{"action":"created","comment":{"url":"https://api.github.com/repos/vmware/pyvmomi-community-samples/pulls/comments/238718960","pull_request_review_id":181328690,"id":238718960,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzODcxODk2MA==","diff_hunk":"@@ -0,0 +1,148 @@\n+#!/usr/bin/env python\n+\"\"\"\n+Written by Yasen Simeonov\n+Github: https://github.com/yasensim\n+\n+This code is released under the terms of the Apache 2\n+http://www.apache.org/licenses/LICENSE-2.0.html\n+\n+Example script to change the network of the Virtual Machine NIC\n+that includes NSX-T opeque switch\n+\n+\"\"\"\n+\n+import atexit\n+import ssl\n+\n+from tools import cli\n+from tools import tasks\n+from pyVim import connect\n+from pyVmomi import vim, vmodl\n+\n+\n+def get_obj(content, vimtype, name):\n+    \"\"\"\n+     Get the vsphere object associated with a given text name\n+    \"\"\"\n+    obj = None\n+    container = content.viewManager.CreateContainerView(content.rootFolder,\n+                                                        vimtype, True)\n+    for view in container.view:\n+        if view.name == name:\n+            obj = view\n+            break\n+    return obj\n+\n+\n+def get_args():","path":"samples/nsxt_change_vm_vif.py","position":37,"original_position":37,"commit_id":"163e7503f7a5097139fb7369cd78c09d8c141835","original_commit_id":"163e7503f7a5097139fb7369cd78c09d8c141835","user":{"login":"pgbidkar","id":14221704,"node_id":"MDQ6VXNlcjE0MjIxNzA0","avatar_url":"https://avatars2.githubusercontent.com/u/14221704?v=4","gravatar_id":"","url":"https://api.github.com/users/pgbidkar","html_url":"https://github.com/pgbidkar","followers_url":"https://api.github.com/users/pgbidkar/followers","following_url":"https://api.github.com/users/pgbidkar/following{/other_user}","gists_url":"https://api.github.com/users/pgbidkar/gists{/gist_id}","starred_url":"https://api.github.com/users/pgbidkar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pgbidkar/subscriptions","organizations_url":"https://api.github.com/users/pgbidkar/orgs","repos_url":"https://api.github.com/users/pgbidkar/repos","events_url":"https://api.github.com/users/pgbidkar/events{/privacy}","received_events_url":"https://api.github.com/users/pgbidkar/received_events","type":"User","site_admin":false},"body":"Please move this method above get_obj(), just to make sure to follow Standard sample template followed by all samples ","created_at":"2018-12-04T15:47:47Z","updated_at":"2018-12-04T15:49:55Z","html_url":"https://github.com/vmware/pyvmomi-community-samples/pull/530#discussion_r238718960","pull_request_url":"https://api.github.com/repos/vmware/pyvmomi-community-samples/pulls/530","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/vmware/pyvmomi-community-samples/pulls/comments/238718960"},"html":{"href":"https://github.com/vmware/pyvmomi-community-samples/pull/530#discussion_r238718960"},"pull_request":{"href":"https://api.github.com/repos/vmware/pyvmomi-community-samples/pulls/530"}}},"pull_request":{"url":"https://api.github.com/repos/vmware/pyvmomi-community-samples/pulls/530","id":235771159,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM1NzcxMTU5","html_url":"https://github.com/vmware/pyvmomi-community-samples/pull/530","diff_url":"https://github.com/vmware/pyvmomi-community-samples/pull/530.diff","patch_url":"https://github.com/vmware/pyvmomi-community-samples/pull/530.patch","issue_url":"https://api.github.com/repos/vmware/pyvmomi-community-samples/issues/530","number":530,"state":"open","locked":false,"title":"Add NSX-T opaque switch example","user":{"login":"yasensim","id":18211453,"node_id":"MDQ6VXNlcjE4MjExNDUz","avatar_url":"https://avatars2.githubusercontent.com/u/18211453?v=4","gravatar_id":"","url":"https://api.github.com/users/yasensim","html_url":"https://github.com/yasensim","followers_url":"https://api.github.com/users/yasensim/followers","following_url":"https://api.github.com/users/yasensim/following{/other_user}","gists_url":"https://api.github.com/users/yasensim/gists{/gist_id}","starred_url":"https://api.github.com/users/yasensim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yasensim/subscriptions","organizations_url":"https://api.github.com/users/yasensim/orgs","repos_url":"https://api.github.com/users/yasensim/repos","events_url":"https://api.github.com/users/yasensim/events{/privacy}","received_events_url":"https://api.github.com/users/yasensim/received_events","type":"User","site_admin":false},"body":"This example show how to attach a VM to NSX-T Logical Switch or VDS or VSS","created_at":"2018-12-04T11:20:19Z","updated_at":"2018-12-04T15:49:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3cbcf47e9e1f22e5a908c682c5240b5a7192820d","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/vmware/pyvmomi-community-samples/pulls/530/commits","review_comments_url":"https://api.github.com/repos/vmware/pyvmomi-community-samples/pulls/530/comments","review_comment_url":"https://api.github.com/repos/vmware/pyvmomi-community-samples/pulls/comments{/number}","comments_url":"https://api.github.com/repos/vmware/pyvmomi-community-samples/issues/530/comments","statuses_url":"https://api.github.com/repos/vmware/pyvmomi-community-samples/statuses/163e7503f7a5097139fb7369cd78c09d8c141835","head":{"label":"yasensim:master","ref":"master","sha":"163e7503f7a5097139fb7369cd78c09d8c141835","user":{"login":"yasensim","id":18211453,"node_id":"MDQ6VXNlcjE4MjExNDUz","avatar_url":"https://avatars2.githubusercontent.com/u/18211453?v=4","gravatar_id":"","url":"https://api.github.com/users/yasensim","html_url":"https://github.com/yasensim","followers_url":"https://api.github.com/users/yasensim/followers","following_url":"https://api.github.com/users/yasensim/following{/other_user}","gists_url":"https://api.github.com/users/yasensim/gists{/gist_id}","starred_url":"https://api.github.com/users/yasensim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yasensim/subscriptions","organizations_url":"https://api.github.com/users/yasensim/orgs","repos_url":"https://api.github.com/users/yasensim/repos","events_url":"https://api.github.com/users/yasensim/events{/privacy}","received_events_url":"https://api.github.com/users/yasensim/received_events","type":"User","site_admin":false},"repo":{"id":160344110,"node_id":"MDEwOlJlcG9zaXRvcnkxNjAzNDQxMTA=","name":"pyvmomi-community-samples","full_name":"yasensim/pyvmomi-community-samples","private":false,"owner":{"login":"yasensim","id":18211453,"node_id":"MDQ6VXNlcjE4MjExNDUz","avatar_url":"https://avatars2.githubusercontent.com/u/18211453?v=4","gravatar_id":"","url":"https://api.github.com/users/yasensim","html_url":"https://github.com/yasensim","followers_url":"https://api.github.com/users/yasensim/followers","following_url":"https://api.github.com/users/yasensim/following{/other_user}","gists_url":"https://api.github.com/users/yasensim/gists{/gist_id}","starred_url":"https://api.github.com/users/yasensim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yasensim/subscriptions","organizations_url":"https://api.github.com/users/yasensim/orgs","repos_url":"https://api.github.com/users/yasensim/repos","events_url":"https://api.github.com/users/yasensim/events{/privacy}","received_events_url":"https://api.github.com/users/yasensim/received_events","type":"User","site_admin":false},"html_url":"https://github.com/yasensim/pyvmomi-community-samples","description":"A place for community contributed samples for the pyVmomi library.","fork":true,"url":"https://api.github.com/repos/yasensim/pyvmomi-community-samples","forks_url":"https://api.github.com/repos/yasensim/pyvmomi-community-samples/forks","keys_url":"https://api.github.com/repos/yasensim/pyvmomi-community-samples/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yasensim/pyvmomi-community-samples/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yasensim/pyvmomi-community-samples/teams","hooks_url":"https://api.github.com/repos/yasensim/pyvmomi-community-samples/hooks","issue_events_url":"https://api.github.com/repos/yasensim/pyvmomi-community-samples/issues/events{/number}","events_url":"https://api.github.com/repos/yasensim/pyvmomi-community-samples/events","assignees_url":"https://api.github.com/repos/yasensim/pyvmomi-community-samples/assignees{/user}","branches_url":"https://api.github.com/repos/yasensim/pyvmomi-community-samples/branches{/branch}","tags_url":"https://api.github.com/repos/yasensim/pyvmomi-community-samples/tags","blobs_url":"https://api.github.com/repos/yasensim/pyvmomi-community-samples/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yasensim/pyvmomi-community-samples/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yasensim/pyvmomi-community-samples/git/refs{/sha}","trees_url":"https://api.github.com/repos/yasensim/pyvmomi-community-samples/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yasensim/pyvmomi-community-samples/statuses/{sha}","languages_url":"https://api.github.com/repos/yasensim/pyvmomi-community-samples/languages","stargazers_url":"https://api.github.com/repos/yasensim/pyvmomi-community-samples/stargazers","contributors_url":"https://api.github.com/repos/yasensim/pyvmomi-community-samples/contributors","subscribers_url":"https://api.github.com/repos/yasensim/pyvmomi-community-samples/subscribers","subscription_url":"https://api.github.com/repos/yasensim/pyvmomi-community-samples/subscription","commits_url":"https://api.github.com/repos/yasensim/pyvmomi-community-samples/commits{/sha}","git_commits_url":"https://api.github.com/repos/yasensim/pyvmomi-community-samples/git/commits{/sha}","comments_url":"https://api.github.com/repos/yasensim/pyvmomi-community-samples/comments{/number}","issue_comment_url":"https://api.github.com/repos/yasensim/pyvmomi-community-samples/issues/comments{/number}","contents_url":"https://api.github.com/repos/yasensim/pyvmomi-community-samples/contents/{+path}","compare_url":"https://api.github.com/repos/yasensim/pyvmomi-community-samples/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yasensim/pyvmomi-community-samples/merges","archive_url":"https://api.github.com/repos/yasensim/pyvmomi-community-samples/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yasensim/pyvmomi-community-samples/downloads","issues_url":"https://api.github.com/repos/yasensim/pyvmomi-community-samples/issues{/number}","pulls_url":"https://api.github.com/repos/yasensim/pyvmomi-community-samples/pulls{/number}","milestones_url":"https://api.github.com/repos/yasensim/pyvmomi-community-samples/milestones{/number}","notifications_url":"https://api.github.com/repos/yasensim/pyvmomi-community-samples/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yasensim/pyvmomi-community-samples/labels{/name}","releases_url":"https://api.github.com/repos/yasensim/pyvmomi-community-samples/releases{/id}","deployments_url":"https://api.github.com/repos/yasensim/pyvmomi-community-samples/deployments","created_at":"2018-12-04T11:03:44Z","updated_at":"2018-12-04T11:18:20Z","pushed_at":"2018-12-04T11:18:18Z","git_url":"git://github.com/yasensim/pyvmomi-community-samples.git","ssh_url":"git@github.com:yasensim/pyvmomi-community-samples.git","clone_url":"https://github.com/yasensim/pyvmomi-community-samples.git","svn_url":"https://github.com/yasensim/pyvmomi-community-samples","homepage":null,"size":588,"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":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"vmware:master","ref":"master","sha":"463ae8416c47a14ccab63797e70bfd67a801b921","user":{"login":"vmware","id":473334,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3MzMzNA==","avatar_url":"https://avatars0.githubusercontent.com/u/473334?v=4","gravatar_id":"","url":"https://api.github.com/users/vmware","html_url":"https://github.com/vmware","followers_url":"https://api.github.com/users/vmware/followers","following_url":"https://api.github.com/users/vmware/following{/other_user}","gists_url":"https://api.github.com/users/vmware/gists{/gist_id}","starred_url":"https://api.github.com/users/vmware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vmware/subscriptions","organizations_url":"https://api.github.com/users/vmware/orgs","repos_url":"https://api.github.com/users/vmware/repos","events_url":"https://api.github.com/users/vmware/events{/privacy}","received_events_url":"https://api.github.com/users/vmware/received_events","type":"Organization","site_admin":false},"repo":{"id":19123101,"node_id":"MDEwOlJlcG9zaXRvcnkxOTEyMzEwMQ==","name":"pyvmomi-community-samples","full_name":"vmware/pyvmomi-community-samples","private":false,"owner":{"login":"vmware","id":473334,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3MzMzNA==","avatar_url":"https://avatars0.githubusercontent.com/u/473334?v=4","gravatar_id":"","url":"https://api.github.com/users/vmware","html_url":"https://github.com/vmware","followers_url":"https://api.github.com/users/vmware/followers","following_url":"https://api.github.com/users/vmware/following{/other_user}","gists_url":"https://api.github.com/users/vmware/gists{/gist_id}","starred_url":"https://api.github.com/users/vmware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vmware/subscriptions","organizations_url":"https://api.github.com/users/vmware/orgs","repos_url":"https://api.github.com/users/vmware/repos","events_url":"https://api.github.com/users/vmware/events{/privacy}","received_events_url":"https://api.github.com/users/vmware/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/vmware/pyvmomi-community-samples","description":"A place for community contributed samples for the pyVmomi library.","fork":false,"url":"https://api.github.com/repos/vmware/pyvmomi-community-samples","forks_url":"https://api.github.com/repos/vmware/pyvmomi-community-samples/forks","keys_url":"https://api.github.com/repos/vmware/pyvmomi-community-samples/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vmware/pyvmomi-community-samples/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vmware/pyvmomi-community-samples/teams","hooks_url":"https://api.github.com/repos/vmware/pyvmomi-community-samples/hooks","issue_events_url":"https://api.github.com/repos/vmware/pyvmomi-community-samples/issues/events{/number}","events_url":"https://api.github.com/repos/vmware/pyvmomi-community-samples/events","assignees_url":"https://api.github.com/repos/vmware/pyvmomi-community-samples/assignees{/user}","branches_url":"https://api.github.com/repos/vmware/pyvmomi-community-samples/branches{/branch}","tags_url":"https://api.github.com/repos/vmware/pyvmomi-community-samples/tags","blobs_url":"https://api.github.com/repos/vmware/pyvmomi-community-samples/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vmware/pyvmomi-community-samples/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vmware/pyvmomi-community-samples/git/refs{/sha}","trees_url":"https://api.github.com/repos/vmware/pyvmomi-community-samples/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vmware/pyvmomi-community-samples/statuses/{sha}","languages_url":"https://api.github.com/repos/vmware/pyvmomi-community-samples/languages","stargazers_url":"https://api.github.com/repos/vmware/pyvmomi-community-samples/stargazers","contributors_url":"https://api.github.com/repos/vmware/pyvmomi-community-samples/contributors","subscribers_url":"https://api.github.com/repos/vmware/pyvmomi-community-samples/subscribers","subscription_url":"https://api.github.com/repos/vmware/pyvmomi-community-samples/subscription","commits_url":"https://api.github.com/repos/vmware/pyvmomi-community-samples/commits{/sha}","git_commits_url":"https://api.github.com/repos/vmware/pyvmomi-community-samples/git/commits{/sha}","comments_url":"https://api.github.com/repos/vmware/pyvmomi-community-samples/comments{/number}","issue_comment_url":"https://api.github.com/repos/vmware/pyvmomi-community-samples/issues/comments{/number}","contents_url":"https://api.github.com/repos/vmware/pyvmomi-community-samples/contents/{+path}","compare_url":"https://api.github.com/repos/vmware/pyvmomi-community-samples/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vmware/pyvmomi-community-samples/merges","archive_url":"https://api.github.com/repos/vmware/pyvmomi-community-samples/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vmware/pyvmomi-community-samples/downloads","issues_url":"https://api.github.com/repos/vmware/pyvmomi-community-samples/issues{/number}","pulls_url":"https://api.github.com/repos/vmware/pyvmomi-community-samples/pulls{/number}","milestones_url":"https://api.github.com/repos/vmware/pyvmomi-community-samples/milestones{/number}","notifications_url":"https://api.github.com/repos/vmware/pyvmomi-community-samples/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vmware/pyvmomi-community-samples/labels{/name}","releases_url":"https://api.github.com/repos/vmware/pyvmomi-community-samples/releases{/id}","deployments_url":"https://api.github.com/repos/vmware/pyvmomi-community-samples/deployments","created_at":"2014-04-24T20:31:56Z","updated_at":"2018-12-04T09:57:25Z","pushed_at":"2018-12-04T13:47:54Z","git_url":"git://github.com/vmware/pyvmomi-community-samples.git","ssh_url":"git@github.com:vmware/pyvmomi-community-samples.git","clone_url":"https://github.com/vmware/pyvmomi-community-samples.git","svn_url":"https://github.com/vmware/pyvmomi-community-samples","homepage":null,"size":586,"stargazers_count":522,"watchers_count":522,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":521,"mirror_url":null,"archived":false,"open_issues_count":269,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":521,"open_issues":269,"watchers":522,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/vmware/pyvmomi-community-samples/pulls/530"},"html":{"href":"https://github.com/vmware/pyvmomi-community-samples/pull/530"},"issue":{"href":"https://api.github.com/repos/vmware/pyvmomi-community-samples/issues/530"},"comments":{"href":"https://api.github.com/repos/vmware/pyvmomi-community-samples/issues/530/comments"},"review_comments":{"href":"https://api.github.com/repos/vmware/pyvmomi-community-samples/pulls/530/comments"},"review_comment":{"href":"https://api.github.com/repos/vmware/pyvmomi-community-samples/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/vmware/pyvmomi-community-samples/pulls/530/commits"},"statuses":{"href":"https://api.github.com/repos/vmware/pyvmomi-community-samples/statuses/163e7503f7a5097139fb7369cd78c09d8c141835"}},"author_association":"NONE"}}
{"actor":{"display_login":"pgbidkar"}}