{"action":"opened","number":247,"pull_request":{"url":"https://api.github.com/repos/project-koku/koku/pulls/247","id":198384412,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk4Mzg0NDEy","html_url":"https://github.com/project-koku/koku/pull/247","diff_url":"https://github.com/project-koku/koku/pull/247.diff","patch_url":"https://github.com/project-koku/koku/pull/247.patch","issue_url":"https://api.github.com/repos/project-koku/koku/issues/247","number":247,"state":"open","locked":false,"title":"Add ability to query for current month, monthly costs grouped by service.","user":{"login":"chambridge","id":29379759,"node_id":"MDQ6VXNlcjI5Mzc5NzU5","avatar_url":"https://avatars3.githubusercontent.com/u/29379759?v=4","gravatar_id":"","url":"https://api.github.com/users/chambridge","html_url":"https://github.com/chambridge","followers_url":"https://api.github.com/users/chambridge/followers","following_url":"https://api.github.com/users/chambridge/following{/other_user}","gists_url":"https://api.github.com/users/chambridge/gists{/gist_id}","starred_url":"https://api.github.com/users/chambridge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chambridge/subscriptions","organizations_url":"https://api.github.com/users/chambridge/orgs","repos_url":"https://api.github.com/users/chambridge/repos","events_url":"https://api.github.com/users/chambridge/events{/privacy}","received_events_url":"https://api.github.com/users/chambridge/received_events","type":"User","site_admin":false},"body":"Adds support for group_by service.\r\n\r\nBelow describes getting the current monthly cost grouped by service.\r\n```\r\nhttp://127.0.0.1:8000/api/v1/reports/costs/?filter[time_scope_value]=-1&group_by[service]=*&filter[time_scope_units]=month&filter[resolution]=monthly\r\n```\r\n\r\nResults:\r\n```\r\n{\r\n    \"group_by\": {\r\n        \"service\": [\r\n            \"*\"\r\n        ]\r\n    },\r\n    \"filter\": {\r\n        \"resolution\": \"monthly\",\r\n        \"time_scope_value\": \"-1\",\r\n        \"time_scope_units\": \"month\"\r\n    },\r\n    \"data\": [\r\n        {\r\n            \"2018-06\": [\r\n                {\r\n                    \"Storage Snapshot\": [\r\n                        {\r\n                            \"date\": \"2018-06\",\r\n                            \"units\": \"USD\",\r\n                            \"service\": \"Storage Snapshot\",\r\n                            \"total\": 73524.680680838\r\n                        }\r\n                    ]\r\n                },\r\n                {\r\n                    \"Storage\": [\r\n                        {\r\n                            \"date\": \"2018-06\",\r\n                            \"units\": \"USD\",\r\n                            \"service\": \"Storage\",\r\n                            \"total\": 8446.981846119\r\n                        }\r\n                    ]\r\n                },\r\n                {\r\n                    \"Compute Instance\": [\r\n                        {\r\n                            \"date\": \"2018-06\",\r\n                            \"units\": \"USD\",\r\n                            \"service\": \"Compute Instance\",\r\n                            \"total\": 7255.689\r\n                        }\r\n                    ]\r\n                },\r\n                {\r\n                    \"Data Transfer\": [\r\n                        {\r\n                            \"date\": \"2018-06\",\r\n                            \"units\": \"USD\",\r\n                            \"service\": \"Data Transfer\",\r\n                            \"total\": 2.174076039\r\n                        }\r\n                    ]\r\n                }\r\n            ]\r\n        }\r\n    ],\r\n    \"total\": {\r\n        \"value\": 89229.525602996,\r\n        \"units\": \"USD\"\r\n    }\r\n}\r\n```\r\n\r\nA few tweaks from the previous sprint:\r\n- Data points use to have _ total_cost _ its now just _total_.\r\n- Data points also contain the items they were grouped on (i.e. `date` and `service` in the above)\r\n- No generation of \"null\" items for empty data points\r\n\r\n\r\nUpdated last 10 days total cost (focus item from last sprint) is updated as follows:\r\n```\r\nhttp://127.0.0.1:8000/api/v1/reports/costs/\r\n```\r\nResponse:\r\n```\r\n{\r\n    \"data\": [\r\n        {\r\n            \"2018-06-19\": [\r\n                {\r\n                    \"date\": \"2018-06-19\",\r\n                    \"units\": \"USD\",\r\n                    \"total\": 3793.164779095\r\n                }\r\n            ]\r\n        },\r\n        {\r\n            \"2018-06-20\": [\r\n                {\r\n                    \"date\": \"2018-06-20\",\r\n                    \"units\": \"USD\",\r\n                    \"total\": 3469.007567622\r\n                }\r\n            ]\r\n        },\r\n        {\r\n            \"2018-06-21\": [\r\n                {\r\n                    \"date\": \"2018-06-21\",\r\n                    \"units\": \"USD\",\r\n                    \"total\": 3386.856317357\r\n                }\r\n            ]\r\n        },\r\n        {\r\n            \"2018-06-22\": [\r\n                {\r\n                    \"date\": \"2018-06-22\",\r\n                    \"units\": \"USD\",\r\n                    \"total\": 2794.619868805\r\n                }\r\n            ]\r\n        },\r\n        {\r\n            \"2018-06-23\": [\r\n                {\r\n                    \"date\": \"2018-06-23\",\r\n                    \"units\": \"USD\",\r\n                    \"total\": 3404.896316126\r\n                }\r\n            ]\r\n        },\r\n        {\r\n            \"2018-06-24\": [\r\n                {\r\n                    \"date\": \"2018-06-24\",\r\n                    \"units\": \"USD\",\r\n                    \"total\": 4032.986082699\r\n                }\r\n            ]\r\n        },\r\n        {\r\n            \"2018-06-25\": [\r\n                {\r\n                    \"date\": \"2018-06-25\",\r\n                    \"units\": \"USD\",\r\n                    \"total\": 3171.341476926\r\n                }\r\n            ]\r\n        },\r\n        {\r\n            \"2018-06-26\": [\r\n                {\r\n                    \"date\": \"2018-06-26\",\r\n                    \"units\": \"USD\",\r\n                    \"total\": 2743.062723355\r\n                }\r\n            ]\r\n        },\r\n        {\r\n            \"2018-06-27\": [\r\n                {\r\n                    \"date\": \"2018-06-27\",\r\n                    \"units\": \"USD\",\r\n                    \"total\": 1399.338203881\r\n                }\r\n            ]\r\n        },\r\n        {\r\n            \"2018-06-28\": []\r\n        }\r\n    ],\r\n    \"total\": {\r\n        \"value\": 28195.273335866,\r\n        \"units\": \"USD\"\r\n    }\r\n}\r\n```\r\n_Note:_ DB contains no data for yesterday (2018-06-28), so while the date is present it just presents an empty list.","created_at":"2018-06-29T17:56:45Z","updated_at":"2018-06-29T17:56:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":{"login":"chambridge","id":29379759,"node_id":"MDQ6VXNlcjI5Mzc5NzU5","avatar_url":"https://avatars3.githubusercontent.com/u/29379759?v=4","gravatar_id":"","url":"https://api.github.com/users/chambridge","html_url":"https://github.com/chambridge","followers_url":"https://api.github.com/users/chambridge/followers","following_url":"https://api.github.com/users/chambridge/following{/other_user}","gists_url":"https://api.github.com/users/chambridge/gists{/gist_id}","starred_url":"https://api.github.com/users/chambridge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chambridge/subscriptions","organizations_url":"https://api.github.com/users/chambridge/orgs","repos_url":"https://api.github.com/users/chambridge/repos","events_url":"https://api.github.com/users/chambridge/events{/privacy}","received_events_url":"https://api.github.com/users/chambridge/received_events","type":"User","site_admin":false},"assignees":[{"login":"chambridge","id":29379759,"node_id":"MDQ6VXNlcjI5Mzc5NzU5","avatar_url":"https://avatars3.githubusercontent.com/u/29379759?v=4","gravatar_id":"","url":"https://api.github.com/users/chambridge","html_url":"https://github.com/chambridge","followers_url":"https://api.github.com/users/chambridge/followers","following_url":"https://api.github.com/users/chambridge/following{/other_user}","gists_url":"https://api.github.com/users/chambridge/gists{/gist_id}","starred_url":"https://api.github.com/users/chambridge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chambridge/subscriptions","organizations_url":"https://api.github.com/users/chambridge/orgs","repos_url":"https://api.github.com/users/chambridge/repos","events_url":"https://api.github.com/users/chambridge/events{/privacy}","received_events_url":"https://api.github.com/users/chambridge/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":975211922,"node_id":"MDU6TGFiZWw5NzUyMTE5MjI=","url":"https://api.github.com/repos/project-koku/koku/labels/ready%20to%20test","name":"ready to test","color":"e0749a","default":false}],"milestone":{"url":"https://api.github.com/repos/project-koku/koku/milestones/5","html_url":"https://github.com/project-koku/koku/milestone/5","labels_url":"https://api.github.com/repos/project-koku/koku/milestones/5/labels","id":3301219,"node_id":"MDk6TWlsZXN0b25lMzMwMTIxOQ==","number":5,"title":"Sprint 4","description":"","creator":{"login":"chambridge","id":29379759,"node_id":"MDQ6VXNlcjI5Mzc5NzU5","avatar_url":"https://avatars3.githubusercontent.com/u/29379759?v=4","gravatar_id":"","url":"https://api.github.com/users/chambridge","html_url":"https://github.com/chambridge","followers_url":"https://api.github.com/users/chambridge/followers","following_url":"https://api.github.com/users/chambridge/following{/other_user}","gists_url":"https://api.github.com/users/chambridge/gists{/gist_id}","starred_url":"https://api.github.com/users/chambridge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chambridge/subscriptions","organizations_url":"https://api.github.com/users/chambridge/orgs","repos_url":"https://api.github.com/users/chambridge/repos","events_url":"https://api.github.com/users/chambridge/events{/privacy}","received_events_url":"https://api.github.com/users/chambridge/received_events","type":"User","site_admin":false},"open_issues":8,"closed_issues":5,"state":"open","created_at":"2018-04-26T13:15:54Z","updated_at":"2018-06-29T17:56:45Z","due_on":"2018-07-06T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/project-koku/koku/pulls/247/commits","review_comments_url":"https://api.github.com/repos/project-koku/koku/pulls/247/comments","review_comment_url":"https://api.github.com/repos/project-koku/koku/pulls/comments{/number}","comments_url":"https://api.github.com/repos/project-koku/koku/issues/247/comments","statuses_url":"https://api.github.com/repos/project-koku/koku/statuses/2a058123955c51e127a98c57c1accf2866e410dd","head":{"label":"project-koku:158-cost-grouped-by-service","ref":"158-cost-grouped-by-service","sha":"2a058123955c51e127a98c57c1accf2866e410dd","user":{"login":"project-koku","id":37702693,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM3NzAyNjkz","avatar_url":"https://avatars1.githubusercontent.com/u/37702693?v=4","gravatar_id":"","url":"https://api.github.com/users/project-koku","html_url":"https://github.com/project-koku","followers_url":"https://api.github.com/users/project-koku/followers","following_url":"https://api.github.com/users/project-koku/following{/other_user}","gists_url":"https://api.github.com/users/project-koku/gists{/gist_id}","starred_url":"https://api.github.com/users/project-koku/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/project-koku/subscriptions","organizations_url":"https://api.github.com/users/project-koku/orgs","repos_url":"https://api.github.com/users/project-koku/repos","events_url":"https://api.github.com/users/project-koku/events{/privacy}","received_events_url":"https://api.github.com/users/project-koku/received_events","type":"Organization","site_admin":false},"repo":{"id":126496611,"node_id":"MDEwOlJlcG9zaXRvcnkxMjY0OTY2MTE=","name":"koku","full_name":"project-koku/koku","owner":{"login":"project-koku","id":37702693,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM3NzAyNjkz","avatar_url":"https://avatars1.githubusercontent.com/u/37702693?v=4","gravatar_id":"","url":"https://api.github.com/users/project-koku","html_url":"https://github.com/project-koku","followers_url":"https://api.github.com/users/project-koku/followers","following_url":"https://api.github.com/users/project-koku/following{/other_user}","gists_url":"https://api.github.com/users/project-koku/gists{/gist_id}","starred_url":"https://api.github.com/users/project-koku/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/project-koku/subscriptions","organizations_url":"https://api.github.com/users/project-koku/orgs","repos_url":"https://api.github.com/users/project-koku/repos","events_url":"https://api.github.com/users/project-koku/events{/privacy}","received_events_url":"https://api.github.com/users/project-koku/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/project-koku/koku","description":"An open source solution for cost management of cloud and hybrid cloud environments.","fork":false,"url":"https://api.github.com/repos/project-koku/koku","forks_url":"https://api.github.com/repos/project-koku/koku/forks","keys_url":"https://api.github.com/repos/project-koku/koku/keys{/key_id}","collaborators_url":"https://api.github.com/repos/project-koku/koku/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/project-koku/koku/teams","hooks_url":"https://api.github.com/repos/project-koku/koku/hooks","issue_events_url":"https://api.github.com/repos/project-koku/koku/issues/events{/number}","events_url":"https://api.github.com/repos/project-koku/koku/events","assignees_url":"https://api.github.com/repos/project-koku/koku/assignees{/user}","branches_url":"https://api.github.com/repos/project-koku/koku/branches{/branch}","tags_url":"https://api.github.com/repos/project-koku/koku/tags","blobs_url":"https://api.github.com/repos/project-koku/koku/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/project-koku/koku/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/project-koku/koku/git/refs{/sha}","trees_url":"https://api.github.com/repos/project-koku/koku/git/trees{/sha}","statuses_url":"https://api.github.com/repos/project-koku/koku/statuses/{sha}","languages_url":"https://api.github.com/repos/project-koku/koku/languages","stargazers_url":"https://api.github.com/repos/project-koku/koku/stargazers","contributors_url":"https://api.github.com/repos/project-koku/koku/contributors","subscribers_url":"https://api.github.com/repos/project-koku/koku/subscribers","subscription_url":"https://api.github.com/repos/project-koku/koku/subscription","commits_url":"https://api.github.com/repos/project-koku/koku/commits{/sha}","git_commits_url":"https://api.github.com/repos/project-koku/koku/git/commits{/sha}","comments_url":"https://api.github.com/repos/project-koku/koku/comments{/number}","issue_comment_url":"https://api.github.com/repos/project-koku/koku/issues/comments{/number}","contents_url":"https://api.github.com/repos/project-koku/koku/contents/{+path}","compare_url":"https://api.github.com/repos/project-koku/koku/compare/{base}...{head}","merges_url":"https://api.github.com/repos/project-koku/koku/merges","archive_url":"https://api.github.com/repos/project-koku/koku/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/project-koku/koku/downloads","issues_url":"https://api.github.com/repos/project-koku/koku/issues{/number}","pulls_url":"https://api.github.com/repos/project-koku/koku/pulls{/number}","milestones_url":"https://api.github.com/repos/project-koku/koku/milestones{/number}","notifications_url":"https://api.github.com/repos/project-koku/koku/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/project-koku/koku/labels{/name}","releases_url":"https://api.github.com/repos/project-koku/koku/releases{/id}","deployments_url":"https://api.github.com/repos/project-koku/koku/deployments","created_at":"2018-03-23T14:29:23Z","updated_at":"2018-06-26T00:49:15Z","pushed_at":"2018-06-29T17:48:02Z","git_url":"git://github.com/project-koku/koku.git","ssh_url":"git@github.com:project-koku/koku.git","clone_url":"https://github.com/project-koku/koku.git","svn_url":"https://github.com/project-koku/koku","homepage":"https://koku.readthedocs.io/","size":435,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"archived":false,"open_issues_count":28,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":7,"open_issues":28,"watchers":2,"default_branch":"master"}},"base":{"label":"project-koku:master","ref":"master","sha":"a569ce4bb553ddc62f2d7888f3e03fe695593471","user":{"login":"project-koku","id":37702693,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM3NzAyNjkz","avatar_url":"https://avatars1.githubusercontent.com/u/37702693?v=4","gravatar_id":"","url":"https://api.github.com/users/project-koku","html_url":"https://github.com/project-koku","followers_url":"https://api.github.com/users/project-koku/followers","following_url":"https://api.github.com/users/project-koku/following{/other_user}","gists_url":"https://api.github.com/users/project-koku/gists{/gist_id}","starred_url":"https://api.github.com/users/project-koku/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/project-koku/subscriptions","organizations_url":"https://api.github.com/users/project-koku/orgs","repos_url":"https://api.github.com/users/project-koku/repos","events_url":"https://api.github.com/users/project-koku/events{/privacy}","received_events_url":"https://api.github.com/users/project-koku/received_events","type":"Organization","site_admin":false},"repo":{"id":126496611,"node_id":"MDEwOlJlcG9zaXRvcnkxMjY0OTY2MTE=","name":"koku","full_name":"project-koku/koku","owner":{"login":"project-koku","id":37702693,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM3NzAyNjkz","avatar_url":"https://avatars1.githubusercontent.com/u/37702693?v=4","gravatar_id":"","url":"https://api.github.com/users/project-koku","html_url":"https://github.com/project-koku","followers_url":"https://api.github.com/users/project-koku/followers","following_url":"https://api.github.com/users/project-koku/following{/other_user}","gists_url":"https://api.github.com/users/project-koku/gists{/gist_id}","starred_url":"https://api.github.com/users/project-koku/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/project-koku/subscriptions","organizations_url":"https://api.github.com/users/project-koku/orgs","repos_url":"https://api.github.com/users/project-koku/repos","events_url":"https://api.github.com/users/project-koku/events{/privacy}","received_events_url":"https://api.github.com/users/project-koku/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/project-koku/koku","description":"An open source solution for cost management of cloud and hybrid cloud environments.","fork":false,"url":"https://api.github.com/repos/project-koku/koku","forks_url":"https://api.github.com/repos/project-koku/koku/forks","keys_url":"https://api.github.com/repos/project-koku/koku/keys{/key_id}","collaborators_url":"https://api.github.com/repos/project-koku/koku/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/project-koku/koku/teams","hooks_url":"https://api.github.com/repos/project-koku/koku/hooks","issue_events_url":"https://api.github.com/repos/project-koku/koku/issues/events{/number}","events_url":"https://api.github.com/repos/project-koku/koku/events","assignees_url":"https://api.github.com/repos/project-koku/koku/assignees{/user}","branches_url":"https://api.github.com/repos/project-koku/koku/branches{/branch}","tags_url":"https://api.github.com/repos/project-koku/koku/tags","blobs_url":"https://api.github.com/repos/project-koku/koku/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/project-koku/koku/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/project-koku/koku/git/refs{/sha}","trees_url":"https://api.github.com/repos/project-koku/koku/git/trees{/sha}","statuses_url":"https://api.github.com/repos/project-koku/koku/statuses/{sha}","languages_url":"https://api.github.com/repos/project-koku/koku/languages","stargazers_url":"https://api.github.com/repos/project-koku/koku/stargazers","contributors_url":"https://api.github.com/repos/project-koku/koku/contributors","subscribers_url":"https://api.github.com/repos/project-koku/koku/subscribers","subscription_url":"https://api.github.com/repos/project-koku/koku/subscription","commits_url":"https://api.github.com/repos/project-koku/koku/commits{/sha}","git_commits_url":"https://api.github.com/repos/project-koku/koku/git/commits{/sha}","comments_url":"https://api.github.com/repos/project-koku/koku/comments{/number}","issue_comment_url":"https://api.github.com/repos/project-koku/koku/issues/comments{/number}","contents_url":"https://api.github.com/repos/project-koku/koku/contents/{+path}","compare_url":"https://api.github.com/repos/project-koku/koku/compare/{base}...{head}","merges_url":"https://api.github.com/repos/project-koku/koku/merges","archive_url":"https://api.github.com/repos/project-koku/koku/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/project-koku/koku/downloads","issues_url":"https://api.github.com/repos/project-koku/koku/issues{/number}","pulls_url":"https://api.github.com/repos/project-koku/koku/pulls{/number}","milestones_url":"https://api.github.com/repos/project-koku/koku/milestones{/number}","notifications_url":"https://api.github.com/repos/project-koku/koku/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/project-koku/koku/labels{/name}","releases_url":"https://api.github.com/repos/project-koku/koku/releases{/id}","deployments_url":"https://api.github.com/repos/project-koku/koku/deployments","created_at":"2018-03-23T14:29:23Z","updated_at":"2018-06-26T00:49:15Z","pushed_at":"2018-06-29T17:48:02Z","git_url":"git://github.com/project-koku/koku.git","ssh_url":"git@github.com:project-koku/koku.git","clone_url":"https://github.com/project-koku/koku.git","svn_url":"https://github.com/project-koku/koku","homepage":"https://koku.readthedocs.io/","size":435,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"archived":false,"open_issues_count":28,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":7,"open_issues":28,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/project-koku/koku/pulls/247"},"html":{"href":"https://github.com/project-koku/koku/pull/247"},"issue":{"href":"https://api.github.com/repos/project-koku/koku/issues/247"},"comments":{"href":"https://api.github.com/repos/project-koku/koku/issues/247/comments"},"review_comments":{"href":"https://api.github.com/repos/project-koku/koku/pulls/247/comments"},"review_comment":{"href":"https://api.github.com/repos/project-koku/koku/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/project-koku/koku/pulls/247/commits"},"statuses":{"href":"https://api.github.com/repos/project-koku/koku/statuses/2a058123955c51e127a98c57c1accf2866e410dd"}},"author_association":"CONTRIBUTOR","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":false,"commits":1,"additions":340,"deletions":100,"changed_files":3}}
{"actor":{"display_login":"chambridge"}}