Merge "Adds v3 API samples for hide server addresses and keypairs"

This commit is contained in:
Jenkins 2013-10-07 18:47:57 +00:00 committed by Gerrit Code Review
commit f9db42dd31
42 changed files with 708 additions and 0 deletions

View File

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

View File

@ -0,0 +1,9 @@
<?xml version='1.0' encoding='UTF-8'?>
<keypairs>
<keypair>
<public_key>ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDcPLt/SUCvzrObsa5dn1M+rHz/9dFTnPhAQ6BFMNMo9EjCLmqWHcOeZ87L6K/caXQOQ7L4rKkQi2aMRt1+GLrY+Y5FeK16Acbd+/37WtB61roPh6uqaMNrm8y2Yusx5/WEDzAZizGDfZwvJa6DVRiQSXSWUeft8dEEWbkCY9FrisnDBA0acb1+kwC+sT9MbjWZ94FJD5ctiHLaQR7e5nFQ7tmMAqiKq14i0R09BoHTd8LUOlh0DD0mtwoHW3YAoIFyJsAtoH/CmBbJ1vjYtna4aATg4eMQMsbz+6LhSQE53dwaRu9AojG7jdC28SEWO/rqznyrDrN6e8sXI5XLX/xL Generated by Nova
</public_key>
<name>keypair-ccaba351-1a04-41dd-b80a-0302d460e2f7</name>
<fingerprint>f4:5a:08:66:ef:5a:1b:52:49:1b:82:2c:fc:b3:df:5d</fingerprint>
</keypair>
</keypairs>

View File

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

View File

@ -0,0 +1,4 @@
<keypair>
<name>keypair-c180f683-b051-4d3c-aed1-962f0ec2658b</name>
<public_key>ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDx8nkQv/zgGgB4rMYmIf+6A4l6Rr+o/6lHBQdW5aYd44bd8JttDCE/F/pNRr0lRE+PiqSPO8nDPHw0010JeMH9gYgnnFlyY3/OcJ02RhIPyyxYpv9FhY+2YiUkpwFOcLImyrxEsYXpD/0d3ac30bNH6Sw9JD9UZHYcpSxsIbECHw== Generated by Nova</public_key>
</keypair>

View File

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

View File

@ -0,0 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?>
<keypair>
<public_key>ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDx8nkQv/zgGgB4rMYmIf+6A4l6Rr+o/6lHBQdW5aYd44bd8JttDCE/F/pNRr0lRE+PiqSPO8nDPHw0010JeMH9gYgnnFlyY3/OcJ02RhIPyyxYpv9FhY+2YiUkpwFOcLImyrxEsYXpD/0d3ac30bNH6Sw9JD9UZHYcpSxsIbECHw== Generated by Nova</public_key>
<user_id>fake</user_id>
<name>keypair-3f16a239-c29d-4db6-be73-49d2ec93d080</name>
<fingerprint>1e:2c:9b:56:79:4b:45:77:f9:ca:7a:98:2c:b0:d5:3c</fingerprint>
</keypair>

View File

@ -0,0 +1,5 @@
{
"keypair": {
"name": "keypair-ab9ff2e6-a6d7-4915-a241-044c369c07f9"
}
}

View File

@ -0,0 +1,3 @@
<keypair>
<name>keypair-94f987ab-8bcf-4398-8aa6-5e00f313394e</name>
</keypair>

View File

@ -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\n772vd6pBpi4OGQHPKz4djvmCLAVBzSyzDP6EKQIDAQ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i9yeC39ctLUNn+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"
}
}

View File

@ -0,0 +1,36 @@
<?xml version='1.0' encoding='UTF-8'?>
<keypair>
<public_key>ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDcPLt/SUCvzrObsa5dn1M+rHz/9dFTnPhAQ6BFMNMo9EjCLmqWHcOeZ87L6K/caXQOQ7L4rKkQi2aMRt1+GLrY+Y5FeK16Acbd+/37WtB61roPh6uqaMNrm8y2Yusx5/WEDzAZizGDfZwvJa6DVRiQSXSWUeft8dEEWbkCY9FrisnDBA0acb1+kwC+sT9MbjWZ94FJD5ctiHLaQR7e5nFQ7tmMAqiKq14i0R09BoHTd8LUOlh0DD0mtwoHW3YAoIFyJsAtoH/CmBbJ1vjYtna4aATg4eMQMsbz+6LhSQE53dwaRu9AojG7jdC28SEWO/rqznyrDrN6e8sXI5XLX/xL Generated by Nova
</public_key>
<private_key>-----BEGIN RSA PRIVATE KEY-----
M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UCgYAX1OAkt4EUyzwz+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-----
</private_key>
<user_id>fake</user_id>
<name>keypair-ccaba351-1a04-41dd-b80a-0302d460e2f7</name>
<fingerprint>f4:5a:08:66:ef:5a:1b:52:49:1b:82:2c:fc:b3:df:5d</fingerprint>
</keypair>

View File

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

View File

@ -0,0 +1,15 @@
<?xml version='1.0' encoding='UTF-8'?>
<server xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1" status="ACTIVE" updated="2013-09-24T14:46:44Z" user_id="fake" name="new-server-test" created="2013-09-24T14:46:44Z" tenant_id="openstack" access_ip_v4="" progress="0" host_id="2936a2ffe8b5bfa4daa8515e8a5efd7f8842232f471fb01a4238520d" id="91bf1e67-e322-42bd-acba-72a05b456d71" access_ip_v6="" key_name="None">
<image id="70a599e0-31e7-49b7-b260-868f441e862b">
<atom:link href="http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b" rel="bookmark"/>
</image>
<flavor id="1">
<atom:link href="http://openstack.example.com/flavors/1" rel="bookmark"/>
</flavor>
<metadata>
<meta key="My Server Name">Apache1</meta>
</metadata>
<addresses/>
<atom:link href="http://openstack.example.com/v3/servers/91bf1e67-e322-42bd-acba-72a05b456d71" rel="self"/>
<atom:link href="http://openstack.example.com/servers/91bf1e67-e322-42bd-acba-72a05b456d71" rel="bookmark"/>
</server>

View File

@ -0,0 +1,16 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "http://openstack.example.com/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavor_ref" : "http://openstack.example.com/openstack/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
},
"personality" : [
{
"path" : "/etc/banner.txt",
"contents" : "ICAgICAgDQoiQSBjbG91ZCBkb2VzIG5vdCBrbm93IHdoeSBpdCBtb3ZlcyBpbiBqdXN0IHN1Y2ggYSBkaXJlY3Rpb24gYW5kIGF0IHN1Y2ggYSBzcGVlZC4uLkl0IGZlZWxzIGFuIGltcHVsc2lvbi4uLnRoaXMgaXMgdGhlIHBsYWNlIHRvIGdvIG5vdy4gQnV0IHRoZSBza3kga25vd3MgdGhlIHJlYXNvbnMgYW5kIHRoZSBwYXR0ZXJucyBiZWhpbmQgYWxsIGNsb3VkcywgYW5kIHlvdSB3aWxsIGtub3csIHRvbywgd2hlbiB5b3UgbGlmdCB5b3Vyc2VsZiBoaWdoIGVub3VnaCB0byBzZWUgYmV5b25kIGhvcml6b25zLiINCg0KLVJpY2hhcmQgQmFjaA=="
}
]
}
}

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<server xmlns="http://docs.openstack.org/compute/api/v1.1" image_ref="http://openstack.example.com/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b" flavor_ref="http://openstack.example.com/openstack/flavors/1" name="new-server-test">
<metadata>
<meta key="My Server Name">Apache1</meta>
</metadata>
<personality>
<file path="/etc/banner.txt">
ICAgICAgDQoiQSBjbG91ZCBkb2VzIG5vdCBrbm93IHdoeSBp
dCBtb3ZlcyBpbiBqdXN0IHN1Y2ggYSBkaXJlY3Rpb24gYW5k
IGF0IHN1Y2ggYSBzcGVlZC4uLkl0IGZlZWxzIGFuIGltcHVs
c2lvbi4uLnRoaXMgaXMgdGhlIHBsYWNlIHRvIGdvIG5vdy4g
QnV0IHRoZSBza3kga25vd3MgdGhlIHJlYXNvbnMgYW5kIHRo
ZSBwYXR0ZXJucyBiZWhpbmQgYWxsIGNsb3VkcywgYW5kIHlv
dSB3aWxsIGtub3csIHRvbywgd2hlbiB5b3UgbGlmdCB5b3Vy
c2VsZiBoaWdoIGVub3VnaCB0byBzZWUgYmV5b25kIGhvcml6
b25zLiINCg0KLVJpY2hhcmQgQmFjaA==
</file>
</personality>
</server>

View File

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

View File

@ -0,0 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<server xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1" id="3cf4865f-f5ea-44fa-91ce-019588133286" admin_pass="fG4cCiZVtf8p">
<metadata/>
<atom:link href="http://openstack.example.com/v3/servers/3cf4865f-f5ea-44fa-91ce-019588133286" rel="self"/>
<atom:link href="http://openstack.example.com/servers/3cf4865f-f5ea-44fa-91ce-019588133286" rel="bookmark"/>
</server>

View File

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

View File

@ -0,0 +1,17 @@
<?xml version='1.0' encoding='UTF-8'?>
<servers xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1">
<server status="ACTIVE" updated="2013-09-24T14:46:12Z" user_id="fake" name="new-server-test" created="2013-09-24T14:46:12Z" tenant_id="openstack" access_ip_v4="" progress="0" host_id="2bd7dab315ad4219b9762b73fdd9e4b12c00e28d9c21864491ca31f8" id="7e699638-e818-4e05-91f4-15cb802e6da0" access_ip_v6="" key_name="None">
<image id="70a599e0-31e7-49b7-b260-868f441e862b">
<atom:link href="http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b" rel="bookmark"/>
</image>
<flavor id="1">
<atom:link href="http://openstack.example.com/flavors/1" rel="bookmark"/>
</flavor>
<metadata>
<meta key="My Server Name">Apache1</meta>
</metadata>
<addresses/>
<atom:link href="http://openstack.example.com/v3/servers/7e699638-e818-4e05-91f4-15cb802e6da0" rel="self"/>
<atom:link href="http://openstack.example.com/servers/7e699638-e818-4e05-91f4-15cb802e6da0" rel="bookmark"/>
</server>
</servers>

View File

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

View File

@ -0,0 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?>
<servers xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1">
<server name="new-server-test" id="b740ae3b-38a8-4a74-83a1-2047dc76c4d4">
<atom:link href="http://openstack.example.com/v3/servers/b740ae3b-38a8-4a74-83a1-2047dc76c4d4" rel="self"/>
<atom:link href="http://openstack.example.com/servers/b740ae3b-38a8-4a74-83a1-2047dc76c4d4" rel="bookmark"/>
</server>
</servers>

View File

@ -0,0 +1,11 @@
{
"keypairs": [
{
"keypair": {
"fingerprint": "%(fingerprint)s",
"name": "%(keypair_name)s",
"public_key": "%(public_key)s"
}
}
]
}

View File

@ -0,0 +1,9 @@
<?xml version='1.0' encoding='UTF-8'?>
<keypairs>
<keypair>
<public_key>%(public_key)s
</public_key>
<name>%(keypair_name)s</name>
<fingerprint>%(fingerprint)s</fingerprint>
</keypair>
</keypairs>

View File

@ -0,0 +1,6 @@
{
"keypair": {
"name": "%(keypair_name)s",
"public_key": "%(public_key)s"
}
}

View File

@ -0,0 +1,4 @@
<keypair>
<name>%(keypair_name)s</name>
<public_key>%(public_key)s</public_key>
</keypair>

View File

@ -0,0 +1,8 @@
{
"keypair": {
"fingerprint": "%(fingerprint)s",
"name": "%(keypair_name)s",
"public_key": "%(public_key)s",
"user_id": "fake"
}
}

View File

@ -0,0 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?>
<keypair>
<public_key>%(public_key)s</public_key>
<user_id>fake</user_id>
<name>%(keypair_name)s</name>
<fingerprint>%(fingerprint)s</fingerprint>
</keypair>

View File

@ -0,0 +1,5 @@
{
"keypair": {
"name": "%(keypair_name)s"
}
}

View File

@ -0,0 +1,3 @@
<keypair>
<name>%(keypair_name)s</name>
</keypair>

View File

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

View File

@ -0,0 +1,10 @@
<?xml version='1.0' encoding='UTF-8'?>
<keypair>
<public_key>%(public_key)s
</public_key>
<private_key>%(private_key)s
</private_key>
<user_id>fake</user_id>
<name>%(keypair_name)s</name>
<fingerprint>%(fingerprint)s</fingerprint>
</keypair>

View File

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

View File

@ -0,0 +1,15 @@
<?xml version='1.0' encoding='UTF-8'?>
<server xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1" status="ACTIVE" updated="%(timestamp)s" user_id="fake" name="new-server-test" created="%(timestamp)s" tenant_id="openstack" access_ip_v4="" progress="0" host_id="%(hostid)s" id="%(id)s" access_ip_v6="" key_name="None">
<image id="%(uuid)s">
<atom:link href="%(glance_host)s/images/%(uuid)s" rel="bookmark"/>
</image>
<flavor id="1">
<atom:link href="%(host)s/flavors/1" rel="bookmark"/>
</flavor>
<metadata>
<meta key="My Server Name">Apache1</meta>
</metadata>
<addresses/>
<atom:link href="%(host)s/v3/servers/%(uuid)s" rel="self"/>
<atom:link href="%(host)s/servers/%(uuid)s" rel="bookmark"/>
</server>

View File

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

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<server xmlns="http://docs.openstack.org/compute/api/v1.1" image_ref="%(host)s/openstack/images/%(image_id)s" flavor_ref="%(host)s/openstack/flavors/1" name="new-server-test">
<metadata>
<meta key="My Server Name">Apache1</meta>
</metadata>
<personality>
<file path="/etc/banner.txt">
ICAgICAgDQoiQSBjbG91ZCBkb2VzIG5vdCBrbm93IHdoeSBp
dCBtb3ZlcyBpbiBqdXN0IHN1Y2ggYSBkaXJlY3Rpb24gYW5k
IGF0IHN1Y2ggYSBzcGVlZC4uLkl0IGZlZWxzIGFuIGltcHVs
c2lvbi4uLnRoaXMgaXMgdGhlIHBsYWNlIHRvIGdvIG5vdy4g
QnV0IHRoZSBza3kga25vd3MgdGhlIHJlYXNvbnMgYW5kIHRo
ZSBwYXR0ZXJucyBiZWhpbmQgYWxsIGNsb3VkcywgYW5kIHlv
dSB3aWxsIGtub3csIHRvbywgd2hlbiB5b3UgbGlmdCB5b3Vy
c2VsZiBoaWdoIGVub3VnaCB0byBzZWUgYmV5b25kIGhvcml6
b25zLiINCg0KLVJpY2hhcmQgQmFjaA==
</file>
</personality>
</server>

View File

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

View File

@ -0,0 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<server xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1" id="%(id)s" admin_pass="%(password)s">
<metadata/>
<atom:link href="%(host)s/v3/servers/%(uuid)s" rel="self"/>
<atom:link href="%(host)s/servers/%(uuid)s" rel="bookmark"/>
</server>

View File

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

View File

@ -0,0 +1,17 @@
<?xml version='1.0' encoding='UTF-8'?>
<servers xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1">
<server status="ACTIVE" updated="%(timestamp)s" host_id="%(hostid)s" name="new-server-test" created="%(timestamp)s" user_id="fake" tenant_id="openstack" access_ip_v4="" access_ip_v6="" progress="0" id="%(id)s" key_name="None">
<image id="%(uuid)s">
<atom:link href="%(glance_host)s/images/%(uuid)s" rel="bookmark"/>
</image>
<flavor id="1">
<atom:link href="%(host)s/flavors/1" rel="bookmark"/>
</flavor>
<metadata>
<meta key="My Server Name">Apache1</meta>
</metadata>
<addresses/>
<atom:link href="%(host)s/v3/servers/%(id)s" rel="self"/>
<atom:link href="%(host)s/servers/%(id)s" rel="bookmark"/>
</server>
</servers>

View File

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

View File

@ -0,0 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?>
<servers xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1">
<server name="new-server-test" id="%(id)s">
<atom:link href="%(host)s/v3/servers/%(id)s" rel="self"/>
<atom:link href="%(host)s/servers/%(id)s" rel="bookmark"/>
</server>
</servers>

View File

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

View File

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