Skip to main content

Create a Broker Profile

Each broker uses a profile which contains the connection information for other Moogsoft Enterprise components, such as the APIs 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 Enterprise 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 rabbit_config property value 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 UI service for 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

If you omit this property, the broker communicates using WebSockets on the value of controller_url instead.

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.

proxy

JSON Object

No

The proxy object used for broker HTTP communication. It contains the following parameters:

  • proxy: Proxy configuration to connect to the controller (optional).

  • host: Host of the proxy (mandatory).

  • port: Port of the proxy (mandatory).

  • username: Username of proxy for basic authentication (optional).

  • password: Password for the proxy (mandatory if username is used).

Note

You can configure a broker profile to communicate using WebSockets instead of RabbitMQ. Omit the rabbit_config property from your configuration when you create the broker profile. Brokers you assign this profile will then communicate over the address of controller_url instead. Any integrations running on the broker also inherit this configuration.

You cannot configure the internal broker to communicate over WebSockets because the internal broker uses the default profile.

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.

Configure the Moogsoft Enterprise Integration

After you create the broker profile, you install integrations using the UI at Integrations > Available Integrations.

Brokers communicate with Moogsoft Enterprise using either RabbitMQ or WebSockets.

If you have set up a WebSockets broker, when you are installing an integration, you select where the integration will be run:

  • Run on Remote Broker if the broker communicates using WebSockets.

  • Run on Moogsoft Cloud if the broker communicates using RabbitMQ.

Examples

The following examples demonstrate typical use of endpoint broker-profiles for RabbitMQ and WebSockets broker responses.

RabbitMQ Broker 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": "RabbitMQ 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"
        }
      }
     }'

RabbitMQ Broker Response Example

Example response returning details of the newly created profile:

{
  "name": "RabbitMQ 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"
    }
  }
}

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

WebSockets Broker Request Example

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

curl -X POST \
  https://aiops.example.com/integrations/api/v1/broker-profiles \
  -H 'Content-Type: application/json' \
  -u john.doe:<password> \
  -d '{
      "name": "WebSocket Broker Profile (with proxy)",
      "config": 
      {
        "controller_url": "https://aiops.example.com",
        "port_range_min": 50000,
        "port_range_max": 51000,
        "proxy": {
          "host": "10.1.1.2",
          "port": 3128,
          "username": "test",
          "password": "pass1234"
        }
      }
     }'

WebSockets Broker Response Example

Example response returning details of the newly created profile:

{
  "name": "WebSocket Broker Profile (with proxy)",
  "config": 
  {
    "controller_url": "https://aiops.example.com",
    "port_range_min": 50000,
    "port_range_max": 51000,
    "proxy": {
      "host": "10.1.1.2",
      "port": 3128,
      "username": "test",
      "password": "pass1234"
    }
  }
}

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