Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Where
<rooturl>: API server web app root url.
<port> : API server web app port.
<entity> : CloudStack entity class, which will be explained below in Object Model section.
<identifier> : Unique identifier for an entity instance, can be uuid, or any other attribute that can uniquely identify a resource.
<opName> : Supported operation name for an entity.

API Server REST vs Cloud-Engine REST

Before discussing CloudStack object model, we would like to make a distinction of two types of REST apis in our system:

  • NorthBound API: REST api provided by api servers to end user.
  • SouthBound API: REST api provided by cloud-engine for CloudStack internal components communication to avoid tight coupling.

Note that although these two types of REST apis will consume the similar REST URL pattern as documented above, supported <entity> and exposed entity information will be different. For NorthBound APIs, we need to pay attention to how much information we want to expose to end users.

CloudStack Object Model

A pre-requisite to come up with a clean REST style API is to build CloudStack Resource Object Model. This object model should have the following information for each CloudStack resource, including those resources directly managed by CloudStack (like VM, volume, network, etc) and those indirectly related resources (like Domain, Account, etc).

  • Accessibilty of this resource entity, is it public to the end user or internal to CloudStack internal? For example, PhysicalNetwork should be a resource not public to end user, so API server should not expose a REST url with PhysicalNetwork as the <entity> in above URL pattern.