コントローラAPIの使用

このページでは、API の使用状況について説明します。コントローラ API は、イベントサービスまたはエージェントコンポーネントによってではなく、コントローラインスタンスによって提供されます。具体的には以下のとおりです。

  • アカウント API
  • アプリケーションモデル API
  • メトリックとスナップショット API
  • アラートと応答API
  • 構成 API
  • 構成インポートおよびエクスポート API
  • 分析イベント API

Controller API Base URI

Except as indicated in the format listing for a particular method, URIs in the Controller API use the following base URI:

http://<controller_host>:<controller_port>/controller/rest/<REST_URI>
注: The port that serves the API is the same primary port for the Controller used by Controller UI and agents.

Retrieving Data in JSON Format

The Splunk AppDynamics Controller APIs return data in eXtensible Markup Language (XML) or JavaScript Object Notation (JSON). The default output format is XML.

Any Controller API with a URI in the /controller/rest/ Controller API Base URI can return data in JSON format.

To retrieve data in JSON, call the API with the output query parameter set to JSON, as follows:

curl --user user1@customer1:secret http://demo.appdynamics.com/controller/rest/applications?output=JSON
[
{
"description": "",
"id": 5,
"name": "ECommerce_E2E"
},
{
"description": "",
"id": 8,
"name": "ECommerce_E2E-Fulfillment"
},
]

You can specify JSON output format for any of the Controller APIs.

When a client uses HTTP 1.1 and accepts gzip content-encoding, the Controller returns JSON responses using gzip compression.

Authentication

You can use OAuth identity types for authentication. See API Clients.

To invoke the REST APIs using basic HTTP authentication, you must provide the authentication credentials as well as your account information. These are:

  • Account: the Splunk AppDynamics tenant account name
  • Username: a user in that account
  • Password: the password for that account

Pass the credentials in the following form:

<your_username>@<your_accountname>:<your_password>

Most on-premises Controllers are single-tenant Controllers that use customer1 as the primary default account name. The account name should be left as default. For example:

<your_username>@customer1:<your_password>

Most SaaS Controllers are multi-tenant Controllers and allow you to replace customer1 with your own, instance-specific account name. See Observe License Usage.

重要: If your login is authenticated through Cisco Identity Provider, the basic HTTP authentication is not supported for the Controller REST API calls. You must use the OAuth token-based authentication for these API calls.

Invalid Characters for Usernames and Passwords

REST API calls will not authenticate usernames and passwords containing the characters specified in the following table:

Invalid Characters
Usernames:

\ / " [ ] : | < > + = ; , ? * , ' % <tab> <space> @

Passwords:

+ % \

If you have already created user credentials that contain any of the disallowed characters, such as "user:customer66", create new credentials without the disallowed character for the purpose of accessing the REST APIs.

For usernames or passwords containing the "@" symbol, URL encode the "@" character as %40.

メトリックブラウザでのメトリック URL のコピー

  1. [Metric Browser] のメトリックを右クリックします。
  2. メトリックの完全な REST URL をコピーします。
  3. REST URL をコードまたはコマンドラインに貼り付けます。
重要: セキュリティ上の理由から、Splunk AppDynamics では API コールをプログラムによって、またはコマンドラインでのみサポートしています。REST URL はブラウザに貼り付けないでください。