Référence de l’API Pannes

Récupérer toutes les pannes d’une page

Point de terminaison :

GET /v1/:page_id/outages?page=:page&per_page=:per_page
  • Le numéro de page par défaut est 1.
  • La valeur par défaut de per_page est 50, avec un maximum de 100 éléments par page.

Exemple de réponse :

[
{
"id": "ckoutage1",
"from": "2020-09-12T03:38:47.998Z",
"to": "2020-09-12T04:38:47.998Z",
"status": "PARTIALOUTAGE",
"visibilityState": "PUBLISHED",
"createdAt": "2020-09-12T03:38:47.998Z",
"updatedAt": "2020-09-12T03:40:47.998Z",
"component": {
"id": "ckf01fvnxywz50a35nh1qzssm",
"name": "Website"
},
"incident": {
"id": "ckf01m59ueaqb0a32wrljz1yd",
"name": "Rocket is going down",
"createdByType": "USER",
"status": "INVESTIGATING"
}
}
]

Récupérer une panne

Point de terminaison :

GET /v1/:page_id/outages/:outage_id

Exemple de réponse :

{
"id": "ckoutage1",
"from": "2020-09-12T03:38:47.998Z",
"to": "2020-09-12T04:38:47.998Z",
"status": "PARTIALOUTAGE",
"visibilityState": "PUBLISHED",
"createdAt": "2020-09-12T03:38:47.998Z",
"updatedAt": "2020-09-12T03:40:47.998Z",
"component": {
"id": "ckf01fvnxywz50a35nh1qzssm",
"name": "Website"
},
"incident": {
"id": "ckf01m59ueaqb0a32wrljz1yd",
"name": "Rocket is going down",
"createdByType": "USER",
"status": "INVESTIGATING"
}
}

Ajouter une panne

Point de terminaison :

POST /v1/:page_id/outages

Exemple de requête :

{
"componentId": "ckf01fvnxywz50a35nh1qzssm",
"status": "PARTIALOUTAGE",
"from": "2020-09-12 03:38:47.998",
"to": "2020-09-12 04:38:47.998",
"visibilityState": "PUBLISHED"
}

Exemple de réponse :

{
"id": "ckoutage1",
"from": "2020-09-12T03:38:47.998Z",
"to": "2020-09-12T04:38:47.998Z",
"status": "PARTIALOUTAGE",
"visibilityState": "PUBLISHED",
"createdAt": "2020-09-12T03:38:47.998Z",
"updatedAt": "2020-09-12T03:40:47.998Z",
"component": {
"id": "ckf01fvnxywz50a35nh1qzssm",
"name": "Website"
},
"incident": null
}

Mettre à jour une panne

Point de terminaison :

PUT /v1/:page_id/outages/:outage_id

Exemple de requête :

{
"status": "MAJOROUTAGE",
"to": "2020-09-12 05:38:47.998"
}

Exemple de réponse :

{
"id": "ckoutage1",
"from": "2020-09-12T03:38:47.998Z",
"to": "2020-09-12T05:38:47.998Z",
"status": "MAJOROUTAGE",
"visibilityState": "PUBLISHED",
"createdAt": "2020-09-12T03:38:47.998Z",
"updatedAt": "2020-09-12T04:40:47.998Z",
"component": {
"id": "ckf01fvnxywz50a35nh1qzssm",
"name": "Website"
},
"incident": null
}

Supprimer une panne

Point de terminaison :

DELETE /v1/:page_id/outages/:outage_id

Exemple de réponse :

HTTP 204 No Content