You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

创建针对多列表元素负载的GET操作RESTCONF URI

Constructing a RESTCONF GET URI for a Specific Nested List Element

Let's break down how to build the correct RESTCONF URI to target a specific list element in your nested structure. RESTCONF uses a hierarchical path based on your data model, with special syntax to target individual list items using their key fields.

Step-by-Step Breakdown

  1. Start with the standard RESTCONF data root:
    All data retrieval URIs begin with /restconf/data — this is the base path for accessing configuration or state data via RESTCONF.

  2. Traverse the container hierarchy:
    Follow the structure of your payload from top to bottom:

    • System (top-level container)
    • tm-items (child container)
    • sensor-items (child container)
  3. Target the specific top-level list element:
    Lists in RESTCONF require you to specify their key field to select an individual item. For your SensorGroup-list, the key is id. Use the syntax list-name=key=value to pin down the exact element:

    • To get the SensorGroup-list item with id="10", append SensorGroup-list=id=10 to the path.
  4. Drill into nested sub-lists (if needed):
    If you want to target a specific SensorPath-list item inside that group, repeat the list targeting syntax. Assuming depth is the key field for SensorPath-list, append /path-items/SensorPath-list=depth=1 to reach the item with depth="1".

Example URIs

  • Get the entire SensorGroup-list item with id=10:

    /restconf/data/System/tm-items/sensor-items/SensorGroup-list=id=10
    
  • Get the specific SensorPath-list item (depth=1) inside the id=10 SensorGroup:

    /restconf/data/System/tm-items/sensor-items/SensorGroup-list=id=10/path-items/SensorPath-list=depth=1
    
  • Get the id=20 SensorGroup's SensorPath item with depth=5:

    /restconf/data/System/tm-items/sensor-items/SensorGroup-list=id=20/path-items/SensorPath-list=depth=5
    

Key Notes

  • Always use the defined key field of the list to target individual items — this is the most efficient and standard approach in RESTCONF (reserve query param filtering for cases where you need to match non-key fields).
  • Container names are used as-is in the path; only lists require the list-name=key=value syntax to select a specific entry.

内容的提问来源于stack exchange,提问作者Bala

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.22 08:48:56