カスタム クエリ オプション

カスタム クエリ オプションを使用すると、URL クエリ文字列に追加の情報を含めて、CA NFA OData サービスに提供できます。カスタム クエリ オプションは、$ や @ 文字で始めないようにする必要があります。
nfa1000
カスタム クエリ オプションを使用すると、URL クエリ文字列に追加の情報を含めて、CA NFA OData サービスに提供できます。カスタム クエリ オプションは、$ や @ 文字で始めないようにする必要があります。
以下に、サポートされているカスタム クエリ パラメータを示します。
カスタム クエリ パラメータ
Description
startTime
NFA メトリック データの開始時刻を示す UNIX タイムスタンプ。開始時刻を指定しない場合、開始時刻は指定した終了時刻の 1 時間前になります。
endTime
NFA メトリック データの終了時刻を示す UNIX タイムスタンプ。終了時刻を指定しない場合、終了時刻は指定した開始時刻の 1 時間後になります。
resolution
ターゲット データを指定します。有効な値は
min1
または
min15
で、それぞれ 1 分または 15 分を示します。
queryTimeOut
CA NFA OData リミッタにあるクエリ実行の defaultQueryTimeout システム デフォルト リミッタを上書きします。値は秒単位で入力します。
timeout
CA NFA OData リミッタにある HTTP リクエストの requestTimeout システム デフォルト リミッタを上書きします。値は秒単位で入力します。
プロトコル名(NFA 22.2.2 以降)
プロトコル プロパティを持つエンティティのレスポンスにプロトコル名を含めます。
startTime と endTime を入力することをお勧めします。しかし、startTime と endTime を指定していない場合、UNIX タイムスタンプはデフォルトではクエリがヒットしたときの 1 時間前になります。
要求 URI
http://<
nfa odata host
>:<
nfa odata port
>/odata/api/<
Entity Type
>(<
PropertyRef Name value
>)/<
NavigationProperty
>?<
Custom Query parameter
>=<Value of
Custom Query parameter
>
メソッド
GET
パラメータ
パラメータ
Description
エンティティ タイプ
エンティティ タイプを示します。
有効なエンティティ タイプのリストの詳細については、「メタデータ」を参照してください。
PropertyRef 名の値
PropertyRef 名の値を示します。
PropertyRef 名のリストの詳細については、「メタデータ」を参照してください。
カスタム クエリ パラメータ
カスタム クエリ パラメータのタイプを示します。以下に、サポートされているカスタム クエリ パラメータを示します。
  • startTime
  • endTime
  • resolution
  • queryTimeOut
  • timeout
以下に、カスタム クエリ オプションの例を示します。
startTime の例
サンプル リクエスト
http://127.0.0.1:8981/odata/api/interfaces(3)/hosts?startTime=1541894400
サンプル レスポンス
{
"@odata.context": "$metadata#hosts",
"value": [
{
"router": "127.0.0.1",
"interface": 2,
"timestamp": 1541894400,
"protocol": 0,
"host": "127.0.0.1",
"inoctets": 1650000,
"outoctets": 1650000
},
{
"router": "127.0.0.1",
"interface": 2,
"timestamp": 1541894400,
"protocol": 0,
"host": "127.0.0.1",
"inoctets": 1650000,
"outoctets": 1650000
},
{
"router": "127.0.0.1",
"interface": 2,
"timestamp": 1541894400,
"protocol": 393239,
"host": "127.0.0.1",
"inoctets": 1650000,
"outoctets": 1650000
},
{
"router": "127.0.0.1",
"interface": 2,
"timestamp": 1541894400,
"protocol": 393239,
"host": "127.0.0.1",
"inoctets": 1650000,
"outoctets": 1650000
},
{
"router": "127.0.0.1",
"interface": 2,
"timestamp": 1541895300,
"protocol": 0,
"host": "127.0.0.1",
"inoctets": 1650000,
"outoctets": 1650000
},
{
"router": "127.0.0.1",
"interface": 2,
"timestamp": 1541895300,
"protocol": 0,
"host": "127.0.0.1",
"inoctets": 1650000,
"outoctets": 1650000
},
{
"router": "127.0.0.1",
"interface": 2,
"timestamp": 1541895300,
"protocol": 393239,
"host": "127.0.0.1",
"inoctets": 1650000,
"outoctets": 1650000
},
{
"router": "127.0.0.1",
"interface": 2,
"timestamp": 1541895300,
"protocol": 393239,
"host": "127.0.0.1",
"inoctets": 1650000,
"outoctets": 1650000
},
{
"router": "127.0.0.1",
"interface": 2,
"timestamp": 1541896200,
"protocol": 0,
"host": "127.0.0.1",
"inoctets": 1650000,
"outoctets": 1650000
},
{
"router": "127.0.0.1",
"interface": 2,
"timestamp": 1541896200,
"protocol": 0,
"host": "127.0.0.1",
"inoctets": 1650000,
"outoctets": 1650000
}
],
"@odata.nextLink": "http://127.0.0.1:8981/odata/api/interfaces(3)/hosts?startTime=1541894400&$skiptoken=10"
}
endTime の例
サンプル リクエスト
http://127.0.0.1:8981/odata/api/interfaces(3)/hosts?endTime=1541808000
サンプル レスポンス
{
"@odata.context": "$metadata#hosts",
"value": [
{
"router": "127.0.0.1",
"interface": 2,
"timestamp": 1541804400,
"protocol": 0,
"host": "127.0.0.1",
"inoctets": 1650000,
"outoctets": 1650000
},
{
"router": "127.0.0.1",
"interface": 2,
"timestamp": 1541804400,
"protocol": 0,
"host": "127.0.0.1",
"inoctets": 1650000,
"outoctets": 1650000
},
{
"router": "127.0.0.1",
"interface": 2,
"timestamp": 1541804400,
"protocol": 393239,
"host": "127.0.0.1",
"inoctets": 1650000,
"outoctets": 1650000
},
{
"router": "127.0.0.1",
"interface": 2,
"timestamp": 1541804400,
"protocol": 393239,
"host": "127.0.0.1",
"inoctets": 1650000,
"outoctets": 1650000
},
{
"router": "127.0.0.1",
"interface": 2,
"timestamp": 1541805300,
"protocol": 0,
"host": "127.0.0.1",
"inoctets": 1650000,
"outoctets": 1650000
},
{
"router": "127.0.0.1",
"interface": 2,
"timestamp": 1541805300,
"protocol": 0,
"host": "127.0.0.1",
"inoctets": 1650000,
"outoctets": 1650000
},
{
"router": "127.0.0.1",
"interface": 2,
"timestamp": 1541805300,
"protocol": 393239,
"host": "127.0.0.1",
"inoctets": 1650000,
"outoctets": 1650000
},
{
"router": "127.0.0.1",
"interface": 2,
"timestamp": 1541805300,
"protocol": 393239,
"host": "127.0.0.1",
"inoctets": 1650000,
"outoctets": 1650000
},
{
"router": "127.0.0.1",
"interface": 2,
"timestamp": 1541806200,
"protocol": 0,
"host": "127.0.0.1",
"inoctets": 1650000,
"outoctets": 1650000
},
{
"router": "127.0.0.1",
"interface": 2,
"timestamp": 1541806200,
"protocol": 0,
"host": "127.0.0.1",
"inoctets": 1650000,
"outoctets": 1650000
}
],
"@odata.nextLink": "http://127.0.0.1:8981/odata/api/interfaces(3)/hosts?endTime=1541808000&$skiptoken=10"
}
startTime および endTime の例
サンプル リクエスト
http://127.0.0.1:8981/odata/api/interfaces(10)/hosts?startTime=1541894400&endTime=1541808000
startTime および endTime がない例
サンプル リクエスト
http://127.0.0.1:8981/odata/api/interfaces(10)/hosts?resolution=min15
解決例
サンプル リクエスト
http://127.0.0.1:8981/odata/api/routers(1500001)/deviceName?resolution=min2
サンプル レスポンス
{
"@odata.context": "../$metadata#routers/deviceName",
"value": "127.0.0.1"
}
queryTimeOut の例
サンプル リクエスト
http://127.0.0.1:8981/odata/api/interfaces(291)/hosts?queryTimeOut=
timeout の例
サンプル リクエスト
http://127.0.0.1:8981/odata/api/interfaces(291)/hosts?timeout
サンプル リクエスト
http://127.0.0.1:8981/odata/api/interfaces(291)/hosts?timeout
サンプル レスポンス
{
"@odata.context": "$metadata#hosts",
"value": [
{
"router": "127.0.0.1",
"interface": 9,
"timestamp": 1526892300,
"protocol": 0,
"host": "127.0.0.1",
"inoctets": 1200000,
"outoctets": 12000000
},
{
"router": "127.0.0.1",
"interface": 9,
"timestamp": 1526892300,
"protocol": 0,
"host": "127.0.0.1",
"inoctets": 12000000,
"outoctets": 1200000
},
{
"router": "127.0.0.1",
"interface": 9,
"timestamp": 1526892300,
"protocol": 0,
"host": "127.0.0.1",
"inoctets": 795000,
"outoctets": 7950000
},
{
"router": "127.0.0.1",
"interface": 9,
"timestamp": 1526892300,
"protocol": 0,
"host": "127.0.0.1",
"inoctets": 7950000,
"outoctets": 795000
}
]
}
プロトコル名の例(NFA 22.2.2 以降)
サンプル リクエスト:
http://127.0.0.1:8981/odata/api/interfaces%28291%29/hosts?protocolNames=true