https://github.com/sematext/sematext-api-client-php
Sematext API Client for PHP
https://github.com/sematext/sematext-api-client-php
alerting api-client cloud log-shipping monitoring php
Last synced: 4 months ago
JSON representation
Sematext API Client for PHP
- Host: GitHub
- URL: https://github.com/sematext/sematext-api-client-php
- Owner: sematext
- License: other
- Created: 2020-05-01T11:09:15.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-11-06T16:19:28.000Z (over 1 year ago)
- Last Synced: 2025-08-03T13:49:09.114Z (10 months ago)
- Topics: alerting, api-client, cloud, log-shipping, monitoring, php
- Language: PHP
- Homepage:
- Size: 3.75 MB
- Stars: 1
- Watchers: 15
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
#
** sematext-api-client-php**
>*A [Sematext Cloud](https://sematext.com/cloud/) API client, for interaction with Sematext Cloud solution monitoring, alerting and log shipping.*
[](https://opensource.org/licenses/Apache-2.0)
One of a family of clients in following flavours:
* [sematext-api-client-javascript](https://github.com/sematext/sematext-api-client-javascript "Javascript")
* [sematext-api-client-rust](https://github.com/sematext/sematext-api-client-rust "Rust")
* [sematext-api-client-ruby](https://github.com/sematext/sematext-api-client-ruby "Ruby")
* [sematext-api-client-python](https://github.com/sematext/sematext-api-client-python "Python")
* [sematext-api-client-php](https://github.com/sematext/sematext-api-client-php "PHP")
* [sematext-api-client-java](https://github.com/sematext/sematext-api-client-java "Java")
* [sematext-api-client-go](https://github.com/sematext/sematext-api-client-go "Go/Golang")
Refer to below link for deeper information on the API itself.
* [Sematext Cloud API Reference](https://sematext.com/docs/api/ "API Reference")
## Contents
- [
** sematext-api-client-php**](#sematext-api-client-php)
- [Contents](#contents)
- [Getting Started](#getting-started)
- [Installation](#installation)
- [Requirements](#requirements)
- [Composer](#composer)
- [Manual Installation](#manual-installation)
- [Testing](#testing)
- [Getting Started](#getting-started-1)
- [Authentication](#authentication)
- [Versioning](#versioning)
- [License](#license)
- [Acknowledgements](#acknowledgements)
- [Reference](#reference)
- [Documentation For Models](#documentation-for-models)
- [Documentation For Models](#documentation-for-models-1)
- [Documentation For Authorization](#documentation-for-authorization)
- [api_key](#api_key)
## 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](http://getcomposer.org/), add the following to `composer.json`:
```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`:
```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](#installation--usage) and then run the following:
```php
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](https://apps.sematext.com/ui/account/api)
## Versioning
We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/your/project/tags).
## License
This project is licensed under the Apache License v2.0- - see the [LICENSE](./LICENSE) file for details
## Acknowledgements
This API client was initially generated by the [swagger-codegen](https://github.com/swagger-api/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**](docs/Api/AlertNotificationsApi.md#getalertnotificationsforappusingpost) | **POST** /users-web/api/v3/apps/{appId}/notifications/alerts | Get alert notifications for an app |
| *AlertNotificationsApi* | [**getAlertNotificationsForUserUsingPOST1**](docs/Api/AlertNotificationsApi.md#getalertnotificationsforuserusingpost1) | **POST** /users-web/api/v3/notifications/alerts | Get alert notifications for a user |
| *AlertsApi* | [**createAlertUsingPOST**](docs/Api/AlertsApi.md#createalertusingpost) | **POST** /users-web/api/v3/alerts | Create alert rule |
| *AlertsApi* | [**deleteAlertRuleUsingDELETE1**](docs/Api/AlertsApi.md#deletealertruleusingdelete1) | **DELETE** /users-web/api/v3/alerts/{updateableAlertId} | Delete alert rule |
| *AlertsApi* | [**disableAlertRuleUsingPUT1**](docs/Api/AlertsApi.md#disablealertruleusingput1) | **PUT** /users-web/api/v3/alerts/{updateableAlertId}/disable | Disable alert rule |
| *AlertsApi* | [**enableAlertRuleUsingPUT1**](docs/Api/AlertsApi.md#enablealertruleusingput1) | **PUT** /users-web/api/v3/alerts/{updateableAlertId}/enable | Enable alert rule |
| *AlertsApi* | [**getAlertRulesForAppUsingGET1**](docs/Api/AlertsApi.md#getalertrulesforappusingget1) | **GET** /users-web/api/v3/apps/{appId}/alerts | Get alert rules for an app |
| *AppsApi* | [**deleteUsingDELETE1**](docs/Api/AppsApi.md#deleteusingdelete1) | **DELETE** /users-web/api/v3/apps/{anyStateAppId} | delete |
| *AppsApi* | [**getAppTypesUsingGET**](docs/Api/AppsApi.md#getapptypesusingget) | **GET** /users-web/api/v3/apps/types | Get all App types supported for the account identified with apiKey |
| *AppsApi* | [**getUsingGET1**](docs/Api/AppsApi.md#getusingget1) | **GET** /users-web/api/v3/apps/{anyStateAppId} | Gets defails for one particular App |
| *AppsApi* | [**inviteAppGuestsUsingPOST1**](docs/Api/AppsApi.md#inviteappguestsusingpost1) | **POST** /users-web/api/v3/apps/guests | Invite guests to an app |
| *AppsApi* | [**listAppsUsersUsingGET1**](docs/Api/AppsApi.md#listappsusersusingget1) | **GET** /users-web/api/v3/apps/users | Get all users of apps accessible to this account |
| *AppsApi* | [**listUsingGET**](docs/Api/AppsApi.md#listusingget) | **GET** /users-web/api/v3/apps | Get all apps accessible by account identified with apiKey |
| *AppsApi* | [**updateDescriptionUsingPUT**](docs/Api/AppsApi.md#updatedescriptionusingput) | **PUT** /users-web/api/v3/apps/{anyStateAppId}/description | Update description of the app |
| *AppsApi* | [**updateUsingPUT2**](docs/Api/AppsApi.md#updateusingput2) | **PUT** /users-web/api/v3/apps/{anyStateAppId} | Update app |
| *AwsSettingsControllerApi* | [**updateUsingPUT**](docs/Api/AwsSettingsControllerApi.md#updateusingput) | **PUT** /users-web/api/v3/apps/{appId}/aws | Update App's AWS CloudWatch settings |
| *BillingApi* | [**getDetailedInvoiceUsingGET1**](docs/Api/BillingApi.md#getdetailedinvoiceusingget1) | **GET** /users-web/api/v3/billing/invoice/{service}/{year}/{month} | Get invoice details |
| *BillingApi* | [**listAvailablePlansUsingGET**](docs/Api/BillingApi.md#listavailableplansusingget) | **GET** /users-web/api/v3/billing/availablePlans | Get available plans |
| *BillingApi* | [**updatePlanUsingPUT**](docs/Api/BillingApi.md#updateplanusingput) | **PUT** /users-web/api/v3/billing/info/{appId} | Update plan for an app |
| *LogsAppApi* | [**createLogseneApplication**](docs/Api/LogsAppApi.md#createlogseneapplication) | **POST** /logsene-reports/api/v3/apps | Create Logs App |
| *MonitoringAppApi* | [**createSpmApplication1**](docs/Api/MonitoringAppApi.md#createspmapplication1) | **POST** /spm-reports/api/v3/apps | Create Monitoring App |
| *ResetPasswordApi* | [**resetPasswordUsingPOST1**](docs/Api/ResetPasswordApi.md#resetpasswordusingpost1) | **POST** /users-web/api/v3/account/password/reset | Reset Password |
| *SubscriptionsApi* | [**createForAppUsingPOST1**](docs/Api/SubscriptionsApi.md#createforappusingpost1) | **POST** /users-web/api/v3/apps/{appId}/subscription | Create App subscription |
| *SubscriptionsApi* | [**createForDashUsingPOST1**](docs/Api/SubscriptionsApi.md#createfordashusingpost1) | **POST** /users-web/api/v3/dashboards/{dashId}/subscription | Create dashboard subscription |
| *SubscriptionsApi* | [**deleteUsingDELETE3**](docs/Api/SubscriptionsApi.md#deleteusingdelete3) | **DELETE** /users-web/api/v3/subscriptions/{updateableSubscriptionId} | Delete subscription |
| *SubscriptionsApi* | [**listUsingGET3**](docs/Api/SubscriptionsApi.md#listusingget3) | **GET** /users-web/api/v3/apps/{appId}/subscriptions | Get subscriptions for an App |
| *SubscriptionsApi* | [**listUsingGET4**](docs/Api/SubscriptionsApi.md#listusingget4) | **GET** /users-web/api/v3/subscriptions | Get current account's subscriptions |
| *SubscriptionsApi* | [**sendAppReportUsingPOST1**](docs/Api/SubscriptionsApi.md#sendappreportusingpost1) | **POST** /users-web/api/v3/apps/{appId}/report/send | Email an App report |
| *SubscriptionsApi* | [**sendDashReportUsingPOST1**](docs/Api/SubscriptionsApi.md#senddashreportusingpost1) | **POST** /users-web/api/v3/dashboards/{dashId}/report/send | Email a dashboard report |
| *SubscriptionsApi* | [**toggleEnabledUsingPUT1**](docs/Api/SubscriptionsApi.md#toggleenabledusingput1) | **PUT** /users-web/api/v3/subscriptions/{updateableSubscriptionId} | Toggle subscription status |
| *SubscriptionsApi* | [**updateForAppUsingPUT**](docs/Api/SubscriptionsApi.md#updateforappusingput) | **PUT** /users-web/api/v3/apps/{appId}/subscription | Update App subscription |
| *SubscriptionsApi* | [**updateForDashUsingPUT1**](docs/Api/SubscriptionsApi.md#updatefordashusingput1) | **PUT** /users-web/api/v3/dashboards/{dashId}/subscription | Update dashboard subscription |
| *TagApiControllerApi* | [**getTagNamesUsingGET1**](docs/Api/TagApiControllerApi.md#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**](docs/Api/TagApiControllerApi.md#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**](docs/Api/TagApiControllerApi.md#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**](docs/Api/TokensApiControllerApi.md#createapptoken1) | **POST** /users-web/api/v3/apps/{appId}/tokens | Create new app token |
| *TokensApiControllerApi* | [**deleteAppToken1**](docs/Api/TokensApiControllerApi.md#deleteapptoken1) | **DELETE** /users-web/api/v3/apps/{appId}/tokens/{tokenId} | Delete app token |
| *TokensApiControllerApi* | [**getAppTokens**](docs/Api/TokensApiControllerApi.md#getapptokens) | **GET** /users-web/api/v3/apps/{appId}/tokens | Get app available tokens |
| *TokensApiControllerApi* | [**regenerateAppToken1**](docs/Api/TokensApiControllerApi.md#regenerateapptoken1) | **POST** /users-web/api/v3/apps/{appId}/tokens/{tokenId}/regenerate | Regenerate app token) |
| *TokensApiControllerApi* | [**updateAppToken**](docs/Api/TokensApiControllerApi.md#updateapptoken) | **PUT** /users-web/api/v3/apps/{appId}/tokens/{tokenId} | Update app token (enable/disable or name) |
## Documentation For Models
- [AlertNotificationRequest](docs/Model/AlertNotificationRequest.md)
- [AlertRule](docs/Model/AlertRule.md)
- [AlertRuleScheduleTimeRangeDto](docs/Model/AlertRuleScheduleTimeRangeDto.md)
- [AlertRuleScheduleWeekdayDto](docs/Model/AlertRuleScheduleWeekdayDto.md)
- [App](docs/Model/App.md)
- [AppDescription](docs/Model/AppDescription.md)
- [AppMetadata](docs/Model/AppMetadata.md)
- [BasicAuthMethodDto](docs/Model/BasicAuthMethodDto.md)
- [BasicOrganizationDto](docs/Model/BasicOrganizationDto.md)
- [BillingInfo](docs/Model/BillingInfo.md)
- [CloudWatchSettings](docs/Model/CloudWatchSettings.md)
- [CreateAppInfo](docs/Model/CreateAppInfo.md)
- [CreateTokenDto](docs/Model/CreateTokenDto.md)
- [Error](docs/Model/Error.md)
- [FilterValue](docs/Model/FilterValue.md)
- [GenericApiResponse](docs/Model/GenericApiResponse.md)
- [Invitation](docs/Model/Invitation.md)
- [NotificationIntegration](docs/Model/NotificationIntegration.md)
- [Plan](docs/Model/Plan.md)
- [ReportInfo](docs/Model/ReportInfo.md)
- [ServiceIntegration](docs/Model/ServiceIntegration.md)
- [SubscriptionDashboardDto](docs/Model/SubscriptionDashboardDto.md)
- [SubscriptionDto](docs/Model/SubscriptionDto.md)
- [UpdateAppInfo](docs/Model/UpdateAppInfo.md)
- [UpdateSubscriptionDto](docs/Model/UpdateSubscriptionDto.md)
- [UpdateTokenDto](docs/Model/UpdateTokenDto.md)
- [UserInfo](docs/Model/UserInfo.md)
- [UserPermissions](docs/Model/UserPermissions.md)
- [UserRole](docs/Model/UserRole.md)
## Documentation For Models
- [AlertNotificationRequest](docs/Model/AlertNotificationRequest.md)
- [AlertRule](docs/Model/AlertRule.md)
- [AlertRuleScheduleTimeRangeDto](docs/Model/AlertRuleScheduleTimeRangeDto.md)
- [AlertRuleScheduleWeekdayDto](docs/Model/AlertRuleScheduleWeekdayDto.md)
- [App](docs/Model/App.md)
- [AppDescription](docs/Model/AppDescription.md)
- [AppMetadata](docs/Model/AppMetadata.md)
- [BasicAuthMethodDto](docs/Model/BasicAuthMethodDto.md)
- [BasicOrganizationDto](docs/Model/BasicOrganizationDto.md)
- [BillingInfo](docs/Model/BillingInfo.md)
- [CloudWatchSettings](docs/Model/CloudWatchSettings.md)
- [CreateAppInfo](docs/Model/CreateAppInfo.md)
- [CreateTokenDto](docs/Model/CreateTokenDto.md)
- [DataSeriesFilter](docs/Model/DataSeriesFilter.md)
- [DataSeriesRequest](docs/Model/DataSeriesRequest.md)
- [Error](docs/Model/Error.md)
- [FilterValue](docs/Model/FilterValue.md)
- [GenericApiResponse](docs/Model/GenericApiResponse.md)
- [Invitation](docs/Model/Invitation.md)
- [NotificationIntegration](docs/Model/NotificationIntegration.md)
- [Plan](docs/Model/Plan.md)
- [ReportInfo](docs/Model/ReportInfo.md)
- [SavedQuery](docs/Model/SavedQuery.md)
- [ServiceIntegration](docs/Model/ServiceIntegration.md)
- [SubscriptionDashboardDto](docs/Model/SubscriptionDashboardDto.md)
- [SubscriptionDto](docs/Model/SubscriptionDto.md)
- [UpdateAppInfo](docs/Model/UpdateAppInfo.md)
- [UpdateSubscriptionDto](docs/Model/UpdateSubscriptionDto.md)
- [UpdateTokenDto](docs/Model/UpdateTokenDto.md)
- [UserInfo](docs/Model/UserInfo.md)
- [UserPermissions](docs/Model/UserPermissions.md)
- [UserRole](docs/Model/UserRole.md)
## Documentation For Authorization
## api_key
- **Type**: API key
- **API key parameter name**: Authorization
- **Location**: HTTP header