223 lines
7.1 KiB
YAML
223 lines
7.1 KiB
YAML
fixtures:
|
|
- ConfigFixture
|
|
- StorageDataFixture
|
|
- NowStorageDataFixture
|
|
- SkipIfFunctional
|
|
|
|
tests:
|
|
- name: get period with two tenants
|
|
url: /v1/report/tenants
|
|
query_parameters:
|
|
begin: "2015-01-04T00:00:00"
|
|
end: "2015-01-05T00:00:00"
|
|
status: 200
|
|
response_strings:
|
|
- "8f82cc70-e50c-466e-8624-24bdea811375"
|
|
- "7606a24a-b8ad-4ae0-be6c-3d7a41334a2e"
|
|
|
|
- name: by default give tenants for the current month
|
|
url: /v1/report/tenants
|
|
status: 200
|
|
response_strings:
|
|
- "3d9a1b33-482f-42fd-aef9-b575a3da9369"
|
|
|
|
- name: get period with no tenants
|
|
url: /v1/report/tenants
|
|
query_parameters:
|
|
begin: "2015-02-01T00:00:00"
|
|
end: "2015-02-02T00:00:00"
|
|
status: 200
|
|
response_strings:
|
|
- "[]"
|
|
|
|
- name: get total when begin time bigger than end time
|
|
url: /v1/report/total
|
|
query_parameters:
|
|
begin: "2015-02-04T00:00:00"
|
|
end: "2015-01-01T00:00:00"
|
|
tenant_id: "8f82cc70-e50c-466e-8624-24bdea811375"
|
|
status: 200
|
|
response_strings:
|
|
- "0"
|
|
|
|
- name: get total for a period
|
|
url: /v1/report/total
|
|
query_parameters:
|
|
begin: "2015-01-01T00:00:00"
|
|
end: "2015-02-04T00:00:00"
|
|
status: 200
|
|
response_strings:
|
|
- "122.472"
|
|
|
|
- name: get total for a period filtering on first tenant
|
|
url: /v1/report/total
|
|
query_parameters:
|
|
begin: "2015-01-01T00:00:00"
|
|
end: "2015-02-04T00:00:00"
|
|
tenant_id: "8f82cc70-e50c-466e-8624-24bdea811375"
|
|
status: 200
|
|
response_strings:
|
|
- "81.648"
|
|
|
|
- name: get total for a period filtering on second tenant
|
|
url: /v1/report/total
|
|
query_parameters:
|
|
begin: "2015-01-01T00:00:00"
|
|
end: "2015-02-04T00:00:00"
|
|
tenant_id: "7606a24a-b8ad-4ae0-be6c-3d7a41334a2e"
|
|
status: 200
|
|
response_strings:
|
|
- "40.824"
|
|
|
|
- name: get total for a period filtering on compute service
|
|
url: /v1/report/total
|
|
query_parameters:
|
|
begin: "2015-01-01T00:00:00"
|
|
end: "2015-02-04T00:00:00"
|
|
service: "cpu"
|
|
status: 200
|
|
response_strings:
|
|
- "112.308"
|
|
|
|
- name: get total for a period filtering on image service
|
|
url: /v1/report/total
|
|
query_parameters:
|
|
begin: "2015-01-01T00:00:00"
|
|
end: "2015-02-04T00:00:00"
|
|
service: "image.size"
|
|
status: 200
|
|
response_strings:
|
|
- "10.164"
|
|
|
|
- name: get total for a period filtering on compute service and tenant
|
|
url: /v1/report/total
|
|
query_parameters:
|
|
begin: "2015-01-01T00:00:00"
|
|
end: "2015-02-04T00:00:00"
|
|
tenant_id: "7606a24a-b8ad-4ae0-be6c-3d7a41334a2e"
|
|
service: "cpu"
|
|
status: 200
|
|
response_strings:
|
|
- "37.436"
|
|
|
|
- name: get total for a period with no data
|
|
url: /v1/report/total
|
|
query_parameters:
|
|
begin: "2015-02-01T00:00:00"
|
|
end: "2015-02-02T00:00:00"
|
|
status: 200
|
|
response_strings:
|
|
- "0"
|
|
|
|
- name: get summary for a period of each tenant
|
|
url: /v1/report/summary
|
|
query_parameters:
|
|
begin: "2015-01-01T00:00:00"
|
|
end: "2015-02-04T00:00:00"
|
|
groupby: "tenant_id"
|
|
status: 200
|
|
response_json_paths:
|
|
$.summary.`len`: 2
|
|
$.summary[0].rate: "40.824"
|
|
$.summary[0].res_type: "ALL"
|
|
$.summary[0].tenant_id: "7606a24a-b8ad-4ae0-be6c-3d7a41334a2e"
|
|
$.summary[0].begin: "2015-01-01T00:00:00"
|
|
$.summary[0].end: "2015-02-04T00:00:00"
|
|
$.summary[1].rate: "81.648"
|
|
$.summary[1].res_type: "ALL"
|
|
$.summary[1].tenant_id: "8f82cc70-e50c-466e-8624-24bdea811375"
|
|
$.summary[1].begin: "2015-01-01T00:00:00"
|
|
$.summary[1].end: "2015-02-04T00:00:00"
|
|
|
|
- name: get summary for a period of each tenant filtering on compute service
|
|
url: /v1/report/summary
|
|
query_parameters:
|
|
begin: "2015-01-01T00:00:00"
|
|
end: "2015-02-04T00:00:00"
|
|
service: "cpu"
|
|
groupby: "tenant_id"
|
|
status: 200
|
|
response_json_paths:
|
|
$.summary.`len`: 2
|
|
$.summary[0].rate: "37.436"
|
|
$.summary[0].tenant_id: "7606a24a-b8ad-4ae0-be6c-3d7a41334a2e"
|
|
$.summary[0].res_type: "cpu"
|
|
$.summary[0].begin: "2015-01-01T00:00:00"
|
|
$.summary[0].end: "2015-02-04T00:00:00"
|
|
$.summary[1].rate: "74.872"
|
|
$.summary[1].tenant_id: "8f82cc70-e50c-466e-8624-24bdea811375"
|
|
$.summary[1].res_type: "cpu"
|
|
$.summary[1].begin: "2015-01-01T00:00:00"
|
|
$.summary[1].end: "2015-02-04T00:00:00"
|
|
|
|
- name: get summary for a period of each service
|
|
url: /v1/report/summary
|
|
query_parameters:
|
|
begin: "2015-01-01T00:00:00"
|
|
end: "2015-02-04T00:00:00"
|
|
groupby: "res_type"
|
|
status: 200
|
|
response_json_paths:
|
|
$.summary.`len`: 2
|
|
$.summary[/res_type][0].rate: "112.308"
|
|
$.summary[/res_type][0].res_type: "cpu"
|
|
$.summary[/res_type][0].tenant_id: "ALL"
|
|
$.summary[/res_type][0].begin: "2015-01-01T00:00:00"
|
|
$.summary[/res_type][0].end: "2015-02-04T00:00:00"
|
|
$.summary[/res_type][1].rate: "10.164"
|
|
$.summary[/res_type][1].res_type: "image.size"
|
|
$.summary[/res_type][1].tenant_id: "ALL"
|
|
$.summary[/res_type][1].begin: "2015-01-01T00:00:00"
|
|
$.summary[/res_type][1].end: "2015-02-04T00:00:00"
|
|
|
|
- name: get summary for a period of each service filtering on first tenant
|
|
url: /v1/report/summary
|
|
query_parameters:
|
|
begin: "2015-01-01T00:00:00"
|
|
end: "2015-02-04T00:00:00"
|
|
tenant_id: "8f82cc70-e50c-466e-8624-24bdea811375"
|
|
groupby: "res_type"
|
|
status: 200
|
|
response_json_paths:
|
|
$.summary.`len`: 2
|
|
$.summary[/res_type][0].rate: "74.872"
|
|
$.summary[/res_type][0].tenant_id: "8f82cc70-e50c-466e-8624-24bdea811375"
|
|
$.summary[/res_type][0].res_type: "cpu"
|
|
$.summary[/res_type][0].begin: "2015-01-01T00:00:00"
|
|
$.summary[/res_type][0].end: "2015-02-04T00:00:00"
|
|
$.summary[/res_type][1].rate: "6.776"
|
|
$.summary[/res_type][1].tenant_id: "8f82cc70-e50c-466e-8624-24bdea811375"
|
|
$.summary[/res_type][1].res_type: "image.size"
|
|
$.summary[/res_type][1].begin: "2015-01-01T00:00:00"
|
|
$.summary[/res_type][1].end: "2015-02-04T00:00:00"
|
|
|
|
- name: get summary for a period of each service and tenant
|
|
url: /v1/report/summary
|
|
query_parameters:
|
|
begin: "2015-01-01T00:00:00"
|
|
end: "2015-02-04T00:00:00"
|
|
groupby: "res_type,tenant_id"
|
|
status: 200
|
|
response_json_paths:
|
|
$.summary.`len`: 4
|
|
$.summary[0].rate: "3.388"
|
|
$.summary[0].res_type: "image.size"
|
|
$.summary[0].tenant_id: "7606a24a-b8ad-4ae0-be6c-3d7a41334a2e"
|
|
$.summary[0].begin: "2015-01-01T00:00:00"
|
|
$.summary[0].end: "2015-02-04T00:00:00"
|
|
$.summary[1].rate: "6.776"
|
|
$.summary[1].res_type: "image.size"
|
|
$.summary[1].tenant_id: "8f82cc70-e50c-466e-8624-24bdea811375"
|
|
$.summary[1].begin: "2015-01-01T00:00:00"
|
|
$.summary[1].end: "2015-02-04T00:00:00"
|
|
$.summary[2].rate: "37.436"
|
|
$.summary[2].res_type: "cpu"
|
|
$.summary[2].tenant_id: "7606a24a-b8ad-4ae0-be6c-3d7a41334a2e"
|
|
$.summary[2].begin: "2015-01-01T00:00:00"
|
|
$.summary[2].end: "2015-02-04T00:00:00"
|
|
$.summary[3].rate: "74.872"
|
|
$.summary[3].res_type: "cpu"
|
|
$.summary[3].tenant_id: "8f82cc70-e50c-466e-8624-24bdea811375"
|
|
$.summary[3].begin: "2015-01-01T00:00:00"
|
|
$.summary[3].end: "2015-02-04T00:00:00"
|