{"componentChunkName":"component---src-templates-default-template-tsx","path":"/documentation/integration/Standard_ActionHandlers/ah_capability_config/","result":{"data":{"asciidoc":{"id":"912b0d9a-d78f-5f38-80c7-ca03cc231318","html":"<div id=\"toc\" class=\"toc\">\n<div id=\"toctitle\">Table of Contents</div>\n<ul class=\"sectlevel1\">\n<li><a href=\"#_introduction\">Introduction</a></li>\n<li><a href=\"#_prerequisites\">Prerequisites</a></li>\n<li><a href=\"#_defining_docker_composition\">Defining docker composition</a></li>\n<li><a href=\"#_using_default_capability_configuration\">Using default capability configuration</a></li>\n<li><a href=\"#_setting_custom_capability_configuration\">Setting custom capability configuration</a></li>\n<li><a href=\"#_special_parameters\">Special Parameters</a></li>\n<li><a href=\"#_available_capabilities\">Available capabilities</a></li>\n<li><a href=\"#_available_implementations\">Available implementations</a>\n<ul class=\"sectlevel2\">\n<li><a href=\"#_ssh_handler_implementation\">SSH Handler Implementation</a></li>\n<li><a href=\"#_http_handler_implementation\">HTTP Handler Implementation</a></li>\n<li><a href=\"#_rest_handler_implementation\">REST Handler Implementation</a></li>\n<li><a href=\"#_local_implementation\">LOCAL Implementation</a></li>\n</ul>\n</li>\n</ul>\n</div>\n<div class=\"sect1\">\n<h2 id=\"_introduction\">Introduction</h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>HIRO&#8482; comes with a Docker image of a standard Action Handler. This Action\nHandler can be configured to perform different types of actions (capabilities).\nThis guide describes how to configure the standard Action Handler via the\n<code>docker-compose.yml</code> configuration file.</p>\n</div>\n</div>\n</div>\n<div class=\"sect1\">\n<h2 id=\"_prerequisites\">Prerequisites</h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>Before you can configure the Action Handler, make sure the following prerequisites\nare fulfilled:</p>\n</div>\n<div class=\"olist arabic\">\n<ol class=\"arabic\">\n<li>\n<p>You have followed the instructions in <a href=\"/7.0/documentation/integration/Standard_ActionHandlers/AHconfig/\">Standard Docker image for Action Handlers</a>\nto setup the Action Handler Docker container. Please make sure that the Action\nHandler correctly connects to the HIRO API.</p>\n</li>\n<li>\n<p>You have configured the desired capabilities in the HIRO&#8482; SaaS system.\nThis is currently done by our SaaS team for you - please open a ticket.</p>\n</li>\n</ol>\n</div>\n<div class=\"paragraph\">\n<p>Once you have setup the basic Docker container for the Action Handler, and the\ncapabilities are correctly assigned in the HIRO&#8482; system, you can proceed with\nthe steps below.</p>\n</div>\n</div>\n</div>\n<div class=\"sect1\">\n<h2 id=\"_defining_docker_composition\">Defining docker composition</h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>The standard Action Handler comes as a Docker image. You need to use <code>docker-compose</code>\nto configure the Docker container for you individual use. This is done in a file\ncalled <code>docker-compose.yml</code>. The <code>docker-compose</code> tool reads this file to instantiate\nyour Docker container from the image.</p>\n</div>\n<div class=\"paragraph\">\n<p>For the basic steps how to create the <code>docker-compose.yml</code> file and run docker-compose\nplease see <a href=\"/7.0/documentation/integration/Standard_ActionHandlers/AHconfig/\">Standard Docker image for Action Handlers</a>.</p>\n</div>\n</div>\n</div>\n<div class=\"sect1\">\n<h2 id=\"_using_default_capability_configuration\">Using default capability configuration</h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>The Action Handler comes equipped with a default configuration for the most basic capabilities.\nTo use the default configuration, you need to set the environment variable <code>USE_DEFAULT_AH_CONFIGS</code>.\nThe following capabilities have a default configuration assigned:</p>\n</div>\n<div class=\"ulist\">\n<ul>\n<li>\n<p>ExecuteCommand</p>\n</li>\n<li>\n<p>HTTPRequest</p>\n</li>\n</ul>\n</div>\n<div class=\"listingblock\">\n<div class=\"title\">Using default configuration in docker-compose.yml</div>\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-yml\" data-lang=\"yml\">    environment:\n      USE_DEFAULT_AH_CONFIGS: ExecuteCommand,HTTPRequest</code></pre>\n</div>\n</div>\n</div>\n</div>\n<div class=\"sect1\">\n<h2 id=\"_setting_custom_capability_configuration\">Setting custom capability configuration</h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>Within the <code>docker-compose.yml</code> file we specify an environment variable <code>AH_CONFIG</code>.\nThis parameter contains the configuration of the Action Handler regarding which\ncapabilities to execute, and how to execute them.</p>\n</div>\n<div class=\"paragraph\">\n<p>As example, the <code>AH_CONFIG</code> in your docker-compose.yml might look like this:</p>\n</div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-yml\" data-lang=\"yml\">  environment:\n    AH_CONFIG: &gt;\n      {\n        \"handlers\":[\n          {\n            \"name\":\"SSH Remote Handler\",\n            \"capability\":\"ExecuteCommand\",\n            \"implementation\":\"SSH\",\n            \"exec\":\"$${command}\",\n            \"user\":\"$${user}\",\n            \"host\":\"$${host}\"\n          },\n          {\n            \"name\":\"HTTP Handler\",\n            \"capability\":\"HTTPRequest\",\n            \"implementation\":\"HTTP\",\n            \"method\":\"$${method}\",\n            \"url\":\"$${url}\",\n            \"params\":\"$${params}\",\n            \"body\":\"$${body}\",\n            \"insecure\":\"$${insecure}\"\n          }\n        ]\n      }</code></pre>\n</div>\n</div>\n<div class=\"paragraph\">\n<p>As you can see, the configuration specifies two handlers: <code>SSH Remote Handler</code>\nand <code>HTTP Handler</code>. Each handler is specified with a set of attributes, of which\nsome are common and some are specific to the type of implementation.</p>\n</div>\n<div class=\"paragraph\">\n<p>To begin with, three parameters are generic and mandatory for all capabilities:</p>\n</div>\n<div class=\"ulist\">\n<ul>\n<li>\n<p><strong>name</strong> - this is a descriptive name you give your action handler</p>\n</li>\n<li>\n<p><strong>capability</strong> - the identifier of the capability (action type), which the handler\nexecutes</p>\n</li>\n<li>\n<p><strong>implementation</strong> - selects one of the existing implementations for executing\nactions (e.g. SSH, HTTP). See below for a list of available implementations.</p>\n</li>\n</ul>\n</div>\n<div class=\"paragraph\">\n<p>The further parameters depend on the chosen implementation. For instance, the HTTP\nimplementation requires parameters such as <code>method</code>, <code>url</code> and <code>params</code>.</p>\n</div>\n<div class=\"paragraph\">\n<p>Parameters from capabilities can be referenced via <code>${name}</code>, so that you can make\nuse of the parameters sent by HIRO in the actions. The specific parameter values\nset by the HIRO &#8482; Engine through Knowledge Items (action statement) are filled\nin at run-time.</p>\n</div>\n<div class=\"paragraph\">\n<p><em>Please note:</em> parameter references need to be escaped by <code>$$</code> in the configuration\nfile. For instance, you need to write <code>$${url}</code>, which gets transformed into <code>${url}</code>\nby docker-compose.</p>\n</div>\n</div>\n</div>\n<div class=\"sect1\">\n<h2 id=\"_special_parameters\">Special Parameters</h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>Two additional optional parameters were introduced with version 0.21.7 of the action handler container:</p>\n</div>\n<div class=\"ulist\">\n<ul>\n<li>\n<p><strong>extract_fields</strong> can be used to specify if any of the return parameter fields should be processed by a JSON parser and the result be added to the result parameter set. A typical example for this would be \"body\" for an HTTP actionhandler returning a JSON map with multiple result fields which should be directly accessible from the calling KI</p>\n</li>\n<li>\n<p><strong>supply_token</strong> can be used to specify a parameter name which will be internally added before processing. The value of that parameter will be a freshly generated graph token that can be passed along to external handlers to allow access back to the graph.</p>\n</li>\n</ul>\n</div>\n</div>\n</div>\n<div class=\"sect1\">\n<h2 id=\"_available_capabilities\">Available capabilities</h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>Please check the <a href=\"/7.0/documentation/integration/Capabilities/capabilities_list/\">Capabilities List</a> for a list of existing capabilities.</p>\n</div>\n</div>\n</div>\n<div class=\"sect1\">\n<h2 id=\"_available_implementations\">Available implementations</h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>At the moment, the standard Action Handler supports the following implementations:</p>\n</div>\n<div class=\"ulist\">\n<ul>\n<li>\n<p>SSH</p>\n</li>\n<li>\n<p>HTTP</p>\n</li>\n<li>\n<p>REST</p>\n</li>\n<li>\n<p>LOCAL</p>\n</li>\n</ul>\n</div>\n<div class=\"paragraph\">\n<p>The SSH implementation executes remote commands via SSH protocol. The HTTP\nimplementation executes generic HTTP(s) calls to web endpoints while the REST\nimplementation execute calls to web services conforming to the REST ActionHandler\nprotocol specification of HIRO 6. The LOCAL implementation invokes a local shell\ncommand within the docker container - this can e.g. be used to extend the standard\ndocker image with custom scripts.</p>\n</div>\n<div class=\"paragraph\">\n<p>Beyond using these implementations for plain SSH or HTTPS calls, you can also\nuse them to invoke any custom implementations. To do so, you may capsulate your\ncustom code either as a web service (with HTTPS interface) or as a console script\nthat can be invoked by the SSH action handler implementation. In order to hide the\n\"internals\" it is advised to return proper json maps on one of the standard return\nchannels and process them with the extract_fields configuration parameter so that\nthe calling KI does not have to know about the actual invocation method.</p>\n</div>\n<div class=\"sect2\">\n<h3 id=\"_ssh_handler_implementation\">SSH Handler Implementation</h3>\n<div class=\"paragraph\">\n<p>The SSH handler implementation executes a command via ssh on a remote host.</p>\n</div>\n<div class=\"paragraph\">\n<p><strong>Supported input parameters:</strong></p>\n</div>\n<table class=\"tableblock frame-all grid-all\" style=\"width: 70%;\">\n<caption class=\"title\">Table 1. Supported Parameters</caption>\n<colgroup>\n<col style=\"width: 25%;\">\n<col style=\"width: 75%;\">\n</colgroup>\n<thead>\n<tr>\n<th class=\"tableblock halign-left valign-top\">Parameter</th>\n<th class=\"tableblock halign-left valign-top\">Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">host</p></td>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">hostname to connect to</p></td>\n</tr>\n<tr>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">port</p></td>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">port to connect to</p></td>\n</tr>\n<tr>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">user</p></td>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">user to connect as</p></td>\n</tr>\n<tr>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">password</p></td>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">optional password to use for login</p></td>\n</tr>\n<tr>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">user_dir</p></td>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">optional path where id_rsa and known_hosts are located</p></td>\n</tr>\n<tr>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">rsa_pass_phrase</p></td>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">optional passphrase for id_rsa</p></td>\n</tr>\n<tr>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">connect_timeout</p></td>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">timeout for establishing a connection</p></td>\n</tr>\n</tbody>\n</table>\n<div class=\"paragraph\">\n<p><strong>Provided return values:</strong></p>\n</div>\n<table class=\"tableblock frame-all grid-all\" style=\"width: 70%;\">\n<caption class=\"title\">Table 2. Return Values</caption>\n<colgroup>\n<col style=\"width: 25%;\">\n<col style=\"width: 75%;\">\n</colgroup>\n<thead>\n<tr>\n<th class=\"tableblock halign-left valign-top\">Parameter</th>\n<th class=\"tableblock halign-left valign-top\">Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">stdout</p></td>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">stdout output of the command</p></td>\n</tr>\n<tr>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">stderr</p></td>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">stderr output of the command</p></td>\n</tr>\n<tr>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">exit</p></td>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">exit code of the command</p></td>\n</tr>\n</tbody>\n</table>\n<div class=\"paragraph\">\n<p><strong>Configuration example:</strong></p>\n</div>\n<div class=\"listingblock\">\n<div class=\"title\">Sample SSH Handler Configuration</div>\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-json\" data-lang=\"json\">{\n  \"name\":\"SSH Remote Handler\",\n  \"capability\":\"ExecuteCommand\",\n  \"implementation\":\"SSH\",\n  \"exec\":\"$${command}\",\n  \"user\":\"$${user}\",\n  \"host\":\"$${host}\"\n},</code></pre>\n</div>\n</div>\n</div>\n<div class=\"sect2\">\n<h3 id=\"_http_handler_implementation\">HTTP Handler Implementation</h3>\n<div class=\"paragraph\">\n<p>The HTTP implementation executes an HTTPS or HTTP request to a web server.</p>\n</div>\n<div class=\"paragraph\">\n<p><strong>Supported input parameters:</strong></p>\n</div>\n<table class=\"tableblock frame-all grid-all\" style=\"width: 70%;\">\n<caption class=\"title\">Table 3. Supported Parameters</caption>\n<colgroup>\n<col style=\"width: 25%;\">\n<col style=\"width: 75%;\">\n</colgroup>\n<thead>\n<tr>\n<th class=\"tableblock halign-left valign-top\">Parameter</th>\n<th class=\"tableblock halign-left valign-top\">Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">method</p></td>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">http method, which should be executed (GET/POST/PUT/DELETE/&#8230;&#8203;)</p></td>\n</tr>\n<tr>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">url</p></td>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">url to which the request is to be sent</p></td>\n</tr>\n<tr>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">params</p></td>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">parameters to be included in the url</p></td>\n</tr>\n<tr>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">body</p></td>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">payload to be sent</p></td>\n</tr>\n<tr>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">headers</p></td>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">headers for the request in form of 'name=value\\\\n'</p></td>\n</tr>\n<tr>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">tls_version</p></td>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">specify the TLS version to use. This parameter is optional - the default TLS version is <code>1.3</code>.</p></td>\n</tr>\n<tr>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">username</p></td>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">username for basic auth</p></td>\n</tr>\n<tr>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">password</p></td>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">password for basic auth</p></td>\n</tr>\n<tr>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">client_certificate</p></td>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">absolute path to the file location of an SSL client certificate file</p></td>\n</tr>\n<tr>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">client_key</p></td>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">absolute path to the file location of an SSL client certificate key file</p></td>\n</tr>\n<tr>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">key_passphrase</p></td>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">passphrase for SSL client certificate file</p></td>\n</tr>\n<tr>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">oauth</p></td>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">identfier of a specified OAuth configuration to apply (authenticate via OAuth first, and then use a bearer token for the actual HTTPS call)</p></td>\n</tr>\n<tr>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">insecure</p></td>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">set to \"true\" to ignore invalid https signatures (NOT RECOMMENDED)</p></td>\n</tr>\n</tbody>\n</table>\n<div class=\"paragraph\">\n<p><strong>Provided return values:</strong></p>\n</div>\n<table class=\"tableblock frame-all grid-all\" style=\"width: 70%;\">\n<caption class=\"title\">Table 4. Return Values</caption>\n<colgroup>\n<col style=\"width: 25%;\">\n<col style=\"width: 75%;\">\n</colgroup>\n<thead>\n<tr>\n<th class=\"tableblock halign-left valign-top\">Parameter</th>\n<th class=\"tableblock halign-left valign-top\">Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">exec</p></td>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">executed http request in a format: \"${method} ${url} ${body}\"</p></td>\n</tr>\n<tr>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">code</p></td>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">http response code</p></td>\n</tr>\n<tr>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">body</p></td>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">http response body</p></td>\n</tr>\n<tr>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">headers</p></td>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">http response headers</p></td>\n</tr>\n</tbody>\n</table>\n<div class=\"paragraph\">\n<p><strong>Configuration examples:</strong></p>\n</div>\n<div class=\"paragraph\">\n<p>Here is an example of a generic HTTP configuration, which passes all parameters through as sent from a Knowledge Item:</p>\n</div>\n<div class=\"listingblock\">\n<div class=\"title\">Sample HTTP Handler Configuration</div>\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-json\" data-lang=\"json\">{\n  \"name\":\"HTTP Handler\",\n  \"capability\":\"HTTPRequest\",\n  \"implementation\":\"HTTP\",\n  \"method\":\"$${method}\",\n  \"url\":\"$${url}\",\n  \"params\":\"$${params}\",\n  \"body\":\"$${body}\",\n}</code></pre>\n</div>\n</div>\n<div class=\"paragraph\">\n<p>The next example shows how to use a specific URL to invoke a web service, using the <code>supply_token</code> option to pass on a static authentication token, and extracting fields from the returned response body.</p>\n</div>\n<div class=\"listingblock\">\n<div class=\"title\">Sample custom HTTP Endpoint requiring token and doing result parameter extraction</div>\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-json\" data-lang=\"json\">{\n  \"name\":\"My Custom REST Handler\",\n  \"capability\":\"MyCustomCapability\",\n  \"implementation\":\"HTTP\",\n  \"supply_token\":\"hirotoken\",\n  \"extract_fields\":[\"body\"],\n  \"headers\":\"Authorization=Bearer ${hirotoken}\",\n  \"url\":\"https://my-custom-service.local\"\n}</code></pre>\n</div>\n</div>\n<div class=\"paragraph\">\n<p>If this service now returns a json map in the result body that looks like</p>\n</div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-json\" data-lang=\"json\">{\n  \"customresult\":\"My Custom Handler result 1\",\n  \"customcode\":\"A custom handler code\"\n}</code></pre>\n</div>\n</div>\n<div class=\"paragraph\">\n<p>then the KI using it would be able to call it using</p>\n</div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight\"><code>  customresult: LOCAL::CustomResultVar, customcode: LOCAL::CustomResultVar = action(\"MyCustomCapability\")</code></pre>\n</div>\n</div>\n<div class=\"paragraph\">\n<p>If you want to connect to an API which requires authentication via OAuth, you can\nconfigure an OAuth endpoint, so that the HTTPS action handler retrieves a bearer\ntoken via OAuth first, before making the final HTTPS call.</p>\n</div>\n<div class=\"paragraph\">\n<p>For example, the handler and OAuth flow configuration to use OAuth with a\nServiceNow REST API could be specified like this:</p>\n</div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-json\" data-lang=\"json\">{\n    \"handlers\": [{\n            \"name\": \"HttpsWithBearer\",\n            \"capability\": \"HttpsWithBearer\",\n            \"implementation\": \"HTTP\",\n            \"headers\": \"${headers}\",\n            \"method\": \"${method}\",\n            \"url\": \"${url}\",\n            \"params\": \"${params}\",\n            \"body\": \"${body}\",\n            \"oauth\": \"${oauth}\"\n        }\n    ],\n    \"oauths\": {\n        \"service_now\": {\n            \"url\": \"https://devNNNNN.service-now.com/oauth_token.do\",\n            \"method\": \"post\",\n            \"headers\": [\n                \"content-type: application/x-www-form-urlencoded\"\n            ],\n            \"body\": \"grant_type=password&amp;client_id=&lt;CLIENT_ID&gt;&amp;client_secret=&lt;CLIENT_SECRET&gt;&amp;username=&lt;USER&gt;&amp;password=&lt;PASS&gt;\",\n            \"response\": {\n                \"ok_status\": 200,\n                \"stop_statuses\": [401],\n                \"access_token_field\": \"access_token\",\n                \"expires_in_field\": \"expires_in\"\n            }\n        }\n    }\n}</code></pre>\n</div>\n</div>\n<div class=\"paragraph\">\n<p>In this example, the identifier of the oauth set (<code>service_now</code>) needs to be passed\nas parameter in the action command from the Knowledge Item.</p>\n</div>\n</div>\n<div class=\"sect2\">\n<h3 id=\"_rest_handler_implementation\">REST Handler Implementation</h3>\n<div class=\"paragraph\">\n<p>The REST handler is a specialized version of the HTTP handler only for use with servers implementing the HIRO 6 REST ActionHandler protocol. With this ActionHandler, all parameters included in the call are passed on to the destination. So there cannot, but also does not need to be any parameter definition in the handler section.</p>\n</div>\n<div class=\"paragraph\">\n<p><strong>Supported input parameters:</strong></p>\n</div>\n<table class=\"tableblock frame-all grid-all\" style=\"width: 70%;\">\n<caption class=\"title\">Table 5. Supported Parameters</caption>\n<colgroup>\n<col style=\"width: 25%;\">\n<col style=\"width: 75%;\">\n</colgroup>\n<thead>\n<tr>\n<th class=\"tableblock halign-left valign-top\">Parameter</th>\n<th class=\"tableblock halign-left valign-top\">Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">url</p></td>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">endpoint url to which the request is to be sent</p></td>\n</tr>\n<tr>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">*</p></td>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">any paramter received is passed on</p></td>\n</tr>\n</tbody>\n</table>\n<div class=\"paragraph\">\n<p><strong>Provided return values:</strong></p>\n</div>\n<table class=\"tableblock frame-all grid-all\" style=\"width: 70%;\">\n<caption class=\"title\">Table 6. Return Values</caption>\n<colgroup>\n<col style=\"width: 25%;\">\n<col style=\"width: 75%;\">\n</colgroup>\n<thead>\n<tr>\n<th class=\"tableblock halign-left valign-top\">Parameter</th>\n<th class=\"tableblock halign-left valign-top\">Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">exec</p></td>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">executed http request in a format: \"${method} ${url} ${body}\"</p></td>\n</tr>\n<tr>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">code</p></td>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">http response code</p></td>\n</tr>\n<tr>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">body</p></td>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">http response body</p></td>\n</tr>\n</tbody>\n</table>\n<div class=\"paragraph\">\n<p><strong>Configuration example:</strong></p>\n</div>\n<div class=\"listingblock\">\n<div class=\"title\">Sample REST handler configuration</div>\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-json\" data-lang=\"json\">{\n  \"name\":\"My Custom REST Handler\",\n  \"capability\":\"MyCustomCapability\",\n  \"implementation\":\"REST\",\n  \"url\":\"https://my-custom-service.local\",\n}</code></pre>\n</div>\n</div>\n</div>\n<div class=\"sect2\">\n<h3 id=\"_local_implementation\">LOCAL Implementation</h3>\n<div class=\"paragraph\">\n<p>The <code>local</code> handler implementation executes a local shell command within the\ndocker container. It is recommended to use this implementation only if you extend the docker image by additional layers. For instance, you may add an additional docker layer with a script file, which gets executed via the <code>local</code> implementation.</p>\n</div>\n<div class=\"paragraph\">\n<p><strong>Supported input parameters:</strong></p>\n</div>\n<table class=\"tableblock frame-all grid-all\" style=\"width: 70%;\">\n<caption class=\"title\">Table 7. Supported Parameters</caption>\n<colgroup>\n<col style=\"width: 25%;\">\n<col style=\"width: 75%;\">\n</colgroup>\n<thead>\n<tr>\n<th class=\"tableblock halign-left valign-top\">Parameter</th>\n<th class=\"tableblock halign-left valign-top\">Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">exec</p></td>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">local shell command to execute</p></td>\n</tr>\n</tbody>\n</table>\n<div class=\"paragraph\">\n<p><strong>Provided return values:</strong></p>\n</div>\n<table class=\"tableblock frame-all grid-all\" style=\"width: 70%;\">\n<caption class=\"title\">Table 8. Return Values</caption>\n<colgroup>\n<col style=\"width: 25%;\">\n<col style=\"width: 75%;\">\n</colgroup>\n<thead>\n<tr>\n<th class=\"tableblock halign-left valign-top\">Parameter</th>\n<th class=\"tableblock halign-left valign-top\">Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">exec</p></td>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">presentation of executed command</p></td>\n</tr>\n<tr>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">stdout</p></td>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">stdout output of the command</p></td>\n</tr>\n<tr>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">stderr</p></td>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">stderr output of the command</p></td>\n</tr>\n<tr>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">exit</p></td>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">exit code of the command</p></td>\n</tr>\n</tbody>\n</table>\n<div class=\"paragraph\">\n<p><strong>Configuration example:</strong></p>\n</div>\n<div class=\"listingblock\">\n<div class=\"title\">Sample LOCAL Handler Configuration</div>\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-json\" data-lang=\"json\">{\n  \"name\":\"Custom Script Handler\",\n  \"capability\":\"MyCustomCapability\",\n  \"implementation\":\"local\",\n  \"exec\":\"python3 -u /scripts/my_script.py $${param1} $${param2}\"\n},</code></pre>\n</div>\n</div>\n</div>\n</div>\n</div>","document":{"main":"How to configure Action Handler capabilities","title":"How to configure Action Handler capabilities","subtitle":""},"fields":{"toc":true,"location":["documentation","integration","Standard_ActionHandlers","ah_capability_config"]}},"sidebarYaml":{"id":"6d066bdd-c982-5a69-b909-a31e6fc044e0","showIndex":null}},"pageContext":{"id":"912b0d9a-d78f-5f38-80c7-ca03cc231318","parent":"documentation"}},"staticQueryHashes":["1010459453","1010459453","2356112386","2356112386","2603905930","2603905930","3026652197","3026652197","3167850324","3167850324","63159454","63159454"]}