Add V3 API samples for flavors,flavor-rxtx,flavor-access

Partially implements blueprint v3-api-unittests

Change-Id: I2b572ec13190b946daebec4e64f9b9b362d5ac6e
This commit is contained in:
He Jie Xu 2013-09-04 15:24:41 +08:00
parent 1889c62aea
commit c898bf8ec4
71 changed files with 1767 additions and 0 deletions

View File

@ -0,0 +1,22 @@
{
"flavor": {
"disabled": false,
"disk": 1,
"ephemeral": "",
"id": "1",
"links": [
{
"href": "http://openstack.example.com/v3/flavors/1",
"rel": "self"
},
{
"href": "http://openstack.example.com/flavors/1",
"rel": "bookmark"
}
],
"name": "m1.tiny",
"ram": 512,
"swap": "",
"vcpus": 1
}
}

View File

@ -0,0 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
<flavor xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1" name="m1.tiny" ram="512" ephemeral="" disabled="False" vcpus="1" swap="" disk="1" id="1">
<atom:link href="http://openstack.example.com/v3/flavors/1" rel="self"/>
<atom:link href="http://openstack.example.com/flavors/1" rel="bookmark"/>
</flavor>

View File

@ -0,0 +1,104 @@
{
"flavors": [
{
"disabled": false,
"disk": 1,
"ephemeral": "",
"id": "1",
"links": [
{
"href": "http://openstack.example.com/v3/flavors/1",
"rel": "self"
},
{
"href": "http://openstack.example.com/flavors/1",
"rel": "bookmark"
}
],
"name": "m1.tiny",
"ram": 512,
"swap": "",
"vcpus": 1
},
{
"disabled": false,
"disk": 20,
"ephemeral": "",
"id": "2",
"links": [
{
"href": "http://openstack.example.com/v3/flavors/2",
"rel": "self"
},
{
"href": "http://openstack.example.com/flavors/2",
"rel": "bookmark"
}
],
"name": "m1.small",
"ram": 2048,
"swap": "",
"vcpus": 1
},
{
"disabled": false,
"disk": 40,
"ephemeral": "",
"id": "3",
"links": [
{
"href": "http://openstack.example.com/v3/flavors/3",
"rel": "self"
},
{
"href": "http://openstack.example.com/flavors/3",
"rel": "bookmark"
}
],
"name": "m1.medium",
"ram": 4096,
"swap": "",
"vcpus": 2
},
{
"disabled": false,
"disk": 80,
"ephemeral": "",
"id": "4",
"links": [
{
"href": "http://openstack.example.com/v3/flavors/4",
"rel": "self"
},
{
"href": "http://openstack.example.com/flavors/4",
"rel": "bookmark"
}
],
"name": "m1.large",
"ram": 8192,
"swap": "",
"vcpus": 4
},
{
"disabled": false,
"disk": 160,
"ephemeral": "",
"id": "5",
"links": [
{
"href": "http://openstack.example.com/v3/flavors/5",
"rel": "self"
},
{
"href": "http://openstack.example.com/flavors/5",
"rel": "bookmark"
}
],
"name": "m1.xlarge",
"ram": 16384,
"swap": "",
"vcpus": 8
}
]
}

View File

@ -0,0 +1,23 @@
<?xml version='1.0' encoding='UTF-8'?>
<flavors xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1">
<flavor name="m1.tiny" ram="512" ephemeral="" disabled="False" vcpus="1" swap="" disk="1" id="1">
<atom:link href="http://openstack.example.com/v3/flavors/1" rel="self"/>
<atom:link href="http://openstack.example.com/flavors/1" rel="bookmark"/>
</flavor>
<flavor name="m1.small" ram="2048" ephemeral="" disabled="False" vcpus="1" swap="" disk="20" id="2">
<atom:link href="http://openstack.example.com/v3/flavors/2" rel="self"/>
<atom:link href="http://openstack.example.com/flavors/2" rel="bookmark"/>
</flavor>
<flavor name="m1.medium" ram="4096" ephemeral="" disabled="False" vcpus="2" swap="" disk="40" id="3">
<atom:link href="http://openstack.example.com/v3/flavors/3" rel="self"/>
<atom:link href="http://openstack.example.com/flavors/3" rel="bookmark"/>
</flavor>
<flavor name="m1.large" ram="8192" ephemeral="" disabled="False" vcpus="4" swap="" disk="80" id="4">
<atom:link href="http://openstack.example.com/v3/flavors/4" rel="self"/>
<atom:link href="http://openstack.example.com/flavors/4" rel="bookmark"/>
</flavor>
<flavor name="m1.xlarge" ram="16384" ephemeral="" disabled="False" vcpus="8" swap="" disk="160" id="5">
<atom:link href="http://openstack.example.com/v3/flavors/5" rel="self"/>
<atom:link href="http://openstack.example.com/flavors/5" rel="bookmark"/>
</flavor>
</flavors>

View File

@ -0,0 +1,74 @@
{
"flavors": [
{
"id": "1",
"links": [
{
"href": "http://openstack.example.com/v3/flavors/1",
"rel": "self"
},
{
"href": "http://openstack.example.com/flavors/1",
"rel": "bookmark"
}
],
"name": "m1.tiny"
},
{
"id": "2",
"links": [
{
"href": "http://openstack.example.com/v3/flavors/2",
"rel": "self"
},
{
"href": "http://openstack.example.com/flavors/2",
"rel": "bookmark"
}
],
"name": "m1.small"
},
{
"id": "3",
"links": [
{
"href": "http://openstack.example.com/v3/flavors/3",
"rel": "self"
},
{
"href": "http://openstack.example.com/flavors/3",
"rel": "bookmark"
}
],
"name": "m1.medium"
},
{
"id": "4",
"links": [
{
"href": "http://openstack.example.com/v3/flavors/4",
"rel": "self"
},
{
"href": "http://openstack.example.com/flavors/4",
"rel": "bookmark"
}
],
"name": "m1.large"
},
{
"id": "5",
"links": [
{
"href": "http://openstack.example.com/v3/flavors/5",
"rel": "self"
},
{
"href": "http://openstack.example.com/flavors/5",
"rel": "bookmark"
}
],
"name": "m1.xlarge"
}
]
}

View File

@ -0,0 +1,23 @@
<?xml version='1.0' encoding='UTF-8'?>
<flavors xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1">
<flavor name="m1.tiny" id="1">
<atom:link href="http://openstack.example.com/v3/flavors/1" rel="self"/>
<atom:link href="http://openstack.example.com/flavors/1" rel="bookmark"/>
</flavor>
<flavor name="m1.small" id="2">
<atom:link href="http://openstack.example.com/v3/flavors/2" rel="self"/>
<atom:link href="http://openstack.example.com/flavors/2" rel="bookmark"/>
</flavor>
<flavor name="m1.medium" id="3">
<atom:link href="http://openstack.example.com/v3/flavors/3" rel="self"/>
<atom:link href="http://openstack.example.com/flavors/3" rel="bookmark"/>
</flavor>
<flavor name="m1.large" id="4">
<atom:link href="http://openstack.example.com/v3/flavors/4" rel="self"/>
<atom:link href="http://openstack.example.com/flavors/4" rel="bookmark"/>
</flavor>
<flavor name="m1.xlarge" id="5">
<atom:link href="http://openstack.example.com/v3/flavors/5" rel="self"/>
<atom:link href="http://openstack.example.com/flavors/5" rel="bookmark"/>
</flavor>
</flavors>

View File

@ -0,0 +1,5 @@
{
"add_tenant_access": {
"tenant_id": "fake_tenant"
}
}

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<add_tenant_access>
<tenant_id>fake_tenant</tenant_id>
</add_tenant_access>

View File

@ -0,0 +1,8 @@
{
"flavor_access": [
{
"flavor_id": "10",
"tenant_id": "fake_tenant"
}
]
}

View File

@ -0,0 +1,4 @@
<?xml version='1.0' encoding='UTF-8'?>
<flavor_access>
<access tenant_id="fake_tenant" flavor_id="10"/>
</flavor_access>

View File

@ -0,0 +1,10 @@
{
"flavor": {
"name": "test_flavor",
"ram": 1024,
"vcpus": 2,
"disk": 10,
"id": "10",
"os-flavor-access:is_public": false
}
}

View File

@ -0,0 +1,10 @@
<?xml version='1.0' encoding='UTF-8'?>
<flavor xmlns="http://docs.openstack.org/compute/api/v1.1"
xmlns:os-flavor-access="http://docs.openstack.org/compute/ext/os-flavor-access/api/v3"
name="test_flavor"
ram="1024"
vcpus="2"
disk="10"
id="10"
os-flavor-access:is_public="False"
/>

View File

@ -0,0 +1,23 @@
{
"flavor": {
"disabled": false,
"disk": 10,
"ephemeral": "",
"id": "10",
"links": [
{
"href": "http://openstack.example.com/v3/flavors/10",
"rel": "self"
},
{
"href": "http://openstack.example.com/flavors/10",
"rel": "bookmark"
}
],
"name": "test_flavor",
"os-flavor-access:is_public": false,
"ram": 1024,
"swap": "",
"vcpus": 2
}
}

View File

@ -0,0 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
<flavor xmlns:os-flavor-access="http://docs.openstack.org/compute/ext/os-flavor-access/api/v3" xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1" name="test_flavor" ram="1024" ephemeral="" disabled="False" vcpus="2" swap="" disk="10" id="10" os-flavor-access:is_public="False">
<atom:link href="http://openstack.example.com/v3/flavors/10" rel="self"/>
<atom:link href="http://openstack.example.com/flavors/10" rel="bookmark"/>
</flavor>

View File

@ -0,0 +1,109 @@
{
"flavors": [
{
"disabled": false,
"disk": 1,
"ephemeral": "",
"id": "1",
"links": [
{
"href": "http://openstack.example.com/v3/flavors/1",
"rel": "self"
},
{
"href": "http://openstack.example.com/flavors/1",
"rel": "bookmark"
}
],
"name": "m1.tiny",
"os-flavor-access:is_public": true,
"ram": 512,
"swap": "",
"vcpus": 1
},
{
"disabled": false,
"disk": 20,
"ephemeral": "",
"id": "2",
"links": [
{
"href": "http://openstack.example.com/v3/flavors/2",
"rel": "self"
},
{
"href": "http://openstack.example.com/flavors/2",
"rel": "bookmark"
}
],
"name": "m1.small",
"os-flavor-access:is_public": true,
"ram": 2048,
"swap": "",
"vcpus": 1
},
{
"disabled": false,
"disk": 40,
"ephemeral": "",
"id": "3",
"links": [
{
"href": "http://openstack.example.com/v3/flavors/3",
"rel": "self"
},
{
"href": "http://openstack.example.com/flavors/3",
"rel": "bookmark"
}
],
"name": "m1.medium",
"os-flavor-access:is_public": true,
"ram": 4096,
"swap": "",
"vcpus": 2
},
{
"disabled": false,
"disk": 80,
"ephemeral": "",
"id": "4",
"links": [
{
"href": "http://openstack.example.com/v3/flavors/4",
"rel": "self"
},
{
"href": "http://openstack.example.com/flavors/4",
"rel": "bookmark"
}
],
"name": "m1.large",
"os-flavor-access:is_public": true,
"ram": 8192,
"swap": "",
"vcpus": 4
},
{
"disabled": false,
"disk": 160,
"ephemeral": "",
"id": "5",
"links": [
{
"href": "http://openstack.example.com/v3/flavors/5",
"rel": "self"
},
{
"href": "http://openstack.example.com/flavors/5",
"rel": "bookmark"
}
],
"name": "m1.xlarge",
"os-flavor-access:is_public": true,
"ram": 16384,
"swap": "",
"vcpus": 8
}
]
}

View File

@ -0,0 +1,23 @@
<?xml version='1.0' encoding='UTF-8'?>
<flavors xmlns:os-flavor-access="http://docs.openstack.org/compute/ext/os-flavor-access/api/v3" xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1">
<flavor name="m1.tiny" ram="512" ephemeral="" disabled="False" vcpus="1" swap="" disk="1" id="1" os-flavor-access:is_public="True">
<atom:link href="http://openstack.example.com/v3/flavors/1" rel="self"/>
<atom:link href="http://openstack.example.com/flavors/1" rel="bookmark"/>
</flavor>
<flavor name="m1.small" ram="2048" ephemeral="" disabled="False" vcpus="1" swap="" disk="20" id="2" os-flavor-access:is_public="True">
<atom:link href="http://openstack.example.com/v3/flavors/2" rel="self"/>
<atom:link href="http://openstack.example.com/flavors/2" rel="bookmark"/>
</flavor>
<flavor name="m1.medium" ram="4096" ephemeral="" disabled="False" vcpus="2" swap="" disk="40" id="3" os-flavor-access:is_public="True">
<atom:link href="http://openstack.example.com/v3/flavors/3" rel="self"/>
<atom:link href="http://openstack.example.com/flavors/3" rel="bookmark"/>
</flavor>
<flavor name="m1.large" ram="8192" ephemeral="" disabled="False" vcpus="4" swap="" disk="80" id="4" os-flavor-access:is_public="True">
<atom:link href="http://openstack.example.com/v3/flavors/4" rel="self"/>
<atom:link href="http://openstack.example.com/flavors/4" rel="bookmark"/>
</flavor>
<flavor name="m1.xlarge" ram="16384" ephemeral="" disabled="False" vcpus="8" swap="" disk="160" id="5" os-flavor-access:is_public="True">
<atom:link href="http://openstack.example.com/v3/flavors/5" rel="self"/>
<atom:link href="http://openstack.example.com/flavors/5" rel="bookmark"/>
</flavor>
</flavors>

View File

@ -0,0 +1,8 @@
{
"flavor_access": [
{
"flavor_id": "10",
"tenant_id": "fake_tenant"
}
]
}

View File

@ -0,0 +1,4 @@
<?xml version='1.0' encoding='UTF-8'?>
<flavor_access>
<access tenant_id="fake_tenant" flavor_id="10"/>
</flavor_access>

View File

@ -0,0 +1,5 @@
{
"remove_tenant_access": {
"tenant_id": "fake_tenant"
}
}

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<remove_tenant_access>
<tenant_id>fake_tenant</tenant_id>
</remove_tenant_access>

View File

@ -0,0 +1,3 @@
{
"flavor_access": []
}

View File

@ -0,0 +1,2 @@
<?xml version='1.0' encoding='UTF-8'?>
<flavor_access/>

View File

@ -0,0 +1,23 @@
{
"flavor": {
"disabled": false,
"disk": 1,
"ephemeral": "",
"id": "1",
"links": [
{
"href": "http://openstack.example.com/v3/flavors/1",
"rel": "self"
},
{
"href": "http://openstack.example.com/flavors/1",
"rel": "bookmark"
}
],
"name": "m1.tiny",
"os-flavor-access:is_public": true,
"ram": 512,
"swap": "",
"vcpus": 1
}
}

View File

@ -0,0 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
<flavor xmlns:os-flavor-access="http://docs.openstack.org/compute/ext/os-flavor-access/api/v3" xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1" name="m1.tiny" ram="512" ephemeral="" disabled="False" vcpus="1" swap="" disk="1" id="1" os-flavor-access:is_public="True">
<atom:link href="http://openstack.example.com/v3/flavors/1" rel="self"/>
<atom:link href="http://openstack.example.com/flavors/1" rel="bookmark"/>
</flavor>

View File

@ -0,0 +1,23 @@
{
"flavor": {
"disabled": false,
"disk": 1,
"ephemeral": "",
"id": "1",
"links": [
{
"href": "http://openstack.example.com/v3/flavors/1",
"rel": "self"
},
{
"href": "http://openstack.example.com/flavors/1",
"rel": "bookmark"
}
],
"name": "m1.tiny",
"ram": 512,
"rxtx_factor": 1.0,
"swap": "",
"vcpus": 1
}
}

View File

@ -0,0 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
<flavor xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1" name="m1.tiny" ram="512" ephemeral="" disabled="False" vcpus="1" swap="" disk="1" id="1" rxtx_factor="1.0">
<atom:link href="http://openstack.example.com/v3/flavors/1" rel="self"/>
<atom:link href="http://openstack.example.com/flavors/1" rel="bookmark"/>
</flavor>

View File

@ -0,0 +1,109 @@
{
"flavors": [
{
"disabled": false,
"disk": 1,
"ephemeral": "",
"id": "1",
"links": [
{
"href": "http://openstack.example.com/v3/flavors/1",
"rel": "self"
},
{
"href": "http://openstack.example.com/flavors/1",
"rel": "bookmark"
}
],
"name": "m1.tiny",
"ram": 512,
"rxtx_factor": 1.0,
"swap": "",
"vcpus": 1
},
{
"disabled": false,
"disk": 20,
"ephemeral": "",
"id": "2",
"links": [
{
"href": "http://openstack.example.com/v3/flavors/2",
"rel": "self"
},
{
"href": "http://openstack.example.com/flavors/2",
"rel": "bookmark"
}
],
"name": "m1.small",
"ram": 2048,
"rxtx_factor": 1.0,
"swap": "",
"vcpus": 1
},
{
"disabled": false,
"disk": 40,
"ephemeral": "",
"id": "3",
"links": [
{
"href": "http://openstack.example.com/v3/flavors/3",
"rel": "self"
},
{
"href": "http://openstack.example.com/flavors/3",
"rel": "bookmark"
}
],
"name": "m1.medium",
"ram": 4096,
"rxtx_factor": 1.0,
"swap": "",
"vcpus": 2
},
{
"disabled": false,
"disk": 80,
"ephemeral": "",
"id": "4",
"links": [
{
"href": "http://openstack.example.com/v3/flavors/4",
"rel": "self"
},
{
"href": "http://openstack.example.com/flavors/4",
"rel": "bookmark"
}
],
"name": "m1.large",
"ram": 8192,
"rxtx_factor": 1.0,
"swap": "",
"vcpus": 4
},
{
"disabled": false,
"disk": 160,
"ephemeral": "",
"id": "5",
"links": [
{
"href": "http://openstack.example.com/v3/flavors/5",
"rel": "self"
},
{
"href": "http://openstack.example.com/flavors/5",
"rel": "bookmark"
}
],
"name": "m1.xlarge",
"ram": 16384,
"rxtx_factor": 1.0,
"swap": "",
"vcpus": 8
}
]
}

View File

@ -0,0 +1,23 @@
<?xml version='1.0' encoding='UTF-8'?>
<flavors xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1">
<flavor name="m1.tiny" ram="512" ephemeral="" disabled="False" vcpus="1" swap="" disk="1" id="1" rxtx_factor="1.0">
<atom:link href="http://openstack.example.com/v3/flavors/1" rel="self"/>
<atom:link href="http://openstack.example.com/flavors/1" rel="bookmark"/>
</flavor>
<flavor name="m1.small" ram="2048" ephemeral="" disabled="False" vcpus="1" swap="" disk="20" id="2" rxtx_factor="1.0">
<atom:link href="http://openstack.example.com/v3/flavors/2" rel="self"/>
<atom:link href="http://openstack.example.com/flavors/2" rel="bookmark"/>
</flavor>
<flavor name="m1.medium" ram="4096" ephemeral="" disabled="False" vcpus="2" swap="" disk="40" id="3" rxtx_factor="1.0">
<atom:link href="http://openstack.example.com/v3/flavors/3" rel="self"/>
<atom:link href="http://openstack.example.com/flavors/3" rel="bookmark"/>
</flavor>
<flavor name="m1.large" ram="8192" ephemeral="" disabled="False" vcpus="4" swap="" disk="80" id="4" rxtx_factor="1.0">
<atom:link href="http://openstack.example.com/v3/flavors/4" rel="self"/>
<atom:link href="http://openstack.example.com/flavors/4" rel="bookmark"/>
</flavor>
<flavor name="m1.xlarge" ram="16384" ephemeral="" disabled="False" vcpus="8" swap="" disk="160" id="5" rxtx_factor="1.0">
<atom:link href="http://openstack.example.com/v3/flavors/5" rel="self"/>
<atom:link href="http://openstack.example.com/flavors/5" rel="bookmark"/>
</flavor>
</flavors>

View File

@ -0,0 +1,10 @@
{
"flavor": {
"name": "flavortest",
"ram": 1024,
"vcpus": 2,
"disk": 10,
"id": "100",
"rxtx_factor": 2.0
}
}

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<flavor xmlns="http://docs.openstack.org/compute/api/v1.1"
name="flavortest"
ram="1024"
vcpus="2"
disk="10"
id="100"
rxtx_factor="2.0" />

View File

@ -0,0 +1,23 @@
{
"flavor": {
"disabled": false,
"disk": 10,
"ephemeral": "",
"id": "100",
"links": [
{
"href": "http://openstack.example.com/v3/flavors/100",
"rel": "self"
},
{
"href": "http://openstack.example.com/flavors/100",
"rel": "bookmark"
}
],
"name": "flavortest",
"ram": 1024,
"rxtx_factor": 2.0,
"swap": "",
"vcpus": 2
}
}

View File

@ -0,0 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
<flavor xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1" name="flavortest" ram="1024" ephemeral="" disabled="False" vcpus="2" swap="" disk="10" id="100" rxtx_factor="2.0">
<atom:link href="http://openstack.example.com/v3/flavors/100" rel="self"/>
<atom:link href="http://openstack.example.com/flavors/100" rel="bookmark"/>
</flavor>

View File

@ -0,0 +1,22 @@
{
"flavor": {
"disk": 1,
"id": "1",
"links": [
{
"href": "%(host)s/v3/flavors/1",
"rel": "self"
},
{
"href": "%(host)s/flavors/1",
"rel": "bookmark"
}
],
"name": "m1.tiny",
"ram": 512,
"vcpus": 1,
"disabled": false,
"ephemeral": "",
"swap": ""
}
}

View File

@ -0,0 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
<flavor xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1" name="m1.tiny" ram="512" vcpus="1" disk="1" id="1" disabled="False" ephemeral="" swap="">
<atom:link href="%(host)s/v3/flavors/1" rel="self"/>
<atom:link href="%(host)s/flavors/1" rel="bookmark"/>
</flavor>

View File

@ -0,0 +1,104 @@
{
"flavors": [
{
"disabled": false,
"disk": 1,
"ephemeral": "",
"id": "1",
"links": [
{
"href": "%(host)s/v3/flavors/1",
"rel": "self"
},
{
"href": "%(host)s/flavors/1",
"rel": "bookmark"
}
],
"name": "m1.tiny",
"ram": 512,
"swap": "",
"vcpus": 1
},
{
"disabled": false,
"disk": 20,
"ephemeral": "",
"id": "2",
"links": [
{
"href": "%(host)s/v3/flavors/2",
"rel": "self"
},
{
"href": "%(host)s/flavors/2",
"rel": "bookmark"
}
],
"name": "m1.small",
"ram": 2048,
"swap": "",
"vcpus": 1
},
{
"disabled": false,
"disk": 40,
"ephemeral": "",
"id": "3",
"links": [
{
"href": "%(host)s/v3/flavors/3",
"rel": "self"
},
{
"href": "%(host)s/flavors/3",
"rel": "bookmark"
}
],
"name": "m1.medium",
"ram": 4096,
"swap": "",
"vcpus": 2
},
{
"disabled": false,
"disk": 80,
"ephemeral": "",
"id": "4",
"links": [
{
"href": "%(host)s/v3/flavors/4",
"rel": "self"
},
{
"href": "%(host)s/flavors/4",
"rel": "bookmark"
}
],
"name": "m1.large",
"ram": 8192,
"swap": "",
"vcpus": 4
},
{
"disabled": false,
"disk": 160,
"ephemeral": "",
"id": "5",
"links": [
{
"href": "%(host)s/v3/flavors/5",
"rel": "self"
},
{
"href": "%(host)s/flavors/5",
"rel": "bookmark"
}
],
"name": "m1.xlarge",
"ram": 16384,
"swap": "",
"vcpus": 8
}
]
}

View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<flavors xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1">
<flavor name="m1.tiny" ram="512" ephemeral="" disabled="False" vcpus="1" swap="" disk="1" id="1">
<atom:link href="%(host)s/v3/flavors/1" rel="self"/>
<atom:link href="%(host)s/flavors/1" rel="bookmark"/>
</flavor>
<flavor name="m1.small" ram="2048" ephemeral="" disabled="False" vcpus="1" swap="" disk="20" id="2">
<atom:link href="%(host)s/v3/flavors/2" rel="self"/>
<atom:link href="%(host)s/flavors/2" rel="bookmark"/>
</flavor>
<flavor name="m1.medium" ram="4096" ephemeral="" disabled="False" vcpus="2" swap="" disk="40" id="3">
<atom:link href="%(host)s/v3/flavors/3" rel="self"/>
<atom:link href="%(host)s/flavors/3" rel="bookmark"/>
</flavor>
<flavor name="m1.large" ram="8192" ephemeral="" disabled="False" vcpus="4" swap="" disk="80" id="4">
<atom:link href="%(host)s/v3/flavors/4" rel="self"/>
<atom:link href="%(host)s/flavors/4" rel="bookmark"/>
</flavor>
<flavor name="m1.xlarge" ram="16384" ephemeral="" disabled="False" vcpus="8" swap="" disk="160" id="5">
<atom:link href="%(host)s/v3/flavors/5" rel="self"/>
<atom:link href="%(host)s/flavors/5" rel="bookmark"/>
</flavor>
</flavors>

View File

@ -0,0 +1,74 @@
{
"flavors": [
{
"id": "1",
"links": [
{
"href": "%(host)s/v3/flavors/1",
"rel": "self"
},
{
"href": "%(host)s/flavors/1",
"rel": "bookmark"
}
],
"name": "m1.tiny"
},
{
"id": "2",
"links": [
{
"href": "%(host)s/v3/flavors/2",
"rel": "self"
},
{
"href": "%(host)s/flavors/2",
"rel": "bookmark"
}
],
"name": "m1.small"
},
{
"id": "3",
"links": [
{
"href": "%(host)s/v3/flavors/3",
"rel": "self"
},
{
"href": "%(host)s/flavors/3",
"rel": "bookmark"
}
],
"name": "m1.medium"
},
{
"id": "4",
"links": [
{
"href": "%(host)s/v3/flavors/4",
"rel": "self"
},
{
"href": "%(host)s/flavors/4",
"rel": "bookmark"
}
],
"name": "m1.large"
},
{
"id": "5",
"links": [
{
"href": "%(host)s/v3/flavors/5",
"rel": "self"
},
{
"href": "%(host)s/flavors/5",
"rel": "bookmark"
}
],
"name": "m1.xlarge"
}
]
}

View File

@ -0,0 +1,23 @@
<?xml version='1.0' encoding='UTF-8'?>
<flavors xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1">
<flavor name="m1.tiny" id="1">
<atom:link href="http://openstack.example.com/v3/flavors/1" rel="self"/>
<atom:link href="http://openstack.example.com/flavors/1" rel="bookmark"/>
</flavor>
<flavor name="m1.small" id="2">
<atom:link href="http://openstack.example.com/v3/flavors/2" rel="self"/>
<atom:link href="http://openstack.example.com/flavors/2" rel="bookmark"/>
</flavor>
<flavor name="m1.medium" id="3">
<atom:link href="http://openstack.example.com/v3/flavors/3" rel="self"/>
<atom:link href="http://openstack.example.com/flavors/3" rel="bookmark"/>
</flavor>
<flavor name="m1.large" id="4">
<atom:link href="http://openstack.example.com/v3/flavors/4" rel="self"/>
<atom:link href="http://openstack.example.com/flavors/4" rel="bookmark"/>
</flavor>
<flavor name="m1.xlarge" id="5">
<atom:link href="http://openstack.example.com/v3/flavors/5" rel="self"/>
<atom:link href="http://openstack.example.com/flavors/5" rel="bookmark"/>
</flavor>
</flavors>

View File

@ -0,0 +1,5 @@
{
"add_tenant_access": {
"tenant_id": "%(tenant_id)s"
}
}

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<add_tenant_access>
<tenant_id>%(tenant_id)s</tenant_id>
</add_tenant_access>

View File

@ -0,0 +1,8 @@
{
"flavor_access": [
{
"flavor_id": "%(flavor_id)s",
"tenant_id": "%(tenant_id)s"
}
]
}

View File

@ -0,0 +1,4 @@
<?xml version='1.0' encoding='UTF-8'?>
<flavor_access>
<access tenant_id="%(tenant_id)s" flavor_id="%(flavor_id)s"/>
</flavor_access>

View File

@ -0,0 +1,10 @@
{
"flavor": {
"name": "%(flavor_name)s",
"ram": 1024,
"vcpus": 2,
"disk": 10,
"id": "%(flavor_id)s",
"os-flavor-access:is_public": false
}
}

View File

@ -0,0 +1,10 @@
<?xml version='1.0' encoding='UTF-8'?>
<flavor xmlns="http://docs.openstack.org/compute/api/v1.1"
xmlns:os-flavor-access="http://docs.openstack.org/compute/ext/os-flavor-access/api/v3"
name="%(flavor_name)s"
ram="1024"
vcpus="2"
disk="10"
id="%(flavor_id)s"
os-flavor-access:is_public="False"
/>

View File

@ -0,0 +1,23 @@
{
"flavor": {
"disk": 10,
"id": "%(flavor_id)s",
"links": [
{
"href": "%(host)s/v3/flavors/%(flavor_id)s",
"rel": "self"
},
{
"href": "%(host)s/flavors/%(flavor_id)s",
"rel": "bookmark"
}
],
"name": "%(flavor_name)s",
"os-flavor-access:is_public": false,
"ram": 1024,
"vcpus": 2,
"disabled": false,
"ephemeral": "",
"swap": ""
}
}

View File

@ -0,0 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
<flavor xmlns:os-flavor-access="http://docs.openstack.org/compute/ext/os-flavor-access/api/v3" xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1" disk="10" vcpus="2" ram="1024" name="%(flavor_name)s" id="%(flavor_id)s" os-flavor-access:is_public="False" disabled="False" ephemeral="" swap="">
<atom:link href="%(host)s/v3/flavors/%(flavor_id)s" rel="self"/>
<atom:link href="%(host)s/flavors/%(flavor_id)s" rel="bookmark"/>
</flavor>

View File

@ -0,0 +1,109 @@
{
"flavors": [
{
"disabled": false,
"disk": 1,
"ephemeral": "",
"id": "1",
"links": [
{
"href": "%(host)s/v3/flavors/1",
"rel": "self"
},
{
"href": "%(host)s/flavors/1",
"rel": "bookmark"
}
],
"name": "m1.tiny",
"os-flavor-access:is_public": true,
"ram": 512,
"swap": "",
"vcpus": 1
},
{
"disabled": false,
"disk": 20,
"ephemeral": "",
"id": "2",
"links": [
{
"href": "%(host)s/v3/flavors/2",
"rel": "self"
},
{
"href": "%(host)s/flavors/2",
"rel": "bookmark"
}
],
"name": "m1.small",
"os-flavor-access:is_public": true,
"ram": 2048,
"swap": "",
"vcpus": 1
},
{
"disabled": false,
"disk": 40,
"ephemeral": "",
"id": "3",
"links": [
{
"href": "%(host)s/v3/flavors/3",
"rel": "self"
},
{
"href": "%(host)s/flavors/3",
"rel": "bookmark"
}
],
"name": "m1.medium",
"os-flavor-access:is_public": true,
"ram": 4096,
"swap": "",
"vcpus": 2
},
{
"disabled": false,
"disk": 80,
"ephemeral": "",
"id": "4",
"links": [
{
"href": "%(host)s/v3/flavors/4",
"rel": "self"
},
{
"href": "%(host)s/flavors/4",
"rel": "bookmark"
}
],
"name": "m1.large",
"os-flavor-access:is_public": true,
"ram": 8192,
"swap": "",
"vcpus": 4
},
{
"disabled": false,
"disk": 160,
"ephemeral": "",
"id": "5",
"links": [
{
"href": "%(host)s/v3/flavors/5",
"rel": "self"
},
{
"href": "%(host)s/flavors/5",
"rel": "bookmark"
}
],
"name": "m1.xlarge",
"os-flavor-access:is_public": true,
"ram": 16384,
"swap": "",
"vcpus": 8
}
]
}

View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<flavors xmlns:os-flavor-access="http://docs.openstack.org/compute/ext/os-flavor-access/api/v3" xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1">
<flavor name="m1.tiny" ram="512" ephemeral="" disabled="False" vcpus="1" swap="" disk="1" id="1" os-flavor-access:is_public="True">
<atom:link href="%(host)s/v3/flavors/1" rel="self"/>
<atom:link href="%(host)s/flavors/1" rel="bookmark"/>
</flavor>
<flavor name="m1.small" ram="2048" ephemeral="" disabled="False" vcpus="1" swap="" disk="20" id="2" os-flavor-access:is_public="True">
<atom:link href="%(host)s/v3/flavors/2" rel="self"/>
<atom:link href="%(host)s/flavors/2" rel="bookmark"/>
</flavor>
<flavor name="m1.medium" ram="4096" ephemeral="" disabled="False" vcpus="2" swap="" disk="40" id="3" os-flavor-access:is_public="True">
<atom:link href="%(host)s/v3/flavors/3" rel="self"/>
<atom:link href="%(host)s/flavors/3" rel="bookmark"/>
</flavor>
<flavor name="m1.large" ram="8192" ephemeral="" disabled="False" vcpus="4" swap="" disk="80" id="4" os-flavor-access:is_public="True">
<atom:link href="%(host)s/v3/flavors/4" rel="self"/>
<atom:link href="%(host)s/flavors/4" rel="bookmark"/>
</flavor>
<flavor name="m1.xlarge" ram="16384" ephemeral="" disabled="False" vcpus="8" swap="" disk="160" id="5" os-flavor-access:is_public="True">
<atom:link href="%(host)s/v3/flavors/5" rel="self"/>
<atom:link href="%(host)s/flavors/5" rel="bookmark"/>
</flavor>
</flavors>

View File

@ -0,0 +1,8 @@
{
"flavor_access": [
{
"flavor_id": "%(flavor_id)s",
"tenant_id": "fake_tenant"
}
]
}

View File

@ -0,0 +1,4 @@
<?xml version='1.0' encoding='UTF-8'?>
<flavor_access>
<access tenant_id="%(tenant_id)s" flavor_id="%(flavor_id)s"/>
</flavor_access>

View File

@ -0,0 +1,5 @@
{
"remove_tenant_access": {
"tenant_id": "%(tenant_id)s"
}
}

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<remove_tenant_access>
<tenant_id>%(tenant_id)s</tenant_id>
</remove_tenant_access>

View File

@ -0,0 +1,3 @@
{
"flavor_access": []
}

View File

@ -0,0 +1,2 @@
<?xml version='1.0' encoding='UTF-8'?>
<flavor_access/>

View File

@ -0,0 +1,23 @@
{
"flavor": {
"disk": 1,
"id": "%(flavor_id)s",
"links": [
{
"href": "%(host)s/v3/flavors/%(flavor_id)s",
"rel": "self"
},
{
"href": "%(host)s/flavors/%(flavor_id)s",
"rel": "bookmark"
}
],
"name": "m1.tiny",
"os-flavor-access:is_public": true,
"ram": 512,
"vcpus": 1,
"disabled": false,
"ephemeral": "",
"swap": ""
}
}

View File

@ -0,0 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
<flavor xmlns:os-flavor-access="http://docs.openstack.org/compute/ext/os-flavor-access/api/v3" xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1" disk="1" vcpus="1" ram="512" name="m1.tiny" id="%(flavor_id)s" disabled="False" ephemeral="" swap="" os-flavor-access:is_public="True">
<atom:link href="%(host)s/v3/flavors/%(flavor_id)s" rel="self"/>
<atom:link href="%(host)s/flavors/%(flavor_id)s" rel="bookmark"/>
</flavor>

View File

@ -0,0 +1,23 @@
{
"flavor": {
"disk": 1,
"id": "1",
"links": [
{
"href": "%(host)s/v3/flavors/1",
"rel": "self"
},
{
"href": "%(host)s/flavors/1",
"rel": "bookmark"
}
],
"name": "m1.tiny",
"ram": 512,
"vcpus": 1,
"disabled": false,
"ephemeral": "",
"swap": "",
"rxtx_factor": 1.0
}
}

View File

@ -0,0 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
<flavor xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1" name="m1.tiny" ram="512" vcpus="1" disk="1" id="1" disabled="False" ephemeral="" swap="" rxtx_factor="1.0">
<atom:link href="%(host)s/v3/flavors/1" rel="self"/>
<atom:link href="%(host)s/flavors/1" rel="bookmark"/>
</flavor>

View File

@ -0,0 +1,23 @@
{
"flavor": {
"disabled": false,
"disk": 1,
"ephemeral": "",
"id": "1",
"links": [
{
"href": "http://openstack.example.com/v3/flavors/1",
"rel": "self"
},
{
"href": "http://openstack.example.com/flavors/1",
"rel": "bookmark"
}
],
"name": "m1.tiny",
"ram": 512,
"rxtx_factor": 1.0,
"swap": "",
"vcpus": 1
}
}

View File

@ -0,0 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
<flavor xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1" name="m1.tiny" ram="512" ephemeral="" disabled="False" vcpus="1" swap="" disk="1" id="1" rxtx_factor="1.0">
<atom:link href="http://openstack.example.com/v3/flavors/1" rel="self"/>
<atom:link href="http://openstack.example.com/flavors/1" rel="bookmark"/>
</flavor>

View File

@ -0,0 +1,109 @@
{
"flavors": [
{
"disabled": false,
"disk": 1,
"ephemeral": "",
"id": "1",
"links": [
{
"href": "http://openstack.example.com/v3/flavors/1",
"rel": "self"
},
{
"href": "http://openstack.example.com/flavors/1",
"rel": "bookmark"
}
],
"name": "m1.tiny",
"ram": 512,
"rxtx_factor": 1.0,
"swap": "",
"vcpus": 1
},
{
"disabled": false,
"disk": 20,
"ephemeral": "",
"id": "2",
"links": [
{
"href": "http://openstack.example.com/v3/flavors/2",
"rel": "self"
},
{
"href": "http://openstack.example.com/flavors/2",
"rel": "bookmark"
}
],
"name": "m1.small",
"ram": 2048,
"rxtx_factor": 1.0,
"swap": "",
"vcpus": 1
},
{
"disabled": false,
"disk": 40,
"ephemeral": "",
"id": "3",
"links": [
{
"href": "http://openstack.example.com/v3/flavors/3",
"rel": "self"
},
{
"href": "http://openstack.example.com/flavors/3",
"rel": "bookmark"
}
],
"name": "m1.medium",
"ram": 4096,
"rxtx_factor": 1.0,
"swap": "",
"vcpus": 2
},
{
"disabled": false,
"disk": 80,
"ephemeral": "",
"id": "4",
"links": [
{
"href": "http://openstack.example.com/v3/flavors/4",
"rel": "self"
},
{
"href": "http://openstack.example.com/flavors/4",
"rel": "bookmark"
}
],
"name": "m1.large",
"ram": 8192,
"rxtx_factor": 1.0,
"swap": "",
"vcpus": 4
},
{
"disabled": false,
"disk": 160,
"ephemeral": "",
"id": "5",
"links": [
{
"href": "http://openstack.example.com/v3/flavors/5",
"rel": "self"
},
{
"href": "http://openstack.example.com/flavors/5",
"rel": "bookmark"
}
],
"name": "m1.xlarge",
"ram": 16384,
"rxtx_factor": 1.0,
"swap": "",
"vcpus": 8
}
]
}

View File

@ -0,0 +1,23 @@
<?xml version='1.0' encoding='UTF-8'?>
<flavors xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1">
<flavor name="m1.tiny" ram="512" ephemeral="" disabled="False" vcpus="1" swap="" disk="1" id="1" rxtx_factor="1.0">
<atom:link href="http://openstack.example.com/v3/flavors/1" rel="self"/>
<atom:link href="http://openstack.example.com/flavors/1" rel="bookmark"/>
</flavor>
<flavor name="m1.small" ram="2048" ephemeral="" disabled="False" vcpus="1" swap="" disk="20" id="2" rxtx_factor="1.0">
<atom:link href="http://openstack.example.com/v3/flavors/2" rel="self"/>
<atom:link href="http://openstack.example.com/flavors/2" rel="bookmark"/>
</flavor>
<flavor name="m1.medium" ram="4096" ephemeral="" disabled="False" vcpus="2" swap="" disk="40" id="3" rxtx_factor="1.0">
<atom:link href="http://openstack.example.com/v3/flavors/3" rel="self"/>
<atom:link href="http://openstack.example.com/flavors/3" rel="bookmark"/>
</flavor>
<flavor name="m1.large" ram="8192" ephemeral="" disabled="False" vcpus="4" swap="" disk="80" id="4" rxtx_factor="1.0">
<atom:link href="http://openstack.example.com/v3/flavors/4" rel="self"/>
<atom:link href="http://openstack.example.com/flavors/4" rel="bookmark"/>
</flavor>
<flavor name="m1.xlarge" ram="16384" ephemeral="" disabled="False" vcpus="8" swap="" disk="160" id="5" rxtx_factor="1.0">
<atom:link href="http://openstack.example.com/v3/flavors/5" rel="self"/>
<atom:link href="http://openstack.example.com/flavors/5" rel="bookmark"/>
</flavor>
</flavors>

View File

@ -0,0 +1,10 @@
{
"flavor": {
"name": "%(flavor_name)s",
"ram": 1024,
"vcpus": 2,
"disk": 10,
"id": "%(flavor_id)s",
"rxtx_factor": 2.0
}
}

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<flavor xmlns="http://docs.openstack.org/compute/api/v1.1"
name="%(flavor_name)s"
ram="1024"
vcpus="2"
disk="10"
id="%(flavor_id)s"
rxtx_factor="2.0" />

View File

@ -0,0 +1,23 @@
{
"flavor": {
"disk": 10,
"id": "%(flavor_id)s",
"links": [
{
"href": "%(host)s/v3/flavors/%(flavor_id)s",
"rel": "self"
},
{
"href": "%(host)s/flavors/%(flavor_id)s",
"rel": "bookmark"
}
],
"name": "%(flavor_name)s",
"ram": 1024,
"rxtx_factor": 2.0,
"vcpus": 2,
"disabled": false,
"ephemeral": "",
"swap": ""
}
}

View File

@ -0,0 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
<flavor xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1" disk="10" vcpus="2" ram="1024" name="%(flavor_name)s" id="%(flavor_id)s" disabled="False" ephemeral="" swap="" rxtx_factor="2.0">
<atom:link href="%(host)s/v3/flavors/%(flavor_id)s" rel="self"/>
<atom:link href="%(host)s/flavors/%(flavor_id)s" rel="bookmark"/>
</flavor>

View File

@ -0,0 +1,109 @@
{
"flavors": [
{
"disabled": false,
"disk": 1,
"ephemeral": "",
"id": "1",
"links": [
{
"href": "%(host)s/v3/flavors/1",
"rel": "self"
},
{
"href": "%(host)s/flavors/1",
"rel": "bookmark"
}
],
"name": "m1.tiny",
"ram": 512,
"swap": "",
"vcpus": 1,
"rxtx_factor": 1.0
},
{
"disabled": false,
"disk": 20,
"ephemeral": "",
"id": "2",
"links": [
{
"href": "%(host)s/v3/flavors/2",
"rel": "self"
},
{
"href": "%(host)s/flavors/2",
"rel": "bookmark"
}
],
"name": "m1.small",
"ram": 2048,
"swap": "",
"vcpus": 1,
"rxtx_factor": 1.0
},
{
"disabled": false,
"disk": 40,
"ephemeral": "",
"id": "3",
"links": [
{
"href": "%(host)s/v3/flavors/3",
"rel": "self"
},
{
"href": "%(host)s/flavors/3",
"rel": "bookmark"
}
],
"name": "m1.medium",
"ram": 4096,
"swap": "",
"vcpus": 2,
"rxtx_factor": 1.0
},
{
"disabled": false,
"disk": 80,
"ephemeral": "",
"id": "4",
"links": [
{
"href": "%(host)s/v3/flavors/4",
"rel": "self"
},
{
"href": "%(host)s/flavors/4",
"rel": "bookmark"
}
],
"name": "m1.large",
"ram": 8192,
"swap": "",
"vcpus": 4,
"rxtx_factor": 1.0
},
{
"disabled": false,
"disk": 160,
"ephemeral": "",
"id": "5",
"links": [
{
"href": "%(host)s/v3/flavors/5",
"rel": "self"
},
{
"href": "%(host)s/flavors/5",
"rel": "bookmark"
}
],
"name": "m1.xlarge",
"ram": 16384,
"swap": "",
"vcpus": 8,
"rxtx_factor": 1.0
}
]
}

View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<flavors xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1">
<flavor name="m1.tiny" ram="512" ephemeral="" disabled="False" vcpus="1" swap="" disk="1" id="1" rxtx_factor="1.0">
<atom:link href="%(host)s/v3/flavors/1" rel="self"/>
<atom:link href="%(host)s/flavors/1" rel="bookmark"/>
</flavor>
<flavor name="m1.small" ram="2048" ephemeral="" disabled="False" vcpus="1" swap="" disk="20" id="2" rxtx_factor="1.0">
<atom:link href="%(host)s/v3/flavors/2" rel="self"/>
<atom:link href="%(host)s/flavors/2" rel="bookmark"/>
</flavor>
<flavor name="m1.medium" ram="4096" ephemeral="" disabled="False" vcpus="2" swap="" disk="40" id="3" rxtx_factor="1.0">
<atom:link href="%(host)s/v3/flavors/3" rel="self"/>
<atom:link href="%(host)s/flavors/3" rel="bookmark"/>
</flavor>
<flavor name="m1.large" ram="8192" ephemeral="" disabled="False" vcpus="4" swap="" disk="80" id="4" rxtx_factor="1.0">
<atom:link href="%(host)s/v3/flavors/4" rel="self"/>
<atom:link href="%(host)s/flavors/4" rel="bookmark"/>
</flavor>
<flavor name="m1.xlarge" ram="16384" ephemeral="" disabled="False" vcpus="8" swap="" disk="160" id="5" rxtx_factor="1.0">
<atom:link href="%(host)s/v3/flavors/5" rel="self"/>
<atom:link href="%(host)s/flavors/5" rel="bookmark"/>
</flavor>
</flavors>

View File

@ -0,0 +1,91 @@
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from nova.tests.integrated.v3 import api_sample_base
class FlavorAccessSampleJsonTests(api_sample_base.ApiSampleTestBaseV3):
extension_name = 'os-flavor-access'
extra_extensions_to_load = ['flavor-manage']
def _add_tenant(self):
subs = {
'tenant_id': 'fake_tenant',
'flavor_id': 10,
}
response = self._do_post('flavors/10/action',
'flavor-access-add-tenant-req',
subs)
self._verify_response('flavor-access-add-tenant-resp',
subs, response, 200)
def _create_flavor(self):
subs = {
'flavor_id': 10,
'flavor_name': 'test_flavor'
}
response = self._do_post("flavors",
"flavor-access-create-req",
subs)
subs.update(self._get_regexes())
self._verify_response("flavor-access-create-resp", subs, response, 200)
def test_flavor_access_create(self):
self._create_flavor()
def test_flavor_access_detail(self):
response = self._do_get('flavors/detail')
subs = self._get_regexes()
self._verify_response('flavor-access-detail-resp', subs, response, 200)
def test_flavor_access_list(self):
self._create_flavor()
self._add_tenant()
flavor_id = 10
response = self._do_get('flavors/%s/os-flavor-access' % flavor_id)
subs = {
'flavor_id': flavor_id,
'tenant_id': 'fake_tenant',
}
self._verify_response('flavor-access-list-resp', subs, response, 200)
def test_flavor_access_show(self):
flavor_id = 1
response = self._do_get('flavors/%s' % flavor_id)
subs = {
'flavor_id': flavor_id
}
subs.update(self._get_regexes())
self._verify_response('flavor-access-show-resp', subs, response, 200)
def test_flavor_access_add_tenant(self):
self._create_flavor()
self._add_tenant()
def test_flavor_access_remove_tenant(self):
self._create_flavor()
self._add_tenant()
subs = {
'tenant_id': 'fake_tenant',
}
response = self._do_post('flavors/10/action',
"flavor-access-remove-tenant-req",
subs)
self._verify_response('flavor-access-remove-tenant-resp',
{}, response, 200)
class FlavorAccessSampleXmlTests(FlavorAccessSampleJsonTests):
ctype = 'xml'

View File

@ -0,0 +1,52 @@
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Nebula, Inc.
# Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from nova.tests.integrated.v3 import api_sample_base
class FlavorRxtxJsonTest(api_sample_base.ApiSampleTestBaseV3):
extension_name = 'os-flavor-rxtx'
extra_extensions_to_load = ['flavor-manage']
def test_flavor_rxtx_get(self):
flavor_id = 1
response = self._do_get('flavors/%s' % flavor_id)
subs = {
'flavor_id': flavor_id,
'flavor_name': 'm1.tiny'
}
subs.update(self._get_regexes())
self._verify_response('flavor-rxtx-get-resp', subs, response, 200)
def test_flavors_rxtx_detail(self):
response = self._do_get('flavors/detail')
subs = self._get_regexes()
self._verify_response('flavor-rxtx-list-resp', subs, response, 200)
def test_flavors_rxtx_create(self):
subs = {
'flavor_id': 100,
'flavor_name': 'flavortest'
}
response = self._do_post('flavors',
'flavor-rxtx-post-req',
subs)
subs.update(self._get_regexes())
self._verify_response('flavor-rxtx-post-resp', subs, response, 200)
class FlavorRxtxXmlTest(FlavorRxtxJsonTest):
ctype = 'xml'

View File

@ -0,0 +1,40 @@
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Nebula, Inc.
# Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from nova.tests.integrated.v3 import api_sample_base
class FlavorsSampleJsonTest(api_sample_base.ApiSampleTestBaseV3):
sample_dir = 'flavors'
def test_flavors_get(self):
response = self._do_get('flavors/1')
subs = self._get_regexes()
self._verify_response('flavor-get-resp', subs, response, 200)
def test_flavors_list(self):
response = self._do_get('flavors')
subs = self._get_regexes()
self._verify_response('flavors-list-resp', subs, response, 200)
def test_flavors_detail(self):
response = self._do_get('flavors/detail')
subs = self._get_regexes()
self._verify_response('flavors-detail-resp', subs, response, 200)
class FlavorsSampleXmlTest(FlavorsSampleJsonTest):
ctype = 'xml'