how to connect to cloudstack on java platform

2019-09-11 15:59发布

问题:

I have setup cloudstack server completely and want to create a program on the Java platform for control cloudstack by passing by program.

How do I connect with cloudstack?

回答1:

CloudStack provides an API that yo can use to program against. You can find the API reference under: http://cloudstack.apache.org/docs/en-US/Apache_CloudStack/4.0.2/html/API_Developers_Guide/index.html

The API Developers Guide contains also many useful information (e.g. how to bypass authentication for testing): http://cloudstack.apache.org/docs/en-US/Apache_CloudStack/4.0.2/html/API_Developers_Guide/index.html

As for interfaces that make programming against the API easier, I know of:

  • Marvin: A Python testing framework for CloudStack
  • CloudMonkey, already mentioned by @Donal Lafferty: A command line interface for CloudStack
  • jClouds: An interface that supports multiple cloud software including CloudStack

I'm in the process of writing system tests for CloudStack and so far I'm inclined to go for jClouds because it is Java and can be used as client for CloudStack API in my tests.



回答2:

Write a script using CloudMonkey.