{"action":"created","comment":{"url":"https://api.github.com/repos/ansible/ansible/pulls/comments/99675068","pull_request_review_id":20359064,"id":99675068,"diff_hunk":"@@ -0,0 +1,392 @@\n+#!/usr/bin/python\n+\n+# (c) 2017, NetApp, Inc\n+#\n+# This file is part of Ansible\n+#\n+# Ansible is free software: you can redistribute it and/or modify\n+# it under the terms of the GNU General Public License as published by\n+# the Free Software Foundation, either version 3 of the License, or\n+# (at your option) any later version.\n+#\n+# Ansible is distributed in the hope that it will be useful,\n+# but WITHOUT ANY WARRANTY; without even the implied warranty of\n+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n+# GNU General Public License for more details.\n+#\n+# You should have received a copy of the GNU General Public License\n+# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.\n+#\n+ANSIBLE_METADATA = {'status': ['preview'],\n+                    'supported_by': 'community',\n+                    'version': '1.0'}\n+\n+DOCUMENTATION = '''\n+\n+module: sf_volume_manager\n+\n+short_description: Manage SolidFire volumes\n+extends_documentation_fragment:\n+    - netapp.solidfire\n+version_added: '2.3'\n+author: Sumit Kumar (sumit4@netapp.com)\n+description:\n+- Create, destroy, or update volumes on SolidFire\n+\n+options:\n+\n+    state:\n+        required: true\n+        description:\n+        - Whether the specified volume should exist or not.\n+        choices: ['present', 'absent']\n+\n+    name:\n+        required: true\n+        description:\n+        - The name of the volume to manage\n+\n+    account_id:\n+        required: true\n+        type: int\n+        description:\n+        - account_id for the owner of this volume\n+\n+    new_account_id:\n+        required: false\n+        type: int\n+        description:\n+        - new account_id for the volume\n+        default: None\n+\n+    enable512e:\n+        required: false\n+        type: bool\n+        description:\n+        - Should the volume provide 512-byte sector emulation?\n+        - required when C(state=present)\n+\n+    qos:\n+        required: false\n+        type: QoS object\n+        description: Initial quality of service settings for this volume.\n+        default: None\n+\n+    attributes:\n+        required: false\n+        type: dict\n+        description: List of Name/Value pairs in JSON object format.\n+        default: None\n+\n+    volume_id:\n+        required: false\n+        description:\n+        - The ID of the volume to manage or update.\n+        - In order to create multiple volumes with the same name, but different volume_ids, please declare the volume_id\n+          parameter with an arbitary value. However, the specified volume_id will not be assigned to the newly created\n+          volume (since it's an auto-generated property).\n+        default: None\n+\n+    size:\n+        required: false\n+        description:\n+        - The size of the volume in (size_unit)\n+        - required when C(state = present)\n+\n+    size_unit:\n+        required: false\n+        description:\n+        - The unit used to interpret the size parameter\n+        choices: ['bytes', 'b', 'kb', 'mb', 'gb', 'tb', 'pb', 'eb', 'zb', 'yb']\n+        default: 'gb'\n+\n+    access:\n+        required: false\n+        description:\n+        - Access allowed for the volume\n+        choices: ['readOnly', 'readWrite', 'locked', 'replicationTarget']\n+        access_type_description:\n+        - readOnly: Only read operations are allowed.\n+        - readWrite: Reads and writes are allowed.\n+        - locked: No reads or writes are allowed.\n+        - replicationTarget: Identify a volume as the target volume for a paired set of volumes. If the volume is not paired, the access status is locked.\n+        - If unspecified, the access settings of the clone will be the same as the source.\n+        default: None\n+\n+'''\n+\n+EXAMPLES = \"\"\"\n+   - name: Create Volume\n+     sf_volume_manager:\n+       hostname: \"{{ solidfire_hostname }}\"\n+       username: \"{{ solidfire_username }}\"\n+       password: \"{{ solidfire_password }}\"\n+       state: present\n+       name: AnsibleVol\n+       account_id: 3\n+       enable512e: False\n+       size: 1\n+       size_unit: gb\n+\n+   - name: Update Volume\n+     sf_volume_manager:\n+       hostname: \"{{ solidfire_hostname }}\"\n+       username: \"{{ solidfire_username }}\"\n+       password: \"{{ solidfire_password }}\"\n+       state: present\n+       name: AnsibleVol\n+       account_id: 3\n+       new_account_id: 2\n+       access: readWrite\n+\n+   - name: Delete Volume\n+     sf_volume_manager:\n+       hostname: \"{{ solidfire_hostname }}\"\n+       username: \"{{ solidfire_username }}\"\n+       password: \"{{ solidfire_password }}\"\n+       state: absent\n+       name: AnsibleVol\n+       account_id: 2\n+\"\"\"\n+\n+RETURN = \"\"\"\n+\n+\n+\"\"\"\n+\n+import logging\n+from traceback import format_exc\n+\n+from ansible.module_utils.basic import AnsibleModule\n+from ansible.module_utils.pycompat24 import get_exception\n+import ansible.module_utils.netapp as netapp_utils\n+\n+HAS_SF_SDK = netapp_utils.has_sf_sdk()\n+\n+logger = logging.getLogger(__name__)\n+logger.setLevel(logging.DEBUG)\n+\n+\n+class SolidFireVolume(object):\n+\n+    def __init__(self):\n+\n+        self._size_unit_map = dict(\n+\n+            # Management GUI displays 1024 ** 3 as 1.1 GB, thus use 1000.\n+            bytes=1,\n+            b=1,\n+            kb=1000,\n+            mb=1000 ** 2,\n+            gb=1000 ** 3,\n+            tb=1000 ** 4,\n+            pb=1000 ** 5,\n+            eb=1000 ** 6,\n+            zb=1000 ** 7,\n+            yb=1000 ** 8\n+        )\n+\n+        self.argument_spec = netapp_utils.ontap_sf_host_argument_spec()\n+        self.argument_spec.update(dict(\n+            state=dict(required=True, choices=['present', 'absent']),\n+            name=dict(required=True, type='str'),\n+            account_id=dict(required=True, type='int'),\n+\n+            new_account_id=dict(required=False, type='int', default=None),\n+            enable512e=dict(type='bool'),\n+            qos=dict(required=False, type='str', default=None),\n+            attributes=dict(required=False, type='dict', default=None),\n+\n+            volume_id=dict(type='int', default=None),\n+            size=dict(type='int'),\n+            size_unit=dict(default='gb',\n+                           choices=['bytes', 'b', 'kb', 'mb', 'gb', 'tb',\n+                                    'pb', 'eb', 'zb', 'yb'], type='str'),\n+\n+            access=dict(required=False, type='str', default=None, choices=['readOnly', 'readWrite',\n+                                                                           'locked', 'replicationTarget']),\n+\n+        ))\n+\n+        self.module = AnsibleModule(\n+            argument_spec=self.argument_spec,\n+            required_if=[\n+                ('state', 'present', ['size', 'enable512e'])\n+            ],\n+            supports_check_mode=False","path":"lib/ansible/modules/storage/netapp/sf_volume_manager.py","position":216,"original_position":216,"commit_id":"cfb89e5aaef3aa06d67a9566f6b149ced73607fb","original_commit_id":"cfb89e5aaef3aa06d67a9566f6b149ced73607fb","user":{"login":"resmo","id":23809,"avatar_url":"https://avatars.githubusercontent.com/u/23809?v=3","gravatar_id":"","url":"https://api.github.com/users/resmo","html_url":"https://github.com/resmo","followers_url":"https://api.github.com/users/resmo/followers","following_url":"https://api.github.com/users/resmo/following{/other_user}","gists_url":"https://api.github.com/users/resmo/gists{/gist_id}","starred_url":"https://api.github.com/users/resmo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/resmo/subscriptions","organizations_url":"https://api.github.com/users/resmo/orgs","repos_url":"https://api.github.com/users/resmo/repos","events_url":"https://api.github.com/users/resmo/events{/privacy}","received_events_url":"https://api.github.com/users/resmo/received_events","type":"User","site_admin":false},"body":"it looks to me this module supports check mode, but it is says not","created_at":"2017-02-06T20:21:06Z","updated_at":"2017-02-06T20:21:22Z","html_url":"https://github.com/ansible/ansible/pull/20732#discussion_r99675068","pull_request_url":"https://api.github.com/repos/ansible/ansible/pulls/20732","_links":{"self":{"href":"https://api.github.com/repos/ansible/ansible/pulls/comments/99675068"},"html":{"href":"https://github.com/ansible/ansible/pull/20732#discussion_r99675068"},"pull_request":{"href":"https://api.github.com/repos/ansible/ansible/pulls/20732"}}},"pull_request":{"url":"https://api.github.com/repos/ansible/ansible/pulls/20732","id":103419054,"html_url":"https://github.com/ansible/ansible/pull/20732","diff_url":"https://github.com/ansible/ansible/pull/20732.diff","patch_url":"https://github.com/ansible/ansible/pull/20732.patch","issue_url":"https://api.github.com/repos/ansible/ansible/issues/20732","number":20732,"state":"open","locked":false,"title":"Add NetApp SolidFire volume module","user":{"login":"timuster","id":2242052,"avatar_url":"https://avatars.githubusercontent.com/u/2242052?v=3","gravatar_id":"","url":"https://api.github.com/users/timuster","html_url":"https://github.com/timuster","followers_url":"https://api.github.com/users/timuster/followers","following_url":"https://api.github.com/users/timuster/following{/other_user}","gists_url":"https://api.github.com/users/timuster/gists{/gist_id}","starred_url":"https://api.github.com/users/timuster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timuster/subscriptions","organizations_url":"https://api.github.com/users/timuster/orgs","repos_url":"https://api.github.com/users/timuster/repos","events_url":"https://api.github.com/users/timuster/events{/privacy}","received_events_url":"https://api.github.com/users/timuster/received_events","type":"User","site_admin":false},"body":"##### ISSUE TYPE\r\n<!--- Pick one below and delete the rest: -->\r\n - New Module Pull Request\r\n\r\n##### COMPONENT NAME\r\n<!--- Name of the module/plugin/module/task -->\r\nNetApp SolidFire volume manager module\r\n\r\n##### ANSIBLE VERSION\r\n<!--- Paste verbatim output from “ansible --version” between quotes below -->\r\n```\r\nansible 2.3.0\r\n  config file = \r\n  configured module search path = Default w/o overrides\r\n```\r\n\r\n##### SUMMARY\r\n<!--- Describe the change, including rationale and design decisions -->\r\nAdding sf_volume_manager.py, a module to manage NetApp SolidFire volumes. The design was based on the existing NetApp E-Series modules.\r\n\r\n<!---\r\nIf you are fixing an existing issue, please include \"Fixes #nnn\" in your\r\ncommit message and your description; but you should still explain what\r\nthe change does.\r\n-->\r\n\r\n<!-- Paste verbatim command output below, e.g. before and after your change -->\r\n```\r\n\r\n```","created_at":"2017-01-27T00:30:26Z","updated_at":"2017-02-06T20:21:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"41feb3a9a45790333eed2b20783a05e21264b737","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/ansible/ansible/pulls/20732/commits","review_comments_url":"https://api.github.com/repos/ansible/ansible/pulls/20732/comments","review_comment_url":"https://api.github.com/repos/ansible/ansible/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/20732/comments","statuses_url":"https://api.github.com/repos/ansible/ansible/statuses/cfb89e5aaef3aa06d67a9566f6b149ced73607fb","head":{"label":"timuster:netapp-sf-module-volume_manager","ref":"netapp-sf-module-volume_manager","sha":"cfb89e5aaef3aa06d67a9566f6b149ced73607fb","user":{"login":"timuster","id":2242052,"avatar_url":"https://avatars.githubusercontent.com/u/2242052?v=3","gravatar_id":"","url":"https://api.github.com/users/timuster","html_url":"https://github.com/timuster","followers_url":"https://api.github.com/users/timuster/followers","following_url":"https://api.github.com/users/timuster/following{/other_user}","gists_url":"https://api.github.com/users/timuster/gists{/gist_id}","starred_url":"https://api.github.com/users/timuster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timuster/subscriptions","organizations_url":"https://api.github.com/users/timuster/orgs","repos_url":"https://api.github.com/users/timuster/repos","events_url":"https://api.github.com/users/timuster/events{/privacy}","received_events_url":"https://api.github.com/users/timuster/received_events","type":"User","site_admin":false},"repo":{"id":77073438,"name":"ansible","full_name":"timuster/ansible","owner":{"login":"timuster","id":2242052,"avatar_url":"https://avatars.githubusercontent.com/u/2242052?v=3","gravatar_id":"","url":"https://api.github.com/users/timuster","html_url":"https://github.com/timuster","followers_url":"https://api.github.com/users/timuster/followers","following_url":"https://api.github.com/users/timuster/following{/other_user}","gists_url":"https://api.github.com/users/timuster/gists{/gist_id}","starred_url":"https://api.github.com/users/timuster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timuster/subscriptions","organizations_url":"https://api.github.com/users/timuster/orgs","repos_url":"https://api.github.com/users/timuster/repos","events_url":"https://api.github.com/users/timuster/events{/privacy}","received_events_url":"https://api.github.com/users/timuster/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/timuster/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/timuster/ansible","forks_url":"https://api.github.com/repos/timuster/ansible/forks","keys_url":"https://api.github.com/repos/timuster/ansible/keys{/key_id}","collaborators_url":"https://api.github.com/repos/timuster/ansible/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/timuster/ansible/teams","hooks_url":"https://api.github.com/repos/timuster/ansible/hooks","issue_events_url":"https://api.github.com/repos/timuster/ansible/issues/events{/number}","events_url":"https://api.github.com/repos/timuster/ansible/events","assignees_url":"https://api.github.com/repos/timuster/ansible/assignees{/user}","branches_url":"https://api.github.com/repos/timuster/ansible/branches{/branch}","tags_url":"https://api.github.com/repos/timuster/ansible/tags","blobs_url":"https://api.github.com/repos/timuster/ansible/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/timuster/ansible/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/timuster/ansible/git/refs{/sha}","trees_url":"https://api.github.com/repos/timuster/ansible/git/trees{/sha}","statuses_url":"https://api.github.com/repos/timuster/ansible/statuses/{sha}","languages_url":"https://api.github.com/repos/timuster/ansible/languages","stargazers_url":"https://api.github.com/repos/timuster/ansible/stargazers","contributors_url":"https://api.github.com/repos/timuster/ansible/contributors","subscribers_url":"https://api.github.com/repos/timuster/ansible/subscribers","subscription_url":"https://api.github.com/repos/timuster/ansible/subscription","commits_url":"https://api.github.com/repos/timuster/ansible/commits{/sha}","git_commits_url":"https://api.github.com/repos/timuster/ansible/git/commits{/sha}","comments_url":"https://api.github.com/repos/timuster/ansible/comments{/number}","issue_comment_url":"https://api.github.com/repos/timuster/ansible/issues/comments{/number}","contents_url":"https://api.github.com/repos/timuster/ansible/contents/{+path}","compare_url":"https://api.github.com/repos/timuster/ansible/compare/{base}...{head}","merges_url":"https://api.github.com/repos/timuster/ansible/merges","archive_url":"https://api.github.com/repos/timuster/ansible/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/timuster/ansible/downloads","issues_url":"https://api.github.com/repos/timuster/ansible/issues{/number}","pulls_url":"https://api.github.com/repos/timuster/ansible/pulls{/number}","milestones_url":"https://api.github.com/repos/timuster/ansible/milestones{/number}","notifications_url":"https://api.github.com/repos/timuster/ansible/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/timuster/ansible/labels{/name}","releases_url":"https://api.github.com/repos/timuster/ansible/releases{/id}","deployments_url":"https://api.github.com/repos/timuster/ansible/deployments","created_at":"2016-12-21T17:42:48Z","updated_at":"2016-12-21T17:43:06Z","pushed_at":"2017-02-04T03:23:15Z","git_url":"git://github.com/timuster/ansible.git","ssh_url":"git@github.com:timuster/ansible.git","clone_url":"https://github.com/timuster/ansible.git","svn_url":"https://github.com/timuster/ansible","homepage":"http://ansible.com/","size":63424,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":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":"829c0b8f6284ec37e36f1454d7d3640415239cb2","user":{"login":"ansible","id":1507452,"avatar_url":"https://avatars.githubusercontent.com/u/1507452?v=3","gravatar_id":"","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?v=3","gravatar_id":"","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}","deployments_url":"https://api.github.com/repos/ansible/ansible/deployments","created_at":"2012-03-06T14:58:02Z","updated_at":"2017-02-06T19:46:20Z","pushed_at":"2017-02-06T20:11:56Z","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":65104,"stargazers_count":21246,"watchers_count":21246,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":6761,"mirror_url":null,"open_issues_count":2360,"forks":6761,"open_issues":2360,"watchers":21246,"default_branch":"devel"}},"_links":{"self":{"href":"https://api.github.com/repos/ansible/ansible/pulls/20732"},"html":{"href":"https://github.com/ansible/ansible/pull/20732"},"issue":{"href":"https://api.github.com/repos/ansible/ansible/issues/20732"},"comments":{"href":"https://api.github.com/repos/ansible/ansible/issues/20732/comments"},"review_comments":{"href":"https://api.github.com/repos/ansible/ansible/pulls/20732/comments"},"review_comment":{"href":"https://api.github.com/repos/ansible/ansible/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ansible/ansible/pulls/20732/commits"},"statuses":{"href":"https://api.github.com/repos/ansible/ansible/statuses/cfb89e5aaef3aa06d67a9566f6b149ced73607fb"}}}}
{"actor":{"display_login":"resmo"}}