{"action":"created","comment":{"url":"https://api.github.com/repos/favoretti/nsnitro/pulls/comments/41619596","id":41619596,"diff_hunk":"@@ -0,0 +1,249 @@\n+# encoding: utf-8\n+from nsbaseresource import NSBaseResource\n+\n+\n+class NSGSLBVServer(NSBaseResource):\n+\n+    # Configuration for Content Switching Virtual Server resource.\n+\n+    def __init__(self, json_data=None):\n+        \"\"\"\n+        Supplied with json_data the object can be pre-filled\n+        \"\"\"\n+        super(NSGSLBVServer, self).__init__()\n+\n+        self.options = {'name': '',\n+                        'servicetype': '',\n+                        'iptype': '',\n+                        'dnsrecordtype': '',\n+                        'lbmethod': '',\n+                        'backupsessiontimeout': '',\n+                        'backuplbmethod': '',\n+                        'netmask': '',\n+                        'v6netmasklen': '',\n+                        'tolerance': '',\n+                        'persistencetype': '',\n+                        'persistenceid': '',\n+                        'persistmask': '',\n+                        'v6persistmasklen': '',\n+                        'timeout': '',\n+                        'edr': '',\n+                        'mir': '',\n+                        'disableprimaryondown': '',\n+                        'dynamicweight': '',\n+                        'state': '',\n+                        'considereffectivestate': '',\n+                        'comment': '',\n+                        'somethod': '',\n+                        'sopersistence': '',\n+                        'sopersistencetimeout': '',\n+                        'sothreshold': '',\n+                        'sobackupaction': '',\n+                        'appflowlog': '',\n+                        'backupvserver': '',\n+                        'servicename': '',\n+                        'weight': '',\n+                        'domainname': '',\n+                        'ttl': '',\n+                        'backupip': '',\n+                        'cookie_domain': '',\n+                        'cookietimeout': '',\n+                        'sitedomainttl': '',\n+                        'newname': '',\n+\n+                        # read only properties\n+                        'curstate': '',\n+                        'status': '',\n+                        'lbrrreason': '',\n+                        'iscname': '',\n+                        'totalservices': '',\n+                        'activeservices': '',\n+                        'statechangetimesec': '',\n+                        'statechangetimemsec': '',\n+                        'tickssincelaststatechange': '',\n+                        'health': '',\n+                        'policyname': '',\n+                        'priority': '',\n+                        'gotopriorityexpression': '',\n+                        'type': ''}\n+\n+        self.resourcetype = NSGSLBVServer.get_resourcetype()\n+\n+        if not (json_data is None):\n+            for key in json_data.keys():\n+                if key in self.options.keys():\n+                    self.options[key] = json_data[key]\n+\n+    @staticmethod\n+    def get_resourcetype():\n+        return \"gslbvserver\"\n+\n+    def set_name(self, name):\n+        \"\"\"\n+        The gslb virtual name\n+        \"\"\"\n+        self.options['name'] = name\n+\n+    def get_name(self):\n+        \"\"\"\n+        \"\"\"\n+        return self.options['name']\n+\n+    def set_lbmethod(self, lbmethod):\n+        \"\"\"\n+        The gslb virtual name\n+        \"\"\"\n+        self.options['lbmethod'] = lbmethod\n+\n+    def get_lbmethod(self):\n+        \"\"\"\n+        \"\"\"\n+        return self.options['lbmethod']\n+\n+    def set_weight(self, weight):\n+        \"\"\"\n+        The gslb virtual name\n+        \"\"\"\n+        self.options['weight'] = weight\n+\n+    def get_weight(self):\n+        \"\"\"\n+        \"\"\"\n+        return self.options['weight']\n+\n+    def set_servicename(self, servicename):\n+        \"\"\"\n+        The gslb virtual name\n+        \"\"\"\n+        self.options['servicename'] = servicename\n+\n+    def get_servicename(self):\n+        \"\"\"\n+        \"\"\"\n+        return self.options['servicename']\n+\n+    # Operations methods\n+    '''\n+    @staticmethod\n+    def disable(nitro, csvserver):\n+        \"\"\"\n+        Use this API to disable csvserver.\n+        \"\"\"\n+        __csvserver = NSCSVServer()\n+        __csvserver.set_name(csvserver.get_name())\n+        return __csvserver.perform_operation(nitro, \"disable\")\n+\n+    @staticmethod\n+    def enable(nitro, csvserver):\n+        \"\"\"\n+        Use this API to enable csvserver.\n+        \"\"\"\n+        __csvserver = NSCSVServer()\n+        __csvserver.set_name(csvserver.get_name())\n+        return __csvserver.perform_operation(nitro, \"enable\")\n+\n+    @staticmethod\n+    def rename(nitro, csvserver):\n+        \"\"\"\n+        Use this API to rename csvserver.\n+        \"\"\"\n+        __csvserver = NSCSVServer()\n+        __csvserver.set_name(csvserver.get_name())\n+        __csvserver.set_newname(csvserver.get_newname())\n+        return __csvserver.perform_operation(nitro, \"rename\")\n+\n+    @staticmethod\n+    '''\n+    def get(nitro, gslbvserver):\n+        \"\"\"\n+        Use this API to fetch gslbvserver resource of given name.\n+        \"\"\"\n+        __gslbvserver = NSGSLBVServer()\n+        __gslbvserver.set_name(gslbvserver.get_name())\n+        __gslbvserver.get_resource(nitro)\n+        return __gslbvserver\n+\n+    @staticmethod\n+    def get_all(nitro):\n+        \"\"\"\n+        Use this API to fetch all configured gslbvserver resources.\n+        \"\"\"\n+        __url = nitro.get_url() + NSGSLBVServer.get_resourcetype()\n+        __json_gslbvservers = nitro.get(__url).get_response_field(NSGSLBVServer.get_resourcetype())\n+        __gslbvservers = []\n+        for json_gslbvserver in __json_gslbvservers:\n+            __gslbvservers.append(NSGSLBVServer(json_gslbvserver))\n+        return __gslbvservers\n+\n+    @staticmethod\n+    def update(nitro, gslbvs):\n+        \"\"\"\n+        Use this API to update csvserver of a given name.\n+        \"\"\"\n+        __gslbvs = NSGSLBVServer()\n+        __gslbvs.set_name(gslbvs.get_name())\n+        __gslbvs.set_servicename(gslbvs.get_servicename())\n+        __gslbvs.set_weight(gslbvs.get_weight())\n+\n+        return __gslbvs.update_resource(nitro)\n+\n+    '''","path":"nsnitro/nsresources/nsgslbvserver.py","position":190,"original_position":190,"commit_id":"f9e0327c9a6a430b9a57f1f225d78d9f1b63412c","original_commit_id":"f9e0327c9a6a430b9a57f1f225d78d9f1b63412c","user":{"login":"favoretti","id":805046,"avatar_url":"https://avatars.githubusercontent.com/u/805046?v=3","gravatar_id":"","url":"https://api.github.com/users/favoretti","html_url":"https://github.com/favoretti","followers_url":"https://api.github.com/users/favoretti/followers","following_url":"https://api.github.com/users/favoretti/following{/other_user}","gists_url":"https://api.github.com/users/favoretti/gists{/gist_id}","starred_url":"https://api.github.com/users/favoretti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/favoretti/subscriptions","organizations_url":"https://api.github.com/users/favoretti/orgs","repos_url":"https://api.github.com/users/favoretti/repos","events_url":"https://api.github.com/users/favoretti/events{/privacy}","received_events_url":"https://api.github.com/users/favoretti/received_events","type":"User","site_admin":false},"body":"Same here.","created_at":"2015-10-09T11:10:24Z","updated_at":"2015-10-09T11:10:24Z","html_url":"https://github.com/favoretti/nsnitro/pull/98#discussion_r41619596","pull_request_url":"https://api.github.com/repos/favoretti/nsnitro/pulls/98","_links":{"self":{"href":"https://api.github.com/repos/favoretti/nsnitro/pulls/comments/41619596"},"html":{"href":"https://github.com/favoretti/nsnitro/pull/98#discussion_r41619596"},"pull_request":{"href":"https://api.github.com/repos/favoretti/nsnitro/pulls/98"}}},"pull_request":{"url":"https://api.github.com/repos/favoretti/nsnitro/pulls/98","id":47254119,"html_url":"https://github.com/favoretti/nsnitro/pull/98","diff_url":"https://github.com/favoretti/nsnitro/pull/98.diff","patch_url":"https://github.com/favoretti/nsnitro/pull/98.patch","issue_url":"https://api.github.com/repos/favoretti/nsnitro/issues/98","number":98,"state":"open","locked":false,"title":"add some functions","user":{"login":"Mark3K","id":7249827,"avatar_url":"https://avatars.githubusercontent.com/u/7249827?v=3","gravatar_id":"","url":"https://api.github.com/users/Mark3K","html_url":"https://github.com/Mark3K","followers_url":"https://api.github.com/users/Mark3K/followers","following_url":"https://api.github.com/users/Mark3K/following{/other_user}","gists_url":"https://api.github.com/users/Mark3K/gists{/gist_id}","starred_url":"https://api.github.com/users/Mark3K/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mark3K/subscriptions","organizations_url":"https://api.github.com/users/Mark3K/orgs","repos_url":"https://api.github.com/users/Mark3K/repos","events_url":"https://api.github.com/users/Mark3K/events{/privacy}","received_events_url":"https://api.github.com/users/Mark3K/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-10-09T10:03:24Z","updated_at":"2015-10-09T11:10:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"11e7f152472bf7df9cb9bd5f1f8805cf08d7d4ee","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/favoretti/nsnitro/pulls/98/commits","review_comments_url":"https://api.github.com/repos/favoretti/nsnitro/pulls/98/comments","review_comment_url":"https://api.github.com/repos/favoretti/nsnitro/pulls/comments{/number}","comments_url":"https://api.github.com/repos/favoretti/nsnitro/issues/98/comments","statuses_url":"https://api.github.com/repos/favoretti/nsnitro/statuses/f9e0327c9a6a430b9a57f1f225d78d9f1b63412c","head":{"label":"Mark3K:master","ref":"master","sha":"f9e0327c9a6a430b9a57f1f225d78d9f1b63412c","user":{"login":"Mark3K","id":7249827,"avatar_url":"https://avatars.githubusercontent.com/u/7249827?v=3","gravatar_id":"","url":"https://api.github.com/users/Mark3K","html_url":"https://github.com/Mark3K","followers_url":"https://api.github.com/users/Mark3K/followers","following_url":"https://api.github.com/users/Mark3K/following{/other_user}","gists_url":"https://api.github.com/users/Mark3K/gists{/gist_id}","starred_url":"https://api.github.com/users/Mark3K/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mark3K/subscriptions","organizations_url":"https://api.github.com/users/Mark3K/orgs","repos_url":"https://api.github.com/users/Mark3K/repos","events_url":"https://api.github.com/users/Mark3K/events{/privacy}","received_events_url":"https://api.github.com/users/Mark3K/received_events","type":"User","site_admin":false},"repo":{"id":18910420,"name":"nsnitro","full_name":"Mark3K/nsnitro","owner":{"login":"Mark3K","id":7249827,"avatar_url":"https://avatars.githubusercontent.com/u/7249827?v=3","gravatar_id":"","url":"https://api.github.com/users/Mark3K","html_url":"https://github.com/Mark3K","followers_url":"https://api.github.com/users/Mark3K/followers","following_url":"https://api.github.com/users/Mark3K/following{/other_user}","gists_url":"https://api.github.com/users/Mark3K/gists{/gist_id}","starred_url":"https://api.github.com/users/Mark3K/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mark3K/subscriptions","organizations_url":"https://api.github.com/users/Mark3K/orgs","repos_url":"https://api.github.com/users/Mark3K/repos","events_url":"https://api.github.com/users/Mark3K/events{/privacy}","received_events_url":"https://api.github.com/users/Mark3K/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Mark3K/nsnitro","description":"Citrix Netscaler 9.2+ Python Library (NITRO API)","fork":true,"url":"https://api.github.com/repos/Mark3K/nsnitro","forks_url":"https://api.github.com/repos/Mark3K/nsnitro/forks","keys_url":"https://api.github.com/repos/Mark3K/nsnitro/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Mark3K/nsnitro/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Mark3K/nsnitro/teams","hooks_url":"https://api.github.com/repos/Mark3K/nsnitro/hooks","issue_events_url":"https://api.github.com/repos/Mark3K/nsnitro/issues/events{/number}","events_url":"https://api.github.com/repos/Mark3K/nsnitro/events","assignees_url":"https://api.github.com/repos/Mark3K/nsnitro/assignees{/user}","branches_url":"https://api.github.com/repos/Mark3K/nsnitro/branches{/branch}","tags_url":"https://api.github.com/repos/Mark3K/nsnitro/tags","blobs_url":"https://api.github.com/repos/Mark3K/nsnitro/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Mark3K/nsnitro/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Mark3K/nsnitro/git/refs{/sha}","trees_url":"https://api.github.com/repos/Mark3K/nsnitro/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Mark3K/nsnitro/statuses/{sha}","languages_url":"https://api.github.com/repos/Mark3K/nsnitro/languages","stargazers_url":"https://api.github.com/repos/Mark3K/nsnitro/stargazers","contributors_url":"https://api.github.com/repos/Mark3K/nsnitro/contributors","subscribers_url":"https://api.github.com/repos/Mark3K/nsnitro/subscribers","subscription_url":"https://api.github.com/repos/Mark3K/nsnitro/subscription","commits_url":"https://api.github.com/repos/Mark3K/nsnitro/commits{/sha}","git_commits_url":"https://api.github.com/repos/Mark3K/nsnitro/git/commits{/sha}","comments_url":"https://api.github.com/repos/Mark3K/nsnitro/comments{/number}","issue_comment_url":"https://api.github.com/repos/Mark3K/nsnitro/issues/comments{/number}","contents_url":"https://api.github.com/repos/Mark3K/nsnitro/contents/{+path}","compare_url":"https://api.github.com/repos/Mark3K/nsnitro/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Mark3K/nsnitro/merges","archive_url":"https://api.github.com/repos/Mark3K/nsnitro/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Mark3K/nsnitro/downloads","issues_url":"https://api.github.com/repos/Mark3K/nsnitro/issues{/number}","pulls_url":"https://api.github.com/repos/Mark3K/nsnitro/pulls{/number}","milestones_url":"https://api.github.com/repos/Mark3K/nsnitro/milestones{/number}","notifications_url":"https://api.github.com/repos/Mark3K/nsnitro/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Mark3K/nsnitro/labels{/name}","releases_url":"https://api.github.com/repos/Mark3K/nsnitro/releases{/id}","created_at":"2014-04-18T10:44:12Z","updated_at":"2015-10-09T10:02:03Z","pushed_at":"2015-10-09T10:25:58Z","git_url":"git://github.com/Mark3K/nsnitro.git","ssh_url":"git@github.com:Mark3K/nsnitro.git","clone_url":"https://github.com/Mark3K/nsnitro.git","svn_url":"https://github.com/Mark3K/nsnitro","homepage":"","size":1604,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"favoretti:master","ref":"master","sha":"6c2a683c3212591f21436793402c948a08e6f875","user":{"login":"favoretti","id":805046,"avatar_url":"https://avatars.githubusercontent.com/u/805046?v=3","gravatar_id":"","url":"https://api.github.com/users/favoretti","html_url":"https://github.com/favoretti","followers_url":"https://api.github.com/users/favoretti/followers","following_url":"https://api.github.com/users/favoretti/following{/other_user}","gists_url":"https://api.github.com/users/favoretti/gists{/gist_id}","starred_url":"https://api.github.com/users/favoretti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/favoretti/subscriptions","organizations_url":"https://api.github.com/users/favoretti/orgs","repos_url":"https://api.github.com/users/favoretti/repos","events_url":"https://api.github.com/users/favoretti/events{/privacy}","received_events_url":"https://api.github.com/users/favoretti/received_events","type":"User","site_admin":false},"repo":{"id":2738027,"name":"nsnitro","full_name":"favoretti/nsnitro","owner":{"login":"favoretti","id":805046,"avatar_url":"https://avatars.githubusercontent.com/u/805046?v=3","gravatar_id":"","url":"https://api.github.com/users/favoretti","html_url":"https://github.com/favoretti","followers_url":"https://api.github.com/users/favoretti/followers","following_url":"https://api.github.com/users/favoretti/following{/other_user}","gists_url":"https://api.github.com/users/favoretti/gists{/gist_id}","starred_url":"https://api.github.com/users/favoretti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/favoretti/subscriptions","organizations_url":"https://api.github.com/users/favoretti/orgs","repos_url":"https://api.github.com/users/favoretti/repos","events_url":"https://api.github.com/users/favoretti/events{/privacy}","received_events_url":"https://api.github.com/users/favoretti/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/favoretti/nsnitro","description":"Citrix Netscaler 9.2+ Python Library (NITRO API)","fork":false,"url":"https://api.github.com/repos/favoretti/nsnitro","forks_url":"https://api.github.com/repos/favoretti/nsnitro/forks","keys_url":"https://api.github.com/repos/favoretti/nsnitro/keys{/key_id}","collaborators_url":"https://api.github.com/repos/favoretti/nsnitro/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/favoretti/nsnitro/teams","hooks_url":"https://api.github.com/repos/favoretti/nsnitro/hooks","issue_events_url":"https://api.github.com/repos/favoretti/nsnitro/issues/events{/number}","events_url":"https://api.github.com/repos/favoretti/nsnitro/events","assignees_url":"https://api.github.com/repos/favoretti/nsnitro/assignees{/user}","branches_url":"https://api.github.com/repos/favoretti/nsnitro/branches{/branch}","tags_url":"https://api.github.com/repos/favoretti/nsnitro/tags","blobs_url":"https://api.github.com/repos/favoretti/nsnitro/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/favoretti/nsnitro/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/favoretti/nsnitro/git/refs{/sha}","trees_url":"https://api.github.com/repos/favoretti/nsnitro/git/trees{/sha}","statuses_url":"https://api.github.com/repos/favoretti/nsnitro/statuses/{sha}","languages_url":"https://api.github.com/repos/favoretti/nsnitro/languages","stargazers_url":"https://api.github.com/repos/favoretti/nsnitro/stargazers","contributors_url":"https://api.github.com/repos/favoretti/nsnitro/contributors","subscribers_url":"https://api.github.com/repos/favoretti/nsnitro/subscribers","subscription_url":"https://api.github.com/repos/favoretti/nsnitro/subscription","commits_url":"https://api.github.com/repos/favoretti/nsnitro/commits{/sha}","git_commits_url":"https://api.github.com/repos/favoretti/nsnitro/git/commits{/sha}","comments_url":"https://api.github.com/repos/favoretti/nsnitro/comments{/number}","issue_comment_url":"https://api.github.com/repos/favoretti/nsnitro/issues/comments{/number}","contents_url":"https://api.github.com/repos/favoretti/nsnitro/contents/{+path}","compare_url":"https://api.github.com/repos/favoretti/nsnitro/compare/{base}...{head}","merges_url":"https://api.github.com/repos/favoretti/nsnitro/merges","archive_url":"https://api.github.com/repos/favoretti/nsnitro/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/favoretti/nsnitro/downloads","issues_url":"https://api.github.com/repos/favoretti/nsnitro/issues{/number}","pulls_url":"https://api.github.com/repos/favoretti/nsnitro/pulls{/number}","milestones_url":"https://api.github.com/repos/favoretti/nsnitro/milestones{/number}","notifications_url":"https://api.github.com/repos/favoretti/nsnitro/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/favoretti/nsnitro/labels{/name}","releases_url":"https://api.github.com/repos/favoretti/nsnitro/releases{/id}","created_at":"2011-11-08T23:20:32Z","updated_at":"2015-08-11T20:53:50Z","pushed_at":"2015-10-09T10:25:58Z","git_url":"git://github.com/favoretti/nsnitro.git","ssh_url":"git@github.com:favoretti/nsnitro.git","clone_url":"https://github.com/favoretti/nsnitro.git","svn_url":"https://github.com/favoretti/nsnitro","homepage":"","size":1307,"stargazers_count":33,"watchers_count":33,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":38,"mirror_url":null,"open_issues_count":4,"forks":38,"open_issues":4,"watchers":33,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/favoretti/nsnitro/pulls/98"},"html":{"href":"https://github.com/favoretti/nsnitro/pull/98"},"issue":{"href":"https://api.github.com/repos/favoretti/nsnitro/issues/98"},"comments":{"href":"https://api.github.com/repos/favoretti/nsnitro/issues/98/comments"},"review_comments":{"href":"https://api.github.com/repos/favoretti/nsnitro/pulls/98/comments"},"review_comment":{"href":"https://api.github.com/repos/favoretti/nsnitro/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/favoretti/nsnitro/pulls/98/commits"},"statuses":{"href":"https://api.github.com/repos/favoretti/nsnitro/statuses/f9e0327c9a6a430b9a57f1f225d78d9f1b63412c"}}}}