Reference Source Test
public class | source

Incidents

Extends:

* → Incidents

Incidents Class - Provides access to the Mux Data Incidents API

Example:

const { Data } = new Mux(accessToken, secret);

// Returns a list of all open incidents
Data.Incidents.list({ status: 'open' });

Test:

Method Summary

Public Methods
public

get(incidentId: string): Promise

Returns the details for a single incident

public

list(params: Object): Promise

Returns a list of all open incidents

public

related(incidentId: string, params: Object): Promise

Returns all the incidents that seem related to a specific incident

Public Methods

public get(incidentId: string): Promise source

Returns the details for a single incident

Params:

NameTypeAttributeDescription
incidentId string

The ID for the incident

Return:

Promise

Returns a resolved Promise with a response from the Mux API

Example:

const muxClient = new Mux(accessToken, secret);
const { Data } = muxClient;

//Returns the details for a single incident
Data.Incidents.get('ABCD1234');

Test:

See:

public list(params: Object): Promise source

Returns a list of all open incidents

Params:

NameTypeAttributeDescription
params Object
  • optional

example { status: 'open', severity: 'warning' }

Return:

Promise

Returns a resolved Promise with a response from the Mux API

Example:

const { Data } = new Mux(accessToken, secret);

// Returns a list of all open incidents
Data.Incidents.list({ status: 'open' });

See:

Returns all the incidents that seem related to a specific incident

Params:

NameTypeAttributeDescription
incidentId string

The ID for the incident

params Object
  • optional

example { measurement: 'median' }

Return:

Promise

Returns a resolved Promise with a response from the Mux API

Example:

const muxClient = new Mux(accessToken, secret);
const { Data } = muxClient;

//Returns all the incidents that seem related to a specific incident
Data.Incidents.related('ABCD1234');

Test:

See: