Make os-services API extensions consistent.

Updates the os-services API extension so that it is consistent
internally (index and update return similar formats), and so
that it works with the recent novaclient code which sends
the following request body format:

  {"binary": "nova-cert", "host": "nova1"}

Also, updates the response body format of the update call so that it
wraps things in an extra service dict which should make novaclient
happier here as well (and is consistent with other extensions too).

Fixes LP Bug #1147746.

Change-Id: I932160d64fdd3aaeb2ed90a092ecc7a36dcc9665
This commit is contained in:
Dan Prince
2013-03-05 16:17:29 -05:00
parent 0c77dae2a0
commit d6999b7788
4 changed files with 15 additions and 11 deletions

View File

@@ -1,4 +1,4 @@
{
"host": "host1",
"service": "nova-compute"
}
"binary": "nova-compute"
}

View File

@@ -1,5 +1,7 @@
{
"disabled": true,
"host": "host1",
"service": "nova-compute"
}
"service": {
"host": "host1",
"binary": "nova-compute",
"status": "disabled"
}
}

View File

@@ -1,5 +1,7 @@
{
"disabled": false,
"host": "host1",
"service": "nova-compute"
}
"service": {
"host": "host1",
"binary": "nova-compute",
"status": "enabled"
}
}

View File

@@ -33,4 +33,4 @@
"zone": "nova"
}
]
}
}