Moogsoft Docs

/integrations/{integrationId}/status

The /integrations/{integrationID}/status endpoint allows you to check and update the status of an integration.

Back to Integrations API Endpoint Reference.

GET

Retrieves the status of an integration.

Request arguments

The GET request takes the following request argument:

Name

Type

Required

Description

integrationId

Integer

Yes

ID of the integration to retrieve. You can obtain an integration's ID by executing a GET request to /integrations.

Response

The GET request returns the following response:

Successful requests return an array of JSON objects containing the following:

Name

Type

Description

instances

String

URL of the instance(s) in an Object of Broker IDs that map to the integration status info. For example:

"instances": 
{
    "Broker_3a52b7ef_8bad_41cc_8b36_cbb9c2aa3a9e@: 
    {
        "integration_name: "Azure1",
        "status": "running",
        "last_heartbeat": 1567789762645
    }
}

global

Object

Contains integration_config_id and status.

integration_config_id

Integer

ID of the integration.

status

String

Current status of the integration.

Examples

The following examples demonstrate making a GET request to the endpoint /integrations/{integrationId}/status:

Request example

Example cURL GET request to retrieve the current status of the integration with the ID "6":

curl \ 
https://example.com/integrations/api/v1/integrations/6/status \ 
-u John.Doe:MyPassword \
-H "accept: application/json"
Response example

Example response returning the integration's current status:

{
    "global": 
    {
        "integration_config_id": 6,"
        status": "running"
    },
    "instances": 
    {
        "Broker_3a52b7ef_8bad_41cc_8b36_cbb9c2aa3a9e": 
        {
            "integration_name": "Azure1",
            "status": "running",
            "last_heartbeat": 1567789762645
        }
    }
}
PUT

Updates the status of an integration. You can use this to start and stop integrations. An integration can run on multiple brokers; when assigning an integration to a broker, Moogsoft AIOps favours the broker(s) running the least integrations.

Request arguments

The PUT request takes the following request argument:

Name

Type

Required

Description

integrationId

Integer

Yes

ID of the integration to update.

Response

The PUT request returns the following response:

Successful requests return an array of JSON objects containing the following:

Name

Type

Required

Description

command

String

Yes

Status command you want to make. Choose from start and stop.

target

String

Yes, unless using the start command

Broker on which to run or stop the integration.

If unspecified, Moogsoft AIOps starts the integration on the broker running the least integrations.

Examples

The following examples demonstrate making a PUT request to the endpoint /integrations/{integrationId}/status:

Request example

Example cURL PUT request to update an integration.

curl -X PUT \
https://example.com/integrations/api/v1/integrations/6/status \ 
-u John.Doe:MyPassword \
{
  "command": "start"
}
Response example

A successful request returns the HTTP code 204 and no response text.