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

Some content is unavailable due to permissions.

. For more information about automation in

Some content is unavailable due to permissions.

, see Automating with Rules.

Before you begin

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.

Important

TLS encrypted connection between CRA and

Some content is unavailable due to permissions.

is not supported.

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
{{/code}}
is concatenated to {{code language="none"}}
textId
{{/code}}
to form the message sent by the Rule.

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.

slots

(optional) for populating additional slots of a BAROC event

opsaHost

(required) Host of the MainView server

opsaPort

(required) Port of the MainView server

The body should look something like this:

{
   "className": "MV_EVENT",
   "message": "Test2",
   "severity": "CRIT",
   "textId": "CRA",
   "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

Some content is unavailable due to permissions.

server is not accessible

Details are provided in the error message.




 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*