summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorNikola Dipanov <ndipanov@redhat.com>2012-09-19 14:45:40 +0200
committerNikola Dipanov <ndipanov@redhat.com>2012-09-20 09:55:01 +0200
commitb456a862ad85578bf4cf8e861be56aa5e728f9f4 (patch)
tree1dde2eb51cf14b7c2c759f63fb0b18a6a72e4db1 /doc
parent59ad151a296c22d8be053e408d9377acebb5ad15 (diff)
Adds API sample testing for rescue API extension
Adds tests and templates for testing of the server rescue API extension. Tests both json and XML API functionality. Change-Id: Icb241e96ebedde0b6385f8ba60eebd0e768f22da
Diffstat (limited to 'doc')
-rw-r--r--doc/api_samples/os-rescue/server-get-resp-rescue.json53
-rw-r--r--doc/api_samples/os-rescue/server-get-resp-rescue.xml19
-rw-r--r--doc/api_samples/os-rescue/server-get-resp-unrescue.json54
-rw-r--r--doc/api_samples/os-rescue/server-get-resp-unrescue.xml19
-rw-r--r--doc/api_samples/os-rescue/server-post-req.json16
-rw-r--r--doc/api_samples/os-rescue/server-post-req.xml19
-rw-r--r--doc/api_samples/os-rescue/server-post-resp.json16
-rw-r--r--doc/api_samples/os-rescue/server-post-resp.xml6
-rw-r--r--doc/api_samples/os-rescue/server-rescue-req.json5
-rw-r--r--doc/api_samples/os-rescue/server-rescue-req.xml3
-rw-r--r--doc/api_samples/os-rescue/server-rescue.json3
-rw-r--r--doc/api_samples/os-rescue/server-rescue.xml2
-rw-r--r--doc/api_samples/os-rescue/server-unrescue-req.json3
-rw-r--r--doc/api_samples/os-rescue/server-unrescue-req.xml2
14 files changed, 220 insertions, 0 deletions
diff --git a/doc/api_samples/os-rescue/server-get-resp-rescue.json b/doc/api_samples/os-rescue/server-get-resp-rescue.json
new file mode 100644
index 000000000..d08191977
--- /dev/null
+++ b/doc/api_samples/os-rescue/server-get-resp-rescue.json
@@ -0,0 +1,53 @@
+{
+ "server": {
+ "accessIPv4": "",
+ "accessIPv6": "",
+ "addresses": {
+ "private": [
+ {
+ "addr": "192.168.0.3",
+ "version": 4
+ }
+ ]
+ },
+ "created": "2012-09-19T09:22:27Z",
+ "flavor": {
+ "id": "1",
+ "links": [
+ {
+ "href": "http://openstack.example.com/openstack/flavors/1",
+ "rel": "bookmark"
+ }
+ ]
+ },
+ "hostId": "c02c15d17499304e9893d9fc41c415f5096f8aa880bc651cac092650",
+ "id": "7e21a264-6cc1-4d90-b7b5-f9f49cec3a85",
+ "image": {
+ "id": "70a599e0-31e7-49b7-b260-868f441e862b",
+ "links": [
+ {
+ "href": "http://openstack.example.com/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b",
+ "rel": "bookmark"
+ }
+ ]
+ },
+ "links": [
+ {
+ "href": "http://openstack.example.com/v2/openstack/servers/7e21a264-6cc1-4d90-b7b5-f9f49cec3a85",
+ "rel": "self"
+ },
+ {
+ "href": "http://openstack.example.com/openstack/servers/7e21a264-6cc1-4d90-b7b5-f9f49cec3a85",
+ "rel": "bookmark"
+ }
+ ],
+ "metadata": {
+ "My Server Name": "Apache1"
+ },
+ "name": "new-server-test",
+ "status": "RESCUE",
+ "tenant_id": "openstack",
+ "updated": "2012-09-19T09:22:27Z",
+ "user_id": "fake"
+ }
+} \ No newline at end of file
diff --git a/doc/api_samples/os-rescue/server-get-resp-rescue.xml b/doc/api_samples/os-rescue/server-get-resp-rescue.xml
new file mode 100644
index 000000000..b0da738c4
--- /dev/null
+++ b/doc/api_samples/os-rescue/server-get-resp-rescue.xml
@@ -0,0 +1,19 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<server xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1" status="RESCUE" updated="2012-09-19T11:44:22Z" hostId="8eb4062a49009f6ee8066fbe1ed4c60d67b0a4ebd4434f51d8f03293" name="new-server-test" created="2012-09-19T11:44:22Z" userId="fake" tenantId="openstack" accessIPv4="" accessIPv6="" id="eb2b2fbb-a6f8-4363-9007-e9a9098ea080">
+ <image id="70a599e0-31e7-49b7-b260-868f441e862b">
+ <atom:link href="http://openstack.example.com/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b" rel="bookmark"/>
+ </image>
+ <flavor id="1">
+ <atom:link href="http://openstack.example.com/openstack/flavors/1" rel="bookmark"/>
+ </flavor>
+ <metadata>
+ <meta key="My Server Name">Apache1</meta>
+ </metadata>
+ <addresses>
+ <network id="private">
+ <ip version="4" addr="192.168.0.3"/>
+ </network>
+ </addresses>
+ <atom:link href="http://openstack.example.com/v2/openstack/servers/eb2b2fbb-a6f8-4363-9007-e9a9098ea080" rel="self"/>
+ <atom:link href="http://openstack.example.com/openstack/servers/eb2b2fbb-a6f8-4363-9007-e9a9098ea080" rel="bookmark"/>
+</server> \ No newline at end of file
diff --git a/doc/api_samples/os-rescue/server-get-resp-unrescue.json b/doc/api_samples/os-rescue/server-get-resp-unrescue.json
new file mode 100644
index 000000000..21a35da7f
--- /dev/null
+++ b/doc/api_samples/os-rescue/server-get-resp-unrescue.json
@@ -0,0 +1,54 @@
+{
+ "server": {
+ "accessIPv4": "",
+ "accessIPv6": "",
+ "addresses": {
+ "private": [
+ {
+ "addr": "192.168.0.3",
+ "version": 4
+ }
+ ]
+ },
+ "created": "2012-09-19T09:22:28Z",
+ "flavor": {
+ "id": "1",
+ "links": [
+ {
+ "href": "http://openstack.example.com/openstack/flavors/1",
+ "rel": "bookmark"
+ }
+ ]
+ },
+ "hostId": "a9410a6a8cb87328b1c43cda5c5a15fc860e977d14feb2c9528a2450",
+ "id": "f1ec6ac3-5379-4cdc-af9a-6ddc29656e4f",
+ "image": {
+ "id": "70a599e0-31e7-49b7-b260-868f441e862b",
+ "links": [
+ {
+ "href": "http://openstack.example.com/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b",
+ "rel": "bookmark"
+ }
+ ]
+ },
+ "links": [
+ {
+ "href": "http://openstack.example.com/v2/openstack/servers/f1ec6ac3-5379-4cdc-af9a-6ddc29656e4f",
+ "rel": "self"
+ },
+ {
+ "href": "http://openstack.example.com/openstack/servers/f1ec6ac3-5379-4cdc-af9a-6ddc29656e4f",
+ "rel": "bookmark"
+ }
+ ],
+ "metadata": {
+ "My Server Name": "Apache1"
+ },
+ "name": "new-server-test",
+ "progress": 0,
+ "status": "ACTIVE",
+ "tenant_id": "openstack",
+ "updated": "2012-09-19T09:22:28Z",
+ "user_id": "fake"
+ }
+} \ No newline at end of file
diff --git a/doc/api_samples/os-rescue/server-get-resp-unrescue.xml b/doc/api_samples/os-rescue/server-get-resp-unrescue.xml
new file mode 100644
index 000000000..41fce846a
--- /dev/null
+++ b/doc/api_samples/os-rescue/server-get-resp-unrescue.xml
@@ -0,0 +1,19 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<server xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1" status="ACTIVE" updated="2012-09-19T11:44:23Z" hostId="40fdb0f0760c536d8c2bc816c39a8997b80ddcc6368bb8470c009015" name="new-server-test" created="2012-09-19T11:44:23Z" userId="fake" tenantId="openstack" accessIPv4="" accessIPv6="" progress="0" id="70b4263f-bae1-4ac4-a1c5-e5bb193767bc">
+ <image id="70a599e0-31e7-49b7-b260-868f441e862b">
+ <atom:link href="http://openstack.example.com/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b" rel="bookmark"/>
+ </image>
+ <flavor id="1">
+ <atom:link href="http://openstack.example.com/openstack/flavors/1" rel="bookmark"/>
+ </flavor>
+ <metadata>
+ <meta key="My Server Name">Apache1</meta>
+ </metadata>
+ <addresses>
+ <network id="private">
+ <ip version="4" addr="192.168.0.3"/>
+ </network>
+ </addresses>
+ <atom:link href="http://openstack.example.com/v2/openstack/servers/70b4263f-bae1-4ac4-a1c5-e5bb193767bc" rel="self"/>
+ <atom:link href="http://openstack.example.com/openstack/servers/70b4263f-bae1-4ac4-a1c5-e5bb193767bc" rel="bookmark"/>
+</server> \ No newline at end of file
diff --git a/doc/api_samples/os-rescue/server-post-req.json b/doc/api_samples/os-rescue/server-post-req.json
new file mode 100644
index 000000000..d88eb4122
--- /dev/null
+++ b/doc/api_samples/os-rescue/server-post-req.json
@@ -0,0 +1,16 @@
+{
+ "server" : {
+ "name" : "new-server-test",
+ "imageRef" : "http://openstack.example.com/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b",
+ "flavorRef" : "http://openstack.example.com/openstack/flavors/1",
+ "metadata" : {
+ "My Server Name" : "Apache1"
+ },
+ "personality" : [
+ {
+ "path" : "/etc/banner.txt",
+ "contents" : "ICAgICAgDQoiQSBjbG91ZCBkb2VzIG5vdCBrbm93IHdoeSBpdCBtb3ZlcyBpbiBqdXN0IHN1Y2ggYSBkaXJlY3Rpb24gYW5kIGF0IHN1Y2ggYSBzcGVlZC4uLkl0IGZlZWxzIGFuIGltcHVsc2lvbi4uLnRoaXMgaXMgdGhlIHBsYWNlIHRvIGdvIG5vdy4gQnV0IHRoZSBza3kga25vd3MgdGhlIHJlYXNvbnMgYW5kIHRoZSBwYXR0ZXJucyBiZWhpbmQgYWxsIGNsb3VkcywgYW5kIHlvdSB3aWxsIGtub3csIHRvbywgd2hlbiB5b3UgbGlmdCB5b3Vyc2VsZiBoaWdoIGVub3VnaCB0byBzZWUgYmV5b25kIGhvcml6b25zLiINCg0KLVJpY2hhcmQgQmFjaA=="
+ }
+ ]
+ }
+} \ No newline at end of file
diff --git a/doc/api_samples/os-rescue/server-post-req.xml b/doc/api_samples/os-rescue/server-post-req.xml
new file mode 100644
index 000000000..0a3c8bb53
--- /dev/null
+++ b/doc/api_samples/os-rescue/server-post-req.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server xmlns="http://docs.openstack.org/compute/api/v1.1" imageRef="http://openstack.example.com/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b" flavorRef="http://openstack.example.com/openstack/flavors/1" name="new-server-test">
+ <metadata>
+ <meta key="My Server Name">Apache1</meta>
+ </metadata>
+ <personality>
+ <file path="/etc/banner.txt">
+ ICAgICAgDQoiQSBjbG91ZCBkb2VzIG5vdCBrbm93IHdoeSBp
+ dCBtb3ZlcyBpbiBqdXN0IHN1Y2ggYSBkaXJlY3Rpb24gYW5k
+ IGF0IHN1Y2ggYSBzcGVlZC4uLkl0IGZlZWxzIGFuIGltcHVs
+ c2lvbi4uLnRoaXMgaXMgdGhlIHBsYWNlIHRvIGdvIG5vdy4g
+ QnV0IHRoZSBza3kga25vd3MgdGhlIHJlYXNvbnMgYW5kIHRo
+ ZSBwYXR0ZXJucyBiZWhpbmQgYWxsIGNsb3VkcywgYW5kIHlv
+ dSB3aWxsIGtub3csIHRvbywgd2hlbiB5b3UgbGlmdCB5b3Vy
+ c2VsZiBoaWdoIGVub3VnaCB0byBzZWUgYmV5b25kIGhvcml6
+ b25zLiINCg0KLVJpY2hhcmQgQmFjaA==
+ </file>
+ </personality>
+</server> \ No newline at end of file
diff --git a/doc/api_samples/os-rescue/server-post-resp.json b/doc/api_samples/os-rescue/server-post-resp.json
new file mode 100644
index 000000000..d9114225a
--- /dev/null
+++ b/doc/api_samples/os-rescue/server-post-resp.json
@@ -0,0 +1,16 @@
+{
+ "server": {
+ "adminPass": "xjDVAYHmc34s",
+ "id": "784f5005-bec9-4c22-8c42-5a7dcba88d82",
+ "links": [
+ {
+ "href": "http://openstack.example.com/v2/openstack/servers/784f5005-bec9-4c22-8c42-5a7dcba88d82",
+ "rel": "self"
+ },
+ {
+ "href": "http://openstack.example.com/openstack/servers/784f5005-bec9-4c22-8c42-5a7dcba88d82",
+ "rel": "bookmark"
+ }
+ ]
+ }
+} \ No newline at end of file
diff --git a/doc/api_samples/os-rescue/server-post-resp.xml b/doc/api_samples/os-rescue/server-post-resp.xml
new file mode 100644
index 000000000..3a31871ba
--- /dev/null
+++ b/doc/api_samples/os-rescue/server-post-resp.xml
@@ -0,0 +1,6 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<server xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1" id="70b4263f-bae1-4ac4-a1c5-e5bb193767bc" adminPass="ttv8YPD3tRPm">
+ <metadata/>
+ <atom:link href="http://openstack.example.com/v2/openstack/servers/70b4263f-bae1-4ac4-a1c5-e5bb193767bc" rel="self"/>
+ <atom:link href="http://openstack.example.com/openstack/servers/70b4263f-bae1-4ac4-a1c5-e5bb193767bc" rel="bookmark"/>
+</server> \ No newline at end of file
diff --git a/doc/api_samples/os-rescue/server-rescue-req.json b/doc/api_samples/os-rescue/server-rescue-req.json
new file mode 100644
index 000000000..379660028
--- /dev/null
+++ b/doc/api_samples/os-rescue/server-rescue-req.json
@@ -0,0 +1,5 @@
+{
+ "rescue": {
+ "adminPass": "MySecretPass"
+ }
+} \ No newline at end of file
diff --git a/doc/api_samples/os-rescue/server-rescue-req.xml b/doc/api_samples/os-rescue/server-rescue-req.xml
new file mode 100644
index 000000000..737263372
--- /dev/null
+++ b/doc/api_samples/os-rescue/server-rescue-req.xml
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<rescue xmlns="http://docs.openstack.org/compute/api/v1.1"
+ adminPass="MySecretPass"/> \ No newline at end of file
diff --git a/doc/api_samples/os-rescue/server-rescue.json b/doc/api_samples/os-rescue/server-rescue.json
new file mode 100644
index 000000000..6cd942395
--- /dev/null
+++ b/doc/api_samples/os-rescue/server-rescue.json
@@ -0,0 +1,3 @@
+{
+ "adminPass": "MySecretPass"
+} \ No newline at end of file
diff --git a/doc/api_samples/os-rescue/server-rescue.xml b/doc/api_samples/os-rescue/server-rescue.xml
new file mode 100644
index 000000000..582388670
--- /dev/null
+++ b/doc/api_samples/os-rescue/server-rescue.xml
@@ -0,0 +1,2 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<adminPass>MySecretPass</adminPass> \ No newline at end of file
diff --git a/doc/api_samples/os-rescue/server-unrescue-req.json b/doc/api_samples/os-rescue/server-unrescue-req.json
new file mode 100644
index 000000000..cafc9b13a
--- /dev/null
+++ b/doc/api_samples/os-rescue/server-unrescue-req.json
@@ -0,0 +1,3 @@
+{
+ "unrescue": null
+} \ No newline at end of file
diff --git a/doc/api_samples/os-rescue/server-unrescue-req.xml b/doc/api_samples/os-rescue/server-unrescue-req.xml
new file mode 100644
index 000000000..6a87f8fb2
--- /dev/null
+++ b/doc/api_samples/os-rescue/server-unrescue-req.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<unrescue xmlns="http://docs.openstack.org/compute/api/v1.1"/> \ No newline at end of file