sematext/stcloud

Sematext Cloud API Client for PHP

v0.5.0 2022-08-24 14:25 UTC

This package is auto-updated.

Last update: 2024-09-24 19:14:04 UTC


README


A Sematext Cloud API client, for interaction with Sematext Cloud solution monitoring, alerting and log shipping.


License


One of a family of clients in following flavours:


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

Documentation For Models

Documentation For Authorization

api_key

  • Type: API key
  • API key parameter name: Authorization
  • Location: HTTP header