Adds v3 API samples for ips and server_metadata extensions
DocImpact Change-Id: I3774db2ab59335e0f8543c4563028b0c35234dc9
This commit is contained in:
parent
0ff26160f9
commit
27775f35dd
10
doc/v3/api_samples/server-ips/server-ips-network-resp.json
Normal file
10
doc/v3/api_samples/server-ips/server-ips-network-resp.json
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
"private": [
|
||||
{
|
||||
"addr": "192.168.0.3",
|
||||
"mac_addr": "aa:bb:cc:dd:ee:ff",
|
||||
"type": "fixed",
|
||||
"version": 4
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<network xmlns="http://docs.openstack.org/compute/api/v1.1" id="private">
|
||||
<ip version="4" type="fixed" addr="192.168.0.3" mac_addr="aa:bb:cc:dd:ee:ff"/>
|
||||
</network>
|
12
doc/v3/api_samples/server-ips/server-ips-resp.json
Normal file
12
doc/v3/api_samples/server-ips/server-ips-resp.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"addresses": {
|
||||
"private": [
|
||||
{
|
||||
"addr": "192.168.0.3",
|
||||
"mac_addr": "aa:bb:cc:dd:ee:ff",
|
||||
"type": "fixed",
|
||||
"version": 4
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
6
doc/v3/api_samples/server-ips/server-ips-resp.xml
Normal file
6
doc/v3/api_samples/server-ips/server-ips-resp.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<addresses xmlns="http://docs.openstack.org/compute/api/v1.1">
|
||||
<network id="private">
|
||||
<ip version="4" type="fixed" addr="192.168.0.3" mac_addr="aa:bb:cc:dd:ee:ff"/>
|
||||
</network>
|
||||
</addresses>
|
16
doc/v3/api_samples/server-ips/server-post-req.json
Normal file
16
doc/v3/api_samples/server-ips/server-post-req.json
Normal file
@ -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
doc/v3/api_samples/server-ips/server-post-req.xml
Normal file
19
doc/v3/api_samples/server-ips/server-post-req.xml
Normal file
@ -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>
|
16
doc/v3/api_samples/server-ips/server-post-resp.json
Normal file
16
doc/v3/api_samples/server-ips/server-post-resp.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"server": {
|
||||
"admin_pass": "Ag463BYwnXEf",
|
||||
"id": "0813a7dc-8e97-42df-9634-957109499bf0",
|
||||
"links": [
|
||||
{
|
||||
"href": "http://openstack.example.com/v3/servers/0813a7dc-8e97-42df-9634-957109499bf0",
|
||||
"rel": "self"
|
||||
},
|
||||
{
|
||||
"href": "http://openstack.example.com/servers/0813a7dc-8e97-42df-9634-957109499bf0",
|
||||
"rel": "bookmark"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
6
doc/v3/api_samples/server-ips/server-post-resp.xml
Normal file
6
doc/v3/api_samples/server-ips/server-post-resp.xml
Normal file
@ -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="8fee36b1-43ce-4380-a360-0b03c9571319" admin_pass="t7CaoxDhmBm8">
|
||||
<metadata/>
|
||||
<atom:link href="http://openstack.example.com/v3/servers/8fee36b1-43ce-4380-a360-0b03c9571319" rel="self"/>
|
||||
<atom:link href="http://openstack.example.com/servers/8fee36b1-43ce-4380-a360-0b03c9571319" rel="bookmark"/>
|
||||
</server>
|
@ -0,0 +1,5 @@
|
||||
{
|
||||
"metadata" : {
|
||||
"foo" : "Foo Value"
|
||||
}
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<metadata xmlns="http://docs.openstack.org/compute/api/v1.1">
|
||||
<meta key="foo">Foo Value</meta>
|
||||
</metadata>
|
@ -0,0 +1,5 @@
|
||||
{
|
||||
"metadata": {
|
||||
"foo": "Foo Value"
|
||||
}
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<metadata xmlns="http://docs.openstack.org/compute/api/v1.1">
|
||||
<meta key="foo">Foo Value</meta>
|
||||
</metadata>
|
@ -0,0 +1,5 @@
|
||||
{
|
||||
"metadata" : {
|
||||
"foo" : "Bar Value"
|
||||
}
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<metadata xmlns="http://docs.openstack.org/compute/api/v1.1" key="foo">Bar Value</metadata>
|
@ -0,0 +1,5 @@
|
||||
{
|
||||
"metadata": {
|
||||
"foo": "Foo Value"
|
||||
}
|
||||
}
|
@ -0,0 +1,2 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<metadata xmlns="http://docs.openstack.org/compute/api/v1.1" key="foo">Foo Value</metadata>
|
16
doc/v3/api_samples/server-metadata/server-post-req.json
Normal file
16
doc/v3/api_samples/server-metadata/server-post-req.json
Normal file
@ -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
doc/v3/api_samples/server-metadata/server-post-req.xml
Normal file
19
doc/v3/api_samples/server-metadata/server-post-req.xml
Normal file
@ -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>
|
16
doc/v3/api_samples/server-metadata/server-post-resp.json
Normal file
16
doc/v3/api_samples/server-metadata/server-post-resp.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"server": {
|
||||
"admin_pass": "ys9M8HQXvwEJ",
|
||||
"id": "a6ebe5b4-b68b-420b-9c1e-620c4d3e0389",
|
||||
"links": [
|
||||
{
|
||||
"href": "http://openstack.example.com/v3/servers/a6ebe5b4-b68b-420b-9c1e-620c4d3e0389",
|
||||
"rel": "self"
|
||||
},
|
||||
{
|
||||
"href": "http://openstack.example.com/servers/a6ebe5b4-b68b-420b-9c1e-620c4d3e0389",
|
||||
"rel": "bookmark"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
6
doc/v3/api_samples/server-metadata/server-post-resp.xml
Normal file
6
doc/v3/api_samples/server-metadata/server-post-resp.xml
Normal file
@ -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="80cd3928-5ce9-44a1-9257-88847c37f9e4" admin_pass="6GXmk5m4AXpy">
|
||||
<metadata/>
|
||||
<atom:link href="http://openstack.example.com/v3/servers/80cd3928-5ce9-44a1-9257-88847c37f9e4" rel="self"/>
|
||||
<atom:link href="http://openstack.example.com/servers/80cd3928-5ce9-44a1-9257-88847c37f9e4" rel="bookmark"/>
|
||||
</server>
|
@ -0,0 +1,10 @@
|
||||
{
|
||||
"private": [
|
||||
{
|
||||
"addr": "%(ip)s",
|
||||
"mac_addr": "aa:bb:cc:dd:ee:ff",
|
||||
"type": "fixed",
|
||||
"version": 4
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<network xmlns="http://docs.openstack.org/compute/api/v1.1" id="private">
|
||||
<ip version="4" type="fixed" addr="%(ip)s" mac_addr="aa:bb:cc:dd:ee:ff"/>
|
||||
</network>
|
@ -0,0 +1,12 @@
|
||||
{
|
||||
"addresses": {
|
||||
"private": [
|
||||
{
|
||||
"addr": "%(ip)s",
|
||||
"mac_addr": "aa:bb:cc:dd:ee:ff",
|
||||
"type": "fixed",
|
||||
"version": 4
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<addresses xmlns="http://docs.openstack.org/compute/api/v1.1">
|
||||
<network id="private">
|
||||
<ip version="4" type="fixed" addr="%(ip)s" mac_addr="aa:bb:cc:dd:ee:ff"/>
|
||||
</network>
|
||||
</addresses>
|
@ -0,0 +1,16 @@
|
||||
{
|
||||
"server" : {
|
||||
"name" : "new-server-test",
|
||||
"image_ref" : "%(host)s/openstack/images/%(image_id)s",
|
||||
"flavor_ref" : "%(host)s/openstack/flavors/1",
|
||||
"metadata" : {
|
||||
"My Server Name" : "Apache1"
|
||||
},
|
||||
"personality" : [
|
||||
{
|
||||
"path" : "/etc/banner.txt",
|
||||
"contents" : "ICAgICAgDQoiQSBjbG91ZCBkb2VzIG5vdCBrbm93IHdoeSBpdCBtb3ZlcyBpbiBqdXN0IHN1Y2ggYSBkaXJlY3Rpb24gYW5kIGF0IHN1Y2ggYSBzcGVlZC4uLkl0IGZlZWxzIGFuIGltcHVsc2lvbi4uLnRoaXMgaXMgdGhlIHBsYWNlIHRvIGdvIG5vdy4gQnV0IHRoZSBza3kga25vd3MgdGhlIHJlYXNvbnMgYW5kIHRoZSBwYXR0ZXJucyBiZWhpbmQgYWxsIGNsb3VkcywgYW5kIHlvdSB3aWxsIGtub3csIHRvbywgd2hlbiB5b3UgbGlmdCB5b3Vyc2VsZiBoaWdoIGVub3VnaCB0byBzZWUgYmV5b25kIGhvcml6b25zLiINCg0KLVJpY2hhcmQgQmFjaA=="
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<server xmlns="http://docs.openstack.org/compute/api/v1.1" image_ref="%(host)s/openstack/images/%(image_id)s" flavor_ref="%(host)s/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>
|
@ -0,0 +1,16 @@
|
||||
{
|
||||
"server": {
|
||||
"admin_pass": "%(password)s",
|
||||
"id": "%(id)s",
|
||||
"links": [
|
||||
{
|
||||
"href": "http://openstack.example.com/v3/servers/%(uuid)s",
|
||||
"rel": "self"
|
||||
},
|
||||
{
|
||||
"href": "http://openstack.example.com/servers/%(uuid)s",
|
||||
"rel": "bookmark"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
@ -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="%(id)s" admin_pass="%(password)s">
|
||||
<metadata/>
|
||||
<atom:link href="%(host)s/v3/servers/%(uuid)s" rel="self"/>
|
||||
<atom:link href="%(host)s/servers/%(uuid)s" rel="bookmark"/>
|
||||
</server>
|
@ -0,0 +1,5 @@
|
||||
{
|
||||
"metadata" : {
|
||||
"foo" : "%(value)s"
|
||||
}
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<metadata xmlns="http://docs.openstack.org/compute/api/v1.1">
|
||||
<meta key="foo">%(value)s</meta>
|
||||
</metadata>
|
@ -0,0 +1,5 @@
|
||||
{
|
||||
"metadata": {
|
||||
"foo": "%(value)s"
|
||||
}
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<metadata xmlns="http://docs.openstack.org/compute/api/v1.1">
|
||||
<meta key="foo">%(value)s</meta>
|
||||
</metadata>
|
@ -0,0 +1,5 @@
|
||||
{
|
||||
"metadata" : {
|
||||
"foo" : "%(value)s"
|
||||
}
|
||||
}
|
@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<metadata xmlns="http://docs.openstack.org/compute/api/v1.1" key="foo">%(value)s</metadata>
|
@ -0,0 +1,5 @@
|
||||
{
|
||||
"metadata": {
|
||||
"foo": "%(value)s"
|
||||
}
|
||||
}
|
@ -0,0 +1,2 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<metadata xmlns="http://docs.openstack.org/compute/api/v1.1" key="foo">%(value)s</metadata>
|
@ -0,0 +1,16 @@
|
||||
{
|
||||
"server" : {
|
||||
"name" : "new-server-test",
|
||||
"image_ref" : "%(host)s/openstack/images/%(image_id)s",
|
||||
"flavor_ref" : "%(host)s/openstack/flavors/1",
|
||||
"metadata" : {
|
||||
"My Server Name" : "Apache1"
|
||||
},
|
||||
"personality" : [
|
||||
{
|
||||
"path" : "/etc/banner.txt",
|
||||
"contents" : "ICAgICAgDQoiQSBjbG91ZCBkb2VzIG5vdCBrbm93IHdoeSBpdCBtb3ZlcyBpbiBqdXN0IHN1Y2ggYSBkaXJlY3Rpb24gYW5kIGF0IHN1Y2ggYSBzcGVlZC4uLkl0IGZlZWxzIGFuIGltcHVsc2lvbi4uLnRoaXMgaXMgdGhlIHBsYWNlIHRvIGdvIG5vdy4gQnV0IHRoZSBza3kga25vd3MgdGhlIHJlYXNvbnMgYW5kIHRoZSBwYXR0ZXJucyBiZWhpbmQgYWxsIGNsb3VkcywgYW5kIHlvdSB3aWxsIGtub3csIHRvbywgd2hlbiB5b3UgbGlmdCB5b3Vyc2VsZiBoaWdoIGVub3VnaCB0byBzZWUgYmV5b25kIGhvcml6b25zLiINCg0KLVJpY2hhcmQgQmFjaA=="
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<server xmlns="http://docs.openstack.org/compute/api/v1.1" image_ref="%(host)s/openstack/images/%(image_id)s" flavor_ref="%(host)s/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>
|
@ -0,0 +1,16 @@
|
||||
{
|
||||
"server": {
|
||||
"admin_pass": "%(password)s",
|
||||
"id": "%(id)s",
|
||||
"links": [
|
||||
{
|
||||
"href": "http://openstack.example.com/v3/servers/%(uuid)s",
|
||||
"rel": "self"
|
||||
},
|
||||
{
|
||||
"href": "http://openstack.example.com/servers/%(uuid)s",
|
||||
"rel": "bookmark"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
@ -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="%(id)s" admin_pass="%(password)s">
|
||||
<metadata/>
|
||||
<atom:link href="%(host)s/v3/servers/%(uuid)s" rel="self"/>
|
||||
<atom:link href="%(host)s/servers/%(uuid)s" rel="bookmark"/>
|
||||
</server>
|
85
nova/tests/integrated/v3/test_server_metadata.py
Normal file
85
nova/tests/integrated/v3/test_server_metadata.py
Normal file
@ -0,0 +1,85 @@
|
||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||
# Copyright 2012 Nebula, Inc.
|
||||
# Copyright 2013 IBM Corp.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from nova.tests.integrated.v3 import test_servers
|
||||
|
||||
|
||||
class ServersMetadataJsonTest(test_servers.ServersSampleBase):
|
||||
extends_name = 'core_only'
|
||||
sample_dir = 'server-metadata'
|
||||
|
||||
def _create_and_set(self, subs):
|
||||
uuid = self._post_server()
|
||||
response = self._do_put('servers/%s/metadata' % uuid,
|
||||
'server-metadata-all-req',
|
||||
subs)
|
||||
self._verify_response('server-metadata-all-resp', subs, response, 200)
|
||||
return uuid
|
||||
|
||||
def generalize_subs(self, subs, vanilla_regexes):
|
||||
subs['value'] = '(Foo|Bar) Value'
|
||||
return subs
|
||||
|
||||
def test_metadata_put_all(self):
|
||||
# Test setting all metadata for a server.
|
||||
subs = {'value': 'Foo Value'}
|
||||
self._create_and_set(subs)
|
||||
|
||||
def test_metadata_post_all(self):
|
||||
# Test updating all metadata for a server.
|
||||
subs = {'value': 'Foo Value'}
|
||||
uuid = self._create_and_set(subs)
|
||||
subs['value'] = 'Bar Value'
|
||||
response = self._do_post('servers/%s/metadata' % uuid,
|
||||
'server-metadata-all-req',
|
||||
subs)
|
||||
self._verify_response('server-metadata-all-resp', subs, response, 201)
|
||||
|
||||
def test_metadata_get_all(self):
|
||||
# Test getting all metadata for a server.
|
||||
subs = {'value': 'Foo Value'}
|
||||
uuid = self._create_and_set(subs)
|
||||
response = self._do_get('servers/%s/metadata' % uuid)
|
||||
self._verify_response('server-metadata-all-resp', subs, response, 200)
|
||||
|
||||
def test_metadata_put(self):
|
||||
# Test putting an individual metadata item for a server.
|
||||
subs = {'value': 'Foo Value'}
|
||||
uuid = self._create_and_set(subs)
|
||||
subs['value'] = 'Bar Value'
|
||||
response = self._do_put('servers/%s/metadata/foo' % uuid,
|
||||
'server-metadata-req',
|
||||
subs)
|
||||
self._verify_response('server-metadata-resp', subs, response, 200)
|
||||
|
||||
def test_metadata_get(self):
|
||||
# Test getting an individual metadata item for a server.
|
||||
subs = {'value': 'Foo Value'}
|
||||
uuid = self._create_and_set(subs)
|
||||
response = self._do_get('servers/%s/metadata/foo' % uuid)
|
||||
self._verify_response('server-metadata-resp', subs, response, 200)
|
||||
|
||||
def test_metadata_delete(self):
|
||||
# Test deleting an individual metadata item for a server.
|
||||
subs = {'value': 'Foo Value'}
|
||||
uuid = self._create_and_set(subs)
|
||||
response = self._do_delete('servers/%s/metadata/foo' % uuid)
|
||||
self.assertEqual(response.status, 204)
|
||||
self.assertEqual(response.read(), '')
|
||||
|
||||
|
||||
class ServersMetadataXmlTest(ServersMetadataJsonTest):
|
||||
ctype = 'xml'
|
40
nova/tests/integrated/v3/test_servers_ips.py
Normal file
40
nova/tests/integrated/v3/test_servers_ips.py
Normal file
@ -0,0 +1,40 @@
|
||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||
# Copyright 2012 Nebula, Inc.
|
||||
# Copyright 2013 IBM Corp.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from nova.tests.integrated.v3 import test_servers
|
||||
|
||||
|
||||
class ServersIpsJsonTest(test_servers.ServersSampleBase):
|
||||
extends_name = 'core_only'
|
||||
sample_dir = 'server-ips'
|
||||
|
||||
def test_get(self):
|
||||
# Test getting a server's IP information.
|
||||
uuid = self._post_server()
|
||||
response = self._do_get('servers/%s/ips' % uuid)
|
||||
subs = self._get_regexes()
|
||||
self._verify_response('server-ips-resp', subs, response, 200)
|
||||
|
||||
def test_get_by_network(self):
|
||||
# Test getting a server's IP information by network id.
|
||||
uuid = self._post_server()
|
||||
response = self._do_get('servers/%s/ips/private' % uuid)
|
||||
subs = self._get_regexes()
|
||||
self._verify_response('server-ips-network-resp', subs, response, 200)
|
||||
|
||||
|
||||
class ServersIpsXmlTest(ServersIpsJsonTest):
|
||||
ctype = 'xml'
|
Loading…
Reference in New Issue
Block a user