20steps/wemonit-bundle

面向服务的 WeMonIt API,用于 Symfony2 应用程序

安装: 607

依赖关系: 0

建议者: 0

安全: 0

星标: 0

关注者: 3

分支: 0

开放问题: 0

类型:symfony-bundle

dev-master 2014-01-13 06:55 UTC

This package is not auto-updated.

Last update: 2024-09-24 00:51:49 UTC


README

关于

20steps WeMonIt Bundle 为需要与 WeMonIt 监控服务交互的 Symfony2 应用程序提供了一个面向服务的 API。

有关 WeMonIt 的更多信息,请访问 http://www.wemonit.de

特性

  • 将 WeMonIt 作为可配置的 Symfony2 服务访问。
  • 完整的 WeMonIt API。
  • 可配置的响应缓存,以防止超出速率限制。
  • 提供一些派生 KPI。
  • 完整的文档和一些示例。
  • 为 20steps 控制开源做准备。

安装

通过将以下条目添加到 composer.json 的相应部分来要求捆绑包:

"20steps/wemonit-bundle": "dev-master"

通过以下命令从 GitHub 通过 Packagist 获取捆绑包:

php composer.phar update 20steps/wemonit-bundle

通过将以下行添加到 AppKernel.php 的 registerBundles() 方法中,在您的应用程序中注册捆绑包:

new twentysteps\Bundle\WeMonItBundle\twentystepsWeMonItBundle()

通过将以下行添加到 config.yml 的 imports 部分,注册捆绑包提供的服务:

- { resource: "@twentystepsWeMonItBundle/Resources/config/services.yml" }

在 parameters.yml 中定义以下属性:

  • twentysteps_wemonit.url - WeMonIt API 的 URL - 通常应指向 "https://wemonit.de/api/"。
  • twentysteps_wemonit.api_key - 在 WeMonIt 的账户 API 密钥。
  • twentysteps_wemonit.timeout - 应用在 WeMonIt API 调用上的超时时间(秒) - 您应使用 10。
  • twentysteps_wemonit.connect_timeout - 应用在 WeMonIt API 调用上的连接超时时间(秒) - 您应使用 5。
  • twentysteps_wemonit.cache_ttl - 应用在 WeMonIt API 响应上的缓存 TTL - 您应使用 3600。

使用

  • 通过将 @twentysteps_wemonit.service 作为依赖项添加到您的服务中,或在运行时显式地从容器中获取服务(例如,在控制器动作中调用 $this->get('twentysteps_wemonit.service')),来获取 WeMonIt 服务的引用。
  • 调用 Services/WeMonItService.php 中提供的任何公共函数,例如 getServices() 来获取 WeMonIt 中列出的监控服务。

版本

此版本尚未完成或可用。

作者

Helmut Hoffer von Ankershoffen (hhva@20steps.de).