summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHe Jie Xu <xuhj@linux.vnet.ibm.com>2013-09-03 16:22:56 +0800
committerHe Jie Xu <xuhj@linux.vnet.ibm.com>2013-09-18 15:35:56 +0800
commita87c65d0eef6d1b0df0d1d970e7e52866bf4dfc0 (patch)
tree0bb5fa9e07b001b5bbfb93e740c4bfbed4480cec
parentdacb9a19a546da7da9a701cfd5b2a13e244ba4ed (diff)
downloadnova-a87c65d0eef6d1b0df0d1d970e7e52866bf4dfc0.tar.gz
Add V3 API samples for quota-sets/class-sets,inst-usage-audit-log
Partially implements blueprint v3-api-unittests Change-Id: I6c21e5dffc5669bb6ab2bba091b97725cc19fd69
-rw-r--r--doc/v3/api_samples/os-instance-usage-audit-log/inst-usage-audit-log-index-get-resp.json17
-rw-r--r--doc/v3/api_samples/os-instance-usage-audit-log/inst-usage-audit-log-index-get-resp.xml16
-rw-r--r--doc/v3/api_samples/os-instance-usage-audit-log/inst-usage-audit-log-index-with-before-get-resp.json17
-rw-r--r--doc/v3/api_samples/os-instance-usage-audit-log/inst-usage-audit-log-index-with-before-get-resp.xml16
-rw-r--r--doc/v3/api_samples/os-quota-class-sets/quota-classes-show-get-resp.json17
-rw-r--r--doc/v3/api_samples/os-quota-class-sets/quota-classes-show-get-resp.xml15
-rw-r--r--doc/v3/api_samples/os-quota-class-sets/quota-classes-update-post-req.json16
-rw-r--r--doc/v3/api_samples/os-quota-class-sets/quota-classes-update-post-req.xml15
-rw-r--r--doc/v3/api_samples/os-quota-class-sets/quota-classes-update-post-resp.json17
-rw-r--r--doc/v3/api_samples/os-quota-class-sets/quota-classes-update-post-resp.xml15
-rw-r--r--doc/v3/api_samples/os-quota-sets/quotas-show-defaults-get-resp.json17
-rw-r--r--doc/v3/api_samples/os-quota-sets/quotas-show-defaults-get-resp.xml15
-rw-r--r--doc/v3/api_samples/os-quota-sets/quotas-show-get-resp.json17
-rw-r--r--doc/v3/api_samples/os-quota-sets/quotas-show-get-resp.xml15
-rw-r--r--doc/v3/api_samples/os-quota-sets/quotas-update-force-post-req.json6
-rw-r--r--doc/v3/api_samples/os-quota-sets/quotas-update-force-post-req.xml5
-rw-r--r--doc/v3/api_samples/os-quota-sets/quotas-update-force-post-resp.json17
-rw-r--r--doc/v3/api_samples/os-quota-sets/quotas-update-force-post-resp.xml15
-rw-r--r--doc/v3/api_samples/os-quota-sets/quotas-update-post-req.json5
-rw-r--r--doc/v3/api_samples/os-quota-sets/quotas-update-post-req.xml4
-rw-r--r--doc/v3/api_samples/os-quota-sets/quotas-update-post-resp.json17
-rw-r--r--doc/v3/api_samples/os-quota-sets/quotas-update-post-resp.xml15
-rw-r--r--doc/v3/api_samples/os-quota-sets/user-quotas-show-get-resp.json17
-rw-r--r--doc/v3/api_samples/os-quota-sets/user-quotas-show-get-resp.xml15
-rw-r--r--doc/v3/api_samples/os-quota-sets/user-quotas-update-post-req.json6
-rw-r--r--doc/v3/api_samples/os-quota-sets/user-quotas-update-post-req.xml5
-rw-r--r--doc/v3/api_samples/os-quota-sets/user-quotas-update-post-resp.json17
-rw-r--r--doc/v3/api_samples/os-quota-sets/user-quotas-update-post-resp.xml15
-rw-r--r--nova/tests/integrated/v3/api_samples/os-instance-usage-audit-log/inst-usage-audit-log-index-get-resp.json.tpl17
-rw-r--r--nova/tests/integrated/v3/api_samples/os-instance-usage-audit-log/inst-usage-audit-log-index-get-resp.xml.tpl16
-rw-r--r--nova/tests/integrated/v3/api_samples/os-instance-usage-audit-log/inst-usage-audit-log-index-with-before-get-resp.json.tpl17
-rw-r--r--nova/tests/integrated/v3/api_samples/os-instance-usage-audit-log/inst-usage-audit-log-index-with-before-get-resp.xml.tpl16
-rw-r--r--nova/tests/integrated/v3/api_samples/os-quota-class-sets/quota-classes-show-get-resp.json.tpl17
-rw-r--r--nova/tests/integrated/v3/api_samples/os-quota-class-sets/quota-classes-show-get-resp.xml.tpl15
-rw-r--r--nova/tests/integrated/v3/api_samples/os-quota-class-sets/quota-classes-update-post-req.json.tpl16
-rw-r--r--nova/tests/integrated/v3/api_samples/os-quota-class-sets/quota-classes-update-post-req.xml.tpl15
-rw-r--r--nova/tests/integrated/v3/api_samples/os-quota-class-sets/quota-classes-update-post-resp.json.tpl17
-rw-r--r--nova/tests/integrated/v3/api_samples/os-quota-class-sets/quota-classes-update-post-resp.xml.tpl15
-rw-r--r--nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-show-defaults-get-resp.json.tpl17
-rw-r--r--nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-show-defaults-get-resp.xml.tpl15
-rw-r--r--nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-show-get-resp.json.tpl17
-rw-r--r--nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-show-get-resp.xml.tpl15
-rw-r--r--nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-update-force-post-req.json.tpl6
-rw-r--r--nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-update-force-post-req.xml.tpl5
-rw-r--r--nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-update-force-post-resp.json.tpl17
-rw-r--r--nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-update-force-post-resp.xml.tpl15
-rw-r--r--nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-update-force-resp.json.tpl17
-rw-r--r--nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-update-force-resp.xml.tpl15
-rw-r--r--nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-update-post-req.json.tpl5
-rw-r--r--nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-update-post-req.xml.tpl4
-rw-r--r--nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-update-post-resp.json.tpl17
-rw-r--r--nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-update-post-resp.xml.tpl15
-rw-r--r--nova/tests/integrated/v3/api_samples/os-quota-sets/user-quotas-show-get-resp.json.tpl17
-rw-r--r--nova/tests/integrated/v3/api_samples/os-quota-sets/user-quotas-show-get-resp.xml.tpl15
-rw-r--r--nova/tests/integrated/v3/api_samples/os-quota-sets/user-quotas-update-post-req.json.tpl6
-rw-r--r--nova/tests/integrated/v3/api_samples/os-quota-sets/user-quotas-update-post-req.xml.tpl5
-rw-r--r--nova/tests/integrated/v3/api_samples/os-quota-sets/user-quotas-update-post-resp.json.tpl17
-rw-r--r--nova/tests/integrated/v3/api_samples/os-quota-sets/user-quotas-update-post-resp.xml.tpl15
-rw-r--r--nova/tests/integrated/v3/test_instance_usage_audit_log.py43
-rw-r--r--nova/tests/integrated/v3/test_quota_class_sets.py41
-rw-r--r--nova/tests/integrated/v3/test_quota_sets.py75
61 files changed, 959 insertions, 0 deletions
diff --git a/doc/v3/api_samples/os-instance-usage-audit-log/inst-usage-audit-log-index-get-resp.json b/doc/v3/api_samples/os-instance-usage-audit-log/inst-usage-audit-log-index-get-resp.json
new file mode 100644
index 0000000000..e3fbc1aa66
--- /dev/null
+++ b/doc/v3/api_samples/os-instance-usage-audit-log/inst-usage-audit-log-index-get-resp.json
@@ -0,0 +1,17 @@
+{
+ "instance_usage_audit_log": {
+ "hosts_not_run": [
+ "defac351f91940668301096238d26b47"
+ ],
+ "log": {},
+ "num_hosts": 1,
+ "num_hosts_done": 0,
+ "num_hosts_not_run": 1,
+ "num_hosts_running": 0,
+ "overall_status": "0 of 1 hosts done. 0 errors.",
+ "period_beginning": "2013-08-01 00:00:00",
+ "period_ending": "2013-09-01 00:00:00",
+ "total_errors": 0,
+ "total_instances": 0
+ }
+} \ No newline at end of file
diff --git a/doc/v3/api_samples/os-instance-usage-audit-log/inst-usage-audit-log-index-get-resp.xml b/doc/v3/api_samples/os-instance-usage-audit-log/inst-usage-audit-log-index-get-resp.xml
new file mode 100644
index 0000000000..f0ff600bcf
--- /dev/null
+++ b/doc/v3/api_samples/os-instance-usage-audit-log/inst-usage-audit-log-index-get-resp.xml
@@ -0,0 +1,16 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<instance_usage_audit_log>
+ <total_errors>0</total_errors>
+ <total_instances>0</total_instances>
+ <log/>
+ <num_hosts_running>0</num_hosts_running>
+ <num_hosts_done>0</num_hosts_done>
+ <num_hosts_not_run>1</num_hosts_not_run>
+ <hosts_not_run>
+ <item>68368b25d745464695a6352a855d8d2e</item>
+ </hosts_not_run>
+ <overall_status>0 of 1 hosts done. 0 errors.</overall_status>
+ <period_ending>2013-09-01 00:00:00</period_ending>
+ <period_beginning>2013-08-01 00:00:00</period_beginning>
+ <num_hosts>1</num_hosts>
+</instance_usage_audit_log> \ No newline at end of file
diff --git a/doc/v3/api_samples/os-instance-usage-audit-log/inst-usage-audit-log-index-with-before-get-resp.json b/doc/v3/api_samples/os-instance-usage-audit-log/inst-usage-audit-log-index-with-before-get-resp.json
new file mode 100644
index 0000000000..27dfafe198
--- /dev/null
+++ b/doc/v3/api_samples/os-instance-usage-audit-log/inst-usage-audit-log-index-with-before-get-resp.json
@@ -0,0 +1,17 @@
+{
+ "instance_usage_audit_log": {
+ "hosts_not_run": [
+ "ccf86bf6d0104fe69ee658eaa31a7469"
+ ],
+ "log": {},
+ "num_hosts": 1,
+ "num_hosts_done": 0,
+ "num_hosts_not_run": 1,
+ "num_hosts_running": 0,
+ "overall_status": "0 of 1 hosts done. 0 errors.",
+ "period_beginning": "2012-06-01 00:00:00",
+ "period_ending": "2012-07-01 00:00:00",
+ "total_errors": 0,
+ "total_instances": 0
+ }
+} \ No newline at end of file
diff --git a/doc/v3/api_samples/os-instance-usage-audit-log/inst-usage-audit-log-index-with-before-get-resp.xml b/doc/v3/api_samples/os-instance-usage-audit-log/inst-usage-audit-log-index-with-before-get-resp.xml
new file mode 100644
index 0000000000..2332988e42
--- /dev/null
+++ b/doc/v3/api_samples/os-instance-usage-audit-log/inst-usage-audit-log-index-with-before-get-resp.xml
@@ -0,0 +1,16 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<instance_usage_audit_log>
+ <total_errors>0</total_errors>
+ <total_instances>0</total_instances>
+ <log/>
+ <num_hosts_running>0</num_hosts_running>
+ <num_hosts_done>0</num_hosts_done>
+ <num_hosts_not_run>1</num_hosts_not_run>
+ <hosts_not_run>
+ <item>744e1407f60c44ad832bd9f4ffe2122f</item>
+ </hosts_not_run>
+ <overall_status>0 of 1 hosts done. 0 errors.</overall_status>
+ <period_ending>2012-07-01 00:00:00</period_ending>
+ <period_beginning>2012-06-01 00:00:00</period_beginning>
+ <num_hosts>1</num_hosts>
+</instance_usage_audit_log> \ No newline at end of file
diff --git a/doc/v3/api_samples/os-quota-class-sets/quota-classes-show-get-resp.json b/doc/v3/api_samples/os-quota-class-sets/quota-classes-show-get-resp.json
new file mode 100644
index 0000000000..462425c8f0
--- /dev/null
+++ b/doc/v3/api_samples/os-quota-class-sets/quota-classes-show-get-resp.json
@@ -0,0 +1,17 @@
+{
+ "quota_class_set": {
+ "cores": 20,
+ "fixed_ips": -1,
+ "floating_ips": 10,
+ "id": "test_class",
+ "injected_file_content_bytes": 10240,
+ "injected_file_path_bytes": 255,
+ "injected_files": 5,
+ "instances": 10,
+ "key_pairs": 100,
+ "metadata_items": 128,
+ "ram": 51200,
+ "security_group_rules": 20,
+ "security_groups": 10
+ }
+} \ No newline at end of file
diff --git a/doc/v3/api_samples/os-quota-class-sets/quota-classes-show-get-resp.xml b/doc/v3/api_samples/os-quota-class-sets/quota-classes-show-get-resp.xml
new file mode 100644
index 0000000000..d0570e9c85
--- /dev/null
+++ b/doc/v3/api_samples/os-quota-class-sets/quota-classes-show-get-resp.xml
@@ -0,0 +1,15 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<quota_class_set id="test_class">
+ <cores>20</cores>
+ <fixed_ips>-1</fixed_ips>
+ <floating_ips>10</floating_ips>
+ <injected_file_content_bytes>10240</injected_file_content_bytes>
+ <injected_file_path_bytes>255</injected_file_path_bytes>
+ <injected_files>5</injected_files>
+ <instances>10</instances>
+ <key_pairs>100</key_pairs>
+ <metadata_items>128</metadata_items>
+ <ram>51200</ram>
+ <security_group_rules>20</security_group_rules>
+ <security_groups>10</security_groups>
+</quota_class_set> \ No newline at end of file
diff --git a/doc/v3/api_samples/os-quota-class-sets/quota-classes-update-post-req.json b/doc/v3/api_samples/os-quota-class-sets/quota-classes-update-post-req.json
new file mode 100644
index 0000000000..4f6f840f1b
--- /dev/null
+++ b/doc/v3/api_samples/os-quota-class-sets/quota-classes-update-post-req.json
@@ -0,0 +1,16 @@
+{
+ "quota_class_set": {
+ "instances": 50,
+ "cores": 50,
+ "ram": 51200,
+ "floating_ips": 10,
+ "fixed_ips": -1,
+ "metadata_items": 128,
+ "injected_files": 5,
+ "injected_file_content_bytes": 10240,
+ "injected_file_path_bytes": 255,
+ "security_groups": 10,
+ "security_group_rules": 20,
+ "key_pairs": 100
+ }
+} \ No newline at end of file
diff --git a/doc/v3/api_samples/os-quota-class-sets/quota-classes-update-post-req.xml b/doc/v3/api_samples/os-quota-class-sets/quota-classes-update-post-req.xml
new file mode 100644
index 0000000000..d55c980172
--- /dev/null
+++ b/doc/v3/api_samples/os-quota-class-sets/quota-classes-update-post-req.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<quota_class_set>
+ <cores>50</cores>
+ <floating_ips>10</floating_ips>
+ <fixed_ips>-1</fixed_ips>
+ <injected_file_content_bytes>10240</injected_file_content_bytes>
+ <injected_file_path_bytes>255</injected_file_path_bytes>
+ <injected_files>5</injected_files>
+ <instances>50</instances>
+ <key_pairs>100</key_pairs>
+ <metadata_items>128</metadata_items>
+ <ram>51200</ram>
+ <security_group_rules>20</security_group_rules>
+ <security_groups>10</security_groups>
+</quota_class_set> \ No newline at end of file
diff --git a/doc/v3/api_samples/os-quota-class-sets/quota-classes-update-post-resp.json b/doc/v3/api_samples/os-quota-class-sets/quota-classes-update-post-resp.json
new file mode 100644
index 0000000000..41ebc43f4a
--- /dev/null
+++ b/doc/v3/api_samples/os-quota-class-sets/quota-classes-update-post-resp.json
@@ -0,0 +1,17 @@
+{
+ "quota_class_set": {
+ "cores": 50,
+ "fixed_ips": -1,
+ "floating_ips": 10,
+ "id": "test_class",
+ "injected_file_content_bytes": 10240,
+ "injected_file_path_bytes": 255,
+ "injected_files": 5,
+ "instances": 50,
+ "key_pairs": 100,
+ "metadata_items": 128,
+ "ram": 51200,
+ "security_group_rules": 20,
+ "security_groups": 10
+ }
+} \ No newline at end of file
diff --git a/doc/v3/api_samples/os-quota-class-sets/quota-classes-update-post-resp.xml b/doc/v3/api_samples/os-quota-class-sets/quota-classes-update-post-resp.xml
new file mode 100644
index 0000000000..045317f29c
--- /dev/null
+++ b/doc/v3/api_samples/os-quota-class-sets/quota-classes-update-post-resp.xml
@@ -0,0 +1,15 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<quota_class_set id="test_class">
+ <cores>50</cores>
+ <fixed_ips>-1</fixed_ips>
+ <floating_ips>10</floating_ips>
+ <injected_file_content_bytes>10240</injected_file_content_bytes>
+ <injected_file_path_bytes>255</injected_file_path_bytes>
+ <injected_files>5</injected_files>
+ <instances>50</instances>
+ <key_pairs>100</key_pairs>
+ <metadata_items>128</metadata_items>
+ <ram>51200</ram>
+ <security_group_rules>20</security_group_rules>
+ <security_groups>10</security_groups>
+</quota_class_set> \ No newline at end of file
diff --git a/doc/v3/api_samples/os-quota-sets/quotas-show-defaults-get-resp.json b/doc/v3/api_samples/os-quota-sets/quotas-show-defaults-get-resp.json
new file mode 100644
index 0000000000..0f54075456
--- /dev/null
+++ b/doc/v3/api_samples/os-quota-sets/quotas-show-defaults-get-resp.json
@@ -0,0 +1,17 @@
+{
+ "quota_set": {
+ "cores": 20,
+ "fixed_ips": -1,
+ "floating_ips": 10,
+ "id": "fake_tenant",
+ "injected_file_content_bytes": 10240,
+ "injected_file_path_bytes": 255,
+ "injected_files": 5,
+ "instances": 10,
+ "key_pairs": 100,
+ "metadata_items": 128,
+ "ram": 51200,
+ "security_group_rules": 20,
+ "security_groups": 10
+ }
+} \ No newline at end of file
diff --git a/doc/v3/api_samples/os-quota-sets/quotas-show-defaults-get-resp.xml b/doc/v3/api_samples/os-quota-sets/quotas-show-defaults-get-resp.xml
new file mode 100644
index 0000000000..da9a2577e2
--- /dev/null
+++ b/doc/v3/api_samples/os-quota-sets/quotas-show-defaults-get-resp.xml
@@ -0,0 +1,15 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<quota_set id="fake_tenant">
+ <cores>20</cores>
+ <fixed_ips>-1</fixed_ips>
+ <floating_ips>10</floating_ips>
+ <injected_file_content_bytes>10240</injected_file_content_bytes>
+ <injected_file_path_bytes>255</injected_file_path_bytes>
+ <injected_files>5</injected_files>
+ <instances>10</instances>
+ <key_pairs>100</key_pairs>
+ <metadata_items>128</metadata_items>
+ <ram>51200</ram>
+ <security_group_rules>20</security_group_rules>
+ <security_groups>10</security_groups>
+</quota_set> \ No newline at end of file
diff --git a/doc/v3/api_samples/os-quota-sets/quotas-show-get-resp.json b/doc/v3/api_samples/os-quota-sets/quotas-show-get-resp.json
new file mode 100644
index 0000000000..0f54075456
--- /dev/null
+++ b/doc/v3/api_samples/os-quota-sets/quotas-show-get-resp.json
@@ -0,0 +1,17 @@
+{
+ "quota_set": {
+ "cores": 20,
+ "fixed_ips": -1,
+ "floating_ips": 10,
+ "id": "fake_tenant",
+ "injected_file_content_bytes": 10240,
+ "injected_file_path_bytes": 255,
+ "injected_files": 5,
+ "instances": 10,
+ "key_pairs": 100,
+ "metadata_items": 128,
+ "ram": 51200,
+ "security_group_rules": 20,
+ "security_groups": 10
+ }
+} \ No newline at end of file
diff --git a/doc/v3/api_samples/os-quota-sets/quotas-show-get-resp.xml b/doc/v3/api_samples/os-quota-sets/quotas-show-get-resp.xml
new file mode 100644
index 0000000000..da9a2577e2
--- /dev/null
+++ b/doc/v3/api_samples/os-quota-sets/quotas-show-get-resp.xml
@@ -0,0 +1,15 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<quota_set id="fake_tenant">
+ <cores>20</cores>
+ <fixed_ips>-1</fixed_ips>
+ <floating_ips>10</floating_ips>
+ <injected_file_content_bytes>10240</injected_file_content_bytes>
+ <injected_file_path_bytes>255</injected_file_path_bytes>
+ <injected_files>5</injected_files>
+ <instances>10</instances>
+ <key_pairs>100</key_pairs>
+ <metadata_items>128</metadata_items>
+ <ram>51200</ram>
+ <security_group_rules>20</security_group_rules>
+ <security_groups>10</security_groups>
+</quota_set> \ No newline at end of file
diff --git a/doc/v3/api_samples/os-quota-sets/quotas-update-force-post-req.json b/doc/v3/api_samples/os-quota-sets/quotas-update-force-post-req.json
new file mode 100644
index 0000000000..460d2ac1c7
--- /dev/null
+++ b/doc/v3/api_samples/os-quota-sets/quotas-update-force-post-req.json
@@ -0,0 +1,6 @@
+{
+ "quota_set": {
+ "force": "True",
+ "instances": 45
+ }
+} \ No newline at end of file
diff --git a/doc/v3/api_samples/os-quota-sets/quotas-update-force-post-req.xml b/doc/v3/api_samples/os-quota-sets/quotas-update-force-post-req.xml
new file mode 100644
index 0000000000..7e5d4f320a
--- /dev/null
+++ b/doc/v3/api_samples/os-quota-sets/quotas-update-force-post-req.xml
@@ -0,0 +1,5 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<quota_set>
+ <force>True</force>
+ <instances>45</instances>
+</quota_set> \ No newline at end of file
diff --git a/doc/v3/api_samples/os-quota-sets/quotas-update-force-post-resp.json b/doc/v3/api_samples/os-quota-sets/quotas-update-force-post-resp.json
new file mode 100644
index 0000000000..8f98181fd7
--- /dev/null
+++ b/doc/v3/api_samples/os-quota-sets/quotas-update-force-post-resp.json
@@ -0,0 +1,17 @@
+{
+ "quota_set": {
+ "cores": 20,
+ "fixed_ips": -1,
+ "floating_ips": 10,
+ "id": "fake_tenant",
+ "injected_file_content_bytes": 10240,
+ "injected_file_path_bytes": 255,
+ "injected_files": 5,
+ "instances": 45,
+ "key_pairs": 100,
+ "metadata_items": 128,
+ "ram": 51200,
+ "security_group_rules": 20,
+ "security_groups": 10
+ }
+} \ No newline at end of file
diff --git a/doc/v3/api_samples/os-quota-sets/quotas-update-force-post-resp.xml b/doc/v3/api_samples/os-quota-sets/quotas-update-force-post-resp.xml
new file mode 100644
index 0000000000..8d88180183
--- /dev/null
+++ b/doc/v3/api_samples/os-quota-sets/quotas-update-force-post-resp.xml
@@ -0,0 +1,15 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<quota_set id="fake_tenant">
+ <cores>20</cores>
+ <fixed_ips>-1</fixed_ips>
+ <floating_ips>10</floating_ips>
+ <injected_file_content_bytes>10240</injected_file_content_bytes>
+ <injected_file_path_bytes>255</injected_file_path_bytes>
+ <injected_files>5</injected_files>
+ <instances>45</instances>
+ <key_pairs>100</key_pairs>
+ <metadata_items>128</metadata_items>
+ <ram>51200</ram>
+ <security_group_rules>20</security_group_rules>
+ <security_groups>10</security_groups>
+</quota_set> \ No newline at end of file
diff --git a/doc/v3/api_samples/os-quota-sets/quotas-update-post-req.json b/doc/v3/api_samples/os-quota-sets/quotas-update-post-req.json
new file mode 100644
index 0000000000..0b78cff309
--- /dev/null
+++ b/doc/v3/api_samples/os-quota-sets/quotas-update-post-req.json
@@ -0,0 +1,5 @@
+{
+ "quota_set": {
+ "security_groups": 45
+ }
+} \ No newline at end of file
diff --git a/doc/v3/api_samples/os-quota-sets/quotas-update-post-req.xml b/doc/v3/api_samples/os-quota-sets/quotas-update-post-req.xml
new file mode 100644
index 0000000000..c46c75f95f
--- /dev/null
+++ b/doc/v3/api_samples/os-quota-sets/quotas-update-post-req.xml
@@ -0,0 +1,4 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<quota_set>
+ <security_groups>45</security_groups>
+</quota_set> \ No newline at end of file
diff --git a/doc/v3/api_samples/os-quota-sets/quotas-update-post-resp.json b/doc/v3/api_samples/os-quota-sets/quotas-update-post-resp.json
new file mode 100644
index 0000000000..ae2bda0941
--- /dev/null
+++ b/doc/v3/api_samples/os-quota-sets/quotas-update-post-resp.json
@@ -0,0 +1,17 @@
+{
+ "quota_set": {
+ "cores": 20,
+ "fixed_ips": -1,
+ "floating_ips": 10,
+ "id": "fake_tenant",
+ "injected_file_content_bytes": 10240,
+ "injected_file_path_bytes": 255,
+ "injected_files": 5,
+ "instances": 10,
+ "key_pairs": 100,
+ "metadata_items": 128,
+ "ram": 51200,
+ "security_group_rules": 20,
+ "security_groups": 45
+ }
+} \ No newline at end of file
diff --git a/doc/v3/api_samples/os-quota-sets/quotas-update-post-resp.xml b/doc/v3/api_samples/os-quota-sets/quotas-update-post-resp.xml
new file mode 100644
index 0000000000..a97431e00a
--- /dev/null
+++ b/doc/v3/api_samples/os-quota-sets/quotas-update-post-resp.xml
@@ -0,0 +1,15 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<quota_set id="fake_tenant">
+ <cores>20</cores>
+ <fixed_ips>-1</fixed_ips>
+ <floating_ips>10</floating_ips>
+ <injected_file_content_bytes>10240</injected_file_content_bytes>
+ <injected_file_path_bytes>255</injected_file_path_bytes>
+ <injected_files>5</injected_files>
+ <instances>10</instances>
+ <key_pairs>100</key_pairs>
+ <metadata_items>128</metadata_items>
+ <ram>51200</ram>
+ <security_group_rules>20</security_group_rules>
+ <security_groups>45</security_groups>
+</quota_set> \ No newline at end of file
diff --git a/doc/v3/api_samples/os-quota-sets/user-quotas-show-get-resp.json b/doc/v3/api_samples/os-quota-sets/user-quotas-show-get-resp.json
new file mode 100644
index 0000000000..0f54075456
--- /dev/null
+++ b/doc/v3/api_samples/os-quota-sets/user-quotas-show-get-resp.json
@@ -0,0 +1,17 @@
+{
+ "quota_set": {
+ "cores": 20,
+ "fixed_ips": -1,
+ "floating_ips": 10,
+ "id": "fake_tenant",
+ "injected_file_content_bytes": 10240,
+ "injected_file_path_bytes": 255,
+ "injected_files": 5,
+ "instances": 10,
+ "key_pairs": 100,
+ "metadata_items": 128,
+ "ram": 51200,
+ "security_group_rules": 20,
+ "security_groups": 10
+ }
+} \ No newline at end of file
diff --git a/doc/v3/api_samples/os-quota-sets/user-quotas-show-get-resp.xml b/doc/v3/api_samples/os-quota-sets/user-quotas-show-get-resp.xml
new file mode 100644
index 0000000000..da9a2577e2
--- /dev/null
+++ b/doc/v3/api_samples/os-quota-sets/user-quotas-show-get-resp.xml
@@ -0,0 +1,15 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<quota_set id="fake_tenant">
+ <cores>20</cores>
+ <fixed_ips>-1</fixed_ips>
+ <floating_ips>10</floating_ips>
+ <injected_file_content_bytes>10240</injected_file_content_bytes>
+ <injected_file_path_bytes>255</injected_file_path_bytes>
+ <injected_files>5</injected_files>
+ <instances>10</instances>
+ <key_pairs>100</key_pairs>
+ <metadata_items>128</metadata_items>
+ <ram>51200</ram>
+ <security_group_rules>20</security_group_rules>
+ <security_groups>10</security_groups>
+</quota_set> \ No newline at end of file
diff --git a/doc/v3/api_samples/os-quota-sets/user-quotas-update-post-req.json b/doc/v3/api_samples/os-quota-sets/user-quotas-update-post-req.json
new file mode 100644
index 0000000000..cbd6f18af1
--- /dev/null
+++ b/doc/v3/api_samples/os-quota-sets/user-quotas-update-post-req.json
@@ -0,0 +1,6 @@
+{
+ "quota_set": {
+ "force": "True",
+ "instances": 9
+ }
+} \ No newline at end of file
diff --git a/doc/v3/api_samples/os-quota-sets/user-quotas-update-post-req.xml b/doc/v3/api_samples/os-quota-sets/user-quotas-update-post-req.xml
new file mode 100644
index 0000000000..7e31621775
--- /dev/null
+++ b/doc/v3/api_samples/os-quota-sets/user-quotas-update-post-req.xml
@@ -0,0 +1,5 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<quota_set>
+ <force>True</force>
+ <instances>9</instances>
+</quota_set> \ No newline at end of file
diff --git a/doc/v3/api_samples/os-quota-sets/user-quotas-update-post-resp.json b/doc/v3/api_samples/os-quota-sets/user-quotas-update-post-resp.json
new file mode 100644
index 0000000000..4a3fb5dd58
--- /dev/null
+++ b/doc/v3/api_samples/os-quota-sets/user-quotas-update-post-resp.json
@@ -0,0 +1,17 @@
+{
+ "quota_set": {
+ "cores": 20,
+ "fixed_ips": -1,
+ "floating_ips": 10,
+ "id": "fake_tenant",
+ "injected_file_content_bytes": 10240,
+ "injected_file_path_bytes": 255,
+ "injected_files": 5,
+ "instances": 9,
+ "key_pairs": 100,
+ "metadata_items": 128,
+ "ram": 51200,
+ "security_group_rules": 20,
+ "security_groups": 10
+ }
+} \ No newline at end of file
diff --git a/doc/v3/api_samples/os-quota-sets/user-quotas-update-post-resp.xml b/doc/v3/api_samples/os-quota-sets/user-quotas-update-post-resp.xml
new file mode 100644
index 0000000000..dac4762123
--- /dev/null
+++ b/doc/v3/api_samples/os-quota-sets/user-quotas-update-post-resp.xml
@@ -0,0 +1,15 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<quota_set id="fake_tenant">
+ <cores>20</cores>
+ <fixed_ips>-1</fixed_ips>
+ <floating_ips>10</floating_ips>
+ <injected_file_content_bytes>10240</injected_file_content_bytes>
+ <injected_file_path_bytes>255</injected_file_path_bytes>
+ <injected_files>5</injected_files>
+ <instances>9</instances>
+ <key_pairs>100</key_pairs>
+ <metadata_items>128</metadata_items>
+ <ram>51200</ram>
+ <security_group_rules>20</security_group_rules>
+ <security_groups>10</security_groups>
+</quota_set> \ No newline at end of file
diff --git a/nova/tests/integrated/v3/api_samples/os-instance-usage-audit-log/inst-usage-audit-log-index-get-resp.json.tpl b/nova/tests/integrated/v3/api_samples/os-instance-usage-audit-log/inst-usage-audit-log-index-get-resp.json.tpl
new file mode 100644
index 0000000000..eda9523047
--- /dev/null
+++ b/nova/tests/integrated/v3/api_samples/os-instance-usage-audit-log/inst-usage-audit-log-index-get-resp.json.tpl
@@ -0,0 +1,17 @@
+{
+ "instance_usage_audit_log": {
+ "hosts_not_run": [
+ "%(hostid)s"
+ ],
+ "log": {},
+ "num_hosts": 1,
+ "num_hosts_done": 0,
+ "num_hosts_not_run": 1,
+ "num_hosts_running": 0,
+ "overall_status": "0 of 1 hosts done. 0 errors.",
+ "period_beginning": "%(timestamp)s",
+ "period_ending": "%(timestamp)s",
+ "total_errors": 0,
+ "total_instances": 0
+ }
+}
diff --git a/nova/tests/integrated/v3/api_samples/os-instance-usage-audit-log/inst-usage-audit-log-index-get-resp.xml.tpl b/nova/tests/integrated/v3/api_samples/os-instance-usage-audit-log/inst-usage-audit-log-index-get-resp.xml.tpl
new file mode 100644
index 0000000000..1ef243292a
--- /dev/null
+++ b/nova/tests/integrated/v3/api_samples/os-instance-usage-audit-log/inst-usage-audit-log-index-get-resp.xml.tpl
@@ -0,0 +1,16 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<instance_usage_audit_log>
+ <total_errors>0</total_errors>
+ <total_instances>0</total_instances>
+ <log/>
+ <num_hosts_running>0</num_hosts_running>
+ <num_hosts_done>0</num_hosts_done>
+ <num_hosts_not_run>1</num_hosts_not_run>
+ <hosts_not_run>
+ <item>%(hostid)s</item>
+ </hosts_not_run>
+ <overall_status>0 of 1 hosts done. 0 errors.</overall_status>
+ <period_ending>%(timestamp)s</period_ending>
+ <period_beginning>%(timestamp)s</period_beginning>
+ <num_hosts>1</num_hosts>
+</instance_usage_audit_log>
diff --git a/nova/tests/integrated/v3/api_samples/os-instance-usage-audit-log/inst-usage-audit-log-index-with-before-get-resp.json.tpl b/nova/tests/integrated/v3/api_samples/os-instance-usage-audit-log/inst-usage-audit-log-index-with-before-get-resp.json.tpl
new file mode 100644
index 0000000000..eda9523047
--- /dev/null
+++ b/nova/tests/integrated/v3/api_samples/os-instance-usage-audit-log/inst-usage-audit-log-index-with-before-get-resp.json.tpl
@@ -0,0 +1,17 @@
+{
+ "instance_usage_audit_log": {
+ "hosts_not_run": [
+ "%(hostid)s"
+ ],
+ "log": {},
+ "num_hosts": 1,
+ "num_hosts_done": 0,
+ "num_hosts_not_run": 1,
+ "num_hosts_running": 0,
+ "overall_status": "0 of 1 hosts done. 0 errors.",
+ "period_beginning": "%(timestamp)s",
+ "period_ending": "%(timestamp)s",
+ "total_errors": 0,
+ "total_instances": 0
+ }
+}
diff --git a/nova/tests/integrated/v3/api_samples/os-instance-usage-audit-log/inst-usage-audit-log-index-with-before-get-resp.xml.tpl b/nova/tests/integrated/v3/api_samples/os-instance-usage-audit-log/inst-usage-audit-log-index-with-before-get-resp.xml.tpl
new file mode 100644
index 0000000000..1ef243292a
--- /dev/null
+++ b/nova/tests/integrated/v3/api_samples/os-instance-usage-audit-log/inst-usage-audit-log-index-with-before-get-resp.xml.tpl
@@ -0,0 +1,16 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<instance_usage_audit_log>
+ <total_errors>0</total_errors>
+ <total_instances>0</total_instances>
+ <log/>
+ <num_hosts_running>0</num_hosts_running>
+ <num_hosts_done>0</num_hosts_done>
+ <num_hosts_not_run>1</num_hosts_not_run>
+ <hosts_not_run>
+ <item>%(hostid)s</item>
+ </hosts_not_run>
+ <overall_status>0 of 1 hosts done. 0 errors.</overall_status>
+ <period_ending>%(timestamp)s</period_ending>
+ <period_beginning>%(timestamp)s</period_beginning>
+ <num_hosts>1</num_hosts>
+</instance_usage_audit_log>
diff --git a/nova/tests/integrated/v3/api_samples/os-quota-class-sets/quota-classes-show-get-resp.json.tpl b/nova/tests/integrated/v3/api_samples/os-quota-class-sets/quota-classes-show-get-resp.json.tpl
new file mode 100644
index 0000000000..f9a94e760a
--- /dev/null
+++ b/nova/tests/integrated/v3/api_samples/os-quota-class-sets/quota-classes-show-get-resp.json.tpl
@@ -0,0 +1,17 @@
+{
+ "quota_class_set": {
+ "cores": 20,
+ "floating_ips": 10,
+ "fixed_ips": -1,
+ "id": "%(set_id)s",
+ "injected_file_content_bytes": 10240,
+ "injected_file_path_bytes": 255,
+ "injected_files": 5,
+ "instances": 10,
+ "key_pairs": 100,
+ "metadata_items": 128,
+ "ram": 51200,
+ "security_group_rules": 20,
+ "security_groups": 10
+ }
+}
diff --git a/nova/tests/integrated/v3/api_samples/os-quota-class-sets/quota-classes-show-get-resp.xml.tpl b/nova/tests/integrated/v3/api_samples/os-quota-class-sets/quota-classes-show-get-resp.xml.tpl
new file mode 100644
index 0000000000..fb8e7992a5
--- /dev/null
+++ b/nova/tests/integrated/v3/api_samples/os-quota-class-sets/quota-classes-show-get-resp.xml.tpl
@@ -0,0 +1,15 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<quota_class_set id="%(set_id)s">
+ <cores>20</cores>
+ <floating_ips>10</floating_ips>
+ <fixed_ips>-1</fixed_ips>
+ <injected_file_content_bytes>10240</injected_file_content_bytes>
+ <injected_file_path_bytes>255</injected_file_path_bytes>
+ <injected_files>5</injected_files>
+ <instances>10</instances>
+ <key_pairs>100</key_pairs>
+ <metadata_items>128</metadata_items>
+ <ram>51200</ram>
+ <security_group_rules>20</security_group_rules>
+ <security_groups>10</security_groups>
+</quota_class_set>
diff --git a/nova/tests/integrated/v3/api_samples/os-quota-class-sets/quota-classes-update-post-req.json.tpl b/nova/tests/integrated/v3/api_samples/os-quota-class-sets/quota-classes-update-post-req.json.tpl
new file mode 100644
index 0000000000..483fda8c53
--- /dev/null
+++ b/nova/tests/integrated/v3/api_samples/os-quota-class-sets/quota-classes-update-post-req.json.tpl
@@ -0,0 +1,16 @@
+{
+ "quota_class_set": {
+ "instances": 50,
+ "cores": 50,
+ "ram": 51200,
+ "floating_ips": 10,
+ "fixed_ips": -1,
+ "metadata_items": 128,
+ "injected_files": 5,
+ "injected_file_content_bytes": 10240,
+ "injected_file_path_bytes": 255,
+ "security_groups": 10,
+ "security_group_rules": 20,
+ "key_pairs": 100
+ }
+}
diff --git a/nova/tests/integrated/v3/api_samples/os-quota-class-sets/quota-classes-update-post-req.xml.tpl b/nova/tests/integrated/v3/api_samples/os-quota-class-sets/quota-classes-update-post-req.xml.tpl
new file mode 100644
index 0000000000..150fb6a42a
--- /dev/null
+++ b/nova/tests/integrated/v3/api_samples/os-quota-class-sets/quota-classes-update-post-req.xml.tpl
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<quota_class_set>
+ <cores>50</cores>
+ <floating_ips>10</floating_ips>
+ <fixed_ips>-1</fixed_ips>
+ <injected_file_content_bytes>10240</injected_file_content_bytes>
+ <injected_file_path_bytes>255</injected_file_path_bytes>
+ <injected_files>5</injected_files>
+ <instances>50</instances>
+ <key_pairs>100</key_pairs>
+ <metadata_items>128</metadata_items>
+ <ram>51200</ram>
+ <security_group_rules>20</security_group_rules>
+ <security_groups>10</security_groups>
+</quota_class_set>
diff --git a/nova/tests/integrated/v3/api_samples/os-quota-class-sets/quota-classes-update-post-resp.json.tpl b/nova/tests/integrated/v3/api_samples/os-quota-class-sets/quota-classes-update-post-resp.json.tpl
new file mode 100644
index 0000000000..a23f7794b8
--- /dev/null
+++ b/nova/tests/integrated/v3/api_samples/os-quota-class-sets/quota-classes-update-post-resp.json.tpl
@@ -0,0 +1,17 @@
+{
+ "quota_class_set": {
+ "cores": 50,
+ "floating_ips": 10,
+ "fixed_ips": -1,
+ "injected_file_content_bytes": 10240,
+ "injected_file_path_bytes": 255,
+ "injected_files": 5,
+ "instances": 50,
+ "key_pairs": 100,
+ "metadata_items": 128,
+ "ram": 51200,
+ "security_group_rules": 20,
+ "security_groups": 10,
+ "id": "test_class"
+ }
+}
diff --git a/nova/tests/integrated/v3/api_samples/os-quota-class-sets/quota-classes-update-post-resp.xml.tpl b/nova/tests/integrated/v3/api_samples/os-quota-class-sets/quota-classes-update-post-resp.xml.tpl
new file mode 100644
index 0000000000..6bb5911a85
--- /dev/null
+++ b/nova/tests/integrated/v3/api_samples/os-quota-class-sets/quota-classes-update-post-resp.xml.tpl
@@ -0,0 +1,15 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<quota_class_set id="test_class">
+ <cores>50</cores>
+ <floating_ips>10</floating_ips>
+ <fixed_ips>-1</fixed_ips>
+ <injected_file_content_bytes>10240</injected_file_content_bytes>
+ <injected_file_path_bytes>255</injected_file_path_bytes>
+ <injected_files>5</injected_files>
+ <instances>50</instances>
+ <key_pairs>100</key_pairs>
+ <metadata_items>128</metadata_items>
+ <ram>51200</ram>
+ <security_group_rules>20</security_group_rules>
+ <security_groups>10</security_groups>
+</quota_class_set>
diff --git a/nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-show-defaults-get-resp.json.tpl b/nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-show-defaults-get-resp.json.tpl
new file mode 100644
index 0000000000..2f0fd98572
--- /dev/null
+++ b/nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-show-defaults-get-resp.json.tpl
@@ -0,0 +1,17 @@
+{
+ "quota_set": {
+ "cores": 20,
+ "floating_ips": 10,
+ "fixed_ips": -1,
+ "id": "fake_tenant",
+ "injected_file_content_bytes": 10240,
+ "injected_file_path_bytes": 255,
+ "injected_files": 5,
+ "instances": 10,
+ "key_pairs": 100,
+ "metadata_items": 128,
+ "ram": 51200,
+ "security_group_rules": 20,
+ "security_groups": 10
+ }
+}
diff --git a/nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-show-defaults-get-resp.xml.tpl b/nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-show-defaults-get-resp.xml.tpl
new file mode 100644
index 0000000000..f56987563c
--- /dev/null
+++ b/nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-show-defaults-get-resp.xml.tpl
@@ -0,0 +1,15 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<quota_set id="fake_tenant">
+ <cores>20</cores>
+ <floating_ips>10</floating_ips>
+ <fixed_ips>-1</fixed_ips>
+ <injected_file_content_bytes>10240</injected_file_content_bytes>
+ <injected_file_path_bytes>255</injected_file_path_bytes>
+ <injected_files>5</injected_files>
+ <instances>10</instances>
+ <key_pairs>100</key_pairs>
+ <metadata_items>128</metadata_items>
+ <ram>51200</ram>
+ <security_group_rules>20</security_group_rules>
+ <security_groups>10</security_groups>
+</quota_set>
diff --git a/nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-show-get-resp.json.tpl b/nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-show-get-resp.json.tpl
new file mode 100644
index 0000000000..2f0fd98572
--- /dev/null
+++ b/nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-show-get-resp.json.tpl
@@ -0,0 +1,17 @@
+{
+ "quota_set": {
+ "cores": 20,
+ "floating_ips": 10,
+ "fixed_ips": -1,
+ "id": "fake_tenant",
+ "injected_file_content_bytes": 10240,
+ "injected_file_path_bytes": 255,
+ "injected_files": 5,
+ "instances": 10,
+ "key_pairs": 100,
+ "metadata_items": 128,
+ "ram": 51200,
+ "security_group_rules": 20,
+ "security_groups": 10
+ }
+}
diff --git a/nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-show-get-resp.xml.tpl b/nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-show-get-resp.xml.tpl
new file mode 100644
index 0000000000..f56987563c
--- /dev/null
+++ b/nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-show-get-resp.xml.tpl
@@ -0,0 +1,15 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<quota_set id="fake_tenant">
+ <cores>20</cores>
+ <floating_ips>10</floating_ips>
+ <fixed_ips>-1</fixed_ips>
+ <injected_file_content_bytes>10240</injected_file_content_bytes>
+ <injected_file_path_bytes>255</injected_file_path_bytes>
+ <injected_files>5</injected_files>
+ <instances>10</instances>
+ <key_pairs>100</key_pairs>
+ <metadata_items>128</metadata_items>
+ <ram>51200</ram>
+ <security_group_rules>20</security_group_rules>
+ <security_groups>10</security_groups>
+</quota_set>
diff --git a/nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-update-force-post-req.json.tpl b/nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-update-force-post-req.json.tpl
new file mode 100644
index 0000000000..a58a179123
--- /dev/null
+++ b/nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-update-force-post-req.json.tpl
@@ -0,0 +1,6 @@
+{
+ "quota_set": {
+ "force": "True",
+ "instances": 45
+ }
+}
diff --git a/nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-update-force-post-req.xml.tpl b/nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-update-force-post-req.xml.tpl
new file mode 100644
index 0000000000..7e5d4f320a
--- /dev/null
+++ b/nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-update-force-post-req.xml.tpl
@@ -0,0 +1,5 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<quota_set>
+ <force>True</force>
+ <instances>45</instances>
+</quota_set> \ No newline at end of file
diff --git a/nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-update-force-post-resp.json.tpl b/nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-update-force-post-resp.json.tpl
new file mode 100644
index 0000000000..8f98181fd7
--- /dev/null
+++ b/nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-update-force-post-resp.json.tpl
@@ -0,0 +1,17 @@
+{
+ "quota_set": {
+ "cores": 20,
+ "fixed_ips": -1,
+ "floating_ips": 10,
+ "id": "fake_tenant",
+ "injected_file_content_bytes": 10240,
+ "injected_file_path_bytes": 255,
+ "injected_files": 5,
+ "instances": 45,
+ "key_pairs": 100,
+ "metadata_items": 128,
+ "ram": 51200,
+ "security_group_rules": 20,
+ "security_groups": 10
+ }
+} \ No newline at end of file
diff --git a/nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-update-force-post-resp.xml.tpl b/nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-update-force-post-resp.xml.tpl
new file mode 100644
index 0000000000..8d88180183
--- /dev/null
+++ b/nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-update-force-post-resp.xml.tpl
@@ -0,0 +1,15 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<quota_set id="fake_tenant">
+ <cores>20</cores>
+ <fixed_ips>-1</fixed_ips>
+ <floating_ips>10</floating_ips>
+ <injected_file_content_bytes>10240</injected_file_content_bytes>
+ <injected_file_path_bytes>255</injected_file_path_bytes>
+ <injected_files>5</injected_files>
+ <instances>45</instances>
+ <key_pairs>100</key_pairs>
+ <metadata_items>128</metadata_items>
+ <ram>51200</ram>
+ <security_group_rules>20</security_group_rules>
+ <security_groups>10</security_groups>
+</quota_set> \ No newline at end of file
diff --git a/nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-update-force-resp.json.tpl b/nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-update-force-resp.json.tpl
new file mode 100644
index 0000000000..5570e8bfa9
--- /dev/null
+++ b/nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-update-force-resp.json.tpl
@@ -0,0 +1,17 @@
+{
+ "quota_set": {
+ "cores": 20,
+ "floating_ips": 10,
+ "fixed_ips": -1,
+ "injected_file_content_bytes": 10240,
+ "injected_file_path_bytes": 255,
+ "injected_files": 5,
+ "instances": 45,
+ "key_pairs": 100,
+ "metadata_items": 128,
+ "ram": 51200,
+ "security_group_rules": 20,
+ "security_groups": 10,
+ "id": "fake_tenant"
+ }
+}
diff --git a/nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-update-force-resp.xml.tpl b/nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-update-force-resp.xml.tpl
new file mode 100644
index 0000000000..0fb8affaef
--- /dev/null
+++ b/nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-update-force-resp.xml.tpl
@@ -0,0 +1,15 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<quota_set id="fake_tenant">
+ <cores>20</cores>
+ <floating_ips>10</floating_ips>
+ <fixed_ips>-1</fixed_ips>
+ <injected_file_content_bytes>10240</injected_file_content_bytes>
+ <injected_file_path_bytes>255</injected_file_path_bytes>
+ <injected_files>5</injected_files>
+ <instances>45</instances>
+ <key_pairs>100</key_pairs>
+ <metadata_items>128</metadata_items>
+ <ram>51200</ram>
+ <security_group_rules>20</security_group_rules>
+ <security_groups>10</security_groups>
+</quota_set>
diff --git a/nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-update-post-req.json.tpl b/nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-update-post-req.json.tpl
new file mode 100644
index 0000000000..1f12caa045
--- /dev/null
+++ b/nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-update-post-req.json.tpl
@@ -0,0 +1,5 @@
+{
+ "quota_set": {
+ "security_groups": 45
+ }
+}
diff --git a/nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-update-post-req.xml.tpl b/nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-update-post-req.xml.tpl
new file mode 100644
index 0000000000..cc9459be78
--- /dev/null
+++ b/nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-update-post-req.xml.tpl
@@ -0,0 +1,4 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<quota_set>
+ <security_groups>45</security_groups>
+</quota_set>
diff --git a/nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-update-post-resp.json.tpl b/nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-update-post-resp.json.tpl
new file mode 100644
index 0000000000..a75450cf96
--- /dev/null
+++ b/nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-update-post-resp.json.tpl
@@ -0,0 +1,17 @@
+{
+ "quota_set": {
+ "cores": 20,
+ "floating_ips": 10,
+ "fixed_ips": -1,
+ "injected_file_content_bytes": 10240,
+ "injected_file_path_bytes": 255,
+ "injected_files": 5,
+ "instances": 10,
+ "key_pairs": 100,
+ "metadata_items": 128,
+ "ram": 51200,
+ "security_group_rules": 20,
+ "security_groups": 45,
+ "id": "fake_tenant"
+ }
+}
diff --git a/nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-update-post-resp.xml.tpl b/nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-update-post-resp.xml.tpl
new file mode 100644
index 0000000000..6c925b2125
--- /dev/null
+++ b/nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-update-post-resp.xml.tpl
@@ -0,0 +1,15 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<quota_set id="fake_tenant">
+ <cores>20</cores>
+ <floating_ips>10</floating_ips>
+ <fixed_ips>-1</fixed_ips>
+ <injected_file_content_bytes>10240</injected_file_content_bytes>
+ <injected_file_path_bytes>255</injected_file_path_bytes>
+ <injected_files>5</injected_files>
+ <instances>10</instances>
+ <key_pairs>100</key_pairs>
+ <metadata_items>128</metadata_items>
+ <ram>51200</ram>
+ <security_group_rules>20</security_group_rules>
+ <security_groups>45</security_groups>
+</quota_set>
diff --git a/nova/tests/integrated/v3/api_samples/os-quota-sets/user-quotas-show-get-resp.json.tpl b/nova/tests/integrated/v3/api_samples/os-quota-sets/user-quotas-show-get-resp.json.tpl
new file mode 100644
index 0000000000..2f0fd98572
--- /dev/null
+++ b/nova/tests/integrated/v3/api_samples/os-quota-sets/user-quotas-show-get-resp.json.tpl
@@ -0,0 +1,17 @@
+{
+ "quota_set": {
+ "cores": 20,
+ "floating_ips": 10,
+ "fixed_ips": -1,
+ "id": "fake_tenant",
+ "injected_file_content_bytes": 10240,
+ "injected_file_path_bytes": 255,
+ "injected_files": 5,
+ "instances": 10,
+ "key_pairs": 100,
+ "metadata_items": 128,
+ "ram": 51200,
+ "security_group_rules": 20,
+ "security_groups": 10
+ }
+}
diff --git a/nova/tests/integrated/v3/api_samples/os-quota-sets/user-quotas-show-get-resp.xml.tpl b/nova/tests/integrated/v3/api_samples/os-quota-sets/user-quotas-show-get-resp.xml.tpl
new file mode 100644
index 0000000000..f56987563c
--- /dev/null
+++ b/nova/tests/integrated/v3/api_samples/os-quota-sets/user-quotas-show-get-resp.xml.tpl
@@ -0,0 +1,15 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<quota_set id="fake_tenant">
+ <cores>20</cores>
+ <floating_ips>10</floating_ips>
+ <fixed_ips>-1</fixed_ips>
+ <injected_file_content_bytes>10240</injected_file_content_bytes>
+ <injected_file_path_bytes>255</injected_file_path_bytes>
+ <injected_files>5</injected_files>
+ <instances>10</instances>
+ <key_pairs>100</key_pairs>
+ <metadata_items>128</metadata_items>
+ <ram>51200</ram>
+ <security_group_rules>20</security_group_rules>
+ <security_groups>10</security_groups>
+</quota_set>
diff --git a/nova/tests/integrated/v3/api_samples/os-quota-sets/user-quotas-update-post-req.json.tpl b/nova/tests/integrated/v3/api_samples/os-quota-sets/user-quotas-update-post-req.json.tpl
new file mode 100644
index 0000000000..b322b2a870
--- /dev/null
+++ b/nova/tests/integrated/v3/api_samples/os-quota-sets/user-quotas-update-post-req.json.tpl
@@ -0,0 +1,6 @@
+{
+ "quota_set": {
+ "force": "True",
+ "instances": 9
+ }
+}
diff --git a/nova/tests/integrated/v3/api_samples/os-quota-sets/user-quotas-update-post-req.xml.tpl b/nova/tests/integrated/v3/api_samples/os-quota-sets/user-quotas-update-post-req.xml.tpl
new file mode 100644
index 0000000000..3f6481a149
--- /dev/null
+++ b/nova/tests/integrated/v3/api_samples/os-quota-sets/user-quotas-update-post-req.xml.tpl
@@ -0,0 +1,5 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<quota_set>
+ <force>True</force>
+ <instances>9</instances>
+</quota_set>
diff --git a/nova/tests/integrated/v3/api_samples/os-quota-sets/user-quotas-update-post-resp.json.tpl b/nova/tests/integrated/v3/api_samples/os-quota-sets/user-quotas-update-post-resp.json.tpl
new file mode 100644
index 0000000000..10f8111bd3
--- /dev/null
+++ b/nova/tests/integrated/v3/api_samples/os-quota-sets/user-quotas-update-post-resp.json.tpl
@@ -0,0 +1,17 @@
+{
+ "quota_set": {
+ "cores": 20,
+ "floating_ips": 10,
+ "fixed_ips": -1,
+ "injected_file_content_bytes": 10240,
+ "injected_file_path_bytes": 255,
+ "injected_files": 5,
+ "instances": 9,
+ "key_pairs": 100,
+ "metadata_items": 128,
+ "ram": 51200,
+ "security_group_rules": 20,
+ "security_groups": 10,
+ "id": "fake_tenant"
+ }
+}
diff --git a/nova/tests/integrated/v3/api_samples/os-quota-sets/user-quotas-update-post-resp.xml.tpl b/nova/tests/integrated/v3/api_samples/os-quota-sets/user-quotas-update-post-resp.xml.tpl
new file mode 100644
index 0000000000..3824249957
--- /dev/null
+++ b/nova/tests/integrated/v3/api_samples/os-quota-sets/user-quotas-update-post-resp.xml.tpl
@@ -0,0 +1,15 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<quota_set id="fake_tenant">
+ <cores>20</cores>
+ <floating_ips>10</floating_ips>
+ <fixed_ips>-1</fixed_ips>
+ <injected_file_content_bytes>10240</injected_file_content_bytes>
+ <injected_file_path_bytes>255</injected_file_path_bytes>
+ <injected_files>5</injected_files>
+ <instances>9</instances>
+ <key_pairs>100</key_pairs>
+ <metadata_items>128</metadata_items>
+ <ram>51200</ram>
+ <security_group_rules>20</security_group_rules>
+ <security_groups>10</security_groups>
+</quota_set>
diff --git a/nova/tests/integrated/v3/test_instance_usage_audit_log.py b/nova/tests/integrated/v3/test_instance_usage_audit_log.py
new file mode 100644
index 0000000000..35043159a7
--- /dev/null
+++ b/nova/tests/integrated/v3/test_instance_usage_audit_log.py
@@ -0,0 +1,43 @@
+# 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 urllib
+
+from nova.tests.integrated.v3 import api_sample_base
+
+
+class InstanceUsageAuditLogJsonTest(api_sample_base.ApiSampleTestBaseV3):
+ extension_name = "os-instance-usage-audit-log"
+
+ def test_index_instance_usage_audit_log(self):
+ response = self._do_get('os-instance-usage-audit-log')
+ subs = self._get_regexes()
+ subs['hostid'] = '[a-f0-9]+'
+ self._verify_response('inst-usage-audit-log-index-get-resp',
+ subs, response, 200)
+
+ def test_index_instance_usage_audit_log_with_before(self):
+ response = self._do_get('os-instance-usage-audit-log?before=%s' %
+ urllib.quote('2012-07-05 10:00:00'))
+ subs = self._get_regexes()
+ subs['hostid'] = '[a-f0-9]+'
+ self._verify_response(
+ 'inst-usage-audit-log-index-with-before-get-resp',
+ subs, response, 200)
+
+
+class InstanceUsageAuditLogXmlTest(InstanceUsageAuditLogJsonTest):
+ ctype = "xml"
diff --git a/nova/tests/integrated/v3/test_quota_class_sets.py b/nova/tests/integrated/v3/test_quota_class_sets.py
new file mode 100644
index 0000000000..d0f0f50f65
--- /dev/null
+++ b/nova/tests/integrated/v3/test_quota_class_sets.py
@@ -0,0 +1,41 @@
+# 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 QuotaClassesSampleJsonTests(api_sample_base.ApiSampleTestBaseV3):
+ extension_name = "os-quota-class-sets"
+ set_id = 'test_class'
+
+ def test_show_quota_classes(self):
+ # Get api sample to show quota classes.
+ response = self._do_get('os-quota-class-sets/%s' % self.set_id)
+ subs = {'set_id': self.set_id}
+ self._verify_response('quota-classes-show-get-resp', subs,
+ response, 200)
+
+ def test_update_quota_classes(self):
+ # Get api sample to update quota classes.
+ response = self._do_put('os-quota-class-sets/%s' % self.set_id,
+ 'quota-classes-update-post-req',
+ {})
+ self._verify_response('quota-classes-update-post-resp',
+ {}, response, 200)
+
+
+class QuotaClassesSampleXmlTests(QuotaClassesSampleJsonTests):
+ ctype = "xml"
diff --git a/nova/tests/integrated/v3/test_quota_sets.py b/nova/tests/integrated/v3/test_quota_sets.py
new file mode 100644
index 0000000000..bf74b705e1
--- /dev/null
+++ b/nova/tests/integrated/v3/test_quota_sets.py
@@ -0,0 +1,75 @@
+# 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 QuotaSetsSampleJsonTests(api_sample_base.ApiSampleTestBaseV3):
+ extension_name = "os-quota-sets"
+
+ def test_show_quotas(self):
+ # Get api sample to show quotas.
+ response = self._do_get('os-quota-sets/fake_tenant')
+ self._verify_response('quotas-show-get-resp', {}, response, 200)
+
+ def test_show_quotas_defaults(self):
+ # Get api sample to show quotas defaults.
+ response = self._do_get('os-quota-sets/fake_tenant/defaults')
+ self._verify_response('quotas-show-defaults-get-resp',
+ {}, response, 200)
+
+ def test_update_quotas(self):
+ # Get api sample to update quotas.
+ response = self._do_put('os-quota-sets/fake_tenant',
+ 'quotas-update-post-req',
+ {})
+ self._verify_response('quotas-update-post-resp', {}, response, 200)
+
+ def test_delete_quotas(self):
+ # Get api sample to delete quota.
+ response = self._do_delete('os-quota-sets/fake_tenant')
+ self.assertEqual(response.status, 204)
+ self.assertEqual(response.read(), '')
+
+ def test_update_quotas_force(self):
+ # Get api sample to update quotas.
+ response = self._do_put('os-quota-sets/fake_tenant',
+ 'quotas-update-force-post-req',
+ {})
+ return self._verify_response('quotas-update-force-post-resp', {},
+ response, 200)
+
+ def test_show_quotas_for_user(self):
+ # Get api sample to show quotas for user.
+ response = self._do_get('os-quota-sets/fake_tenant?user_id=1')
+ self._verify_response('user-quotas-show-get-resp', {}, response, 200)
+
+ def test_delete_quotas_for_user(self):
+ response = self._do_delete('os-quota-sets/fake_tenant?user_id=1')
+ self.assertEqual(response.status, 204)
+ self.assertEqual(response.read(), '')
+
+ def test_update_quotas_for_user(self):
+ # Get api sample to update quotas for user.
+ response = self._do_put('os-quota-sets/fake_tenant?user_id=1',
+ 'user-quotas-update-post-req',
+ {})
+ return self._verify_response('user-quotas-update-post-resp', {},
+ response, 200)
+
+
+class QuotaSetsSampleXmlTests(QuotaSetsSampleJsonTests):
+ ctype = "xml"