[MUSIC] Many administrators running IBM PowerVC are interested in understanding how to query the software from an external source to either export or import data into PowerVC. This is because an enterprise data center can typically be using several products from several vendors to manage their infrastructure. So, the ability to export data from PowerVC to other software, such as for logging or monitoring purposes, is much desired. In this section will take a look at how the REST API of IBM PowerVC can be used to perform some tasks. IBM PowerVC provides three types of APIs. They're open stack APIs, IBM PowerVC extensions to the open stack APIs, and IBM PowerVC only APIs. Supported OpenStack APIs are a subset of the APIs provided by OpenStack, and can be used with IBM PowerVC without any modifications. Extended OpenStack APIs are a subset of the APIs provided by OpenStack, but their functions are extended by the IBM PowerVC development team. And finally the IBM PowerVC APIs are exclusively developed by IBM to work with the IBM power environment. IBM PowerVC APIs are restful HTTP services. The defined REST APIs of our product provide amazing infrastructure as a service, or REST based services. These APIs are called northbound APIs because conceptually, the lower level details within the software can be accessed by higher level clients. A higher level clients can be a fully fledged product like a cloud management application, or simple client developed scripts or applications. I've spoken with several users of this private cloud product, an they've expressed interest in understanding how they can use another vendors product to manage IBM power systems by interacting with IBM PowerVC. That's where REST APIs help and come into play. So, how does it work? Simply put, we can breakdown its operation into two big steps. The first step is when the client initiates a request to the server using HTTP, and via the defined REST API commands. The second step is when the server then processes the request an returns a response in an expected format. So, what does REST mean? These APIs are implemented by using a representational state transfer, more easily described as REST architecture. It's an architecture that uses a client server model to provide access to web based services. Basically, it's a commonly accepted format to provide interoperability between computer systems on the Internet. In the diagram shown here, interacting with IBM PowerVC using REST APIs, requires the user or application to send the request using an HTTP server. Some APIs can be publicly accessible and required no authentication. Most of the APIs require the use of an authentication token. So first the user or application can receive a token by making an authentication request. That's the first line shown here. Then that request is handled by the OpenStack Keystone service, and sent back to the user. Once the user or application has a token, the token can be stored and used again in requests that require a token ID. I told you about placing the first authentication requests, so how do we do that? Well, there are several methods. One easy way is to use the command line to make that request. To do that, we use the curl command. The main components of the command method for which we use post in this example, protocol for which we use HTTPS. Universal resource locator or URL shown here as ring 3 Keystone API Universal Resource Identifier header information. Except application/json, which means that we want the data that is returned in the JavaScript object notation in JSON format. And context type application JSON, which specifies how we are sending the data. And finally body that's minus D which contains keys like project, domain, user ID and password. These are all defined by the API. You'd typically read the API documentation to come up with these keys and values. The next step is getting the response back from the Keystone service. A sample response is shown here. The response is in JSON format and contains several key value pairs, for example, date server and so on. The token that we requested was returned in one such header of the response. Look under the X subject token header. What is returned there is our token. This token is typically valid for a set amount of time, for example for a few hours. The next step is to interact with IBM PowerVC. In this example we are asking for a list of available images on the IBM PowerVC server, again using the curl command. But what is an image? Well, for the purposes of this example, think of an image as a template of a virtual machine. These templates can be stored as images, which are big files, so we want to return a list of available templates currently available in our private cloud. The main components of the command are method get because we want to get some data from the IBM PowerVC server. Protocol of HTTPS as usual, the Universal Resource Locator or the URL shown here is 9.27.25.186. Service port number of 9292 because that's the port number used by the glance service. The glance API URI shown here as /v2/images. The header information that's minus H. The accept application JSON, context type application JSON, and both of these are as we saw earlier, then body minus D. Nothing is past here because the body context is ignored on a get request. If everything went right, the glance endpoint should return something to us. We can see a sample response here. The list of image names are available under the images key inside the JSON response. And this concludes our overview of the procedure to use the REST API commands to get information from the IBM PowerVC server. The development team also publishes a REST API guide. You can read through the guide to look for specific details on any other use cases you can think of. [MUSIC]