You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by André Dietisheim <an...@gmail.com> on 2011/05/26 00:39:02 UTC

why do instance details differ when requesting single instance/all instances?

Hi guys

I just stumbled upon a change that must have been applied to the REST 
API btw. 0.1.2 and 0.3:

If you request the full listing of all running instances, you will not 
get the authentication bits that was used to create the instance. If you 
list a single instance you would get it:

* listing all instances:

<instances>
   <instance  href='http://localhost:3001/api/instances/inst1  <view-source:http://localhost:3001/api/instances/inst1>'id='inst1'>
     <name>ddd</name>
     <owner_id>mockuser</owner_id>
     <image  href='http://localhost:3001/api/images/img1  <view-source:http://localhost:3001/api/images/img1>'id='img1'></image>
     <realm  href='http://localhost:3001/api/realms/us  <view-source:http://localhost:3001/api/realms/us>'id='us'></realm>
     <state>RUNNING</state>

     <hardware_profile  href='http://localhost:3001/api/hardware_profiles/m1-xlarge  <view-source:http://localhost:3001/api/hardware_profiles/m1-xlarge>'id='m1-xlarge'>
     </hardware_profile>
     <actions>
       <link  href='http://localhost:3001/api/instances/inst1/reboot  <view-source:http://localhost:3001/api/instances/inst1/reboot>'method='post'rel='reboot'/>
       <link  href='http://localhost:3001/api/instances/inst1/stop  <view-source:http://localhost:3001/api/instances/inst1/stop>'method='post'rel='stop'/>
     </actions>
     <public_addresses>
       <address>img1.inst1.public.com</address>

     </public_addresses>
     <private_addresses>
       <address>img1.inst1.private.com</address>
     </private_addresses>
   </instance>

* listing a single instance:

<instance  href='http://localhost:3001/api/instances/inst1  <view-source:http://localhost:3001/api/instances/inst1>'id='inst1'>
   <name>ddd</name>
   <owner_id>mockuser</owner_id>
   <image  href='http://localhost:3001/api/images/img1  <view-source:http://localhost:3001/api/images/img1>'id='img1'></image>
   <realm  href='http://localhost:3001/api/realms/us  <view-source:http://localhost:3001/api/realms/us>'id='us'></realm>
   <state>RUNNING</state>
   <hardware_profile  href='http://localhost:3001/api/hardware_profiles/m1-xlarge  <view-source:http://localhost:3001/api/hardware_profiles/m1-xlarge>'id='m1-xlarge'>

   </hardware_profile>
   <actions>
     <link  href='http://localhost:3001/api/instances/inst1/reboot  <view-source:http://localhost:3001/api/instances/inst1/reboot>'method='post'rel='reboot'/>
     <link  href='http://localhost:3001/api/instances/inst1/stop  <view-source:http://localhost:3001/api/instances/inst1/stop>'method='post'rel='stop'/>
   </actions>
   <public_addresses>
     <address>img1.inst1.public.com</address>
   </public_addresses>

   <private_addresses>
     <address>img1.inst1.private.com</address>
   </private_addresses>
   <authentication  type='key'>
     <login>
       <keyname></keyname>
     </login>
   </authentication>

</instance>

Is there any reason behind the fact that you ommit the authentication 
bits when listing all instances or is it a bug? Or do I miss something?

Thanks
/André

Re: why do instance details differ when requesting single instance/all instances?

Posted by "marios@redhat.com" <ma...@redhat.com>.
On 26/05/11 20:37, Chris Lalancette wrote:
> On 05/26/11 - 12:39:02AM, André Dietisheim wrote:
>> Hi guys
>>
>> I just stumbled upon a change that must have been applied to the
>> REST API btw. 0.1.2 and 0.3:
>>
>> If you request the full listing of all running instances, you will
>> not get the authentication bits that was used to create the
>> instance. If you list a single instance you would get it:
>
> I've noticed 2 things when playing around with this:
>
> 1)  As you say, listing an instance one at a time vs. listing them all together
> does show different data.  In fact, if you look at the view code, you will see
> that there are a number of pieces of information that you can get from the
> single instance lookup that you can't get from the "all instances" lookup.
> It has been mentioned to me in the past that some of this might be intentional;
> that is, not all cloud providers provide rich enough detail in their "list
> instances" view to fully populate that view.
correct

  However, it would seem to me that
> *if* that data is available in the full view, we should provide it.  Does
> anyone else have an opinion here?

for ec2, there is no differentiation in the 'def instances' method 
between listing only a single instance or all instances (i.e. filter_on 
does the work here).
Thus I also added changes to the 'index' (all instances) xml listing to 
show the password/key info if present. Also, the info wasn't displayed 
at all for the 'show' html listing, so added there too.

marios

>
> 2)  For EC2, at least, even if you do look up the single instance view, the
> authentication data is empty.  I think this one is just a bug; I'll post a
> patch for it shortly.
>


Re: why do instance details differ when requesting single instance/all instances?

Posted by André Dietisheim <an...@gmail.com>.
Hi Chris

thanks a lot for playing around and for the exhaustive answer.

On 05/26/2011 07:37 PM, Chris Lalancette wrote:
> 1)  As you say, listing an instance one at a time vs. listing them all together
> does show different data.  In fact, if you look at the view code, you will see
> that there are a number of pieces of information that you can get from the
> single instance lookup that you can't get from the "all instances" lookup.
> It has been mentioned to me in the past that some of this might be intentional;
> that is, not all cloud providers provide rich enough detail in their "list
> instances" view to fully populate that view.  However, it would seem to me that
> *if* that data is available in the full view, we should provide it.  Does
> anyone else have an opinion here?

ok, that pretty much matches what I knew from prior version and what I 
would have expected. In JBoss Tools we therefore tried to dispaly only 
what we were told was available for all cloud drivers.

> 2)  For EC2, at least, even if you do look up the single instance view, the
> authentication data is empty.  I think this one is just a bug; I'll post a
> patch for it shortly.

great! should I open an issue in jira so that other which would have 
spotted the bug know?

Thanks
/André



Re: why do instance details differ when requesting single instance/all instances?

Posted by Chris Lalancette <cl...@redhat.com>.
On 05/26/11 - 12:39:02AM, André Dietisheim wrote:
> Hi guys
> 
> I just stumbled upon a change that must have been applied to the
> REST API btw. 0.1.2 and 0.3:
> 
> If you request the full listing of all running instances, you will
> not get the authentication bits that was used to create the
> instance. If you list a single instance you would get it:

I've noticed 2 things when playing around with this:

1)  As you say, listing an instance one at a time vs. listing them all together
does show different data.  In fact, if you look at the view code, you will see
that there are a number of pieces of information that you can get from the
single instance lookup that you can't get from the "all instances" lookup.
It has been mentioned to me in the past that some of this might be intentional;
that is, not all cloud providers provide rich enough detail in their "list
instances" view to fully populate that view.  However, it would seem to me that
*if* that data is available in the full view, we should provide it.  Does
anyone else have an opinion here?

2)  For EC2, at least, even if you do look up the single instance view, the
authentication data is empty.  I think this one is just a bug; I'll post a
patch for it shortly.

-- 
Chris Lalancette