ルータ

このセクションでは、ルータでサポートされている以下の操作について説明します。
nfa1000
このセクションでは、ルータでサポートされている以下の操作について説明します。
ルータの編集 - 単一
リソース
URI
http://<nfa odata host>:<nfa odata port>/odata/api/routers(PropertyRef Name value)
メソッド
PATCH
ペイロード
{ "snmpVersion": <snmp version value>, "snmpPort": <snmp portvalue>, "routerName": "<Router name>", "templateId": <template ID value>, "domainID": <domain ID value>, "profileId": <profile ID value> }
  • 有効な snmpVersion 値は 1、2、または 3 です。
  • 1 以上のテンプレート ID を入力します。
サンプル リクエスト
http://127.0.0.1:8981/odata/api/routers(1500004)
サンプル ペイロード
{ "snmpVersion": 2, "snmpPort": 123, "routerName": "127.0.0.1", "templateId": 5, "domainID": 1, "profileId": 5 }
サンプル レスポンス
この API に対するレスポンスはありません。
ルータのドメイン ID を編集すると、関連するテナント ID が更新されます。
ルータの編集 - 一括
この API を使用すると、同じプロパティを持つ複数のエンティティの値を一度に更新できます。この API を使用して、以下のプロパティを編集できます。
  • SNMP プロファイル
  • ドメイン
リソース
URI
http://<nfa odata host>:<nfa odata port>/odata/api/routers/com.ca.nfa.odata.editRouters
メソッド
POST
ペイロード
{ "RouterIds": [<Enter the list of Router_IDs separated by a comma>], "snmpVersion": <snmp version value>, "snmpPort" : <snmp port value>, "templateId" : <template id value>, "profileId" : <profile id value> "domainID" : <domain id value> }
有効な snmpVersion 値は 1、2、または 3 です。
サンプル リクエスト
http://127.0.0.1:8981/odata/api/routers/com.ca.nfa.odata.editRouters
サンプル ペイロード
{
"RouterIds": [1500012,1500013], "snmpVersion": 3, "snmpPort": 1654, "templateId": 1, "profileId": 4, "domainID" :1 }
サンプル レスポンス
{ "@odata.context": "$metadata#Collection(com.ca.nfa.odata.router)", "value": [ { "routerUpdatedOn": 1599147491, "deviceAlias": "10.0.9.11", "dnsExpireTime": 1599752503, "snmpMaxRows": 10, "templateId": 1, "dnsProxyAddress": "10.74.241.203", "deviceName": "10.0.9.11", "domainID": 1, "lifecyclestate": "ACTIVE", "lastHarvesterUpdate": 0, "sysDescr": "10.0.9.11", "sysUptime": 0, "snmpProxyAddress": "10.74.241.203", "snmpRetry": 3, "ifNumber": 0, "harvesterID": 2, "lastReboot": 1599562571, "routerName": null, "firstPollError": 1599562606, "sysName": "", "interfaceCount": 2, "snmpTimeout": 3, "ID": 1500001, "lastData": 0, "lastRefresh": 0, "snmpVersion": 2, "routerAddress": "10.0.9.11", "lastDiscovery": 0, "dnsLastLookupTime": 1599147703, "nextPollRetry": 0, "syncUpdateTime": 0, "profileId": 0, "tenantId": 8, "snmpPort": 161, "agentCount": 2, "flowStatus": "Red", "enabledInterfacesCount": 2, "profileName": null, "harvesterAddress": "127.0.0.1" }, { "routerUpdatedOn": 1599147492, "deviceAlias": "10.0.9.14", "dnsExpireTime": 1599752503, "snmpMaxRows": 10, "templateId": 1, "dnsProxyAddress": "10.74.241.203", "deviceName": "10.0.9.14", "domainID": 1, "lifecyclestate": "ACTIVE", "lastHarvesterUpdate": 0, "sysDescr": "10.0.9.14", "sysUptime": 0, "snmpProxyAddress": "10.74.241.203", "snmpRetry": 3, "ifNumber": 0, "harvesterID": 2, "lastReboot": 1599562571, "routerName": null, "firstPollError": 1599562606, "sysName": "", "interfaceCount": 2, "snmpTimeout": 3, "ID": 1500002, "lastData": 0, "lastRefresh": 0, "snmpVersion": 2, "routerAddress": "10.0.9.14", "lastDiscovery": 0, "dnsLastLookupTime": 1599147703, "nextPollRetry": 0, "syncUpdateTime": 0, "profileId": 0, "tenantId": 8, "snmpPort": 161, "agentCount": 2, "flowStatus": "Red", "enabledInterfacesCount": 2, "profileName": null, "harvesterAddress": "127.0.0.1" } ] }
ルータの有効化 - 単一
リソース
URI
http://<nfa odata host>:<nfa odata port>/odata/api/routers(<routerID Value>)/com.ca.nfa.odata.enableRouter
メソッド
POST
サンプル リクエスト
http://127.0.0.1:8981/odata/api/routers(1500002)/com.ca.nfa.odata.enableRouter
サンプル レスポンス
{
"@odata.context": "$metadata#com.ca.nfa.odata.router",
"ID": 1500002,
"routerAddress": "127.0.0.1",
"sysDescr": "127.0.0.1",
"sysName": "",
"deviceName": "127.0.0.1",
"deviceAlias": "127.0.0.1",
"sysUptime": 0,
"lastData": 0,
"lastReboot": 0,
"lastRefresh": 0,
"lastDiscovery": 1552995238,
"lastHarvesterUpdate": 0,
"firstPollError": 0,
"nextPollRetry": 0,
"harvesterID": 2,
"profileId": 4,
"snmpVersion": 2,
"snmpPort": 161,
"snmpTimeout": 3,
"snmpRetry": 3,
"snmpMaxRows": 10,
"ifNumber": 0,
"interfaceCount": 10,
"agentCount": 10,
"dnsLastLookupTime": 1556194180,
"dnsExpireTime": 1556798980,
"syncUpdateTime": 0,
"routerName": null,
"routerUpdatedOn": 1552995238,
"templateId": 1,
"snmpProxyAddress": "127.0.0.1",
"dnsProxyAddress": "127.0.0.1",
"tenantId": 8,
"domainID": 1
}
ルータの有効化 - 一括
リソース
URI
http://<nfa odata host>:<nfa odata port>/odata/api/routers/com.ca.nfa.odata.enableRouters
メソッド
POST
ペイロード
"RouterIds":[<
List of Router_ids separated by a comma
>
サンプル リクエスト
http://127.0.0.1:8981/odata/api/routers/com.ca.nfa.odata.enableRouters
サンプル ペイロード
"RouterIds":[1554235706, 1554840506, 1553025868]
サンプル レスポンス
{
"@odata.context": "$metadata#Collection(com.ca.nfa.odata.router)",
"value": [
{
"ID": 1500001,
"routerAddress": "127.0.0.1",
"sysDescr": "127.0.0.1",
"sysName": "",
"deviceName": "127.0.0.1",
"deviceAlias": "127.0.0.1",
"sysUptime": 0,
"lastData": 0,
"lastReboot": 0,
"lastRefresh": 0,
"lastDiscovery": 0,
"lastHarvesterUpdate": 0,
"firstPollError": 0,
"nextPollRetry": 0,
"harvesterID": 1,
"profileId": 0,
"snmpVersion": 2,
"snmpPort": 161,
"snmpTimeout": 3,
"snmpRetry": 3,
"snmpMaxRows": 10,
"ifNumber": 0,
"interfaceCount": 10,
"agentCount": 10,
"dnsLastLookupTime": 1554235706,
"dnsExpireTime": 1554840506,
"syncUpdateTime": 0,
"routerName": null,
"routerUpdatedOn": 1553025868,
"templateId": 1,
"snmpProxyAddress": "127.0.0.1",
"dnsProxyAddress": "127.0.0.1",
"tenantId": 8,
"domainID": 1
}
]
}
ルータの無効化 - 単一
リソース
URI
http://<nfa odata host>:<nfa odata port>/odata/api/routers(<routerID value>)/com.ca.nfa.odata.disableRouter
メソッド
POST
サンプル リクエスト
http://127.0.0.1:8981/odata/api/routers(1500002)/com.ca.nfa.odata.disableRouter
サンプル レスポンス
{
"@odata.context": "$metadata#com.ca.nfa.odata.router",
"ID": 1500002,
"routerAddress": "127.0.0.1",
"sysDescr": "127.0.0.1",
"sysName": "",
"deviceName": "127.0.0.1",
"deviceAlias": "127.0.0.1",
"sysUptime": 0,
"lastData": 0,
"lastReboot": 0,
"lastRefresh": 0,
"lastDiscovery": 1552995238,
"lastHarvesterUpdate": 0,
"firstPollError": 0,
"nextPollRetry": 0,
"harvesterID": 2,
"profileId": 4,
"snmpVersion": 2,
"snmpPort": 161,
"snmpTimeout": 3,
"snmpRetry": 3,
"snmpMaxRows": 10,
"ifNumber": 0,
"interfaceCount": 10,
"agentCount": 10,
"dnsLastLookupTime": 1556194180,
"dnsExpireTime": 1556798980,
"syncUpdateTime": 0,
"routerName": null,
"routerUpdatedOn": 1552995238,
"templateId": 1,
"snmpProxyAddress": "127.0.0.1",
"dnsProxyAddress": "127.0.0.1",
"tenantId": 8,
"domainID": 1
}
ルータの無効化 - 一括
サンプル URI
http://<nfa odata host>:<nfa odata port>/odata/api/routers/com.ca.nfa.odata.disableRouters
メソッド
POST
ペイロード
"RouterIds":[<
List of router_ids separated by a comma
>]
サンプル リクエスト
http://127.0.0.1:8981/odata/api/routers/com.ca.nfa.odata.disableRouters
サンプル ペイロード
"RouterIds":[150032,123894,222891,100034]
サンプル レスポンス
{
"@odata.context": "$metadata#Collection(com.ca.nfa.odata.router)",
"value": [
{
"ID": 1500001,
"routerAddress": "127.0.0.1",
"sysDescr": "127.0.0.1",
"sysName": "",
"deviceName": "127.0.0.1",
"deviceAlias": "127.0.0.1",
"sysUptime": 0,
"lastData": 0,
"lastReboot": 0,
"lastRefresh": 0,
"lastDiscovery": 0,
"lastHarvesterUpdate": 0,
"firstPollError": 0,
"nextPollRetry": 0,
"harvesterID": 1,
"profileId": 0,
"snmpVersion": 2,
"snmpPort": 161,
"snmpTimeout": 3,
"snmpRetry": 3,
"snmpMaxRows": 10,
"ifNumber": 0,
"interfaceCount": 10,
"agentCount": 10,
"dnsLastLookupTime": 1554235706,
"dnsExpireTime": 1554840506,
"syncUpdateTime": 0,
"routerName": null,
"routerUpdatedOn": 1553025868,
"templateId": 1,
"snmpProxyAddress": "127.0.0.1",
"dnsProxyAddress": "127.0.0.1",
"tenantId": 8,
"domainID": 1
}
]
}
ルータの削除 - 単一
この API を使用すると、単一のルータを削除できます。
リソース
URI
http://<nfa odata host>:<nfa odata port>/odata/api/routers(<router_id>)
メソッド
DELETE
HTTP ヘッダ
Content-Type:application/json; odata.metadata=minimal
パラメータ
以下の表には、必須パラメータが含まれています。
パラメータ
Description
router_id
ルータ エンティティ セットから削除するルータ ID を指定します。
サンプル リクエスト
以下のリクエストは、ルータ ID 1500002 の削除アクションを示しています。
http://127.0.0.1:8981/odata/api/routers(1500002)
サンプル レスポンス
この API に対するレスポンスはありません。
ルータの削除 - 一括
以下のコードは、ルータの一括削除アクションの参照メタデータ セクションです。
リソース
URI
http://<nfa odata host>:<nfa odata port>/odata/api/routers/com.ca.nfa.odata.deleteRouters
メソッド
POST
ペイロード
"RouterIds":[1500008,1500009]
サンプル リクエスト
以下のリクエストは、ルータ エンティティを一括で削除するための削除アクションを示しています。
http://127.0.0.1:8981/odata/api/routers/com.ca.nfa.odata.deleteRouters
サンプル ペイロード
"RouterIds":[150032,123894,222891,100034]
サンプル レスポンス
{
"@odata.context": "$metadata#Collection(com.ca.nfa.odata.router)",
"value": [
{
"ID": 1500008,
"routerAddress": "127.0.0.1",
"sysDescr": "127.0.0.1",
"sysName": "",
"deviceName": "127.0.0.1",
"deviceAlias": "127.0.0.1",
"sysUptime": 0,
"lastData": 0,
"lastReboot": 0,
"lastRefresh": 0,
"lastDiscovery": 0,
"lastHarvesterUpdate": 0,
"firstPollError": 0,
"nextPollRetry": 0,
"harvesterID": 1,
"profileId": 4,
"snmpVersion": 1,
"snmpPort": 36863,
"snmpTimeout": 3,
"snmpRetry": 3,
"snmpMaxRows": 10,
"ifNumber": 0,
"interfaceCount": 2,
"agentCount": 0,
"dnsLastLookupTime": 1556273867,
"dnsExpireTime": 1556878667,
"syncUpdateTime": 0,
"routerName": null,
"routerUpdatedOn": 1556273741,
"templateId": 1,
"snmpProxyAddress": "127.0.0.1",
"dnsProxyAddress": "127.0.0.1",
"tenantId": 8,
"domainID": 1
},
{
"ID": 1500009,
"routerAddress": "127.0.0.1",
"sysDescr": "127.0.0.1",
"sysName": "",
"deviceName": "127.0.0.1",
"deviceAlias": "127.0.0.1",
"sysUptime": 0,
"lastData": 0,
"lastReboot": 0,
"lastRefresh": 0,
"lastDiscovery": 0,
"lastHarvesterUpdate": 0,
"firstPollError": 0,
"nextPollRetry": 0,
"harvesterID": 1,
"profileId": 4,
"snmpVersion": 1,
"snmpPort": 36863,
"snmpTimeout": 3,
"snmpRetry": 3,
"snmpMaxRows": 10,
"ifNumber": 0,
"interfaceCount": 10,
"agentCount": 8,
"dnsLastLookupTime": 1556273867,
"dnsExpireTime": 1556878667,
"syncUpdateTime": 0,
"routerName": null,
"routerUpdatedOn": 1556273741,
"templateId": 1,
"snmpProxyAddress": "127.0.0.1",
"dnsProxyAddress": "127.0.0.1",
"tenantId": 8,
"domainID": 1
}
]
}
プロファイルのテスト
リソース
URI
http://<nfa odata host>:<nfa odata port>/odata/api/routers(<routerID value>)/com.ca.nfa.odata.testProfile
メソッド
POST
サンプル リクエスト
http://127.0.0.1:8981/odata/api/routers(1500002)/com.ca.nfa.odata.testProfile
サンプル レスポンス
{ "@odata.context": "$metadata#com.ca.nfa.odata.testProfileResponse", "status": "Success" }
プロファイルの検出
リソース
URI
http://<nfa odata host>:<nfa odata port>/odata/api/routers(<routerID value>)/com.ca.nfa.odata.discoverProfile
メソッド
POST
サンプル リクエスト
http://127.0.0.1:8981/odata/api/routers(1500002)/com.ca.nfa.odata.discoverProfile
サンプル レスポンス
{ "@odata.context": "$metadata#com.ca.nfa.odata.discoverProfileResponse", "status": "Success", "message": "Successfully scheduled DISCOVER_PROFILE task." }
プロファイルの検出操作は、タスクをスケジュールするだけです。routers API の「lastDiscoverState」列から操作のステータスを取得できます。