Manage Integration States

The Integrations Controller stores the states of UI integrations in <moog_intdb>.integration_state. To modify the state of an integration, you can either run it or use the Integrations API. If you use the Integrations API, you can modify the data ingestion information for a process group.

This topic provides an example state management workflow in which you combine queries to check an integration's state, then set its last poll time back an hour.

Before you begin

Before you start the workflow, ensure you have met the following requirements:

  • You have the name of the integration you want to modify.

  • The integration you want to modify is either running or pre-populated in a non-running state.

Check the integration state

Using basic authentication, make a GET request to retrieve the status of the integration, which contains the last poll time in milliseconds. In this example, ZabbixPolling2 is the name of the integration:

curl -u John.Doe:MyPassword https://<host>/integrations/api/v1/integration-states/ZabbixPolling2

The response indicates the last poll time. For example:

{
    "target1": {
        "last_poll_time_ms": 1574758921000
    }
}

Note

If you are checking the state of a LAM, in place of the integration name you use the HA group name. You can find this in the LAM configuration file under the ha section. See LAMs and High Availability for more information.

Modify the integration state

Now that you have the last poll time you can change the timestamp. Make a PUT request to the same endpoint with the new value for last_poll_time_ms:

 curl -X PUT \
  https://<host>/integrations/api/v1/integration-states/ZabbixPolling2_1 \
 -u John.Doe:MyPassword
  -H 'Content-Type: application/json' \
  -d '{
    "target1": {
        "last_poll_time_ms": 1574762521000
    }
}'

For a running integration, upon successful completion your changes instantly apply.

If the integration is not running or does not yet exist, the state is applied once the integration starts. See /integrations/{integrationId}/status for more information.