Merge "rest: do not duplicate non-existing resource ids"
This commit is contained in:
commit
c4183fe4fa
@ -1422,6 +1422,7 @@ class ResourcesMetricsMeasuresBatchController(rest.RestController):
|
||||
unknown_resources.append({
|
||||
'resource_id': six.text_type(resource_id),
|
||||
'original_resource_id': original_resource_id})
|
||||
break
|
||||
except indexer.IndexerException as e:
|
||||
# This catch NoSuchArchivePolicy, which is unlikely
|
||||
# be still possible
|
||||
|
@ -227,6 +227,39 @@ tests:
|
||||
- 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:
|
||||
|
Loading…
Reference in New Issue
Block a user