Skip to content

sematext/sematext-api-client-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

  sematext-api-client-php


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

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

Documentation For Models

Documentation For Authorization

api_key

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