{"action":"created","comment":{"url":"https://api.github.com/repos/Azure/service-fabric-cli/pulls/comments/180908518","pull_request_review_id":111415120,"id":180908518,"diff_hunk":"@@ -0,0 +1,81 @@\n+# -----------------------------------------------------------------------------\n+# Copyright (c) Microsoft Corporation. All rights reserved.\n+# Licensed under the MIT License. See License.txt in the project root for\n+# license information.\n+# -----------------------------------------------------------------------------\n+\n+\"\"\"Custom commands for the Service Fabric container support\"\"\"\n+\n+from __future__ import print_function\n+import json\n+import jsonpickle\n+from azure.servicefabric.models import ContainerApiRequestBody\n+\n+def invoke_api( # pylint: disable=too-many-arguments\n+        client,\n+        node_name,\n+        application_id,\n+        service_manifest_name,\n+        code_package_name,\n+        code_package_instance_id,\n+        container_api_uri_path,\n+        container_api_http_verb=None,\n+        container_api_content_type=None,\n+        container_api_body=None,\n+        timeout=60):\n+    \"\"\"Invoke container API on a cluster node\"\"\"\n+\n+    request_body = ContainerApiRequestBody(\n+        container_api_uri_path,\n+        container_api_http_verb,\n+        container_api_content_type,\n+        container_api_body)\n+\n+    response = client.invoke_container_api(\n+        node_name,\n+        application_id,\n+        service_manifest_name,\n+        code_package_name,\n+        code_package_instance_id,\n+        request_body,\n+        timeout)\n+\n+    print(format_response(response))","path":"src/sfctl/custom_container.py","position":43,"original_position":43,"commit_id":"124c0ac382514a4002c1d30f67fe7aefd6b0aaba","original_commit_id":"124c0ac382514a4002c1d30f67fe7aefd6b0aaba","user":{"login":"Christina-Kang","id":4260977,"avatar_url":"https://avatars1.githubusercontent.com/u/4260977?v=4","gravatar_id":"","url":"https://api.github.com/users/Christina-Kang","html_url":"https://github.com/Christina-Kang","followers_url":"https://api.github.com/users/Christina-Kang/followers","following_url":"https://api.github.com/users/Christina-Kang/following{/other_user}","gists_url":"https://api.github.com/users/Christina-Kang/gists{/gist_id}","starred_url":"https://api.github.com/users/Christina-Kang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Christina-Kang/subscriptions","organizations_url":"https://api.github.com/users/Christina-Kang/orgs","repos_url":"https://api.github.com/users/Christina-Kang/repos","events_url":"https://api.github.com/users/Christina-Kang/events{/privacy}","received_events_url":"https://api.github.com/users/Christina-Kang/received_events","type":"User","site_admin":false},"body":"Why print instead of returning?","created_at":"2018-04-11T21:47:53Z","updated_at":"2018-04-11T21:47:53Z","html_url":"https://github.com/Azure/service-fabric-cli/pull/82#discussion_r180908518","pull_request_url":"https://api.github.com/repos/Azure/service-fabric-cli/pulls/82","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/Azure/service-fabric-cli/pulls/comments/180908518"},"html":{"href":"https://github.com/Azure/service-fabric-cli/pull/82#discussion_r180908518"},"pull_request":{"href":"https://api.github.com/repos/Azure/service-fabric-cli/pulls/82"}}},"pull_request":{"url":"https://api.github.com/repos/Azure/service-fabric-cli/pulls/82","id":180466854,"html_url":"https://github.com/Azure/service-fabric-cli/pull/82","diff_url":"https://github.com/Azure/service-fabric-cli/pull/82.diff","patch_url":"https://github.com/Azure/service-fabric-cli/pull/82.patch","issue_url":"https://api.github.com/repos/Azure/service-fabric-cli/issues/82","number":82,"state":"open","locked":false,"title":"RDBug 9584859:Pass docker commands to a node in the cluster","user":{"login":"leikong","id":11276068,"avatar_url":"https://avatars0.githubusercontent.com/u/11276068?v=4","gravatar_id":"","url":"https://api.github.com/users/leikong","html_url":"https://github.com/leikong","followers_url":"https://api.github.com/users/leikong/followers","following_url":"https://api.github.com/users/leikong/following{/other_user}","gists_url":"https://api.github.com/users/leikong/gists{/gist_id}","starred_url":"https://api.github.com/users/leikong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leikong/subscriptions","organizations_url":"https://api.github.com/users/leikong/orgs","repos_url":"https://api.github.com/users/leikong/repos","events_url":"https://api.github.com/users/leikong/events{/privacy}","received_events_url":"https://api.github.com/users/leikong/received_events","type":"User","site_admin":false},"body":"Add invoke-container-api\r\n\r\nExamples:\r\n\r\n**sfctl container logs --node-name N0020 --application-id nodejs1 --service-manifest-name NodeOnSF --code-package-name Code --code-package-instance-id 131673596679688285**\r\nRunning on http://localhost:8085\r\n\r\n**sfctl container invoke-api --node-name N0020 --application-id nodejs1 --service-manifest-name NodeOnSF --code-package-name Code --code-package-instance-id 131673596679688285 --container-api-uri-path \"/containers/{id}/update\" --container-api-http-verb=POST --container-api-body \"{ \\\"CpuShares\\\": 512}\"**\r\n{\r\n    \"container_api_result\": {\r\n        \"body\": \"{\\\"Warnings\\\":null}\\n\",\r\n        \"content_encoding\": null,\r\n        \"content_type\": \"application/json\",\r\n        \"status\": 200\r\n    }\r\n}\r\n\r\nVerifed:\r\n\r\n- [x] Build and test CI passes\r\n- [x] History and readme updated to reflect changes\r\n- [x] Package version updated according to semantic versioning rules\r\n- [x] Tests modified or added, when applicable\r\n- [x] Updated code owners file, when applicable\r\n- [x] Read the [PR checklist](https://github.com/Azure/service-fabric-cli/wiki/Checklist)\r\n","created_at":"2018-04-10T01:22:03Z","updated_at":"2018-04-11T21:47:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7244af6abc9cbf4cd49c1bf885bbe677d98130e3","assignee":{"login":"Christina-Kang","id":4260977,"avatar_url":"https://avatars1.githubusercontent.com/u/4260977?v=4","gravatar_id":"","url":"https://api.github.com/users/Christina-Kang","html_url":"https://github.com/Christina-Kang","followers_url":"https://api.github.com/users/Christina-Kang/followers","following_url":"https://api.github.com/users/Christina-Kang/following{/other_user}","gists_url":"https://api.github.com/users/Christina-Kang/gists{/gist_id}","starred_url":"https://api.github.com/users/Christina-Kang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Christina-Kang/subscriptions","organizations_url":"https://api.github.com/users/Christina-Kang/orgs","repos_url":"https://api.github.com/users/Christina-Kang/repos","events_url":"https://api.github.com/users/Christina-Kang/events{/privacy}","received_events_url":"https://api.github.com/users/Christina-Kang/received_events","type":"User","site_admin":false},"assignees":[{"login":"Christina-Kang","id":4260977,"avatar_url":"https://avatars1.githubusercontent.com/u/4260977?v=4","gravatar_id":"","url":"https://api.github.com/users/Christina-Kang","html_url":"https://github.com/Christina-Kang","followers_url":"https://api.github.com/users/Christina-Kang/followers","following_url":"https://api.github.com/users/Christina-Kang/following{/other_user}","gists_url":"https://api.github.com/users/Christina-Kang/gists{/gist_id}","starred_url":"https://api.github.com/users/Christina-Kang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Christina-Kang/subscriptions","organizations_url":"https://api.github.com/users/Christina-Kang/orgs","repos_url":"https://api.github.com/users/Christina-Kang/repos","events_url":"https://api.github.com/users/Christina-Kang/events{/privacy}","received_events_url":"https://api.github.com/users/Christina-Kang/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"samedder","id":26749906,"avatar_url":"https://avatars1.githubusercontent.com/u/26749906?v=4","gravatar_id":"","url":"https://api.github.com/users/samedder","html_url":"https://github.com/samedder","followers_url":"https://api.github.com/users/samedder/followers","following_url":"https://api.github.com/users/samedder/following{/other_user}","gists_url":"https://api.github.com/users/samedder/gists{/gist_id}","starred_url":"https://api.github.com/users/samedder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samedder/subscriptions","organizations_url":"https://api.github.com/users/samedder/orgs","repos_url":"https://api.github.com/users/samedder/repos","events_url":"https://api.github.com/users/samedder/events{/privacy}","received_events_url":"https://api.github.com/users/samedder/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Azure/service-fabric-cli/pulls/82/commits","review_comments_url":"https://api.github.com/repos/Azure/service-fabric-cli/pulls/82/comments","review_comment_url":"https://api.github.com/repos/Azure/service-fabric-cli/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Azure/service-fabric-cli/issues/82/comments","statuses_url":"https://api.github.com/repos/Azure/service-fabric-cli/statuses/124c0ac382514a4002c1d30f67fe7aefd6b0aaba","head":{"label":"leikong:bug.9584859","ref":"bug.9584859","sha":"124c0ac382514a4002c1d30f67fe7aefd6b0aaba","user":{"login":"leikong","id":11276068,"avatar_url":"https://avatars0.githubusercontent.com/u/11276068?v=4","gravatar_id":"","url":"https://api.github.com/users/leikong","html_url":"https://github.com/leikong","followers_url":"https://api.github.com/users/leikong/followers","following_url":"https://api.github.com/users/leikong/following{/other_user}","gists_url":"https://api.github.com/users/leikong/gists{/gist_id}","starred_url":"https://api.github.com/users/leikong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leikong/subscriptions","organizations_url":"https://api.github.com/users/leikong/orgs","repos_url":"https://api.github.com/users/leikong/repos","events_url":"https://api.github.com/users/leikong/events{/privacy}","received_events_url":"https://api.github.com/users/leikong/received_events","type":"User","site_admin":false},"repo":{"id":128853950,"name":"service-fabric-cli","full_name":"leikong/service-fabric-cli","owner":{"login":"leikong","id":11276068,"avatar_url":"https://avatars0.githubusercontent.com/u/11276068?v=4","gravatar_id":"","url":"https://api.github.com/users/leikong","html_url":"https://github.com/leikong","followers_url":"https://api.github.com/users/leikong/followers","following_url":"https://api.github.com/users/leikong/following{/other_user}","gists_url":"https://api.github.com/users/leikong/gists{/gist_id}","starred_url":"https://api.github.com/users/leikong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leikong/subscriptions","organizations_url":"https://api.github.com/users/leikong/orgs","repos_url":"https://api.github.com/users/leikong/repos","events_url":"https://api.github.com/users/leikong/events{/privacy}","received_events_url":"https://api.github.com/users/leikong/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/leikong/service-fabric-cli","description":"Service Fabric CLI Tools","fork":true,"url":"https://api.github.com/repos/leikong/service-fabric-cli","forks_url":"https://api.github.com/repos/leikong/service-fabric-cli/forks","keys_url":"https://api.github.com/repos/leikong/service-fabric-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/leikong/service-fabric-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/leikong/service-fabric-cli/teams","hooks_url":"https://api.github.com/repos/leikong/service-fabric-cli/hooks","issue_events_url":"https://api.github.com/repos/leikong/service-fabric-cli/issues/events{/number}","events_url":"https://api.github.com/repos/leikong/service-fabric-cli/events","assignees_url":"https://api.github.com/repos/leikong/service-fabric-cli/assignees{/user}","branches_url":"https://api.github.com/repos/leikong/service-fabric-cli/branches{/branch}","tags_url":"https://api.github.com/repos/leikong/service-fabric-cli/tags","blobs_url":"https://api.github.com/repos/leikong/service-fabric-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/leikong/service-fabric-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/leikong/service-fabric-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/leikong/service-fabric-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/leikong/service-fabric-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/leikong/service-fabric-cli/languages","stargazers_url":"https://api.github.com/repos/leikong/service-fabric-cli/stargazers","contributors_url":"https://api.github.com/repos/leikong/service-fabric-cli/contributors","subscribers_url":"https://api.github.com/repos/leikong/service-fabric-cli/subscribers","subscription_url":"https://api.github.com/repos/leikong/service-fabric-cli/subscription","commits_url":"https://api.github.com/repos/leikong/service-fabric-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/leikong/service-fabric-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/leikong/service-fabric-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/leikong/service-fabric-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/leikong/service-fabric-cli/contents/{+path}","compare_url":"https://api.github.com/repos/leikong/service-fabric-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/leikong/service-fabric-cli/merges","archive_url":"https://api.github.com/repos/leikong/service-fabric-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/leikong/service-fabric-cli/downloads","issues_url":"https://api.github.com/repos/leikong/service-fabric-cli/issues{/number}","pulls_url":"https://api.github.com/repos/leikong/service-fabric-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/leikong/service-fabric-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/leikong/service-fabric-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/leikong/service-fabric-cli/labels{/name}","releases_url":"https://api.github.com/repos/leikong/service-fabric-cli/releases{/id}","deployments_url":"https://api.github.com/repos/leikong/service-fabric-cli/deployments","created_at":"2018-04-10T01:18:20Z","updated_at":"2018-04-10T01:18:23Z","pushed_at":"2018-04-11T20:59:46Z","git_url":"git://github.com/leikong/service-fabric-cli.git","ssh_url":"git@github.com:leikong/service-fabric-cli.git","clone_url":"https://github.com/leikong/service-fabric-cli.git","svn_url":"https://github.com/leikong/service-fabric-cli","homepage":null,"size":477,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Azure:master","ref":"master","sha":"e97a4440633d0e076a6b09bb124b84c1c75427aa","user":{"login":"Azure","id":6844498,"avatar_url":"https://avatars0.githubusercontent.com/u/6844498?v=4","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"repo":{"id":94585736,"name":"service-fabric-cli","full_name":"Azure/service-fabric-cli","owner":{"login":"Azure","id":6844498,"avatar_url":"https://avatars0.githubusercontent.com/u/6844498?v=4","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Azure/service-fabric-cli","description":"Service Fabric CLI Tools","fork":false,"url":"https://api.github.com/repos/Azure/service-fabric-cli","forks_url":"https://api.github.com/repos/Azure/service-fabric-cli/forks","keys_url":"https://api.github.com/repos/Azure/service-fabric-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Azure/service-fabric-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Azure/service-fabric-cli/teams","hooks_url":"https://api.github.com/repos/Azure/service-fabric-cli/hooks","issue_events_url":"https://api.github.com/repos/Azure/service-fabric-cli/issues/events{/number}","events_url":"https://api.github.com/repos/Azure/service-fabric-cli/events","assignees_url":"https://api.github.com/repos/Azure/service-fabric-cli/assignees{/user}","branches_url":"https://api.github.com/repos/Azure/service-fabric-cli/branches{/branch}","tags_url":"https://api.github.com/repos/Azure/service-fabric-cli/tags","blobs_url":"https://api.github.com/repos/Azure/service-fabric-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Azure/service-fabric-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Azure/service-fabric-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/Azure/service-fabric-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Azure/service-fabric-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/Azure/service-fabric-cli/languages","stargazers_url":"https://api.github.com/repos/Azure/service-fabric-cli/stargazers","contributors_url":"https://api.github.com/repos/Azure/service-fabric-cli/contributors","subscribers_url":"https://api.github.com/repos/Azure/service-fabric-cli/subscribers","subscription_url":"https://api.github.com/repos/Azure/service-fabric-cli/subscription","commits_url":"https://api.github.com/repos/Azure/service-fabric-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/Azure/service-fabric-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/Azure/service-fabric-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/Azure/service-fabric-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/Azure/service-fabric-cli/contents/{+path}","compare_url":"https://api.github.com/repos/Azure/service-fabric-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Azure/service-fabric-cli/merges","archive_url":"https://api.github.com/repos/Azure/service-fabric-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Azure/service-fabric-cli/downloads","issues_url":"https://api.github.com/repos/Azure/service-fabric-cli/issues{/number}","pulls_url":"https://api.github.com/repos/Azure/service-fabric-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/Azure/service-fabric-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/Azure/service-fabric-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Azure/service-fabric-cli/labels{/name}","releases_url":"https://api.github.com/repos/Azure/service-fabric-cli/releases{/id}","deployments_url":"https://api.github.com/repos/Azure/service-fabric-cli/deployments","created_at":"2017-06-16T22:30:58Z","updated_at":"2018-04-11T18:44:40Z","pushed_at":"2018-04-11T21:19:13Z","git_url":"git://github.com/Azure/service-fabric-cli.git","ssh_url":"git@github.com:Azure/service-fabric-cli.git","clone_url":"https://github.com/Azure/service-fabric-cli.git","svn_url":"https://github.com/Azure/service-fabric-cli","homepage":null,"size":441,"stargazers_count":22,"watchers_count":22,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":18,"mirror_url":null,"archived":false,"open_issues_count":19,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":18,"open_issues":19,"watchers":22,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Azure/service-fabric-cli/pulls/82"},"html":{"href":"https://github.com/Azure/service-fabric-cli/pull/82"},"issue":{"href":"https://api.github.com/repos/Azure/service-fabric-cli/issues/82"},"comments":{"href":"https://api.github.com/repos/Azure/service-fabric-cli/issues/82/comments"},"review_comments":{"href":"https://api.github.com/repos/Azure/service-fabric-cli/pulls/82/comments"},"review_comment":{"href":"https://api.github.com/repos/Azure/service-fabric-cli/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Azure/service-fabric-cli/pulls/82/commits"},"statuses":{"href":"https://api.github.com/repos/Azure/service-fabric-cli/statuses/124c0ac382514a4002c1d30f67fe7aefd6b0aaba"}},"author_association":"NONE"}}
{"actor":{"display_login":"Christina-Kang"}}