展開

expand システム クエリ オプションは、インラインで表示する必要がある関連エンティティおよびストリーム値を示します。CA NFA OData サービスは指定されたコンテンツを返し、追加情報を返す場合があります。
nfa1000
expand システム クエリ オプションは、インラインで表示する必要がある関連エンティティおよびストリーム値を示します。CA NFA OData サービスは指定されたコンテンツを返し、追加情報を返す場合があります。
単純な展開
リソース
URI
http://<
nfa odata host
>:<
nfa odata port
>/odata/api/<
EntityType Name
>(<
PropertyRef Name Value
>)?$expand=<
EntityType Name
>
メソッド
GET
パラメータ
以下の表には、必須パラメータが含まれています。
パラメータ
Description
EntityType 名
エンティティのタイプを示します。
有効な EntityType 名のリストの詳細については、「メタデータ」を参照してください。
PropertyRef 名
指定されたエンティティのプロパティ タイプを示します。
有効な EntityType 名のリストの詳細については、「メタデータ」を参照してください。
サンプル リクエスト
このサンプル API は、インターフェース ID 3 のホスト エンティティの詳細を展開します。
http://127.0.0.1:8981/odata/api/interfaces(109)?$expand=hosts
サンプル レスポンス
{
"@odata.context": "$metadata#interfaces(hosts())",
"ID": 109,
"AgentType": "Physical",
"RouterAddress": "127.0.0.1",
"IfIndex": 1,
"PersistentIfIndex": 1,
"RouterId": "1500001",
"RouterName": "127.0.0.1",
"Name": "Interface 1",
"Description": "",
"IfType": "Token Ring",
"InSpeed": 101,
"OutSpeed": 121,
"Linked": "N",
"LastData": 1553473820,
"UpdatedOn": 1553389258,
"HarvesterAddress": "127.0.0.1",
"DomainId": "1",
"Enabled": "Y",
"hosts": [
{
"protocol": 0,
"inoctets": 1500000,
"host": "127.0.0.1",
"outoctets": 150000,
"interface": 1,
"router": "127.0.0.1",
"timestamp": 1553442300
},
{
"protocol": 0,
"inoctets": 150000,
"host": "127.0.0.1",
"outoctets": 1500000,
"interface": 1,
"router": "127.0.0.1",
"timestamp": 1553442300
},
{
"protocol": 65536,
"inoctets": 1500000,
"host": "127.0.0.1",
"outoctets": 150000,
"interface": 1,
"router": "10.0.9.13",
"timestamp": 1553442300
}
]
}
また、以下を指定して展開クエリを使用することもできます。
  • select、top、skip、count、filter などのシステム クエリ オプション。
  • startTime、endTime、resolution、queryTimeOut、timeout などのカスタム クエリ オプション。
リソース
URI
http://
<nfa odata host>:<nfa odata port>
/odata/api/<
EntityType Name
>(<
PropertyRef Name Value
>)?$expand=<
EntityType Name
>&<
list of other system or custom query operator
>
メソッド
GET
パラメータ
以下の表には、必須パラメータが含まれています。
パラメータ
Description
EntityType 名
エンティティのタイプを示します。
有効な EntityType 名のリストの詳細については、「メタデータ」を参照してください。
PropertyRef 名
エンティティのプロパティ参照名を示します。
有効な PropertyRef 名のリストの詳細については、「メタデータ」を参照してください。
サンプル リクエスト
http://127.0.0.1:8981/odata/api/interfaces(110)?$expand=conversations($top=8;$skip=2;$count=true;$filter=protocol eq 0),protocols($top=2)&startTime=1526891820&endTime=1553445000
プロトコル名を含むサンプル リクエスト
http://127.0.0.1:8981/odata/api/interfaces(110)?$expand=conversations($top=8;$skip=2;$count=true;$filter=protocol eq 0),protocols($top=2)&startTime=1526891820&endTime=1553445000 &protocolNames=true
サンプル レスポンス
{
"@odata.context": "$metadata#interfaces(protocols(),conversations())",
"ID": 110,
"AgentType": "Physical",
"RouterAddress": "127.0.0.1",
"IfIndex": 2,
"PersistentIfIndex": 2,
"RouterId": "1500001",
"RouterName": "127.0.0.1",
"Name": "Interface 2",
"Description": "",
"IfType": "Token Ring",
"InSpeed": 101,
"OutSpeed": 121,
"Linked": "N",
"LastData": 1553476521,
"UpdatedOn": 1553389258,
"HarvesterAddress": "127.0.0.1",
"DomainId": "1",
"Enabled": "Y",
"protocols": [
{
"protocol": 0,
"inoctets": 800000,
"outoctets": 520000,
"interface": 2,
"router": "127.0.0.1",
"timestamp": 1553389200
},
{
"protocol": 4,
"inoctets": 800000,
"outoctets": 520000,
"interface": 2,
"router": "127.0.0.1",
"timestamp": 1553389200
}
],
"[email protected]": 6,
"conversations": [
{
"protocol": 0,
"inoctets": 150000,
"outoctets": 1500000,
"SrcHost": "1.1.1.10",
"interface": 2,
"DestHost": "127.0.0.1",
"router": "127.0.0.1",
"timestamp": 1553390100
},
{
"protocol": 0,
"inoctets": 0,
"outoctets": 675000,
"SrcHost": "127.0.0.1",
"interface": 2,
"DestHost": "255.255.255.255",
"router": "127.0.0.1",
"timestamp": 1553390100
},
{
"protocol": 0,
"inoctets": 0,
"outoctets": 150000,
"SrcHost": "127.0.0.1",
"interface": 2,
"DestHost": "255.255.255.255",
"router": "127.0.0.1",
"timestamp": 1553390100
},
{
"protocol": 0,
"inoctets": 150000,
"outoctets": 1500000,
"SrcHost": "1.1.1.10",
"interface": 2,
"DestHost": "127.0.0.1",
"router": "127.0.0.1",
"timestamp": 1553391000
},
{
"protocol": 0,
"inoctets": 0,
"outoctets": 675000,
"SrcHost": "127.0.0.1",
"interface": 2,
"DestHost": "255.255.255.255",
"router": "127.0.0.1",
"timestamp": 1553391000
},
{
"protocol": 0,
"inoctets": 0,
"outoctets": 150000,
"SrcHost": "127.0.0.1",
"interface": 2,
"DestHost": "255.255.255.255",
"router": "127.0.0.1",
"timestamp": 1553391000
}
]
}
使用率に関する展開
リソース
URI
http://<
nfa odata host
>:<
nfa odata port
>/odata/api/interfaces?$expand=utilization&$apply=groupby((utilization/protocol),aggregate(Utilization))&startTime=<
Start time
>&endTime=<
end time
>&resolution<
MIN1 or Min15>
メソッド
GET
パラメータ
以下の表には、オプションのパラメータが含まれています。
パラメータ
Description
startTime
NFA メトリック データの開始時刻を示す UNIX タイムスタンプ。
開始時刻を指定しない場合、開始時刻は指定した終了時刻の 1 時間前になります。
endTime
NFA メトリック データの終了時刻を示す UNIX タイムスタンプ。
終了時刻を指定しない場合、終了時刻は指定した開始時刻の 1 時間後になります。
resolution
ターゲット データを指定します。有効な値は
min1
または
min15
で、それぞれ 1 分または 15 分を示します。
デフォルトでは、この値は 15 分です。
サンプル リクエスト
http://127.0.0.1:8981/odata/api/interfaces?$expand=utilization&$apply=groupby((utilization/protocol),aggregate(Utilization))&startTime=1541480880&endTime=1541480980&resolution=MIN1
サンプル レスポンス
このサンプル レスポンスは、インターフェース エンティティの使用率エンティティ タイプを展開し、プロトコル、開始時刻、および終了時刻に基づいて使用率データをグループ化します。
{
"@odata.context": "$metadata#interfaces(utilization())",
"value": [
{
"ID": 229,
"AgentType": "Physical",
"RouterAddress": "127.0.0.1",
"IfIndex": 8,
"PersistentIfIndex": 10,
"RouterId": "1500001",
"RouterName": "127.0.0.1",
"Name": "Interface 8",
"Description": "",
"IfType": "WAN",
"InSpeed": 100,
"OutSpeed": 200,
"Linked": "N",
"LastData": 1543301125,
"UpdatedOn": 1539340223,
"HarvesterAddress": "127.0.0.1",
"DomainId": "1",
"Enabled": "Y",
"utilization": []
},
{
"ID": 228,
"AgentType": "Physical",
"RouterAddress": "127.0.0.1",
"IfIndex": 7,
"PersistentIfIndex": 9,
"RouterId": "1500001",
"RouterName": "127.0.0.1",
"Name": "Interface 7",
"Description": "",
"IfType": "WAN",
"InSpeed": 100,
"OutSpeed": 200,
"Linked": "N",
"LastData": 1543301125,
"UpdatedOn": 1539340223,
"HarvesterAddress": "127.0.0.1",
"DomainId": "1",
"Enabled": "Y",
"utilization": [
{
"protocol": 1769472,
"UtcTimeStamp": "1541480400",
"Total": "6.52",
"In": "9.78",
"Out": "4.89",
"interface": 9,
"router": "127.0.0.1"
},
{
"protocol": 1769472,
"UtcTimeStamp": "1541484000",
"Total": "6.52",
"In": "9.78",
"Out": "4.89",
"interface": 9,
"router": "127.0.0.1"
}
]
},
{
"ID": 223,
"AgentType": "Physical",
"RouterAddress": "127.0.0.1",
"IfIndex": 3,
"PersistentIfIndex": 4,
"RouterId": "1500001",
"RouterName": "127.0.0.1",
"Name": "Interface 3",
"Description": "",
"IfType": "WAN",
"InSpeed": 100,
"OutSpeed": 200,
"Linked": "N",
"LastData": 1543301125,
"UpdatedOn": 1539340223,
"HarvesterAddress": "127.0.0.1",
"DomainId": "1",
"Enabled": "Y",
"utilization": [
{
"protocol": 0,
"UtcTimeStamp": "1541480400",
"Total": "57.68",
"In": "85.91",
"Out": "43.57",
"interface": 4,
"router": "127.0.0.1"
},
{
"protocol": 0,
"UtcTimeStamp": "1541484000",
"Total": "57.68",
"In": "85.91",
"Out": "43.57",
"interface": 4,
"router": "127.0.0.1"
},
{
"protocol": 393236,
"UtcTimeStamp": "1541480400",
"Total": "3.26",
"In": "4.89",
"Out": "2.44",
"interface": 4,
"router": "127.0.0.1"
},
{
"protocol": 393236,
"UtcTimeStamp": "1541484000",
"Total": "3.26",
"In": "4.89",
"Out": "2.44",
"interface": 4,
"router": "127.0.0.1"
},
{
"protocol": 393239,
"UtcTimeStamp": "1541480400",
"Total": "3.75",
"In": "5.62",
"Out": "2.81",
"interface": 4,
"router": "127.0.0.1"
},
{
"protocol": 393239,
"UtcTimeStamp": "1541484000",
"Total": "3.75",
"In": "5.62",
"Out": "2.81",
"interface": 4,
"router": "127.0.0.1"
},
{
"protocol": 393241,
"UtcTimeStamp": "1541480400",
"Total": "7.41",
"In": "11.11",
"Out": "5.56",
"interface": 4,
"router": "127.0.0.1"
},
{
"protocol": 393241,
"UtcTimeStamp": "1541484000",
"Total": "7.41",
"In": "11.11",
"Out": "5.56",
"interface": 4,
"router": "127.0.0.1"
},
{
"protocol": 393296,
"UtcTimeStamp": "1541480400",
"Total": "13.04",
"In": "19.56",
"Out": "9.78",
"interface": 4,
"router": "127.0.0.1"
},
{
"protocol": 393296,
"UtcTimeStamp": "1541484000",
"Total": "13.04",
"In": "19.56",
"Out": "9.78",
"interface": 4,
"router": "127.0.0.1"
},
{
"protocol": 1114165,
"UtcTimeStamp": "1541480400",
"Total": "8.64",
"In": "12.96",
"Out": "6.48",
"interface": 4,
"router": "127.0.0.1"
},
{
"protocol": 1114165,
"UtcTimeStamp": "1541484000",
"Total": "8.64",
"In": "12.96",
"Out": "6.48",
"interface": 4,
"router": "127.0.0.1"
}
]
},
{
"ID": 221,
"AgentType": "Physical",
"RouterAddress": "127.0.0.1",
"IfIndex": 5,
"PersistentIfIndex": 2,
"RouterId": "1500001",
"RouterName": "127.0.0.1",
"Name": "Interface 5",
"Description": "",
"IfType": "WAN",
"InSpeed": 100,
"OutSpeed": 200,
"Linked": "N",
"LastData": 1543301125,
"UpdatedOn": 1539340223,
"HarvesterAddress": "127.0.0.1",
"DomainId": "1",
"Enabled": "Y",
"utilization": [
{
"protocol": 1114142,
"UtcTimeStamp": "1541480400",
"Total": "4.89",
"In": "7.33",
"Out": "3.67",
"interface": 2,
"router": "127.0.0.1"
},
{
"protocol": 1114142,
"UtcTimeStamp": "1541484000",
"Total": "4.89",
"In": "7.33",
"Out": "3.67",
"interface": 2,
"router": "127.0.0.1"
}
]
},
"@odata.nextLink": "http://localhost:8981/odata/api/interfaces?$expand=utilization&$apply=groupby%28%28utilization/protocol%29,aggregate%28Utilization%29%29&startTime=1541480880&endTime=1541480980&resolution=MIN1&$skiptoken=10"
}