0.5.0 • Published 2 years ago

@sematext/sematext-api-client v0.5.0

Weekly downloads
6
License
SEE LICENSE IN LI...
Repository
github
Last release
2 years ago

  sematext-api-client-javascript

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

License

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

Node.js

Install via:

npm install @sematext/sematext-api-client --save
const Stcloud = require("@sematext/sematext-api-client")

Webpack Configuration

Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:

module: {
  rules: [
    {
      parser: {
        amd: false
      }
    }
  ]
}

Authentication

This client code requires a Sematext API Access token to function. You can find this by logging into your Sematext Cloud Account

Please follow the installation instruction and execute the following JS code:

var SematextApiClientJavascript = require('sematext-api-client-javascript')

var defaultClient = SematextApiClientJavascript.ApiClient.instance

// Configure API key authorization: api_key
var api_key = defaultClient.authentications['api_key']
api_key.apiKey = 'YOUR API KEY'
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix['Authorization'] = "Token"

var api = new SematextApiClientJavascript.AlertNotificationsApi()

var appId = 789 // {Number} appId

var timeInterval = new SematextApiClientJavascript.AlertNotificationRequest() // {AlertNotificationRequest} Time Interval

api.getAlertNotificationsForAppUsingPOST(appId, timeInterval).then(
  function (data) {
    console.log('API called successfully. Returned data: ' + data)
  },
  function (error) {
    console.error(error)
  }
)

Testing

Note: Tests are currently inhibited by a Mocha dependancy on Yargs. This client is generated code so this should have litle impact. Marking as a pre-release until this is resolved upstream.

Documentation for API Endpoints

All URIs are relative to https://localhost

ClassMethodHTTP requestDescription
SematextApiClientJavascript.AlertNotificationsApigetAlertNotificationsForAppUsingPOSTPOST /users-web/api/v3/apps/{appId}/notifications/alertsGet alert notifications for an app
SematextApiClientJavascript.AlertNotificationsApigetAlertNotificationsForUserUsingPOST1POST /users-web/api/v3/notifications/alertsGet alert notifications for a user
SematextApiClientJavascript.AlertsApicreateAlertUsingPOSTPOST /users-web/api/v3/alertsCreate alert rule
SematextApiClientJavascript.AlertsApideleteAlertRuleUsingDELETEDELETE /users-web/api/v3/alerts/{updateableAlertId}Delete alert rule
SematextApiClientJavascript.AlertsApidisableAlertRuleUsingPUTPUT /users-web/api/v3/alerts/{updateableAlertId}/disableDisable alert rule
SematextApiClientJavascript.AlertsApienableAlertRuleUsingPUT1PUT /users-web/api/v3/alerts/{updateableAlertId}/enableEnable alert rule
SematextApiClientJavascript.AlertsApigetAlertRulesForAppUsingGETGET /users-web/api/v3/apps/{appId}/alertsGet alert rules for an app
SematextApiClientJavascript.AppsApideleteUsingDELETEDELETE /users-web/api/v3/apps/{anyStateAppId}delete
SematextApiClientJavascript.AppsApigetAppTypesUsingGET1GET /users-web/api/v3/apps/typesGet all App types supported for the account identified with apiKey
SematextApiClientJavascript.AppsApigetUsingGETGET /users-web/api/v3/apps/{anyStateAppId}Gets defails for one particular App
SematextApiClientJavascript.AppsApiinviteAppGuestsUsingPOSTPOST /users-web/api/v3/apps/guestsInvite guests to an app
SematextApiClientJavascript.AppsApilistAppsUsersUsingGET1GET /users-web/api/v3/apps/usersGet all users of apps accessible to this account
SematextApiClientJavascript.AppsApilistUsingGET1GET /users-web/api/v3/appsGet all apps accessible by account identified with apiKey
SematextApiClientJavascript.AppsApiupdateDescriptionUsingPUT1PUT /users-web/api/v3/apps/{anyStateAppId}/descriptionUpdate description of the app
SematextApiClientJavascript.AppsApiupdateUsingPUT2PUT /users-web/api/v3/apps/{anyStateAppId}Update app
SematextApiClientJavascript.AwsSettingsControllerApiupdateUsingPUTPUT /users-web/api/v3/apps/{appId}/awsUpdate App's AWS CloudWatch settings
SematextApiClientJavascript.BillingApigetDetailedInvoiceUsingGETGET /users-web/api/v3/billing/invoice/{service}/{year}/{month}Get invoice details
SematextApiClientJavascript.BillingApilistAvailablePlansUsingGET1GET /users-web/api/v3/billing/availablePlansGet available plans
SematextApiClientJavascript.BillingApiupdatePlanUsingPUT1PUT /users-web/api/v3/billing/info/{appId}Update plan for an app
SematextApiClientJavascript.LogsAppApicreateLogseneApplicationPOST /logsene-reports/api/v3/appsCreate Logs App
SematextApiClientJavascript.MonitoringAppApicreateSpmApplication1POST /spm-reports/api/v3/appsCreate Monitoring App
SematextApiClientJavascript.ResetPasswordApiresetPasswordUsingPOSTPOST /users-web/api/v3/account/password/resetReset Password
SematextApiClientJavascript.SubscriptionsApicreateForAppUsingPOSTPOST /users-web/api/v3/apps/{appId}/subscriptionCreate App subscription
SematextApiClientJavascript.SubscriptionsApicreateForDashUsingPOST1POST /users-web/api/v3/dashboards/{dashId}/subscriptionCreate dashboard subscription
SematextApiClientJavascript.SubscriptionsApideleteUsingDELETE2DELETE /users-web/api/v3/subscriptions/{updateableSubscriptionId}Delete subscription
SematextApiClientJavascript.SubscriptionsApilistUsingGET3GET /users-web/api/v3/apps/{appId}/subscriptionsGet subscriptions for an App
SematextApiClientJavascript.SubscriptionsApilistUsingGET4GET /users-web/api/v3/subscriptionsGet current account's subscriptions
SematextApiClientJavascript.SubscriptionsApisendAppReportUsingPOST1POST /users-web/api/v3/apps/{appId}/report/sendEmail an App report
SematextApiClientJavascript.SubscriptionsApisendDashReportUsingPOSTPOST /users-web/api/v3/dashboards/{dashId}/report/sendEmail a dashboard report
SematextApiClientJavascript.SubscriptionsApitoggleEnabledUsingPUT1PUT /users-web/api/v3/subscriptions/{updateableSubscriptionId}Toggle subscription status
SematextApiClientJavascript.SubscriptionsApiupdateForAppUsingPUTPUT /users-web/api/v3/apps/{appId}/subscriptionUpdate App subscription
SematextApiClientJavascript.SubscriptionsApiupdateForDashUsingPUT1PUT /users-web/api/v3/dashboards/{dashId}/subscriptionUpdate dashboard subscription
SematextApiClientJavascript.TagApiControllerApigetTagNamesUsingGET1GET /spm-reports/api/v3/apps/{appIds}/tagNamesGets tag names for the given application identifiers appearing in the given time frame.
SematextApiClientJavascript.TagApiControllerApigetUsingGET1GET /spm-reports/api/v3/apps/{appIds}/tagsGets values for specified tags for the given application identifiers appearing in the given time frame.
SematextApiClientJavascript.TagApiControllerApigetUsingGET2GET /spm-reports/api/v3/apps/{appIds}/metrics/filtersGets values for specified tags for the given application identifiers appearing in the given time frame.
SematextApiClientJavascript.TokensApiControllerApicreateAppToken1POST /users-web/api/v3/apps/{appId}/tokensCreate new app token
SematextApiClientJavascript.TokensApiControllerApideleteAppToken1DELETE /users-web/api/v3/apps/{appId}/tokens/{tokenId}Delete app token
SematextApiClientJavascript.TokensApiControllerApigetAppTokensGET /users-web/api/v3/apps/{appId}/tokensGet app available tokens
SematextApiClientJavascript.TokensApiControllerApiregenerateAppTokenPOST /users-web/api/v3/apps/{appId}/tokens/{tokenId}/regenerateRegenerate app token)
SematextApiClientJavascript.TokensApiControllerApiupdateAppToken1PUT /users-web/api/v3/apps/{appId}/tokens/{tokenId}Update app token (enable/disable or name)

Documentation for Models

0.5.0

2 years ago

0.4.0

2 years ago

0.3.0

3 years ago

0.2.0

3 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago