{"action":"created","issue":{"url":"https://api.github.com/repos/cloudfoundry-incubator/cf-abacus/issues/124","labels_url":"https://api.github.com/repos/cloudfoundry-incubator/cf-abacus/issues/124/labels{/name}","comments_url":"https://api.github.com/repos/cloudfoundry-incubator/cf-abacus/issues/124/comments","events_url":"https://api.github.com/repos/cloudfoundry-incubator/cf-abacus/issues/124/events","html_url":"https://github.com/cloudfoundry-incubator/cf-abacus/issues/124","id":113111203,"number":124,"title":"Submitting usage to collector - Status 409","user":{"login":"rajkiranrbala","id":493560,"avatar_url":"https://avatars.githubusercontent.com/u/493560?v=3","gravatar_id":"","url":"https://api.github.com/users/rajkiranrbala","html_url":"https://github.com/rajkiranrbala","followers_url":"https://api.github.com/users/rajkiranrbala/followers","following_url":"https://api.github.com/users/rajkiranrbala/following{/other_user}","gists_url":"https://api.github.com/users/rajkiranrbala/gists{/gist_id}","starred_url":"https://api.github.com/users/rajkiranrbala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rajkiranrbala/subscriptions","organizations_url":"https://api.github.com/users/rajkiranrbala/orgs","repos_url":"https://api.github.com/users/rajkiranrbala/repos","events_url":"https://api.github.com/users/rajkiranrbala/events{/privacy}","received_events_url":"https://api.github.com/users/rajkiranrbala/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/cloudfoundry-incubator/cf-abacus/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-10-23T22:31:33Z","updated_at":"2015-10-24T01:31:08Z","closed_at":null,"body":"When I submit usage to collector, I get a http status code 409 even when the payload has new usage entries along with the old entries. Is this the expected behavior.\r\n\r\nPayload 1 \r\n```javascript\r\n{\r\n  \"usage\": [\r\n    {\r\n      \"start\": 1445637382327,\r\n      \"end\": 1445637382332,\r\n      \"organization_id\": \"us-south:a3d7fe4d-3cb1-4cc3-a831-ffe98e20cf27\",\r\n      \"space_id\": \"aaeae239-f3f8-483c-9dd0-de5d41c38b6a\",\r\n      \"consumer_id\": \"app:bbeae239-f3f8-483c-9dd0-de6781c38bab\",\r\n      \"resource_id\": \"object-storage\",\r\n      \"plan_id\": \"basic\",\r\n      \"resource_instance_id\": \"0b39fa70-a65f-4183-bae8-385633ca5c87\",\r\n      \"measured_usage\": [\r\n        {\r\n          \"measure\": \"storage\",\r\n          \"quantity\": 1073741824\r\n        },\r\n        {\r\n          \"measure\": \"light_api_calls\",\r\n          \"quantity\": 1000\r\n        },\r\n        {\r\n          \"measure\": \"heavy_api_calls\",\r\n          \"quantity\": 100\r\n        }\r\n      ]\r\n    },\r\n    {\r\n      \"start\": 1445637382337,\r\n      \"end\": 1445637382349,\r\n      \"organization_id\": \"us-south:a3d7fe4d-3cb1-4cc3-a831-ffe98e20cf27\",\r\n      \"space_id\": \"aaeae239-f3f8-483c-9dd0-de5d41c38b6a\",\r\n      \"consumer_id\": \"app:bbeae239-f3f8-483c-9dd0-de6781c38bab\",\r\n      \"resource_id\": \"object-storage\",\r\n      \"plan_id\": \"basic\",\r\n      \"resource_instance_id\": \"0b39fa70-a65f-4183-bae8-385633ca5c87\",\r\n      \"measured_usage\": [\r\n        {\r\n          \"measure\": \"storage\",\r\n          \"quantity\": 1073741824\r\n        },\r\n        {\r\n          \"measure\": \"light_api_calls\",\r\n          \"quantity\": 1000\r\n        },\r\n        {\r\n          \"measure\": \"heavy_api_calls\",\r\n          \"quantity\": 100\r\n        }\r\n      ]\r\n    }\r\n  ]\r\n}\r\n```\r\nPayload 2\r\n\r\n```javascript\r\n{\r\n  \"usage\": [\r\n    {\r\n      \"start\": 1445637382337,\r\n      \"end\": 1445637382349,\r\n      \"organization_id\": \"us-south:a3d7fe4d-3cb1-4cc3-a831-ffe98e20cf27\",\r\n      \"space_id\": \"aaeae239-f3f8-483c-9dd0-de5d41c38b6a\",\r\n      \"consumer_id\": \"app:bbeae239-f3f8-483c-9dd0-de6781c38bab\",\r\n      \"resource_id\": \"object-storage\",\r\n      \"plan_id\": \"basic\",\r\n      \"resource_instance_id\": \"0b39fa70-a65f-4183-bae8-385633ca5c87\",\r\n      \"measured_usage\": [\r\n        {\r\n          \"measure\": \"storage\",\r\n          \"quantity\": 1073741824\r\n        },\r\n        {\r\n          \"measure\": \"light_api_calls\",\r\n          \"quantity\": 1000\r\n        },\r\n        {\r\n          \"measure\": \"heavy_api_calls\",\r\n          \"quantity\": 100\r\n        }\r\n      ]\r\n    },\r\n    {\r\n      \"start\": 1445637382352,\r\n      \"end\": 1445637382363,\r\n      \"organization_id\": \"us-south:a3d7fe4d-3cb1-4cc3-a831-ffe98e20cf27\",\r\n      \"space_id\": \"aaeae239-f3f8-483c-9dd0-de5d41c38b6a\",\r\n      \"consumer_id\": \"app:bbeae239-f3f8-483c-9dd0-de6781c38bab\",\r\n      \"resource_id\": \"object-storage\",\r\n      \"plan_id\": \"basic\",\r\n      \"resource_instance_id\": \"0b39fa70-a65f-4183-bae8-385633ca5c87\",\r\n      \"measured_usage\": [\r\n        {\r\n          \"measure\": \"storage\",\r\n          \"quantity\": 1073741824\r\n        },\r\n        {\r\n          \"measure\": \"light_api_calls\",\r\n          \"quantity\": 1000\r\n        },\r\n        {\r\n          \"measure\": \"heavy_api_calls\",\r\n          \"quantity\": 100\r\n        }\r\n      ]\r\n    }\r\n  ]\r\n}\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/cloudfoundry-incubator/cf-abacus/issues/comments/150733032","html_url":"https://github.com/cloudfoundry-incubator/cf-abacus/issues/124#issuecomment-150733032","issue_url":"https://api.github.com/repos/cloudfoundry-incubator/cf-abacus/issues/124","id":150733032,"user":{"login":"jsdelfino","id":247394,"avatar_url":"https://avatars.githubusercontent.com/u/247394?v=3","gravatar_id":"","url":"https://api.github.com/users/jsdelfino","html_url":"https://github.com/jsdelfino","followers_url":"https://api.github.com/users/jsdelfino/followers","following_url":"https://api.github.com/users/jsdelfino/following{/other_user}","gists_url":"https://api.github.com/users/jsdelfino/gists{/gist_id}","starred_url":"https://api.github.com/users/jsdelfino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsdelfino/subscriptions","organizations_url":"https://api.github.com/users/jsdelfino/orgs","repos_url":"https://api.github.com/users/jsdelfino/repos","events_url":"https://api.github.com/users/jsdelfino/events{/privacy}","received_events_url":"https://api.github.com/users/jsdelfino/received_events","type":"User","site_admin":false},"created_at":"2015-10-24T01:31:08Z","updated_at":"2015-10-24T01:31:08Z","body":"Currently the whole set gets rejected, as we need a clear indication of the decision on the batch: either 201 the batch is accepted and you get back a URL where you can retrieve it later, or 409 indicating that the batch is rejected. Service providers can also post individual usage docs (batches of 1 usage doc) if they'd like to get a 201 vs 409 decision on each individual usage doc."}}