I'm looking for an API for service discovery (mainly compute and storage capability) in clouds environments. The API need to be provider-independent. Any suggestion?
It depends on what features you expect from a discovery service (fault tolerance, network scalability, security, reconfigurability, etc.), what type of network (LAN, WAN, ad-hoc, etc.), how much (and how structured) information you need to describe services, and so on. I hope such a survey paper might help http://doc.utwente.nl/54527/1/classification_of_service.pdf although I am confident you can find many other survey on the web. In the past I used DNS-Service Discovery api: the Apple Bonjour service discovery system relies on DNS-SD, although I don't not if this technology fits your requirements.
You should keep in mind that most public clouds today do not allow for broadcast or multicast communication. Hence, any service that relies on one or both of them will not work (out of the box).