{"action":"created","comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/pulls/comments/59104525","id":59104525,"diff_hunk":"@@ -0,0 +1,283 @@\n+# Copyright 2016 Google Inc. All rights reserved.\n+#\n+# Licensed under the Apache License, Version 2.0 (the \"License\");\n+# you may not use this file except in compliance with the License.\n+# You may obtain a copy of the License at\n+#\n+# http://www.apache.org/licenses/LICENSE-2.0\n+#\n+# Unless required by applicable law or agreed to in writing, software\n+# distributed under the License is distributed on an \"AS IS\" BASIS,\n+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+# See the License for the specific language governing permissions and\n+# limitations under the License.\n+\n+\"\"\"HTTP API wrapper for the Google Monitoring API.\"\"\"\n+\n+try:\n+  from gcp._util import Http, RequestException\n+except ImportError:\n+  # Use a minimal substitute module if the Datalab library is not available.\n+  from .http import Http, RequestException","path":"sources/lib/api/gcp/stackdriver/monitoring/_impl/api.py","position":21,"original_position":21,"commit_id":"02f77850899536b23933224d882e31b426170b7d","original_commit_id":"02f77850899536b23933224d882e31b426170b7d","user":{"login":"rimey","id":360806,"avatar_url":"https://avatars.githubusercontent.com/u/360806?v=3","gravatar_id":"","url":"https://api.github.com/users/rimey","html_url":"https://github.com/rimey","followers_url":"https://api.github.com/users/rimey/followers","following_url":"https://api.github.com/users/rimey/following{/other_user}","gists_url":"https://api.github.com/users/rimey/gists{/gist_id}","starred_url":"https://api.github.com/users/rimey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rimey/subscriptions","organizations_url":"https://api.github.com/users/rimey/orgs","repos_url":"https://api.github.com/users/rimey/repos","events_url":"https://api.github.com/users/rimey/events{/privacy}","received_events_url":"https://api.github.com/users/rimey/received_events","type":"User","site_admin":false},"body":"We use it as a standalone client library for the Monitoring API in a\ncontext that has no connection whatsoever with Datalab. We can remove\n_impl/http.py from this pull request if you feel strongly. All of this will\nbecome moot as soon as a version of gcloud-python including the base\nlibrary is pip-installable.\n\nOn Fri, Apr 8, 2016 at 7:54 PM, Graham Wheeler <notifications@github.com>\nwrote:\n\n> In sources/lib/api/gcp/stackdriver/monitoring/_impl/api.py\n> <https://github.com/GoogleCloudPlatform/datalab/pull/795#discussion_r59103996>\n> :\n>\n> > +#\n> > +# http://www.apache.org/licenses/LICENSE-2.0\n> > +#\n> > +# Unless required by applicable law or agreed to in writing, software\n> > +# distributed under the License is distributed on an \"AS IS\" BASIS,\n> > +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n> > +# See the License for the specific language governing permissions and\n> > +# limitations under the License.\n> > +\n> > +\"\"\"HTTP API wrapper for the Google Monitoring API.\"\"\"\n> > +\n> > +try:\n> > +  from gcp._util import Http, RequestException\n> > +except ImportError:\n> > +  # Use a minimal substitute module if the Datalab library is not available.\n> > +  from .http import Http, RequestException\n>\n> When would it be used as a standalone module? See my other comment. If the\n> intention is to use it as a standalone module then IMO it doesn't belong in\n> Datalab except possibly as a dependency.\n>\n> —\n> You are receiving this because you were mentioned.\n> Reply to this email directly or view it on GitHub\n> <https://github.com/GoogleCloudPlatform/datalab/pull/795/files/02f77850899536b23933224d882e31b426170b7d#r59103996>\n>\n","created_at":"2016-04-09T00:03:42Z","updated_at":"2016-04-09T00:03:42Z","html_url":"https://github.com/GoogleCloudPlatform/datalab/pull/795#discussion_r59104525","pull_request_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/pulls/795","_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/datalab/pulls/comments/59104525"},"html":{"href":"https://github.com/GoogleCloudPlatform/datalab/pull/795#discussion_r59104525"},"pull_request":{"href":"https://api.github.com/repos/GoogleCloudPlatform/datalab/pulls/795"}}},"pull_request":{"url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/pulls/795","id":65860935,"html_url":"https://github.com/GoogleCloudPlatform/datalab/pull/795","diff_url":"https://github.com/GoogleCloudPlatform/datalab/pull/795.diff","patch_url":"https://github.com/GoogleCloudPlatform/datalab/pull/795.patch","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/issues/795","number":795,"state":"open","locked":false,"title":"Monitoring API","user":{"login":"supriyagarg","id":11726936,"avatar_url":"https://avatars.githubusercontent.com/u/11726936?v=3","gravatar_id":"","url":"https://api.github.com/users/supriyagarg","html_url":"https://github.com/supriyagarg","followers_url":"https://api.github.com/users/supriyagarg/followers","following_url":"https://api.github.com/users/supriyagarg/following{/other_user}","gists_url":"https://api.github.com/users/supriyagarg/gists{/gist_id}","starred_url":"https://api.github.com/users/supriyagarg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/supriyagarg/subscriptions","organizations_url":"https://api.github.com/users/supriyagarg/orgs","repos_url":"https://api.github.com/users/supriyagarg/repos","events_url":"https://api.github.com/users/supriyagarg/events{/privacy}","received_events_url":"https://api.github.com/users/supriyagarg/received_events","type":"User","site_admin":false},"body":"This initial version of the monitoring client for Datalab allows users\r\nto query timeseries data. It introduces a new module under gcp that\r\nusers can import using:\r\n\r\n    from gcp.stackdriver import monitoring\r\n\r\nQuerying timeseries data:\r\n\r\nThere is a `Query` class that allows users to query timeseries data\r\nfor their monitored resources. They can initialize the query by specifying a\r\nmetric type and time interval, and refine it by adding filters to it.\r\n\r\nThe timeseries data is returned as a pandas DataFrame that allows users\r\nto further manipulate the data and visualize it within Datalab.\r\n\r\nIPython magics:\r\n\r\nThere are a couple of IPython magic commands to allow users to list\r\ndetails of the available metrics and resource types. E.g.:\r\n\r\n    %%monitoring list metrics\r\n\r\nThe base library:\r\n\r\nThe _impl directory is a snapshot of an earlier version of a\r\nmonitoring client library that we have submitted to gcloud-python:\r\n\r\nhttps://github.com/GoogleCloudPlatform/gcloud-python/pull/1691\r\n\r\nIt works as the base library on top of which the Datalab library adds\r\ninteractive features.\r\n\r\nThe authors of this code are @rimey and myself, both at Google.","created_at":"2016-04-08T23:31:35Z","updated_at":"2016-04-09T00:03:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"109b2f238adc23d202f46dccced97f2a6acbcb0e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/pulls/795/commits","review_comments_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/pulls/795/comments","review_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/pulls/comments{/number}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/issues/795/comments","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/statuses/02f77850899536b23933224d882e31b426170b7d","head":{"label":"supriyagarg:feature/stackdriver_monitoring","ref":"feature/stackdriver_monitoring","sha":"02f77850899536b23933224d882e31b426170b7d","user":{"login":"supriyagarg","id":11726936,"avatar_url":"https://avatars.githubusercontent.com/u/11726936?v=3","gravatar_id":"","url":"https://api.github.com/users/supriyagarg","html_url":"https://github.com/supriyagarg","followers_url":"https://api.github.com/users/supriyagarg/followers","following_url":"https://api.github.com/users/supriyagarg/following{/other_user}","gists_url":"https://api.github.com/users/supriyagarg/gists{/gist_id}","starred_url":"https://api.github.com/users/supriyagarg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/supriyagarg/subscriptions","organizations_url":"https://api.github.com/users/supriyagarg/orgs","repos_url":"https://api.github.com/users/supriyagarg/repos","events_url":"https://api.github.com/users/supriyagarg/events{/privacy}","received_events_url":"https://api.github.com/users/supriyagarg/received_events","type":"User","site_admin":false},"repo":{"id":55424693,"name":"datalab","full_name":"supriyagarg/datalab","owner":{"login":"supriyagarg","id":11726936,"avatar_url":"https://avatars.githubusercontent.com/u/11726936?v=3","gravatar_id":"","url":"https://api.github.com/users/supriyagarg","html_url":"https://github.com/supriyagarg","followers_url":"https://api.github.com/users/supriyagarg/followers","following_url":"https://api.github.com/users/supriyagarg/following{/other_user}","gists_url":"https://api.github.com/users/supriyagarg/gists{/gist_id}","starred_url":"https://api.github.com/users/supriyagarg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/supriyagarg/subscriptions","organizations_url":"https://api.github.com/users/supriyagarg/orgs","repos_url":"https://api.github.com/users/supriyagarg/repos","events_url":"https://api.github.com/users/supriyagarg/events{/privacy}","received_events_url":"https://api.github.com/users/supriyagarg/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/supriyagarg/datalab","description":"Interactive tools and developer experiences for Big Data on Google Cloud Platform.","fork":true,"url":"https://api.github.com/repos/supriyagarg/datalab","forks_url":"https://api.github.com/repos/supriyagarg/datalab/forks","keys_url":"https://api.github.com/repos/supriyagarg/datalab/keys{/key_id}","collaborators_url":"https://api.github.com/repos/supriyagarg/datalab/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/supriyagarg/datalab/teams","hooks_url":"https://api.github.com/repos/supriyagarg/datalab/hooks","issue_events_url":"https://api.github.com/repos/supriyagarg/datalab/issues/events{/number}","events_url":"https://api.github.com/repos/supriyagarg/datalab/events","assignees_url":"https://api.github.com/repos/supriyagarg/datalab/assignees{/user}","branches_url":"https://api.github.com/repos/supriyagarg/datalab/branches{/branch}","tags_url":"https://api.github.com/repos/supriyagarg/datalab/tags","blobs_url":"https://api.github.com/repos/supriyagarg/datalab/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/supriyagarg/datalab/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/supriyagarg/datalab/git/refs{/sha}","trees_url":"https://api.github.com/repos/supriyagarg/datalab/git/trees{/sha}","statuses_url":"https://api.github.com/repos/supriyagarg/datalab/statuses/{sha}","languages_url":"https://api.github.com/repos/supriyagarg/datalab/languages","stargazers_url":"https://api.github.com/repos/supriyagarg/datalab/stargazers","contributors_url":"https://api.github.com/repos/supriyagarg/datalab/contributors","subscribers_url":"https://api.github.com/repos/supriyagarg/datalab/subscribers","subscription_url":"https://api.github.com/repos/supriyagarg/datalab/subscription","commits_url":"https://api.github.com/repos/supriyagarg/datalab/commits{/sha}","git_commits_url":"https://api.github.com/repos/supriyagarg/datalab/git/commits{/sha}","comments_url":"https://api.github.com/repos/supriyagarg/datalab/comments{/number}","issue_comment_url":"https://api.github.com/repos/supriyagarg/datalab/issues/comments{/number}","contents_url":"https://api.github.com/repos/supriyagarg/datalab/contents/{+path}","compare_url":"https://api.github.com/repos/supriyagarg/datalab/compare/{base}...{head}","merges_url":"https://api.github.com/repos/supriyagarg/datalab/merges","archive_url":"https://api.github.com/repos/supriyagarg/datalab/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/supriyagarg/datalab/downloads","issues_url":"https://api.github.com/repos/supriyagarg/datalab/issues{/number}","pulls_url":"https://api.github.com/repos/supriyagarg/datalab/pulls{/number}","milestones_url":"https://api.github.com/repos/supriyagarg/datalab/milestones{/number}","notifications_url":"https://api.github.com/repos/supriyagarg/datalab/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/supriyagarg/datalab/labels{/name}","releases_url":"https://api.github.com/repos/supriyagarg/datalab/releases{/id}","deployments_url":"https://api.github.com/repos/supriyagarg/datalab/deployments","created_at":"2016-04-04T15:55:42Z","updated_at":"2016-04-04T15:55:44Z","pushed_at":"2016-04-08T23:30:18Z","git_url":"git://github.com/supriyagarg/datalab.git","ssh_url":"git@github.com:supriyagarg/datalab.git","clone_url":"https://github.com/supriyagarg/datalab.git","svn_url":"https://github.com/supriyagarg/datalab","homepage":"","size":182554,"stargazers_count":0,"watchers_count":0,"language":"Jupyter Notebook","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":"afc008229234bd794bcc21cf38611a06339b4861","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":22693761,"name":"datalab","full_name":"GoogleCloudPlatform/datalab","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/datalab","description":"Interactive tools and developer experiences for Big Data on Google Cloud Platform.","fork":false,"url":"https://api.github.com/repos/GoogleCloudPlatform/datalab","forks_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/forks","keys_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/teams","hooks_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/hooks","issue_events_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/issues/events{/number}","events_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/events","assignees_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/assignees{/user}","branches_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/branches{/branch}","tags_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/tags","blobs_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/git/refs{/sha}","trees_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/statuses/{sha}","languages_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/languages","stargazers_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/stargazers","contributors_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/contributors","subscribers_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/subscribers","subscription_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/subscription","commits_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/commits{/sha}","git_commits_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/git/commits{/sha}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/comments{/number}","issue_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/issues/comments{/number}","contents_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/contents/{+path}","compare_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/merges","archive_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/downloads","issues_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/issues{/number}","pulls_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/pulls{/number}","milestones_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/milestones{/number}","notifications_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/labels{/name}","releases_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/releases{/id}","deployments_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/deployments","created_at":"2014-08-06T18:37:34Z","updated_at":"2016-04-08T19:53:14Z","pushed_at":"2016-04-08T23:31:36Z","git_url":"git://github.com/GoogleCloudPlatform/datalab.git","ssh_url":"git@github.com:GoogleCloudPlatform/datalab.git","clone_url":"https://github.com/GoogleCloudPlatform/datalab.git","svn_url":"https://github.com/GoogleCloudPlatform/datalab","homepage":"","size":183615,"stargazers_count":206,"watchers_count":206,"language":"Jupyter Notebook","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":46,"mirror_url":null,"open_issues_count":129,"forks":46,"open_issues":129,"watchers":206,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/datalab/pulls/795"},"html":{"href":"https://github.com/GoogleCloudPlatform/datalab/pull/795"},"issue":{"href":"https://api.github.com/repos/GoogleCloudPlatform/datalab/issues/795"},"comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/datalab/issues/795/comments"},"review_comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/datalab/pulls/795/comments"},"review_comment":{"href":"https://api.github.com/repos/GoogleCloudPlatform/datalab/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/GoogleCloudPlatform/datalab/pulls/795/commits"},"statuses":{"href":"https://api.github.com/repos/GoogleCloudPlatform/datalab/statuses/02f77850899536b23933224d882e31b426170b7d"}}}}