diff --git a/doc/api_samples/os-admin-actions/admin-actions-backup-server.json b/doc/api_samples/os-admin-actions/admin-actions-backup-server.json
new file mode 100644
index 000000000000..38c03b0eb0fe
--- /dev/null
+++ b/doc/api_samples/os-admin-actions/admin-actions-backup-server.json
@@ -0,0 +1,7 @@
+{
+ "createBackup": {
+ "name": "Backup 1",
+ "backup_type": "daily",
+ "rotation": 1
+ }
+}
\ No newline at end of file
diff --git a/doc/api_samples/os-admin-actions/admin-actions-backup-server.xml b/doc/api_samples/os-admin-actions/admin-actions-backup-server.xml
new file mode 100644
index 000000000000..0acb17695194
--- /dev/null
+++ b/doc/api_samples/os-admin-actions/admin-actions-backup-server.xml
@@ -0,0 +1,6 @@
+
+
+ Backup 1
+ daily
+ 1
+
\ No newline at end of file
diff --git a/doc/api_samples/os-admin-actions/admin-actions-inject-network-info.json b/doc/api_samples/os-admin-actions/admin-actions-inject-network-info.json
new file mode 100644
index 000000000000..d47c1133a5cc
--- /dev/null
+++ b/doc/api_samples/os-admin-actions/admin-actions-inject-network-info.json
@@ -0,0 +1,3 @@
+{
+ "injectNetworkInfo": null
+}
\ No newline at end of file
diff --git a/doc/api_samples/os-admin-actions/admin-actions-inject-network-info.xml b/doc/api_samples/os-admin-actions/admin-actions-inject-network-info.xml
new file mode 100644
index 000000000000..6091a5ed7b31
--- /dev/null
+++ b/doc/api_samples/os-admin-actions/admin-actions-inject-network-info.xml
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/doc/api_samples/os-admin-actions/admin-actions-live-migrate.json b/doc/api_samples/os-admin-actions/admin-actions-live-migrate.json
new file mode 100644
index 000000000000..6ba79bb44e88
--- /dev/null
+++ b/doc/api_samples/os-admin-actions/admin-actions-live-migrate.json
@@ -0,0 +1,7 @@
+{
+ "os-migrateLive": {
+ "host": "0443e9a1254044d8b99f35eace132080",
+ "block_migration": false,
+ "disk_over_commit": false
+ }
+}
\ No newline at end of file
diff --git a/doc/api_samples/os-admin-actions/admin-actions-live-migrate.xml b/doc/api_samples/os-admin-actions/admin-actions-live-migrate.xml
new file mode 100644
index 000000000000..35269d76e309
--- /dev/null
+++ b/doc/api_samples/os-admin-actions/admin-actions-live-migrate.xml
@@ -0,0 +1,6 @@
+
+
+ 6217bf142bb3491995f966af999f9f23
+ false
+ false
+
\ No newline at end of file
diff --git a/doc/api_samples/os-admin-actions/admin-actions-lock-server.json b/doc/api_samples/os-admin-actions/admin-actions-lock-server.json
new file mode 100644
index 000000000000..d7e96964ef23
--- /dev/null
+++ b/doc/api_samples/os-admin-actions/admin-actions-lock-server.json
@@ -0,0 +1,3 @@
+{
+ "lock": null
+}
\ No newline at end of file
diff --git a/doc/api_samples/os-admin-actions/admin-actions-lock-server.xml b/doc/api_samples/os-admin-actions/admin-actions-lock-server.xml
new file mode 100644
index 000000000000..943691c746a4
--- /dev/null
+++ b/doc/api_samples/os-admin-actions/admin-actions-lock-server.xml
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/doc/api_samples/os-admin-actions/admin-actions-lock.json b/doc/api_samples/os-admin-actions/admin-actions-lock.json
new file mode 100644
index 000000000000..a1863f2f3914
--- /dev/null
+++ b/doc/api_samples/os-admin-actions/admin-actions-lock.json
@@ -0,0 +1,3 @@
+{
+ "lock": null
+}
diff --git a/doc/api_samples/os-admin-actions/admin-actions-migrate.json b/doc/api_samples/os-admin-actions/admin-actions-migrate.json
new file mode 100644
index 000000000000..c42f2c63fb63
--- /dev/null
+++ b/doc/api_samples/os-admin-actions/admin-actions-migrate.json
@@ -0,0 +1,3 @@
+{
+ "migrate": null
+}
\ No newline at end of file
diff --git a/doc/api_samples/os-admin-actions/admin-actions-migrate.xml b/doc/api_samples/os-admin-actions/admin-actions-migrate.xml
new file mode 100644
index 000000000000..c686d9e19df6
--- /dev/null
+++ b/doc/api_samples/os-admin-actions/admin-actions-migrate.xml
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/doc/api_samples/os-admin-actions/admin-actions-pause.json b/doc/api_samples/os-admin-actions/admin-actions-pause.json
new file mode 100644
index 000000000000..c44ca70599da
--- /dev/null
+++ b/doc/api_samples/os-admin-actions/admin-actions-pause.json
@@ -0,0 +1,3 @@
+{
+ "pause": null
+}
\ No newline at end of file
diff --git a/doc/api_samples/os-admin-actions/admin-actions-pause.xml b/doc/api_samples/os-admin-actions/admin-actions-pause.xml
new file mode 100644
index 000000000000..6a61bc26b3b2
--- /dev/null
+++ b/doc/api_samples/os-admin-actions/admin-actions-pause.xml
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/doc/api_samples/os-admin-actions/admin-actions-reset-network.json b/doc/api_samples/os-admin-actions/admin-actions-reset-network.json
new file mode 100644
index 000000000000..02730e7867f0
--- /dev/null
+++ b/doc/api_samples/os-admin-actions/admin-actions-reset-network.json
@@ -0,0 +1,3 @@
+{
+ "resetNetwork": null
+}
\ No newline at end of file
diff --git a/doc/api_samples/os-admin-actions/admin-actions-reset-network.xml b/doc/api_samples/os-admin-actions/admin-actions-reset-network.xml
new file mode 100644
index 000000000000..d800b3decf6b
--- /dev/null
+++ b/doc/api_samples/os-admin-actions/admin-actions-reset-network.xml
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/doc/api_samples/os-admin-actions/admin-actions-reset-server-state.json b/doc/api_samples/os-admin-actions/admin-actions-reset-server-state.json
new file mode 100644
index 000000000000..3e183fbfba99
--- /dev/null
+++ b/doc/api_samples/os-admin-actions/admin-actions-reset-server-state.json
@@ -0,0 +1,5 @@
+{
+ "os-resetState": {
+ "state": "active"
+ }
+}
\ No newline at end of file
diff --git a/doc/api_samples/os-admin-actions/admin-actions-reset-server-state.xml b/doc/api_samples/os-admin-actions/admin-actions-reset-server-state.xml
new file mode 100644
index 000000000000..976be070d5b7
--- /dev/null
+++ b/doc/api_samples/os-admin-actions/admin-actions-reset-server-state.xml
@@ -0,0 +1,4 @@
+
+
+ active
+
\ No newline at end of file
diff --git a/doc/api_samples/os-admin-actions/admin-actions-reset-state.json b/doc/api_samples/os-admin-actions/admin-actions-reset-state.json
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/doc/api_samples/os-admin-actions/admin-actions-reset-state.xml b/doc/api_samples/os-admin-actions/admin-actions-reset-state.xml
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/doc/api_samples/os-admin-actions/admin-actions-resume.json b/doc/api_samples/os-admin-actions/admin-actions-resume.json
new file mode 100644
index 000000000000..008ff18c719c
--- /dev/null
+++ b/doc/api_samples/os-admin-actions/admin-actions-resume.json
@@ -0,0 +1,3 @@
+{
+ "resume": null
+}
\ No newline at end of file
diff --git a/doc/api_samples/os-admin-actions/admin-actions-resume.xml b/doc/api_samples/os-admin-actions/admin-actions-resume.xml
new file mode 100644
index 000000000000..d53370e158d0
--- /dev/null
+++ b/doc/api_samples/os-admin-actions/admin-actions-resume.xml
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/doc/api_samples/os-admin-actions/admin-actions-suspend.json b/doc/api_samples/os-admin-actions/admin-actions-suspend.json
new file mode 100644
index 000000000000..7bee7020520b
--- /dev/null
+++ b/doc/api_samples/os-admin-actions/admin-actions-suspend.json
@@ -0,0 +1,3 @@
+{
+ "suspend": null
+}
\ No newline at end of file
diff --git a/doc/api_samples/os-admin-actions/admin-actions-suspend.xml b/doc/api_samples/os-admin-actions/admin-actions-suspend.xml
new file mode 100644
index 000000000000..1da7328b513e
--- /dev/null
+++ b/doc/api_samples/os-admin-actions/admin-actions-suspend.xml
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/doc/api_samples/os-admin-actions/admin-actions-unlock-server.json b/doc/api_samples/os-admin-actions/admin-actions-unlock-server.json
new file mode 100644
index 000000000000..0eba7e725291
--- /dev/null
+++ b/doc/api_samples/os-admin-actions/admin-actions-unlock-server.json
@@ -0,0 +1,3 @@
+{
+ "unlock": null
+}
\ No newline at end of file
diff --git a/doc/api_samples/os-admin-actions/admin-actions-unlock-server.xml b/doc/api_samples/os-admin-actions/admin-actions-unlock-server.xml
new file mode 100644
index 000000000000..5c59e3a577fc
--- /dev/null
+++ b/doc/api_samples/os-admin-actions/admin-actions-unlock-server.xml
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/doc/api_samples/os-admin-actions/admin-actions-unlock.json b/doc/api_samples/os-admin-actions/admin-actions-unlock.json
new file mode 100644
index 000000000000..9e905ca2b99e
--- /dev/null
+++ b/doc/api_samples/os-admin-actions/admin-actions-unlock.json
@@ -0,0 +1,3 @@
+{
+ "unlock": null
+}
diff --git a/doc/api_samples/os-admin-actions/admin-actions-unpause.json b/doc/api_samples/os-admin-actions/admin-actions-unpause.json
new file mode 100644
index 000000000000..fdc0c410c3d5
--- /dev/null
+++ b/doc/api_samples/os-admin-actions/admin-actions-unpause.json
@@ -0,0 +1,3 @@
+{
+ "unpause": null
+}
\ No newline at end of file
diff --git a/doc/api_samples/os-admin-actions/admin-actions-unpause.xml b/doc/api_samples/os-admin-actions/admin-actions-unpause.xml
new file mode 100644
index 000000000000..1c3b538c134e
--- /dev/null
+++ b/doc/api_samples/os-admin-actions/admin-actions-unpause.xml
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/doc/api_samples/os-admin-actions/server-post-req.json b/doc/api_samples/os-admin-actions/server-post-req.json
new file mode 100644
index 000000000000..d88eb4122223
--- /dev/null
+++ b/doc/api_samples/os-admin-actions/server-post-req.json
@@ -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=="
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/doc/api_samples/os-admin-actions/server-post-req.xml b/doc/api_samples/os-admin-actions/server-post-req.xml
new file mode 100644
index 000000000000..0a3c8bb5303d
--- /dev/null
+++ b/doc/api_samples/os-admin-actions/server-post-req.xml
@@ -0,0 +1,19 @@
+
+
+
+ Apache1
+
+
+
+ ICAgICAgDQoiQSBjbG91ZCBkb2VzIG5vdCBrbm93IHdoeSBp
+ dCBtb3ZlcyBpbiBqdXN0IHN1Y2ggYSBkaXJlY3Rpb24gYW5k
+ IGF0IHN1Y2ggYSBzcGVlZC4uLkl0IGZlZWxzIGFuIGltcHVs
+ c2lvbi4uLnRoaXMgaXMgdGhlIHBsYWNlIHRvIGdvIG5vdy4g
+ QnV0IHRoZSBza3kga25vd3MgdGhlIHJlYXNvbnMgYW5kIHRo
+ ZSBwYXR0ZXJucyBiZWhpbmQgYWxsIGNsb3VkcywgYW5kIHlv
+ dSB3aWxsIGtub3csIHRvbywgd2hlbiB5b3UgbGlmdCB5b3Vy
+ c2VsZiBoaWdoIGVub3VnaCB0byBzZWUgYmV5b25kIGhvcml6
+ b25zLiINCg0KLVJpY2hhcmQgQmFjaA==
+
+
+
\ No newline at end of file
diff --git a/doc/api_samples/os-admin-actions/server-post-resp.json b/doc/api_samples/os-admin-actions/server-post-resp.json
new file mode 100644
index 000000000000..43021e233ea4
--- /dev/null
+++ b/doc/api_samples/os-admin-actions/server-post-resp.json
@@ -0,0 +1,16 @@
+{
+ "server": {
+ "adminPass": "GrsuNLsSKd5N",
+ "id": "b63a8fc6-2977-4a11-a611-3ec45f839c4c",
+ "links": [
+ {
+ "href": "http://openstack.example.com/v2/openstack/servers/b63a8fc6-2977-4a11-a611-3ec45f839c4c",
+ "rel": "self"
+ },
+ {
+ "href": "http://openstack.example.com/openstack/servers/b63a8fc6-2977-4a11-a611-3ec45f839c4c",
+ "rel": "bookmark"
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/doc/api_samples/os-admin-actions/server-post-resp.xml b/doc/api_samples/os-admin-actions/server-post-resp.xml
new file mode 100644
index 000000000000..06f00f80e4aa
--- /dev/null
+++ b/doc/api_samples/os-admin-actions/server-post-resp.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-backup-server.json.tpl b/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-backup-server.json.tpl
new file mode 100644
index 000000000000..60f5e1d9fe40
--- /dev/null
+++ b/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-backup-server.json.tpl
@@ -0,0 +1,7 @@
+{
+ "createBackup": {
+ "name": "Backup 1",
+ "backup_type": "daily",
+ "rotation": 1
+ }
+}
diff --git a/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-backup-server.xml.tpl b/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-backup-server.xml.tpl
new file mode 100644
index 000000000000..f2f9024bd7b6
--- /dev/null
+++ b/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-backup-server.xml.tpl
@@ -0,0 +1,6 @@
+
+
+ Backup 1
+ daily
+ 1
+
diff --git a/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-inject-network-info.json.tpl b/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-inject-network-info.json.tpl
new file mode 100644
index 000000000000..62e16737b085
--- /dev/null
+++ b/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-inject-network-info.json.tpl
@@ -0,0 +1,3 @@
+{
+ "injectNetworkInfo": null
+}
diff --git a/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-inject-network-info.xml.tpl b/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-inject-network-info.xml.tpl
new file mode 100644
index 000000000000..e5b71ffcdb5f
--- /dev/null
+++ b/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-inject-network-info.xml.tpl
@@ -0,0 +1,2 @@
+
+
diff --git a/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-live-migrate.json.tpl b/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-live-migrate.json.tpl
new file mode 100644
index 000000000000..4800d4aa1110
--- /dev/null
+++ b/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-live-migrate.json.tpl
@@ -0,0 +1,7 @@
+{
+ "os-migrateLive": {
+ "host": "%(hostname)s",
+ "block_migration": false,
+ "disk_over_commit": false
+ }
+}
diff --git a/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-live-migrate.xml.tpl b/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-live-migrate.xml.tpl
new file mode 100644
index 000000000000..88ead85f202a
--- /dev/null
+++ b/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-live-migrate.xml.tpl
@@ -0,0 +1,6 @@
+
+
+ %(hostname)s
+ false
+ false
+
diff --git a/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-lock-server.json.tpl b/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-lock-server.json.tpl
new file mode 100644
index 000000000000..a1863f2f3914
--- /dev/null
+++ b/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-lock-server.json.tpl
@@ -0,0 +1,3 @@
+{
+ "lock": null
+}
diff --git a/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-lock-server.xml.tpl b/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-lock-server.xml.tpl
new file mode 100644
index 000000000000..f86b13054774
--- /dev/null
+++ b/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-lock-server.xml.tpl
@@ -0,0 +1,2 @@
+
+
diff --git a/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-migrate.json.tpl b/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-migrate.json.tpl
new file mode 100644
index 000000000000..a9bf8c483e0f
--- /dev/null
+++ b/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-migrate.json.tpl
@@ -0,0 +1,3 @@
+{
+ "migrate": null
+}
diff --git a/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-migrate.xml.tpl b/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-migrate.xml.tpl
new file mode 100644
index 000000000000..431284448de7
--- /dev/null
+++ b/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-migrate.xml.tpl
@@ -0,0 +1,2 @@
+
+
diff --git a/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-pause.json.tpl b/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-pause.json.tpl
new file mode 100644
index 000000000000..2e7c1fad307f
--- /dev/null
+++ b/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-pause.json.tpl
@@ -0,0 +1,3 @@
+{
+ "pause": null
+}
diff --git a/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-pause.xml.tpl b/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-pause.xml.tpl
new file mode 100644
index 000000000000..a37359338c83
--- /dev/null
+++ b/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-pause.xml.tpl
@@ -0,0 +1,2 @@
+
+
diff --git a/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-reset-network.json.tpl b/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-reset-network.json.tpl
new file mode 100644
index 000000000000..7c79cb68a514
--- /dev/null
+++ b/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-reset-network.json.tpl
@@ -0,0 +1,3 @@
+{
+ "resetNetwork": null
+}
diff --git a/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-reset-network.xml.tpl b/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-reset-network.xml.tpl
new file mode 100644
index 000000000000..6034983911da
--- /dev/null
+++ b/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-reset-network.xml.tpl
@@ -0,0 +1,2 @@
+
+
diff --git a/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-reset-server-state.json.tpl b/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-reset-server-state.json.tpl
new file mode 100644
index 000000000000..013aed482413
--- /dev/null
+++ b/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-reset-server-state.json.tpl
@@ -0,0 +1,5 @@
+{
+ "os-resetState": {
+ "state": "active"
+ }
+}
diff --git a/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-reset-server-state.xml.tpl b/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-reset-server-state.xml.tpl
new file mode 100644
index 000000000000..435c1c7d76f8
--- /dev/null
+++ b/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-reset-server-state.xml.tpl
@@ -0,0 +1,4 @@
+
+
+ active
+
diff --git a/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-reset-state.json.tpl b/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-reset-state.json.tpl
new file mode 100644
index 000000000000..72d94786789a
--- /dev/null
+++ b/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-reset-state.json.tpl
@@ -0,0 +1,5 @@
+{
+ 'os-resetState': {
+ 'state': 'active'
+ }
+}
diff --git a/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-reset-state.xml.tpl b/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-reset-state.xml.tpl
new file mode 100644
index 000000000000..435c1c7d76f8
--- /dev/null
+++ b/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-reset-state.xml.tpl
@@ -0,0 +1,4 @@
+
+
+ active
+
diff --git a/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-resume.json.tpl b/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-resume.json.tpl
new file mode 100644
index 000000000000..ff00d97a14cb
--- /dev/null
+++ b/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-resume.json.tpl
@@ -0,0 +1,3 @@
+{
+ "resume": null
+}
diff --git a/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-resume.xml.tpl b/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-resume.xml.tpl
new file mode 100644
index 000000000000..4d6aaa750cf6
--- /dev/null
+++ b/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-resume.xml.tpl
@@ -0,0 +1,2 @@
+
+
diff --git a/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-suspend.json.tpl b/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-suspend.json.tpl
new file mode 100644
index 000000000000..8c2206a063bc
--- /dev/null
+++ b/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-suspend.json.tpl
@@ -0,0 +1,3 @@
+{
+ "suspend": null
+}
diff --git a/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-suspend.xml.tpl b/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-suspend.xml.tpl
new file mode 100644
index 000000000000..02aeac572a36
--- /dev/null
+++ b/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-suspend.xml.tpl
@@ -0,0 +1,2 @@
+
+
diff --git a/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-unlock-server.json.tpl b/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-unlock-server.json.tpl
new file mode 100644
index 000000000000..9e905ca2b99e
--- /dev/null
+++ b/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-unlock-server.json.tpl
@@ -0,0 +1,3 @@
+{
+ "unlock": null
+}
diff --git a/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-unlock-server.xml.tpl b/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-unlock-server.xml.tpl
new file mode 100644
index 000000000000..8331e2258a62
--- /dev/null
+++ b/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-unlock-server.xml.tpl
@@ -0,0 +1,2 @@
+
+
diff --git a/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-unpause.json.tpl b/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-unpause.json.tpl
new file mode 100644
index 000000000000..ce5024f0c92a
--- /dev/null
+++ b/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-unpause.json.tpl
@@ -0,0 +1,3 @@
+{
+ "unpause": null
+}
diff --git a/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-unpause.xml.tpl b/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-unpause.xml.tpl
new file mode 100644
index 000000000000..b674f09269d5
--- /dev/null
+++ b/nova/tests/integrated/api_samples/os-admin-actions/admin-actions-unpause.xml.tpl
@@ -0,0 +1,2 @@
+
+
diff --git a/nova/tests/integrated/api_samples/os-admin-actions/server-post-req.json.tpl b/nova/tests/integrated/api_samples/os-admin-actions/server-post-req.json.tpl
new file mode 100644
index 000000000000..d3916d1aa68a
--- /dev/null
+++ b/nova/tests/integrated/api_samples/os-admin-actions/server-post-req.json.tpl
@@ -0,0 +1,16 @@
+{
+ "server" : {
+ "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=="
+ }
+ ]
+ }
+}
diff --git a/nova/tests/integrated/api_samples/os-admin-actions/server-post-req.xml.tpl b/nova/tests/integrated/api_samples/os-admin-actions/server-post-req.xml.tpl
new file mode 100644
index 000000000000..f92614984242
--- /dev/null
+++ b/nova/tests/integrated/api_samples/os-admin-actions/server-post-req.xml.tpl
@@ -0,0 +1,19 @@
+
+
+
+ Apache1
+
+
+
+ ICAgICAgDQoiQSBjbG91ZCBkb2VzIG5vdCBrbm93IHdoeSBp
+ dCBtb3ZlcyBpbiBqdXN0IHN1Y2ggYSBkaXJlY3Rpb24gYW5k
+ IGF0IHN1Y2ggYSBzcGVlZC4uLkl0IGZlZWxzIGFuIGltcHVs
+ c2lvbi4uLnRoaXMgaXMgdGhlIHBsYWNlIHRvIGdvIG5vdy4g
+ QnV0IHRoZSBza3kga25vd3MgdGhlIHJlYXNvbnMgYW5kIHRo
+ ZSBwYXR0ZXJucyBiZWhpbmQgYWxsIGNsb3VkcywgYW5kIHlv
+ dSB3aWxsIGtub3csIHRvbywgd2hlbiB5b3UgbGlmdCB5b3Vy
+ c2VsZiBoaWdoIGVub3VnaCB0byBzZWUgYmV5b25kIGhvcml6
+ b25zLiINCg0KLVJpY2hhcmQgQmFjaA==
+
+
+
diff --git a/nova/tests/integrated/api_samples/os-admin-actions/server-post-resp.json.tpl b/nova/tests/integrated/api_samples/os-admin-actions/server-post-resp.json.tpl
new file mode 100644
index 000000000000..d5f030c8730b
--- /dev/null
+++ b/nova/tests/integrated/api_samples/os-admin-actions/server-post-resp.json.tpl
@@ -0,0 +1,16 @@
+{
+ "server": {
+ "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"
+ }
+ ]
+ }
+}
diff --git a/nova/tests/integrated/api_samples/os-admin-actions/server-post-resp.xml.tpl b/nova/tests/integrated/api_samples/os-admin-actions/server-post-resp.xml.tpl
new file mode 100644
index 000000000000..3bb13e69bd6d
--- /dev/null
+++ b/nova/tests/integrated/api_samples/os-admin-actions/server-post-resp.xml.tpl
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/nova/tests/integrated/test_api_samples.py b/nova/tests/integrated/test_api_samples.py
index f2ccbc22c0a0..8f7e29f37dec 100644
--- a/nova/tests/integrated/test_api_samples.py
+++ b/nova/tests/integrated/test_api_samples.py
@@ -31,6 +31,7 @@ from nova.openstack.common import importutils
from nova.openstack.common import jsonutils
from nova.openstack.common.log import logging
from nova.openstack.common import timeutils
+from nova.scheduler import driver
from nova import test
from nova.tests import fake_network
from nova.tests.image import fake
@@ -1306,4 +1307,110 @@ class AvailabilityZoneJsonTest(ServersSampleBase):
class AvailabilityZoneXmlTest(AvailabilityZoneJsonTest):
+ ctype = "xml"
+
+
+class AdminActionsSamplesJsonTest(ServersSampleBase):
+ extension_name = ("nova.api.openstack.compute.contrib.admin_actions."
+ "Admin_actions")
+
+ def setUp(self):
+ """setUp Method for AdminActions api samples extension
+ This method creates the server that will be used in each tests"""
+ super(AdminActionsSamplesJsonTest, self).setUp()
+ self.uuid = self._post_server()
+
+ def test_post_pause(self):
+ """Get api samples to pause server request"""
+ response = self._do_post('servers/%s/action' % self.uuid,
+ 'admin-actions-pause', {})
+ self.assertEqual(response.status, 202)
+
+ def test_post_unpause(self):
+ """Get api samples to unpause server request"""
+ self.test_post_pause()
+ response = self._do_post('servers/%s/action' % self.uuid,
+ 'admin-actions-unpause', {})
+ self.assertEqual(response.status, 202)
+
+ def test_post_suspend(self):
+ """Get api samples to suspend server request"""
+ response = self._do_post('servers/%s/action' % self.uuid,
+ 'admin-actions-suspend', {})
+ self.assertEqual(response.status, 202)
+
+ def test_post_resume(self):
+ """Get api samples to server resume request"""
+ self.test_post_suspend()
+ response = self._do_post('servers/%s/action' % self.uuid,
+ 'admin-actions-resume', {})
+ self.assertEqual(response.status, 202)
+
+ def test_post_migrate(self):
+ """Get api samples to migrate server request"""
+ response = self._do_post('servers/%s/action' % self.uuid,
+ 'admin-actions-migrate', {})
+ self.assertEqual(response.status, 202)
+
+ def test_post_reset_network(self):
+ """Get api samples to reset server network request"""
+ response = self._do_post('servers/%s/action' % self.uuid,
+ 'admin-actions-reset-network', {})
+ self.assertEqual(response.status, 202)
+
+ def test_post_inject_network_info(self):
+ """Get api samples to inject network info request"""
+ response = self._do_post('servers/%s/action' % self.uuid,
+ 'admin-actions-inject-network-info', {})
+ self.assertEqual(response.status, 202)
+
+ def test_post_lock_server(self):
+ """Get api samples to lock server request"""
+ response = self._do_post('servers/%s/action' % self.uuid,
+ 'admin-actions-lock-server', {})
+ self.assertEqual(response.status, 202)
+
+ def test_post_unlock_server(self):
+ """Get api samples to unlock server request"""
+ self.test_post_lock_server()
+ response = self._do_post('servers/%s/action' % self.uuid,
+ 'admin-actions-unlock-server', {})
+ self.assertEqual(response.status, 202)
+
+ def test_post_backup_server(self):
+ """Get api samples to backup server request"""
+ def image_details(self, context, **kwargs):
+ """This stub is specifically used on the backup action."""
+ # NOTE(maurosr): I've added this simple stub cause backup action
+ # was trapped in infinite loop during fetch image phase since the
+ # fake Image Service always returns the same set of images
+ return None
+
+ self.stubs.Set(fake._FakeImageService, 'detail', image_details)
+
+ response = self._do_post('servers/%s/action' % self.uuid,
+ 'admin-actions-backup-server', {})
+ self.assertEqual(response.status, 202)
+
+ def test_post_live_migrate_server(self):
+ """Get api samples to server live migrate request"""
+ def fake_live_migration_dest_check(self, context, instance_ref, dest):
+ """Skip live migration scheduler checks"""
+ return
+ self.stubs.Set(driver.Scheduler, '_live_migration_dest_check',
+ fake_live_migration_dest_check)
+
+ response = self._do_post('servers/%s/action' % self.uuid,
+ 'admin-actions-live-migrate',
+ {'hostname': self.compute.host})
+ self.assertEqual(response.status, 202)
+
+ def test_post_reset_state(self):
+ """get api samples to server reset state request"""
+ response = self._do_post('servers/%s/action' % self.uuid,
+ 'admin-actions-reset-server-state', {})
+ self.assertEqual(response.status, 202)
+
+
+class AdminActionsSamplesXmlTest(AdminActionsSamplesJsonTest):
ctype = 'xml'