Verify create/get flavor attributes of Nova APIs

This patch adds the JSON schema for Nova V2/V3 create & get flavor
APIs response and validate the response with added JSON schema to
block the backward incompatibility change in the future.

The response body of V2 create & get flavor API is below:

{
    "flavor": {
        "name": "m1.tiny",
        "links": [
            {
                "href": "http://openstack.example.com/
                        v2/openstack/flavors/1",
                "rel": "self"
            },
            {
                "href": "http://openstack.example.com/
                        openstack/flavors/1",
                "rel": "bookmark"
            }
        ],
        "ram": 512,
        "vcpus": 1,
        "swap": "",
        "disk": 1,
        "id": "1",
        "OS-FLV-DISABLED:disabled": false,
        "os-flavor-access:is_public": true,
        "rxtx_factor": 1.0,
        "OS-FLV-EXT-DATA:ephemeral": 0
    }
}

The response body of V3 create & get flavor API is below:

{
    "flavor": {
        "name": "m1.tiny",
        "links": [
            {
                "href": "http://openstack.example.com/
                         v3/openstack/flavors/1",
                "rel": "self"
            },
            {
                "href": "http://openstack.example.com/
                        openstack/flavors/1",
                "rel": "bookmark"
            }
        ],
        "ram": 512,
        "vcpus": 1,
        "swap": 0,
        "disk": 1,
        "id": "1",
        "disabled": false,
        "ephemeral": 0,
        "flavor-access:is_public": true,
        "os-flavor-rxtx:rxtx_factor": 1.0
    }
}

Partially implements blueprint nova-api-attribute-test

Change-Id: I57569e315aebd5b712b8635b1f5ad8a768d77592
5 files changed