Docs/Tools/DevStats API/Incident

Incident API

URL Base:https://service.devstats.com/api/v1
Autorização

Token Bearer obrigatório. Incluir no header:

Authorization: Bearer <token>
GET/incidents

List Incidents

Retrieves a list of incidents.

Parâmetros de Query
NameTypeInRequiredDescription
per_pagenumberqueryNoMin: 1
pagenumberqueryNoMin: 1
repositorystringqueryNoMin length: 1Max length: 255
severitystringqueryNoEnum: critical, high, medium, low
statusstringqueryNoEnum: resolved, detected, investigating, identified, mitigated
GET /api/v1/incidents HTTP/1.1
Host: service.devstats.com
Authorization: Bearer <token>
Accept: application/json
Respostas
POST/incidents

Create Incident

Creates a new incident for the repository.

Corpo da Requisição
NameTypeInRequiredDescription
namestringbodyYesThe incident name.
severitystringbodyNoThe incident severity.
statusstringbodyNoThe incident status.
descriptionstringbodyNoThe incident description.
detected_bystringbodyYesEnum: automated_monitoring, customers, internally
root_causestring | nullbodyNoThe root cause of the incident.
started_atstringbodyYesThe incident start date in the ISO 8601 format.
resolved_atstringbodyNoThe resolved date in the ISO 8601 format.
repositoriesarraybodyYesThe full names of the repositories to associate with the incident.
POST /api/v1/incidents HTTP/1.1
Host: service.devstats.com
Authorization: Bearer <token>
Accept: application/json
Content-Type: application/json

{
  "name": "Problem with login",
  "severity": "high",
  "status": "detected",
  "description": "It's impossible to log in to the system.",
  "detected_by": "<detected_by>",
  "root_cause": "Database connection timeout",
  "started_at": "2024-07-20T15:30:00+00:00",
  "resolved_at": "2024-07-20T15:30:00+00:00",
  "repositories": [
    "organization/repository-one",
    "organization/repository-two"
  ]
}
Respostas
DELETE/incidents/{incident}

Delete Incident

Deletes an existing incident.

Parâmetros de Path
NameTypeInRequiredDescription
incidentstringpathYesThe incident UUID
DELETE /api/v1/incidents/<incident> HTTP/1.1
Host: service.devstats.com
Authorization: Bearer <token>
Accept: application/json
Respostas
PATCH/incidents/{incident}

Update Incident

Updates an existing incident.

Parâmetros de Path
NameTypeInRequiredDescription
incidentstringpathYesThe incident UUID
Corpo da Requisição
NameTypeInRequiredDescription
namestringbodyNoThe incident name.
severitystringbodyNoThe incident severity.
statusstringbodyNoThe incident status.
descriptionstringbodyNoThe incident description.
detected_bystringbodyNoEnum: automated_monitoring, customers, internally
root_causestring | nullbodyNoThe root cause of the incident.
started_atstringbodyNoThe incident start date in the ISO 8601 format.
resolved_atstringbodyNoThe resolved date in the ISO 8601 format.
repositoriesarraybodyNoThe full names of the repositories to associate with the incident.
PATCH /api/v1/incidents/<incident> HTTP/1.1
Host: service.devstats.com
Authorization: Bearer <token>
Accept: application/json
Content-Type: application/json

{
  "name": "Problem with login",
  "severity": "high",
  "status": "detected",
  "description": "It's impossible to log in to the system.",
  "detected_by": "<detected_by>",
  "root_cause": "Database connection timeout",
  "started_at": "2024-07-20T15:30:00+00:00",
  "resolved_at": "2024-07-20T15:30:00+00:00",
  "repositories": [
    "organization/repository-one",
    "organization/repository-two"
  ]
}
Respostas