Validate server detail list attribute of Nova APIs
This patch adds the JSON schema for Nova V2 & V3 server detail list
APIs response and validate the response with added JSON schema
to block the backward incompatibility change in the future.
The response body of server detail list V2 APIs is below:
{
"servers": [
{
"accessIPv4": "",
"accessIPv6": "",
"addresses": {
"private": [
{
"addr": "%(ip)s",
"version": 4
}
]
},
"created": "%(timestamp)s",
"flavor": {
"id": "1",
"links": [
{
"href": "%(host)s/openstack/flavors/1",
"rel": "bookmark"
}
]
},
"hostId": "%(hostid)s",
"id": "%(id)s",
"image": {
"id": "%(uuid)s",
"links": [
{
"href": "%(host)s/openstack/images/%(uuid)s",
"rel": "bookmark"
}
]
},
"links": [
{
"href": "%(host)s/v2/openstack/servers/%(id)s",
"rel": "self"
},
{
"href": "%(host)s/openstack/servers/%(id)s",
"rel": "bookmark"
}
],
"metadata": {
"My Server Name": "Apache1"
},
"name": "new-server-test",
"progress": 0,
"status": "ACTIVE",
"tenant_id": "openstack",
"updated": "%(timestamp)s",
"user_id": "fake"
}
]
}
The response body of server detail list V3 APIs is below:
{
"servers": [
{
"addresses": {
"private": [
{
"addr": "%(ip)s",
"mac_addr": "aa:bb:cc:dd:ee:ff",
"type": "fixed",
"version": 4
}
]
},
"created": "%(timestamp)s",
"flavor": {
"id": "1",
"links": [
{
"href": "%(host)s/flavors/1",
"rel": "bookmark"
}
]
},
"host_id": "%(hostid)s",
"id": "%(id)s",
"image": {
"id": "%(uuid)s",
"links": [
{
"href": "%(glance_host)s/images/%(uuid)s",
"rel": "bookmark"
}
]
},
"key_name": null,
"links": [
{
"href": "%(host)s/v3/servers/%(uuid)s",
"rel": "self"
},
{
"href": "%(host)s/servers/%(id)s",
"rel": "bookmark"
}
],
"metadata": {
"My Server Name": "Apache1"
},
"name": "new-server-test",
"progress": 0,
"status": "ACTIVE",
"tenant_id": "openstack",
"updated": "%(timestamp)s",
"user_id": "fake"
}
]
}
Partially implements blueprint nova-api-attribute-test
Change-Id: Icafb0470402e59e9df3c81407f57c57b9e719fcb
5 files changed