Moogsoft Docs

setPrcLabels

A MoogDb v2 method that sets the Probable Root Cause (PRC) labels for alerts within a Situation.

You can mark alerts as causal, non-causal or unlabeled within a Situation. An alert can have different PRC levels within different Situations.

Back to MoogDb V2 API Method Reference.

Request arguments

Method setPrcLabels takes the following request arguments:

Name

Type

Required

Description

situationId

Number

Yes

Situation ID.

object

JSON Object

Yes

A JSON object containing the following fields:

  • causal: A JSON array containing the alert IDs that you want to be marked as causal. Leave the list empty if there are no causal alerts.

  • non_causal: A JSON array containing the alert IDs that you want to be marked as non-causal. Leave the list empty if there are no non-causal alerts.

  • unlabelled: A JSON array containing the alert IDs that you do not want to be labeled as causal or non-causal. Leave the list empty if there are no unlabeled alerts.

Response

Method setPrcLabels returns the following response:

API update behavior

The behavior of this method depends on whether the relevant alert or Situation is open, closed and still in the active database, or closed and archived to the historic database. This method updates or returns information about the alert or Situation as follows:

See API Update Behavior for more information on Situation statuses.

Examples

The following examples demonstrate typical use of method setPrcLabels:

Request example

Example request to set alert IDs 1 and 2 as causal, alert IDs 3 and 7 as non-causal, and alert IDs 5 and 9 as unlabeled, in Situation ID 1:

var labelsSet = moogdb.setPrcLabels(1, { "causal" : [ 1, 2 ], "non_causal" : [ 3,7 ], "unlabelled" : [ 5, 9] });

Response example