Check show_hypervisor attributes of Nova V2/V3 API

This patch adds the JSON Schema for response of Nova V2 & V3
show hypervisor detail API and validate the response with added
JSON Schema to block the backward incompatibility change in the future.

The response body of V2 show hypervisor detail API is below:

{
    "hypervisor": {
        "cpu_info": "?",
        "current_workload": 0,
        "disk_available_least": 0,
        "host_ip": "%(ip)s",
        "free_disk_gb": 1028,
        "free_ram_mb": 7680,
        "hypervisor_hostname": "fake-mini",
        "hypervisor_type": "fake",
        "hypervisor_version": 1,
        "id": %(hypervisor_id)s,
        "local_gb": 1028,
        "local_gb_used": 0,
        "memory_mb": 8192,
        "memory_mb_used": 512,
        "running_vms": 0,
        "service": {
            "host": "%(host_name)s",
            "id": 2
        },
        "vcpus": 1,
        "vcpus_used": 0
    }
}

The response body of V3 show hypervisor detail API is below:

{
    "hypervisor": {
        "cpu_info": "?",
        "current_workload": 0,
        "disk_available_least": 0,
        "host_ip": "%(ip)s",
        "free_disk_gb": 1028,
        "free_ram_mb": 7680,
        "hypervisor_hostname": "fake-mini",
        "hypervisor_type": "fake",
        "hypervisor_version": 1,
        "id": %(hypervisor_id)s,
        "local_gb": 1028,
        "local_gb_used": 0,
        "memory_mb": 8192,
        "memory_mb_used": 512,
        "running_vms": 0,
        "service": {
            "host": "%(host_name)s",
            "id": 2
        },
        "vcpus": 1,
        "vcpus_used": 0,
        "os-pci:pci_stats": []
    }
}

Partially implements blueprint nova-api-attribute-test

Change-Id: I68735a50c2d54893862838fd651794e1184eb53a
4 files changed