Triggering BMC AMI Ops Automation using the Common REST API
You can use the Common REST API opsa endpoint to send BRC events that trigger BRC Rules in BMC AMI Ops Automation. For more information about automation in BMC AMI OpsA, see Automating with Rules.
Before you begin
- You must have CRA installed and running. For more information, see Setting-up-the-Common-REST-API.
- You must have BMC AMI OpsA installed and running. For more information, see Getting-started-with-BMC-AMI-Ops-Automation for more details.
Firing a BRC Rule using the opsa endpoint
The opsa endpoint uses the POST method to fire a BRC Rule. Use a URL based on the following structure:
https://<hostName>:<portNumber>/cra/opsa
The variables represent the following values:
- <hostName> is the name of the mainframe host where the CRA server is running.
- <portNumber> is the port number of the CRA server.
Authentication
By default the opsa endpoint doesn’t require authentication.
To enable authentication, add opsa.auth=true to the application.properties file, located on the CRA server in the installationDirectory/amiops/config directory, and restart the CRAserver.
If the opsa.auth is set to true, authentication can be done by either of the following options:
- If the CRA server is configured to require a client certificate, authentication is done by the Tomcat client certificate validation.
- Otherwise you can provide a username and password as a basic authentication header.
Body
Include the following parameters in the body:
Parameter | Description |
---|---|
className | (required) Example: MV_EVENT |
message | The message that is included in the event {{code language="none"}} message and textId cannot both be empty. At least one must have content. |
severity | (optional) Possible values are – CRITICAL, WARNING, MAJOR, MINOR, INFO, CLEAR |
textId | ID of the event textId is sent at the beginning of the message followed by a space character. textId can be a maximum of 16 characters. message and textId cannot both be empty. At least one must have content. |
tls | (SPE2204) If you set tls=true, with no keystore configured, the following error is issued: For more information about setting up your keystore, see To enable TLS communication with BMC AMI Ops Automation. |
slots | (optional) for populating additional slots of a BAROC event |
opsaHost | (required) Host of the BMC AMI Ops server |
opsaPort | (required) Port of the BMC AMI Ops server |
The body should look something like this:
"className": "MV_EVENT",
"message": "Test2",
"severity": "CRIT",
"textId": "CRA",
"tls:"true",
"slots": {
"mc_tool_time": "1624948567957"
},
"opsaHost": "server1.bmc.com",
"opsaPort": "14888"
}
HTTP status and reason codes
The following HTTP status codes are returned for the indicated errors, and the response body is a standard error response body providing the reason code indicated and associated error message.
Error Code | Explanation | |
---|---|---|
200 | Successful completion | |
401 | Authentication error Details are provided in the error message. | |
404 | Path not valid | |
500 | BMC AMI OpsA server is not accessible Details are provided in the error message. |
Related Topic