Related pages

このページでは、ライセンスルールの作成、更新、および削除や、ID、アクセスキー、および名前によるライセンスルールの取得などの、AppDynamics でモデル化されたライセンスルールに関する情報を取得するために使用できるライセンスルール API メソッドについて説明します。

すべてのライセンスルール API に以下が適用されます。

  • id:これはグローバルで一意な識別子の頭字語である GUID(または UUID)です。 
  • access_key:すべての licenseRules で一意である必要があります。
  • name:すべての licenseRules で一意である必要があります。
  • account_id:GET API を使用して次のパラメータの現在の値を確認します: account_id.

ライセンスルールの新規作成

URL

http://<host>:<port>/mds/v1/license/rules

形式

POST /mds/v1/license/rules 

  

Input parameters

Parameter Name

Parameter Type

Value

必須

license_module_type

文字列

ライセンスモジュールのタイプを表す文字列。

モジュールタイプ:

  • NETVIZ
  • MACHINE_AGENT
  • SIM_MACHINE_AGENT
  • APM
  • APP_AGENT
  • DOT_NET_AGENT
[はい(Yes)] に設定

id

文字列ID または名前を表す文字列。[はい(Yes)] に設定

version

整数型(Integer)バージョン番号を示します。[はい(Yes)] に設定

number_of_licenses

整数型(Integer)必要なライセンス数を示す整数。[はい(Yes)] に設定

account_id

文字列アカウント名またはアカウント ID を提供します。[はい(Yes)] に設定

access_key

[パス(Path)]アカウントアクセスキーを提供します。[はい(Yes)] に設定


LicenseRule は、license_module_type, id, access_key, account_id, version、および number_of_licenses で構成されています。

curl --user <user>@<AccountName>:<password> -X POST \
  http://<host>:<port>/controller/mds/v1/license/rules \
  -H 'Content-Type: application/json' \
  -d '{
    "id": "011116a4-124c-4b73-9343-f315836f103b",
    "version": 0,
    "name": "Default_API9",
    "description": null,
    "enabled": true,
    "constraints": [],
    "entitlements": [
        {
            "license_module_type": "JAVA",
            "number_of_licenses": 100
        },
        {
            "license_module_type": "NATIVE_WEB_SERVER",
            "number_of_licenses": 100
        },
        {
            "license_module_type": "NATIVE_SDK",
            "number_of_licenses": 100
        },
        {
            "license_module_type": "DOT_NET",
            "number_of_licenses": 100
        },
        {
            "license_module_type": "NETVIZ",
            "number_of_licenses": 100
        },
        {
            "license_module_type": "MACHINE_AGENT",
            "number_of_licenses": 100
        },
        {
            "license_module_type": "NODEJS",
            "number_of_licenses": 100
        },
        {
            "license_module_type": "SIM_MACHINE_AGENT",
            "number_of_licenses": 100
        },
        {
            "license_module_type": "PHP",
            "number_of_licenses": 100
        },
        {
            "license_module_type": "PYTHON",
            "number_of_licenses": 100
        }
    ],
    "account_id": "8b1e92f2-387c-45b6-9bb5-ebd7f67587d4",
    "access_key": "ap1845ad-1f3e-4c9b-909b-a3cfa510bfb0",
    "total_licenses": null,
    "peak_usage": null
}
{  
   "id": "011116a4-124c-4b73-9343-f315836f103b",
   "version": 0,
   "name": "Default_API9",
   "description": null,
   "enabled": true,
   "constraints": [  

   ],
   "entitlements": [  
      {  
         "license_module_type": "JAVA",
         "number_of_licenses": 100
      },
      {  
         "license_module_type": "NATIVE_WEB_SERVER",
         "number_of_licenses": 100
      },
      {  
         "license_module_type": "NATIVE_SDK",
         "number_of_licenses": 100
      },
      {  
         "license_module_type": "DOT_NET",
         "number_of_licenses": 100
      },
      {  
         "license_module_type": "NETVIZ",
         "number_of_licenses": 100
      },
      {  
         "license_module_type": "MACHINE_AGENT",
         "number_of_licenses": 100
      },
      {  
         "license_module_type": "NODEJS",
         "number_of_licenses": 100
      },
      {  
         "license_module_type": "SIM_MACHINE_AGENT",
         "number_of_licenses": 100
      },
      {  
         "license_module_type": "PHP",
         "number_of_licenses": 100
      },
      {  
         "license_module_type": "PYTHON",
         "number_of_licenses": 100
      }
   ],
   "account_id": "8b1e92f2-387c-45b6-9bb5-ebd7f67587d4",
   "access_key": "ap1845ad-1f3e-4c9b-909b-a3cfa510bfb0",
   "total_licenses": null,
   "peak_usage": null
}

作成時にはバージョンを 0 にする必要があります。


現在のアカウントのすべてのライセンスルールの概要を返します。

ライセンスルールの概要を取得するには、これを使用します。返されるデータ転送オブジェクト(DTO)には、制約、一致条件、または権限付与は含まれません。

URL

http://<host>:<port>/mds/v1/license/rules

形式

GET /mds/v1/license/rules

[
{
"id": "f36e08e2-5f57-4b8c-9ad2-f18873adcd87",
"version": 2,
"name": "Default",
"description": null,
"enabled": true,
"constraints": [],
"entitlements": [],
"account_id": "0429fc7b-a2b9-42e3-a7fb-f704d436a054",
"access_key": "account-accesskey-123",
"total_licenses": 120,
"peak_usage": null
}
]

ライセンスルールを更新する

URL

http://<host>:<port>/mds/v1/license/rules

形式

PUT /mds/v1/license/rules

入力パラメータ

Parameter Name

Parameter Type

Value

必須

id
文字列ID または名前を表す文字列。[はい(Yes)] に設定
license_module_type
文字列

ライセンスモジュールのタイプを表す文字列。

モジュールタイプ:

  • NetViz
  • マシンエージェント
  • SIM マシンエージェント
  • APM
[はい(Yes)] に設定
version
整数型(Integer)バージョン番号を示します。[はい(Yes)] に設定
number_of_licenses
整数型(Integer)必要なライセンス数を示す整数。[はい(Yes)] に設定
account_id
文字列アカウント名またはアカウント ID を提供します。[はい(Yes)] に設定
access_key
[パス(Path)]アカウントアクセスキーを提供します。[はい(Yes)] に設定

要求の例

curl -v -X PUT http://<host>:<port>/controller/mds/v1/license/rules \
  --user <user>@<AccountName>:<password> \
  -H 'Content-Type: application/json' \
  -d '{
    "id": "321116a4-124c-4b73-9343-f315836f103b",
    "version": 0,
    "name": "Default_API",
    "description": null,
    "enabled": true,
    "constraints": [],
    "entitlements": [
        {
            "license_module_type": "JAVA",
            "number_of_licenses": 1000
        },
        {
            "license_module_type": "NATIVE_WEB_SERVER",
            "number_of_licenses": 100
        },
        {
            "license_module_type": "NATIVE_SDK",
            "number_of_licenses": 100
        },
        {
            "license_module_type": "DOT_NET",
            "number_of_licenses": 100
        },
        {
            "license_module_type": "NETVIZ",
            "number_of_licenses": 100
        },
        {
            "license_module_type": "MACHINE_AGENT",
            "number_of_licenses": 100
        },
        {
            "license_module_type": "NODEJS",
            "number_of_licenses": 100
        },
        {
            "license_module_type": "SIM_MACHINE_AGENT",
            "number_of_licenses": 100
        },
        {
            "license_module_type": "PHP",
            "number_of_licenses": 100
        },
        {
            "license_module_type": "PYTHON",
            "number_of_licenses": 100
        }
    ],
    "account_id": "8b1e92f2-387c-45b6-9bb5-ebd7f67587d4",
    "access_key": "api845ad-1f3e-4c9b-909b-a3cfa510bfb0",
    "total_licenses": null,
    "peak_usage": null
}

ライセンスルールを更新するには、次の手順を実行します。

1. 使用可能な GET メソッドのいずれかを使用してペイロードを取得します

2.accessKeys、権限付与などを更新します。

3. 他のキーと値のペアを変更せずに PUT 要求を送信します。

4. "version" は GET 時の状態のまま維持する必要があります。これはインクリメントされます。

ライセンスルールを削除する

URL

http://<host>:<port>/mds/v1/license/rules/f36e08e2-5f57-4b8c-9ad2-f18873adcd87

形式

DELETE /mds/v1/license/rules/{id}

入力パラメータ

Parameter Name

Parameter Type

Value

必須

LicenseRuleId

パス

ID によってライセンスルールを削除します。

あり

ID を使用してライセンスルールを取得する

ライセンスルール ID によってライセンスルールを取得するには、これを使用します。

URL

http://<host>:<port>/mds/v1/license/rules/f36e08e2-5f57-4b8c-9ad2-f18873adcd87

形式

GET /mds/v1/license/rules/{licenseRuleId}

入力パラメータ

Parameter Name

Parameter Type

Value

必須

licenseRuleIdパスライセンスルールの UUID を取得します。あり

出力パラメータ

Parameter NameParameter TypeValueMandatory
id
文字列ID または名前を表す文字列。[はい(Yes)] に設定
version
整数型(Integer)バージョン番号を示します。[はい(Yes)] に設定
total_licenses
整数型(Integer)ライセンスの合計数を示す整数。[はい(Yes)] に設定
account_id
文字列アカウント名またはアカウント ID を提供します。[はい(Yes)] に設定
access_key
pathアカウントアクセスキーを提供します。[はい(Yes)] に設定


curl -X GET --user <user>@<AccountName>:<password> http://<host>:<port>/controller/mds/v1/license/rules/091116a4-124c-4b73-9343-f315836f103b
{
    "id": "091116a4-124c-4b73-9343-f315836f103b",
    "version": 0,
    "name": "Default",
    "description": null,
    "enabled": true,
    "constraints": [],
    "entitlements": [
        {
            "license_module_type": "JAVA",
            "number_of_licenses": 100
        },
        {
            "license_module_type": "NATIVE_WEB_SERVER",
            "number_of_licenses": 100
        },
        {
            "license_module_type": "NATIVE_SDK",
            "number_of_licenses": 100
        },
        {
            "license_module_type": "DOT_NET",
            "number_of_licenses": 100
        },
        {
            "license_module_type": "NETVIZ",
            "number_of_licenses": 100
        },
        {
            "license_module_type": "MACHINE_AGENT",
            "number_of_licenses": 100
        },
        {
            "license_module_type": "NODEJS",
            "number_of_licenses": 100
        },
        {
            "license_module_type": "SIM_MACHINE_AGENT",
            "number_of_licenses": 100
        },
        {
            "license_module_type": "PHP",
            "number_of_licenses": 100
        },
        {
            "license_module_type": "PYTHON",
            "number_of_licenses": 100
        }
    ],
    "account_id": "8b1e92f2-387c-45b6-9bb5-ebd7f67587d4",
    "access_key": "bd3845ad-1f3e-4c9b-909b-a3cfa510bfb0",
    "total_licenses": null,
    "peak_usage": null
}

"version" は UI または API からの更新のたびに更新されます。


アクセスキーごとにライセンスルールを取得する

URL

http://<host>:<port>/mds/v1/license/rules/accessKey/account-accesskey-123

形式

GET /mds/v1/license/rules/accessKey/{accessKey}

入力パラメータ

Parameter Name

Parameter Type

Value

必須

access_key

パス

ライセンスルールに割り当てられているアクセスキーを取得します。

あり

出力パラメータ

Parameter NameParameter TypeValueMandatory
id
文字列ID または名前を表す文字列。[はい(Yes)] に設定
version
整数型(Integer)バージョン番号を示します。[はい(Yes)] に設定
total_licenses
整数型(Integer)ライセンスの合計数を示す整数。[はい(Yes)] に設定
account_id
文字列アカウント名またはアカウント ID を提供します。[はい(Yes)] に設定


curl -X GET --user <user>@<AccountName>:<password> http://<host>:<port>/controller/mds/v1/license/rules
[
    {
        "id": "221116a4-124c-4b73-9343-f315836f103b",
        "version": 0,
        "name": "Default",
        "description": null,
        "enabled": true,
        "constraints": [],
        "entitlements": [],
        "account_id": "8b1e92f2-387c-45b6-9bb5-ebd7f67587d4",
        "access_key": "bd3845ad-1f3e-4c9b-909b-a3cfa510bfb0",
        "total_licenses": 1000,
        "peak_usage": null
    },
    {
        "id": "321116a4-124c-4b73-9343-f315836f103b",
        "version": 0,
        "name": "Custom1",
        "description": null,
        "enabled": true,
        "constraints": [],
        "entitlements": [],
        "account_id": "8b1e92f2-387c-45b6-9bb5-ebd7f67587d4",
        "access_key": "api845ad-1f3e-4c9b-909b-a3cfa510bfb0",
        "total_licenses": 1000,
        "peak_usage": null
    }
]
 


名前ごとにライセンスルールを取得する

URL

http://<host>:<port>/mds/v1/license/rules/name/Default

形式

GET /mds/v1/license/rules/name/{name}

入力パラメータ

Parameter Name

Parameter Type

Value

必須

name

パス

ライセンスルールの名前を取得します。

あり

出力パラメータ

Parameter NameParameter TypeValueMandatory
id
文字列ID または名前を表す文字列。[はい(Yes)] に設定
version
整数型(Integer)バージョン番号を示します。[はい(Yes)] に設定
total_licenses
整数型(Integer)ライセンスの合計数を示す整数。[はい(Yes)] に設定
account_id
文字列アカウント名またはアカウント ID を提供します。[はい(Yes)] に設定


curl -X GET --user <user>@<AccountName>:<password> http://<host>:<port>/controller/mds/v1/license/rules
 [
    {
        "id": "221116a4-124c-4b73-9343-f315836f103b",
        "version": 0,
        "name": "Default",
        "description": null,
        "enabled": true,
        "constraints": [],
        "entitlements": [],
        "account_id": "8b1e92f2-387c-45b6-9bb5-ebd7f67587d4",
        "access_key": "bd3845ad-1f3e-4c9b-909b-a3cfa510bfb0",
        "total_licenses": 1000,
        "peak_usage": null
    },
    {
        "id": "321116a4-124c-4b73-9343-f315836f103b",
        "version": 0,
        "name": "Custom1",
        "description": null,
        "enabled": true,
        "constraints": [],
        "entitlements": [],
        "account_id": "8b1e92f2-387c-45b6-9bb5-ebd7f67587d4",
        "access_key": "api845ad-1f3e-4c9b-909b-a3cfa510bfb0",
        "total_licenses": 1000,
        "peak_usage": null
    }
]