PHP module to send notification messages to VictorOps via the REST integration.
Via Composer
composer require signiant/victoropsnotifier
composer update
<?php
require_once 'vendor/autoload.php';
use Signiant\VictorOps\Notifier;
use Signiant\VictorOps\Messages\CustomMessage;
// Only the message level is mandatory
$voMsg = new Signiant\VictorOps\Messages\CustomMessage('INFO');
$voConfig = ['endpoint_url' => 'YOUR_VO_REST_ENDPOINT', 'routing_key' => 'YOUR_VO_ROUTING_KEY'];
$voEndpoint = new Signiant\VictorOps\Notifier($voConfig);
$voEndpoint->send(voMsg);
The supplied CustomMessage class details the optional parameters that can be sent as part of the request. These parameters allow you to customise the message.
- Entity ID
- Entity Display Name
- State Message
- ACK Message
- ACK Author
- Entity Is Host Setting
<?php
use Signiant\VictorOps\Messages\CustomMessage;
$voMsg = new CustomMessage('INFO');
$voMsg->stateMessage('Hello VictorOps');
$voMsg->entityId('system123');
$voMsg->entityDisplayName('HAL 9000');