[cc-ing the deltacloud-dev list]
On 14/01/13 20:19, Christian Karnath wrote:
> Hi Marios,
>
> Thank you for your efforts. I will test your monkey patch and get back to you
> asap.
>
> I don't know whether it is a bug or a new feature so I'd like to ask you
> first, before opening a new ticket for this issue. Deltacloud 1.0.2 included
> the attribute href when requesting /api/instances (or images, realms, hwp,
> etc.) in json http-responses:
>
good question! We recently had some bug reports about the json output
[1][2] and we changed the way the json is generated. With respect to
your question, I'd say it's a bug; for sure the xml and json output
should be consistent with what is included in the respective
serializations. At a guess, the 'href' is missing from the json output
because in xml it's an attribute rather than an enclosed 'tag'; afaik
there is no 'rule' for the conversion of these attributes xml <==> json.
Please do go ahead and file a jira issue so we can resolve this. I guess
the easiest way is to just include the 'href' as an attribute in the
json (i.e. as before):
"instance": {
"href": "https://192.168.23.101:3001/api/instances/inst0",
"id": "inst0"
...
marios
[1] https://issues.apache.org/jira/browse/DTACLOUD-329
[2] https://issues.apache.org/jira/browse/DTACLOUD-354
> {
> "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"
> }
> }
> }
>
> But the current development version is lacking that attribute:
>
> {
> "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": [ ]
> }
> ]
> }
>
> Best regards
> Christian
>
>