Adds API Sample tests for DiskConfig extension.

Partially implements blueprint nova-api-samples
Fixes bug 1070158

Change-Id: Ied2efc3ae17599b61133247273a7a4bec9020927
This commit is contained in:
Tiago Mello 2012-12-02 01:17:05 -02:00
parent b6f4796f86
commit 15a395f4b5
45 changed files with 1529 additions and 0 deletions

View File

@ -0,0 +1,34 @@
{
"image": {
"OS-DCF:diskConfig": "AUTO",
"created": "2011-01-01T01:02:03Z",
"id": "70a599e0-31e7-49b7-b260-868f441e862b",
"links": [
{
"href": "http://openstack.example.com/v2/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b",
"rel": "self"
},
{
"href": "http://openstack.example.com/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b",
"rel": "bookmark"
},
{
"href": "http://glance.openstack.example.com/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b",
"rel": "alternate",
"type": "application/vnd.openstack.image"
}
],
"metadata": {
"architecture": "x86_64",
"auto_disk_config": "True",
"kernel_id": "nokernel",
"ramdisk_id": "nokernel"
},
"minDisk": 0,
"minRam": 0,
"name": "fakeimage7",
"progress": 100,
"status": "ACTIVE",
"updated": "2011-01-01T01:02:03Z"
}
}

View File

@ -0,0 +1,12 @@
<?xml version='1.0' encoding='UTF-8'?>
<image xmlns:OS-DCF="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" status="ACTIVE" updated="2011-01-01T01:02:03Z" name="fakeimage7" created="2011-01-01T01:02:03Z" minDisk="0" progress="100" minRam="0" id="70a599e0-31e7-49b7-b260-868f441e862b" OS-DCF:diskConfig="AUTO">
<metadata>
<meta key="kernel_id">nokernel</meta>
<meta key="auto_disk_config">True</meta>
<meta key="ramdisk_id">nokernel</meta>
<meta key="architecture">x86_64</meta>
</metadata>
<atom:link href="http://openstack.example.com/v2/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b" rel="self"/>
<atom:link href="http://openstack.example.com/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b" rel="bookmark"/>
<atom:link href="http://glance.openstack.example.com/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b" type="application/vnd.openstack.image" rel="alternate"/>
</image>

View File

@ -0,0 +1,214 @@
{
"images": [
{
"OS-DCF:diskConfig": "AUTO",
"created": "2011-01-01T01:02:03Z",
"id": "70a599e0-31e7-49b7-b260-868f441e862b",
"links": [
{
"href": "http://openstack.example.com/v2/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b",
"rel": "self"
},
{
"href": "http://openstack.example.com/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b",
"rel": "bookmark"
},
{
"href": "http://glance.openstack.example.com/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b",
"rel": "alternate",
"type": "application/vnd.openstack.image"
}
],
"metadata": {
"architecture": "x86_64",
"auto_disk_config": "True",
"kernel_id": "nokernel",
"ramdisk_id": "nokernel"
},
"minDisk": 0,
"minRam": 0,
"name": "fakeimage7",
"progress": 100,
"status": "ACTIVE",
"updated": "2011-01-01T01:02:03Z"
},
{
"created": "2011-01-01T01:02:03Z",
"id": "155d900f-4e14-4e4c-a73d-069cbf4541e6",
"links": [
{
"href": "http://openstack.example.com/v2/openstack/images/155d900f-4e14-4e4c-a73d-069cbf4541e6",
"rel": "self"
},
{
"href": "http://openstack.example.com/openstack/images/155d900f-4e14-4e4c-a73d-069cbf4541e6",
"rel": "bookmark"
},
{
"href": "http://glance.openstack.example.com/openstack/images/155d900f-4e14-4e4c-a73d-069cbf4541e6",
"rel": "alternate",
"type": "application/vnd.openstack.image"
}
],
"metadata": {
"architecture": "x86_64",
"kernel_id": "nokernel",
"ramdisk_id": "nokernel"
},
"minDisk": 0,
"minRam": 0,
"name": "fakeimage123456",
"progress": 100,
"status": "ACTIVE",
"updated": "2011-01-01T01:02:03Z"
},
{
"created": "2011-01-01T01:02:03Z",
"id": "a2459075-d96c-40d5-893e-577ff92e721c",
"links": [
{
"href": "http://openstack.example.com/v2/openstack/images/a2459075-d96c-40d5-893e-577ff92e721c",
"rel": "self"
},
{
"href": "http://openstack.example.com/openstack/images/a2459075-d96c-40d5-893e-577ff92e721c",
"rel": "bookmark"
},
{
"href": "http://glance.openstack.example.com/openstack/images/a2459075-d96c-40d5-893e-577ff92e721c",
"rel": "alternate",
"type": "application/vnd.openstack.image"
}
],
"metadata": {
"kernel_id": "nokernel",
"ramdisk_id": "nokernel"
},
"minDisk": 0,
"minRam": 0,
"name": "fakeimage123456",
"progress": 100,
"status": "ACTIVE",
"updated": "2011-01-01T01:02:03Z"
},
{
"OS-DCF:diskConfig": "MANUAL",
"created": "2011-01-01T01:02:03Z",
"id": "a440c04b-79fa-479c-bed1-0b816eaec379",
"links": [
{
"href": "http://openstack.example.com/v2/openstack/images/a440c04b-79fa-479c-bed1-0b816eaec379",
"rel": "self"
},
{
"href": "http://openstack.example.com/openstack/images/a440c04b-79fa-479c-bed1-0b816eaec379",
"rel": "bookmark"
},
{
"href": "http://glance.openstack.example.com/openstack/images/a440c04b-79fa-479c-bed1-0b816eaec379",
"rel": "alternate",
"type": "application/vnd.openstack.image"
}
],
"metadata": {
"architecture": "x86_64",
"auto_disk_config": "False",
"kernel_id": "nokernel",
"ramdisk_id": "nokernel"
},
"minDisk": 0,
"minRam": 0,
"name": "fakeimage6",
"progress": 100,
"status": "ACTIVE",
"updated": "2011-01-01T01:02:03Z"
},
{
"created": "2011-01-01T01:02:03Z",
"id": "c905cedb-7281-47e4-8a62-f26bc5fc4c77",
"links": [
{
"href": "http://openstack.example.com/v2/openstack/images/c905cedb-7281-47e4-8a62-f26bc5fc4c77",
"rel": "self"
},
{
"href": "http://openstack.example.com/openstack/images/c905cedb-7281-47e4-8a62-f26bc5fc4c77",
"rel": "bookmark"
},
{
"href": "http://glance.openstack.example.com/openstack/images/c905cedb-7281-47e4-8a62-f26bc5fc4c77",
"rel": "alternate",
"type": "application/vnd.openstack.image"
}
],
"metadata": {
"kernel_id": "155d900f-4e14-4e4c-a73d-069cbf4541e6",
"ramdisk_id": null
},
"minDisk": 0,
"minRam": 0,
"name": "fakeimage123456",
"progress": 100,
"status": "ACTIVE",
"updated": "2011-01-01T01:02:03Z"
},
{
"created": "2011-01-01T01:02:03Z",
"id": "cedef40a-ed67-4d10-800e-17455edce175",
"links": [
{
"href": "http://openstack.example.com/v2/openstack/images/cedef40a-ed67-4d10-800e-17455edce175",
"rel": "self"
},
{
"href": "http://openstack.example.com/openstack/images/cedef40a-ed67-4d10-800e-17455edce175",
"rel": "bookmark"
},
{
"href": "http://glance.openstack.example.com/openstack/images/cedef40a-ed67-4d10-800e-17455edce175",
"rel": "alternate",
"type": "application/vnd.openstack.image"
}
],
"metadata": {
"kernel_id": "nokernel",
"ramdisk_id": "nokernel"
},
"minDisk": 0,
"minRam": 0,
"name": "fakeimage123456",
"progress": 100,
"status": "ACTIVE",
"updated": "2011-01-01T01:02:03Z"
},
{
"created": "2011-01-01T01:02:03Z",
"id": "76fa36fc-c930-4bf3-8c8a-ea2a2420deb6",
"links": [
{
"href": "http://openstack.example.com/v2/openstack/images/76fa36fc-c930-4bf3-8c8a-ea2a2420deb6",
"rel": "self"
},
{
"href": "http://openstack.example.com/openstack/images/76fa36fc-c930-4bf3-8c8a-ea2a2420deb6",
"rel": "bookmark"
},
{
"href": "http://glance.openstack.example.com/openstack/images/76fa36fc-c930-4bf3-8c8a-ea2a2420deb6",
"rel": "alternate",
"type": "application/vnd.openstack.image"
}
],
"metadata": {
"kernel_id": "nokernel",
"ramdisk_id": "nokernel"
},
"minDisk": 0,
"minRam": 0,
"name": "fakeimage123456",
"progress": 100,
"status": "ACTIVE",
"updated": "2011-01-01T01:02:03Z"
}
]
}

View File

@ -0,0 +1,71 @@
<?xml version='1.0' encoding='UTF-8'?>
<images xmlns:OS-DCF="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 status="ACTIVE" updated="2011-01-01T01:02:03Z" name="fakeimage7" created="2011-01-01T01:02:03Z" minDisk="0" progress="100" minRam="0" id="70a599e0-31e7-49b7-b260-868f441e862b" OS-DCF:diskConfig="AUTO">
<metadata>
<meta key="kernel_id">nokernel</meta>
<meta key="auto_disk_config">True</meta>
<meta key="ramdisk_id">nokernel</meta>
<meta key="architecture">x86_64</meta>
</metadata>
<atom:link href="http://openstack.example.com/v2/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b" rel="self"/>
<atom:link href="http://openstack.example.com/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b" rel="bookmark"/>
<atom:link href="http://glance.openstack.example.com/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b" type="application/vnd.openstack.image" rel="alternate"/>
</image>
<image status="ACTIVE" updated="2011-01-01T01:02:03Z" name="fakeimage123456" created="2011-01-01T01:02:03Z" minDisk="0" progress="100" minRam="0" id="155d900f-4e14-4e4c-a73d-069cbf4541e6">
<metadata>
<meta key="kernel_id">nokernel</meta>
<meta key="ramdisk_id">nokernel</meta>
<meta key="architecture">x86_64</meta>
</metadata>
<atom:link href="http://openstack.example.com/v2/openstack/images/155d900f-4e14-4e4c-a73d-069cbf4541e6" rel="self"/>
<atom:link href="http://openstack.example.com/openstack/images/155d900f-4e14-4e4c-a73d-069cbf4541e6" rel="bookmark"/>
<atom:link href="http://glance.openstack.example.com/openstack/images/155d900f-4e14-4e4c-a73d-069cbf4541e6" type="application/vnd.openstack.image" rel="alternate"/>
</image>
<image status="ACTIVE" updated="2011-01-01T01:02:03Z" name="fakeimage123456" created="2011-01-01T01:02:03Z" minDisk="0" progress="100" minRam="0" id="a2459075-d96c-40d5-893e-577ff92e721c">
<metadata>
<meta key="kernel_id">nokernel</meta>
<meta key="ramdisk_id">nokernel</meta>
</metadata>
<atom:link href="http://openstack.example.com/v2/openstack/images/a2459075-d96c-40d5-893e-577ff92e721c" rel="self"/>
<atom:link href="http://openstack.example.com/openstack/images/a2459075-d96c-40d5-893e-577ff92e721c" rel="bookmark"/>
<atom:link href="http://glance.openstack.example.com/openstack/images/a2459075-d96c-40d5-893e-577ff92e721c" type="application/vnd.openstack.image" rel="alternate"/>
</image>
<image status="ACTIVE" updated="2011-01-01T01:02:03Z" name="fakeimage6" created="2011-01-01T01:02:03Z" minDisk="0" progress="100" minRam="0" id="a440c04b-79fa-479c-bed1-0b816eaec379" OS-DCF:diskConfig="MANUAL">
<metadata>
<meta key="kernel_id">nokernel</meta>
<meta key="auto_disk_config">False</meta>
<meta key="ramdisk_id">nokernel</meta>
<meta key="architecture">x86_64</meta>
</metadata>
<atom:link href="http://openstack.example.com/v2/openstack/images/a440c04b-79fa-479c-bed1-0b816eaec379" rel="self"/>
<atom:link href="http://openstack.example.com/openstack/images/a440c04b-79fa-479c-bed1-0b816eaec379" rel="bookmark"/>
<atom:link href="http://glance.openstack.example.com/openstack/images/a440c04b-79fa-479c-bed1-0b816eaec379" type="application/vnd.openstack.image" rel="alternate"/>
</image>
<image status="ACTIVE" updated="2011-01-01T01:02:03Z" name="fakeimage123456" created="2011-01-01T01:02:03Z" minDisk="0" progress="100" minRam="0" id="c905cedb-7281-47e4-8a62-f26bc5fc4c77">
<metadata>
<meta key="kernel_id">155d900f-4e14-4e4c-a73d-069cbf4541e6</meta>
<meta key="ramdisk_id">None</meta>
</metadata>
<atom:link href="http://openstack.example.com/v2/openstack/images/c905cedb-7281-47e4-8a62-f26bc5fc4c77" rel="self"/>
<atom:link href="http://openstack.example.com/openstack/images/c905cedb-7281-47e4-8a62-f26bc5fc4c77" rel="bookmark"/>
<atom:link href="http://glance.openstack.example.com/openstack/images/c905cedb-7281-47e4-8a62-f26bc5fc4c77" type="application/vnd.openstack.image" rel="alternate"/>
</image>
<image status="ACTIVE" updated="2011-01-01T01:02:03Z" name="fakeimage123456" created="2011-01-01T01:02:03Z" minDisk="0" progress="100" minRam="0" id="cedef40a-ed67-4d10-800e-17455edce175">
<metadata>
<meta key="kernel_id">nokernel</meta>
<meta key="ramdisk_id">nokernel</meta>
</metadata>
<atom:link href="http://openstack.example.com/v2/openstack/images/cedef40a-ed67-4d10-800e-17455edce175" rel="self"/>
<atom:link href="http://openstack.example.com/openstack/images/cedef40a-ed67-4d10-800e-17455edce175" rel="bookmark"/>
<atom:link href="http://glance.openstack.example.com/openstack/images/cedef40a-ed67-4d10-800e-17455edce175" type="application/vnd.openstack.image" rel="alternate"/>
</image>
<image status="ACTIVE" updated="2011-01-01T01:02:03Z" name="fakeimage123456" created="2011-01-01T01:02:03Z" minDisk="0" progress="100" minRam="0" id="76fa36fc-c930-4bf3-8c8a-ea2a2420deb6">
<metadata>
<meta key="kernel_id">nokernel</meta>
<meta key="ramdisk_id">nokernel</meta>
</metadata>
<atom:link href="http://openstack.example.com/v2/openstack/images/76fa36fc-c930-4bf3-8c8a-ea2a2420deb6" rel="self"/>
<atom:link href="http://openstack.example.com/openstack/images/76fa36fc-c930-4bf3-8c8a-ea2a2420deb6" rel="bookmark"/>
<atom:link href="http://glance.openstack.example.com/openstack/images/76fa36fc-c930-4bf3-8c8a-ea2a2420deb6" type="application/vnd.openstack.image" rel="alternate"/>
</image>
</images>

View File

@ -0,0 +1,57 @@
{
"servers": [
{
"OS-DCF:diskConfig": "AUTO",
"accessIPv4": "",
"accessIPv6": "",
"addresses": {
"private": [
{
"addr": "192.168.0.3",
"version": 4
}
]
},
"created": "2012-12-02T02:11:55Z",
"flavor": {
"id": "1",
"links": [
{
"href": "http://openstack.example.com/openstack/flavors/1",
"rel": "bookmark"
}
]
},
"hostId": "99428f32351a5d89d0f7727c6eec68c1777c545a0972aaac645508dc",
"id": "05372e62-05b9-4ee2-9343-9a1fdf2a5fda",
"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/05372e62-05b9-4ee2-9343-9a1fdf2a5fda",
"rel": "self"
},
{
"href": "http://openstack.example.com/openstack/servers/05372e62-05b9-4ee2-9343-9a1fdf2a5fda",
"rel": "bookmark"
}
],
"metadata": {
"My Server Name": "Apache1"
},
"name": "new-server-test",
"progress": 0,
"status": "ACTIVE",
"tenant_id": "openstack",
"updated": "2012-12-02T02:11:56Z",
"user_id": "fake"
}
]
}

View File

@ -0,0 +1,21 @@
<?xml version='1.0' encoding='UTF-8'?>
<servers xmlns:OS-DCF="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">
<server status="ACTIVE" updated="2012-12-02T02:15:38Z" hostId="85973b57730e91f4eea36b3e7a2a7e3fdaf56008af335dd59f897a59" name="new-server-test" created="2012-12-02T02:15:38Z" userId="fake" tenantId="openstack" accessIPv4="" accessIPv6="" progress="0" id="08266bed-2651-4b6c-9dc8-83f0c3ef9d38" OS-DCF:diskConfig="AUTO">
<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/08266bed-2651-4b6c-9dc8-83f0c3ef9d38" rel="self"/>
<atom:link href="http://openstack.example.com/openstack/servers/08266bed-2651-4b6c-9dc8-83f0c3ef9d38" rel="bookmark"/>
</server>
</servers>

View File

@ -0,0 +1,6 @@
{
"rebuild": {
"imageRef" : "http://openstack.example.com/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b",
"OS-DCF:diskConfig": "AUTO"
}
}

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<rebuild xmlns:OS-DCF="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"
imageRef="http://openstack.example.com/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b"
OS-DCF:diskConfig="AUTO" />

View File

@ -0,0 +1,56 @@
{
"server": {
"OS-DCF:diskConfig": "AUTO",
"accessIPv4": "",
"accessIPv6": "",
"addresses": {
"private": [
{
"addr": "192.168.0.3",
"version": 4
}
]
},
"adminPass": "NBjMaJoFL4EF",
"created": "2012-12-02T02:11:56Z",
"flavor": {
"id": "1",
"links": [
{
"href": "http://openstack.example.com/openstack/flavors/1",
"rel": "bookmark"
}
]
},
"hostId": "c076393ad900d62c4805a42df10d9b364f629842681c00cce035487f",
"id": "63a8aa13-60fe-41c4-b079-77f6fdf3c841",
"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/63a8aa13-60fe-41c4-b079-77f6fdf3c841",
"rel": "self"
},
{
"href": "http://openstack.example.com/openstack/servers/63a8aa13-60fe-41c4-b079-77f6fdf3c841",
"rel": "bookmark"
}
],
"metadata": {
"My Server Name": "Apache1"
},
"name": "new-server-test",
"progress": 0,
"status": "ACTIVE",
"tenant_id": "openstack",
"updated": "2012-12-02T02:11:56Z",
"user_id": "fake"
}
}

View File

@ -0,0 +1,19 @@
<?xml version='1.0' encoding='UTF-8'?>
<server xmlns:OS-DCF="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" status="ACTIVE" updated="2012-12-02T02:15:39Z" hostId="981de784ae4d8c49ca075024977828a16e7f3c2beeb19115b0366e17" name="new-server-test" created="2012-12-02T02:15:38Z" userId="fake" tenantId="openstack" accessIPv4="" accessIPv6="" progress="0" id="10791a94-8900-4d0c-b93d-0debb224882e" adminPass="mTxoVD3eALpv" OS-DCF:diskConfig="AUTO">
<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/10791a94-8900-4d0c-b93d-0debb224882e" rel="self"/>
<atom:link href="http://openstack.example.com/openstack/servers/10791a94-8900-4d0c-b93d-0debb224882e" rel="bookmark"/>
</server>

View File

@ -0,0 +1,55 @@
{
"server": {
"OS-DCF:diskConfig": "AUTO",
"accessIPv4": "",
"accessIPv6": "",
"addresses": {
"private": [
{
"addr": "192.168.0.3",
"version": 4
}
]
},
"created": "2012-12-02T02:11:55Z",
"flavor": {
"id": "1",
"links": [
{
"href": "http://openstack.example.com/openstack/flavors/1",
"rel": "bookmark"
}
]
},
"hostId": "c949ab4256cea23b6089b710aa2df48bf6577ed915278b62e33ad8bb",
"id": "5046e2f2-3b33-4041-b3cf-e085f73e78e7",
"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/5046e2f2-3b33-4041-b3cf-e085f73e78e7",
"rel": "self"
},
{
"href": "http://openstack.example.com/openstack/servers/5046e2f2-3b33-4041-b3cf-e085f73e78e7",
"rel": "bookmark"
}
],
"metadata": {
"My Server Name": "Apache1"
},
"name": "new-server-test",
"progress": 0,
"status": "ACTIVE",
"tenant_id": "openstack",
"updated": "2012-12-02T02:11:55Z",
"user_id": "fake"
}
}

View File

@ -0,0 +1,19 @@
<?xml version='1.0' encoding='UTF-8'?>
<server xmlns:OS-DCF="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" status="ACTIVE" updated="2012-12-02T02:15:37Z" hostId="afa0a883de4743c7a0c164327bda5284b875c50e1a9e30de910ac126" name="new-server-test" created="2012-12-02T02:15:37Z" userId="fake" tenantId="openstack" accessIPv4="" accessIPv6="" progress="0" id="d5d844c0-ecc3-4202-90ed-2e85b7fe513d" OS-DCF:diskConfig="AUTO">
<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/d5d844c0-ecc3-4202-90ed-2e85b7fe513d" rel="self"/>
<atom:link href="http://openstack.example.com/openstack/servers/d5d844c0-ecc3-4202-90ed-2e85b7fe513d" rel="bookmark"/>
</server>

View File

@ -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=="
}
]
}
}

View File

@ -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>

View File

@ -0,0 +1,17 @@
{
"server": {
"OS-DCF:diskConfig": "AUTO",
"adminPass": "CQH9gWzgkVno",
"id": "324dfb7d-f4a9-419a-9a19-237df04b443b",
"links": [
{
"href": "http://openstack.example.com/v2/openstack/servers/324dfb7d-f4a9-419a-9a19-237df04b443b",
"rel": "self"
},
{
"href": "http://openstack.example.com/openstack/servers/324dfb7d-f4a9-419a-9a19-237df04b443b",
"rel": "bookmark"
}
]
}
}

View File

@ -0,0 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<server xmlns:OS-DCF="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" id="900a4ef7-f374-413f-8816-52d3dbfaf498" adminPass="Cj6sZgWq85qm" OS-DCF:diskConfig="AUTO">
<metadata/>
<atom:link href="http://openstack.example.com/v2/openstack/servers/900a4ef7-f374-413f-8816-52d3dbfaf498" rel="self"/>
<atom:link href="http://openstack.example.com/openstack/servers/900a4ef7-f374-413f-8816-52d3dbfaf498" rel="bookmark"/>
</server>

View File

@ -0,0 +1,6 @@
{
"resize": {
"flavorRef": "3",
"OS-DCF:diskConfig": "AUTO"
}
}

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<resize xmlns:OS-DCF="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-DCF:diskConfig="AUTO"
flavorRef="3" />

View File

@ -0,0 +1,5 @@
{
"server": {
"OS-DCF:diskConfig": "AUTO"
}
}

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<server xmlns:OS-DCF="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-DCF:diskConfig="AUTO" />

View File

@ -0,0 +1,55 @@
{
"server": {
"OS-DCF:diskConfig": "AUTO",
"accessIPv4": "",
"accessIPv6": "",
"addresses": {
"private": [
{
"addr": "192.168.0.3",
"version": 4
}
]
},
"created": "2012-12-02T02:11:57Z",
"flavor": {
"id": "1",
"links": [
{
"href": "http://openstack.example.com/openstack/flavors/1",
"rel": "bookmark"
}
]
},
"hostId": "6e84af987b4e7ec1c039b16d21f508f4a505672bd94fb0218b668d07",
"id": "324dfb7d-f4a9-419a-9a19-237df04b443b",
"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/324dfb7d-f4a9-419a-9a19-237df04b443b",
"rel": "self"
},
{
"href": "http://openstack.example.com/openstack/servers/324dfb7d-f4a9-419a-9a19-237df04b443b",
"rel": "bookmark"
}
],
"metadata": {
"My Server Name": "Apache1"
},
"name": "new-server-test",
"progress": 0,
"status": "ACTIVE",
"tenant_id": "openstack",
"updated": "2012-12-02T02:11:58Z",
"user_id": "fake"
}
}

View File

@ -0,0 +1,19 @@
<?xml version='1.0' encoding='UTF-8'?>
<server xmlns:OS-DCF="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" status="ACTIVE" updated="2012-12-02T02:15:40Z" hostId="e987bebf62599c59c4559b249d0f5f300a302d1e9ff22dd1f0c5c4b0" name="new-server-test" created="2012-12-02T02:15:40Z" userId="fake" tenantId="openstack" accessIPv4="" accessIPv6="" progress="0" id="900a4ef7-f374-413f-8816-52d3dbfaf498" OS-DCF:diskConfig="AUTO">
<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/900a4ef7-f374-413f-8816-52d3dbfaf498" rel="self"/>
<atom:link href="http://openstack.example.com/openstack/servers/900a4ef7-f374-413f-8816-52d3dbfaf498" rel="bookmark"/>
</server>

View File

@ -0,0 +1,34 @@
{
"image": {
"OS-DCF:diskConfig": "AUTO",
"created": "%(timestamp)s",
"id": "%(image_id)s",
"links": [
{
"href": "%(host)s/v2/openstack/images/%(image_id)s",
"rel": "self"
},
{
"href": "%(host)s/openstack/images/%(image_id)s",
"rel": "bookmark"
},
{
"href": "%(glance_host)s/openstack/images/%(image_id)s",
"rel": "alternate",
"type": "application/vnd.openstack.image"
}
],
"metadata": {
"architecture": "x86_64",
"auto_disk_config": "True",
"kernel_id": "nokernel",
"ramdisk_id": "nokernel"
},
"minDisk": 0,
"minRam": 0,
"name": "fakeimage7",
"progress": 100,
"status": "ACTIVE",
"updated": "%(timestamp)s"
}
}

View File

@ -0,0 +1,12 @@
<?xml version='1.0' encoding='UTF-8'?>
<image xmlns:OS-DCF="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" status="ACTIVE" updated="2011-01-01T01:02:03Z" name="fakeimage7" created="2011-01-01T01:02:03Z" minDisk="0" progress="100" minRam="0" id="%(image_id)s" OS-DCF:diskConfig="AUTO">
<metadata>
<meta key="kernel_id">nokernel</meta>
<meta key="auto_disk_config">True</meta>
<meta key="ramdisk_id">nokernel</meta>
<meta key="architecture">x86_64</meta>
</metadata>
<atom:link href="%(host)s/v2/openstack/images/%(image_id)s" rel="self"/>
<atom:link href="%(host)s/openstack/images/%(image_id)s" rel="bookmark"/>
<atom:link href="%(glance_host)s/openstack/images/%(image_id)s" type="application/vnd.openstack.image" rel="alternate"/>
</image>

View File

@ -0,0 +1,214 @@
{
"images": [
{
"OS-DCF:diskConfig": "AUTO",
"created": "%(timestamp)s",
"id": "%(id)s",
"links": [
{
"href": "%(host)s/v2/openstack/images/%(id)s",
"rel": "self"
},
{
"href": "%(host)s/openstack/images/%(id)s",
"rel": "bookmark"
},
{
"href": "%(glance_host)s/openstack/images/%(id)s",
"rel": "alternate",
"type": "application/vnd.openstack.image"
}
],
"metadata": {
"architecture": "x86_64",
"auto_disk_config": "True",
"kernel_id": "nokernel",
"ramdisk_id": "nokernel"
},
"minDisk": 0,
"minRam": 0,
"name": "fakeimage7",
"progress": 100,
"status": "ACTIVE",
"updated": "%(timestamp)s"
},
{
"created": "%(timestamp)s",
"id": "%(id)s",
"links": [
{
"href": "%(host)s/v2/openstack/images/%(id)s",
"rel": "self"
},
{
"href": "%(host)s/openstack/images/%(id)s",
"rel": "bookmark"
},
{
"href": "%(glance_host)s/openstack/images/%(id)s",
"rel": "alternate",
"type": "application/vnd.openstack.image"
}
],
"metadata": {
"architecture": "x86_64",
"kernel_id": "nokernel",
"ramdisk_id": "nokernel"
},
"minDisk": 0,
"minRam": 0,
"name": "fakeimage123456",
"progress": 100,
"status": "ACTIVE",
"updated": "%(timestamp)s"
},
{
"created": "%(timestamp)s",
"id": "%(uuid)s",
"links": [
{
"href": "%(host)s/v2/openstack/images/%(uuid)s",
"rel": "self"
},
{
"href": "%(host)s/openstack/images/%(uuid)s",
"rel": "bookmark"
},
{
"href": "%(glance_host)s/openstack/images/%(uuid)s",
"rel": "alternate",
"type": "application/vnd.openstack.image"
}
],
"metadata": {
"kernel_id": "nokernel",
"ramdisk_id": "nokernel"
},
"minDisk": 0,
"minRam": 0,
"name": "fakeimage123456",
"progress": 100,
"status": "ACTIVE",
"updated": "%(timestamp)s"
},
{
"OS-DCF:diskConfig": "MANUAL",
"created": "%(timestamp)s",
"id": "%(uuid)s",
"links": [
{
"href": "%(host)s/v2/openstack/images/%(uuid)s",
"rel": "self"
},
{
"href": "%(host)s/openstack/images/%(uuid)s",
"rel": "bookmark"
},
{
"href": "%(glance_host)s/openstack/images/%(uuid)s",
"rel": "alternate",
"type": "application/vnd.openstack.image"
}
],
"metadata": {
"architecture": "x86_64",
"auto_disk_config": "False",
"kernel_id": "nokernel",
"ramdisk_id": "nokernel"
},
"minDisk": 0,
"minRam": 0,
"name": "fakeimage6",
"progress": 100,
"status": "ACTIVE",
"updated": "%(timestamp)s"
},
{
"created": "%(timestamp)s",
"id": "%(id)s",
"links": [
{
"href": "%(host)s/v2/openstack/images/%(id)s",
"rel": "self"
},
{
"href": "%(host)s/openstack/images/%(id)s",
"rel": "bookmark"
},
{
"href": "%(glance_host)s/openstack/images/%(id)s",
"rel": "alternate",
"type": "application/vnd.openstack.image"
}
],
"metadata": {
"kernel_id": "%(id)s",
"ramdisk_id": null
},
"minDisk": 0,
"minRam": 0,
"name": "fakeimage123456",
"progress": 100,
"status": "ACTIVE",
"updated": "%(timestamp)s"
},
{
"created": "%(timestamp)s",
"id": "%(id)s",
"links": [
{
"href": "%(host)s/v2/openstack/images/%(id)s",
"rel": "self"
},
{
"href": "%(host)s/openstack/images/%(id)s",
"rel": "bookmark"
},
{
"href": "%(glance_host)s/openstack/images/%(id)s",
"rel": "alternate",
"type": "application/vnd.openstack.image"
}
],
"metadata": {
"kernel_id": "nokernel",
"ramdisk_id": "nokernel"
},
"minDisk": 0,
"minRam": 0,
"name": "fakeimage123456",
"progress": 100,
"status": "ACTIVE",
"updated": "%(timestamp)s"
},
{
"created": "%(timestamp)s",
"id": "%(id)s",
"links": [
{
"href": "%(host)s/v2/openstack/images/%(id)s",
"rel": "self"
},
{
"href": "%(host)s/openstack/images/%(id)s",
"rel": "bookmark"
},
{
"href": "%(glance_host)s/openstack/images/%(id)s",
"rel": "alternate",
"type": "application/vnd.openstack.image"
}
],
"metadata": {
"kernel_id": "nokernel",
"ramdisk_id": "nokernel"
},
"minDisk": 0,
"minRam": 0,
"name": "fakeimage123456",
"progress": 100,
"status": "ACTIVE",
"updated": "%(timestamp)s"
}
]
}

View File

@ -0,0 +1,71 @@
<?xml version='1.0' encoding='UTF-8'?>
<images xmlns:OS-DCF="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 status="ACTIVE" updated="%(timestamp)s" name="fakeimage7" created="%(timestamp)s" minDisk="0" progress="100" minRam="0" id="%(id)s" OS-DCF:diskConfig="AUTO">
<metadata>
<meta key="kernel_id">nokernel</meta>
<meta key="auto_disk_config">True</meta>
<meta key="ramdisk_id">nokernel</meta>
<meta key="architecture">x86_64</meta>
</metadata>
<atom:link href="%(host)s/v2/openstack/images/%(id)s" rel="self"/>
<atom:link href="%(host)s/openstack/images/%(id)s" rel="bookmark"/>
<atom:link href="%(glance_host)s/openstack/images/%(id)s" type="application/vnd.openstack.image" rel="alternate"/>
</image>
<image status="ACTIVE" updated="%(timestamp)s" name="fakeimage123456" created="%(timestamp)s" minDisk="0" progress="100" minRam="0" id="%(id)s">
<metadata>
<meta key="kernel_id">nokernel</meta>
<meta key="ramdisk_id">nokernel</meta>
<meta key="architecture">x86_64</meta>
</metadata>
<atom:link href="%(host)s/v2/openstack/images/%(id)s" rel="self"/>
<atom:link href="%(host)s/openstack/images/%(id)s" rel="bookmark"/>
<atom:link href="%(glance_host)s/openstack/images/%(id)s" type="application/vnd.openstack.image" rel="alternate"/>
</image>
<image status="ACTIVE" updated="%(timestamp)s" name="fakeimage123456" created="%(timestamp)s" minDisk="0" progress="100" minRam="0" id="%(id)s">
<metadata>
<meta key="kernel_id">nokernel</meta>
<meta key="ramdisk_id">nokernel</meta>
</metadata>
<atom:link href="%(host)s/v2/openstack/images/%(id)s" rel="self"/>
<atom:link href="%(host)s/openstack/images/%(id)s" rel="bookmark"/>
<atom:link href="%(glance_host)s/openstack/images/%(id)s" type="application/vnd.openstack.image" rel="alternate"/>
</image>
<image status="ACTIVE" updated="%(timestamp)s" name="fakeimage6" created="%(timestamp)s" minDisk="0" progress="100" minRam="0" id="%(id)s" OS-DCF:diskConfig="MANUAL">
<metadata>
<meta key="kernel_id">nokernel</meta>
<meta key="auto_disk_config">False</meta>
<meta key="ramdisk_id">nokernel</meta>
<meta key="architecture">x86_64</meta>
</metadata>
<atom:link href="%(host)s/v2/openstack/images/%(id)s" rel="self"/>
<atom:link href="%(host)s/openstack/images/%(id)s" rel="bookmark"/>
<atom:link href="%(glance_host)s/openstack/images/%(id)s" type="application/vnd.openstack.image" rel="alternate"/>
</image>
<image status="ACTIVE" updated="%(timestamp)s" name="fakeimage123456" created="%(timestamp)s" minDisk="0" progress="100" minRam="0" id="%(id)s">
<metadata>
<meta key="kernel_id">%(id)s</meta>
<meta key="ramdisk_id">None</meta>
</metadata>
<atom:link href="%(host)s/v2/openstack/images/%(id)s" rel="self"/>
<atom:link href="%(host)s/openstack/images/%(id)s" rel="bookmark"/>
<atom:link href="%(glance_host)s/openstack/images/%(id)s" type="application/vnd.openstack.image" rel="alternate"/>
</image>
<image status="ACTIVE" updated="%(timestamp)s" name="fakeimage123456" created="%(timestamp)s" minDisk="0" progress="100" minRam="0" id="%(id)s">
<metadata>
<meta key="kernel_id">nokernel</meta>
<meta key="ramdisk_id">nokernel</meta>
</metadata>
<atom:link href="%(host)s/v2/openstack/images/%(id)s" rel="self"/>
<atom:link href="%(host)s/openstack/images/%(id)s" rel="bookmark"/>
<atom:link href="%(glance_host)s/openstack/images/%(id)s" type="application/vnd.openstack.image" rel="alternate"/>
</image>
<image status="ACTIVE" updated="%(timestamp)s" name="fakeimage123456" created="%(timestamp)s" minDisk="0" progress="100" minRam="0" id="%(id)s">
<metadata>
<meta key="kernel_id">nokernel</meta>
<meta key="ramdisk_id">nokernel</meta>
</metadata>
<atom:link href="%(host)s/v2/openstack/images/%(id)s" rel="self"/>
<atom:link href="%(host)s/openstack/images/%(id)s" rel="bookmark"/>
<atom:link href="%(glance_host)s/openstack/images/%(id)s" type="application/vnd.openstack.image" rel="alternate"/>
</image>
</images>

View File

@ -0,0 +1,57 @@
{
"servers": [
{
"OS-DCF:diskConfig": "AUTO",
"accessIPv4": "",
"accessIPv6": "",
"addresses": {
"private": [
{
"addr": "%(ip)s",
"version": 4
}
]
},
"created": "%(timestamp)s",
"flavor": {
"id": "1",
"links": [
{
"href": "%(host)s/openstack/flavors/1",
"rel": "bookmark"
}
]
},
"hostId": "%(hostid)s",
"id": "%(id)s",
"image": {
"id": "%(uuid)s",
"links": [
{
"href": "%(host)s/openstack/images/%(uuid)s",
"rel": "bookmark"
}
]
},
"links": [
{
"href": "%(host)s/v2/openstack/servers/%(id)s",
"rel": "self"
},
{
"href": "%(host)s/openstack/servers/%(id)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"
}
]
}

View File

@ -0,0 +1,21 @@
<?xml version='1.0' encoding='UTF-8'?>
<servers xmlns:OS-DCF="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">
<server status="ACTIVE" updated="%(timestamp)s" hostId="%(hostid)s" name="new-server-test" created="%(timestamp)s" userId="fake" tenantId="openstack" accessIPv4="" accessIPv6="" progress="0" id="%(id)s" OS-DCF:diskConfig="AUTO">
<image id="%(uuid)s">
<atom:link href="%(host)s/openstack/images/%(uuid)s" rel="bookmark"/>
</image>
<flavor id="1">
<atom:link href="%(host)s/openstack/flavors/1" rel="bookmark"/>
</flavor>
<metadata>
<meta key="My Server Name">Apache1</meta>
</metadata>
<addresses>
<network id="private">
<ip version="4" addr="%(ip)s"/>
</network>
</addresses>
<atom:link href="%(host)s/v2/openstack/servers/%(id)s" rel="self"/>
<atom:link href="%(host)s/openstack/servers/%(id)s" rel="bookmark"/>
</server>
</servers>

View File

@ -0,0 +1,6 @@
{
"rebuild": {
"imageRef" : "%(host)s/openstack/images/%(image_id)s",
"OS-DCF:diskConfig": "AUTO"
}
}

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<rebuild xmlns:OS-DCF="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"
imageRef="%(host)s/openstack/images/%(image_id)s"
OS-DCF:diskConfig="AUTO" />

View File

@ -0,0 +1,56 @@
{
"server": {
"OS-DCF:diskConfig": "AUTO",
"accessIPv4": "",
"accessIPv6": "",
"addresses": {
"private": [
{
"addr": "%(ip)s",
"version": 4
}
]
},
"adminPass": "%(password)s",
"created": "%(timestamp)s",
"flavor": {
"id": "1",
"links": [
{
"href": "%(host)s/openstack/flavors/1",
"rel": "bookmark"
}
]
},
"hostId": "%(hostid)s",
"id": "%(id)s",
"image": {
"id": "%(uuid)s",
"links": [
{
"href": "%(host)s/openstack/images/%(uuid)s",
"rel": "bookmark"
}
]
},
"links": [
{
"href": "%(host)s/v2/openstack/servers/%(id)s",
"rel": "self"
},
{
"href": "%(host)s/openstack/servers/%(id)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"
}
}

View File

@ -0,0 +1,19 @@
<?xml version='1.0' encoding='UTF-8'?>
<server xmlns:OS-DCF="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" status="ACTIVE" updated="%(timestamp)s" hostId="%(hostid)s" name="new-server-test" created="%(timestamp)s" userId="fake" tenantId="openstack" accessIPv4="" accessIPv6="" progress="0" id="%(id)s" adminPass="%(password)s" OS-DCF:diskConfig="AUTO">
<image id="%(uuid)s">
<atom:link href="%(host)s/openstack/images/%(uuid)s" rel="bookmark"/>
</image>
<flavor id="1">
<atom:link href="%(host)s/openstack/flavors/1" rel="bookmark"/>
</flavor>
<metadata>
<meta key="My Server Name">Apache1</meta>
</metadata>
<addresses>
<network id="private">
<ip version="4" addr="%(ip)s"/>
</network>
</addresses>
<atom:link href="%(host)s/v2/openstack/servers/%(id)s" rel="self"/>
<atom:link href="%(host)s/openstack/servers/%(id)s" rel="bookmark"/>
</server>

View File

@ -0,0 +1,55 @@
{
"server": {
"OS-DCF:diskConfig": "AUTO",
"accessIPv4": "",
"accessIPv6": "",
"addresses": {
"private": [
{
"addr": "%(ip)s",
"version": 4
}
]
},
"created": "%(timestamp)s",
"flavor": {
"id": "1",
"links": [
{
"href": "%(host)s/openstack/flavors/1",
"rel": "bookmark"
}
]
},
"hostId": "%(hostid)s",
"id": "%(id)s",
"image": {
"id": "%(uuid)s",
"links": [
{
"href": "%(host)s/openstack/images/%(uuid)s",
"rel": "bookmark"
}
]
},
"links": [
{
"href": "%(host)s/v2/openstack/servers/%(id)s",
"rel": "self"
},
{
"href": "%(host)s/openstack/servers/%(id)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"
}
}

View File

@ -0,0 +1,19 @@
<?xml version='1.0' encoding='UTF-8'?>
<server xmlns:OS-DCF="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" status="ACTIVE" updated="%(timestamp)s" hostId="%(hostid)s" name="new-server-test" created="%(timestamp)s" userId="fake" tenantId="openstack" accessIPv4="" accessIPv6="" progress="0" id="%(id)s" OS-DCF:diskConfig="AUTO">
<image id="%(uuid)s">
<atom:link href="%(host)s/openstack/images/%(uuid)s" rel="bookmark"/>
</image>
<flavor id="1">
<atom:link href="%(host)s/openstack/flavors/1" rel="bookmark"/>
</flavor>
<metadata>
<meta key="My Server Name">Apache1</meta>
</metadata>
<addresses>
<network id="private">
<ip version="4" addr="%(ip)s"/>
</network>
</addresses>
<atom:link href="%(host)s/v2/openstack/servers/%(id)s" rel="self"/>
<atom:link href="%(host)s/openstack/servers/%(id)s" rel="bookmark"/>
</server>

View File

@ -0,0 +1,17 @@
{
"server" : {
"OS-DCF:diskConfig": "AUTO",
"name" : "new-server-test",
"imageRef" : "%(host)s/openstack/images/%(image_id)s",
"flavorRef" : "%(host)s/openstack/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
},
"personality" : [
{
"path" : "/etc/banner.txt",
"contents" : "ICAgICAgDQoiQSBjbG91ZCBkb2VzIG5vdCBrbm93IHdoeSBpdCBtb3ZlcyBpbiBqdXN0IHN1Y2ggYSBkaXJlY3Rpb24gYW5kIGF0IHN1Y2ggYSBzcGVlZC4uLkl0IGZlZWxzIGFuIGltcHVsc2lvbi4uLnRoaXMgaXMgdGhlIHBsYWNlIHRvIGdvIG5vdy4gQnV0IHRoZSBza3kga25vd3MgdGhlIHJlYXNvbnMgYW5kIHRoZSBwYXR0ZXJucyBiZWhpbmQgYWxsIGNsb3VkcywgYW5kIHlvdSB3aWxsIGtub3csIHRvbywgd2hlbiB5b3UgbGlmdCB5b3Vyc2VsZiBoaWdoIGVub3VnaCB0byBzZWUgYmV5b25kIGhvcml6b25zLiINCg0KLVJpY2hhcmQgQmFjaA=="
}
]
}
}

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<server xmlns="http://docs.openstack.org/compute/api/v1.1" imageRef="%(host)s/openstack/images/%(image_id)s" flavorRef="%(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>

View File

@ -0,0 +1,17 @@
{
"server": {
"OS-DCF:diskConfig": "AUTO",
"adminPass": "%(password)s",
"id": "%(id)s",
"links": [
{
"href": "%(host)s/v2/openstack/servers/%(uuid)s",
"rel": "self"
},
{
"href": "%(host)s/openstack/servers/%(uuid)s",
"rel": "bookmark"
}
]
}
}

View File

@ -0,0 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<server xmlns:OS-DCF="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" id="%(id)s" adminPass="%(password)s" OS-DCF:diskConfig="AUTO">
<metadata/>
<atom:link href="%(host)s/v2/openstack/servers/%(uuid)s" rel="self"/>
<atom:link href="%(host)s/openstack/servers/%(uuid)s" rel="bookmark"/>
</server>

View File

@ -0,0 +1,6 @@
{
"resize": {
"flavorRef": "3",
"OS-DCF:diskConfig": "AUTO"
}
}

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<resize xmlns:OS-DCF="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-DCF:diskConfig="AUTO"
flavorRef="3" />

View File

@ -0,0 +1,5 @@
{
"server": {
"OS-DCF:diskConfig": "AUTO"
}
}

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<server xmlns:OS-DCF="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-DCF:diskConfig="AUTO" />

View File

@ -0,0 +1,55 @@
{
"server": {
"OS-DCF:diskConfig": "AUTO",
"accessIPv4": "",
"accessIPv6": "",
"addresses": {
"private": [
{
"addr": "%(ip)s",
"version": 4
}
]
},
"created": "%(timestamp)s",
"flavor": {
"id": "1",
"links": [
{
"href": "%(host)s/openstack/flavors/1",
"rel": "bookmark"
}
]
},
"hostId": "%(hostid)s",
"id": "%(id)s",
"image": {
"id": "%(uuid)s",
"links": [
{
"href": "%(host)s/openstack/images/%(uuid)s",
"rel": "bookmark"
}
]
},
"links": [
{
"href": "%(host)s/v2/openstack/servers/%(id)s",
"rel": "self"
},
{
"href": "%(host)s/openstack/servers/%(id)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"
}
}

View File

@ -0,0 +1,24 @@
<?xml version='1.0' encoding='UTF-8'?>
<server xmlns:OS-DCF="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" status="ACTIVE" updated="%(timestamp)s"
hostId="%(hostid)s" name="new-server-test" created="%(timestamp)s" userId="fake"
tenantId="openstack" accessIPv4="" accessIPv6="" progress="0" id="%(id)s"
OS-DCF:diskConfig="AUTO">
<image id="%(uuid)s">
<atom:link href="%(host)s/openstack/images/%(uuid)s" rel="bookmark"/>
</image>
<flavor id="1">
<atom:link href="%(host)s/openstack/flavors/1" rel="bookmark"/>
</flavor>
<metadata>
<meta key="My Server Name">Apache1</meta>
</metadata>
<addresses>
<network id="private">
<ip version="4" addr="%(ip)s"/>
</network>
</addresses>
<atom:link href="%(host)s/v2/openstack/servers/%(id)s" rel="self"/>
<atom:link href="%(host)s/openstack/servers/%(id)s" rel="bookmark"/>
</server>

View File

@ -1896,3 +1896,78 @@ class FlavorManageSampleJsonTests(ApiSampleTestBase):
class FlavorManageSampleXmlTests(FlavorManageSampleJsonTests):
ctype = "xml"
class DiskConfigJsonTest(ServersSampleBase):
extension_name = ("nova.api.openstack.compute.contrib.disk_config."
"Disk_config")
def test_list_servers_detail(self):
uuid = self._post_server()
response = self._do_get('servers/detail')
self.assertEqual(response.status, 200)
subs = self._get_regexes()
subs['hostid'] = '[a-f0-9]+'
subs['id'] = uuid
return self._verify_response('list-servers-detail-get',
subs, response)
def test_get_server(self):
uuid = self._post_server()
response = self._do_get('servers/%s' % uuid)
self.assertEqual(response.status, 200)
subs = self._get_regexes()
subs['hostid'] = '[a-f0-9]+'
return self._verify_response('server-get-resp', subs, response)
def test_update_server(self):
uuid = self._post_server()
response = self._do_put('servers/%s' % uuid,
'server-update-put-req', {})
self.assertEqual(response.status, 200)
subs = self._get_regexes()
subs['hostid'] = '[a-f0-9]+'
return self._verify_response('server-update-put-resp',
subs, response)
def test_resize_server(self):
self.flags(allow_resize_to_same_host=True)
uuid = self._post_server()
response = self._do_post('servers/%s/action' % uuid,
'server-resize-post-req', {})
self.assertEqual(response.status, 202)
# NOTE(tmello): Resize does not return response body
# Bug #1085213.
self.assertEqual(response.read(), "")
def test_rebuild_server(self):
uuid = self._post_server()
subs = {
'image_id': fake.get_valid_image_id(),
'host': self._get_host(),
}
response = self._do_post('servers/%s/action' % uuid,
'server-action-rebuild-req', subs)
self.assertEqual(response.status, 202)
subs = self._get_regexes()
subs['hostid'] = '[a-f0-9]+'
return self._verify_response('server-action-rebuild-resp',
subs, response)
def test_get_image(self):
image_id = fake.get_valid_image_id()
response = self._do_get('images/%s' % image_id)
self.assertEqual(response.status, 200)
subs = self._get_regexes()
subs['image_id'] = image_id
return self._verify_response('image-get-resp', subs, response)
def test_list_images(self):
response = self._do_get('images/detail')
self.assertEqual(response.status, 200)
subs = self._get_regexes()
return self._verify_response('image-list-resp', subs, response)
class DiskConfigXmlTest(DiskConfigJsonTest):
ctype = 'xml'