summaryrefslogtreecommitdiff
path: root/nova/tests/integrated/v3/api_samples/os-extended-volumes
diff options
context:
space:
mode:
authorHe Jie Xu <xuhj@linux.vnet.ibm.com>2013-09-02 16:36:26 +0800
committerHe Jie Xu <xuhj@linux.vnet.ibm.com>2013-09-16 11:23:24 +0800
commit1fbdc5a9466c13408307a30e53f619a5894f44d5 (patch)
tree3f4f9af4136cd5088365fabb76f80207f43b8240 /nova/tests/integrated/v3/api_samples/os-extended-volumes
parent6a027703b921f057ea6c90bdceb0a62fe0526c6f (diff)
downloadnova-1fbdc5a9466c13408307a30e53f619a5894f44d5.tar.gz
Add v3 API samples for os-extended-volumes
Partially implements blueprint v3-api-unittests Change-Id: I347b220890980a588eaecda644b15257d85b4a85
Diffstat (limited to 'nova/tests/integrated/v3/api_samples/os-extended-volumes')
-rw-r--r--nova/tests/integrated/v3/api_samples/os-extended-volumes/attach-volume-req.json.tpl6
-rw-r--r--nova/tests/integrated/v3/api_samples/os-extended-volumes/attach-volume-req.xml.tpl2
-rw-r--r--nova/tests/integrated/v3/api_samples/os-extended-volumes/detach-volume-req.json.tpl5
-rw-r--r--nova/tests/integrated/v3/api_samples/os-extended-volumes/detach-volume-req.xml.tpl2
-rw-r--r--nova/tests/integrated/v3/api_samples/os-extended-volumes/server-get-resp.json.tpl61
-rw-r--r--nova/tests/integrated/v3/api_samples/os-extended-volumes/server-get-resp.xml.tpl21
-rw-r--r--nova/tests/integrated/v3/api_samples/os-extended-volumes/servers-detail-resp.json.tpl62
-rw-r--r--nova/tests/integrated/v3/api_samples/os-extended-volumes/servers-detail-resp.xml.tpl23
8 files changed, 182 insertions, 0 deletions
diff --git a/nova/tests/integrated/v3/api_samples/os-extended-volumes/attach-volume-req.json.tpl b/nova/tests/integrated/v3/api_samples/os-extended-volumes/attach-volume-req.json.tpl
new file mode 100644
index 0000000000..1f0c59901b
--- /dev/null
+++ b/nova/tests/integrated/v3/api_samples/os-extended-volumes/attach-volume-req.json.tpl
@@ -0,0 +1,6 @@
+{
+ "attach": {
+ "volume_id": "%(volume_id)s",
+ "device": "%(device)s"
+ }
+}
diff --git a/nova/tests/integrated/v3/api_samples/os-extended-volumes/attach-volume-req.xml.tpl b/nova/tests/integrated/v3/api_samples/os-extended-volumes/attach-volume-req.xml.tpl
new file mode 100644
index 0000000000..76b99854fa
--- /dev/null
+++ b/nova/tests/integrated/v3/api_samples/os-extended-volumes/attach-volume-req.xml.tpl
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<attach volume_id="%(volume_id)s" device="%(device)s" />
diff --git a/nova/tests/integrated/v3/api_samples/os-extended-volumes/detach-volume-req.json.tpl b/nova/tests/integrated/v3/api_samples/os-extended-volumes/detach-volume-req.json.tpl
new file mode 100644
index 0000000000..c56f3c3b83
--- /dev/null
+++ b/nova/tests/integrated/v3/api_samples/os-extended-volumes/detach-volume-req.json.tpl
@@ -0,0 +1,5 @@
+{
+ "detach": {
+ "volume_id": "%(volume_id)s"
+ }
+}
diff --git a/nova/tests/integrated/v3/api_samples/os-extended-volumes/detach-volume-req.xml.tpl b/nova/tests/integrated/v3/api_samples/os-extended-volumes/detach-volume-req.xml.tpl
new file mode 100644
index 0000000000..8f01c24355
--- /dev/null
+++ b/nova/tests/integrated/v3/api_samples/os-extended-volumes/detach-volume-req.xml.tpl
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<detach volume_id="%(volume_id)s" />
diff --git a/nova/tests/integrated/v3/api_samples/os-extended-volumes/server-get-resp.json.tpl b/nova/tests/integrated/v3/api_samples/os-extended-volumes/server-get-resp.json.tpl
new file mode 100644
index 0000000000..a8af74c817
--- /dev/null
+++ b/nova/tests/integrated/v3/api_samples/os-extended-volumes/server-get-resp.json.tpl
@@ -0,0 +1,61 @@
+{
+ "server": {
+ "access_ip_v4": "",
+ "access_ip_v6": "",
+ "addresses": {
+ "private": [
+ {
+ "addr": "%(ip)s",
+ "mac_addr": "aa:bb:cc:dd:ee:ff",
+ "type": "fixed",
+ "version": 4
+ }
+ ]
+ },
+ "created": "%(timestamp)s",
+ "flavor": {
+ "id": "1",
+ "links": [
+ {
+ "href": "%(host)s/flavors/1",
+ "rel": "bookmark"
+ }
+ ]
+ },
+ "host_id": "%(hostid)s",
+ "id": "%(id)s",
+ "image": {
+ "id": "%(uuid)s",
+ "links": [
+ {
+ "href": "%(glance_host)s/images/%(uuid)s",
+ "rel": "bookmark"
+ }
+ ]
+ },
+ "links": [
+ {
+ "href": "%(host)s/v3/servers/%(uuid)s",
+ "rel": "self"
+ },
+ {
+ "href": "%(host)s/servers/%(uuid)s",
+ "rel": "bookmark"
+ }
+ ],
+ "metadata": {
+ "My Server Name": "Apache1"
+ },
+ "name": "new-server-test",
+ "progress": 0,
+ "status": "ACTIVE",
+ "tenant_id": "openstack",
+ "updated": "%(timestamp)s",
+ "user_id": "fake",
+ "os-extended-volumes:volumes_attached": [
+ {"id": "volume_id1"},
+ {"id": "volume_id2"}
+ ],
+ "key_name": null
+ }
+}
diff --git a/nova/tests/integrated/v3/api_samples/os-extended-volumes/server-get-resp.xml.tpl b/nova/tests/integrated/v3/api_samples/os-extended-volumes/server-get-resp.xml.tpl
new file mode 100644
index 0000000000..3368c2b651
--- /dev/null
+++ b/nova/tests/integrated/v3/api_samples/os-extended-volumes/server-get-resp.xml.tpl
@@ -0,0 +1,21 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<server xmlns:os-extended-volumes="http://docs.openstack.org/compute/ext/extended_volumes/api/v3" xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1" status="ACTIVE" updated="%(timestamp)s" user_id="fake" name="new-server-test" created="%(timestamp)s" tenant_id="openstack" access_ip_v4="" progress="0" host_id="%(hostid)s" id="%(id)s" access_ip_v6="" key_name="None">
+ <image id="%(uuid)s">
+ <atom:link href="%(glance_host)s/images/%(uuid)s" rel="bookmark"/>
+ </image>
+ <flavor id="1">
+ <atom:link href="%(host)s/flavors/1" rel="bookmark"/>
+ </flavor>
+ <metadata>
+ <meta key="My Server Name">Apache1</meta>
+ </metadata>
+ <addresses>
+ <network id="private">
+ <ip version="4" type="fixed" addr="%(ip)s" mac_addr="aa:bb:cc:dd:ee:ff"/>
+ </network>
+ </addresses>
+ <atom:link href="%(host)s/v3/servers/%(uuid)s" rel="self"/>
+ <atom:link href="%(host)s/servers/%(uuid)s" rel="bookmark"/>
+ <os-extended-volumes:volume_attached id="volume_id1"/>
+ <os-extended-volumes:volume_attached id="volume_id2"/>
+</server>
diff --git a/nova/tests/integrated/v3/api_samples/os-extended-volumes/servers-detail-resp.json.tpl b/nova/tests/integrated/v3/api_samples/os-extended-volumes/servers-detail-resp.json.tpl
new file mode 100644
index 0000000000..b9bacf00fc
--- /dev/null
+++ b/nova/tests/integrated/v3/api_samples/os-extended-volumes/servers-detail-resp.json.tpl
@@ -0,0 +1,62 @@
+{
+ "servers": [
+ {
+ "updated": "%(timestamp)s",
+ "created": "%(timestamp)s",
+ "access_ip_v4": "",
+ "access_ip_v6": "",
+ "addresses": {
+ "private": [
+ {
+ "addr": "%(ip)s",
+ "version": 4,
+ "mac_addr": "aa:bb:cc:dd:ee:ff",
+ "type": "fixed"
+ }
+ ]
+ },
+ "flavor": {
+ "id": "1",
+ "links": [
+ {
+ "href": "%(host)s/flavors/1",
+ "rel": "bookmark"
+ }
+ ]
+ },
+ "host_id": "%(hostid)s",
+ "id": "%(uuid)s",
+ "image": {
+ "id": "%(uuid)s",
+ "links": [
+ {
+ "href": "%(glance_host)s/images/%(uuid)s",
+ "rel": "bookmark"
+ }
+ ]
+ },
+ "links": [
+ {
+ "href": "%(host)s/v3/servers/%(id)s",
+ "rel": "self"
+ },
+ {
+ "href": "%(host)s/servers/%(id)s",
+ "rel": "bookmark"
+ }
+ ],
+ "metadata": {
+ "My Server Name": "Apache1"
+ },
+ "name": "new-server-test",
+ "progress": 0,
+ "status": "ACTIVE",
+ "tenant_id": "openstack",
+ "user_id": "fake",
+ "os-extended-volumes:volumes_attached": [
+ {"id": "volume_id1"},
+ {"id": "volume_id2"}
+ ],
+ "key_name": null
+ }]
+}
diff --git a/nova/tests/integrated/v3/api_samples/os-extended-volumes/servers-detail-resp.xml.tpl b/nova/tests/integrated/v3/api_samples/os-extended-volumes/servers-detail-resp.xml.tpl
new file mode 100644
index 0000000000..7d0ed6d583
--- /dev/null
+++ b/nova/tests/integrated/v3/api_samples/os-extended-volumes/servers-detail-resp.xml.tpl
@@ -0,0 +1,23 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<servers xmlns:os-extended-volumes="http://docs.openstack.org/compute/ext/extended_volumes/api/v3" xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1">
+ <server status="ACTIVE" updated="%(timestamp)s" host_id="%(hostid)s" name="new-server-test" created="%(timestamp)s" user_id="fake" tenant_id="openstack" access_ip_v4="" access_ip_v6="" progress="0" id="%(id)s" key_name="None">
+ <image id="%(uuid)s">
+ <atom:link href="%(glance_host)s/images/%(uuid)s" rel="bookmark"/>
+ </image>
+ <flavor id="1">
+ <atom:link href="%(host)s/flavors/1" rel="bookmark"/>
+ </flavor>
+ <metadata>
+ <meta key="My Server Name">Apache1</meta>
+ </metadata>
+ <addresses>
+ <network id="private">
+ <ip version="4" addr="%(ip)s" type="fixed" mac_addr="aa:bb:cc:dd:ee:ff"/>
+ </network>
+ </addresses>
+ <atom:link href="%(host)s/v3/servers/%(uuid)s" rel="self"/>
+ <atom:link href="%(host)s/servers/%(uuid)s" rel="bookmark"/>
+ <os-extended-volumes:volume_attached id="volume_id1"/>
+ <os-extended-volumes:volume_attached id="volume_id2"/>
+ </server>
+</servers>