Kawan:

Seems that the "View" is a high-level abstraction that is "common" to all
providers i.e. a baseline to promote portability.
It also provides some convienient methods like runScripts...
OTOH, the richness of the full OpenStack NOVA API can only be accessed via
NovaApi.
So  I guess for Nova-specific features use NovaApi and use ComputeService
to use features "common" to all.
That's how its supposed to work as pointed out to me.



On Wed, Jul 31, 2013 at 2:17 PM, Kavan Patil <kavan.pa...@gmail.com> wrote:

> I am no JClouds expert but :
>
> I tend to use this (and seems like this is encouraged):
>
> -------------
>         NovaApi api =
>                 ContextBuilder.newBuilder(...)
>                  .credentials(...)
>                  .endpoint(...)
>                  .buildApi(NovaApi.class);
> ---------------
>
> than this:
>
> ---------------
>
> ctx=ContextBuilder.newBuilder(
> "openstack-nova")//
>                 .endpoint("....")//
>                 .credentials("...", "....")//
>                 .buildView(ComputeServiceContext.class);
>
> //RestContext use seems to be discouraged now as i see it is deprecated
> //RestContext<NovaApi, NovaAsyncApi> nova = ctx.unwrap()
> //nova.getApi()... // do something with NovaApi
>
> NovaApi novaApi = ctx.unwrapApi(NovaApi.class);
> ----------------
>
> But I always wanted to know what is the difference between a View and Api?
> Can I have different View other that ComputerServiceContext for a compute
> provider?
>
> Regards,
> Kavan
>
>
> On Wed, Jul 31, 2013 at 11:31 PM, Bk Lau <bklau2...@gmail.com> wrote:
>
>> Zack:
>> Not sure. I haven't got a Rackspace account to try it out yet.
>>
>>
>> On Wed, Jul 31, 2013 at 12:35 PM, Zack Shoylev <
>> zack.shoy...@rackspace.com> wrote:
>>
>>> I am looking at the examples I use (
>>> https://github.com/jclouds/jclouds-examples/blob/master/rackspace/src/main/java/org/jclouds/examples/rackspace/cloudservers/CreateServer.java#L83)
>>> Seems your code is about the same, any issues with it?
>>>
>>>
>>>
>>> From: Bk Lau [mailto:bklau2...@gmail.com]
>>> Sent: Wednesday, July 31, 2013 10:11 AM
>>> To: user@jclouds.incubator.apache.org
>>> Subject: NovaComputeService
>>>
>>> Hi:
>>> Is NovaComputeService currently intended to be used as below?
>>>
>>> ctx=ContextBuilder.newBuilder("openstack-nova")//
>>>                 .endpoint("....")//
>>>                 .credentials("...", "....")//
>>>                 .buildView(ComputeServiceContext.class);
>>>    NovaComputeService s=(NovaComputeService)ctx.getComputeService();
>>> Thanks,
>>> BK
>>>
>>
>>
>

Reply via email to