sematext/stcloud
Composer 安装命令:
composer require sematext/stcloud
包简介
Sematext Cloud API Client for PHP
README 文档
README
A Sematext Cloud API client, for interaction with Sematext Cloud solution monitoring, alerting and log shipping.
One of a family of clients in following flavours:
- sematext-api-client-javascript
- sematext-api-client-rust
- sematext-api-client-ruby
- sematext-api-client-python
- sematext-api-client-php
- sematext-api-client-java
- sematext-api-client-go
Refer to below link for deeper information on the API itself.
Contents
## Getting Started
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
Installation
Requirements
PHP 5.5 and later
Composer
To install the bindings via Composer, add the following to composer.json:
{
"repositories": [
{
"type": "git",
"url": "https://github.com/sematext/sematext-api-client-php.git"
}
],
"require": {
"/sematext/stcloud": "*@dev"
}
}
Then run composer install
Manual Installation
Download the files and include autoload.php:
require_once('/path/to/stcloud/vendor/autoload.php');
Testing
To run the unit tests:
composer install
./vendor/bin/phpunit
Getting Started
Please follow the installation procedure and then run the following:
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: api_key $config = sematext\stcloud\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // $config = sematext\stcloud\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); $apiInstance = new sematext\stcloud\Api\AlertNotificationsApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client(), $config ); $app_id = 789; // int | appId $time_interval = new \sematext\stcloud\Model\AlertNotificationRequest(); // \sematext\stcloud\Model\AlertNotificationRequest | Time Interval try { $result = $apiInstance->getAlertNotificationsForAppUsingPOST($app_id, $time_interval); print_r($result); } catch (Exception $e) { echo 'Exception when calling AlertNotificationsApi->getAlertNotificationsForAppUsingPOST: ', $e->getMessage(), PHP_EOL; } ?>
Authentication
This client code requires a Sematext API Access token to function. You can find this by logging into your Sematext Cloud Account
Versioning
We use SemVer for versioning. For the versions available, see the tags on this repository.
License
This project is licensed under the Apache License v2.0- - see the LICENSE file for details
Acknowledgements
This API client was initially generated by the swagger-codegen project.
- API version: v3
- Package version: 1.0.0
Reference
All URIs are relative to https://localhost
| Class | Method | HTTP request | Description |
|---|---|---|---|
| AlertNotificationsApi | getAlertNotificationsForAppUsingPOST | POST /users-web/api/v3/apps/{appId}/notifications/alerts | Get alert notifications for an app |
| AlertNotificationsApi | getAlertNotificationsForUserUsingPOST1 | POST /users-web/api/v3/notifications/alerts | Get alert notifications for a user |
| AlertsApi | createAlertUsingPOST | POST /users-web/api/v3/alerts | Create alert rule |
| AlertsApi | deleteAlertRuleUsingDELETE1 | DELETE /users-web/api/v3/alerts/{updateableAlertId} | Delete alert rule |
| AlertsApi | disableAlertRuleUsingPUT1 | PUT /users-web/api/v3/alerts/{updateableAlertId}/disable | Disable alert rule |
| AlertsApi | enableAlertRuleUsingPUT1 | PUT /users-web/api/v3/alerts/{updateableAlertId}/enable | Enable alert rule |
| AlertsApi | getAlertRulesForAppUsingGET1 | GET /users-web/api/v3/apps/{appId}/alerts | Get alert rules for an app |
| AppsApi | deleteUsingDELETE1 | DELETE /users-web/api/v3/apps/{anyStateAppId} | delete |
| AppsApi | getAppTypesUsingGET | GET /users-web/api/v3/apps/types | Get all App types supported for the account identified with apiKey |
| AppsApi | getUsingGET1 | GET /users-web/api/v3/apps/{anyStateAppId} | Gets defails for one particular App |
| AppsApi | inviteAppGuestsUsingPOST1 | POST /users-web/api/v3/apps/guests | Invite guests to an app |
| AppsApi | listAppsUsersUsingGET1 | GET /users-web/api/v3/apps/users | Get all users of apps accessible to this account |
| AppsApi | listUsingGET | GET /users-web/api/v3/apps | Get all apps accessible by account identified with apiKey |
| AppsApi | updateDescriptionUsingPUT | PUT /users-web/api/v3/apps/{anyStateAppId}/description | Update description of the app |
| AppsApi | updateUsingPUT2 | PUT /users-web/api/v3/apps/{anyStateAppId} | Update app |
| AwsSettingsControllerApi | updateUsingPUT | PUT /users-web/api/v3/apps/{appId}/aws | Update App's AWS CloudWatch settings |
| BillingApi | getDetailedInvoiceUsingGET1 | GET /users-web/api/v3/billing/invoice/{service}/{year}/{month} | Get invoice details |
| BillingApi | listAvailablePlansUsingGET | GET /users-web/api/v3/billing/availablePlans | Get available plans |
| BillingApi | updatePlanUsingPUT | PUT /users-web/api/v3/billing/info/{appId} | Update plan for an app |
| LogsAppApi | createLogseneApplication | POST /logsene-reports/api/v3/apps | Create Logs App |
| MonitoringAppApi | createSpmApplication1 | POST /spm-reports/api/v3/apps | Create Monitoring App |
| ResetPasswordApi | resetPasswordUsingPOST1 | POST /users-web/api/v3/account/password/reset | Reset Password |
| SubscriptionsApi | createForAppUsingPOST1 | POST /users-web/api/v3/apps/{appId}/subscription | Create App subscription |
| SubscriptionsApi | createForDashUsingPOST1 | POST /users-web/api/v3/dashboards/{dashId}/subscription | Create dashboard subscription |
| SubscriptionsApi | deleteUsingDELETE3 | DELETE /users-web/api/v3/subscriptions/{updateableSubscriptionId} | Delete subscription |
| SubscriptionsApi | listUsingGET3 | GET /users-web/api/v3/apps/{appId}/subscriptions | Get subscriptions for an App |
| SubscriptionsApi | listUsingGET4 | GET /users-web/api/v3/subscriptions | Get current account's subscriptions |
| SubscriptionsApi | sendAppReportUsingPOST1 | POST /users-web/api/v3/apps/{appId}/report/send | Email an App report |
| SubscriptionsApi | sendDashReportUsingPOST1 | POST /users-web/api/v3/dashboards/{dashId}/report/send | Email a dashboard report |
| SubscriptionsApi | toggleEnabledUsingPUT1 | PUT /users-web/api/v3/subscriptions/{updateableSubscriptionId} | Toggle subscription status |
| SubscriptionsApi | updateForAppUsingPUT | PUT /users-web/api/v3/apps/{appId}/subscription | Update App subscription |
| SubscriptionsApi | updateForDashUsingPUT1 | PUT /users-web/api/v3/dashboards/{dashId}/subscription | Update dashboard subscription |
| TagApiControllerApi | getTagNamesUsingGET1 | GET /spm-reports/api/v3/apps/{appIds}/tagNames | Gets tag names for the given application identifiers appearing in the given time frame. |
| TagApiControllerApi | getUsingGET1 | GET /spm-reports/api/v3/apps/{appIds}/tags | Gets values for specified tags for the given application identifiers appearing in the given time frame. |
| TagApiControllerApi | getUsingGET2 | GET /spm-reports/api/v3/apps/{appIds}/metrics/filters | Gets values for specified tags for the given application identifiers appearing in the given time frame. |
| TokensApiControllerApi | createAppToken1 | POST /users-web/api/v3/apps/{appId}/tokens | Create new app token |
| TokensApiControllerApi | deleteAppToken1 | DELETE /users-web/api/v3/apps/{appId}/tokens/{tokenId} | Delete app token |
| TokensApiControllerApi | getAppTokens | GET /users-web/api/v3/apps/{appId}/tokens | Get app available tokens |
| TokensApiControllerApi | regenerateAppToken1 | POST /users-web/api/v3/apps/{appId}/tokens/{tokenId}/regenerate | Regenerate app token) |
| TokensApiControllerApi | updateAppToken | PUT /users-web/api/v3/apps/{appId}/tokens/{tokenId} | Update app token (enable/disable or name) |
Documentation For Models
- AlertNotificationRequest
- AlertRule
- AlertRuleScheduleTimeRangeDto
- AlertRuleScheduleWeekdayDto
- App
- AppDescription
- AppMetadata
- BasicAuthMethodDto
- BasicOrganizationDto
- BillingInfo
- CloudWatchSettings
- CreateAppInfo
- CreateTokenDto
- Error
- FilterValue
- GenericApiResponse
- Invitation
- NotificationIntegration
- Plan
- ReportInfo
- ServiceIntegration
- SubscriptionDashboardDto
- SubscriptionDto
- UpdateAppInfo
- UpdateSubscriptionDto
- UpdateTokenDto
- UserInfo
- UserPermissions
- UserRole
Documentation For Models
- AlertNotificationRequest
- AlertRule
- AlertRuleScheduleTimeRangeDto
- AlertRuleScheduleWeekdayDto
- App
- AppDescription
- AppMetadata
- BasicAuthMethodDto
- BasicOrganizationDto
- BillingInfo
- CloudWatchSettings
- CreateAppInfo
- CreateTokenDto
- DataSeriesFilter
- DataSeriesRequest
- Error
- FilterValue
- GenericApiResponse
- Invitation
- NotificationIntegration
- Plan
- ReportInfo
- SavedQuery
- ServiceIntegration
- SubscriptionDashboardDto
- SubscriptionDto
- UpdateAppInfo
- UpdateSubscriptionDto
- UpdateTokenDto
- UserInfo
- UserPermissions
- UserRole
Documentation For Authorization
api_key
- Type: API key
- API key parameter name: Authorization
- Location: HTTP header
sematext/stcloud 适用场景与选型建议
sematext/stcloud 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2 次下载、GitHub Stars 达 1, 最近一次更新时间为 2020 年 06 月 29 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「api」 「sdk」 「swagger」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 sematext/stcloud 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 sematext/stcloud 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 sematext/stcloud 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A PSR-7 compatible library for making CRUD API endpoints
Alfabank REST API integration
Zero-dependency raw PHP DNS resolver, domain-ownership verification, and intoDNS/MxToolbox-style diagnostics. Queries authoritative nameservers directly over sockets — never trusts the recursive cache for ownership checks.
A lightweight plain-PHP framework for database-backed CRUD APIs.
bughq error tracking - PHP SDK
ABsurge PHP SDK for feature flags and A/B testing
统计信息
- 总下载量: 2
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 7
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2020-06-29