deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ronelle Landy (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DTACLOUD-418) Missing href-attribute in JSON output
Date Wed, 16 Jan 2013 20:30:13 GMT

    [ https://issues.apache.org/jira/browse/DTACLOUD-418?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13555423#comment-13555423
] 

Ronelle Landy commented on DTACLOUD-418:
----------------------------------------

With the patch set: http://tracker.deltacloud.org/set/253 applied, I get the following responses
in JSON and XML. Please see the differences listed below the copied output:

JSON output from GET /api/instances/inst2 (mock provider example):

{"instance":
{"id":"inst2","href":"http://ibm-x3550m3-07.lab.eng.brq.redhat.com:3001/api/instances/inst2",
"name":"AnotherInstance",
"state":"RUNNING",
"owner":"anotheruser",
"image":{"href":"http://ibm-x3550m3-07.lab.eng.brq.redhat.com:3001/api/images/img1","id":"img1","rel":"image"},
"realm":{"href":"http://ibm-x3550m3-07.lab.eng.brq.redhat.com:3001/api/realms/us","id":"us","rel":"realm"},
"actions":[
{"href":"http://ibm-x3550m3-07.lab.eng.brq.redhat.com:3001/api/instances/inst2/reboot","rel":"reboot","method":"post"},{"href":"http://ibm-x3550m3-07.lab.eng.brq.redhat.com:3001/api/instances/inst2/stop","rel":"stop","method":"post"}],
"instance_profile":{"id":"m1-large","href":"http://ibm-x3550m3-07.lab.eng.brq.redhat.com:3001/api/hardware_profiles/m1-large","rel":"hardware_profile","properties":{}},
"public_addresses":[{"address":"img1.inst2.public.com","type":"hostname"}],
"private_addresses":[{"address":"img1.inst2.private.com","type":"hostname"}],
"launch_time":null,
"create_image":true,
"storage_volumes":[]}}

XML output from GET /api/instances/inst2 (mock provider example):

<?xml version='1.0' encoding='utf-8' ?>
<instance href='http://ibm-x3550m3-07.lab.eng.brq.redhat.com:3001/api/instances/inst2'
id='inst2'>
  <name>AnotherInstance</name>
  <owner_id>anotheruser</owner_id>
  <image href='http://ibm-x3550m3-07.lab.eng.brq.redhat.com:3001/api/images/img1' id='img1'></image>
  <realm href='http://ibm-x3550m3-07.lab.eng.brq.redhat.com:3001/api/realms/us' id='us'></realm>
  <state>RUNNING</state>
  <hardware_profile href='http://ibm-x3550m3-07.lab.eng.brq.redhat.com:3001/api/hardware_profiles/m1-large'
id='m1-large'>
  </hardware_profile>
  <actions>
    <link href='http://ibm-x3550m3-07.lab.eng.brq.redhat.com:3001/api/instances/inst2/reboot'
method='post' rel='reboot' />
    <link href='http://ibm-x3550m3-07.lab.eng.brq.redhat.com:3001/api/instances/inst2/stop'
method='post' rel='stop' />
    <link href='http://ibm-x3550m3-07.lab.eng.brq.redhat.com:3001/api/instances/inst2/run;id=inst2'
method='post' rel='run' />
    <link href='http://ibm-x3550m3-07.lab.eng.brq.redhat.com:3001/api/images;instance_id=inst2'
method='post' rel='create_image' />
  </actions>
  <public_addresses><address type='hostname'>img1.inst2.public.com</address></public_addresses>
  <private_addresses><address type='hostname'>img1.inst2.private.com</address></private_addresses>
  <storage_volumes></storage_volumes>
  <authentication type='key'>
  </authentication>
</instance>

Differences in information output (JSON vs XML):

 - hardware_profiles (xml) vs instance_profile (json)
 - launch_time and create_time (json only)
 - authentication type (xml only)
 - actions - 4 listed in xml - 2 in json
                
> Missing href-attribute in JSON output
> -------------------------------------
>
>                 Key: DTACLOUD-418
>                 URL: https://issues.apache.org/jira/browse/DTACLOUD-418
>             Project: DeltaCloud
>          Issue Type: Bug
>          Components: Server
>         Environment: Debian 6.0.6, ruby 1.9.2p0, deltacloud development
>            Reporter: Christian Karnath
>            Assignee: Michal Fojtik
>
> The 'href' attribute was present in Deltacloud 1.0.2 but it is missing in the current
development version when specifying JSON as an output format:
> Requesting /api/instances against deltacloud 1.0.2 returned:
> {
>     "instances": {
>         "instance": {
>             "name": null,
>             "owner_id": "mockuser",
>             "image": { … },
>             "realm": { … },
>             "state": "RUNNING",
>             "hardware_profile": { … },
>             "actions": { … },
>             "public_addresses": { … },
>             "private_addresses": { … },
>             "storage_volumes": null,
>             "authentication": { … },
>             "href": "https://192.168.23.101:3001/api/instances/inst0",
>             "id": "inst0"
>         }
>     }
> }
> Requesting /api/instances against deltacloud development version returns:
> {
>     "instances": [
>         {
>             "id": "inst1",
>             "name": "MockUserInstance",
>             "state": "RUNNING",
>             "owner": "mockuser",
>             "image": { … },
>             "realm": { … },
>             "actions": [ … ],
>             "instance_profile": { … },
>             "public_addresses": [ … ],
>             "private_addresses": [ … ],
>             "launch_time": null,
>             "create_image": true,
>             "storage_volumes": [ ]
>         }
>     ]
> }
> It seems that /api/images, /api/realms and so on are also inconsistent with the corresponding
xml representation (which includes the 'href'-attribute).

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message