ragboyjr/pager-duty-client

Pager Duty REST API V2 Client

v0.1.0 2017-07-07 15:48 UTC

This package is auto-updated.

Last update: 2024-04-18 18:50:42 UTC


README

Simple PHP Client for interacting with the Pager Duty API.

Installation

Install with composer at ragboyjr/pager-duty-client-client

Usage

<?php

use Ragboyjr\PagerDuty;

$events = new PagerDuty\GuzzleEventsApiClient(/* pass an optional custom GuzzleHttp\ClientInterface */);

$resp = $events->enqueue($routing_key, PagerDuty\EventsApi::ACTION_TRIGGER, [
    'summary' => 'My Alert Summary',
    'source' => 'sub.host.com',
    'severity' => PagerDuty\EventsApi::SEVERITY_INFO,
]);

if ($resp->isOk()) {
    var_dump($resp->getBody());
} else if ($resp->isError()) {
    var_dump($resp->getStatus());
    var_dump($resp->getBody());
    var_dump($resp->getHttpResponse());
}