ご意見をお寄せいただきありがとうございました

この記事は機械翻訳されています.免責事項

Citrix Analytics ODATA API

概要

CAS ODATA v4 REST API を使用すると、集約されたデータを簡単に取得できます。現在、CASパフォーマンスデータソースからセッションデータを取得するユーザーをサポートしています。

この記事では、API の使用方法に関するガイダンスを提供します。

API スペシフィケーション

認証

この実装では、Citrix Cloudベアラートークンを使用して認証を行います。

参照先ドキュメント:

Citrix Cloud クライアントIDとCitrix Cloud クライアントシークレット

以下は、トークンを取得するためのサンプルリクエストです。

リクエストのサンプル:

POST https://api.cloud.com/cctrustoauth2/{customerid}/tokens/clients Accept: application/json Content-Type: application/x-www-form-urlencoded Body: grant_type=client_credentials&client_id={client_id}&client_secret={client_secret}

応答サンプル:

HTTP/1.1 200 OK Content-Type: application/json ... { "token_type": "bearer", "access_token": "ey1..", "expires_in": "3600" }

注:

ベアラートークンの有効期限は 1 時間です。1 時間後にクエリを実行する必要がある場合は、再生成してください。

エンドポイント

グローバル: https://api.cloud.com/casodata

例:

https://api.cloud.com/casodata/sessions?year=2023&month=04&day=14は2023/04/14 (UTC) の集計されたセッションデータを取得します。

サービスパス

このセクションには、サービスパスと、セッション、マシン、ユーザーなどのエンティティ名に関する情報が含まれています。たとえば、次のサンプルサービスパスを参照してください:

/sessions?year=2023&month=04&day=14

年、月、日のパラメーターは必須で、UTC 形式で追加されます。

指定された時間のデータもサポートされています。パスは次のとおりです:

/sessions?year=2023&month=04&day=14&hour=10 (Fetch the data of 2023/04/14 10:00)

HTTP ヘッダー

キー サンプル 固定
承認 CwsAuth bearer=   はい
Citrix-CustomerId はい
Content-Type application/json   はい
Citrix-TransactionId     いいえ
Accept-Encoding gzip いいえ

システムオペレーター

CAS ODATA API は、以下の基本的な ODATA システムオプションをサポートしています:

注意:

$select オプションの値にはスペースを入れないでください。

$filter operators and functions

CAS ODATA API は、$filter オプションで次の ODATA 論理演算子と文字列関数をサポートしています:

エンティティとデータ属性

次の 3 つの CAS パフォーマンスエンティティがサポートされています:

サンプルユースケース

メタデータを取得し、その中からいくつかの列を選択してクエリを実行します

  1. メタデータをリクエストする

    リクエストのサンプル:

    curl --location 'https://api.cloud.com/casodata/$metadata' \ --header 'Authorization: CwsAuth bearer=eyJhbGciOiJSUzI1NiIsInR5.....' \ --header 'Citrix-CustomerId: qt64gkrzji7h' \ --header 'Content-Type: application/json'

    応答サンプル:

    <?xml version="1.0" encoding="UTF-8"?> <edmx:Edmx Version="4.0" xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx"> <edmx:DataServices> <Schema xmlns="http://docs.oasis-open.org/odata/ns/edm" Namespace="cas.odata.v1"> <EntityType Name="session"> <Property Name="timestamp" Type="Edm.String"></Property> <Property Name="sessionKey" Type="Edm.String"></Property> <Property Name="sessionScore" Type="Edm.Double"></Property> <Property Name="sessionState" Type="Edm.String"></Property> ... <Property Name="sessionLaunchStatus" Type="Edm.Int32"></Property> <Property Name="sessionLaunchStatusCustom" Type="Edm.String"></Property> </EntityType> <EntityContainer Name="Container"> <EntitySet Name="sessions" EntityType="cas.odata.v1.session" IncludeInServiceDocument="false"></EntitySet> </EntityContainer> </Schema> </edmx:DataServices> </edmx:Edmx>
  2. sessionKeysessionScoresessionStateを選択し、クエリを実行する

    リクエストのサンプル:

    curl --location 'https://api.cloud.com/casodata/sessions?year=2023&month=04&day=14&%24select=sessionKey%2CsessionScore% 2CsessionState' \ --header 'Authorization: CwsAuth bearer=eyJhbGciOiJSUzI1NiIsInR5.....' \ --header 'Citrix-CustomerId: qt64gkrzji7h' \ --header 'Content-Type: application/json'

    応答サンプル:

    { "@odata.context": "$metadata#sessions(sessionKey,sessionScore,sessionState)/$entity", "value": [ { "sessionKey": "009e7f0f-5707-4083-934f-24d8ad5e91f8", "sessionScore": -1.0, "sessionState": "2" }, ... { "sessionKey": "ff0504e3-0867-414a-b0b2-beb73f06fdad", "sessionScore": 0.0, "sessionState": "5" } ] }

指定された日のすべてのデータをページネーションで取得する

クエリのデフォルトの制限は 1000 行です。

ユーザーは$topオプションの値を設定して、クエリの結果行を制限できます。このシナリオでは、 次のページのリンクがクエリ応答の下部に表示されます。

リクエストのサンプル:

curl --location 'https://api.cloud.com/casodata/sessions?year=2023&month=04&day=14&%24top=100' \ --header 'Authorization: CwsAuth bearer=eyJhbGciOiJSUzI1NiIsInR5.....' \ --header 'Citrix-CustomerId: qt64gkrzji7h' \ --header 'Content-Type: application/json'

応答サンプル:

{ "@odata.context": "$metadata#sessions/$entity", "value": [ { "timestamp": "2023-03-28T00:00:00.000Z", "sessionKey": "009e7f0f-5707-4083-934f-24d8ad5e91f8", "sessionScore": 79.0, "sessionState": "2", "sessionType": "0", "userName": "81d0260b529c11fbb05c8dfabb3d312182e6af9deecfc6c036768df2ed3c3a39", "sessionStartTime": "2023-03-28T17:38:38.000Z", "machineName": "253f6a031c9b65cbb7bcc3f137b9878fe0effef010757aec54420776a0d2dd71", "deliveryGroupName": "CVD\BUR CVAD Development", "logonDuration": 18.69, "brokeringDuration": 0.0, "vmStartDuration": 0.0, "hdxConnectionDuration": 0.0, "authenticationDuration": 0.0, "gpoDuration": 0.0, "logonScriptsDuration": 0.0, "profileLoadDuration": 0.0, "interactiveSessionsDuration": 0.0, "siteName": "cloudxdsite", "icaRtt": 125.38, "reconnects": 0.0, "wanLatency": 0, "hostDelay": 0, "dcLatency": 0, "endpointLocationCity": null, "endpointReceiverVersion": "21.6.0.47", "endpointOS": "Windows", "endpointLocationCountry": null, "endpointLinkSpeed": -1.0, "endpointName": "64368231b5d925e40d67449640ca110e9658f63eef37d2579b09b975cc7f7e88", "endpointIP": "850a4b2abc159a2f7d44dac564bda06afad0c558a070a2681f5cc0e1aa81991c", "vdaIP": null, "gatewayFQDN": null, "connectionType": "External", "connectorName": null, "connectorGatewayLatency": 0.0, "networkInterfaceType": null, "isp": null, "sessionLaunchType": "ICA", "throughputBytesReceived": -1.0, "throughputBytesSent": -1.0, "inputBandwidthConsumed": -1.0, "outputBandwidthAvailable": -1.0, "outputBandwidthUsed": -1.0, "networkLatency": -1.0, "outputBandwidthUtilization": -1.0, "siteId": "090e20c8-c852-4a92-9b3f-dfb8d8b2ab61", "sessionLaunchStatus": 0, "sessionLaunchStatusCustom": "Succeeded" }, ... { "timestamp": "2023-04-14T00:00:00.000Z", "sessionKey": "ff0504e3-0867-414a-b0b2-beb73f06fdad", "sessionScore": 0.0, "sessionState": "5", "sessionType": "0", "userName": "aed8a56c38d5d2824d8699a48cdd1b19eb3b16f135c8d61bf2cd6acd465aa998", "sessionStartTime": "2023-03-09T21:39:51.000Z", "machineName": "5603b4dcad97424b6329caccc9cc6ad949b764bbc0015bc6e2a2b4938e4be954", "deliveryGroupName": "Remote PC - Miami LABs", "logonDuration": 0.0, "brokeringDuration": 0.0, "vmStartDuration": 0.0, "hdxConnectionDuration": 0.0, "authenticationDuration": 0.0, "gpoDuration": 0.0, "logonScriptsDuration": 0.0, "profileLoadDuration": 0.0, "interactiveSessionsDuration": 0.0, "siteName": "cloudxdsite", "icaRtt": 0.0, "reconnects": 0.0, "wanLatency": 0, "hostDelay": 0, "dcLatency": 0, "endpointLocationCity": null, "endpointReceiverVersion": null, "endpointOS": "Windows 10", "endpointLocationCountry": null, "endpointLinkSpeed": -1.0, "endpointName": "Precision 5550", "endpointIP": "e74dbbbd20d20f971c0254c6680aad800ad3932c4740544b39a42bb422424272", "vdaIP": null, "gatewayFQDN": null, "connectionType": "External", "connectorName": null, "connectorGatewayLatency": 0.0, "networkInterfaceType": null, "isp": null, "sessionLaunchType": "ICA", "throughputBytesReceived": -1.0, "throughputBytesSent": -1.0, "inputBandwidthConsumed": -1.0, "outputBandwidthAvailable": -1.0, "outputBandwidthUsed": -1.0, "networkLatency": -1.0, "outputBandwidthUtilization": -1.0, "siteId": "090e20c8-c852-4a92-9b3f-dfb8d8b2ab61", "sessionLaunchStatus": 0, "sessionLaunchStatusCustom": "Succeeded" } ], "@odata.nextLink": "https://api.cloud.com/casodata/sessions?year=2023&month=04&day=14&% 24skip=100&%24top=100" }

特定のセッションのすべてのデータを取得する (sessionkey でデータをフィルタリングする)

リクエストのサンプル:

curl --location 'https://api.cloud.com/casodata/sessions?year=2023&month=04&day=14&%24filter=sessionKey%20eq%20% 27009e7f0f-5707-4083-934f-24d8ad5e91f8%27' \ --header 'Authorization: CwsAuth bearer=eyJhbGciOiJSUzI1NiIsInR5.....' \ --header 'Citrix-CustomerId: qt64gkrzji7h' \ --header 'Content-Type: application/json'

応答サンプル:

{ "@odata.context": "$metadata#sessions/$entity", "value": [ { "timestamp": "2023-04-14T00:00:00.000Z", "sessionKey": "009e7f0f-5707-4083-934f-24d8ad5e91f8", "sessionScore": -1.0, "sessionState": "2", "sessionType": "0", "userName": "81d0260b529c11fbb05c8dfabb3d312182e6af9deecfc6c036768df2ed3c3a39", "sessionStartTime": "2023-04-05T17:32:45.000Z", "machineName": "253f6a031c9b65cbb7bcc3f137b9878fe0effef010757aec54420776a0d2dd71", "deliveryGroupName": "CVD\BUR CVAD Development", "logonDuration": 21.2, "brokeringDuration": 0.0, "vmStartDuration": 0.0, "hdxConnectionDuration": 0.0, "authenticationDuration": 0.0, "gpoDuration": 0.0, "logonScriptsDuration": 0.0, "profileLoadDuration": 0.0, "interactiveSessionsDuration": 0.0, "siteName": "cloudxdsite", "icaRtt": 0.0, "reconnects": 0.0, "wanLatency": 0, "hostDelay": 0, "dcLatency": 0, "endpointLocationCity": null, "endpointReceiverVersion": "21.6.0.47", "endpointOS": "Windows", "endpointLocationCountry": null, "endpointLinkSpeed": -1.0, "endpointName": "64368231b5d925e40d67449640ca110e9658f63eef37d2579b09b975cc7f7e88", "endpointIP": "8dbacd9197f4d3dc068fd44b4837828f8e10a19358b14e96d439cfc82042b70f", "vdaIP": null, "gatewayFQDN": null, "connectionType": "External", "connectorName": null, "connectorGatewayLatency": 0.0, "networkInterfaceType": null, "isp": null, "sessionLaunchType": "ICA", "throughputBytesReceived": -1.0, "throughputBytesSent": -1.0, "inputBandwidthConsumed": -1.0, "outputBandwidthAvailable": -1.0, "outputBandwidthUsed": -1.0, "networkLatency": -1.0, "outputBandwidthUtilization": -1.0, "siteId": "090e20c8-c852-4a92-9b3f-dfb8d8b2ab61", "sessionLaunchStatus": 0, "sessionLaunchStatusCustom": "Succeeded" } ] }

特定の日のすべてのアクティブセッションをカウントします

リクエストのサンプル:

curl --location 'https://api.cloud.com/casodata/sessions?year=2023&month=04&day=14&%24count=true&%24filter=sessionState% 20eq%20%275%27' \ --header 'Authorization: CwsAuth bearer=eyJhbGciOiJSUzI1NiIsInR5.....' \ --header 'Citrix-CustomerId: qt64gkrzji7h' \ --header 'Content-Type: application/json'

応答サンプル:

207

データソース

CASセルフサービス検索ダッシュボードは、データを視覚化して顧客管理者に表示し、検索機能を有効にします。ODATA API は同じデータソースを使用するため、顧客管理者はより柔軟にデータを取得してフィルタリングできます。詳細については、「 表形式データ」を参照してください。

このコンテンツの正式なバージョンは英語で提供されています。Cloud Software Groupドキュメントのコンテンツの一部は、お客様の利便性のみを目的として機械翻訳されています。Cloud Software Groupは機械翻訳されたコンテンツを管理していないため、誤り、不正確な情報、不適切な用語が含まれる場合があります。英語の原文から他言語への翻訳について、精度、信頼性、適合性、正確性、またはお使いのCloud Software Group製品またはサービスと機械翻訳されたコンテンツとの整合性に関する保証、該当するライセンス契約書またはサービス利用規約、あるいはCloud Software Groupとのその他すべての契約に基づき提供される保証、および製品またはサービスのドキュメントとの一致に関する保証は、明示的か黙示的かを問わず、かかるドキュメントの機械翻訳された範囲には適用されないものとします。機械翻訳されたコンテンツの使用に起因する損害または問題について、Cloud Software Groupは責任を負わないものとします。
Citrix Analytics ODATA API