deb-gnocchi/gnocchi/tests/functional/gabbits/batch-measures.yaml

296 lines
9.7 KiB
YAML

fixtures:
- ConfigFixture
defaults:
request_headers:
x-user-id: 0fbb231484614b1a80131fc22f6afc9c
x-project-id: f3d41b770cc14f0bb94a1d5be9c0e3ea
tests:
- name: create archive policy
desc: for later use
POST: /v1/archive_policy
request_headers:
content-type: application/json
x-roles: admin
data:
name: simple
definition:
- granularity: 1 second
status: 201
- name: create metric
POST: /v1/metric
request_headers:
content-type: application/json
data:
archive_policy_name: simple
status: 201
- name: push measurements to metric
POST: /v1/batch/metrics/measures
request_headers:
content-type: application/json
data:
$RESPONSE['$.id']:
- timestamp: "2015-03-06T14:33:57"
value: 43.1
- timestamp: "2015-03-06T14:34:12"
value: 12
status: 202
- name: push measurements to unknown metrics
POST: /v1/batch/metrics/measures
request_headers:
content-type: application/json
data:
37AEC8B7-C0D9-445B-8AB9-D3C6312DCF5C:
- timestamp: "2015-03-06T14:33:57"
value: 43.1
- timestamp: "2015-03-06T14:34:12"
value: 12
37AEC8B7-C0D9-445B-8AB9-D3C6312DCF5D:
- timestamp: "2015-03-06T14:33:57"
value: 43.1
- timestamp: "2015-03-06T14:34:12"
value: 12
status: 400
response_strings:
- "Unknown metrics: 37aec8b7-c0d9-445b-8ab9-d3c6312dcf5c, 37aec8b7-c0d9-445b-8ab9-d3c6312dcf5d"
- name: push measurements to unknown named metrics
POST: /v1/batch/resources/metrics/measures
request_headers:
content-type: application/json
data:
37AEC8B7-C0D9-445B-8AB9-D3C6312DCF5D:
cpu_util:
- timestamp: "2015-03-06T14:33:57"
value: 43.1
- timestamp: "2015-03-06T14:34:12"
value: 12
46c9418d-d63b-4cdd-be89-8f57ffc5952e:
disk.iops:
- timestamp: "2015-03-06T14:33:57"
value: 43.1
- timestamp: "2015-03-06T14:34:12"
value: 12
status: 400
response_strings:
- "Unknown metrics: 37aec8b7-c0d9-445b-8ab9-d3c6312dcf5d/cpu_util, 46c9418d-d63b-4cdd-be89-8f57ffc5952e/disk.iops"
- name: create second metric
POST: /v1/metric
request_headers:
content-type: application/json
data:
archive_policy_name: simple
status: 201
- name: post a resource
POST: /v1/resource/generic
request_headers:
content-type: application/json
data:
id: 46c9418d-d63b-4cdd-be89-8f57ffc5952e
user_id: 0fbb2314-8461-4b1a-8013-1fc22f6afc9c
project_id: f3d41b77-0cc1-4f0b-b94a-1d5be9c0e3ea
metrics:
disk.iops:
archive_policy_name: simple
cpu_util:
archive_policy_name: simple
status: 201
- name: post a second resource
POST: /v1/resource/generic
request_headers:
content-type: application/json
data:
id: f0f6038f-f82c-4f30-8d81-65db8be249fe
user_id: 0fbb2314-8461-4b1a-8013-1fc22f6afc9c
project_id: f3d41b77-0cc1-4f0b-b94a-1d5be9c0e3ea
metrics:
net.speed:
archive_policy_name: simple
mem_usage:
archive_policy_name: simple
status: 201
- name: list metrics
GET: /v1/metric
- name: push measurements to two metrics
POST: /v1/batch/metrics/measures
request_headers:
content-type: application/json
data:
$RESPONSE['$[0].id']:
- timestamp: "2015-03-06T14:33:57"
value: 43.1
- timestamp: "2015-03-06T14:34:12"
value: 12
$RESPONSE['$[1].id']:
- timestamp: "2015-03-06T14:33:57"
value: 43.1
- timestamp: "2015-03-06T14:34:12"
value: 12
status: 202
- name: push measurements to two named metrics
POST: /v1/batch/resources/metrics/measures
request_headers:
content-type: application/json
data:
46c9418d-d63b-4cdd-be89-8f57ffc5952e:
disk.iops:
- timestamp: "2015-03-06T14:33:57"
value: 43.1
- timestamp: "2015-03-06T14:34:12"
value: 12
cpu_util:
- timestamp: "2015-03-06T14:33:57"
value: 43.1
- timestamp: "2015-03-06T14:34:12"
value: 12
f0f6038f-f82c-4f30-8d81-65db8be249fe:
mem_usage:
- timestamp: "2015-03-06T14:33:57"
value: 43.1
- timestamp: "2015-03-06T14:34:12"
value: 12
net.speed:
- timestamp: "2015-03-06T14:33:57"
value: 43.1
- timestamp: "2015-03-06T14:34:12"
value: 12
status: 202
- name: create archive policy rule for auto
POST: /v1/archive_policy_rule
request_headers:
content-type: application/json
x-roles: admin
data:
name: rule_auto
metric_pattern: "auto.*"
archive_policy_name: simple
status: 201
- name: push measurements to unknown named metrics and create it
POST: /v1/batch/resources/metrics/measures?create_metrics=true
request_headers:
content-type: application/json
data:
46c9418d-d63b-4cdd-be89-8f57ffc5952e:
auto.test:
- timestamp: "2015-03-06T14:33:57"
value: 43.1
- timestamp: "2015-03-06T14:34:12"
value: 12
status: 202
- name: get created metric to check creation
GET: /v1/resource/generic/46c9418d-d63b-4cdd-be89-8f57ffc5952e/metric/auto.test
- name: ensure measure have been posted
GET: /v1/resource/generic/46c9418d-d63b-4cdd-be89-8f57ffc5952e/metric/auto.test/measures?refresh=true&start=2015-03-06T14:34
response_json_paths:
$:
- ["2015-03-06T14:34:12+00:00", 1.0, 12.0]
- name: push measurements to unknown named metrics and resource with create_metrics with uuid resource id
POST: /v1/batch/resources/metrics/measures?create_metrics=true
request_headers:
content-type: application/json
accept: application/json
data:
aaaaaaaa-d63b-4cdd-be89-111111111111:
auto.test:
- timestamp: "2015-03-06T14:33:57"
value: 43.1
- timestamp: "2015-03-06T14:34:12"
value: 12
bbbbbbbb-d63b-4cdd-be89-111111111111:
auto.test:
- timestamp: "2015-03-06T14:33:57"
value: 43.1
- timestamp: "2015-03-06T14:34:12"
value: 12
status: 400
response_json_paths:
$.description.cause: "Unknown resources"
$.description.detail[/original_resource_id]:
- original_resource_id: "aaaaaaaa-d63b-4cdd-be89-111111111111"
resource_id: "aaaaaaaa-d63b-4cdd-be89-111111111111"
- original_resource_id: "bbbbbbbb-d63b-4cdd-be89-111111111111"
resource_id: "bbbbbbbb-d63b-4cdd-be89-111111111111"
- name: push measurements to unknown named metrics and resource with create_metrics with uuid resource id where resources is several times listed
POST: /v1/batch/resources/metrics/measures?create_metrics=true
request_headers:
content-type: application/json
accept: application/json
data:
aaaaaaaa-d63b-4cdd-be89-111111111111:
auto.test:
- timestamp: "2015-03-06T14:33:57"
value: 43.1
- timestamp: "2015-03-06T14:34:12"
value: 12
auto.test2:
- timestamp: "2015-03-06T14:33:57"
value: 43.1
- timestamp: "2015-03-06T14:34:12"
value: 12
bbbbbbbb-d63b-4cdd-be89-111111111111:
auto.test:
- timestamp: "2015-03-06T14:33:57"
value: 43.1
- timestamp: "2015-03-06T14:34:12"
value: 12
status: 400
response_json_paths:
$.description.cause: "Unknown resources"
$.description.detail[/original_resource_id]:
- original_resource_id: "aaaaaaaa-d63b-4cdd-be89-111111111111"
resource_id: "aaaaaaaa-d63b-4cdd-be89-111111111111"
- original_resource_id: "bbbbbbbb-d63b-4cdd-be89-111111111111"
resource_id: "bbbbbbbb-d63b-4cdd-be89-111111111111"
- name: push measurements to unknown named metrics and resource with create_metrics with non uuid resource id
POST: /v1/batch/resources/metrics/measures?create_metrics=true
request_headers:
content-type: application/json
accept: application/json
data:
foobar:
auto.test:
- timestamp: "2015-03-06T14:33:57"
value: 43.1
- timestamp: "2015-03-06T14:34:12"
value: 12
status: 400
response_json_paths:
$.description.cause: "Unknown resources"
$.description.detail:
- resource_id: "6b8e287d-c01a-538c-979b-a819ee49de5d"
original_resource_id: "foobar"
- name: push measurements to named metrics and resource with create_metrics with wrong measure objects
POST: /v1/batch/resources/metrics/measures?create_metrics=true
request_headers:
content-type: application/json
accept: application/json
data:
46c9418d-d63b-4cdd-be89-8f57ffc5952e:
auto.test:
- [ "2015-03-06T14:33:57", 43.1]
- [ "2015-03-06T14:34:12", 12]
status: 400
response_strings:
- "Invalid format for measures"