Triggering BMC AMI Ops Automation using the Common REST API
Before you begin
- You must have CRA server installed and running. For more information, see Installing-and-configuring-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 cra_custom.properties file, located on the CRA server in the "${CRA_INSTALL_PATH}"/cra_custom.properties 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 CRA server 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 the 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. |