{"action":"created","comment":{"url":"https://api.github.com/repos/HewlettPackard/hpe3par_ansible_module/pulls/comments/224032165","pull_request_review_id":163300184,"id":224032165,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNDAzMjE2NQ==","diff_hunk":"@@ -435,13 +468,188 @@ def restore_snapshot_online(\n         snapshot_name,\n         {})\n \n+def create_schedule(\n+        client_obj,\n+        storage_system_ip,        \n+        storage_system_username,\n+        storage_system_password,\n+        schedule_name,\n+        snapshot_name,\n+        base_volume_name,\n+        read_only,\n+        expiration_time,\n+        retention_time,\n+        expiration_unit,\n+        retention_unit,\n+        task_freq, task_freq_custom):\n+    if storage_system_username is None or storage_system_password is None:\n+        return (\n+            False,\n+            False,\n+            \"Schedule creation failed. Storage system username or password is \\\n+null\",\n+            {})\n+    if schedule_name is None:\n+        return (\n+            False,\n+            False,\n+            \"Schedule create failed. Schedule name is null\",\n+            {})                 \n+    if snapshot_name is None:\n+        return (\n+            False,\n+            False,\n+            \"Schedule create failed. Snapshot name is null\",\n+            {})\n+    if len(schedule_name) < 1 or len(schedule_name) > 31:\n+        return (False, False, \"Schedule creation failed. Schedule name must be atleast 1 character and not more than 31 characters\", {})\n+\n+    if len(snapshot_name) < 1 or len(snapshot_name) > 31:\n+        return (False, False, \"Schedule create failed. Snapshot name must be atleast 1 character and not more than 31 characters\", {})\n+    if base_volume_name is None:\n+        return (\n+            False,\n+            False,\n+            \"Schedule create failed. Base volume name is null\",\n+            {})\n+    if len(base_volume_name) < 1 or len(base_volume_name) > 31:\n+        return (False, False, \"Schedule create failed. Base volume name must be atleast 1 character and not more than 31 characters\", {})\n+    try:\n+        client_obj.login(storage_system_username, storage_system_password)\n+        client_obj.setSSHOptions(storage_system_ip, storage_system_username, storage_system_password)\n+        expirationHours = convert_to_hours(expiration_time, expiration_unit)\n+        retentionHours = convert_to_hours(retention_time, retention_unit)\n+\n+        freq = \"@hourly\"\n+        if not client_obj.volumeExists(base_volume_name):\n+           return (False, False, \"Volume does not Exist\", {})\n+        \n+        if retentionHours > expirationHours:\n+           return (False, False, \"Expiration time must be greater than or equal to retention time\", {})   \n+       \n+        if task_freq_custom:          \n+          if ' ' in task_freq_custom:            \n+           taskcm = str(task_freq_custom).split()\n+           if len(taskcm) == 5:\n+               minutes_t = taskcm[0]               \n+               hour_t = taskcm[1]\n+               day_t = taskcm[2]\n+               month_t = taskcm[3]  \n+               dow_t = taskcm[4]\n+               if '*' not in minutes_t:","path":"Modules/hpe3par_snapshot.py","position":133,"original_position":133,"commit_id":"b448f6941420ace81d1b7f5fbb7c0a3d8e4b1172","original_commit_id":"f0ad3f2a0c8c963fe5a3ff0a1a70581420663bda","user":{"login":"nirupaman","id":5293352,"node_id":"MDQ6VXNlcjUyOTMzNTI=","avatar_url":"https://avatars2.githubusercontent.com/u/5293352?v=4","gravatar_id":"","url":"https://api.github.com/users/nirupaman","html_url":"https://github.com/nirupaman","followers_url":"https://api.github.com/users/nirupaman/followers","following_url":"https://api.github.com/users/nirupaman/following{/other_user}","gists_url":"https://api.github.com/users/nirupaman/gists{/gist_id}","starred_url":"https://api.github.com/users/nirupaman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nirupaman/subscriptions","organizations_url":"https://api.github.com/users/nirupaman/orgs","repos_url":"https://api.github.com/users/nirupaman/repos","events_url":"https://api.github.com/users/nirupaman/events{/privacy}","received_events_url":"https://api.github.com/users/nirupaman/received_events","type":"User","site_admin":false},"body":"test written for minutes,hours,month,day and day of week","created_at":"2018-10-10T11:10:06Z","updated_at":"2018-10-10T11:10:06Z","html_url":"https://github.com/HewlettPackard/hpe3par_ansible_module/pull/8#discussion_r224032165","pull_request_url":"https://api.github.com/repos/HewlettPackard/hpe3par_ansible_module/pulls/8","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/HewlettPackard/hpe3par_ansible_module/pulls/comments/224032165"},"html":{"href":"https://github.com/HewlettPackard/hpe3par_ansible_module/pull/8#discussion_r224032165"},"pull_request":{"href":"https://api.github.com/repos/HewlettPackard/hpe3par_ansible_module/pulls/8"}},"in_reply_to_id":224019926},"pull_request":{"url":"https://api.github.com/repos/HewlettPackard/hpe3par_ansible_module/pulls/8","id":221475551,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIxNDc1NTUx","html_url":"https://github.com/HewlettPackard/hpe3par_ansible_module/pull/8","diff_url":"https://github.com/HewlettPackard/hpe3par_ansible_module/pull/8.diff","patch_url":"https://github.com/HewlettPackard/hpe3par_ansible_module/pull/8.patch","issue_url":"https://api.github.com/repos/HewlettPackard/hpe3par_ansible_module/issues/8","number":8,"state":"open","locked":false,"title":"Actions for snapshot scheduling","user":{"login":"farhan7500","id":22393330,"node_id":"MDQ6VXNlcjIyMzkzMzMw","avatar_url":"https://avatars2.githubusercontent.com/u/22393330?v=4","gravatar_id":"","url":"https://api.github.com/users/farhan7500","html_url":"https://github.com/farhan7500","followers_url":"https://api.github.com/users/farhan7500/followers","following_url":"https://api.github.com/users/farhan7500/following{/other_user}","gists_url":"https://api.github.com/users/farhan7500/gists{/gist_id}","starred_url":"https://api.github.com/users/farhan7500/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/farhan7500/subscriptions","organizations_url":"https://api.github.com/users/farhan7500/orgs","repos_url":"https://api.github.com/users/farhan7500/repos","events_url":"https://api.github.com/users/farhan7500/events{/privacy}","received_events_url":"https://api.github.com/users/farhan7500/received_events","type":"User","site_admin":false},"body":"Create and delete snapshot scheduling actions","created_at":"2018-10-09T15:02:38Z","updated_at":"2018-10-10T11:10:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e4ef0ead2ee29369e1d22fe21087cce9fb73003f","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/HewlettPackard/hpe3par_ansible_module/pulls/8/commits","review_comments_url":"https://api.github.com/repos/HewlettPackard/hpe3par_ansible_module/pulls/8/comments","review_comment_url":"https://api.github.com/repos/HewlettPackard/hpe3par_ansible_module/pulls/comments{/number}","comments_url":"https://api.github.com/repos/HewlettPackard/hpe3par_ansible_module/issues/8/comments","statuses_url":"https://api.github.com/repos/HewlettPackard/hpe3par_ansible_module/statuses/b448f6941420ace81d1b7f5fbb7c0a3d8e4b1172","head":{"label":"farhan7500:snapshot-scheduling","ref":"snapshot-scheduling","sha":"b448f6941420ace81d1b7f5fbb7c0a3d8e4b1172","user":{"login":"farhan7500","id":22393330,"node_id":"MDQ6VXNlcjIyMzkzMzMw","avatar_url":"https://avatars2.githubusercontent.com/u/22393330?v=4","gravatar_id":"","url":"https://api.github.com/users/farhan7500","html_url":"https://github.com/farhan7500","followers_url":"https://api.github.com/users/farhan7500/followers","following_url":"https://api.github.com/users/farhan7500/following{/other_user}","gists_url":"https://api.github.com/users/farhan7500/gists{/gist_id}","starred_url":"https://api.github.com/users/farhan7500/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/farhan7500/subscriptions","organizations_url":"https://api.github.com/users/farhan7500/orgs","repos_url":"https://api.github.com/users/farhan7500/repos","events_url":"https://api.github.com/users/farhan7500/events{/privacy}","received_events_url":"https://api.github.com/users/farhan7500/received_events","type":"User","site_admin":false},"repo":{"id":144131121,"node_id":"MDEwOlJlcG9zaXRvcnkxNDQxMzExMjE=","name":"hpe3par_ansible_module","full_name":"farhan7500/hpe3par_ansible_module","private":false,"owner":{"login":"farhan7500","id":22393330,"node_id":"MDQ6VXNlcjIyMzkzMzMw","avatar_url":"https://avatars2.githubusercontent.com/u/22393330?v=4","gravatar_id":"","url":"https://api.github.com/users/farhan7500","html_url":"https://github.com/farhan7500","followers_url":"https://api.github.com/users/farhan7500/followers","following_url":"https://api.github.com/users/farhan7500/following{/other_user}","gists_url":"https://api.github.com/users/farhan7500/gists{/gist_id}","starred_url":"https://api.github.com/users/farhan7500/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/farhan7500/subscriptions","organizations_url":"https://api.github.com/users/farhan7500/orgs","repos_url":"https://api.github.com/users/farhan7500/repos","events_url":"https://api.github.com/users/farhan7500/events{/privacy}","received_events_url":"https://api.github.com/users/farhan7500/received_events","type":"User","site_admin":false},"html_url":"https://github.com/farhan7500/hpe3par_ansible_module","description":"HPE 3PAR ansible module to configure, provision and manage 3PAR storage arrays and resources","fork":true,"url":"https://api.github.com/repos/farhan7500/hpe3par_ansible_module","forks_url":"https://api.github.com/repos/farhan7500/hpe3par_ansible_module/forks","keys_url":"https://api.github.com/repos/farhan7500/hpe3par_ansible_module/keys{/key_id}","collaborators_url":"https://api.github.com/repos/farhan7500/hpe3par_ansible_module/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/farhan7500/hpe3par_ansible_module/teams","hooks_url":"https://api.github.com/repos/farhan7500/hpe3par_ansible_module/hooks","issue_events_url":"https://api.github.com/repos/farhan7500/hpe3par_ansible_module/issues/events{/number}","events_url":"https://api.github.com/repos/farhan7500/hpe3par_ansible_module/events","assignees_url":"https://api.github.com/repos/farhan7500/hpe3par_ansible_module/assignees{/user}","branches_url":"https://api.github.com/repos/farhan7500/hpe3par_ansible_module/branches{/branch}","tags_url":"https://api.github.com/repos/farhan7500/hpe3par_ansible_module/tags","blobs_url":"https://api.github.com/repos/farhan7500/hpe3par_ansible_module/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/farhan7500/hpe3par_ansible_module/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/farhan7500/hpe3par_ansible_module/git/refs{/sha}","trees_url":"https://api.github.com/repos/farhan7500/hpe3par_ansible_module/git/trees{/sha}","statuses_url":"https://api.github.com/repos/farhan7500/hpe3par_ansible_module/statuses/{sha}","languages_url":"https://api.github.com/repos/farhan7500/hpe3par_ansible_module/languages","stargazers_url":"https://api.github.com/repos/farhan7500/hpe3par_ansible_module/stargazers","contributors_url":"https://api.github.com/repos/farhan7500/hpe3par_ansible_module/contributors","subscribers_url":"https://api.github.com/repos/farhan7500/hpe3par_ansible_module/subscribers","subscription_url":"https://api.github.com/repos/farhan7500/hpe3par_ansible_module/subscription","commits_url":"https://api.github.com/repos/farhan7500/hpe3par_ansible_module/commits{/sha}","git_commits_url":"https://api.github.com/repos/farhan7500/hpe3par_ansible_module/git/commits{/sha}","comments_url":"https://api.github.com/repos/farhan7500/hpe3par_ansible_module/comments{/number}","issue_comment_url":"https://api.github.com/repos/farhan7500/hpe3par_ansible_module/issues/comments{/number}","contents_url":"https://api.github.com/repos/farhan7500/hpe3par_ansible_module/contents/{+path}","compare_url":"https://api.github.com/repos/farhan7500/hpe3par_ansible_module/compare/{base}...{head}","merges_url":"https://api.github.com/repos/farhan7500/hpe3par_ansible_module/merges","archive_url":"https://api.github.com/repos/farhan7500/hpe3par_ansible_module/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/farhan7500/hpe3par_ansible_module/downloads","issues_url":"https://api.github.com/repos/farhan7500/hpe3par_ansible_module/issues{/number}","pulls_url":"https://api.github.com/repos/farhan7500/hpe3par_ansible_module/pulls{/number}","milestones_url":"https://api.github.com/repos/farhan7500/hpe3par_ansible_module/milestones{/number}","notifications_url":"https://api.github.com/repos/farhan7500/hpe3par_ansible_module/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/farhan7500/hpe3par_ansible_module/labels{/name}","releases_url":"https://api.github.com/repos/farhan7500/hpe3par_ansible_module/releases{/id}","deployments_url":"https://api.github.com/repos/farhan7500/hpe3par_ansible_module/deployments","created_at":"2018-08-09T09:30:35Z","updated_at":"2018-09-05T07:03:42Z","pushed_at":"2018-10-10T10:40:31Z","git_url":"git://github.com/farhan7500/hpe3par_ansible_module.git","ssh_url":"git@github.com:farhan7500/hpe3par_ansible_module.git","clone_url":"https://github.com/farhan7500/hpe3par_ansible_module.git","svn_url":"https://github.com/farhan7500/hpe3par_ansible_module","homepage":null,"size":121,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":10,"license":null,"forks":2,"open_issues":10,"watchers":0,"default_branch":"master"}},"base":{"label":"HewlettPackard:master","ref":"master","sha":"68cb033b0df55c71f3e2a8341814305277ba1dfd","user":{"login":"HewlettPackard","id":6004705,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYwMDQ3MDU=","avatar_url":"https://avatars0.githubusercontent.com/u/6004705?v=4","gravatar_id":"","url":"https://api.github.com/users/HewlettPackard","html_url":"https://github.com/HewlettPackard","followers_url":"https://api.github.com/users/HewlettPackard/followers","following_url":"https://api.github.com/users/HewlettPackard/following{/other_user}","gists_url":"https://api.github.com/users/HewlettPackard/gists{/gist_id}","starred_url":"https://api.github.com/users/HewlettPackard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HewlettPackard/subscriptions","organizations_url":"https://api.github.com/users/HewlettPackard/orgs","repos_url":"https://api.github.com/users/HewlettPackard/repos","events_url":"https://api.github.com/users/HewlettPackard/events{/privacy}","received_events_url":"https://api.github.com/users/HewlettPackard/received_events","type":"Organization","site_admin":false},"repo":{"id":132178404,"node_id":"MDEwOlJlcG9zaXRvcnkxMzIxNzg0MDQ=","name":"hpe3par_ansible_module","full_name":"HewlettPackard/hpe3par_ansible_module","private":false,"owner":{"login":"HewlettPackard","id":6004705,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYwMDQ3MDU=","avatar_url":"https://avatars0.githubusercontent.com/u/6004705?v=4","gravatar_id":"","url":"https://api.github.com/users/HewlettPackard","html_url":"https://github.com/HewlettPackard","followers_url":"https://api.github.com/users/HewlettPackard/followers","following_url":"https://api.github.com/users/HewlettPackard/following{/other_user}","gists_url":"https://api.github.com/users/HewlettPackard/gists{/gist_id}","starred_url":"https://api.github.com/users/HewlettPackard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HewlettPackard/subscriptions","organizations_url":"https://api.github.com/users/HewlettPackard/orgs","repos_url":"https://api.github.com/users/HewlettPackard/repos","events_url":"https://api.github.com/users/HewlettPackard/events{/privacy}","received_events_url":"https://api.github.com/users/HewlettPackard/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/HewlettPackard/hpe3par_ansible_module","description":"HPE 3PAR ansible module to configure, provision and manage 3PAR storage arrays and resources","fork":false,"url":"https://api.github.com/repos/HewlettPackard/hpe3par_ansible_module","forks_url":"https://api.github.com/repos/HewlettPackard/hpe3par_ansible_module/forks","keys_url":"https://api.github.com/repos/HewlettPackard/hpe3par_ansible_module/keys{/key_id}","collaborators_url":"https://api.github.com/repos/HewlettPackard/hpe3par_ansible_module/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/HewlettPackard/hpe3par_ansible_module/teams","hooks_url":"https://api.github.com/repos/HewlettPackard/hpe3par_ansible_module/hooks","issue_events_url":"https://api.github.com/repos/HewlettPackard/hpe3par_ansible_module/issues/events{/number}","events_url":"https://api.github.com/repos/HewlettPackard/hpe3par_ansible_module/events","assignees_url":"https://api.github.com/repos/HewlettPackard/hpe3par_ansible_module/assignees{/user}","branches_url":"https://api.github.com/repos/HewlettPackard/hpe3par_ansible_module/branches{/branch}","tags_url":"https://api.github.com/repos/HewlettPackard/hpe3par_ansible_module/tags","blobs_url":"https://api.github.com/repos/HewlettPackard/hpe3par_ansible_module/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/HewlettPackard/hpe3par_ansible_module/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/HewlettPackard/hpe3par_ansible_module/git/refs{/sha}","trees_url":"https://api.github.com/repos/HewlettPackard/hpe3par_ansible_module/git/trees{/sha}","statuses_url":"https://api.github.com/repos/HewlettPackard/hpe3par_ansible_module/statuses/{sha}","languages_url":"https://api.github.com/repos/HewlettPackard/hpe3par_ansible_module/languages","stargazers_url":"https://api.github.com/repos/HewlettPackard/hpe3par_ansible_module/stargazers","contributors_url":"https://api.github.com/repos/HewlettPackard/hpe3par_ansible_module/contributors","subscribers_url":"https://api.github.com/repos/HewlettPackard/hpe3par_ansible_module/subscribers","subscription_url":"https://api.github.com/repos/HewlettPackard/hpe3par_ansible_module/subscription","commits_url":"https://api.github.com/repos/HewlettPackard/hpe3par_ansible_module/commits{/sha}","git_commits_url":"https://api.github.com/repos/HewlettPackard/hpe3par_ansible_module/git/commits{/sha}","comments_url":"https://api.github.com/repos/HewlettPackard/hpe3par_ansible_module/comments{/number}","issue_comment_url":"https://api.github.com/repos/HewlettPackard/hpe3par_ansible_module/issues/comments{/number}","contents_url":"https://api.github.com/repos/HewlettPackard/hpe3par_ansible_module/contents/{+path}","compare_url":"https://api.github.com/repos/HewlettPackard/hpe3par_ansible_module/compare/{base}...{head}","merges_url":"https://api.github.com/repos/HewlettPackard/hpe3par_ansible_module/merges","archive_url":"https://api.github.com/repos/HewlettPackard/hpe3par_ansible_module/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/HewlettPackard/hpe3par_ansible_module/downloads","issues_url":"https://api.github.com/repos/HewlettPackard/hpe3par_ansible_module/issues{/number}","pulls_url":"https://api.github.com/repos/HewlettPackard/hpe3par_ansible_module/pulls{/number}","milestones_url":"https://api.github.com/repos/HewlettPackard/hpe3par_ansible_module/milestones{/number}","notifications_url":"https://api.github.com/repos/HewlettPackard/hpe3par_ansible_module/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/HewlettPackard/hpe3par_ansible_module/labels{/name}","releases_url":"https://api.github.com/repos/HewlettPackard/hpe3par_ansible_module/releases{/id}","deployments_url":"https://api.github.com/repos/HewlettPackard/hpe3par_ansible_module/deployments","created_at":"2018-05-04T19:00:43Z","updated_at":"2018-05-28T05:05:14Z","pushed_at":"2018-10-10T10:40:33Z","git_url":"git://github.com/HewlettPackard/hpe3par_ansible_module.git","ssh_url":"git@github.com:HewlettPackard/hpe3par_ansible_module.git","clone_url":"https://github.com/HewlettPackard/hpe3par_ansible_module.git","svn_url":"https://github.com/HewlettPackard/hpe3par_ansible_module","homepage":null,"size":72,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"archived":false,"open_issues_count":18,"license":null,"forks":5,"open_issues":18,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/HewlettPackard/hpe3par_ansible_module/pulls/8"},"html":{"href":"https://github.com/HewlettPackard/hpe3par_ansible_module/pull/8"},"issue":{"href":"https://api.github.com/repos/HewlettPackard/hpe3par_ansible_module/issues/8"},"comments":{"href":"https://api.github.com/repos/HewlettPackard/hpe3par_ansible_module/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/HewlettPackard/hpe3par_ansible_module/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/HewlettPackard/hpe3par_ansible_module/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/HewlettPackard/hpe3par_ansible_module/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/HewlettPackard/hpe3par_ansible_module/statuses/b448f6941420ace81d1b7f5fbb7c0a3d8e4b1172"}},"author_association":"NONE"}}
{"actor":{"display_login":"nirupaman"}}