{"action":"created","comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/python-runtime/pulls/comments/91415563","pull_request_review_id":11923748,"id":91415563,"diff_hunk":"@@ -0,0 +1,139 @@\n+#!/usr/bin/python\n+\n+from google.cloud import logging as gcloud_logging\n+from google.cloud import monitoring as gcloud_monitoring\n+from google.cloud.monitoring import MetricKind, ValueType\n+from google.cloud.exceptions import Forbidden as ForbiddenException\n+from google.cloud.exceptions import NotFound as NotFoundException\n+from oauth2client.client import GoogleCredentials\n+\n+import logging\n+import time\n+\n+from flask import Flask, request, jsonify\n+app = Flask(__name__)\n+\n+\n+@app.route('/')\n+def hello_world():\n+\treturn 'Hello World!'\n+\n+\n+@app.route('/logging', methods=['POST'])\n+def _logging():\n+\trequest_data = request.get_json()\n+\tif request_data is None:\n+\t\traise ErrorResponse(\"Unable to parse request JSON: did you set the Content-type header?\")\n+\tlog_name = request_data.get('log_name', '')\n+\tif log_name == '':\n+\t\traise ErrorResponse(\"please provide log name\")\n+\ttoken = request_data.get('token', '')\n+\tif token == '':\n+\t\traise ErrorResponse(\"please provide token name\")\n+\n+\t_log(\"log name is {0}, token is {1}\".format(log_name, token))\n+\t_log(token, log_name)\n+\n+\treturn ('OK', 200)\n+\n+\n+# TODO (nkubala): just as a note, currently the client logging API is broken","path":"tests/integration/server.py","position":40,"original_position":40,"commit_id":"ff49aa467a35137ed78ac19aa4e7b4552adefb87","original_commit_id":"13ed3279a730ec5173adccc443ea6a6a0166431c","user":{"login":"jonparrott","id":250995,"avatar_url":"https://avatars.githubusercontent.com/u/250995?v=3","gravatar_id":"","url":"https://api.github.com/users/jonparrott","html_url":"https://github.com/jonparrott","followers_url":"https://api.github.com/users/jonparrott/followers","following_url":"https://api.github.com/users/jonparrott/following{/other_user}","gists_url":"https://api.github.com/users/jonparrott/gists{/gist_id}","starred_url":"https://api.github.com/users/jonparrott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonparrott/subscriptions","organizations_url":"https://api.github.com/users/jonparrott/orgs","repos_url":"https://api.github.com/users/jonparrott/repos","events_url":"https://api.github.com/users/jonparrott/events{/privacy}","received_events_url":"https://api.github.com/users/jonparrott/received_events","type":"User","site_admin":false},"body":"You should be able to setup cloud logging as a standard library logging handler.","created_at":"2016-12-07T23:57:06Z","updated_at":"2016-12-07T23:59:00Z","html_url":"https://github.com/GoogleCloudPlatform/python-runtime/pull/52#discussion_r91415563","pull_request_url":"https://api.github.com/repos/GoogleCloudPlatform/python-runtime/pulls/52","_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/python-runtime/pulls/comments/91415563"},"html":{"href":"https://github.com/GoogleCloudPlatform/python-runtime/pull/52#discussion_r91415563"},"pull_request":{"href":"https://api.github.com/repos/GoogleCloudPlatform/python-runtime/pulls/52"}}},"pull_request":{"url":"https://api.github.com/repos/GoogleCloudPlatform/python-runtime/pulls/52","id":97032723,"html_url":"https://github.com/GoogleCloudPlatform/python-runtime/pull/52","diff_url":"https://github.com/GoogleCloudPlatform/python-runtime/pull/52.diff","patch_url":"https://github.com/GoogleCloudPlatform/python-runtime/pull/52.patch","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/python-runtime/issues/52","number":52,"state":"open","locked":false,"title":"[WIP] Integration Test Sample Application","user":{"login":"nkubala","id":5531168,"avatar_url":"https://avatars.githubusercontent.com/u/5531168?v=3","gravatar_id":"","url":"https://api.github.com/users/nkubala","html_url":"https://github.com/nkubala","followers_url":"https://api.github.com/users/nkubala/followers","following_url":"https://api.github.com/users/nkubala/following{/other_user}","gists_url":"https://api.github.com/users/nkubala/gists{/gist_id}","starred_url":"https://api.github.com/users/nkubala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nkubala/subscriptions","organizations_url":"https://api.github.com/users/nkubala/orgs","repos_url":"https://api.github.com/users/nkubala/repos","events_url":"https://api.github.com/users/nkubala/events{/privacy}","received_events_url":"https://api.github.com/users/nkubala/received_events","type":"User","site_admin":false},"body":"**As of 12/7/16, this code is a work in progress.**\r\n\r\nThis is a preliminary attempt at a sample integration test application, which will fulfill the specification for the GCP integration testing framework (once complete).\r\n\r\nSee https://github.com/GoogleCloudPlatform/runtimes-common/pull/73 for more details.\r\n\r\n@dlorenc @duggelz @jonparrott ","created_at":"2016-12-07T23:52:46Z","updated_at":"2016-12-07T23:59:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a15da7225cf36aed859b1488ace2db1391a371d7","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/GoogleCloudPlatform/python-runtime/pulls/52/commits","review_comments_url":"https://api.github.com/repos/GoogleCloudPlatform/python-runtime/pulls/52/comments","review_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/python-runtime/pulls/comments{/number}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/python-runtime/issues/52/comments","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/python-runtime/statuses/ff49aa467a35137ed78ac19aa4e7b4552adefb87","head":{"label":"nkubala:integration_test","ref":"integration_test","sha":"ff49aa467a35137ed78ac19aa4e7b4552adefb87","user":{"login":"nkubala","id":5531168,"avatar_url":"https://avatars.githubusercontent.com/u/5531168?v=3","gravatar_id":"","url":"https://api.github.com/users/nkubala","html_url":"https://github.com/nkubala","followers_url":"https://api.github.com/users/nkubala/followers","following_url":"https://api.github.com/users/nkubala/following{/other_user}","gists_url":"https://api.github.com/users/nkubala/gists{/gist_id}","starred_url":"https://api.github.com/users/nkubala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nkubala/subscriptions","organizations_url":"https://api.github.com/users/nkubala/orgs","repos_url":"https://api.github.com/users/nkubala/repos","events_url":"https://api.github.com/users/nkubala/events{/privacy}","received_events_url":"https://api.github.com/users/nkubala/received_events","type":"User","site_admin":false},"repo":{"id":72687210,"name":"python-runtime","full_name":"nkubala/python-runtime","owner":{"login":"nkubala","id":5531168,"avatar_url":"https://avatars.githubusercontent.com/u/5531168?v=3","gravatar_id":"","url":"https://api.github.com/users/nkubala","html_url":"https://github.com/nkubala","followers_url":"https://api.github.com/users/nkubala/followers","following_url":"https://api.github.com/users/nkubala/following{/other_user}","gists_url":"https://api.github.com/users/nkubala/gists{/gist_id}","starred_url":"https://api.github.com/users/nkubala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nkubala/subscriptions","organizations_url":"https://api.github.com/users/nkubala/orgs","repos_url":"https://api.github.com/users/nkubala/repos","events_url":"https://api.github.com/users/nkubala/events{/privacy}","received_events_url":"https://api.github.com/users/nkubala/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nkubala/python-runtime","description":"gcr.io/google_appengine/python - Docker images for python","fork":true,"url":"https://api.github.com/repos/nkubala/python-runtime","forks_url":"https://api.github.com/repos/nkubala/python-runtime/forks","keys_url":"https://api.github.com/repos/nkubala/python-runtime/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nkubala/python-runtime/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nkubala/python-runtime/teams","hooks_url":"https://api.github.com/repos/nkubala/python-runtime/hooks","issue_events_url":"https://api.github.com/repos/nkubala/python-runtime/issues/events{/number}","events_url":"https://api.github.com/repos/nkubala/python-runtime/events","assignees_url":"https://api.github.com/repos/nkubala/python-runtime/assignees{/user}","branches_url":"https://api.github.com/repos/nkubala/python-runtime/branches{/branch}","tags_url":"https://api.github.com/repos/nkubala/python-runtime/tags","blobs_url":"https://api.github.com/repos/nkubala/python-runtime/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nkubala/python-runtime/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nkubala/python-runtime/git/refs{/sha}","trees_url":"https://api.github.com/repos/nkubala/python-runtime/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nkubala/python-runtime/statuses/{sha}","languages_url":"https://api.github.com/repos/nkubala/python-runtime/languages","stargazers_url":"https://api.github.com/repos/nkubala/python-runtime/stargazers","contributors_url":"https://api.github.com/repos/nkubala/python-runtime/contributors","subscribers_url":"https://api.github.com/repos/nkubala/python-runtime/subscribers","subscription_url":"https://api.github.com/repos/nkubala/python-runtime/subscription","commits_url":"https://api.github.com/repos/nkubala/python-runtime/commits{/sha}","git_commits_url":"https://api.github.com/repos/nkubala/python-runtime/git/commits{/sha}","comments_url":"https://api.github.com/repos/nkubala/python-runtime/comments{/number}","issue_comment_url":"https://api.github.com/repos/nkubala/python-runtime/issues/comments{/number}","contents_url":"https://api.github.com/repos/nkubala/python-runtime/contents/{+path}","compare_url":"https://api.github.com/repos/nkubala/python-runtime/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nkubala/python-runtime/merges","archive_url":"https://api.github.com/repos/nkubala/python-runtime/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nkubala/python-runtime/downloads","issues_url":"https://api.github.com/repos/nkubala/python-runtime/issues{/number}","pulls_url":"https://api.github.com/repos/nkubala/python-runtime/pulls{/number}","milestones_url":"https://api.github.com/repos/nkubala/python-runtime/milestones{/number}","notifications_url":"https://api.github.com/repos/nkubala/python-runtime/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nkubala/python-runtime/labels{/name}","releases_url":"https://api.github.com/repos/nkubala/python-runtime/releases{/id}","deployments_url":"https://api.github.com/repos/nkubala/python-runtime/deployments","created_at":"2016-11-02T22:34:17Z","updated_at":"2016-11-02T22:34:18Z","pushed_at":"2016-12-07T23:56:06Z","git_url":"git://github.com/nkubala/python-runtime.git","ssh_url":"git@github.com:nkubala/python-runtime.git","clone_url":"https://github.com/nkubala/python-runtime.git","svn_url":"https://github.com/nkubala/python-runtime","homepage":"https://cloud.google.com/python","size":68,"stargazers_count":0,"watchers_count":0,"language":"Makefile","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"GoogleCloudPlatform:master","ref":"master","sha":"b75fb62aad4b3bd476c2f3be3c8693dca9714fef","user":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"repo":{"id":20423832,"name":"python-runtime","full_name":"GoogleCloudPlatform/python-runtime","owner":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/GoogleCloudPlatform/python-runtime","description":"gcr.io/google_appengine/python - Docker images for python","fork":false,"url":"https://api.github.com/repos/GoogleCloudPlatform/python-runtime","forks_url":"https://api.github.com/repos/GoogleCloudPlatform/python-runtime/forks","keys_url":"https://api.github.com/repos/GoogleCloudPlatform/python-runtime/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GoogleCloudPlatform/python-runtime/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GoogleCloudPlatform/python-runtime/teams","hooks_url":"https://api.github.com/repos/GoogleCloudPlatform/python-runtime/hooks","issue_events_url":"https://api.github.com/repos/GoogleCloudPlatform/python-runtime/issues/events{/number}","events_url":"https://api.github.com/repos/GoogleCloudPlatform/python-runtime/events","assignees_url":"https://api.github.com/repos/GoogleCloudPlatform/python-runtime/assignees{/user}","branches_url":"https://api.github.com/repos/GoogleCloudPlatform/python-runtime/branches{/branch}","tags_url":"https://api.github.com/repos/GoogleCloudPlatform/python-runtime/tags","blobs_url":"https://api.github.com/repos/GoogleCloudPlatform/python-runtime/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GoogleCloudPlatform/python-runtime/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GoogleCloudPlatform/python-runtime/git/refs{/sha}","trees_url":"https://api.github.com/repos/GoogleCloudPlatform/python-runtime/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/python-runtime/statuses/{sha}","languages_url":"https://api.github.com/repos/GoogleCloudPlatform/python-runtime/languages","stargazers_url":"https://api.github.com/repos/GoogleCloudPlatform/python-runtime/stargazers","contributors_url":"https://api.github.com/repos/GoogleCloudPlatform/python-runtime/contributors","subscribers_url":"https://api.github.com/repos/GoogleCloudPlatform/python-runtime/subscribers","subscription_url":"https://api.github.com/repos/GoogleCloudPlatform/python-runtime/subscription","commits_url":"https://api.github.com/repos/GoogleCloudPlatform/python-runtime/commits{/sha}","git_commits_url":"https://api.github.com/repos/GoogleCloudPlatform/python-runtime/git/commits{/sha}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/python-runtime/comments{/number}","issue_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/python-runtime/issues/comments{/number}","contents_url":"https://api.github.com/repos/GoogleCloudPlatform/python-runtime/contents/{+path}","compare_url":"https://api.github.com/repos/GoogleCloudPlatform/python-runtime/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GoogleCloudPlatform/python-runtime/merges","archive_url":"https://api.github.com/repos/GoogleCloudPlatform/python-runtime/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GoogleCloudPlatform/python-runtime/downloads","issues_url":"https://api.github.com/repos/GoogleCloudPlatform/python-runtime/issues{/number}","pulls_url":"https://api.github.com/repos/GoogleCloudPlatform/python-runtime/pulls{/number}","milestones_url":"https://api.github.com/repos/GoogleCloudPlatform/python-runtime/milestones{/number}","notifications_url":"https://api.github.com/repos/GoogleCloudPlatform/python-runtime/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/python-runtime/labels{/name}","releases_url":"https://api.github.com/repos/GoogleCloudPlatform/python-runtime/releases{/id}","deployments_url":"https://api.github.com/repos/GoogleCloudPlatform/python-runtime/deployments","created_at":"2014-06-02T23:57:26Z","updated_at":"2016-11-17T23:48:41Z","pushed_at":"2016-12-07T23:56:07Z","git_url":"git://github.com/GoogleCloudPlatform/python-runtime.git","ssh_url":"git@github.com:GoogleCloudPlatform/python-runtime.git","clone_url":"https://github.com/GoogleCloudPlatform/python-runtime.git","svn_url":"https://github.com/GoogleCloudPlatform/python-runtime","homepage":"https://cloud.google.com/python","size":68,"stargazers_count":57,"watchers_count":57,"language":"Makefile","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":23,"mirror_url":null,"open_issues_count":5,"forks":23,"open_issues":5,"watchers":57,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/python-runtime/pulls/52"},"html":{"href":"https://github.com/GoogleCloudPlatform/python-runtime/pull/52"},"issue":{"href":"https://api.github.com/repos/GoogleCloudPlatform/python-runtime/issues/52"},"comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/python-runtime/issues/52/comments"},"review_comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/python-runtime/pulls/52/comments"},"review_comment":{"href":"https://api.github.com/repos/GoogleCloudPlatform/python-runtime/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/GoogleCloudPlatform/python-runtime/pulls/52/commits"},"statuses":{"href":"https://api.github.com/repos/GoogleCloudPlatform/python-runtime/statuses/ff49aa467a35137ed78ac19aa4e7b4552adefb87"}}}}
{"actor":{"display_login":"jonparrott"}}