LogpointApi.Core.Incident (logpoint_api v2.2.0)

Copy Markdown View Source

Manage incidents in Logpoint.

Wraps the Incident API for listing, assigning, commenting on, and changing the state of incidents.

Summary

Functions

Add comments to incidents.

Assign incidents to a user.

Close incidents.

Get incident data by object ID and incident ID.

Get users from the Logpoint instance.

List incidents within a time range.

List incident states within a time range.

Reopen incidents.

Resolve incidents.

Functions

add_comments(client, comments)

@spec add_comments(LogpointApi.Data.Client.t(), list()) ::
  {:ok, map()} | {:error, term()}

Add comments to incidents.

assign(client, incident_ids, assignee)

@spec assign(LogpointApi.Data.Client.t(), [String.t()], String.t()) ::
  {:ok, map()} | {:error, term()}

Assign incidents to a user.

close(client, incident_ids)

@spec close(LogpointApi.Data.Client.t(), [String.t()]) ::
  {:ok, map()} | {:error, term()}

Close incidents.

get(client, obj_id, incident_id)

@spec get(LogpointApi.Data.Client.t(), String.t(), String.t()) ::
  {:ok, map()} | {:error, term()}

Get incident data by object ID and incident ID.

get_users(client)

@spec get_users(LogpointApi.Data.Client.t()) :: {:ok, map()} | {:error, term()}

Get users from the Logpoint instance.

list(client, start_time, end_time, filters \\ %{})

@spec list(LogpointApi.Data.Client.t(), number(), number(), map()) ::
  {:ok, map()} | {:error, term()}

List incidents within a time range.

An optional filters map can be provided to filter by name, status, type, risk, attack_category, attack_tag, log_source, or custom metadata fields. Multiple values for a single filter can be comma-separated.

Examples

Incident.list(client, start_time, end_time)
Incident.list(client, start_time, end_time, %{status: "unresolved", risk: "critical"})

list_states(client, start_time, end_time, filters \\ %{})

@spec list_states(LogpointApi.Data.Client.t(), number(), number(), map()) ::
  {:ok, map()} | {:error, term()}

List incident states within a time range.

An optional filters map can be provided to filter by name, status, type, risk, attack_category, attack_tag, log_source, or custom metadata fields. Multiple values for a single filter can be comma-separated.

Note: filter support for this endpoint is unverified and filters may be ignored by the API.

Examples

Incident.list_states(client, start_time, end_time)
Incident.list_states(client, start_time, end_time, %{status: "unresolved"})

reopen(client, incident_ids)

@spec reopen(LogpointApi.Data.Client.t(), [String.t()]) ::
  {:ok, map()} | {:error, term()}

Reopen incidents.

resolve(client, incident_ids)

@spec resolve(LogpointApi.Data.Client.t(), [String.t()]) ::
  {:ok, map()} | {:error, term()}

Resolve incidents.