License Usage API を呼び出すことで、ツールのライセンス使用情報を確認できます。この API は、DTP ログ フォルダーに保存されている ls_access.log.yyyy-MM-dd ファイルを読み取り、指定された期間の情報を返します。デフォルトでは、直近 90 日分のログが保管されます。ログの保管期間を変更する方法については「License Server の設定」を参照してください。

このセクションの内容:

認証

ベーシック認証または OIDC を使用して認証できます。ベーシック認証の使用については REST API ページの「認証」を、OIDC の使用については「OpenID Connect の設定」を参照してください。

エンドポイント

以下のエンドポイントを利用できます。

/toolsUsage

このエンドポイントは、ツールの使用に関する概要情報を返します。 

URL

<protocol>://<host>:<port>/licenseserver/usage/api/v1.0/toolsUsage

パラメーター 

次の表は、API のすべてのエンドポイントに共通のパラメーターです。

パラメーター説明必須
startDate 

レスポンスに "含める" 最初のレコードの日付を指定します。 

デフォルトでは、ログの最初の日付が含まれます。

形式: yyyy-MM-dd 

string任意
endDate 

レスポンスから除外する、開始日の後の最初のレコードの日付を指定します。 

デフォルトでは、終了日は指定されていません。

形式: yyyy-MM-dd 

string任意

レスポンス データ

レスポンスは、ツールおよびツールの使用法に関する情報の配列です。次の表は、レスポンス データについて説明しています。

フィールド説明
featuresAtMaxConcurrentLicenseTimemaxConcurrentLicenseTime で使用中の機能。オブジェクトの配列

count 機能に対して提供されたライセンス トークン リクエストの数。integer

feature ライセンスが要求された機能の名前。string

maxConcurrentLicenseCount

任意の時点でツールに使用されるライセンス トークンの最大数。integer
maxConcurrentLicenseTime ライセンス トークンの最新のカウントの日時。 string
tool ツールの名前。string
uniqueHostCount期間全体でのユニーク ホスト名の数。integer
uniqueUserCount 期間全体のユニーク ユーザーの数。integer
usageHours ライセンス トークンが使用された合計時間。戻り値は、ツールがホストされているユーザーとマシン全体の集計です。 float

リクエストの例

次の例は、2020 年 3 月 1 日のツールの使用状況を返します。

curl https://myserver:8443/licenseserver/usage/api/v1.0/toolsUsage?startDate=2020-03-01&endDate=2020-03-2 --cookie cookies.txt

レスポンスの例

次のレスポンスは、1 人の Parasoft Jtest ユーザーが短期間にいくつかの機能のライセンスを要求したことを示しています。

[
    {
        "featuresAtMaxConcurrentLicenseTime": [
            {
                "count": 1,
                "feature": "Automation"
            },
            {
                "count": 1,
                "feature": "Change Based Testing"
            },
            {
                "count": 1,
                "feature": "Coding Standards"
            },
            {
                "count": 1,
                "feature": "Coverage"
            },
            {
                "count": 1,
                "feature": "Desktop Command Line"
            },
            {
                "count": 1,
                "feature": "Flow Analysis"
            },
            {
                "count": 1,
                "feature": "Unit Test"
            }
        ],
        "maxConcurrentLicenseCount": 1,
        "maxConcurrentLicenseTime": "2020-03-01T20:18:21.369",
        "tool": "jtest!",
        "uniqueHostCount": 1,
        "uniqueUserCount": 1,
        "usageHours": 0.0025158333333333335
    }
] 

/featuresUsage

このエンドポイントは、機能の使用状況を返します。

URL

<protocol>://<host>:<port>/licenseserver/usage/api/v1.0/featuresUsage

パラメーター

このエンドポイントは 共通の API パラメーター をサポートします。

レスポンス データ

レスポンスは、機能および機能に関する情報の配列です。次の表は、レスポンス データについて説明しています。

フィールド
説明
features少なくとも 1 回使用された機能のリスト。文字列の配列

<feature_name> 使用されている機能の名前。ツールで使用できる機能の詳細については、Parasoft 製品テクニカル サポート センターにお問い合わせください。string
tool ツールの名前。string

リクエストの例

次の例は、2020 年 3 月 1 日の機能の使用状況を返します。

https://myserver:8443/licenseserver/usage/api/v1.0/featuresUsage?startDate=2020-03-01&endDate=2020-03-2

レスポンスの例

次のレスポンスは、いくつかの Parasoft Jtest 機能が、指定された開始日と終了日の間に少なくとも 1 回使用されたことを示しています。

[
    {
        "features": [
            "Automation",
            "Change Based Testing",
            "Coding Standards",
            "Coverage",
            "Desktop Command Line",
            "Flow Analysis",
            "Unit Test"
        ],
        "tool": "jtest!"
    }
]

/licenseUsage

このエンドポイントは、ユーザーごとに、使用されている機能、ツール、使用期間など、ライセンスの使用状況を配列で返します。

URL

<protocol>://<host>:<port>/licenseserver/usage/api/v1.0/licenseUsage

パラメーター

このエンドポイントは 共通の API パラメーター をサポートします。

レスポンス データ

レスポンスは、ライセンスの使用状況を表すオブジェクトの配列です。 

フィールド説明
features ライセンスによって有効化された機能のリスト。文字列の配列

<feature_name> 使用されている機能の名前。ツールで使用できる機能の詳細については、Parasoft 製品テクニカル サポート センターにお問い合わせください。
tool ライセンスを使用したツールの名前。string
toolVersion ツールのバージョン。string
usageHours ツールのライセンスがユーザーによって使用された合計時間。float
user ツールが実行されたホスト マシンと、ライセンスを要求したユーザー名。  object

hostname ツールが実行されたマシンの名前。string

name ライセンス トークンを要求したツール ユーザーのユーザー名。string

リクエストの例

次の例は、2020 年 3 月 1 日のライセンスの使用状況を返します。

https://myserver:8443/licenseserver/usage/api/v1.0/licenseUsage?startDate=2020-03-01&endDate=2020-03-2

レスポンスの例

次のレスポンスは、ユーザー"devtest" が "lin-dtp-vm2" というマシンでいくつかの機能を備えた Jtest ライセンスを短期間使用したことを示しています。 

[
    {
        "features": [
            "Automation",
            "Change Based Testing",
            "Coding Standards",
            "Coverage",
            "Desktop Command Line",
            "Flow Analysis",
            "Unit Test"
        ],
        "tool": "jtest!",
        "toolVersion": "10.4",
        "usageHours": 0.0025158333333333335,
        "user": {
            "hostName": "lin-dtp-vm2",
            "name": "devtest"
        }
    }
]

/licenseRejection

このエンドポイントは、サーバーによって拒否されたライセンス要求を示すオブジェクトの配列を返します。

URL

<protocol>://<host>:<port>/licenseserver/usage/api/v1.0/licenseRejection

パラメーター

このエンドポイントは 共通の API パラメーター をサポートします。

レスポンス データ

レスポンスは、ログに記録されたライセンス要求の拒否を表すオブジェクトの配列です。

フィールド説明
noMoreTokens 使用可能なトークンがなくなったためにライセンス要求が拒否されたインスタンスをリストします。 オブジェクトの配列

requestKey ライセンスが拒否されたライセンス要求のプロパティ。object


requestedFeatures 

ツールに要求された機能をリストします。ツールからライセンスが要求されると、その要求は、ユーザーが .properties ファイルまたは UI 設定で有効化しようとしたすべてのツールに適用されます。  文字列の配列



<feature_name>

リクエストされている機能の名前。ツールで使用できる機能の詳細については、Parasoft 製品テクニカル サポート センターにお問い合わせください。string


tool 

ライセンス要求が拒否されたツールの名前。string


toolVersion 

ツールのバージョン。 string

responseStatistics 

拒否されたライセンス要求に関する統計情報。

object



noMoreTokensCount 使用可能なライセンス トークンがなくなったためにライセンス要求が拒否された回数。integer


noMoreTokensUserCount ライセンス トークンを使用できなくなったために拒否されたライセンス要求を行ったユーザーの数。integer


noMoreTokensUsers ライセンス要求が拒否されたユーザーについての情報をリストします。オブジェクトの配列



noMoreTokensCount ユーザーがライセンスを要求した回数。 integer



noMoreTokensTime ユーザーがライセンスをリクエストしたときにマークされたタイム スタンプのリスト。文字列の配列




<timestamp> 

ライセンス トークンが要求された日時。デフォルトの形式: yyyy-MM-dd h:m:s:ms

string


user

拒否されたライセンスが要求されたホスト マシンと、ライセンスを要求したユーザー名。  object



hostName 

ライセンスが要求されたマシンの名前。string



name 

ライセンス トークンを要求したツール ユーザーのユーザー名。string
noFeatures 要求された機能の 1 つ以上がライセンスに含まれていないためにライセンス要求が拒否されたケースをリストします。その場合でも、ライセンス契約に従って有効化されている機能のライセンス トークンは使用できます。オブジェクトの配列

requestKey ライセンスが拒否されたライセンス要求のプロパティ。オブジェクトの配列


grantedFeatures ライセンス トークンを使用できる機能の名前。文字列の配列



<feature_name> feature_name を参照 feature_name を参照 


requestedNoFeatures ライセンスに含まれていない機能のリスト。文字列の配列



<feature_name> feature_name を参照 feature_name を参照 



tooltool を参照tool を参照


toolVersiontoolVersion を参照toolVersion を参照

responseStatistics拒否されたライセンス要求に関する統計情報。object


noFeaturesCount要求された機能がライセンスにないためにライセンス要求が拒否された回数。integer


noFeaturesUserCount 要求された機能がライセンスにないために拒否されたライセンス要求を行ったユーザーの数。integer


noFeaturesUsersライセンス要求が拒否されたユーザーについての情報をリストします。オブジェクトの配列



noFeaturesCount リクエストされた機能がライセンスにないために特定のユーザーのライセンス リクエストが拒否された回数。integer



noFeaturesTime ユーザーがライセンスをリクエストしたときにマークされたタイム スタンプのリスト。文字列の配列




<timestamp>timestamp を参照 timestamp を参照 



user user を参照 user を参照 




hostNamehostName を参照 hostName を参照 




name name を参照 name を参照 
requestDenied 特定のユーザー名、ホスト名、またはグループのアクセスを除外するように管理者がライセンス トークン リクエストを構成したためにライセンス リクエストが拒否されたケースをリストします (ライセンス アクセスのフィルタリング を参照)。オブジェクトの配列

requestKey ライセンスが拒否されたライセンス要求のプロパティ。オブジェクトの配列


requestedFeatures requestedFeatures を参照requestedFeatures を参照


tooltool を参照tool を参照


toolVersion toolVersion を参照toolVersion を参照

responseStatistics 拒否されたライセンス要求に関する統計情報。


requestsDeniedCount ライセンス要求が拒否された回数。integer


requestDeniedUserCount ライセンス要求が拒否されたユーザーの数。integer


requestDeniedUsersライセンス要求が拒否されたユーザーについての情報をリストします。オブジェクトの配列



requestDeniedCount 特定のユーザーのライセンス要求が拒否された回数。integer



requestDeniedTime ユーザーがライセンスをリクエストしたときにマークされたタイム スタンプのリスト。文字列の配列




<timestamp>timestamp を参照 timestamp を参照 



useruser を参照 




hostName hostName を参照 hostName を参照 




namename を参照 name を参照 

リクエストの例

https://myserver:8443/licenseserver/usage/api/v1.0/licenseRejection

レスポンスの例

{
  "noFeatures": [
    {
      "requestKey": {
        "grantedFeatures": [
          "Automation",
          "Change Based Testing",
          "Coding Standards",
          "Coverage"
        ],
        "requestedNoFeatures": [
          "CWE Rules",
          "DTP Publish",
          "Desktop Command Line",
          "Flow Analysis",
          "OWASP Rules",
          "PCI DSS Rules",
          "Security Rules",
          "Unit Test"
        ],
        "tool": "jtest!",
        "toolVersion": "10.4"
      },
      "responseStatistics": {
        "noFeaturesCount": 4,
        "noFeaturesUserCount": 1,
        "noFeaturesUsers": [{
          "noFeaturesCount": 4,
          "noFeaturesTime": [
            "2020-02-12 14:05:08.951",
            "2020-02-12 14:19:08.959",
            "2020-02-12 14:33:08.927",
            "2020-02-12 14:47:08.944"
          ],
          "user": {
            "hostName": "home",
            "name": "kprzybyla"
          }
        }]
      }
    },
    {
      "requestKey": {
        "grantedFeatures": [
          "Automation",
          "Change Based Testing",
          "Coding Standards",
          "Coverage"
        ],
        "requestedNoFeatures": [
          "CWE Rules",
          "DTP Publish",
          "Flow Analysis",
          "OWASP Rules",
          "PCI DSS Rules",
          "Security Rules",
          "Unit Test"
        ],
        "tool": "jtest!",
        "toolVersion": "10.4"
      },
      "responseStatistics": {
        "noFeaturesCount": 10,
        "noFeaturesUserCount": 1,
        "noFeaturesUsers": [{
          "noFeaturesCount": 10,
          "noFeaturesTime": [
            "2020-02-12 15:00:12.015",
            "2020-02-12 15:00:15.364",
            "2020-02-12 15:00:33.480",
            "2020-02-12 15:01:08.924",
            "2020-02-12 15:15:08.953",
            "2020-02-12 15:21:09.053",
            "2020-02-12 15:35:09.158",
            "2020-02-12 15:42:09.243",
            "2020-02-12 15:56:09.369",
            "2020-02-12 16:10:09.374"
          ],
          "user": {
            "hostName": "home",
            "name": "kprzybyla"
          }
        }]
      }
    },
    {
      "requestKey": {
        "grantedFeatures": [
          "Command Line",
          "Jtest Connect",
          "Message Packs",
          "RuleWizard",
          "SOA",
          "Stub Desktop",
          "Stub Server",
          "Web"
        ],
        "requestedNoFeatures": ["Server API Enabled"],
        "tool": "SOAtest",
        "toolVersion": "9.10"
      },
      "responseStatistics": {
        "noFeaturesCount": 10,
        "noFeaturesUserCount": 1,
        "noFeaturesUsers": [{
          "noFeaturesCount": 10,
          "noFeaturesTime": [
            "2020-02-12 13:39:35.481",
            "2020-02-12 13:39:35.506",
            "2020-02-12 13:40:05.580",
            "2020-02-12 13:40:05.630",
            "2020-02-12 13:40:06.692",
            "2020-02-12 13:40:06.708",
            "2020-02-12 13:40:31.765",
            "2020-02-12 13:40:31.781",
            "2020-02-12 13:40:55.839",
            "2020-02-12 13:40:55.854"
          ],
          "user": {
            "hostName": "caprica",
            "name": "modtest"
          }
        }]
      }
    }
  ],
  "noMoreTokens": [
    {
      "requestKey": {
        "requestedFeatures": [],
        "tool": "jtest!",
        "toolVersion": "10.4"
      },
      "responseStatistics": {
        "noMoreTokensCount": 4,
        "noMoreTokensUserCount": 1,
        "noMoreTokensUsers": [{
          "noMoreTokensCount": 4,
          "noMoreTokensTime": [
            "2020-02-12 21:46:09.516",
            "2020-02-12 22:00:09.534",
            "2020-02-12 22:14:09.573",
            "2020-02-12 22:28:09.578"
          ],
          "user": {
            "hostName": "home",
            "name": "kprzybyla"
          }
        }]
      }
    },
    {
      "requestKey": {
        "requestedFeatures": [
          "Automation",
          "CWE Rules",
          "Change Based Testing",
          "Coding Standards",
          "Coverage",
          "DTP Publish",
          "Desktop Command Line",
          "Flow Analysis",
          "OWASP Rules",
          "PCI DSS Rules",
          "Security Rules",
          "Unit Test",
          "Unit Test Bulk Creation",
          "Unit Test Spring Framework"
        ],
        "tool": "jtest!",
        "toolVersion": "10.4"
      },
      "responseStatistics": {
        "noMoreTokensCount": 3,
        "noMoreTokensUserCount": 1,
        "noMoreTokensUsers": [{
          "noMoreTokensCount": 3,
          "noMoreTokensTime": [
            "2020-02-12 12:00:46.576",
            "2020-02-12 12:00:46.840",
            "2020-02-12 12:01:17.713"
          ],
          "user": {
            "hostName": "home",
            "name": "kprzybyla"
          }
        }]
      }
    },
    {
      "requestKey": {
        "requestedFeatures": ["Server API Enabled"],
        "tool": "SOAtest",
        "toolVersion": "9.10"
      },
      "responseStatistics": {
        "noMoreTokensCount": 4,
        "noMoreTokensUserCount": 1,
        "noMoreTokensUsers": [{
          "noMoreTokensCount": 4,
          "noMoreTokensTime": [
            "2020-02-12 13:46:30.425",
            "2020-02-12 13:46:30.463",
            "2020-02-12 13:47:06.557",
            "2020-02-12 13:47:06.579"
          ],
          "user": {
            "hostName": "home",
            "name": "kprzybyla"
          }
        }]
      }
    }
  ],
  "requestDenied": [
    {
      "requestKey": {
        "requestedFeatures": [],
        "tool": "SOAtest",
        "toolVersion": "9.10"
      },
      "responseStatistics": {
        "requestDeniedCount": 10,
        "requestDeniedUserCount": 2,
        "requestDeniedUsers": [
          {
            "requestDeniedCount": 2,
            "requestDeniedTime": [
              "2020-02-12 13:46:30.447",
              "2020-02-12 13:47:06.567"
            ],
            "user": {
              "hostName": "home",
              "name": "kprzybyla"
            }
          },
          {
            "requestDeniedCount": 8,
            "requestDeniedTime": [
              "2020-02-12 13:21:23.734",
              "2020-02-12 13:21:38.810",
              "2020-02-12 13:22:36.874",
              "2020-02-12 13:32:58.201",
              "2020-02-12 13:33:24.331",
              "2020-02-12 13:34:23.410",
              "2020-02-12 13:34:27.483",
              "2020-02-12 13:34:35.555"
            ],
            "user": {
              "hostName": "caprica",
              "name": "modtest"
            }
          }
        ]
      }
    },
    {
      "requestKey": {
        "requestedFeatures": ["Server API Enabled"],
        "tool": "SOAtest",
        "toolVersion": "9.10"
      },
      "responseStatistics": {
        "requestDeniedCount": 6,
        "requestDeniedUserCount": 1,
        "requestDeniedUsers": [{
          "requestDeniedCount": 6,
          "requestDeniedTime": [
            "2020-02-12 13:37:30.630",
            "2020-02-12 13:37:30.668",
            "2020-02-12 13:38:13.751",
            "2020-02-12 13:38:13.773",
            "2020-02-12 13:38:50.842",
            "2020-02-12 13:38:50.857"
          ],
          "user": {
            "hostName": "caprica",
            "name": "modtest"
          }
        }]
      }
    }
  ]
} 

API ページへのアクセス


License Server に付属の SwaggerUI から API を呼び出すことができます。 DTP に付属の SwaggerUI から API を呼び出すことができます。 これは、ライセンスの使用状況を表示するためのポイント アンド クリック インターフェイスを提供します。SwaggerUI はログイン後に使用できます。追加の認証は必要ありません。  

  1. License Server ページを開きます。
  2. [Management] > [Tools Usage] を選択して License Usage API にアクセスします。

エンドポイントを右クリックして URL をコピーし、スクリプトで使用することができます。また、ブラウザーでエンドポイントを検索してデータを素早く表示することも可能です。例: 

  1. ブラウザバーに URL を貼り付け、さらにクエリーを追加します。

    http://<host>/licenseserver/usage/api/v1.0/toolsUsage?startDate=<yyyy-MM-dd>&endDate=<yyyy-MM-dd>
  2. リターン キーを押してエンドポイントを検索します。



  • No labels