test json output

This commit is contained in:
Dmitri Babaev 2011-04-08 22:29:41 +04:00 committed by Dmitri Babaev
parent 8fb5ec9555
commit f8afe3860b
3 changed files with 112 additions and 38 deletions

View File

@ -36,12 +36,12 @@ public class _NovaClient {
TemplateOptions options = new TemplateOptions();
//options.authorizePublicKey("");
Template template = cs.templateBuilder().hardwareId("m1.small").imageId("13").options(options).build();
/*try {
cs.runNodesWithTag("test", 1, template);
} catch (RunNodesException e) {
e.printStackTrace();
}*/
//Template template = cs.templateBuilder().hardwareId("m1.small").imageId("13").options(options).build();
//try {
// cs.runNodesWithTag("test", 1, template);
//} catch (RunNodesException e) {
// e.printStackTrace();
//}
//System.out.println(cs.listNodes());
//System.out.println(cs.listImages());

View File

@ -1,12 +1,46 @@
{
"images" : [
{
"id" : 2,
"name" : "CentOS 5.2"
},
{
"id" : 743,
"name" : "My Server Backup"
}
]
"images" : {
"values" : [
{
"id" : 1,
"name" : "CentOS 5.2",
"links": [
{
"rel" : "self",
"href" : "http://servers.api.openstack.org/v1.1/1234/images/1"
},
{
"rel" : "bookmark",
"type" : "application/vnd.openstack.compute-v1.1+xml",
"href" : "http://servers.api.openstack.org/1234/images/1"
},
{
"rel" : "bookmark",
"type" : "application/vnd.openstack.compute-v1.1+json",
"href" : "http://servers.api.openstack.org/1234/images/1"
}
]
},
{
"id" : 743,
"name" : "My Server Backup",
"links": [
{
"rel" : "self",
"href" : "http://servers.api.openstack.org/v1.1/1234/images/743"
},
{
"rel" : "bookmark",
"type" : "application/vnd.openstack.compute-v1.1+xml",
"href" : "http://servers.api.openstack.org/1234/images/743"
},
{
"rel" : "bookmark",
"type" : "application/vnd.openstack.compute-v1.1+json",
"href" : "http://servers.api.openstack.org/1234/images/743"
}
]
}
]
}
}

View File

@ -1,20 +1,60 @@
{
"images" : [
{
"id" : 2,
"name" : "CentOS 5.2",
"updated" : "2010-10-10T12:00:00Z",
"created" : "2010-08-10T12:00:00Z",
"status" : "ACTIVE"
},
{
"id" : 743,
"name" : "My Server Backup",
"serverId" : 12,
"updated" : "2010-10-10T12:00:00Z",
"created" : "2009-07-07T09:56:16-05:00",
"status" : "SAVING",
"progress" : 80
}
]
"images" : {
"values" : [
{
"id" : 1,
"name" : "CentOS 5.2",
"updated" : "2010-10-10T12:00:00Z",
"created" : "2010-08-10T12:00:00Z",
"status" : "ACTIVE",
"metadata" : {
"values" : {
"ImageType" : "Gold",
"ImageVersion" : "1.5"
}
},
"links": [
{
"rel" : "self",
"href" : "http://servers.api.openstack.org/v1.1/1234/images/1"
},
{
"rel" : "bookmark",
"type" : "application/vnd.openstack.compute-v1.1+xml",
"href" : "http://servers.api.openstack.org/1234/images/1"
},
{
"rel" : "bookmark",
"type" : "application/vnd.openstack.compute-v1.1+json",
"href" : "http://servers.api.openstack.org/1234/images/1"
}
]
},
{
"id" : 743,
"name" : "My Server Backup",
"serverRef" : "http://servers.api.openstack.org/v1.1/1234/servers/12",
"updated" : "2010-10-10T12:00:00Z",
"created" : "2010-08-10T12:00:00Z",
"status" : "SAVING",
"progress" : 80,
"links": [
{
"rel" : "self",
"href" : "http://servers.api.openstack.org/v1.1/1234/images/743"
},
{
"rel" : "bookmark",
"type" : "application/vnd.openstack.compute-v1.1+xml",
"href" : "http://servers.api.openstack.org/1234/images/743"
},
{
"rel" : "bookmark",
"type" : "application/vnd.openstack.compute-v1.1+json",
"href" : "http://servers.api.openstack.org/1234/images/743"
}
]
}
]
}
}