- Frequently Asked Questions (FAQ)
- Why are the block storage related management methods located in the compute API?
- What are the extension methods and arguments?
- How do I test if provider credentials are valid?
- I want do add a new provider driver what should I do?
- I want to add / propose a new API, what should I do?
- How do I obtain Libcloud version?
Frequently Asked Questions (FAQ)
Why are the block storage related management methods located in the compute API?
Block storage related management methods are located in the compute API becausein most cases block storage API is tightly coupled with the compute API meaningthat you can’t manage block storage independent of the compute API.
This also makes sense because in most cases you are only interested in attachingor detaching volumes from and to the compute nodes.
What are the extension methods and arguments?
Libcloud acts as a lowest common denominator and exposes a unified base APIwhich allows you to work with many different cloud providers through a singlecode base.
Being a lowest common denominator by definition means that not all of thefunctionality offered by different cloud service providers is availablethrough a base API.
Libcloud solves this problem and allows user to access provider specificfunctionality through a so called extension methods and arguments. Extensionmethods and arguments are all the methods and arguments which are prefixedwith ex_
.
Extension methods are there for your convenience, but you should be carefulwhen you use them because they make switching or working with multipleproviders harder.
How do I test if provider credentials are valid?
Libcloud makes the whole authentication process transparent to the user. Assuch, the easiest way to check if provider credentials are valid is byinstantiating a driver and calling a method which results in an HTTP call.
If the credentials are valid, method will return a result, otherwiselibcloud.common.types.InvalidCredsError
exception will be thrown.
An example of such method islibcloud.compute.base.NodeDriver.list_nodes()
. Keep in mind that dependingon the account state, list_nodes method might return a lot of data.
If you want to avoid unnecessarily fetching a lot of data, you should find amethod specific to your provider which issues a request which results in smallamount of data being retrieved.
I want do add a new provider driver what should I do?
For now the best thing to do is to look at an existing driver and test casesfor examples.
Libcloud currently supports more than 60 different providers. This means wehave a broad range of examples of different APIs and authentication methods.APIs range from simple JSON based REST APIs to SOAP APIs. Authenticationmethods range from simple shared token and digest auth to HMAC signed requests.
I want to add / propose a new API, what should I do?
We are always open to accepting a now top level API as long as it matches thefollowing criteria:
- API must be indented to manage an online infrastructure oriented Cloudservice
- Similar service is offered by multiple providers
- It’s possible to build a common API on top of services provided by differentservicesLibcloud can be used with many different providers and acts as a lowest commondenominator which makes the last point most important one. Sometimes it doesn’tmake sense to build a common Libcloud API even if multiple providers offer asimilar service. Usually the case is that the APIs are vastly different andthere aren’t enough common points which would allow us to build across-provider API which would still provide enough value to the end user.
If the API matches the criteria defined above, you should send a proposal toour mailing list where we can discuss it further.Ideally, the proposal should also contain a prototype of a driver for at leasttwo different providers. This helps us make sure that the API you have designedis not biased towards a single provider.
How do I obtain Libcloud version?
You can obtain currently active Libcloud version by accessing thelibcloud.version
variable.
Example #1 (command line):
- python -c "import libcloud ; print libcloud.__version__"
Example #2 (code):
- import libcloud
- libcloud.__version__