{"action":"created","comment":{"url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/pulls/comments/194160738","pull_request_review_id":127289216,"id":194160738,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NDE2MDczOA==","diff_hunk":"@@ -0,0 +1,96 @@\n+package main\n+\n+import (\n+\t\"encoding/json\"\n+\t\"github.com/aws/aws-lambda-go/events\"\n+\t\"github.com/aws/aws-lambda-go/lambda\"\n+\t\"github.com/silinternational/speed-snitch-admin-api\"\n+\t\"github.com/silinternational/speed-snitch-admin-api/db\"\n+\t\"github.com/silinternational/speed-snitch-admin-api/lib/reporting\"\n+\t\"net/http\"\n+\t\"time\"\n+)\n+\n+const PeriodTimeFormat = \"2006-01-02\"\n+\n+func router(req events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error) {\n+\tmacAddr := req.PathParameters[\"macAddr\"]\n+\tif macAddr != \"\" {\n+\t\treturn viewNodeReport(req)\n+\t}\n+\n+\treturn domain.ClientError(http.StatusBadRequest, \"macAddr is required in url\")\n+}\n+\n+func viewNodeReport(req events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error) {\n+\tmacAddr := req.PathParameters[\"macAddr\"]\n+\n+\t// Validate Inputs\n+\tinterval := req.QueryStringParameters[\"interval\"]\n+\tif !reporting.IsValidReportingInterval(interval) {\n+\t\treturn domain.ClientError(http.StatusBadRequest, \"Invalid interval specified\")\n+\t}\n+\n+\tperiodStart := req.QueryStringParameters[\"start\"]","path":"api/admin/report/main.go","position":34,"original_position":34,"commit_id":"745792891b275190f7147948138876a568c10f1b","original_commit_id":"745792891b275190f7147948138876a568c10f1b","user":{"login":"Baggerone","id":8058522,"node_id":"MDQ6VXNlcjgwNTg1MjI=","avatar_url":"https://avatars0.githubusercontent.com/u/8058522?v=4","gravatar_id":"","url":"https://api.github.com/users/Baggerone","html_url":"https://github.com/Baggerone","followers_url":"https://api.github.com/users/Baggerone/followers","following_url":"https://api.github.com/users/Baggerone/following{/other_user}","gists_url":"https://api.github.com/users/Baggerone/gists{/gist_id}","starred_url":"https://api.github.com/users/Baggerone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Baggerone/subscriptions","organizations_url":"https://api.github.com/users/Baggerone/orgs","repos_url":"https://api.github.com/users/Baggerone/repos","events_url":"https://api.github.com/users/Baggerone/events{/privacy}","received_events_url":"https://api.github.com/users/Baggerone/received_events","type":"User","site_admin":false},"body":"Could this group of lines and the next be factored out into a single function\r\n```\r\nfunc GetPeriod(queryParam, startEnd string) error { ... }\r\n```\r\nI see that you are using a periodEndTimestamp from the end of a day, but for snap shots the Timestamp will always be the beginning of the day, right? Just to say that both the periodStartTime and PeriodEndTime  could be a 00:00 time.","created_at":"2018-06-08T19:35:03Z","updated_at":"2018-06-08T19:58:09Z","html_url":"https://github.com/silinternational/speed-snitch-admin-api/pull/42#discussion_r194160738","pull_request_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/pulls/42","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/pulls/comments/194160738"},"html":{"href":"https://github.com/silinternational/speed-snitch-admin-api/pull/42#discussion_r194160738"},"pull_request":{"href":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/pulls/42"}}},"pull_request":{"url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/pulls/42","id":193699071,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkzNjk5MDcx","html_url":"https://github.com/silinternational/speed-snitch-admin-api/pull/42","diff_url":"https://github.com/silinternational/speed-snitch-admin-api/pull/42.diff","patch_url":"https://github.com/silinternational/speed-snitch-admin-api/pull/42.patch","issue_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/issues/42","number":42,"state":"open","locked":false,"title":"Adding API interface to get node snapshot reports. Also some refactor…","user":{"login":"fillup","id":556105,"node_id":"MDQ6VXNlcjU1NjEwNQ==","avatar_url":"https://avatars3.githubusercontent.com/u/556105?v=4","gravatar_id":"","url":"https://api.github.com/users/fillup","html_url":"https://github.com/fillup","followers_url":"https://api.github.com/users/fillup/followers","following_url":"https://api.github.com/users/fillup/following{/other_user}","gists_url":"https://api.github.com/users/fillup/gists{/gist_id}","starred_url":"https://api.github.com/users/fillup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fillup/subscriptions","organizations_url":"https://api.github.com/users/fillup/orgs","repos_url":"https://api.github.com/users/fillup/repos","events_url":"https://api.github.com/users/fillup/events{/privacy}","received_events_url":"https://api.github.com/users/fillup/received_events","type":"User","site_admin":false},"body":"…ing of common db methods to simplify json unmarshalling","created_at":"2018-06-08T19:07:51Z","updated_at":"2018-06-08T19:58:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ed71029a1eb1b0de212f781a77051a15fb8e9362","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/pulls/42/commits","review_comments_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/pulls/42/comments","review_comment_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/issues/42/comments","statuses_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/statuses/745792891b275190f7147948138876a568c10f1b","head":{"label":"silinternational:feature/reporting-api","ref":"feature/reporting-api","sha":"745792891b275190f7147948138876a568c10f1b","user":{"login":"silinternational","id":1247676,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyNDc2NzY=","avatar_url":"https://avatars1.githubusercontent.com/u/1247676?v=4","gravatar_id":"","url":"https://api.github.com/users/silinternational","html_url":"https://github.com/silinternational","followers_url":"https://api.github.com/users/silinternational/followers","following_url":"https://api.github.com/users/silinternational/following{/other_user}","gists_url":"https://api.github.com/users/silinternational/gists{/gist_id}","starred_url":"https://api.github.com/users/silinternational/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/silinternational/subscriptions","organizations_url":"https://api.github.com/users/silinternational/orgs","repos_url":"https://api.github.com/users/silinternational/repos","events_url":"https://api.github.com/users/silinternational/events{/privacy}","received_events_url":"https://api.github.com/users/silinternational/received_events","type":"Organization","site_admin":false},"repo":{"id":129777340,"node_id":"MDEwOlJlcG9zaXRvcnkxMjk3NzczNDA=","name":"speed-snitch-admin-api","full_name":"silinternational/speed-snitch-admin-api","owner":{"login":"silinternational","id":1247676,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyNDc2NzY=","avatar_url":"https://avatars1.githubusercontent.com/u/1247676?v=4","gravatar_id":"","url":"https://api.github.com/users/silinternational","html_url":"https://github.com/silinternational","followers_url":"https://api.github.com/users/silinternational/followers","following_url":"https://api.github.com/users/silinternational/following{/other_user}","gists_url":"https://api.github.com/users/silinternational/gists{/gist_id}","starred_url":"https://api.github.com/users/silinternational/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/silinternational/subscriptions","organizations_url":"https://api.github.com/users/silinternational/orgs","repos_url":"https://api.github.com/users/silinternational/repos","events_url":"https://api.github.com/users/silinternational/events{/privacy}","received_events_url":"https://api.github.com/users/silinternational/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/silinternational/speed-snitch-admin-api","description":"Admin API for Speed Snitch agent","fork":false,"url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api","forks_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/forks","keys_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/teams","hooks_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/hooks","issue_events_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/issues/events{/number}","events_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/events","assignees_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/assignees{/user}","branches_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/branches{/branch}","tags_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/tags","blobs_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/statuses/{sha}","languages_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/languages","stargazers_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/stargazers","contributors_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/contributors","subscribers_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/subscribers","subscription_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/subscription","commits_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/contents/{+path}","compare_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/merges","archive_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/downloads","issues_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/issues{/number}","pulls_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/pulls{/number}","milestones_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/milestones{/number}","notifications_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/labels{/name}","releases_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/releases{/id}","deployments_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/deployments","created_at":"2018-04-16T16:58:43Z","updated_at":"2018-06-08T14:35:38Z","pushed_at":"2018-06-08T19:26:12Z","git_url":"git://github.com/silinternational/speed-snitch-admin-api.git","ssh_url":"git@github.com:silinternational/speed-snitch-admin-api.git","clone_url":"https://github.com/silinternational/speed-snitch-admin-api.git","svn_url":"https://github.com/silinternational/speed-snitch-admin-api","homepage":null,"size":368,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":1,"watchers":0,"default_branch":"develop"}},"base":{"label":"silinternational:develop","ref":"develop","sha":"13bb956ab29475582c03416d0654383261bde76c","user":{"login":"silinternational","id":1247676,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyNDc2NzY=","avatar_url":"https://avatars1.githubusercontent.com/u/1247676?v=4","gravatar_id":"","url":"https://api.github.com/users/silinternational","html_url":"https://github.com/silinternational","followers_url":"https://api.github.com/users/silinternational/followers","following_url":"https://api.github.com/users/silinternational/following{/other_user}","gists_url":"https://api.github.com/users/silinternational/gists{/gist_id}","starred_url":"https://api.github.com/users/silinternational/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/silinternational/subscriptions","organizations_url":"https://api.github.com/users/silinternational/orgs","repos_url":"https://api.github.com/users/silinternational/repos","events_url":"https://api.github.com/users/silinternational/events{/privacy}","received_events_url":"https://api.github.com/users/silinternational/received_events","type":"Organization","site_admin":false},"repo":{"id":129777340,"node_id":"MDEwOlJlcG9zaXRvcnkxMjk3NzczNDA=","name":"speed-snitch-admin-api","full_name":"silinternational/speed-snitch-admin-api","owner":{"login":"silinternational","id":1247676,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyNDc2NzY=","avatar_url":"https://avatars1.githubusercontent.com/u/1247676?v=4","gravatar_id":"","url":"https://api.github.com/users/silinternational","html_url":"https://github.com/silinternational","followers_url":"https://api.github.com/users/silinternational/followers","following_url":"https://api.github.com/users/silinternational/following{/other_user}","gists_url":"https://api.github.com/users/silinternational/gists{/gist_id}","starred_url":"https://api.github.com/users/silinternational/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/silinternational/subscriptions","organizations_url":"https://api.github.com/users/silinternational/orgs","repos_url":"https://api.github.com/users/silinternational/repos","events_url":"https://api.github.com/users/silinternational/events{/privacy}","received_events_url":"https://api.github.com/users/silinternational/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/silinternational/speed-snitch-admin-api","description":"Admin API for Speed Snitch agent","fork":false,"url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api","forks_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/forks","keys_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/teams","hooks_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/hooks","issue_events_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/issues/events{/number}","events_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/events","assignees_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/assignees{/user}","branches_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/branches{/branch}","tags_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/tags","blobs_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/statuses/{sha}","languages_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/languages","stargazers_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/stargazers","contributors_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/contributors","subscribers_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/subscribers","subscription_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/subscription","commits_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/contents/{+path}","compare_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/merges","archive_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/downloads","issues_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/issues{/number}","pulls_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/pulls{/number}","milestones_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/milestones{/number}","notifications_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/labels{/name}","releases_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/releases{/id}","deployments_url":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/deployments","created_at":"2018-04-16T16:58:43Z","updated_at":"2018-06-08T14:35:38Z","pushed_at":"2018-06-08T19:26:12Z","git_url":"git://github.com/silinternational/speed-snitch-admin-api.git","ssh_url":"git@github.com:silinternational/speed-snitch-admin-api.git","clone_url":"https://github.com/silinternational/speed-snitch-admin-api.git","svn_url":"https://github.com/silinternational/speed-snitch-admin-api","homepage":null,"size":368,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":1,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/pulls/42"},"html":{"href":"https://github.com/silinternational/speed-snitch-admin-api/pull/42"},"issue":{"href":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/issues/42"},"comments":{"href":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/issues/42/comments"},"review_comments":{"href":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/pulls/42/comments"},"review_comment":{"href":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/pulls/42/commits"},"statuses":{"href":"https://api.github.com/repos/silinternational/speed-snitch-admin-api/statuses/745792891b275190f7147948138876a568c10f1b"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"Baggerone"}}