Create a requestor plug-in

POST method to add a requestor plug-in configuration in the cluster.

Method URL Description
POST https://host_name:port/platform/rest/hostfactory/requestorplugins Add a requestor plug-in configuration. Can add only one requestor plug-in in this RESTful API.

Prerequisites

  • You must be the cluster administrator, or your user account must be assigned the HF_ALL_REQUESTOR_MANAGE permission.
  • This REST API does not create the script path automatically. You must manually create the requester scripts directory specified for the scriptPath parameter. For example, the absolute path to the requestor scripts directory, by default is:
    ${HF_TOP}/${HF_VERSION}/requestorplugins/requestor_name/scripts/
    where requestor_name is the requestor specified by the name parameter. The HF_TOP environment variable is defined in the hostfactory.xml file. For more information, see hostfactory.xml reference topic.

Request

POST https://host_name:port/platform/rest/hostfactory/requestorplugins
Table 1. Request parameter
Parameter Type Required/Optional Description
hfcsrftoken string Optional CSRF token that is obtained with successful login.

If you use curl, the command might look like the following example:

curl --header -b /tmp/cookie --cacert /opt/ibm/spectrumcomputing/wlp/usr/shared/resources/security/cacert.pem --tlsv1.2 -X POST https://myprimaryhost.example.com:9443/platform/rest/hostfactory/requestorplugins?hfcsrftoken=915ee7644f431e630dac68b9ab3e40bc -d '{"name": "symB","enabled": 1,"needEGOCredential":1, "scriptPath": "${HF_TOP}/${HF_VERSION}/requestorplugins/symB/scripts/"}'
This command takes a JSON request string to create a new requestor plug-in with the following sample configuration details:
{
   "name": "symB",
   "enabled": 1,
   "needEGOCredential": 1,
   "scriptPath": "${HF_TOP}/${HF_VERSION}/requestorplugins/symB/scripts/"
}

Response

The command returns to the updated hostRequestorPlugins.json file at:
  • $EGO_CONFDIR/../../hostfactory/conf/requestorplugins/ on Linux®
  • %EGO_CONFDIR%\..\..\hostfactory\conf\requestorplugins\ on Windows
Status code Description
201 Created.
400 Bad request. Duplicate or invalid parameter.
500 Internal server error. Check the log files and look for hints in the API response body.