定制 panopta/php-panopta-api-client 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

panopta/php-panopta-api-client

最新稳定版本:1.1.0

Composer 安装命令:

composer require panopta/php-panopta-api-client

包简介

A thin PHP wrapper for the Panopta API

README 文档

README

The Panopta REST API provides full access to all configuration, status and outage management functionality of the Panopta monitoring service, including the ability to create and modify monitoring checks that are being performed, manage notification configuration, respond to active outages and to pull availability statistics for monitored servers.

Installation

Run the Composer require command:

composer require panopta/php-panopta-api-client

Add the Composer autoloader to your project:

require 'vendor/autoload.php';

API Documentation

Full documentation for the API is available at https://api2.panopta.com/v2/api-docs/. By entering your API token you can view full details on all of the API methods and issue API requests from the documentation page. A token can be generated from the API management section of the Settings menu in the control panel at https://my.panopta.com.

Usage

The library provides a wrapper around the Panopta REST API, making it easy to issue GET, POST, PUT and DELETE operations to the API.

Instantiate the Panopta API client

$client = Panopta\ApiClient(
    'https://api2.panopta.com',
    'your-api-token',
    2, // API version
    Panopta\ApiClient::LOG_DEBUG,
    'logs/' // Log directory
);

GET

$fiveContacts = $client->get('/contact', ['limit' => 5]);

$serversWithACertainFullyQualifiedDomainName = $client->get(
    '/server',
    ['fqdn' => 'panopta.com']
);

$serverFortyTwo = $client->get('/server/42');

POST

$newNotificationSchedule = $client->post(
    '/notification_schedule',
    ['name' => 'New Notification Schedule', 'targets' => [$serverFortyTwo['url']]]
);

PUT

$updatedServerGroup = $client->put(
    '/server_group',
    [
        'name' => 'Updated Server Group',
        'notification_schedule' => $newNotificationSchedule['url']
    ]
);

DELETE

$client->delete('/contact/1');

统计信息

  • 总下载量: 7
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-08-27