You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Starting 4.1, everything that provides an API in CloudStack is a PluggableService. This means all APIs exposed by plugins such as ACL, network, hypervisors and even ManagementServer is a PluggableService, and all PluggableService expose an interface "getCommands()" which returns a list of api cmd classes.

How to write an API:

  1. Write a command class which would process an incoming request. Please see existing APIs, the API annotation wiki on how to write an API command class.
  1. Next, configure the API access via commands.properties.in where you would set role based API ACL.
  1. Lastly, create a service which extends PluggableService and in its implementation's getCommands() add your API cmd class. In case you're adding an API to CloudStack server itself, add your API in ManagementServerImpl's getCommands() list of APIs.
  1. Test with cloudmonkey, curl or your browser!
  • No labels