Skip to content

Commit

Permalink
Adds V3 API samples for the disk-config extension
Browse files Browse the repository at this point in the history
Adds api sample tests and and api samples for the
disk-config extension

Partially implements blueprint v3-api-unittests
Partially implements blueprint v3-api-specification

Change-Id: Ic5c1e4d4e8c6edf3fceef456a79c1f5b79a3b5aa
  • Loading branch information
Chris Yeoh committed Oct 21, 2013
1 parent 7c68f0e commit 5ff633c
Show file tree
Hide file tree
Showing 37 changed files with 878 additions and 0 deletions.
60 changes: 60 additions & 0 deletions doc/v3/api_samples/os-disk-config/list-servers-detail-get.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"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-10-15T02:10:25Z",
"flavor": {
"id": "1",
"links": [
{
"href": "http://openstack.example.com/flavors/1",
"rel": "bookmark"
}
]
},
"host_id": "6cf06d723b64cccf68dd9d40429588cd215879d518a2699b2b947c19",
"id": "e1f469a7-1d3c-44ad-ac17-312596b84e0c",
"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/e1f469a7-1d3c-44ad-ac17-312596b84e0c",
"rel": "self"
},
{
"href": "http://openstack.example.com/servers/e1f469a7-1d3c-44ad-ac17-312596b84e0c",
"rel": "bookmark"
}
],
"metadata": {
"My Server Name": "Apache1"
},
"name": "new-server-test",
"os-disk-config:disk_config": "AUTO",
"progress": 0,
"status": "ACTIVE",
"tenant_id": "openstack",
"updated": "2013-10-15T02:10:25Z",
"user_id": "fake"
}
]
}
21 changes: 21 additions & 0 deletions doc/v3/api_samples/os-disk-config/list-servers-detail-get.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version='1.0' encoding='UTF-8'?>
<servers xmlns:os-disk-config="http://docs.openstack.org/compute/ext/disk_config/api/v3" xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1">
<server status="ACTIVE" updated="2013-10-15T02:10:26Z" user_id="fake" name="new-server-test" created="2013-10-15T02:10:26Z" tenant_id="openstack" access_ip_v4="" progress="0" host_id="91afc29a75a4060983952e3a85271fa9ae5748430d4688e81b2baf4d" id="b4bcbdb4-837c-4070-88df-3da18ffbf303" access_ip_v6="" os-disk-config:disk_config="AUTO" 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/b4bcbdb4-837c-4070-88df-3da18ffbf303" rel="self"/>
<atom:link href="http://openstack.example.com/servers/b4bcbdb4-837c-4070-88df-3da18ffbf303" rel="bookmark"/>
</server>
</servers>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"rebuild": {
"image_ref" : "http://openstack.example.com/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b",
"os-disk-config:disk_config": "AUTO"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<rebuild xmlns:os-disk-config="http://docs.openstack.org/compute/ext/disk_config/api/v1.1"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns="http://docs.openstack.org/compute/api/v1.1"
image_ref="http://openstack.example.com/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b"
os-disk-config:disk_config="AUTO" />
58 changes: 58 additions & 0 deletions doc/v3/api_samples/os-disk-config/server-action-rebuild-resp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"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
}
]
},
"admin_pass": "GfbpJWGgBZ8K",
"created": "2013-10-15T02:10:35Z",
"flavor": {
"id": "1",
"links": [
{
"href": "http://openstack.example.com/flavors/1",
"rel": "bookmark"
}
]
},
"host_id": "0052256b3afffc50ce0b1e6cdbee47df8398935d1e76fb8bb4a202c7",
"id": "4c69ad8c-5d0f-4fc8-83f8-c031b2769b0e",
"image": {
"id": "70a599e0-31e7-49b7-b260-868f441e862b",
"links": [
{
"href": "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"rel": "bookmark"
}
]
},
"links": [
{
"href": "http://openstack.example.com/v3/servers/4c69ad8c-5d0f-4fc8-83f8-c031b2769b0e",
"rel": "self"
},
{
"href": "http://openstack.example.com/servers/4c69ad8c-5d0f-4fc8-83f8-c031b2769b0e",
"rel": "bookmark"
}
],
"metadata": {
"My Server Name": "Apache1"
},
"name": "new-server-test",
"os-disk-config:disk_config": "AUTO",
"progress": 0,
"status": "ACTIVE",
"tenant_id": "openstack",
"updated": "2013-10-15T02:10:35Z",
"user_id": "fake"
}
}
19 changes: 19 additions & 0 deletions doc/v3/api_samples/os-disk-config/server-action-rebuild-resp.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version='1.0' encoding='UTF-8'?>
<server xmlns:os-disk-config="http://docs.openstack.org/compute/ext/disk_config/api/v3" xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1" status="ACTIVE" updated="2013-10-15T02:10:27Z" user_id="fake" name="new-server-test" created="2013-10-15T02:10:27Z" tenant_id="openstack" access_ip_v4="" progress="0" host_id="197205cc7340272607a9c5fa34f3520bbf53103399a6e80a06b67583" id="beb22987-dd7c-4791-8b7a-542c4f53cdd7" access_ip_v6="" admin_pass="whSjs3JXbb6p" os-disk-config:disk_config="AUTO">
<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/beb22987-dd7c-4791-8b7a-542c4f53cdd7" rel="self"/>
<atom:link href="http://openstack.example.com/servers/beb22987-dd7c-4791-8b7a-542c4f53cdd7" rel="bookmark"/>
</server>
58 changes: 58 additions & 0 deletions doc/v3/api_samples/os-disk-config/server-get-resp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"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-10-15T02:10:34Z",
"flavor": {
"id": "1",
"links": [
{
"href": "http://openstack.example.com/flavors/1",
"rel": "bookmark"
}
]
},
"host_id": "060592f7d211654f26c403eeb86fe3a0ce60f29b4338b37f1c88b15e",
"id": "5b5e7d2e-720b-404e-81ae-4faa7aa43c6a",
"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/5b5e7d2e-720b-404e-81ae-4faa7aa43c6a",
"rel": "self"
},
{
"href": "http://openstack.example.com/servers/5b5e7d2e-720b-404e-81ae-4faa7aa43c6a",
"rel": "bookmark"
}
],
"metadata": {
"My Server Name": "Apache1"
},
"name": "new-server-test",
"os-disk-config:disk_config": "AUTO",
"progress": 0,
"status": "ACTIVE",
"tenant_id": "openstack",
"updated": "2013-10-15T02:10:34Z",
"user_id": "fake"
}
}
19 changes: 19 additions & 0 deletions doc/v3/api_samples/os-disk-config/server-get-resp.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version='1.0' encoding='UTF-8'?>
<server xmlns:os-disk-config="http://docs.openstack.org/compute/ext/disk_config/api/v3" xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1" status="ACTIVE" updated="2013-10-15T02:10:26Z" user_id="fake" name="new-server-test" created="2013-10-15T02:10:26Z" tenant_id="openstack" access_ip_v4="" progress="0" host_id="0f65e54d42dc6ab16e7a970df1c58d93ea8fa92636550f0d00af48f4" id="31c9e8eb-0527-4dfe-a631-52d487baa7be" access_ip_v6="" os-disk-config:disk_config="AUTO" 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/31c9e8eb-0527-4dfe-a631-52d487baa7be" rel="self"/>
<atom:link href="http://openstack.example.com/servers/31c9e8eb-0527-4dfe-a631-52d487baa7be" rel="bookmark"/>
</server>
16 changes: 16 additions & 0 deletions doc/v3/api_samples/os-disk-config/server-post-req.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "http://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=="
}
]
}
}
19 changes: 19 additions & 0 deletions doc/v3/api_samples/os-disk-config/server-post-req.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<server xmlns="http://docs.openstack.org/compute/api/v1.1" image_ref="http://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>
</server>
17 changes: 17 additions & 0 deletions doc/v3/api_samples/os-disk-config/server-post-resp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"server": {
"admin_pass": "S3uGgNnQRb4V",
"id": "e1f469a7-1d3c-44ad-ac17-312596b84e0c",
"links": [
{
"href": "http://openstack.example.com/v3/servers/e1f469a7-1d3c-44ad-ac17-312596b84e0c",
"rel": "self"
},
{
"href": "http://openstack.example.com/servers/e1f469a7-1d3c-44ad-ac17-312596b84e0c",
"rel": "bookmark"
}
],
"os-disk-config:disk_config": "AUTO"
}
}
6 changes: 6 additions & 0 deletions doc/v3/api_samples/os-disk-config/server-post-resp.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<server xmlns:os-disk-config="http://docs.openstack.org/compute/ext/disk_config/api/v3" xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1" id="31c9e8eb-0527-4dfe-a631-52d487baa7be" admin_pass="Sjn7LYAiNLZH" os-disk-config:disk_config="AUTO">
<metadata/>
<atom:link href="http://openstack.example.com/v3/servers/31c9e8eb-0527-4dfe-a631-52d487baa7be" rel="self"/>
<atom:link href="http://openstack.example.com/servers/31c9e8eb-0527-4dfe-a631-52d487baa7be" rel="bookmark"/>
</server>
6 changes: 6 additions & 0 deletions doc/v3/api_samples/os-disk-config/server-resize-post-req.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"resize": {
"flavor_ref": "3",
"os-disk-config:disk_config": "AUTO"
}
}
6 changes: 6 additions & 0 deletions doc/v3/api_samples/os-disk-config/server-resize-post-req.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<resize xmlns:os-disk-config="http://docs.openstack.org/compute/ext/disk_config/api/v1.1"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns="http://docs.openstack.org/compute/api/v1.1"
os-disk-config:disk_config="AUTO"
flavor_ref="3" />
5 changes: 5 additions & 0 deletions doc/v3/api_samples/os-disk-config/server-update-put-req.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"server": {
"os-disk-config:disk_config": "AUTO"
}
}
5 changes: 5 additions & 0 deletions doc/v3/api_samples/os-disk-config/server-update-put-req.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<server xmlns:os-disk-config="http://docs.openstack.org/compute/ext/disk_config/api/v1.1"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns="http://docs.openstack.org/compute/api/v1.1"
os-disk-config:disk_config="AUTO" />
Loading

0 comments on commit 5ff633c

Please sign in to comment.