sematext / stcloud
Sematext Cloud API Client for PHP
Requires
- php: >=5.5
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^6.2
Requires (Dev)
- friendsofphp/php-cs-fixer: ~3.10
- phpunit/phpunit: ^9.5
- squizlabs/php_codesniffer: ~3.7
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
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