GitHub PullRequestEvent at 2014-06-30 13:10:20
Repository: ansible
Actor: smashwilson
Payload: {"action":"opened","number":7987,"pull_request":{"url":"https://api.github.com/repos/ansible/ansible/pulls/7987","id":17772025,"html_url":"https://github.com/ansible/ansible/pull/7987","diff_url":"https://github.com/ansible/ansible/pull/7987.diff","patch_url":"https://github.com/ansible/ansible/pull/7987.patch","issue_url":"https://api.github.com/repos/ansible/ansible/issues/7987","number":7987,"state":"open","title":"Rackspace Cloud Monitoring modules","user":{"login":"smashwilson","id":17565,"avatar_url":"https://avatars.githubusercontent.com/u/17565?","gravatar_id":"9c5da6e05ae65fbd295344270feba072","url":"https://api.github.com/users/smashwilson","html_url":"https://github.com/smashwilson","followers_url":"https://api.github.com/users/smashwilson/followers","following_url":"https://api.github.com/users/smashwilson/following{/other_user}","gists_url":"https://api.github.com/users/smashwilson/gists{/gist_id}","starred_url":"https://api.github.com/users/smashwilson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smashwilson/subscriptions","organizations_url":"https://api.github.com/users/smashwilson/orgs","repos_url":"https://api.github.com/users/smashwilson/repos","events_url":"https://api.github.com/users/smashwilson/events{/privacy}","received_events_url":"https://api.github.com/users/smashwilson/received_events","type":"User","site_admin":false},"body":"This family of modules enables full management of a Rackspace Cloud Monitoring setup. Each module is idempotent, keying off of `label`: existing models will be updated with changed attributes if possible, or deleted and re-created otherwise.\r\n\r\nHere's what a full playbook that configures monitoring for a site looks like:\r\n\r\n```yaml\r\n---\r\n- name: Configure Cloud Monitoring\r\n  hosts: local\r\n  connection: local\r\n  gather_facts: false\r\n  vars:\r\n    monitoring_zones:\r\n    - mzdfw\r\n    - mziad\r\n    - mzord\r\n  tasks:\r\n\r\n  - name: Create a monitoring entity for the site to monitor.\r\n    rax_mon_entity:\r\n      credentials: ~/.rackspace_cloud_credentials\r\n      state: present\r\n      name: my_site\r\n      named_ip_addresses:\r\n        frontend: \"{{ frontend_ip }}\"\r\n    register: the_entity\r\n\r\n  - name: Fetch the frontpage.\r\n    rax_mon_check:\r\n      credentials: ~/.rackspace_cloud_credentials\r\n      state: present\r\n      entity_id: \"{{ the_entity['entity']['id'] }}\"\r\n      label: frontpage_check\r\n      check_type: remote.http\r\n      details:\r\n        url: http://{{ frontend_fqdn }}/\r\n        method: GET\r\n      monitoring_zones_poll: \"{{ monitoring_zones }}\"\r\n      target_alias: frontend\r\n    register: frontpage_check\r\n\r\n  - name: Email notification.\r\n    rax_mon_notification:\r\n      credentials: ~/.rackspace_cloud_credentials\r\n      state: present\r\n      label: who_ya_gonna_call\r\n      notification_type: email\r\n      details:\r\n        address: \"{{ opsfloor_email }}\"\r\n    register: email_notification\r\n\r\n  - name: Create a notification plan.\r\n    rax_mon_notification_plan:\r\n      credentials: ~/.rackspace_cloud_credentials\r\n      state: present\r\n      label: escalation_station\r\n      ok_state:\r\n      - \"{{ email_notification['notification']['id'] }}\"\r\n      warning_state:\r\n      - \"{{ email_notification['notification']['id'] }}\"\r\n      critical_state:\r\n      - \"{{ email_notification['notification']['id'] }}\"\r\n    register: escalation_station\r\n\r\n  - name: Trigger an alarm when the site errors out.\r\n    rax_mon_alarm:\r\n      credentials: ~/.rackspace_cloud_credentials\r\n      state: present\r\n      label: frontpage_alarm\r\n      entity_id: \"{{ the_entity['entity']['id'] }}\"\r\n      check_id: \"{{ frontpage_check['check']['id'] }}\"\r\n      notification_plan_id: \"{{ escalation_station['notification_plan']['id'] }}\"\r\n      criteria: >\r\n        if (metric['code'] != \"200\") {\r\n          return new AlarmStatus(CRITICAL, \"Non-200 status code #{code} returned.\");\r\n        }\r\n        if (metric['duration'] > 500) {\r\n          return new AlarmStatus(WARNING, \"Page render took #{duration}ms > 500ms.\");\r\n        }\r\n        return new AlarmStatus(OK);\r\n```\r\n\r\n/cc @sivel, @claco","created_at":"2014-06-30T13:10:19Z","updated_at":"2014-06-30T13:10:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ansible/ansible/pulls/7987/commits","review_comments_url":"https://api.github.com/repos/ansible/ansible/pulls/7987/comments","review_comment_url":"https://api.github.com/repos/ansible/ansible/pulls/comments/{number}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/7987/comments","statuses_url":"https://api.github.com/repos/ansible/ansible/statuses/19a27084152a131fb93f237c8ad9c854668af873","head":{"label":"smashwilson:rax_mon","ref":"rax_mon","sha":"19a27084152a131fb93f237c8ad9c854668af873","user":{"login":"smashwilson","id":17565,"avatar_url":"https://avatars.githubusercontent.com/u/17565?","gravatar_id":"9c5da6e05ae65fbd295344270feba072","url":"https://api.github.com/users/smashwilson","html_url":"https://github.com/smashwilson","followers_url":"https://api.github.com/users/smashwilson/followers","following_url":"https://api.github.com/users/smashwilson/following{/other_user}","gists_url":"https://api.github.com/users/smashwilson/gists{/gist_id}","starred_url":"https://api.github.com/users/smashwilson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smashwilson/subscriptions","organizations_url":"https://api.github.com/users/smashwilson/orgs","repos_url":"https://api.github.com/users/smashwilson/repos","events_url":"https://api.github.com/users/smashwilson/events{/privacy}","received_events_url":"https://api.github.com/users/smashwilson/received_events","type":"User","site_admin":false},"repo":{"id":21255468,"name":"ansible","full_name":"smashwilson/ansible","owner":{"login":"smashwilson","id":17565,"avatar_url":"https://avatars.githubusercontent.com/u/17565?","gravatar_id":"9c5da6e05ae65fbd295344270feba072","url":"https://api.github.com/users/smashwilson","html_url":"https://github.com/smashwilson","followers_url":"https://api.github.com/users/smashwilson/followers","following_url":"https://api.github.com/users/smashwilson/following{/other_user}","gists_url":"https://api.github.com/users/smashwilson/gists{/gist_id}","starred_url":"https://api.github.com/users/smashwilson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smashwilson/subscriptions","organizations_url":"https://api.github.com/users/smashwilson/orgs","repos_url":"https://api.github.com/users/smashwilson/repos","events_url":"https://api.github.com/users/smashwilson/events{/privacy}","received_events_url":"https://api.github.com/users/smashwilson/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/smashwilson/ansible","description":"Ansible is a radically simple IT automation platform that makes your applications and systems easier to deploy. Avoid writing scripts or custom code to deploy and update your applications— automate in a language that approaches plain English, using SSH, with no agents to install on remote systems.","fork":true,"url":"https://api.github.com/repos/smashwilson/ansible","forks_url":"https://api.github.com/repos/smashwilson/ansible/forks","keys_url":"https://api.github.com/repos/smashwilson/ansible/keys{/key_id}","collaborators_url":"https://api.github.com/repos/smashwilson/ansible/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/smashwilson/ansible/teams","hooks_url":"https://api.github.com/repos/smashwilson/ansible/hooks","issue_events_url":"https://api.github.com/repos/smashwilson/ansible/issues/events{/number}","events_url":"https://api.github.com/repos/smashwilson/ansible/events","assignees_url":"https://api.github.com/repos/smashwilson/ansible/assignees{/user}","branches_url":"https://api.github.com/repos/smashwilson/ansible/branches{/branch}","tags_url":"https://api.github.com/repos/smashwilson/ansible/tags","blobs_url":"https://api.github.com/repos/smashwilson/ansible/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/smashwilson/ansible/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/smashwilson/ansible/git/refs{/sha}","trees_url":"https://api.github.com/repos/smashwilson/ansible/git/trees{/sha}","statuses_url":"https://api.github.com/repos/smashwilson/ansible/statuses/{sha}","languages_url":"https://api.github.com/repos/smashwilson/ansible/languages","stargazers_url":"https://api.github.com/repos/smashwilson/ansible/stargazers","contributors_url":"https://api.github.com/repos/smashwilson/ansible/contributors","subscribers_url":"https://api.github.com/repos/smashwilson/ansible/subscribers","subscription_url":"https://api.github.com/repos/smashwilson/ansible/subscription","commits_url":"https://api.github.com/repos/smashwilson/ansible/commits{/sha}","git_commits_url":"https://api.github.com/repos/smashwilson/ansible/git/commits{/sha}","comments_url":"https://api.github.com/repos/smashwilson/ansible/comments{/number}","issue_comment_url":"https://api.github.com/repos/smashwilson/ansible/issues/comments/{number}","contents_url":"https://api.github.com/repos/smashwilson/ansible/contents/{+path}","compare_url":"https://api.github.com/repos/smashwilson/ansible/compare/{base}...{head}","merges_url":"https://api.github.com/repos/smashwilson/ansible/merges","archive_url":"https://api.github.com/repos/smashwilson/ansible/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/smashwilson/ansible/downloads","issues_url":"https://api.github.com/repos/smashwilson/ansible/issues{/number}","pulls_url":"https://api.github.com/repos/smashwilson/ansible/pulls{/number}","milestones_url":"https://api.github.com/repos/smashwilson/ansible/milestones{/number}","notifications_url":"https://api.github.com/repos/smashwilson/ansible/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/smashwilson/ansible/labels{/name}","releases_url":"https://api.github.com/repos/smashwilson/ansible/releases{/id}","created_at":"2014-06-26T21:22:17Z","updated_at":"2014-06-26T19:10:35Z","pushed_at":"2014-06-30T12:57:39Z","git_url":"git://github.com/smashwilson/ansible.git","ssh_url":"git@github.com:smashwilson/ansible.git","clone_url":"https://github.com/smashwilson/ansible.git","svn_url":"https://github.com/smashwilson/ansible","homepage":"http://ansible.com/","size":19546,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"devel"}},"base":{"label":"ansible:devel","ref":"devel","sha":"14cf3c4d2a2444a24c3329e6ed3c280e8e8ab904","user":{"login":"ansible","id":1507452,"avatar_url":"https://avatars.githubusercontent.com/u/1507452?","gravatar_id":"f9759b728f6026571043dc66cd36edf2","url":"https://api.github.com/users/ansible","html_url":"https://github.com/ansible","followers_url":"https://api.github.com/users/ansible/followers","following_url":"https://api.github.com/users/ansible/following{/other_user}","gists_url":"https://api.github.com/users/ansible/gists{/gist_id}","starred_url":"https://api.github.com/users/ansible/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ansible/subscriptions","organizations_url":"https://api.github.com/users/ansible/orgs","repos_url":"https://api.github.com/users/ansible/repos","events_url":"https://api.github.com/users/ansible/events{/privacy}","received_events_url":"https://api.github.com/users/ansible/received_events","type":"Organization","site_admin":false},"repo":{"id":3638964,"name":"ansible","full_name":"ansible/ansible","owner":{"login":"ansible","id":1507452,"avatar_url":"https://avatars.githubusercontent.com/u/1507452?","gravatar_id":"f9759b728f6026571043dc66cd36edf2","url":"https://api.github.com/users/ansible","html_url":"https://github.com/ansible","followers_url":"https://api.github.com/users/ansible/followers","following_url":"https://api.github.com/users/ansible/following{/other_user}","gists_url":"https://api.github.com/users/ansible/gists{/gist_id}","starred_url":"https://api.github.com/users/ansible/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ansible/subscriptions","organizations_url":"https://api.github.com/users/ansible/orgs","repos_url":"https://api.github.com/users/ansible/repos","events_url":"https://api.github.com/users/ansible/events{/privacy}","received_events_url":"https://api.github.com/users/ansible/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ansible/ansible","description":"Ansible is a radically simple IT automation platform that makes your applications and systems easier to deploy. Avoid writing scripts or custom code to deploy and update your applications— automate in a language that approaches plain English, using SSH, with no agents to install on remote systems.","fork":false,"url":"https://api.github.com/repos/ansible/ansible","forks_url":"https://api.github.com/repos/ansible/ansible/forks","keys_url":"https://api.github.com/repos/ansible/ansible/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ansible/ansible/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ansible/ansible/teams","hooks_url":"https://api.github.com/repos/ansible/ansible/hooks","issue_events_url":"https://api.github.com/repos/ansible/ansible/issues/events{/number}","events_url":"https://api.github.com/repos/ansible/ansible/events","assignees_url":"https://api.github.com/repos/ansible/ansible/assignees{/user}","branches_url":"https://api.github.com/repos/ansible/ansible/branches{/branch}","tags_url":"https://api.github.com/repos/ansible/ansible/tags","blobs_url":"https://api.github.com/repos/ansible/ansible/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ansible/ansible/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ansible/ansible/git/refs{/sha}","trees_url":"https://api.github.com/repos/ansible/ansible/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ansible/ansible/statuses/{sha}","languages_url":"https://api.github.com/repos/ansible/ansible/languages","stargazers_url":"https://api.github.com/repos/ansible/ansible/stargazers","contributors_url":"https://api.github.com/repos/ansible/ansible/contributors","subscribers_url":"https://api.github.com/repos/ansible/ansible/subscribers","subscription_url":"https://api.github.com/repos/ansible/ansible/subscription","commits_url":"https://api.github.com/repos/ansible/ansible/commits{/sha}","git_commits_url":"https://api.github.com/repos/ansible/ansible/git/commits{/sha}","comments_url":"https://api.github.com/repos/ansible/ansible/comments{/number}","issue_comment_url":"https://api.github.com/repos/ansible/ansible/issues/comments/{number}","contents_url":"https://api.github.com/repos/ansible/ansible/contents/{+path}","compare_url":"https://api.github.com/repos/ansible/ansible/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ansible/ansible/merges","archive_url":"https://api.github.com/repos/ansible/ansible/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ansible/ansible/downloads","issues_url":"https://api.github.com/repos/ansible/ansible/issues{/number}","pulls_url":"https://api.github.com/repos/ansible/ansible/pulls{/number}","milestones_url":"https://api.github.com/repos/ansible/ansible/milestones{/number}","notifications_url":"https://api.github.com/repos/ansible/ansible/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ansible/ansible/labels{/name}","releases_url":"https://api.github.com/repos/ansible/ansible/releases{/id}","created_at":"2012-03-06T14:58:02Z","updated_at":"2014-06-30T12:51:42Z","pushed_at":"2014-06-29T19:32:08Z","git_url":"git://github.com/ansible/ansible.git","ssh_url":"git@github.com:ansible/ansible.git","clone_url":"https://github.com/ansible/ansible.git","svn_url":"https://github.com/ansible/ansible","homepage":"http://ansible.com/","size":131994,"stargazers_count":6542,"watchers_count":6542,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"forks_count":1981,"mirror_url":null,"open_issues_count":669,"forks":1981,"open_issues":669,"watchers":6542,"default_branch":"devel"}},"_links":{"self":{"href":"https://api.github.com/repos/ansible/ansible/pulls/7987"},"html":{"href":"https://github.com/ansible/ansible/pull/7987"},"issue":{"href":"https://api.github.com/repos/ansible/ansible/issues/7987"},"comments":{"href":"https://api.github.com/repos/ansible/ansible/issues/7987/comments"},"review_comments":{"href":"https://api.github.com/repos/ansible/ansible/pulls/7987/comments"},"review_comment":{"href":"https://api.github.com/repos/ansible/ansible/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/ansible/ansible/pulls/7987/commits"},"statuses":{"href":"https://api.github.com/repos/ansible/ansible/statuses/19a27084152a131fb93f237c8ad9c854668af873"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":2,"additions":1150,"deletions":0,"changed_files":5}}