You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by Michal Fojtik <mf...@redhat.com> on 2013/01/02 11:23:17 UTC
Re: Java REST Client
On 12/31, Dario Garcia Gasulla wrote:
> Thanks Andre and Mario, your explanations were quite useful.
> The approach you use to create and manage instances is quite simple and
> intuitive (much better than what I was trying to do).
>
> I found one more problem, I'll tell you about it to see if you know what
> I'm doing wrong:
>
> When launching an instance
>
> / instance = client.createInstance(image.getId());/
>
> there's no way to specify the pem key the instance is supposed to
> accept. The second create method does not accept key id either:
>
> /createInstance(String name, String imageId, String profileId,
> String realmId, String memory, String storage)/
>
> Unfortunately, if the key is not provided on launch time, the instance
> will only be accessible through <user,pass> (says Amazon).
> I've tried to set it before and then launch it:/
> instance.setKeyId("pem_key_file");
> // instance = client.createInstance(image.getId());/
>
The 'key' in Deltacloud is specified by 'keyname' parameter during
'create_instance' operation. The naming of this parameter is a bit
ambiguous because the 'key id' is actually require here.
To use this 'key' you first need to 'create' one under /api/keys
collection or use one of the already created id's.
The PEM is returned in response of the 'key' creation. Then you can
use this 'key' when creating a new instance. The using that PEM you
should be able to connected to the instance.
Hope that helps :-)
-- Michal
--
Michal Fojtik <mf...@redhat.com>
Deltacloud API, CloudForms
Re: Java REST Client
Posted by Dario Garcia Gasulla <da...@lsi.upc.edu>.
El 04/01/13 13:23, Dario Garcia Gasulla escribió:
> El 02/01/13 11:23, Michal Fojtik escribió:
>> On 12/31, Dario Garcia Gasulla wrote:
>>> Thanks Andre and Mario, your explanations were quite useful.
>>> The approach you use to create and manage instances is quite simple and
>>> intuitive (much better than what I was trying to do).
>>>
>>> I found one more problem, I'll tell you about it to see if you know what
>>> I'm doing wrong:
>>>
>>> When launching an instance
>>>
>>> / instance = client.createInstance(image.getId());/
>>>
>>> there's no way to specify the pem key the instance is supposed to
>>> accept. The second create method does not accept key id either:
>>>
>>> /createInstance(String name, String imageId, String profileId,
>>> String realmId, String memory, String storage)/
>>>
>>> Unfortunately, if the key is not provided on launch time, the instance
>>> will only be accessible through <user,pass> (says Amazon).
>>> I've tried to set it before and then launch it:/
>>> instance.setKeyId("pem_key_file");
>>> // instance = client.createInstance(image.getId());/
>>>
>> The 'key' in Deltacloud is specified by 'keyname' parameter during
>> 'create_instance' operation. The naming of this parameter is a bit
>> ambiguous because the 'key id' is actually require here.
>>
>> To use this 'key' you first need to 'create' one under /api/keys
>> collection or use one of the already created id's.
>>
>> The PEM is returned in response of the 'key' creation. Then you can
>> use this 'key' when creating a new instance. The using that PEM you
>> should be able to connected to the instance.
>>
>> Hope that helps :-)
>>
>> -- Michal
>>
> Thanks a lot Michal, I used the method:
>
> DeltaCloudClient.createInstance(String name, String imageId, String
> profileId, String realmId, String keyname, String memory, String storage)
>
> And I passed only the first three parameters plus the keyname. If I did
> not pass some of those I got an exception for null parameter. I tried to
> reduce the number of parameters to see which ones could be left "by
> default" just in case I do not have that information available. It works
> perfectly.
>
> The following question is about the design of the library. I've noticed
> that many methods (e.g., getImage) are available for both
> DeltaCloudConnectionManager and it's object DeltaCloudClient. In most
> cases both seem to return the same values. So I wondered, why such
> replication? From my point of view the client should be in charge of
> performing actions on the provider, but maybe I'm misunderstanding their
> purposes. In which cases should one be used instead of the other?
>
Ok, forget this. DeltaCloudConnectionManager is a class developed by a
workmate which uses the DeltaCloudClient.
Sorry for the misunderstanding. I feel stupid now.
Re: Java REST Client
Posted by Dario Garcia Gasulla <da...@lsi.upc.edu>.
El 02/01/13 11:23, Michal Fojtik escribió:
> On 12/31, Dario Garcia Gasulla wrote:
>> Thanks Andre and Mario, your explanations were quite useful.
>> The approach you use to create and manage instances is quite simple and
>> intuitive (much better than what I was trying to do).
>>
>> I found one more problem, I'll tell you about it to see if you know what
>> I'm doing wrong:
>>
>> When launching an instance
>>
>> / instance = client.createInstance(image.getId());/
>>
>> there's no way to specify the pem key the instance is supposed to
>> accept. The second create method does not accept key id either:
>>
>> /createInstance(String name, String imageId, String profileId,
>> String realmId, String memory, String storage)/
>>
>> Unfortunately, if the key is not provided on launch time, the instance
>> will only be accessible through <user,pass> (says Amazon).
>> I've tried to set it before and then launch it:/
>> instance.setKeyId("pem_key_file");
>> // instance = client.createInstance(image.getId());/
>>
> The 'key' in Deltacloud is specified by 'keyname' parameter during
> 'create_instance' operation. The naming of this parameter is a bit
> ambiguous because the 'key id' is actually require here.
>
> To use this 'key' you first need to 'create' one under /api/keys
> collection or use one of the already created id's.
>
> The PEM is returned in response of the 'key' creation. Then you can
> use this 'key' when creating a new instance. The using that PEM you
> should be able to connected to the instance.
>
> Hope that helps :-)
>
> -- Michal
>
Thanks a lot Michal, I used the method:
DeltaCloudClient.createInstance(String name, String imageId, String
profileId, String realmId, String keyname, String memory, String storage)
And I passed only the first three parameters plus the keyname. If I did
not pass some of those I got an exception for null parameter. I tried to
reduce the number of parameters to see which ones could be left "by
default" just in case I do not have that information available. It works
perfectly.
The following question is about the design of the library. I've noticed
that many methods (e.g., getImage) are available for both
DeltaCloudConnectionManager and it's object DeltaCloudClient. In most
cases both seem to return the same values. So I wondered, why such
replication? From my point of view the client should be in charge of
performing actions on the provider, but maybe I'm misunderstanding their
purposes. In which cases should one be used instead of the other?