The ComputeService is what we call an "abstraction view". It is just a view
over the underlying api (determined by the given provider, nova in this
case) with a generic interface that is portable across clouds.

If you code against the ComputeService interface, the code will also be
valid for other providers such as aws-ec2, with very minimal changes.

You have the choice, however, to directly use the provider specific api to
take advantage of concrete features of the provider. It's your choice!

Note that you can combine both: do as much as you can with the
ComputeService and concrete things with the provider api (the
ComputeServiceContext provides the "unwrap" methods to get the underlying
api without having to create a new context).

HTH!

I.
El 31/07/2013 00:42, "Personal" <[email protected]> escribió:

> If it meets your needs prefer ComputeServiceContext as it is more generic,
> it will not have as many features as the NovaAPI
>
> On Jul 30, 2013, at 3:36 PM, Bk Lau <[email protected]> wrote:
>
> I'm a little confused by examples per jcloud 1.6.1
>
>  NovaApi nova = ContextBuilder.newBuilder(provider)
>                 .endpoint("http://172.16.0.1:5000/v2.0/";)
>                 .credentials(identity, password)
>                 .buildApi(NovaApi.class);
>
>           versus
>
>  ComputeServiceContext context=ContextBuilder.newBuilder(provider)
>              .endpoint("http://172.16.0.1:5000/v2.0/";)
> .credentials(identity, password)
> .buildView(ComputeServiceContext.class);
>
>
> So which one to use?
>
>
>

Reply via email to