{"action":"opened","number":3124,"pull_request":{"url":"https://api.github.com/repos/StackStorm/st2/pulls/3124","id":98423829,"html_url":"https://github.com/StackStorm/st2/pull/3124","diff_url":"https://github.com/StackStorm/st2/pull/3124.diff","patch_url":"https://github.com/StackStorm/st2/pull/3124.patch","issue_url":"https://api.github.com/repos/StackStorm/st2/issues/3124","number":3124,"state":"open","locked":false,"title":"Feature Request - Actionalias help API","user":{"login":"nzlosh","id":2700069,"avatar_url":"https://avatars.githubusercontent.com/u/2700069?v=3","gravatar_id":"","url":"https://api.github.com/users/nzlosh","html_url":"https://github.com/nzlosh","followers_url":"https://api.github.com/users/nzlosh/followers","following_url":"https://api.github.com/users/nzlosh/following{/other_user}","gists_url":"https://api.github.com/users/nzlosh/gists{/gist_id}","starred_url":"https://api.github.com/users/nzlosh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nzlosh/subscriptions","organizations_url":"https://api.github.com/users/nzlosh/orgs","repos_url":"https://api.github.com/users/nzlosh/repos","events_url":"https://api.github.com/users/nzlosh/events{/privacy}","received_events_url":"https://api.github.com/users/nzlosh/received_events","type":"User","site_admin":false},"body":"With the action-alias processing on the server side since 2.1, it is possible to send strings to the API and have it return success or failure when matching against an action alias.  It is still a client side task to display action alias help, which requires fetching the list of action-aliases' and processing them by applying the same logic as the server side to action alias `format` field.\r\n\r\nTo fully capitalise on server side action alias processing, it would be useful to have an API that would return available help to the client side without the need for client side processing.  I submit this PR as a candidate for the implementation and for your comment/feedback on the idea.\r\n\r\nThe API supports\r\n\r\n- filtering by help string (regular expression)\r\n- selecting a pack (string comparison with available packs)\r\n- limit the size of the resulting help strings\r\n- offset in the list or returned help strings (to allow pagination via the API)\r\n\r\nHere is an example API response\r\n`curl -H 'Content-Type: application/json' localhost:9101/v1/actionalias/help -d '{\"filtering\": \"^[a-z]\", \"pack\": \"packs\", \"limit\":2, \"offset\": 4 }'`\r\n```\r\n{\r\n    \"packs\": [\r\n        {\r\n            \"display\": \"pack show <pack>\",\r\n            \"description\": \"Show information about the pack from StackStorm Exchange.\"\r\n        }\r\n    ]\r\n}\r\n```\r\nand with no limit/offset\r\n`curl -H 'Content-Type: application/json' -XPOST localhost:9101/v1/actionalias/help -d '{\"filtering\": \"^[a-z]\", \"pack\": \"packs\"}'`\r\n```\r\n{\r\n    \"packs\": [\r\n        {\r\n            \"display\": \"pack get <pack>\",\r\n            \"description\": \"Get information about installed StackStorm pack.\"\r\n        },\r\n        {\r\n            \"display\": \"pack install <pack>[,<pack>]\",\r\n            \"description\": \"Install/upgrade StackStorm packs.\"\r\n        },\r\n        {\r\n            \"display\": \"pack install <gitUrl>[,<gitUrl>]\",\r\n            \"description\": \"Install/upgrade StackStorm packs.\"\r\n        },\r\n        {\r\n            \"display\": \"pack search <query>\",\r\n            \"description\": \"Search for packs in StackStorm Exchange and other directories.\"\r\n        },\r\n        {\r\n            \"display\": \"pack show <pack>\",\r\n            \"description\": \"Show information about the pack from StackStorm Exchange.\"\r\n        }\r\n    ]\r\n}\r\n```\r\n","created_at":"2016-12-17T00:19:40Z","updated_at":"2016-12-17T00:19:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"823652a2c45fe3af82e9b8916fe8760c343bafc2","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/StackStorm/st2/pulls/3124/commits","review_comments_url":"https://api.github.com/repos/StackStorm/st2/pulls/3124/comments","review_comment_url":"https://api.github.com/repos/StackStorm/st2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/StackStorm/st2/issues/3124/comments","statuses_url":"https://api.github.com/repos/StackStorm/st2/statuses/7f1966b569c5cdcf1b479e2e1a8e700be562a97b","head":{"label":"nzlosh:actionalias_help","ref":"actionalias_help","sha":"7f1966b569c5cdcf1b479e2e1a8e700be562a97b","user":{"login":"nzlosh","id":2700069,"avatar_url":"https://avatars.githubusercontent.com/u/2700069?v=3","gravatar_id":"","url":"https://api.github.com/users/nzlosh","html_url":"https://github.com/nzlosh","followers_url":"https://api.github.com/users/nzlosh/followers","following_url":"https://api.github.com/users/nzlosh/following{/other_user}","gists_url":"https://api.github.com/users/nzlosh/gists{/gist_id}","starred_url":"https://api.github.com/users/nzlosh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nzlosh/subscriptions","organizations_url":"https://api.github.com/users/nzlosh/orgs","repos_url":"https://api.github.com/users/nzlosh/repos","events_url":"https://api.github.com/users/nzlosh/events{/privacy}","received_events_url":"https://api.github.com/users/nzlosh/received_events","type":"User","site_admin":false},"repo":{"id":60675982,"name":"st2","full_name":"nzlosh/st2","owner":{"login":"nzlosh","id":2700069,"avatar_url":"https://avatars.githubusercontent.com/u/2700069?v=3","gravatar_id":"","url":"https://api.github.com/users/nzlosh","html_url":"https://github.com/nzlosh","followers_url":"https://api.github.com/users/nzlosh/followers","following_url":"https://api.github.com/users/nzlosh/following{/other_user}","gists_url":"https://api.github.com/users/nzlosh/gists{/gist_id}","starred_url":"https://api.github.com/users/nzlosh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nzlosh/subscriptions","organizations_url":"https://api.github.com/users/nzlosh/orgs","repos_url":"https://api.github.com/users/nzlosh/repos","events_url":"https://api.github.com/users/nzlosh/events{/privacy}","received_events_url":"https://api.github.com/users/nzlosh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nzlosh/st2","description":"StackStorm (aka \"IFTTT for Ops\") is event-driven automation commonly used for auto-remediation, security responses, facilitated troubleshooting, complex deployments, and more. Includes rules engine, workflow,1800+ integrations (see /st2contrib), native ChatOps and so forth.  Installer available at http://docs.stackstorm.com/install/index.html. Ping us on slack - https://stackstorm-community.slack.com/. ","fork":true,"url":"https://api.github.com/repos/nzlosh/st2","forks_url":"https://api.github.com/repos/nzlosh/st2/forks","keys_url":"https://api.github.com/repos/nzlosh/st2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nzlosh/st2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nzlosh/st2/teams","hooks_url":"https://api.github.com/repos/nzlosh/st2/hooks","issue_events_url":"https://api.github.com/repos/nzlosh/st2/issues/events{/number}","events_url":"https://api.github.com/repos/nzlosh/st2/events","assignees_url":"https://api.github.com/repos/nzlosh/st2/assignees{/user}","branches_url":"https://api.github.com/repos/nzlosh/st2/branches{/branch}","tags_url":"https://api.github.com/repos/nzlosh/st2/tags","blobs_url":"https://api.github.com/repos/nzlosh/st2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nzlosh/st2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nzlosh/st2/git/refs{/sha}","trees_url":"https://api.github.com/repos/nzlosh/st2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nzlosh/st2/statuses/{sha}","languages_url":"https://api.github.com/repos/nzlosh/st2/languages","stargazers_url":"https://api.github.com/repos/nzlosh/st2/stargazers","contributors_url":"https://api.github.com/repos/nzlosh/st2/contributors","subscribers_url":"https://api.github.com/repos/nzlosh/st2/subscribers","subscription_url":"https://api.github.com/repos/nzlosh/st2/subscription","commits_url":"https://api.github.com/repos/nzlosh/st2/commits{/sha}","git_commits_url":"https://api.github.com/repos/nzlosh/st2/git/commits{/sha}","comments_url":"https://api.github.com/repos/nzlosh/st2/comments{/number}","issue_comment_url":"https://api.github.com/repos/nzlosh/st2/issues/comments{/number}","contents_url":"https://api.github.com/repos/nzlosh/st2/contents/{+path}","compare_url":"https://api.github.com/repos/nzlosh/st2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nzlosh/st2/merges","archive_url":"https://api.github.com/repos/nzlosh/st2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nzlosh/st2/downloads","issues_url":"https://api.github.com/repos/nzlosh/st2/issues{/number}","pulls_url":"https://api.github.com/repos/nzlosh/st2/pulls{/number}","milestones_url":"https://api.github.com/repos/nzlosh/st2/milestones{/number}","notifications_url":"https://api.github.com/repos/nzlosh/st2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nzlosh/st2/labels{/name}","releases_url":"https://api.github.com/repos/nzlosh/st2/releases{/id}","deployments_url":"https://api.github.com/repos/nzlosh/st2/deployments","created_at":"2016-06-08T06:58:38Z","updated_at":"2016-06-08T06:58:41Z","pushed_at":"2016-12-16T23:48:39Z","git_url":"git://github.com/nzlosh/st2.git","ssh_url":"git@github.com:nzlosh/st2.git","clone_url":"https://github.com/nzlosh/st2.git","svn_url":"https://github.com/nzlosh/st2","homepage":"http://www.stackstorm.com/","size":16755,"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":"master"}},"base":{"label":"StackStorm:master","ref":"master","sha":"85229b5a581c2574a1bffb3fed442eb50f20a776","user":{"login":"StackStorm","id":4969009,"avatar_url":"https://avatars.githubusercontent.com/u/4969009?v=3","gravatar_id":"","url":"https://api.github.com/users/StackStorm","html_url":"https://github.com/StackStorm","followers_url":"https://api.github.com/users/StackStorm/followers","following_url":"https://api.github.com/users/StackStorm/following{/other_user}","gists_url":"https://api.github.com/users/StackStorm/gists{/gist_id}","starred_url":"https://api.github.com/users/StackStorm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StackStorm/subscriptions","organizations_url":"https://api.github.com/users/StackStorm/orgs","repos_url":"https://api.github.com/users/StackStorm/repos","events_url":"https://api.github.com/users/StackStorm/events{/privacy}","received_events_url":"https://api.github.com/users/StackStorm/received_events","type":"Organization","site_admin":false},"repo":{"id":19051806,"name":"st2","full_name":"StackStorm/st2","owner":{"login":"StackStorm","id":4969009,"avatar_url":"https://avatars.githubusercontent.com/u/4969009?v=3","gravatar_id":"","url":"https://api.github.com/users/StackStorm","html_url":"https://github.com/StackStorm","followers_url":"https://api.github.com/users/StackStorm/followers","following_url":"https://api.github.com/users/StackStorm/following{/other_user}","gists_url":"https://api.github.com/users/StackStorm/gists{/gist_id}","starred_url":"https://api.github.com/users/StackStorm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StackStorm/subscriptions","organizations_url":"https://api.github.com/users/StackStorm/orgs","repos_url":"https://api.github.com/users/StackStorm/repos","events_url":"https://api.github.com/users/StackStorm/events{/privacy}","received_events_url":"https://api.github.com/users/StackStorm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/StackStorm/st2","description":"StackStorm (aka \"IFTTT for Ops\") is event-driven automation commonly used for auto-remediation, security responses, facilitated troubleshooting, complex deployments, and more. Includes rules engine, workflow,1800+ integrations (see /st2contrib), native ChatOps and so forth.  Installer available at http://docs.stackstorm.com/install/index.html. Ping us on slack - https://stackstorm-community.slack.com/. ","fork":false,"url":"https://api.github.com/repos/StackStorm/st2","forks_url":"https://api.github.com/repos/StackStorm/st2/forks","keys_url":"https://api.github.com/repos/StackStorm/st2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/StackStorm/st2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/StackStorm/st2/teams","hooks_url":"https://api.github.com/repos/StackStorm/st2/hooks","issue_events_url":"https://api.github.com/repos/StackStorm/st2/issues/events{/number}","events_url":"https://api.github.com/repos/StackStorm/st2/events","assignees_url":"https://api.github.com/repos/StackStorm/st2/assignees{/user}","branches_url":"https://api.github.com/repos/StackStorm/st2/branches{/branch}","tags_url":"https://api.github.com/repos/StackStorm/st2/tags","blobs_url":"https://api.github.com/repos/StackStorm/st2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/StackStorm/st2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/StackStorm/st2/git/refs{/sha}","trees_url":"https://api.github.com/repos/StackStorm/st2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/StackStorm/st2/statuses/{sha}","languages_url":"https://api.github.com/repos/StackStorm/st2/languages","stargazers_url":"https://api.github.com/repos/StackStorm/st2/stargazers","contributors_url":"https://api.github.com/repos/StackStorm/st2/contributors","subscribers_url":"https://api.github.com/repos/StackStorm/st2/subscribers","subscription_url":"https://api.github.com/repos/StackStorm/st2/subscription","commits_url":"https://api.github.com/repos/StackStorm/st2/commits{/sha}","git_commits_url":"https://api.github.com/repos/StackStorm/st2/git/commits{/sha}","comments_url":"https://api.github.com/repos/StackStorm/st2/comments{/number}","issue_comment_url":"https://api.github.com/repos/StackStorm/st2/issues/comments{/number}","contents_url":"https://api.github.com/repos/StackStorm/st2/contents/{+path}","compare_url":"https://api.github.com/repos/StackStorm/st2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/StackStorm/st2/merges","archive_url":"https://api.github.com/repos/StackStorm/st2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/StackStorm/st2/downloads","issues_url":"https://api.github.com/repos/StackStorm/st2/issues{/number}","pulls_url":"https://api.github.com/repos/StackStorm/st2/pulls{/number}","milestones_url":"https://api.github.com/repos/StackStorm/st2/milestones{/number}","notifications_url":"https://api.github.com/repos/StackStorm/st2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/StackStorm/st2/labels{/name}","releases_url":"https://api.github.com/repos/StackStorm/st2/releases{/id}","deployments_url":"https://api.github.com/repos/StackStorm/st2/deployments","created_at":"2014-04-23T00:51:34Z","updated_at":"2016-12-14T13:50:46Z","pushed_at":"2016-12-17T00:19:41Z","git_url":"git://github.com/StackStorm/st2.git","ssh_url":"git@github.com:StackStorm/st2.git","clone_url":"https://github.com/StackStorm/st2.git","svn_url":"https://github.com/StackStorm/st2","homepage":"http://www.stackstorm.com/","size":16986,"stargazers_count":1715,"watchers_count":1715,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":206,"mirror_url":null,"open_issues_count":167,"forks":206,"open_issues":167,"watchers":1715,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/StackStorm/st2/pulls/3124"},"html":{"href":"https://github.com/StackStorm/st2/pull/3124"},"issue":{"href":"https://api.github.com/repos/StackStorm/st2/issues/3124"},"comments":{"href":"https://api.github.com/repos/StackStorm/st2/issues/3124/comments"},"review_comments":{"href":"https://api.github.com/repos/StackStorm/st2/pulls/3124/comments"},"review_comment":{"href":"https://api.github.com/repos/StackStorm/st2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/StackStorm/st2/pulls/3124/commits"},"statuses":{"href":"https://api.github.com/repos/StackStorm/st2/statuses/7f1966b569c5cdcf1b479e2e1a8e700be562a97b"}},"merged":false,"mergeable":true,"mergeable_state":"unstable","merged_by":null,"comments":0,"review_comments":0,"commits":3,"additions":335,"deletions":5,"changed_files":6}}
{"actor":{"display_login":"nzlosh"}}