...
Instructions
Writing CS API Request
Writing CS API Response
API placement and registration
Command placement depends on whether is command is coming as a part of plugin that can be enabled/disabled, or CloudStack core base.
When command comes as a part of CS core base
- Location: The request/response code should be placed in cloud-api package (src/org/apache/cloudstack/api)
- Access permissions: The command's access control permissions (who is eligible to call should be registered in commands.properties.in file
- Command registration: The command should be added to the list of all APIs CS supports, returned by ManagementServerImpl. getCommands()
When command comes as a part of plugin/service
- Location: Define the command (request/response) in the plugin package
- Access Permissions: Define the permissions in the Cmd file, @APICommand annotation, "authorized" field. Example: authorized = {RoleType.Admin})
- Command Registration: Make your plugin manager to extent PluggableService interface. Add new API command to the list of commands returned by
getCommands()