問題
DNA CenterのIntent APIで、登録されたネットワーク機器の件数を取得する要求はどれか。
- A
GET https://controller.example/dna/intent/api/v1/network-device/count - B
GET https://controller.example/dna/intent/api/v1/network-device?parameter1=value¶meter2=value - C
GET https://controller.example/dna/intent/api/v1/network-device/startIndex/recordsToReturn - D
GET https://controller.example/dna/intent/api/v1/network-device
正解:A
理由
GETのnetwork-device/countで機器の件数を取得する。JSON応答の整数値responseが件数を表す。hostname等のフィルターを付けると、その条件に合う機器を数える。
選択肢ごとの説明
- A.
GET https://controller.example/dna/intent/api/v1/network-device/count count endpointが、指定した条件に合う機器の件数を返す。
- B.
GET https://controller.example/dna/intent/api/v1/network-device?parameter1=value¶meter2=value 一覧の取得へ検索条件を付ける候補で、件数用のendpointはAである。
- C.
GET https://controller.example/dna/intent/api/v1/network-device/startIndex/recordsToReturn 一覧の範囲を指定する候補で、件数用の要求とは異なる。
- D.
GET https://controller.example/dna/intent/api/v1/network-device ネットワーク機器の一覧を取得する。