0

I need to generate reference/reflection/schema classes in java for the Openstack's response of ReST API.

For example I am using API to get list of servers as : v2/{tenant_id}/servers/detail and here is my response :-

{
    "servers": [
        {
            "status": "ACTIVE",
            "updated": "2014-07-11T11:29:58Z",
            "hostId": "872e9b93ccd50b93612d49f4c371f49fe6365f02bcb51994868eb88f",
            "OS-EXT-SRV-ATTR:host": "controller",
            "addresses": {
                "officenet": [
                    {
                        "OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:c8:52:41",
                        "version": 4,
                        "addr": "10.43.1.182",
                        "OS-EXT-IPS:type": "fixed"
                    }
                ]
            },
            "links": [
                {
                    "href": "http://10.43.1.197:8774/v2/1333f00f05564a02b3c4f608b9622fc9/servers/bbadfe78-c6eb-48ce-a51b-c26617a812ba",
                    "rel": "self"
                },
                {
                    "href": "http://10.43.1.197:8774/1333f00f05564a02b3c4f608b9622fc9/servers/bbadfe78-c6eb-48ce-a51b-c26617a812ba",
                    "rel": "bookmark"
                }
            ],
            "key_name": null,
            "image": {
                "id": "b724ae53-9113-4e33-987a-f58fd9a4ec81",
                "links": [
                    {
                        "href": "http://10.43.1.197:8774/1333f00f05564a02b3c4f608b9622fc9/images/b724ae53-9113-4e33-987a-f58fd9a4ec81",
                        "rel": "bookmark"
                    }
                ]
            },
            "OS-EXT-STS:task_state": null,
            "OS-EXT-STS:vm_state": "active",
            "OS-EXT-SRV-ATTR:instance_name": "instance-00000016",
            "OS-SRV-USG:launched_at": "2014-07-11T11:29:58.000000",
            "OS-EXT-SRV-ATTR:hypervisor_hostname": "controller",
            "flavor": {
                "id": "1",
                "links": [
                    {
                        "href": "http://10.43.1.197:8774/1333f00f05564a02b3c4f608b9622fc9/flavors/1",
                        "rel": "bookmark"
                    }
                ]
            },
            "id": "bbadfe78-c6eb-48ce-a51b-c26617a812ba",
            "security_groups": [
                {
                    "name": "default"
                }
            ],
            "OS-SRV-USG:terminated_at": null,
            "OS-EXT-AZ:availability_zone": "nova",
            "user_id": "a859477b42794e8fa6dbf339361bb268",
            "name": "AKshay-DebianInstance 1",
            "created": "2014-07-11T11:29:53Z",
            "tenant_id": "1333f00f05564a02b3c4f608b9622fc9",
            "OS-DCF:diskConfig": "MANUAL",
            "os-extended-volumes:volumes_attached": [],
            "accessIPv4": "",
            "accessIPv6": "",
            "progress": 0,
            "OS-EXT-STS:power_state": 1,
            "config_drive": "",
            "metadata": {}
        }
    ]
}

How Do I get a generalized schema of this JSON and similar JSONs for corresponding APIs. I searched on Openstack docs but its only about Image service JSON schema available. Also, searched on Google about it, but in vain.

[Edit]: I can get http://docs.openstack.org/api/openstack-image-service/2.0/content/get-images-schema.html , API for that is v2/schemas/images. How do I get Compute and Networking related schema ?

Akshay Patil
  • 954
  • 1
  • 12
  • 28

1 Answers1

1

They're not JSON schemas but you could process the OpenStack WADLs instead for what you need to do.

Everett Toews
  • 10,337
  • 10
  • 44
  • 45