Expectation Incidents

An ExpectationIncident groups ongoing failure behavior for an Expectation over time.

List Expectation Incidents

SDK Method

ExpectationIncident.list()

Return Object

ExpectationIncident[]

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Additional Arguments

Example Request

import ExpectationIncident from 'files.com/lib/models/ExpectationIncident';
import * as FilesErrors from 'files.com/lib/Errors';

try {
  const expectationIncidents = await ExpectationIncident.list();
  for (const expectationIncident of expectationIncidents) {
    // Operate on expectationIncident
  }
} catch (err) {
  if (err instanceof FilesErrors.NotAuthenticatedError) {
    console.error(`Authentication Error Occurred (${err.constructor.name}): ${err.error}`);
  } else if (err instanceof FilesErrors.FilesError) {
    console.error(`Unknown Error Occurred (${err.constructor.name}): ${err.error}`);
  } else {
    throw err;
  }
}

Show Expectation Incident

SDK Method

ExpectationIncident.find()

Return Object

ExpectationIncident

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Method Arguments

ArgumentDescription
id
int64
Required
Expectation Incident ID.

Example Request

import ExpectationIncident from 'files.com/lib/models/ExpectationIncident';
import * as FilesErrors from 'files.com/lib/Errors';

try {
  const expectationIncident = await ExpectationIncident.find(id);
  // Operate on expectationIncident
} catch (err) {
  if (err instanceof FilesErrors.NotAuthenticatedError) {
    console.error(`Authentication Error Occurred (${err.constructor.name}): ${err.error}`);
  } else if (err instanceof FilesErrors.FilesError) {
    console.error(`Unknown Error Occurred (${err.constructor.name}): ${err.error}`);
  } else {
    throw err;
  }
}

Resolve an expectation incident

SDK Method

expectationIncident.resolve()

Return Object

ExpectationIncident

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Example Request

import ExpectationIncident from 'files.com/lib/models/ExpectationIncident';
import * as FilesErrors from 'files.com/lib/Errors';

try {
  // Find the expectationIncident object by its id.
  const expectationIncident = await ExpectationIncident.find(id);
  await expectationIncident.resolve();
} catch (err) {
  if (err instanceof FilesErrors.NotAuthenticatedError) {
    console.error(`Authentication Error Occurred (${err.constructor.name}): ${err.error}`);
  } else if (err instanceof FilesErrors.FilesError) {
    console.error(`Unknown Error Occurred (${err.constructor.name}): ${err.error}`);
  } else {
    throw err;
  }
}

Snooze an expectation incident until a specified time

SDK Method

expectationIncident.snooze()

Return Object

ExpectationIncident

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Method Arguments

ArgumentDescription
snoozed_until
string
Required
Time until which the incident should remain snoozed.

Example Request

import ExpectationIncident from 'files.com/lib/models/ExpectationIncident';
import * as FilesErrors from 'files.com/lib/Errors';

try {
  // Find the expectationIncident object by its id.
  const expectationIncident = await ExpectationIncident.find(id);
  await expectationIncident.snooze({
    snoozed_until: "snoozed_until",
  });
} catch (err) {
  if (err instanceof FilesErrors.NotAuthenticatedError) {
    console.error(`Authentication Error Occurred (${err.constructor.name}): ${err.error}`);
  } else if (err instanceof FilesErrors.FilesError) {
    console.error(`Unknown Error Occurred (${err.constructor.name}): ${err.error}`);
  } else {
    throw err;
  }
}

Acknowledge an expectation incident

SDK Method

expectationIncident.acknowledge()

Return Object

ExpectationIncident

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Example Request

import ExpectationIncident from 'files.com/lib/models/ExpectationIncident';
import * as FilesErrors from 'files.com/lib/Errors';

try {
  // Find the expectationIncident object by its id.
  const expectationIncident = await ExpectationIncident.find(id);
  await expectationIncident.acknowledge();
} catch (err) {
  if (err instanceof FilesErrors.NotAuthenticatedError) {
    console.error(`Authentication Error Occurred (${err.constructor.name}): ${err.error}`);
  } else if (err instanceof FilesErrors.FilesError) {
    console.error(`Unknown Error Occurred (${err.constructor.name}): ${err.error}`);
  } else {
    throw err;
  }
}

The ExpectationIncident Object

Some of the methods above return a ExpectationIncident object. The attributes of this object are listed below.

AttributeDescription
id
int64
Expectation Incident ID
workspace_id
int64
Workspace ID. 0 means the default workspace.
expectation_id
int64
Expectation ID.
status
string
Incident status.
Possible values: open, acknowledged, snoozed, resolved
opened_at
date-time
When the incident was opened.
last_failed_at
date-time
When the most recent failing evaluation contributing to the incident occurred.
acknowledged_at
date-time
When the incident was acknowledged.
snoozed_until
date-time
When the current snooze expires.
resolved_at
date-time
When the incident was resolved.
opened_by_evaluation_id
int64
Evaluation that first opened the incident.
last_evaluation_id
int64
Most recent evaluation linked to the incident.
resolved_by_evaluation_id
int64
Evaluation that resolved the incident.
summary
object
Compact incident summary payload.
created_at
date-time
Creation time.
updated_at
date-time
Last update time.