IncidentIo.IncidentAttachmentsV1 (IncidentIo v0.3.1)

View Source

Manage attachments on incidents.

Incident attachments link external resources (e.g. Jira issues, GitHub PRs, PagerDuty alerts) to an incident. Each attachment has a resource type and a permalink to the external resource.

Summary

Functions

Attaches an external resource to an incident.

Unattaches an external resource from an incident.

List all incident attachments for a given external resource or incident. You must provide either a specific incident ID or a specific external resource type and external ID.

Functions

create(client \\ %Client{}, body)

@spec create(IncidentIo.Client.t(), request_body()) :: IncidentIo.response()

Attaches an external resource to an incident.

Incident attachment body example:

%{
  incident_id: "01FDAG4SAP5TYPT98WGR2N7W91",
  resource: %{
    external_id: "123",
    resource_type: "pager_duty_incident"
  }
}

Example

IncidentIo.IncidentAttachmentsV1.create(client, body)

More information at: https://api-docs.incident.io/tag/Incident-Attachments-V1#operation/Incident-Attachments%20V1_Create

destroy(client \\ %Client{}, id)

Unattaches an external resource from an incident.

Example

IncidentIo.IncidentAttachmentsV1.destroy(client, body)

More information at: https://api-docs.incident.io/tag/Incident-Attachments-V1#operation/Incident-Attachments%20V1_Delete

list(client \\ %Client{}, incident_id \\ nil, external_id \\ nil, resource_type \\ nil)

@spec list(IncidentIo.Client.t(), nil, binary(), resource_type()) ::
  IncidentIo.response()

List all incident attachments for a given external resource or incident. You must provide either a specific incident ID or a specific external resource type and external ID.

Example

IncidentIo.IncidentAttachmentsV1.list(client, "some-incident-id")

IncidentIo.IncidentAttachmentsV1.list(client, nil, "some-external-id", :pager_duty_incident)

More information at: https://api-docs.incident.io/tag/Incident-Attachments-V1#operation/Incident-Attachments%20V1_List