diff --git a/doc/v3/api_samples/keypairs/keypairs-get-resp.json b/doc/v3/api_samples/keypairs/keypairs-get-resp.json
new file mode 100644
index 000000000000..e650c3dd61fc
--- /dev/null
+++ b/doc/v3/api_samples/keypairs/keypairs-get-resp.json
@@ -0,0 +1,11 @@
+{
+ "keypairs": [
+ {
+ "keypair": {
+ "fingerprint": "7e:eb:ab:24:ba:d1:e1:88:ae:9a:fb:66:53:df:d3:bd",
+ "name": "keypair-50ca852e-273f-4cdc-8949-45feba200837",
+ "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCkF3MX59OrlBs3dH5CU7lNmvpbrgZxSpyGjlnE8Flkirnc/Up22lpjznoxqeoTAwTW034k7Dz6aYIrZGmQwe2TkE084yqvlj45Dkyoj95fW/sZacm0cZNuL69EObEGHdprfGJQajrpz22NQoCD8TFB8Wv+8om9NH9Le6s+WPe98WC77KLw8qgfQsbIey+JawPWl4O67ZdL5xrypuRjfIPWjgy/VH85IXg/Z/GONZ2nxHgSShMkwqSFECAC5L3PHB+0+/12M/iikdatFSVGjpuHvkLOs3oe7m6HlOfluSJ85BzLWBbvva93qkGmLg4ZAc8rPh2O+YIsBUHNLLMM/oQp Generated by Nova\n"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/doc/v3/api_samples/keypairs/keypairs-get-resp.xml b/doc/v3/api_samples/keypairs/keypairs-get-resp.xml
new file mode 100644
index 000000000000..bc5401e6ec6e
--- /dev/null
+++ b/doc/v3/api_samples/keypairs/keypairs-get-resp.xml
@@ -0,0 +1,9 @@
+
+
+
+ ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDcPLt/SUCvzrObsa5dn1M+rHz/9dFTnPhAQ6BFMNMo9EjCLmqWHcOeZ87L6K/caXQOQ7L4rKkQi2aMRt1+GLrY+Y5FeK16Acbd+/37WtB61roPh6uqaMNrm8y2Yusx5/WEDzAZizGDfZwvJa6DVRiQSXSWUeft8dEEWbkCY9FrisnDBA0acb1+kwC+sT9MbjWZ94FJD5ctiHLaQR7e5nFQ7tmMAqiKq14i0R09BoHTd8LUOlh0DD0mtwoHW3YAoIFyJsAtoH/CmBbJ1vjYtna4aATg4eMQMsbz+6LhSQE53dwaRu9AojG7jdC28SEWO/rqznyrDrN6e8sXI5XLX/xL Generated by Nova
+
+ keypair-ccaba351-1a04-41dd-b80a-0302d460e2f7
+ f4:5a:08:66:ef:5a:1b:52:49:1b:82:2c:fc:b3:df:5d
+
+
\ No newline at end of file
diff --git a/doc/v3/api_samples/keypairs/keypairs-import-post-req.json b/doc/v3/api_samples/keypairs/keypairs-import-post-req.json
new file mode 100644
index 000000000000..2a1179d70f0a
--- /dev/null
+++ b/doc/v3/api_samples/keypairs/keypairs-import-post-req.json
@@ -0,0 +1,6 @@
+{
+ "keypair": {
+ "name": "keypair-d20a3d59-9433-4b79-8726-20b431d89c78",
+ "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDx8nkQv/zgGgB4rMYmIf+6A4l6Rr+o/6lHBQdW5aYd44bd8JttDCE/F/pNRr0lRE+PiqSPO8nDPHw0010JeMH9gYgnnFlyY3/OcJ02RhIPyyxYpv9FhY+2YiUkpwFOcLImyrxEsYXpD/0d3ac30bNH6Sw9JD9UZHYcpSxsIbECHw== Generated by Nova"
+ }
+}
\ No newline at end of file
diff --git a/doc/v3/api_samples/keypairs/keypairs-import-post-req.xml b/doc/v3/api_samples/keypairs/keypairs-import-post-req.xml
new file mode 100644
index 000000000000..7be37f5cf130
--- /dev/null
+++ b/doc/v3/api_samples/keypairs/keypairs-import-post-req.xml
@@ -0,0 +1,4 @@
+
+ keypair-c180f683-b051-4d3c-aed1-962f0ec2658b
+ ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDx8nkQv/zgGgB4rMYmIf+6A4l6Rr+o/6lHBQdW5aYd44bd8JttDCE/F/pNRr0lRE+PiqSPO8nDPHw0010JeMH9gYgnnFlyY3/OcJ02RhIPyyxYpv9FhY+2YiUkpwFOcLImyrxEsYXpD/0d3ac30bNH6Sw9JD9UZHYcpSxsIbECHw== Generated by Nova
+
\ No newline at end of file
diff --git a/doc/v3/api_samples/keypairs/keypairs-import-post-resp.json b/doc/v3/api_samples/keypairs/keypairs-import-post-resp.json
new file mode 100644
index 000000000000..9022571546db
--- /dev/null
+++ b/doc/v3/api_samples/keypairs/keypairs-import-post-resp.json
@@ -0,0 +1,8 @@
+{
+ "keypair": {
+ "fingerprint": "1e:2c:9b:56:79:4b:45:77:f9:ca:7a:98:2c:b0:d5:3c",
+ "name": "keypair-803a1926-af78-4b05-902a-1d6f7a8d9d3e",
+ "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDx8nkQv/zgGgB4rMYmIf+6A4l6Rr+o/6lHBQdW5aYd44bd8JttDCE/F/pNRr0lRE+PiqSPO8nDPHw0010JeMH9gYgnnFlyY3/OcJ02RhIPyyxYpv9FhY+2YiUkpwFOcLImyrxEsYXpD/0d3ac30bNH6Sw9JD9UZHYcpSxsIbECHw== Generated by Nova",
+ "user_id": "fake"
+ }
+}
\ No newline at end of file
diff --git a/doc/v3/api_samples/keypairs/keypairs-import-post-resp.xml b/doc/v3/api_samples/keypairs/keypairs-import-post-resp.xml
new file mode 100644
index 000000000000..78e77f62f120
--- /dev/null
+++ b/doc/v3/api_samples/keypairs/keypairs-import-post-resp.xml
@@ -0,0 +1,7 @@
+
+
+ ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDx8nkQv/zgGgB4rMYmIf+6A4l6Rr+o/6lHBQdW5aYd44bd8JttDCE/F/pNRr0lRE+PiqSPO8nDPHw0010JeMH9gYgnnFlyY3/OcJ02RhIPyyxYpv9FhY+2YiUkpwFOcLImyrxEsYXpD/0d3ac30bNH6Sw9JD9UZHYcpSxsIbECHw== Generated by Nova
+ fake
+ keypair-3f16a239-c29d-4db6-be73-49d2ec93d080
+ 1e:2c:9b:56:79:4b:45:77:f9:ca:7a:98:2c:b0:d5:3c
+
\ No newline at end of file
diff --git a/doc/v3/api_samples/keypairs/keypairs-post-req.json b/doc/v3/api_samples/keypairs/keypairs-post-req.json
new file mode 100644
index 000000000000..e4e9f4a8aca0
--- /dev/null
+++ b/doc/v3/api_samples/keypairs/keypairs-post-req.json
@@ -0,0 +1,5 @@
+{
+ "keypair": {
+ "name": "keypair-ab9ff2e6-a6d7-4915-a241-044c369c07f9"
+ }
+}
\ No newline at end of file
diff --git a/doc/v3/api_samples/keypairs/keypairs-post-req.xml b/doc/v3/api_samples/keypairs/keypairs-post-req.xml
new file mode 100644
index 000000000000..90c2a74c8aa8
--- /dev/null
+++ b/doc/v3/api_samples/keypairs/keypairs-post-req.xml
@@ -0,0 +1,3 @@
+
+ keypair-94f987ab-8bcf-4398-8aa6-5e00f313394e
+
\ No newline at end of file
diff --git a/doc/v3/api_samples/keypairs/keypairs-post-resp.json b/doc/v3/api_samples/keypairs/keypairs-post-resp.json
new file mode 100644
index 000000000000..f049e05510a9
--- /dev/null
+++ b/doc/v3/api_samples/keypairs/keypairs-post-resp.json
@@ -0,0 +1,9 @@
+{
+ "keypair": {
+ "fingerprint": "7e:eb:ab:24:ba:d1:e1:88:ae:9a:fb:66:53:df:d3:bd",
+ "name": "keypair-50ca852e-273f-4cdc-8949-45feba200837",
+ "private_key": "-----BEGIN RSA PRIVATE KEY-----\nMIIEpAIBAAKCAQEApBdzF+fTq5QbN3R+QlO5TZr6W64GcUqcho5ZxPBZZIq53P1K\ndtpaY856ManqEwME1tN+JOw8+mmCK2RpkMHtk5BNPOMqr5Y+OQ5MqI/eX1v7GWnJ\ntHGTbi+vRDmxBh3aa3xiUGo66c9tjUKAg/ExQfFr/vKJvTR/S3urPlj3vfFgu+yi\n8PKoH0LGyHsviWsD1peDuu2XS+ca8qbkY3yD1o4Mv1R/OSF4P2fxjjWdp8R4EkoT\nJMKkhRAgAuS9zxwftPv9djP4opHWrRUlRo6bh75CzrN6Hu5uh5Tn5bkifOQcy1gW\n772vd6pBpi4OGQHPKz4djvmCLAVBzSyzDP6EKQIDAQABAoIBAQCB+tU/ZXKlIe+h\nMNTmoz1QfOe+AY625Rwx9cakGqMk4kKyC62VkgcxshfXCToSjzyhEuyEQOFYloT2\n7FY2xXb0gcS861Efv0pQlcQhbbz/GnQ/wC13ktPu3zTdPTm9l54xsFiMTGmYVaf4\n0mnMmhyjmKIsVGDJEDGZUD/oZj7wJGOFha5M4FZrZlJIrEZC0rGGlcC0kGF2no6B\nj1Mu7HjyK3pTKf4dlp+jeRikUF5Pct+qT+rcv2rZ3fl3inxtlLEwZeFPbp/njf/U\nIGxFzZsuLmiFlsJar6M5nEckTB3p25maWWaR8/0jvJRgsPnuoUrUoGDq87DMKCdk\nlw6by9fRAoGBANhnS9ko7Of+ntqIFR7xOG9p/oPATztgHkFxe4GbQ0leaDRTx3vE\ndQmUCnn24xtyVECaI9a4IV+LP1npw8niWUJ4pjgdAlkF4cCTu9sN+cBO15SfdACI\nzD1DaaHmpFCAWlpTo68VWlvWll6i2ncCkRJR1+q/C/yQz7asvl4AakElAoGBAMId\nxqMT2Sy9xLuHsrAoMUvBOkwaMYZH+IAb4DvUDjVIiKWjmonrmopS5Lpb+ALBKqZe\neVfD6HwWQqGwCFItToaEkZvrNfTapoNCHWWg001D49765UV5lMrArDbM1vXtFfM4\nDRYM6+Y6o/6QH8EBgXtyBxcYthIDBM3wBJa67xG1AoGAKTm8fFlMkIG0N4N3Kpbf\nnnH915GaRoBwIx2AXtd6QQ7oIRfYx95MQY/fUw7SgxcLr+btbulTCkWXwwRClUI2\nqPAdElGMcfMp56r9PaTy8EzUyu55heSJrB4ckIhEw0VAcTa/1wnlVduSd+LkZYmq\no2fOD11n5iycNXvBJF1F4LUCgYAMaRbwCi7SW3eefbiA5rDwJPRzNSGBckyC9EVL\nzezynyaNYH5a3wNMYKxa9dJPasYtSND9OXs9o7ay26xMhLUGiKc+jrUuaGRI9Asp\nGjUoNXT2JphN7s4CgHsCLep4YqYKnMTJah4S5CDj/5boIg6DM/EcGupZEHRYLkY8\n1MrAGQKBgQCi9yeC39ctLUNn+Ix604gttWWChdt3ozufTZ7HybJOSRA9Gh3iD5gm\nzlz0xqpGShKpOY2k+ftvja0poMdGeJLt84P3r2q01IgI7w0LmOj5m0W10dHysH27\nBWpCnHdBJMxnBsMRPoM4MKkmKWD9l5PSTCTWtkIpsyuDCko6D9UwZA==\n-----END RSA PRIVATE KEY-----\n",
+ "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCkF3MX59OrlBs3dH5CU7lNmvpbrgZxSpyGjlnE8Flkirnc/Up22lpjznoxqeoTAwTW034k7Dz6aYIrZGmQwe2TkE084yqvlj45Dkyoj95fW/sZacm0cZNuL69EObEGHdprfGJQajrpz22NQoCD8TFB8Wv+8om9NH9Le6s+WPe98WC77KLw8qgfQsbIey+JawPWl4O67ZdL5xrypuRjfIPWjgy/VH85IXg/Z/GONZ2nxHgSShMkwqSFECAC5L3PHB+0+/12M/iikdatFSVGjpuHvkLOs3oe7m6HlOfluSJ85BzLWBbvva93qkGmLg4ZAc8rPh2O+YIsBUHNLLMM/oQp Generated by Nova\n",
+ "user_id": "fake"
+ }
+}
\ No newline at end of file
diff --git a/doc/v3/api_samples/keypairs/keypairs-post-resp.xml b/doc/v3/api_samples/keypairs/keypairs-post-resp.xml
new file mode 100644
index 000000000000..eb7da8d57d15
--- /dev/null
+++ b/doc/v3/api_samples/keypairs/keypairs-post-resp.xml
@@ -0,0 +1,36 @@
+
+
+ ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDcPLt/SUCvzrObsa5dn1M+rHz/9dFTnPhAQ6BFMNMo9EjCLmqWHcOeZ87L6K/caXQOQ7L4rKkQi2aMRt1+GLrY+Y5FeK16Acbd+/37WtB61roPh6uqaMNrm8y2Yusx5/WEDzAZizGDfZwvJa6DVRiQSXSWUeft8dEEWbkCY9FrisnDBA0acb1+kwC+sT9MbjWZ94FJD5ctiHLaQR7e5nFQ7tmMAqiKq14i0R09BoHTd8LUOlh0DD0mtwoHW3YAoIFyJsAtoH/CmBbJ1vjYtna4aATg4eMQMsbz+6LhSQE53dwaRu9AojG7jdC28SEWO/rqznyrDrN6e8sXI5XLX/xL Generated by Nova
+
+ -----BEGIN RSA PRIVATE KEY-----
+MIIEowIBAAKCAQEA3Dy7f0lAr86zm7GuXZ9TPqx8//XRU5z4QEOgRTDTKPRIwi5q
+lh3DnmfOy+iv3Gl0DkOy+KypEItmjEbdfhi62PmORXitegHG3fv9+1rQeta6D4er
+qmjDa5vMtmLrMef1hA8wGYsxg32cLyWug1UYkEl0llHn7fHRBFm5AmPRa4rJwwQN
+GnG9fpMAvrE/TG41mfeBSQ+XLYhy2kEe3uZxUO7ZjAKoiqteItEdPQaB03fC1DpY
+dAw9JrcKB1t2AKCBcibALaB/wpgWydb42LZ2uGgE4OHjEDLG8/ui4UkBOd3cGkbv
+QKIxu43QtvEhFjv66s58qw6zenvLFyOVy1/8SwIDAQABAoIBAA+E0Al2FfLNc+aC
+rLC4K1t9OAmpPqjPpMaSfVaizB5UqFPWhXgyfLhKxE2mBc5YN+9RYekX8YnS6NT1
+oWHjSDdFznqiuEainWrC+PCfQ5WET/QMMVJ+s1Z/0fsAGWaY27oEf/Us075aOYkw
+9I0Yj/SK2IZHGzqvEXVnBRxgAD+9lFukPQMIL6PzxnPyOgpWl32qS+BJjtTPvkwf
+/SAplL6EhcXgETsxnjX4Wnyqzn7oMVJ7UMaeqTP1Dqf9jKZJThDClegmTTxAicwK
+dE568+KyYhetVRoAe72PribIJJ+EioeurZrhJJ8cQtyRO6IJgn2iUVEegjAdKKbI
+ymA6AnECgYEA+jdIqE0DYBByJYOJIlXTJs+5lYiW2onOzmRc0rUlY9sodVhutoTW
+VzVVD2Prmg2tlsEL/3d7/xZtQl9V6nlUPzK7Tj0s+u6bTdnDpz3j2MGhMKWFXpUn
+TyZ8MIQz1fvPP6LBE6iqC8qFCuB2dpJ7n47gTJNI57yH05iXSDdGUh8CgYEA4VQK
+vaZy+/ej4gJ21PoeVoJMeGoGJUfkfOMVWASSxPH9lryDCCCBPfE5EB6o+hUGI/Gp
+rUByifnEXmHUSHYBLhDRaLI9x9/AlFpi54+OFCveZpPeMV1awTJPrW6VeqT9wZib
+Lzbqie7Elshks95E7cFxZ+RWoZOi/SbhYyRSSFUCgYAX1OAkt4EUyzwz+n07OfVs
+guhoJ6RGmE2MNt7oarxu8FbAJnYVCD3p/HhniNrNx3O7IhPkdxrmRtqNMctbE8dE
+Za6VWxpHpCZCmfUanrhu0rJpkbpMMeSWk1HMxSqyvNMWeoftOWlIyjc1u/9Md9My
+dUdDw9tzxu8g5i2ygSE/fQKBgA6nToOC3ZtxQWEjU+MJ2Qs7Mgnqqzelc0CD7BFr
+SrgwHJO+8q6GnqEOnO1lcQvCbkHMJ4Ky3EAI1DJnHk0QD4eVZGjwnn/vFzEOp7vz
+ZAP/zljRaPPA5HQH95KJzILLVA1RBVaOtbX+px4/Lf1ciRMFL4DYIqIjXcgkzSeL
+ZyZ5AoGBAOlBzur3UJFn+ZMtbE3F4/zO39e8ns/OwzgfkgxjELmkbNpb8qvmI0JT
+MHOHdUNUJmjjZ8BQmynUiuPVISSOMiACo7cPzTWYY5Gh7ijSUQ/tn08tcTBAyo0l
+ak3qRYzz2heSi7Qe0RiHSX44rXyL9XYa7u3aexQGuGCjDwxkr2pw
+-----END RSA PRIVATE KEY-----
+
+ fake
+ keypair-ccaba351-1a04-41dd-b80a-0302d460e2f7
+ f4:5a:08:66:ef:5a:1b:52:49:1b:82:2c:fc:b3:df:5d
+
\ No newline at end of file
diff --git a/doc/v3/api_samples/os-hide-server-addresses/server-get-resp.json b/doc/v3/api_samples/os-hide-server-addresses/server-get-resp.json
new file mode 100644
index 000000000000..fdd83c47afe2
--- /dev/null
+++ b/doc/v3/api_samples/os-hide-server-addresses/server-get-resp.json
@@ -0,0 +1,48 @@
+{
+ "server": {
+ "access_ip_v4": "",
+ "access_ip_v6": "",
+ "addresses": {},
+ "created": "2013-09-24T14:39:00Z",
+ "flavor": {
+ "id": "1",
+ "links": [
+ {
+ "href": "http://openstack.example.com/flavors/1",
+ "rel": "bookmark"
+ }
+ ]
+ },
+ "host_id": "d0635823e9162b22b90ff103f0c30f129bacf6ffb72f4d6fde87e738",
+ "id": "4bdee8c7-507f-40f2-8429-d301edd3791b",
+ "image": {
+ "id": "70a599e0-31e7-49b7-b260-868f441e862b",
+ "links": [
+ {
+ "href": "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
+ "rel": "bookmark"
+ }
+ ]
+ },
+ "key_name": null,
+ "links": [
+ {
+ "href": "http://openstack.example.com/v3/servers/4bdee8c7-507f-40f2-8429-d301edd3791b",
+ "rel": "self"
+ },
+ {
+ "href": "http://openstack.example.com/servers/4bdee8c7-507f-40f2-8429-d301edd3791b",
+ "rel": "bookmark"
+ }
+ ],
+ "metadata": {
+ "My Server Name": "Apache1"
+ },
+ "name": "new-server-test",
+ "progress": 0,
+ "status": "ACTIVE",
+ "tenant_id": "openstack",
+ "updated": "2013-09-24T14:39:01Z",
+ "user_id": "fake"
+ }
+}
\ No newline at end of file
diff --git a/doc/v3/api_samples/os-hide-server-addresses/server-get-resp.xml b/doc/v3/api_samples/os-hide-server-addresses/server-get-resp.xml
new file mode 100644
index 000000000000..485359235109
--- /dev/null
+++ b/doc/v3/api_samples/os-hide-server-addresses/server-get-resp.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+ Apache1
+
+
+
+
+
\ No newline at end of file
diff --git a/doc/v3/api_samples/os-hide-server-addresses/server-post-req.json b/doc/v3/api_samples/os-hide-server-addresses/server-post-req.json
new file mode 100644
index 000000000000..d41985a1bc39
--- /dev/null
+++ b/doc/v3/api_samples/os-hide-server-addresses/server-post-req.json
@@ -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=="
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/doc/v3/api_samples/os-hide-server-addresses/server-post-req.xml b/doc/v3/api_samples/os-hide-server-addresses/server-post-req.xml
new file mode 100644
index 000000000000..598839cf6a3a
--- /dev/null
+++ b/doc/v3/api_samples/os-hide-server-addresses/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/v3/api_samples/os-hide-server-addresses/server-post-resp.json b/doc/v3/api_samples/os-hide-server-addresses/server-post-resp.json
new file mode 100644
index 000000000000..9f312b3c2b92
--- /dev/null
+++ b/doc/v3/api_samples/os-hide-server-addresses/server-post-resp.json
@@ -0,0 +1,16 @@
+{
+ "server": {
+ "admin_pass": "5bjyggD6SaSB",
+ "id": "3d8bedd4-003d-417a-8cd7-a94cb181185d",
+ "links": [
+ {
+ "href": "http://openstack.example.com/v3/servers/3d8bedd4-003d-417a-8cd7-a94cb181185d",
+ "rel": "self"
+ },
+ {
+ "href": "http://openstack.example.com/servers/3d8bedd4-003d-417a-8cd7-a94cb181185d",
+ "rel": "bookmark"
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/doc/v3/api_samples/os-hide-server-addresses/server-post-resp.xml b/doc/v3/api_samples/os-hide-server-addresses/server-post-resp.xml
new file mode 100644
index 000000000000..5602cf1fda6f
--- /dev/null
+++ b/doc/v3/api_samples/os-hide-server-addresses/server-post-resp.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/doc/v3/api_samples/os-hide-server-addresses/servers-details-resp.json b/doc/v3/api_samples/os-hide-server-addresses/servers-details-resp.json
new file mode 100644
index 000000000000..3d1b4baae07a
--- /dev/null
+++ b/doc/v3/api_samples/os-hide-server-addresses/servers-details-resp.json
@@ -0,0 +1,50 @@
+{
+ "servers": [
+ {
+ "access_ip_v4": "",
+ "access_ip_v6": "",
+ "addresses": {},
+ "created": "2013-09-24T14:44:01Z",
+ "flavor": {
+ "id": "1",
+ "links": [
+ {
+ "href": "http://openstack.example.com/flavors/1",
+ "rel": "bookmark"
+ }
+ ]
+ },
+ "host_id": "a4fa72ae8741e5e18fb062c15657b8f689b8da2837b734c61fc9eedd",
+ "id": "a747eac1-e3ed-446c-935a-c2a2853f919c",
+ "image": {
+ "id": "70a599e0-31e7-49b7-b260-868f441e862b",
+ "links": [
+ {
+ "href": "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
+ "rel": "bookmark"
+ }
+ ]
+ },
+ "key_name": null,
+ "links": [
+ {
+ "href": "http://openstack.example.com/v3/servers/a747eac1-e3ed-446c-935a-c2a2853f919c",
+ "rel": "self"
+ },
+ {
+ "href": "http://openstack.example.com/servers/a747eac1-e3ed-446c-935a-c2a2853f919c",
+ "rel": "bookmark"
+ }
+ ],
+ "metadata": {
+ "My Server Name": "Apache1"
+ },
+ "name": "new-server-test",
+ "progress": 0,
+ "status": "ACTIVE",
+ "tenant_id": "openstack",
+ "updated": "2013-09-24T14:44:01Z",
+ "user_id": "fake"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/doc/v3/api_samples/os-hide-server-addresses/servers-details-resp.xml b/doc/v3/api_samples/os-hide-server-addresses/servers-details-resp.xml
new file mode 100644
index 000000000000..76fab82f5dfd
--- /dev/null
+++ b/doc/v3/api_samples/os-hide-server-addresses/servers-details-resp.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+ Apache1
+
+
+
+
+
+
\ No newline at end of file
diff --git a/doc/v3/api_samples/os-hide-server-addresses/servers-list-resp.json b/doc/v3/api_samples/os-hide-server-addresses/servers-list-resp.json
new file mode 100644
index 000000000000..caca8f0fc8ce
--- /dev/null
+++ b/doc/v3/api_samples/os-hide-server-addresses/servers-list-resp.json
@@ -0,0 +1,18 @@
+{
+ "servers": [
+ {
+ "id": "b2a7068b-8aed-41a4-aa74-af8feb984bae",
+ "links": [
+ {
+ "href": "http://openstack.example.com/v3/servers/b2a7068b-8aed-41a4-aa74-af8feb984bae",
+ "rel": "self"
+ },
+ {
+ "href": "http://openstack.example.com/servers/b2a7068b-8aed-41a4-aa74-af8feb984bae",
+ "rel": "bookmark"
+ }
+ ],
+ "name": "new-server-test"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/doc/v3/api_samples/os-hide-server-addresses/servers-list-resp.xml b/doc/v3/api_samples/os-hide-server-addresses/servers-list-resp.xml
new file mode 100644
index 000000000000..51ddbd8b3af7
--- /dev/null
+++ b/doc/v3/api_samples/os-hide-server-addresses/servers-list-resp.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/nova/tests/integrated/v3/api_samples/keypairs/keypairs-get-resp.json.tpl b/nova/tests/integrated/v3/api_samples/keypairs/keypairs-get-resp.json.tpl
new file mode 100644
index 000000000000..29ba63c00b03
--- /dev/null
+++ b/nova/tests/integrated/v3/api_samples/keypairs/keypairs-get-resp.json.tpl
@@ -0,0 +1,11 @@
+{
+ "keypairs": [
+ {
+ "keypair": {
+ "fingerprint": "%(fingerprint)s",
+ "name": "%(keypair_name)s",
+ "public_key": "%(public_key)s"
+ }
+ }
+ ]
+}
diff --git a/nova/tests/integrated/v3/api_samples/keypairs/keypairs-get-resp.xml.tpl b/nova/tests/integrated/v3/api_samples/keypairs/keypairs-get-resp.xml.tpl
new file mode 100644
index 000000000000..493bfa31610d
--- /dev/null
+++ b/nova/tests/integrated/v3/api_samples/keypairs/keypairs-get-resp.xml.tpl
@@ -0,0 +1,9 @@
+
+
+
+ %(public_key)s
+
+ %(keypair_name)s
+ %(fingerprint)s
+
+
diff --git a/nova/tests/integrated/v3/api_samples/keypairs/keypairs-import-post-req.json.tpl b/nova/tests/integrated/v3/api_samples/keypairs/keypairs-import-post-req.json.tpl
new file mode 100644
index 000000000000..2301fa05b22c
--- /dev/null
+++ b/nova/tests/integrated/v3/api_samples/keypairs/keypairs-import-post-req.json.tpl
@@ -0,0 +1,6 @@
+{
+ "keypair": {
+ "name": "%(keypair_name)s",
+ "public_key": "%(public_key)s"
+ }
+}
diff --git a/nova/tests/integrated/v3/api_samples/keypairs/keypairs-import-post-req.xml.tpl b/nova/tests/integrated/v3/api_samples/keypairs/keypairs-import-post-req.xml.tpl
new file mode 100644
index 000000000000..0516de30352d
--- /dev/null
+++ b/nova/tests/integrated/v3/api_samples/keypairs/keypairs-import-post-req.xml.tpl
@@ -0,0 +1,4 @@
+
+ %(keypair_name)s
+ %(public_key)s
+
diff --git a/nova/tests/integrated/v3/api_samples/keypairs/keypairs-import-post-resp.json.tpl b/nova/tests/integrated/v3/api_samples/keypairs/keypairs-import-post-resp.json.tpl
new file mode 100644
index 000000000000..ca7192d5dc5d
--- /dev/null
+++ b/nova/tests/integrated/v3/api_samples/keypairs/keypairs-import-post-resp.json.tpl
@@ -0,0 +1,8 @@
+{
+ "keypair": {
+ "fingerprint": "%(fingerprint)s",
+ "name": "%(keypair_name)s",
+ "public_key": "%(public_key)s",
+ "user_id": "fake"
+ }
+}
diff --git a/nova/tests/integrated/v3/api_samples/keypairs/keypairs-import-post-resp.xml.tpl b/nova/tests/integrated/v3/api_samples/keypairs/keypairs-import-post-resp.xml.tpl
new file mode 100644
index 000000000000..ed2543c10753
--- /dev/null
+++ b/nova/tests/integrated/v3/api_samples/keypairs/keypairs-import-post-resp.xml.tpl
@@ -0,0 +1,7 @@
+
+
+ %(public_key)s
+ fake
+ %(keypair_name)s
+ %(fingerprint)s
+
diff --git a/nova/tests/integrated/v3/api_samples/keypairs/keypairs-post-req.json.tpl b/nova/tests/integrated/v3/api_samples/keypairs/keypairs-post-req.json.tpl
new file mode 100644
index 000000000000..68e2f03487b7
--- /dev/null
+++ b/nova/tests/integrated/v3/api_samples/keypairs/keypairs-post-req.json.tpl
@@ -0,0 +1,5 @@
+{
+ "keypair": {
+ "name": "%(keypair_name)s"
+ }
+}
diff --git a/nova/tests/integrated/v3/api_samples/keypairs/keypairs-post-req.xml.tpl b/nova/tests/integrated/v3/api_samples/keypairs/keypairs-post-req.xml.tpl
new file mode 100644
index 000000000000..e14935d314da
--- /dev/null
+++ b/nova/tests/integrated/v3/api_samples/keypairs/keypairs-post-req.xml.tpl
@@ -0,0 +1,3 @@
+
+ %(keypair_name)s
+
diff --git a/nova/tests/integrated/v3/api_samples/keypairs/keypairs-post-resp.json.tpl b/nova/tests/integrated/v3/api_samples/keypairs/keypairs-post-resp.json.tpl
new file mode 100644
index 000000000000..aace6f5ccc23
--- /dev/null
+++ b/nova/tests/integrated/v3/api_samples/keypairs/keypairs-post-resp.json.tpl
@@ -0,0 +1,9 @@
+{
+ "keypair": {
+ "fingerprint": "%(fingerprint)s",
+ "name": "%(keypair_name)s",
+ "private_key": "%(private_key)s",
+ "public_key": "%(public_key)s",
+ "user_id": "fake"
+ }
+}
diff --git a/nova/tests/integrated/v3/api_samples/keypairs/keypairs-post-resp.xml.tpl b/nova/tests/integrated/v3/api_samples/keypairs/keypairs-post-resp.xml.tpl
new file mode 100644
index 000000000000..4f4bb3e20eb6
--- /dev/null
+++ b/nova/tests/integrated/v3/api_samples/keypairs/keypairs-post-resp.xml.tpl
@@ -0,0 +1,10 @@
+
+
+ %(public_key)s
+
+ %(private_key)s
+
+ fake
+ %(keypair_name)s
+ %(fingerprint)s
+
diff --git a/nova/tests/integrated/v3/api_samples/os-hide-server-addresses/server-get-resp.json.tpl b/nova/tests/integrated/v3/api_samples/os-hide-server-addresses/server-get-resp.json.tpl
new file mode 100644
index 000000000000..bb38484c6f39
--- /dev/null
+++ b/nova/tests/integrated/v3/api_samples/os-hide-server-addresses/server-get-resp.json.tpl
@@ -0,0 +1,49 @@
+{
+ "server": {
+ "access_ip_v4": "",
+ "access_ip_v6": "",
+ "addresses": {
+ },
+ "created": "%(timestamp)s",
+ "flavor": {
+ "id": "1",
+ "links": [
+ {
+ "href": "%(host)s/flavors/1",
+ "rel": "bookmark"
+ }
+ ]
+ },
+ "host_id": "%(hostid)s",
+ "id": "%(id)s",
+ "image": {
+ "id": "%(uuid)s",
+ "links": [
+ {
+ "href": "%(glance_host)s/images/%(uuid)s",
+ "rel": "bookmark"
+ }
+ ]
+ },
+ "key_name": null,
+ "links": [
+ {
+ "href": "%(host)s/v3/servers/%(uuid)s",
+ "rel": "self"
+ },
+ {
+ "href": "%(host)s/servers/%(uuid)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"
+ }
+}
diff --git a/nova/tests/integrated/v3/api_samples/os-hide-server-addresses/server-get-resp.xml.tpl b/nova/tests/integrated/v3/api_samples/os-hide-server-addresses/server-get-resp.xml.tpl
new file mode 100644
index 000000000000..81314ef57cee
--- /dev/null
+++ b/nova/tests/integrated/v3/api_samples/os-hide-server-addresses/server-get-resp.xml.tpl
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+ Apache1
+
+
+
+
+
diff --git a/nova/tests/integrated/v3/api_samples/os-hide-server-addresses/server-post-req.json.tpl b/nova/tests/integrated/v3/api_samples/os-hide-server-addresses/server-post-req.json.tpl
new file mode 100644
index 000000000000..1dcb63e3b2ae
--- /dev/null
+++ b/nova/tests/integrated/v3/api_samples/os-hide-server-addresses/server-post-req.json.tpl
@@ -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=="
+ }
+ ]
+ }
+}
diff --git a/nova/tests/integrated/v3/api_samples/os-hide-server-addresses/server-post-req.xml.tpl b/nova/tests/integrated/v3/api_samples/os-hide-server-addresses/server-post-req.xml.tpl
new file mode 100644
index 000000000000..ddb5ea78c4b5
--- /dev/null
+++ b/nova/tests/integrated/v3/api_samples/os-hide-server-addresses/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/v3/api_samples/os-hide-server-addresses/server-post-resp.json.tpl b/nova/tests/integrated/v3/api_samples/os-hide-server-addresses/server-post-resp.json.tpl
new file mode 100644
index 000000000000..6c3100fbec86
--- /dev/null
+++ b/nova/tests/integrated/v3/api_samples/os-hide-server-addresses/server-post-resp.json.tpl
@@ -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"
+ }
+ ]
+ }
+}
diff --git a/nova/tests/integrated/v3/api_samples/os-hide-server-addresses/server-post-resp.xml.tpl b/nova/tests/integrated/v3/api_samples/os-hide-server-addresses/server-post-resp.xml.tpl
new file mode 100644
index 000000000000..3470373e171f
--- /dev/null
+++ b/nova/tests/integrated/v3/api_samples/os-hide-server-addresses/server-post-resp.xml.tpl
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/nova/tests/integrated/v3/api_samples/os-hide-server-addresses/servers-details-resp.json.tpl b/nova/tests/integrated/v3/api_samples/os-hide-server-addresses/servers-details-resp.json.tpl
new file mode 100644
index 000000000000..39e56583c7ac
--- /dev/null
+++ b/nova/tests/integrated/v3/api_samples/os-hide-server-addresses/servers-details-resp.json.tpl
@@ -0,0 +1,50 @@
+{
+ "servers": [
+ {
+ "access_ip_v4": "",
+ "access_ip_v6": "",
+ "addresses": {},
+ "created": "%(timestamp)s",
+ "flavor": {
+ "id": "1",
+ "links": [
+ {
+ "href": "%(host)s/flavors/1",
+ "rel": "bookmark"
+ }
+ ]
+ },
+ "host_id": "%(hostid)s",
+ "id": "%(id)s",
+ "image": {
+ "id": "%(uuid)s",
+ "links": [
+ {
+ "href": "%(glance_host)s/images/%(uuid)s",
+ "rel": "bookmark"
+ }
+ ]
+ },
+ "key_name": null,
+ "links": [
+ {
+ "href": "%(host)s/v3/servers/%(uuid)s",
+ "rel": "self"
+ },
+ {
+ "href": "%(host)s/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"
+ }
+ ]
+}
diff --git a/nova/tests/integrated/v3/api_samples/os-hide-server-addresses/servers-details-resp.xml.tpl b/nova/tests/integrated/v3/api_samples/os-hide-server-addresses/servers-details-resp.xml.tpl
new file mode 100644
index 000000000000..7b184c6df0e8
--- /dev/null
+++ b/nova/tests/integrated/v3/api_samples/os-hide-server-addresses/servers-details-resp.xml.tpl
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+ Apache1
+
+
+
+
+
+
diff --git a/nova/tests/integrated/v3/api_samples/os-hide-server-addresses/servers-list-resp.json.tpl b/nova/tests/integrated/v3/api_samples/os-hide-server-addresses/servers-list-resp.json.tpl
new file mode 100644
index 000000000000..8797266b68f9
--- /dev/null
+++ b/nova/tests/integrated/v3/api_samples/os-hide-server-addresses/servers-list-resp.json.tpl
@@ -0,0 +1,18 @@
+{
+ "servers": [
+ {
+ "id": "%(id)s",
+ "links": [
+ {
+ "href": "%(host)s/v3/servers/%(id)s",
+ "rel": "self"
+ },
+ {
+ "href": "%(host)s/servers/%(id)s",
+ "rel": "bookmark"
+ }
+ ],
+ "name": "new-server-test"
+ }
+ ]
+}
diff --git a/nova/tests/integrated/v3/api_samples/os-hide-server-addresses/servers-list-resp.xml.tpl b/nova/tests/integrated/v3/api_samples/os-hide-server-addresses/servers-list-resp.xml.tpl
new file mode 100644
index 000000000000..421eb28d5321
--- /dev/null
+++ b/nova/tests/integrated/v3/api_samples/os-hide-server-addresses/servers-list-resp.xml.tpl
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/nova/tests/integrated/v3/test_hide_server_addresses.py b/nova/tests/integrated/v3/test_hide_server_addresses.py
new file mode 100644
index 000000000000..5dc0710cb45c
--- /dev/null
+++ b/nova/tests/integrated/v3/test_hide_server_addresses.py
@@ -0,0 +1,44 @@
+# 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 oslo.config import cfg
+
+from nova.compute import vm_states
+from nova.tests.integrated.v3 import test_servers
+
+CONF = cfg.CONF
+CONF.import_opt('osapi_hide_server_address_states',
+ 'nova.api.openstack.compute.plugins.v3.hide_server_addresses')
+
+
+class ServersSampleHideAddressesJsonTest(test_servers.ServersSampleJsonTest):
+ extension_name = 'os-hide-server-addresses'
+ # Override the sample dirname because
+ # test_servers.ServersSampleJsonTest does and so it won't default
+ # to the extension name
+ sample_dir = extension_name
+
+ def setUp(self):
+ # We override osapi_hide_server_address_states in order
+ # to have an example of in the json/xml samples of the
+ # addresses being hidden
+ CONF.set_override("osapi_hide_server_address_states",
+ [vm_states.ACTIVE])
+ super(ServersSampleHideAddressesJsonTest, self).setUp()
+
+
+class ServersSampleHideAddressesXMLTest(ServersSampleHideAddressesJsonTest):
+ ctype = 'xml'
diff --git a/nova/tests/integrated/v3/test_keypairs.py b/nova/tests/integrated/v3/test_keypairs.py
new file mode 100644
index 000000000000..f1d4da4db0d5
--- /dev/null
+++ b/nova/tests/integrated/v3/test_keypairs.py
@@ -0,0 +1,69 @@
+# 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.
+
+import uuid
+
+from nova.tests.integrated.v3 import api_sample_base
+
+
+class KeyPairsSampleJsonTest(api_sample_base.ApiSampleTestBaseV3):
+ sample_dir = "keypairs"
+
+ def generalize_subs(self, subs, vanilla_regexes):
+ subs['keypair_name'] = 'keypair-[0-9a-f-]+'
+ return subs
+
+ def test_keypairs_post(self, public_key=None):
+ """Get api sample of key pairs post request."""
+ key_name = 'keypair-' + str(uuid.uuid4())
+ response = self._do_post('keypairs', 'keypairs-post-req',
+ {'keypair_name': key_name})
+ subs = self._get_regexes()
+ subs['keypair_name'] = '(%s)' % key_name
+ self._verify_response('keypairs-post-resp', subs, response, 201)
+ # NOTE(maurosr): return the key_name is necessary cause the
+ # verification returns the label of the last compared information in
+ # the response, not necessarily the key name.
+ return key_name
+
+ def test_keypairs_import_key_post(self):
+ # Get api sample of key pairs post to import user's key.
+ key_name = 'keypair-' + str(uuid.uuid4())
+ subs = {
+ 'keypair_name': key_name,
+ 'public_key': "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDx8nkQv/zgGg"
+ "B4rMYmIf+6A4l6Rr+o/6lHBQdW5aYd44bd8JttDCE/F/pNRr0l"
+ "RE+PiqSPO8nDPHw0010JeMH9gYgnnFlyY3/OcJ02RhIPyyxYpv"
+ "9FhY+2YiUkpwFOcLImyrxEsYXpD/0d3ac30bNH6Sw9JD9UZHYc"
+ "pSxsIbECHw== Generated by Nova"
+ }
+ response = self._do_post('keypairs', 'keypairs-import-post-req',
+ subs)
+ subs = self._get_regexes()
+ subs['keypair_name'] = '(%s)' % key_name
+ self._verify_response('keypairs-import-post-resp', subs, response, 201)
+
+ def test_keypairs_get(self):
+ # Get api sample of key pairs get request.
+ key_name = self.test_keypairs_post()
+ response = self._do_get('keypairs')
+ subs = self._get_regexes()
+ subs['keypair_name'] = '(%s)' % key_name
+ self._verify_response('keypairs-get-resp', subs, response, 200)
+
+
+class KeyPairsSampleXmlTest(KeyPairsSampleJsonTest):
+ ctype = 'xml'