{"action":"created","comment":{"url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/pulls/comments/151496570","pull_request_review_id":77212567,"id":151496570,"diff_hunk":"@@ -0,0 +1,72 @@\n+# Licensed to the StackStorm, Inc ('StackStorm') under one or more\n+# contributor license agreements.  See the NOTICE file distributed with\n+# this work for additional information regarding copyright ownership.\n+# The ASF licenses this file to You under the Apache License, Version 2.0\n+# (the \"License\"); you may not use this file except in compliance with\n+# the License.  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+from datetime import datetime\n+from tzlocal import get_localzone\n+from lib.actions import ZabbixBaseAction\n+\n+\n+class MaintenanceCreateOrUpdate(ZabbixBaseAction):\n+    def run(self,\n+            host=None,\n+            time_type=None,\n+            maintenance_window_name=None,\n+            maintenance_type=None,\n+            start_date=None,\n+            end_date=None):\n+        \"\"\" Creates or updates a Zabbix maintenance window by looking\n+        for the supplied maintenance_window_name and creating the mainenance window if it\n+        does not exist or updating the mainenance window if it already exists.\n+        \"\"\"\n+        self.connect()\n+\n+        zabbix_host = self.find_host(host)\n+\n+        host_id = zabbix_host['hostid']","path":"actions/maintenance_create_or_update.py","position":37,"original_position":37,"commit_id":"04381282e1f44195d82b480f212634ee35e7ba70","original_commit_id":"04381282e1f44195d82b480f212634ee35e7ba70","user":{"login":"nmaludy","id":3693851,"avatar_url":"https://avatars1.githubusercontent.com/u/3693851?v=4","gravatar_id":"","url":"https://api.github.com/users/nmaludy","html_url":"https://github.com/nmaludy","followers_url":"https://api.github.com/users/nmaludy/followers","following_url":"https://api.github.com/users/nmaludy/following{/other_user}","gists_url":"https://api.github.com/users/nmaludy/gists{/gist_id}","starred_url":"https://api.github.com/users/nmaludy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmaludy/subscriptions","organizations_url":"https://api.github.com/users/nmaludy/orgs","repos_url":"https://api.github.com/users/nmaludy/repos","events_url":"https://api.github.com/users/nmaludy/events{/privacy}","received_events_url":"https://api.github.com/users/nmaludy/received_events","type":"User","site_admin":false},"body":"copy/pasted code","created_at":"2017-11-16T18:21:29Z","updated_at":"2017-11-16T18:30:06Z","html_url":"https://github.com/EncoreTechnologies/stackstorm-zabbix/pull/1#discussion_r151496570","pull_request_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/pulls/1","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/pulls/comments/151496570"},"html":{"href":"https://github.com/EncoreTechnologies/stackstorm-zabbix/pull/1#discussion_r151496570"},"pull_request":{"href":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/pulls/1","id":153107640,"html_url":"https://github.com/EncoreTechnologies/stackstorm-zabbix/pull/1","diff_url":"https://github.com/EncoreTechnologies/stackstorm-zabbix/pull/1.diff","patch_url":"https://github.com/EncoreTechnologies/stackstorm-zabbix/pull/1.patch","issue_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/issues/1","number":1,"state":"open","locked":false,"title":"Feature/encore actions","user":{"login":"bishopbm1","id":15911425,"avatar_url":"https://avatars2.githubusercontent.com/u/15911425?v=4","gravatar_id":"","url":"https://api.github.com/users/bishopbm1","html_url":"https://github.com/bishopbm1","followers_url":"https://api.github.com/users/bishopbm1/followers","following_url":"https://api.github.com/users/bishopbm1/following{/other_user}","gists_url":"https://api.github.com/users/bishopbm1/gists{/gist_id}","starred_url":"https://api.github.com/users/bishopbm1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bishopbm1/subscriptions","organizations_url":"https://api.github.com/users/bishopbm1/orgs","repos_url":"https://api.github.com/users/bishopbm1/repos","events_url":"https://api.github.com/users/bishopbm1/events{/privacy}","received_events_url":"https://api.github.com/users/bishopbm1/received_events","type":"User","site_admin":false},"body":"Added base action class with common code. Removed duplicate code from other actions. Added host_get_id action action to return the id of a Zabbix Host. Added host_update_status action to change the status of a Zabbix Host. Added maintenance_create_or_update action to create a maintenance window or update one if it already exists. Added maintenance_delete action to delete a maintenance window. Created new tests for all new actions and methods that were added to base action. Create base test class to inherit from. Updated readme and change log to incorporate new changes. Iterated the pack version.\r\n","created_at":"2017-11-16T17:47:45Z","updated_at":"2017-11-16T18:30:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ba46e772259a255d180dd74efc88e09267384b6b","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/pulls/1/commits","review_comments_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/pulls/1/comments","review_comment_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/pulls/comments{/number}","comments_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/issues/1/comments","statuses_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/statuses/04381282e1f44195d82b480f212634ee35e7ba70","head":{"label":"EncoreTechnologies:feature/encore-actions","ref":"feature/encore-actions","sha":"04381282e1f44195d82b480f212634ee35e7ba70","user":{"login":"EncoreTechnologies","id":25846485,"avatar_url":"https://avatars0.githubusercontent.com/u/25846485?v=4","gravatar_id":"","url":"https://api.github.com/users/EncoreTechnologies","html_url":"https://github.com/EncoreTechnologies","followers_url":"https://api.github.com/users/EncoreTechnologies/followers","following_url":"https://api.github.com/users/EncoreTechnologies/following{/other_user}","gists_url":"https://api.github.com/users/EncoreTechnologies/gists{/gist_id}","starred_url":"https://api.github.com/users/EncoreTechnologies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EncoreTechnologies/subscriptions","organizations_url":"https://api.github.com/users/EncoreTechnologies/orgs","repos_url":"https://api.github.com/users/EncoreTechnologies/repos","events_url":"https://api.github.com/users/EncoreTechnologies/events{/privacy}","received_events_url":"https://api.github.com/users/EncoreTechnologies/received_events","type":"Organization","site_admin":false},"repo":{"id":110263907,"name":"stackstorm-zabbix","full_name":"EncoreTechnologies/stackstorm-zabbix","owner":{"login":"EncoreTechnologies","id":25846485,"avatar_url":"https://avatars0.githubusercontent.com/u/25846485?v=4","gravatar_id":"","url":"https://api.github.com/users/EncoreTechnologies","html_url":"https://github.com/EncoreTechnologies","followers_url":"https://api.github.com/users/EncoreTechnologies/followers","following_url":"https://api.github.com/users/EncoreTechnologies/following{/other_user}","gists_url":"https://api.github.com/users/EncoreTechnologies/gists{/gist_id}","starred_url":"https://api.github.com/users/EncoreTechnologies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EncoreTechnologies/subscriptions","organizations_url":"https://api.github.com/users/EncoreTechnologies/orgs","repos_url":"https://api.github.com/users/EncoreTechnologies/repos","events_url":"https://api.github.com/users/EncoreTechnologies/events{/privacy}","received_events_url":"https://api.github.com/users/EncoreTechnologies/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/EncoreTechnologies/stackstorm-zabbix","description":null,"fork":true,"url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix","forks_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/forks","keys_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/keys{/key_id}","collaborators_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/teams","hooks_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/hooks","issue_events_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/issues/events{/number}","events_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/events","assignees_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/assignees{/user}","branches_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/branches{/branch}","tags_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/tags","blobs_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/git/refs{/sha}","trees_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/git/trees{/sha}","statuses_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/statuses/{sha}","languages_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/languages","stargazers_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/stargazers","contributors_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/contributors","subscribers_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/subscribers","subscription_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/subscription","commits_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/commits{/sha}","git_commits_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/git/commits{/sha}","comments_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/comments{/number}","issue_comment_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/issues/comments{/number}","contents_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/contents/{+path}","compare_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/compare/{base}...{head}","merges_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/merges","archive_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/downloads","issues_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/issues{/number}","pulls_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/pulls{/number}","milestones_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/milestones{/number}","notifications_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/labels{/name}","releases_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/releases{/id}","deployments_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/deployments","created_at":"2017-11-10T15:45:30Z","updated_at":"2017-11-10T15:45:32Z","pushed_at":"2017-11-16T17:47:46Z","git_url":"git://github.com/EncoreTechnologies/stackstorm-zabbix.git","ssh_url":"git@github.com:EncoreTechnologies/stackstorm-zabbix.git","clone_url":"https://github.com/EncoreTechnologies/stackstorm-zabbix.git","svn_url":"https://github.com/EncoreTechnologies/stackstorm-zabbix","homepage":null,"size":75,"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":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"EncoreTechnologies:master","ref":"master","sha":"04af4ab39e3db98907bffea8f85fa0c3b7d964fc","user":{"login":"EncoreTechnologies","id":25846485,"avatar_url":"https://avatars0.githubusercontent.com/u/25846485?v=4","gravatar_id":"","url":"https://api.github.com/users/EncoreTechnologies","html_url":"https://github.com/EncoreTechnologies","followers_url":"https://api.github.com/users/EncoreTechnologies/followers","following_url":"https://api.github.com/users/EncoreTechnologies/following{/other_user}","gists_url":"https://api.github.com/users/EncoreTechnologies/gists{/gist_id}","starred_url":"https://api.github.com/users/EncoreTechnologies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EncoreTechnologies/subscriptions","organizations_url":"https://api.github.com/users/EncoreTechnologies/orgs","repos_url":"https://api.github.com/users/EncoreTechnologies/repos","events_url":"https://api.github.com/users/EncoreTechnologies/events{/privacy}","received_events_url":"https://api.github.com/users/EncoreTechnologies/received_events","type":"Organization","site_admin":false},"repo":{"id":110263907,"name":"stackstorm-zabbix","full_name":"EncoreTechnologies/stackstorm-zabbix","owner":{"login":"EncoreTechnologies","id":25846485,"avatar_url":"https://avatars0.githubusercontent.com/u/25846485?v=4","gravatar_id":"","url":"https://api.github.com/users/EncoreTechnologies","html_url":"https://github.com/EncoreTechnologies","followers_url":"https://api.github.com/users/EncoreTechnologies/followers","following_url":"https://api.github.com/users/EncoreTechnologies/following{/other_user}","gists_url":"https://api.github.com/users/EncoreTechnologies/gists{/gist_id}","starred_url":"https://api.github.com/users/EncoreTechnologies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EncoreTechnologies/subscriptions","organizations_url":"https://api.github.com/users/EncoreTechnologies/orgs","repos_url":"https://api.github.com/users/EncoreTechnologies/repos","events_url":"https://api.github.com/users/EncoreTechnologies/events{/privacy}","received_events_url":"https://api.github.com/users/EncoreTechnologies/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/EncoreTechnologies/stackstorm-zabbix","description":null,"fork":true,"url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix","forks_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/forks","keys_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/keys{/key_id}","collaborators_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/teams","hooks_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/hooks","issue_events_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/issues/events{/number}","events_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/events","assignees_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/assignees{/user}","branches_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/branches{/branch}","tags_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/tags","blobs_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/git/refs{/sha}","trees_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/git/trees{/sha}","statuses_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/statuses/{sha}","languages_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/languages","stargazers_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/stargazers","contributors_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/contributors","subscribers_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/subscribers","subscription_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/subscription","commits_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/commits{/sha}","git_commits_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/git/commits{/sha}","comments_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/comments{/number}","issue_comment_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/issues/comments{/number}","contents_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/contents/{+path}","compare_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/compare/{base}...{head}","merges_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/merges","archive_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/downloads","issues_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/issues{/number}","pulls_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/pulls{/number}","milestones_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/milestones{/number}","notifications_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/labels{/name}","releases_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/releases{/id}","deployments_url":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/deployments","created_at":"2017-11-10T15:45:30Z","updated_at":"2017-11-10T15:45:32Z","pushed_at":"2017-11-16T17:47:46Z","git_url":"git://github.com/EncoreTechnologies/stackstorm-zabbix.git","ssh_url":"git@github.com:EncoreTechnologies/stackstorm-zabbix.git","clone_url":"https://github.com/EncoreTechnologies/stackstorm-zabbix.git","svn_url":"https://github.com/EncoreTechnologies/stackstorm-zabbix","homepage":null,"size":75,"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":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/pulls/1"},"html":{"href":"https://github.com/EncoreTechnologies/stackstorm-zabbix/pull/1"},"issue":{"href":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/issues/1"},"comments":{"href":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/EncoreTechnologies/stackstorm-zabbix/statuses/04381282e1f44195d82b480f212634ee35e7ba70"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"nmaludy"}}