Hogar / Alertas: métodos API y exportaciones

Alertas: métodos API y exportaciones

Consulte eventos del proyecto o informe, indicadores y series temporales. Use los métodos específicos de exportación CSV y métricas de seguimiento.

En esta página

Elija un método en el índice. Revise el método HTTP, la ruta, los permisos, los parámetros obligatorios y el cuerpo. Los bloques JSON con schema, properties y $ref describen el contrato; no se envían como cuerpo de una solicitud. Los ejemplos de solicitudes y los esquemas de respuesta están identificados por separado.

GET /public-api/v1/diff-projects/{id}/alerts

Parámetros

Modelos de datos relacionados: CacheControl · RateLimitLimit · RateLimitRemaining · RateLimitResetAt · RetryAfter · XRequestID · DiffAlertListResponse · ErrorResponse · XID

id (path)

{
  "required": true,
  "schema": {
    "$ref": "#/components/schemas/XID"
  }
}

trigger_code (query)

{
  "schema": {
    "type": "string"
  }
}

created_from (query)

{
  "schema": {
    "type": "string",
    "format": "date-time"
  }
}

created_to (query)

{
  "schema": {
    "type": "string",
    "format": "date-time"
  }
}

limit (query)

{
  "schema": {
    "type": "integer",
    "minimum": 1,
    "maximum": 10000,
    "default": 1000
  }
}

offset (query)

{
  "schema": {
    "type": "integer",
    "minimum": 0,
    "default": 0
  }
}

url_md5 (query)

{
  "schema": {
    "type": "string",
    "pattern": "^[a-fA-F0-9]{32}$"
  }
}

email (query)

{
  "schema": {
    "type": "string",
    "maxLength": 255
  }
}

trigger_group (query)

{
  "schema": {
    "type": "string"
  }
}

include_raw (query)

{
  "schema": {
    "type": "boolean"
  }
}

Respuestas

200

Alertas.

{
  "headers": {
    "X-Request-ID": {
      "$ref": "#/components/headers/XRequestID"
    }
  },
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/DiffAlertListResponse"
      }
    }
  }
}

default

Sin una clave válida, las cabeceras de límites corresponden a intentos fallidos por IP. Tras la autenticación, corresponden a la clave o cuenta. Pueden faltar por un bloqueo previo o un contador no disponible. X-RateLimit-Reset es una marca de tiempo Unix en segundos; Retry-After en 429 es una espera en segundos.

{
  "headers": {
    "X-Request-ID": {
      "$ref": "#/components/headers/XRequestID"
    },
    "X-RateLimit-Limit": {
      "$ref": "#/components/headers/RateLimitLimit"
    },
    "X-RateLimit-Remaining": {
      "$ref": "#/components/headers/RateLimitRemaining"
    },
    "X-RateLimit-Reset": {
      "$ref": "#/components/headers/RateLimitResetAt"
    },
    "Cache-Control": {
      "$ref": "#/components/headers/CacheControl"
    },
    "Retry-After": {
      "$ref": "#/components/headers/RetryAfter"
    }
  },
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/ErrorResponse"
      }
    }
  }
}

GET /public-api/v1/diff-projects/{id}/reports/{report_id}/alerts

Parámetros

Modelos de datos relacionados: CacheControl · RateLimitLimit · RateLimitRemaining · RateLimitResetAt · RetryAfter · XRequestID · DiffAlertListResponse · ErrorResponse · XID

id (path)

{
  "required": true,
  "schema": {
    "$ref": "#/components/schemas/XID"
  }
}

report_id (path)

Xid del informe o el literal last. El literal last solo se admite en este parámetro de ruta.

{
  "required": true,
  "schema": {
    "type": "string",
    "minLength": 4,
    "maxLength": 64,
    "pattern": "^([A-Za-z0-9_-]+|last)$"
  }
}

trigger_code (query)

{
  "schema": {
    "type": "string"
  }
}

limit (query)

{
  "schema": {
    "type": "integer",
    "minimum": 1,
    "maximum": 10000,
    "default": 1000
  }
}

offset (query)

{
  "schema": {
    "type": "integer",
    "minimum": 0,
    "default": 0
  }
}

url_md5 (query)

{
  "schema": {
    "type": "string",
    "pattern": "^[a-fA-F0-9]{32}$"
  }
}

email (query)

{
  "schema": {
    "type": "string",
    "maxLength": 255
  }
}

trigger_group (query)

{
  "schema": {
    "type": "string"
  }
}

include_raw (query)

{
  "schema": {
    "type": "boolean"
  }
}

Respuestas

200

Alertas.

{
  "headers": {
    "X-Request-ID": {
      "$ref": "#/components/headers/XRequestID"
    }
  },
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/DiffAlertListResponse"
      }
    }
  }
}

default

{
  "headers": {
    "X-Request-ID": {
      "$ref": "#/components/headers/XRequestID"
    },
    "X-RateLimit-Limit": {
      "$ref": "#/components/headers/RateLimitLimit"
    },
    "X-RateLimit-Remaining": {
      "$ref": "#/components/headers/RateLimitRemaining"
    },
    "X-RateLimit-Reset": {
      "$ref": "#/components/headers/RateLimitResetAt"
    },
    "Cache-Control": {
      "$ref": "#/components/headers/CacheControl"
    },
    "Retry-After": {
      "$ref": "#/components/headers/RetryAfter"
    }
  },
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/ErrorResponse"
      }
    }
  }
}

GET /public-api/v1/diff-projects/{id}/alerts/summary

Parámetros

Modelos de datos relacionados: CacheControl · RateLimitLimit · RateLimitRemaining · RateLimitResetAt · RetryAfter · XRequestID · DiffAlertSummaryResponse · ErrorResponse · XID

id (path)

{
  "required": true,
  "schema": {
    "$ref": "#/components/schemas/XID"
  }
}

created_from (query)

{
  "schema": {
    "type": "string",
    "format": "date-time"
  }
}

created_to (query)

{
  "schema": {
    "type": "string",
    "format": "date-time"
  }
}

url_md5 (query)

{
  "schema": {
    "type": "string",
    "pattern": "^[a-fA-F0-9]{32}$"
  }
}

email (query)

{
  "schema": {
    "type": "string",
    "maxLength": 255
  }
}

trigger_code (query)

{
  "schema": {
    "type": "string"
  }
}

trigger_group (query)

{
  "schema": {
    "type": "string"
  }
}

include_raw (query)

{
  "schema": {
    "type": "boolean"
  }
}

Respuestas

200

Resumen de alertas.

{
  "headers": {
    "X-Request-ID": {
      "$ref": "#/components/headers/XRequestID"
    }
  },
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/DiffAlertSummaryResponse"
      }
    }
  }
}

default

{
  "headers": {
    "X-Request-ID": {
      "$ref": "#/components/headers/XRequestID"
    },
    "X-RateLimit-Limit": {
      "$ref": "#/components/headers/RateLimitLimit"
    },
    "X-RateLimit-Remaining": {
      "$ref": "#/components/headers/RateLimitRemaining"
    },
    "X-RateLimit-Reset": {
      "$ref": "#/components/headers/RateLimitResetAt"
    },
    "Cache-Control": {
      "$ref": "#/components/headers/CacheControl"
    },
    "Retry-After": {
      "$ref": "#/components/headers/RetryAfter"
    }
  },
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/ErrorResponse"
      }
    }
  }
}

GET /public-api/v1/diff-projects/{id}/reports/{report_id}/alerts/summary

Parámetros

Modelos de datos relacionados: CacheControl · RateLimitLimit · RateLimitRemaining · RateLimitResetAt · RetryAfter · XRequestID · DiffAlertSummaryResponse · ErrorResponse · XID

id (path)

{
  "required": true,
  "schema": {
    "$ref": "#/components/schemas/XID"
  }
}

report_id (path)

Xid del informe o el literal last. El literal last solo se admite en este parámetro de ruta.

{
  "required": true,
  "schema": {
    "type": "string",
    "minLength": 4,
    "maxLength": 64,
    "pattern": "^([A-Za-z0-9_-]+|last)$"
  }
}

url_md5 (query)

{
  "schema": {
    "type": "string",
    "pattern": "^[a-fA-F0-9]{32}$"
  }
}

email (query)

{
  "schema": {
    "type": "string",
    "maxLength": 255
  }
}

trigger_code (query)

{
  "schema": {
    "type": "string"
  }
}

trigger_group (query)

{
  "schema": {
    "type": "string"
  }
}

include_raw (query)

{
  "schema": {
    "type": "boolean"
  }
}

Respuestas

200

Resumen de alertas.

{
  "headers": {
    "X-Request-ID": {
      "$ref": "#/components/headers/XRequestID"
    }
  },
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/DiffAlertSummaryResponse"
      }
    }
  }
}

default

{
  "headers": {
    "X-Request-ID": {
      "$ref": "#/components/headers/XRequestID"
    },
    "X-RateLimit-Limit": {
      "$ref": "#/components/headers/RateLimitLimit"
    },
    "X-RateLimit-Remaining": {
      "$ref": "#/components/headers/RateLimitRemaining"
    },
    "X-RateLimit-Reset": {
      "$ref": "#/components/headers/RateLimitResetAt"
    },
    "Cache-Control": {
      "$ref": "#/components/headers/CacheControl"
    },
    "Retry-After": {
      "$ref": "#/components/headers/RetryAfter"
    }
  },
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/ErrorResponse"
      }
    }
  }
}

GET /public-api/v1/diff-projects/{id}/alerts/timeseries

Parámetros

Modelos de datos relacionados: CacheControl · RateLimitLimit · RateLimitRemaining · RateLimitResetAt · RetryAfter · XRequestID · DiffAlertTimeseriesResponse · ErrorResponse · XID

id (path)

{
  "required": true,
  "schema": {
    "$ref": "#/components/schemas/XID"
  }
}

interval (query)

{
  "schema": {
    "type": "string",
    "enum": [
      "hour",
      "day"
    ],
    "default": "day"
  }
}

url_md5 (query)

{
  "schema": {
    "type": "string",
    "pattern": "^[a-fA-F0-9]{32}$"
  }
}

email (query)

{
  "schema": {
    "type": "string",
    "maxLength": 255
  }
}

trigger_code (query)

{
  "schema": {
    "type": "string"
  }
}

trigger_group (query)

{
  "schema": {
    "type": "string"
  }
}

include_raw (query)

{
  "schema": {
    "type": "boolean"
  }
}

from (query)

{
  "schema": {
    "type": "string",
    "format": "date-time"
  }
}

to (query)

{
  "schema": {
    "type": "string",
    "format": "date-time"
  }
}

Respuestas

200

Series temporales de alertas.

{
  "headers": {
    "X-Request-ID": {
      "$ref": "#/components/headers/XRequestID"
    }
  },
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/DiffAlertTimeseriesResponse"
      }
    }
  }
}

default

{
  "headers": {
    "X-Request-ID": {
      "$ref": "#/components/headers/XRequestID"
    },
    "X-RateLimit-Limit": {
      "$ref": "#/components/headers/RateLimitLimit"
    },
    "X-RateLimit-Remaining": {
      "$ref": "#/components/headers/RateLimitRemaining"
    },
    "X-RateLimit-Reset": {
      "$ref": "#/components/headers/RateLimitResetAt"
    },
    "Cache-Control": {
      "$ref": "#/components/headers/CacheControl"
    },
    "Retry-After": {
      "$ref": "#/components/headers/RetryAfter"
    }
  },
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/ErrorResponse"
      }
    }
  }
}

GET /public-api/v1/diff-projects/{id}/alerts/export.csv

Parámetros

Modelos de datos relacionados: CacheControl · RateLimitLimit · RateLimitRemaining · RateLimitResetAt · RetryAfter · XRequestID · ErrorResponse · XID

id (path)

{
  "required": true,
  "schema": {
    "$ref": "#/components/schemas/XID"
  }
}

created_from (query)

{
  "schema": {
    "type": "string",
    "format": "date-time"
  }
}

created_to (query)

{
  "schema": {
    "type": "string",
    "format": "date-time"
  }
}

bom (query)

{
  "schema": {
    "type": "boolean",
    "default": true
  }
}

url_md5 (query)

{
  "schema": {
    "type": "string",
    "pattern": "^[a-fA-F0-9]{32}$"
  }
}

email (query)

{
  "schema": {
    "type": "string",
    "maxLength": 255
  }
}

trigger_code (query)

{
  "schema": {
    "type": "string"
  }
}

trigger_group (query)

{
  "schema": {
    "type": "string"
  }
}

include_raw (query)

{
  "schema": {
    "type": "boolean"
  }
}

Respuestas

200

Exportación CSV codificada para hojas de cálculo.

{
  "headers": {
    "X-Request-ID": {
      "$ref": "#/components/headers/XRequestID"
    },
    "Content-Disposition": {
      "schema": {
        "type": "string"
      }
    }
  },
  "content": {
    "text/csv": {
      "schema": {
        "type": "string"
      }
    }
  }
}

default

{
  "headers": {
    "X-Request-ID": {
      "$ref": "#/components/headers/XRequestID"
    },
    "X-RateLimit-Limit": {
      "$ref": "#/components/headers/RateLimitLimit"
    },
    "X-RateLimit-Remaining": {
      "$ref": "#/components/headers/RateLimitRemaining"
    },
    "X-RateLimit-Reset": {
      "$ref": "#/components/headers/RateLimitResetAt"
    },
    "Cache-Control": {
      "$ref": "#/components/headers/CacheControl"
    },
    "Retry-After": {
      "$ref": "#/components/headers/RetryAfter"
    }
  },
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/ErrorResponse"
      }
    }
  }
}

GET /public-api/v1/diff-projects/{id}/alerts/metrics

Parámetros

Modelos de datos relacionados: CacheControl · RateLimitLimit · RateLimitRemaining · RateLimitResetAt · RetryAfter · XRequestID · ErrorResponse · XID

id (path)

{
  "required": true,
  "schema": {
    "$ref": "#/components/schemas/XID"
  }
}

created_from (query)

{
  "schema": {
    "type": "string",
    "format": "date-time"
  }
}

created_to (query)

{
  "schema": {
    "type": "string",
    "format": "date-time"
  }
}

url_md5 (query)

{
  "schema": {
    "type": "string",
    "pattern": "^[a-fA-F0-9]{32}$"
  }
}

email (query)

{
  "schema": {
    "type": "string",
    "maxLength": 255
  }
}

trigger_code (query)

{
  "schema": {
    "type": "string"
  }
}

trigger_group (query)

{
  "schema": {
    "type": "string"
  }
}

include_raw (query)

{
  "schema": {
    "type": "boolean"
  }
}

Respuestas

200

Formato de texto de Prometheus solo con etiquetas de baja cardinalidad.

{
  "headers": {
    "X-Request-ID": {
      "$ref": "#/components/headers/XRequestID"
    }
  },
  "content": {
    "text/plain": {
      "schema": {
        "type": "string"
      }
    }
  }
}

default

{
  "headers": {
    "X-Request-ID": {
      "$ref": "#/components/headers/XRequestID"
    },
    "X-RateLimit-Limit": {
      "$ref": "#/components/headers/RateLimitLimit"
    },
    "X-RateLimit-Remaining": {
      "$ref": "#/components/headers/RateLimitRemaining"
    },
    "X-RateLimit-Reset": {
      "$ref": "#/components/headers/RateLimitResetAt"
    },
    "Cache-Control": {
      "$ref": "#/components/headers/CacheControl"
    },
    "Retry-After": {
      "$ref": "#/components/headers/RetryAfter"
    }
  },
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/ErrorResponse"
      }
    }
  }
}

GET /public-api/v1/diff-projects/{id}/reports/{report_id}/alerts/metrics

Parámetros

Modelos de datos relacionados: CacheControl · RateLimitLimit · RateLimitRemaining · RateLimitResetAt · RetryAfter · XRequestID · ErrorResponse · XID

id (path)

{
  "required": true,
  "schema": {
    "$ref": "#/components/schemas/XID"
  }
}

report_id (path)

Xid del informe o el literal last. El literal last solo se admite en este parámetro de ruta.

{
  "required": true,
  "schema": {
    "type": "string",
    "minLength": 4,
    "maxLength": 64,
    "pattern": "^([A-Za-z0-9_-]+|last)$"
  }
}

url_md5 (query)

{
  "schema": {
    "type": "string",
    "pattern": "^[a-fA-F0-9]{32}$"
  }
}

email (query)

{
  "schema": {
    "type": "string",
    "maxLength": 255
  }
}

trigger_code (query)

{
  "schema": {
    "type": "string"
  }
}

trigger_group (query)

{
  "schema": {
    "type": "string"
  }
}

include_raw (query)

{
  "schema": {
    "type": "boolean"
  }
}

Respuestas

200

Formato de texto de Prometheus solo con etiquetas de baja cardinalidad.

{
  "headers": {
    "X-Request-ID": {
      "$ref": "#/components/headers/XRequestID"
    }
  },
  "content": {
    "text/plain": {
      "schema": {
        "type": "string"
      }
    }
  }
}

default

{
  "headers": {
    "X-Request-ID": {
      "$ref": "#/components/headers/XRequestID"
    },
    "X-RateLimit-Limit": {
      "$ref": "#/components/headers/RateLimitLimit"
    },
    "X-RateLimit-Remaining": {
      "$ref": "#/components/headers/RateLimitRemaining"
    },
    "X-RateLimit-Reset": {
      "$ref": "#/components/headers/RateLimitResetAt"
    },
    "Cache-Control": {
      "$ref": "#/components/headers/CacheControl"
    },
    "Retry-After": {
      "$ref": "#/components/headers/RetryAfter"
    }
  },
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/ErrorResponse"
      }
    }
  }
}