api-video/statuspage-php
Composer 安装命令:
composer require api-video/statuspage-php
包简介
StatusPage.io client by api.video
README 文档
README
api.video is an API that encodes on the go to facilitate immediate playback, enhancing viewer streaming experiences across multiple devices and platforms. You can stream live or on-demand online videos within minutes.
apivideo/statuspage-php
StatusPage php client by api.video.
Install
This package is installable and auto-loadable via Composer:
$ composer require apivideo/statuspage-php
Quick start
Find your StatusPage account page to find your API key and other IDs.
Auto-completion of code is available for every object of the library to ease development.
<?php use ApiVideo\StatusPage\Client; $client = new Client('2c04e0b2-8c4a-b941-de65-012a61b7f6ea'); // User API key foreach ($client->components as $component) { echo $component->id.': '.$component->name."\n"; } $client->components->setStatus('7mst16b00d59', 'partial_outage'); foreach ($client->metrics as $metric) { echo $metric->id.': '.$metric->name."\n"; } $client->metrics->addPoint('gu1kkk8qe0dl', 12.5);
Full API
If you have several pages in your StatusPage account, you need to select the page before operating on metrics or components.
It's better to set the default page ID as it avoids an API request to guess it.
Client instantiation
<?php use ApiVideo\StatusPage\Client; $client = new Client( '2c04e0b2-8c4a-b941-de65-012a61b7f6ea', // User API key [ 'page-id' => 'zujkhu4kgivg', // (optional) Default page ID ] ); // You can also set the default page later. $client->setDefaultPageId('zujkhu4kgivg');
Components API
<?php use ApiVideo\StatusPage\Client; use ApiVideo\StatusPage\Model\Component; $client = new Client(/*..*/); foreach ($client->components as $component) { // Available properties: echo $component->id; echo $component->name; echo $component->description; echo $component->created_at; echo $component->status; echo $component->updated_at; echo $component->group; echo $component->group_id; echo $component->automation_email; echo $component->only_show_if_degraded; echo $component->page_id; echo $component->position; echo $component->showcase; } $component = $client->components->create([ 'name' => 'Component name', 'description' => 'This is an example component', ]); echo $component->id; // a5xc8i1a03ki $component = $client->components->update('a5xc8i1a03ki', ['description' => 'Another description']); $component = $client->components->setStatus('a5xc8i1a03ki', Component::STATUS_MAINTENANCE); // Avoid using magic strings $client->components->delete('a5xc8i1a03ki');
Metrics API
<?php use ApiVideo\StatusPage\Client; $client = new Client(/*..*/); foreach ($client->metrics as $metric) { echo $metric->id; echo $metric->name; echo $metric->created_at; echo $metric->updated_at; echo $metric->most_recent_data_at; echo $metric->backfilled; echo $metric->decimal_places; echo $metric->metrics_display_id; echo $metric->suffix; echo $metric->tooltip_description; echo $metric->y_axis_hidden; echo $metric->y_axis_max; echo $metric->y_axis_min; } $metric = $client->metrics->create([ 'name' => 'Component name', 'description' => 'This is an example component', ]); echo $metric->id; // 9zwc0v70t29n $metric = $client->metrics->update('9zwc0v70t29n', ['description' => 'Another description']); // Metric points $client->metrics->addPoint('9zwc0v70t29n', random_int(0, 100)); $metric = $client->metrics->get('9zwc0v70t29n'); echo $metric->name.' (last updated on '.date(DATE_ATOM, $metric->most_recent_data_at).')'; print_r($client->metrics->getPoints('9zwc0v70t29n')); $client->metrics->delete('9zwc0v70t29n');
api-video/statuspage-php 适用场景与选型建议
api-video/statuspage-php 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 131 次下载、GitHub Stars 达 13, 最近一次更新时间为 2019 年 07 月 25 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 api-video/statuspage-php 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 api-video/statuspage-php 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 131
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 13
- 点击次数: 15
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-07-25
