LogicMonitorのRESTAPIを使用する

All the updates and enhancements will be done to LogicMonitor REST API v3 ONLY. We strongly recommend that you switch to the latest v3 to stay ahead.

LogicMonitor REST APIを使用すると、ダッシュボード、デバイス、レポート、サービス、アラート、コレクター、データソース、SDTなどのLogicMonitorリソースをプログラムでクエリおよび管理できます。

ベースURL

RESTAPIリクエストを行うためのベースURLは次のとおりです。

https://ACCOUNTNAME.logicmonitor.com/santaba/rest

Here, you must replace ACCOUNTNAME with your LogicMonitor account name.

Supported API Versions

LogicMonitor REST APIs are available in three versions: v3, v2, and v1. You must consider the following guidelines to decide the version you want to use:

  • 私たちはフォローする セマンティックバージョニング, but only major version is allowed in requests (the most recent minor / patch versions will always be returned)
  • All the updates and enhancements will be done to version 3 たったの.
  • Version can be specified in an X-Version header, or in the URL as a query parameter.

To access the latest v3 APIs, see v3 Swagger Documentation.

認証

LogicMonitorサーバーに送信される各要求は、 HTTPS, and must also be authenticated. All data is received as JSON.  LogicMonitor REST API currently supports two authentication methods:

  • API token-based authentication
  • 基本認証

注意: Basic Authentication is only supported in v1 of the API, and may not be available with future versions of the API. Therefore, we highly recommend that you make REST API requests with API Token Authentication.

詳細については、を参照してください。 RESTAPI認証.

帯域制限

Rate limits are imposed for requests to LogicMonitor REST API. Limits vary per endpoint and method combination. For a listing of default rate limits, details on pulling rate limit information from response headers, and several cross-language examples of how to adjust scripts to accommodate rate limits, see 帯域制限.

Status Codes and Error Codes

With each API version that we rolled out, we have evolved and improved the Status codes and Error codes. To access the list, see ステータスコード 及び エラーコード.

変更ログ

LogicMonitor REST APIs are constantly evolving. To track all the updates done to our APIs, see 変更ログ.

Supported HTTP Methods

LogicMonitor REST API use the globally-used HTTP verbs or methods. They are POST, GET, PUT, PATCH, and DELETE. These methods correspond to Create, Read/Retrieve, Update, and Delete (aka CRUD) operations, respectively.

  • POST– POST APIs are typically used to create new subordinate resources. LogicMonitor REST API use POST method to add API tokens, Dashboard groups, and so on. For example, POST/dashboard/groups and POST/setting/alert/chains.
  • GET– Use the GET request to read/retrieve resource information. You can use the GET method to get a representation of your resource’s content and data. For example, GET/alert/alerts/{id} and GET/dashboard/groups/{id}.
  • PUT– Use the PUT method to update a resource by completely replacing its content. Consistent with REST standards, any properties not specified in a PUT request will revert back to their default values. Examples of PUT requests are PUT/setting/alert/chains/{id} and PUT/setting/recipientgroups/{id}.
  • PATCH– Use the PATCH method to update/modify resource content. In your PATCH request you must specify the updates you want to make to the resource. For example, PATCH/report/reports/{id} and PATCH/setting/roles/{id}.
  • DELETE– Use the DELETE method to delete a resource identified by a URI. The resource is removed entirely. For example, DELETE/sdt/sdts/{id} and DELETE/setting/recipientgroups/{id}.

LogicMonitor SDK

In addition to the REST APIs, LogicMonitor also supports SDKs. v3 Python SDK will be available for use by early next week.

記事上で