Cloud Servers and APIs

When you begin writing your own software to interact with Cloud Servers, you might want to learn about how Cloud Servers works in the Cloud Control Panel and how SDKs and APIs are documented at Rackspace.

Cloud Servers API investigation

Using an API, you can write software to automate functions that could otherwise be performed manually by a person logged in to the Cloud Control Panel. You can accelerate your understanding of how the API works by using the Cloud Control Panel to demonstrate the manual process before you begin to automate it; to interact with the Cloud Servers service, the Cloud Control Panel sends requests via the same API that you interact with when you write your own software.

Sometimes, especially for new features that are not yet available in the Cloud Control Panel, you can write software to perform functions using the API that could not be performed in any other way. Product announcements for Limited Availability and Early Access releases point out this limitation when it applies. In that case, experimenting in the Cloud Control Panel can show you only part of the process of working with a new feature; other details are described in the API documentation.

Just as you can use the Cloud Control Panel to help you understand a manual process that you intend to automate, you can use the API documentation to help you understand how to use API operations to automate cloud functions.

The API documentation describes what you can accomplish, how to structure an API operation, and what responses to expect.

After you understand what the Cloud Servers API is capable of, investigate whether the automation you require is already available from another Rackspace product or from a Rackspace partner.

For example:

Good places to investigate relevant capabilities available within the broader Rackspace portfolio include:

Cloud Servers API demonstration

Using the process suggested at Cloud Servers API investigation, this section provides an example of how you can plan and then write your own software to perform one simple task: list all your cloud servers.

Learn about Cloud Servers in the Cloud Control Panel

When you login to the Cloud Control Panel, your session begins with a list of all your servers. By default, the list is unfiltered, showing every server; you can narrow the list by clicking on filters for tag, status, image, flavor, and type.

The Cloud Control Panel lists all of your Cloud Servers.

The Cloud Control Panel lists all of your Cloud Servers.

Note

Because the Cloud Control Panel uses APIs, watching the Cloud Control Panel work can help you learn how to work with APIs.

To see how the Cloud Control Panel gets its information:

  • Launch the Chrome browser.

  • In Chrome, log in to your Cloud Control Panel account.

  • For Mac, from the Chrome menu, select View > Developer > Developer Tools. For Windows, from the Chrome menu, select More tools > Developer Tools.

  • Experiment in the Cloud Control Panel and observe the actions in Chrome’s developer view.

You can use Chrome's developer tools to observe the Cloud Control Panel's API interactions.

You can use Chrome’s developer tools to observe the Cloud Control Panel’s API interactions.

Learn about Cloud Servers in API documentation

In the API documentation, you can see all available API operations for all cloud services. The operations are grouped according to the service they interact with (for example, Cloud Servers or Cloud Files) and the scope they act on (for example, flavors or images).

You can see all Cloud Servers operations in the Cloud Servers API Reference. In the group of Server operations, you can see that:

  • Sending a GET request to the /v2/{tenant_id}/servers URI requests a basic list of information about servers

  • Sending a POST request to the same URI requests the creation of a new server

  • Sending a GET request to the same URI and appending /detail requests an expanded list of information about servers

The request parameters and sample response shown here can help you formulate a basic list servers request to the API and understand the API’s response.

You can use request parameters to construct a request that returns a list of only the Cloud Servers that meet specific criteria. In the sample response, the request parameters named status, image, and flavor correspond to the filters available on the Cloud Control Panel.

In the Getting Started Guide for Cloud Servers - Create your first server, you can follow a 3-step tutorial to perform an essential task: create a cloud server. The Getting Started Guide begins with instructions on creating a Rackspace account and walks you through basic server and network operations. An intermediate step shows an example with the cURL command-line interface (CLI) for Listing servers (cURL).