summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorHe Jie Xu <xuhj@linux.vnet.ibm.com>2013-09-06 20:35:15 +0800
committerHe Jie Xu <xuhj@linux.vnet.ibm.com>2013-09-25 11:32:36 +0800
commitc37e034790bd5ce0f7a6a8274ac9dbcc56913a69 (patch)
treef2fdefafc3061872f767cd3d5693d9e1a615de11 /doc
parent018dfd8652ef4d4f24f9aff67a9f449bb9cc2b80 (diff)
downloadnova-c37e034790bd5ce0f7a6a8274ac9dbcc56913a69.tar.gz
Add V3 API samples for security-groups
Partially implements blueprint v3-api-unittests Change-Id: I6df70127a88881320052613f4c107e2287f375c1
Diffstat (limited to 'doc')
-rw-r--r--doc/v3/api_samples/os-security-groups/server-get-resp.json62
-rw-r--r--doc/v3/api_samples/os-security-groups/server-get-resp.xml22
-rw-r--r--doc/v3/api_samples/os-security-groups/server-post-req.json17
-rw-r--r--doc/v3/api_samples/os-security-groups/server-post-req.xml22
-rw-r--r--doc/v3/api_samples/os-security-groups/server-post-resp.json21
-rw-r--r--doc/v3/api_samples/os-security-groups/server-post-resp.xml9
-rw-r--r--doc/v3/api_samples/os-security-groups/servers-detail-resp.json64
-rw-r--r--doc/v3/api_samples/os-security-groups/servers-detail-resp.xml24
8 files changed, 241 insertions, 0 deletions
diff --git a/doc/v3/api_samples/os-security-groups/server-get-resp.json b/doc/v3/api_samples/os-security-groups/server-get-resp.json
new file mode 100644
index 0000000000..a3d005dd0c
--- /dev/null
+++ b/doc/v3/api_samples/os-security-groups/server-get-resp.json
@@ -0,0 +1,62 @@
+{
+ "server": {
+ "access_ip_v4": "",
+ "access_ip_v6": "",
+ "addresses": {
+ "private": [
+ {
+ "addr": "192.168.0.3",
+ "mac_addr": "aa:bb:cc:dd:ee:ff",
+ "type": "fixed",
+ "version": 4
+ }
+ ]
+ },
+ "created": "2013-09-25T03:29:13Z",
+ "flavor": {
+ "id": "1",
+ "links": [
+ {
+ "href": "http://openstack.example.com/flavors/1",
+ "rel": "bookmark"
+ }
+ ]
+ },
+ "host_id": "0e312d6763795d572ccd716973fd078290d9ec446517b222d3395660",
+ "id": "f6961f7a-0133-4f27-94cd-901dca4ba426",
+ "image": {
+ "id": "70a599e0-31e7-49b7-b260-868f441e862b",
+ "links": [
+ {
+ "href": "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
+ "rel": "bookmark"
+ }
+ ]
+ },
+ "key_name": null,
+ "links": [
+ {
+ "href": "http://openstack.example.com/v3/servers/f6961f7a-0133-4f27-94cd-901dca4ba426",
+ "rel": "self"
+ },
+ {
+ "href": "http://openstack.example.com/servers/f6961f7a-0133-4f27-94cd-901dca4ba426",
+ "rel": "bookmark"
+ }
+ ],
+ "metadata": {
+ "My Server Name": "Apache1"
+ },
+ "name": "new-server-test",
+ "progress": 0,
+ "security_groups": [
+ {
+ "name": "test"
+ }
+ ],
+ "status": "ACTIVE",
+ "tenant_id": "openstack",
+ "updated": "2013-09-25T03:29:14Z",
+ "user_id": "fake"
+ }
+} \ No newline at end of file
diff --git a/doc/v3/api_samples/os-security-groups/server-get-resp.xml b/doc/v3/api_samples/os-security-groups/server-get-resp.xml
new file mode 100644
index 0000000000..6515f482da
--- /dev/null
+++ b/doc/v3/api_samples/os-security-groups/server-get-resp.xml
@@ -0,0 +1,22 @@
+<?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="2013-09-25T03:29:14Z" user_id="fake" name="new-server-test" created="2013-09-25T03:29:14Z" tenant_id="openstack" access_ip_v4="" progress="0" host_id="a41e10b8b76a145704a8d4cd340fc14a7e005188ecc475aaea04de44" id="0c2e89e5-491a-4416-ae48-e77edfb04705" access_ip_v6="" key_name="None">
+ <image id="70a599e0-31e7-49b7-b260-868f441e862b">
+ <atom:link href="http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b" rel="bookmark"/>
+ </image>
+ <flavor id="1">
+ <atom:link href="http://openstack.example.com/flavors/1" rel="bookmark"/>
+ </flavor>
+ <metadata>
+ <meta key="My Server Name">Apache1</meta>
+ </metadata>
+ <addresses>
+ <network id="private">
+ <ip version="4" type="fixed" addr="192.168.0.3" mac_addr="aa:bb:cc:dd:ee:ff"/>
+ </network>
+ </addresses>
+ <atom:link href="http://openstack.example.com/v3/servers/0c2e89e5-491a-4416-ae48-e77edfb04705" rel="self"/>
+ <atom:link href="http://openstack.example.com/servers/0c2e89e5-491a-4416-ae48-e77edfb04705" rel="bookmark"/>
+ <security_groups>
+ <security_group name="test"/>
+ </security_groups>
+</server> \ No newline at end of file
diff --git a/doc/v3/api_samples/os-security-groups/server-post-req.json b/doc/v3/api_samples/os-security-groups/server-post-req.json
new file mode 100644
index 0000000000..cd323c6ffe
--- /dev/null
+++ b/doc/v3/api_samples/os-security-groups/server-post-req.json
@@ -0,0 +1,17 @@
+{
+ "server" : {
+ "name" : "new-server-test",
+ "image_ref" : "http://glance.openstack.example.com/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b",
+ "flavor_ref" : "http://openstack.example.com/openstack/flavors/1",
+ "metadata" : {
+ "My Server Name" : "Apache1"
+ },
+ "personality" : [
+ {
+ "path" : "/etc/banner.txt",
+ "contents" : "ICAgICAgDQoiQSBjbG91ZCBkb2VzIG5vdCBrbm93IHdoeSBpdCBtb3ZlcyBpbiBqdXN0IHN1Y2ggYSBkaXJlY3Rpb24gYW5kIGF0IHN1Y2ggYSBzcGVlZC4uLkl0IGZlZWxzIGFuIGltcHVsc2lvbi4uLnRoaXMgaXMgdGhlIHBsYWNlIHRvIGdvIG5vdy4gQnV0IHRoZSBza3kga25vd3MgdGhlIHJlYXNvbnMgYW5kIHRoZSBwYXR0ZXJucyBiZWhpbmQgYWxsIGNsb3VkcywgYW5kIHlvdSB3aWxsIGtub3csIHRvbywgd2hlbiB5b3UgbGlmdCB5b3Vyc2VsZiBoaWdoIGVub3VnaCB0byBzZWUgYmV5b25kIGhvcml6b25zLiINCg0KLVJpY2hhcmQgQmFjaA=="
+ }
+ ],
+ "os-security-groups:security_groups": [{"name": "test"}]
+ }
+} \ No newline at end of file
diff --git a/doc/v3/api_samples/os-security-groups/server-post-req.xml b/doc/v3/api_samples/os-security-groups/server-post-req.xml
new file mode 100644
index 0000000000..6494a574f4
--- /dev/null
+++ b/doc/v3/api_samples/os-security-groups/server-post-req.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server xmlns:os-security-groups="http://docs.openstack.org/compute/ext/securitygroups/api/v3" xmlns="http://docs.openstack.org/compute/api/v1.1" image_ref="http://glance.openstack.example.com/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b" flavor_ref="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>
+ <os-security-groups:security_groups>
+ <security_group name="test" />
+ </os-security-groups:security_groups>
+</server> \ No newline at end of file
diff --git a/doc/v3/api_samples/os-security-groups/server-post-resp.json b/doc/v3/api_samples/os-security-groups/server-post-resp.json
new file mode 100644
index 0000000000..2945d58a3a
--- /dev/null
+++ b/doc/v3/api_samples/os-security-groups/server-post-resp.json
@@ -0,0 +1,21 @@
+{
+ "server": {
+ "admin_pass": "ki8cbWeZdxH6",
+ "id": "2dabdd93-ced7-4607-a542-2516de84e0e5",
+ "links": [
+ {
+ "href": "http://openstack.example.com/v3/servers/2dabdd93-ced7-4607-a542-2516de84e0e5",
+ "rel": "self"
+ },
+ {
+ "href": "http://openstack.example.com/servers/2dabdd93-ced7-4607-a542-2516de84e0e5",
+ "rel": "bookmark"
+ }
+ ],
+ "security_groups": [
+ {
+ "name": "test"
+ }
+ ]
+ }
+} \ No newline at end of file
diff --git a/doc/v3/api_samples/os-security-groups/server-post-resp.xml b/doc/v3/api_samples/os-security-groups/server-post-resp.xml
new file mode 100644
index 0000000000..1139ee881e
--- /dev/null
+++ b/doc/v3/api_samples/os-security-groups/server-post-resp.xml
@@ -0,0 +1,9 @@
+<?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="c7edb38c-18bf-4522-8ddc-3af9dd3ab513" admin_pass="55v3adHeAzSM">
+ <metadata/>
+ <atom:link href="http://openstack.example.com/v3/servers/c7edb38c-18bf-4522-8ddc-3af9dd3ab513" rel="self"/>
+ <atom:link href="http://openstack.example.com/servers/c7edb38c-18bf-4522-8ddc-3af9dd3ab513" rel="bookmark"/>
+ <security_groups>
+ <security_group name="test"/>
+ </security_groups>
+</server> \ No newline at end of file
diff --git a/doc/v3/api_samples/os-security-groups/servers-detail-resp.json b/doc/v3/api_samples/os-security-groups/servers-detail-resp.json
new file mode 100644
index 0000000000..5affdf890e
--- /dev/null
+++ b/doc/v3/api_samples/os-security-groups/servers-detail-resp.json
@@ -0,0 +1,64 @@
+{
+ "servers": [
+ {
+ "access_ip_v4": "",
+ "access_ip_v6": "",
+ "addresses": {
+ "private": [
+ {
+ "addr": "192.168.0.3",
+ "mac_addr": "aa:bb:cc:dd:ee:ff",
+ "type": "fixed",
+ "version": 4
+ }
+ ]
+ },
+ "created": "2013-09-25T03:29:11Z",
+ "flavor": {
+ "id": "1",
+ "links": [
+ {
+ "href": "http://openstack.example.com/flavors/1",
+ "rel": "bookmark"
+ }
+ ]
+ },
+ "host_id": "afeeb125d4d37d0a2123e3144a20a6672fda5d4b6cb85ec193430d82",
+ "id": "1b94e3fc-1b1c-431a-a077-6b280fb720ce",
+ "image": {
+ "id": "70a599e0-31e7-49b7-b260-868f441e862b",
+ "links": [
+ {
+ "href": "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
+ "rel": "bookmark"
+ }
+ ]
+ },
+ "key_name": null,
+ "links": [
+ {
+ "href": "http://openstack.example.com/v3/servers/1b94e3fc-1b1c-431a-a077-6b280fb720ce",
+ "rel": "self"
+ },
+ {
+ "href": "http://openstack.example.com/servers/1b94e3fc-1b1c-431a-a077-6b280fb720ce",
+ "rel": "bookmark"
+ }
+ ],
+ "metadata": {
+ "My Server Name": "Apache1"
+ },
+ "name": "new-server-test",
+ "progress": 0,
+ "security_groups": [
+ {
+ "name": "test"
+ }
+ ],
+ "status": "ACTIVE",
+ "tenant_id": "openstack",
+ "updated": "2013-09-25T03:29:12Z",
+ "user_id": "fake"
+ }
+ ]
+} \ No newline at end of file
diff --git a/doc/v3/api_samples/os-security-groups/servers-detail-resp.xml b/doc/v3/api_samples/os-security-groups/servers-detail-resp.xml
new file mode 100644
index 0000000000..9563bc5bc6
--- /dev/null
+++ b/doc/v3/api_samples/os-security-groups/servers-detail-resp.xml
@@ -0,0 +1,24 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<servers xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1">
+ <server status="ACTIVE" updated="2013-09-25T03:29:12Z" user_id="fake" name="new-server-test" created="2013-09-25T03:29:11Z" tenant_id="openstack" access_ip_v4="" progress="0" host_id="a26871d6b20ffd0c27cebe72624fb2547be453c746edde9df33161f1" id="c7edb38c-18bf-4522-8ddc-3af9dd3ab513" access_ip_v6="" key_name="None">
+ <image id="70a599e0-31e7-49b7-b260-868f441e862b">
+ <atom:link href="http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b" rel="bookmark"/>
+ </image>
+ <flavor id="1">
+ <atom:link href="http://openstack.example.com/flavors/1" rel="bookmark"/>
+ </flavor>
+ <metadata>
+ <meta key="My Server Name">Apache1</meta>
+ </metadata>
+ <addresses>
+ <network id="private">
+ <ip version="4" type="fixed" addr="192.168.0.3" mac_addr="aa:bb:cc:dd:ee:ff"/>
+ </network>
+ </addresses>
+ <atom:link href="http://openstack.example.com/v3/servers/c7edb38c-18bf-4522-8ddc-3af9dd3ab513" rel="self"/>
+ <atom:link href="http://openstack.example.com/servers/c7edb38c-18bf-4522-8ddc-3af9dd3ab513" rel="bookmark"/>
+ <security_groups>
+ <security_group name="test"/>
+ </security_groups>
+ </server>
+</servers> \ No newline at end of file