From a87c65d0eef6d1b0df0d1d970e7e52866bf4dfc0 Mon Sep 17 00:00:00 2001 From: He Jie Xu Date: Tue, 3 Sep 2013 16:22:56 +0800 Subject: [PATCH] Add V3 API samples for quota-sets/class-sets,inst-usage-audit-log Partially implements blueprint v3-api-unittests Change-Id: I6c21e5dffc5669bb6ab2bba091b97725cc19fd69 --- .../inst-usage-audit-log-index-get-resp.json | 17 +++++ .../inst-usage-audit-log-index-get-resp.xml | 16 ++++ ...-audit-log-index-with-before-get-resp.json | 17 +++++ ...e-audit-log-index-with-before-get-resp.xml | 16 ++++ .../quota-classes-show-get-resp.json | 17 +++++ .../quota-classes-show-get-resp.xml | 15 ++++ .../quota-classes-update-post-req.json | 16 ++++ .../quota-classes-update-post-req.xml | 15 ++++ .../quota-classes-update-post-resp.json | 17 +++++ .../quota-classes-update-post-resp.xml | 15 ++++ .../quotas-show-defaults-get-resp.json | 17 +++++ .../quotas-show-defaults-get-resp.xml | 15 ++++ .../os-quota-sets/quotas-show-get-resp.json | 17 +++++ .../os-quota-sets/quotas-show-get-resp.xml | 15 ++++ .../quotas-update-force-post-req.json | 6 ++ .../quotas-update-force-post-req.xml | 5 ++ .../quotas-update-force-post-resp.json | 17 +++++ .../quotas-update-force-post-resp.xml | 15 ++++ .../os-quota-sets/quotas-update-post-req.json | 5 ++ .../os-quota-sets/quotas-update-post-req.xml | 4 + .../quotas-update-post-resp.json | 17 +++++ .../os-quota-sets/quotas-update-post-resp.xml | 15 ++++ .../user-quotas-show-get-resp.json | 17 +++++ .../user-quotas-show-get-resp.xml | 15 ++++ .../user-quotas-update-post-req.json | 6 ++ .../user-quotas-update-post-req.xml | 5 ++ .../user-quotas-update-post-resp.json | 17 +++++ .../user-quotas-update-post-resp.xml | 15 ++++ ...st-usage-audit-log-index-get-resp.json.tpl | 17 +++++ ...nst-usage-audit-log-index-get-resp.xml.tpl | 16 ++++ ...it-log-index-with-before-get-resp.json.tpl | 17 +++++ ...dit-log-index-with-before-get-resp.xml.tpl | 16 ++++ .../quota-classes-show-get-resp.json.tpl | 17 +++++ .../quota-classes-show-get-resp.xml.tpl | 15 ++++ .../quota-classes-update-post-req.json.tpl | 16 ++++ .../quota-classes-update-post-req.xml.tpl | 15 ++++ .../quota-classes-update-post-resp.json.tpl | 17 +++++ .../quota-classes-update-post-resp.xml.tpl | 15 ++++ .../quotas-show-defaults-get-resp.json.tpl | 17 +++++ .../quotas-show-defaults-get-resp.xml.tpl | 15 ++++ .../quotas-show-get-resp.json.tpl | 17 +++++ .../quotas-show-get-resp.xml.tpl | 15 ++++ .../quotas-update-force-post-req.json.tpl | 6 ++ .../quotas-update-force-post-req.xml.tpl | 5 ++ .../quotas-update-force-post-resp.json.tpl | 17 +++++ .../quotas-update-force-post-resp.xml.tpl | 15 ++++ .../quotas-update-force-resp.json.tpl | 17 +++++ .../quotas-update-force-resp.xml.tpl | 15 ++++ .../quotas-update-post-req.json.tpl | 5 ++ .../quotas-update-post-req.xml.tpl | 4 + .../quotas-update-post-resp.json.tpl | 17 +++++ .../quotas-update-post-resp.xml.tpl | 15 ++++ .../user-quotas-show-get-resp.json.tpl | 17 +++++ .../user-quotas-show-get-resp.xml.tpl | 15 ++++ .../user-quotas-update-post-req.json.tpl | 6 ++ .../user-quotas-update-post-req.xml.tpl | 5 ++ .../user-quotas-update-post-resp.json.tpl | 17 +++++ .../user-quotas-update-post-resp.xml.tpl | 15 ++++ .../v3/test_instance_usage_audit_log.py | 43 +++++++++++ .../integrated/v3/test_quota_class_sets.py | 41 ++++++++++ nova/tests/integrated/v3/test_quota_sets.py | 75 +++++++++++++++++++ 61 files changed, 959 insertions(+) create mode 100644 doc/v3/api_samples/os-instance-usage-audit-log/inst-usage-audit-log-index-get-resp.json create mode 100644 doc/v3/api_samples/os-instance-usage-audit-log/inst-usage-audit-log-index-get-resp.xml create mode 100644 doc/v3/api_samples/os-instance-usage-audit-log/inst-usage-audit-log-index-with-before-get-resp.json create mode 100644 doc/v3/api_samples/os-instance-usage-audit-log/inst-usage-audit-log-index-with-before-get-resp.xml create mode 100644 doc/v3/api_samples/os-quota-class-sets/quota-classes-show-get-resp.json create mode 100644 doc/v3/api_samples/os-quota-class-sets/quota-classes-show-get-resp.xml create mode 100644 doc/v3/api_samples/os-quota-class-sets/quota-classes-update-post-req.json create mode 100644 doc/v3/api_samples/os-quota-class-sets/quota-classes-update-post-req.xml create mode 100644 doc/v3/api_samples/os-quota-class-sets/quota-classes-update-post-resp.json create mode 100644 doc/v3/api_samples/os-quota-class-sets/quota-classes-update-post-resp.xml create mode 100644 doc/v3/api_samples/os-quota-sets/quotas-show-defaults-get-resp.json create mode 100644 doc/v3/api_samples/os-quota-sets/quotas-show-defaults-get-resp.xml create mode 100644 doc/v3/api_samples/os-quota-sets/quotas-show-get-resp.json create mode 100644 doc/v3/api_samples/os-quota-sets/quotas-show-get-resp.xml create mode 100644 doc/v3/api_samples/os-quota-sets/quotas-update-force-post-req.json create mode 100644 doc/v3/api_samples/os-quota-sets/quotas-update-force-post-req.xml create mode 100644 doc/v3/api_samples/os-quota-sets/quotas-update-force-post-resp.json create mode 100644 doc/v3/api_samples/os-quota-sets/quotas-update-force-post-resp.xml create mode 100644 doc/v3/api_samples/os-quota-sets/quotas-update-post-req.json create mode 100644 doc/v3/api_samples/os-quota-sets/quotas-update-post-req.xml create mode 100644 doc/v3/api_samples/os-quota-sets/quotas-update-post-resp.json create mode 100644 doc/v3/api_samples/os-quota-sets/quotas-update-post-resp.xml create mode 100644 doc/v3/api_samples/os-quota-sets/user-quotas-show-get-resp.json create mode 100644 doc/v3/api_samples/os-quota-sets/user-quotas-show-get-resp.xml create mode 100644 doc/v3/api_samples/os-quota-sets/user-quotas-update-post-req.json create mode 100644 doc/v3/api_samples/os-quota-sets/user-quotas-update-post-req.xml create mode 100644 doc/v3/api_samples/os-quota-sets/user-quotas-update-post-resp.json create mode 100644 doc/v3/api_samples/os-quota-sets/user-quotas-update-post-resp.xml create mode 100644 nova/tests/integrated/v3/api_samples/os-instance-usage-audit-log/inst-usage-audit-log-index-get-resp.json.tpl create mode 100644 nova/tests/integrated/v3/api_samples/os-instance-usage-audit-log/inst-usage-audit-log-index-get-resp.xml.tpl create mode 100644 nova/tests/integrated/v3/api_samples/os-instance-usage-audit-log/inst-usage-audit-log-index-with-before-get-resp.json.tpl create mode 100644 nova/tests/integrated/v3/api_samples/os-instance-usage-audit-log/inst-usage-audit-log-index-with-before-get-resp.xml.tpl create mode 100644 nova/tests/integrated/v3/api_samples/os-quota-class-sets/quota-classes-show-get-resp.json.tpl create mode 100644 nova/tests/integrated/v3/api_samples/os-quota-class-sets/quota-classes-show-get-resp.xml.tpl create mode 100644 nova/tests/integrated/v3/api_samples/os-quota-class-sets/quota-classes-update-post-req.json.tpl create mode 100644 nova/tests/integrated/v3/api_samples/os-quota-class-sets/quota-classes-update-post-req.xml.tpl create mode 100644 nova/tests/integrated/v3/api_samples/os-quota-class-sets/quota-classes-update-post-resp.json.tpl create mode 100644 nova/tests/integrated/v3/api_samples/os-quota-class-sets/quota-classes-update-post-resp.xml.tpl create mode 100644 nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-show-defaults-get-resp.json.tpl create mode 100644 nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-show-defaults-get-resp.xml.tpl create mode 100644 nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-show-get-resp.json.tpl create mode 100644 nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-show-get-resp.xml.tpl create mode 100644 nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-update-force-post-req.json.tpl create mode 100644 nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-update-force-post-req.xml.tpl create mode 100644 nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-update-force-post-resp.json.tpl create mode 100644 nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-update-force-post-resp.xml.tpl create mode 100644 nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-update-force-resp.json.tpl create mode 100644 nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-update-force-resp.xml.tpl create mode 100644 nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-update-post-req.json.tpl create mode 100644 nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-update-post-req.xml.tpl create mode 100644 nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-update-post-resp.json.tpl create mode 100644 nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-update-post-resp.xml.tpl create mode 100644 nova/tests/integrated/v3/api_samples/os-quota-sets/user-quotas-show-get-resp.json.tpl create mode 100644 nova/tests/integrated/v3/api_samples/os-quota-sets/user-quotas-show-get-resp.xml.tpl create mode 100644 nova/tests/integrated/v3/api_samples/os-quota-sets/user-quotas-update-post-req.json.tpl create mode 100644 nova/tests/integrated/v3/api_samples/os-quota-sets/user-quotas-update-post-req.xml.tpl create mode 100644 nova/tests/integrated/v3/api_samples/os-quota-sets/user-quotas-update-post-resp.json.tpl create mode 100644 nova/tests/integrated/v3/api_samples/os-quota-sets/user-quotas-update-post-resp.xml.tpl create mode 100644 nova/tests/integrated/v3/test_instance_usage_audit_log.py create mode 100644 nova/tests/integrated/v3/test_quota_class_sets.py create mode 100644 nova/tests/integrated/v3/test_quota_sets.py 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 000000000000..e3fbc1aa66ed --- /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 000000000000..f0ff600bcffc --- /dev/null +++ b/doc/v3/api_samples/os-instance-usage-audit-log/inst-usage-audit-log-index-get-resp.xml @@ -0,0 +1,16 @@ + + + 0 + 0 + + 0 + 0 + 1 + + 68368b25d745464695a6352a855d8d2e + + 0 of 1 hosts done. 0 errors. + 2013-09-01 00:00:00 + 2013-08-01 00:00:00 + 1 + \ 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 000000000000..27dfafe198c2 --- /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 000000000000..2332988e42f4 --- /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 @@ + + + 0 + 0 + + 0 + 0 + 1 + + 744e1407f60c44ad832bd9f4ffe2122f + + 0 of 1 hosts done. 0 errors. + 2012-07-01 00:00:00 + 2012-06-01 00:00:00 + 1 + \ 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 000000000000..462425c8f0d5 --- /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 000000000000..d0570e9c8556 --- /dev/null +++ b/doc/v3/api_samples/os-quota-class-sets/quota-classes-show-get-resp.xml @@ -0,0 +1,15 @@ + + + 20 + -1 + 10 + 10240 + 255 + 5 + 10 + 100 + 128 + 51200 + 20 + 10 + \ 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 000000000000..4f6f840f1bc9 --- /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 000000000000..d55c98017221 --- /dev/null +++ b/doc/v3/api_samples/os-quota-class-sets/quota-classes-update-post-req.xml @@ -0,0 +1,15 @@ + + + 50 + 10 + -1 + 10240 + 255 + 5 + 50 + 100 + 128 + 51200 + 20 + 10 + \ 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 000000000000..41ebc43f4a9a --- /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 000000000000..045317f29cea --- /dev/null +++ b/doc/v3/api_samples/os-quota-class-sets/quota-classes-update-post-resp.xml @@ -0,0 +1,15 @@ + + + 50 + -1 + 10 + 10240 + 255 + 5 + 50 + 100 + 128 + 51200 + 20 + 10 + \ 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 000000000000..0f540754566c --- /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 000000000000..da9a2577e225 --- /dev/null +++ b/doc/v3/api_samples/os-quota-sets/quotas-show-defaults-get-resp.xml @@ -0,0 +1,15 @@ + + + 20 + -1 + 10 + 10240 + 255 + 5 + 10 + 100 + 128 + 51200 + 20 + 10 + \ 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 000000000000..0f540754566c --- /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 000000000000..da9a2577e225 --- /dev/null +++ b/doc/v3/api_samples/os-quota-sets/quotas-show-get-resp.xml @@ -0,0 +1,15 @@ + + + 20 + -1 + 10 + 10240 + 255 + 5 + 10 + 100 + 128 + 51200 + 20 + 10 + \ 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 000000000000..460d2ac1c7c4 --- /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 000000000000..7e5d4f320a40 --- /dev/null +++ b/doc/v3/api_samples/os-quota-sets/quotas-update-force-post-req.xml @@ -0,0 +1,5 @@ + + + True + 45 + \ 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 000000000000..8f98181fd79f --- /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 000000000000..8d881801830f --- /dev/null +++ b/doc/v3/api_samples/os-quota-sets/quotas-update-force-post-resp.xml @@ -0,0 +1,15 @@ + + + 20 + -1 + 10 + 10240 + 255 + 5 + 45 + 100 + 128 + 51200 + 20 + 10 + \ 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 000000000000..0b78cff3095f --- /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 000000000000..c46c75f95f3b --- /dev/null +++ b/doc/v3/api_samples/os-quota-sets/quotas-update-post-req.xml @@ -0,0 +1,4 @@ + + + 45 + \ 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 000000000000..ae2bda094154 --- /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 000000000000..a97431e00afd --- /dev/null +++ b/doc/v3/api_samples/os-quota-sets/quotas-update-post-resp.xml @@ -0,0 +1,15 @@ + + + 20 + -1 + 10 + 10240 + 255 + 5 + 10 + 100 + 128 + 51200 + 20 + 45 + \ 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 000000000000..0f540754566c --- /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 000000000000..da9a2577e225 --- /dev/null +++ b/doc/v3/api_samples/os-quota-sets/user-quotas-show-get-resp.xml @@ -0,0 +1,15 @@ + + + 20 + -1 + 10 + 10240 + 255 + 5 + 10 + 100 + 128 + 51200 + 20 + 10 + \ 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 000000000000..cbd6f18af1d7 --- /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 000000000000..7e31621775ad --- /dev/null +++ b/doc/v3/api_samples/os-quota-sets/user-quotas-update-post-req.xml @@ -0,0 +1,5 @@ + + + True + 9 + \ 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 000000000000..4a3fb5dd58d6 --- /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 000000000000..dac476212326 --- /dev/null +++ b/doc/v3/api_samples/os-quota-sets/user-quotas-update-post-resp.xml @@ -0,0 +1,15 @@ + + + 20 + -1 + 10 + 10240 + 255 + 5 + 9 + 100 + 128 + 51200 + 20 + 10 + \ 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 000000000000..eda952304702 --- /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 000000000000..1ef243292a4f --- /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 @@ + + + 0 + 0 + + 0 + 0 + 1 + + %(hostid)s + + 0 of 1 hosts done. 0 errors. + %(timestamp)s + %(timestamp)s + 1 + 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 000000000000..eda952304702 --- /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 000000000000..1ef243292a4f --- /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 @@ + + + 0 + 0 + + 0 + 0 + 1 + + %(hostid)s + + 0 of 1 hosts done. 0 errors. + %(timestamp)s + %(timestamp)s + 1 + 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 000000000000..f9a94e760af7 --- /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 000000000000..fb8e7992a510 --- /dev/null +++ b/nova/tests/integrated/v3/api_samples/os-quota-class-sets/quota-classes-show-get-resp.xml.tpl @@ -0,0 +1,15 @@ + + + 20 + 10 + -1 + 10240 + 255 + 5 + 10 + 100 + 128 + 51200 + 20 + 10 + 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 000000000000..483fda8c53e7 --- /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 000000000000..150fb6a42a7c --- /dev/null +++ b/nova/tests/integrated/v3/api_samples/os-quota-class-sets/quota-classes-update-post-req.xml.tpl @@ -0,0 +1,15 @@ + + + 50 + 10 + -1 + 10240 + 255 + 5 + 50 + 100 + 128 + 51200 + 20 + 10 + 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 000000000000..a23f7794b8dd --- /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 000000000000..6bb5911a8550 --- /dev/null +++ b/nova/tests/integrated/v3/api_samples/os-quota-class-sets/quota-classes-update-post-resp.xml.tpl @@ -0,0 +1,15 @@ + + + 50 + 10 + -1 + 10240 + 255 + 5 + 50 + 100 + 128 + 51200 + 20 + 10 + 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 000000000000..2f0fd9857242 --- /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 000000000000..f56987563cef --- /dev/null +++ b/nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-show-defaults-get-resp.xml.tpl @@ -0,0 +1,15 @@ + + + 20 + 10 + -1 + 10240 + 255 + 5 + 10 + 100 + 128 + 51200 + 20 + 10 + 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 000000000000..2f0fd9857242 --- /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 000000000000..f56987563cef --- /dev/null +++ b/nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-show-get-resp.xml.tpl @@ -0,0 +1,15 @@ + + + 20 + 10 + -1 + 10240 + 255 + 5 + 10 + 100 + 128 + 51200 + 20 + 10 + 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 000000000000..a58a17912375 --- /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 000000000000..7e5d4f320a40 --- /dev/null +++ b/nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-update-force-post-req.xml.tpl @@ -0,0 +1,5 @@ + + + True + 45 + \ 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 000000000000..8f98181fd79f --- /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 000000000000..8d881801830f --- /dev/null +++ b/nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-update-force-post-resp.xml.tpl @@ -0,0 +1,15 @@ + + + 20 + -1 + 10 + 10240 + 255 + 5 + 45 + 100 + 128 + 51200 + 20 + 10 + \ 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 000000000000..5570e8bfa9e7 --- /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 000000000000..0fb8affaef3c --- /dev/null +++ b/nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-update-force-resp.xml.tpl @@ -0,0 +1,15 @@ + + + 20 + 10 + -1 + 10240 + 255 + 5 + 45 + 100 + 128 + 51200 + 20 + 10 + 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 000000000000..1f12caa0450e --- /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 000000000000..cc9459be786e --- /dev/null +++ b/nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-update-post-req.xml.tpl @@ -0,0 +1,4 @@ + + + 45 + 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 000000000000..a75450cf9630 --- /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 000000000000..6c925b21250b --- /dev/null +++ b/nova/tests/integrated/v3/api_samples/os-quota-sets/quotas-update-post-resp.xml.tpl @@ -0,0 +1,15 @@ + + + 20 + 10 + -1 + 10240 + 255 + 5 + 10 + 100 + 128 + 51200 + 20 + 45 + 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 000000000000..2f0fd9857242 --- /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 000000000000..f56987563cef --- /dev/null +++ b/nova/tests/integrated/v3/api_samples/os-quota-sets/user-quotas-show-get-resp.xml.tpl @@ -0,0 +1,15 @@ + + + 20 + 10 + -1 + 10240 + 255 + 5 + 10 + 100 + 128 + 51200 + 20 + 10 + 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 000000000000..b322b2a87007 --- /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 000000000000..3f6481a149fc --- /dev/null +++ b/nova/tests/integrated/v3/api_samples/os-quota-sets/user-quotas-update-post-req.xml.tpl @@ -0,0 +1,5 @@ + + + True + 9 + 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 000000000000..10f8111bd367 --- /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 000000000000..382424995788 --- /dev/null +++ b/nova/tests/integrated/v3/api_samples/os-quota-sets/user-quotas-update-post-resp.xml.tpl @@ -0,0 +1,15 @@ + + + 20 + 10 + -1 + 10240 + 255 + 5 + 9 + 100 + 128 + 51200 + 20 + 10 + 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 000000000000..35043159a70d --- /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 000000000000..d0f0f50f6526 --- /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 000000000000..bf74b705e124 --- /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"