Skip to content
PHP Library interacts with the OpsGenie service through the RESTful Web API.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
tests
.env.example
.gitignore
.travis.yml
README.md
composer.json
composer.lock
phpunit.xml

README.md

OpsGenie-PHP

PHP classes interact OpsGenie Notifier with the REST API.

Requirements

Installation

  1. Download and Install PHP Composer.

    curl -sS https://getcomposer.org/installer | php
  2. Next, run the Composer command to install the latest version of php jira rest client.

    php composer.phar require lesstif/OpsGenie-php dev-master

    or add the following to your composer.json file.

    {
        "require": {
            "lesstif/OpsGenie-php": "dev-master"
        }
    }
  3. Then run Composer's install or update commands to complete installation.

    php composer.phar install
  4. After installing, you need to require Composer's autoloader:

    require 'vendor/autoload.php';

Configuration

copy .env.example file to .env on your project root.

API_HOST="https://api.opsgenie.com"
API_URL="/v1/json/"
API_TOKEN="your-token"

Usage

Table of Contents

Create Alert

<?php
require 'vendor/autoload.php';

$req = new \Lesstif\OpsGenie\Alert\Request();

$req->user = "lesstif@gmail.com";

try {
    $oc = new OpsGenieHttpClient;

    $oc->createAlert('alert test', $req);

} catch (OpsGenieException $e) {
    $this->assertTrue(false, $e->getMessage());
}

License

Apache V2 License

Documents

You can’t perform that action at this time.