Create a Broker Profile

Each broker uses a profile which contains the connection information for other Moogsoft AIOps components, such as the APIs, the database, and the Message Bus.

You use the broker-profiles endpoint of the integrations API to create a broker profile, for example:

<host>/integrations/api/v1/broker-profiles

Where <host> is the URL of the Moogsoft AIOps instance you want to create the new profile on.

Before you begin

Before you create your new profile, ensure you have met the following requirements:

  • You are running RHEL/CentOS 7.

  • You have the values of the rabbit_config and mysql_config properties from the system.conf file. You can find the file in $MOOGSOFT_HOME/config.

  • The ports you want to configure the profile on are open.

Request body

Endpoint broker-profiles takes the following properties:

Name

Type

Required

Description

name

String

Yes

The name of the new broker.

config

JSON Object

Yes

The top-level object containing the config attributes.

controller_url

String

Yes

The URL of the integrations page on your instance. For example "https://aiops.example.com"

port_range_min

Integer

Yes

Minimum port number for the broker to use.

port_range_max

Integer

Yes

Maximum port number for the broker to use.

rabbit_config

JSON Object

Yes

The top-level object containing the rabbit_config attributes. These should match your RabbitMQ broker configuration in system.conf

brokers

JSON Object

Yes

The host and port of the RabbitMQ broker.

zone

String

Yes

The name of the zone.

username

String

Yes

The username of the RabbitMQ user.

password

String

Yes

The password for the RabbitMQ user.

mysql_config

JSON Objects

Yes

The top-level object containing the mysql_config attributes.

host

String

Yes

The host name or server name of the server that is running MySQL.

moogdb_database_name

String

Yes

The name of the primary Moogsoft AIOps database.

intdb_database_name

String

Yes

The name of the moog_reference database

username

String

Yes

The username of the MySQL user.

password

String

Yes

The MySQL user's password.

port

Integer

Yes

The port that MySQL uses.

Response

The endpoint returns the following response:

Type

Description

HTTP

HTTP status or error code indicating request success or failure. See HTTP status code definitions for more information.

Examples

The following examples demonstrate typical use of endpoint broker-profiles.

Request Example

Example cURL request to https://aiops.example.com/integrations/api/v1/broker-profiles:

curl -X POST \
  https://aiops.example.com/integrations/api/v1/broker-profiles \
  -H 'Content-Type: application/json' \
  -u john.doe:<password> \
  -d '{
      "name": "Main Broker Profile",
      "config": 
      {
          "controller_url": "https://aiops.example.com",
          "port_range_min": 50000,
          "port_range_max": 51000,
          "rabbit_config": 
          {  
              "brokers": [
              {
                  "host": "aiops.example.com",
                  "port": 5672
              }
                         ],   
                  "zone": "zonex",
                  "username": "jdoe",
                  "password": "eg123"
          },    
          "mysql_config": 
          {
              "host": "aiops.example.com",
              "moogdb_database_name": "moogdb",
              "intdb_database_name": "moog_intdb",
              "username": "janedoe",
              "password": "123eg",
              "port": 3306
          }
      }
     }'

Response Example

Example response returning details of the newly created profile:

{
  "name": "Main Broker Profile",
  "config": 
  {
      "controller_url": "https://aiops.example.com",
      "port_range_min": 50000,
      "port_range_max": 51000,
      "rabbit_config": 
      {
          "brokers": [
          {
              "host": "aiops.example.com",
              "port": 5672
          }
                     ],
          "zone": "zonex",
          "username": "jdoe",
          "password": "eg123"
      },
      "mysql_config": 
      {
          "host": "aiops.example.com",
          "moogdb_database_name": "moogdb",
          "intdb_database_name": "moog_intdb",
          "username": "janedoe",
          "password": "123eg",
          "port": 3306
      }
  }
}

After creating a broker profile, you can use it with any broker you subsequently create in the Moogsoft AIOps UI. See Create a Broker for more information.