# About request "get filter" for /components/component

**URL:** <https://dmap-community.ductus.global/t/about-request-get-filter-for-components-component/4027>\
**Category:** NETCONF\
**Created:** [March 16, 2022, 7:28am UTC](https://dmap-community.ductus.global/t/about-request-get-filter-for-components-component/4027 "2022-03-16T07:28:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![looyo](https://avatars.discourse-cdn.com/v4/letter/l/50afbb/32.png) [@looyo](https://dmap-community.ductus.global/u/looyo)\
**Post date:** [March 16, 2022, 7:28am UTC](https://dmap-community.ductus.global/t/about-request-get-filter-for-components-component/4027/1 "2022-03-16T07:28:14Z")

</div>

I send request to confd basic7.6 as follows:

```auto
 <?xml version="1.0" encoding="utf-8"?>
<rpc message-id="54" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <get>
    <filter type="subtree">
    <components xmlns="http://openconfig.net/yang/platform" xmlns:oc-platform="http://openconfig.net/yang/platform">
      <component>
        <state>
          <type>PORT</type>
        </state>
        <port></port>
      </component>
    </components>
    </filter>
  </get>
</rpc>

```

I recieve respone as follows：

```auto
<?xml version="1.0" encoding="UTF-8"?>
<rpc-reply message-id="54" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">
    <data>
        <components xmlns="http://openconfig.net/yang/platform">
            <component>
                <state>
                    <name>XGEI-0/0/0/1</name>
                    <type xmlns:oc-platform-types="http://openconfig.net/yang/platform-types">oc-platform-types:PORT</type>
                    <empty>false</empty>
                    <equipment-failure xmlns="http://openconfig.net/yang/alarms">false</equipment-failure>
                    <equipment-mismatch xmlns="http://openconfig.net/yang/alarms">false</equipment-mismatch>
                </state>
                <port>
                    <breakout-mode xmlns="http://openconfig.net/yang/platform/port">
                        <groups>
                            <group>
                                <index>1</index>
                                <config>
                                    <index>1</index>
                                    <num-breakouts>3</num-breakouts>
                                    <breakout-speed xmlns:oc-eth="http://openconfig.net/yang/interfaces/ethernet">oc-eth:SPEED_1GB</breakout-speed>
                                    <num-physical-channels>2</num-physical-channels>
                                </config>
                                <state>
                                    <index>1</index>
                                    <num-breakouts>3</num-breakouts>
                                    <breakout-speed xmlns:oc-eth="http://openconfig.net/yang/interfaces/ethernet">oc-eth:SPEED_1GB</breakout-speed>
                                    <num-physical-channels>2</num-physical-channels>
                                </state>
                            </group>
                        </groups>
                    </breakout-mode>
                </port>
            </component>
        </components>
    </data>
</rpc-reply>

```

But I think /components/component/name and /components/component/config are also expected as follows:

```auto
<?xml version="1.0" encoding="UTF-8"?>
<rpc-reply message-id="54" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">
    <data>
        <components xmlns="http://openconfig.net/yang/platform">
            <component>
                <name>N8K-X9732C-TEST</name>
                <config>
                    <name>N8K-X9732C-TEST</name>
                </config>
                <state>
                    <name>XGEI-0/0/0/1</name>
                    <type xmlns:oc-platform-types="http://openconfig.net/yang/platform-types">oc-platform-types:PORT</type>
                    <empty>false</empty>
                    <equipment-failure xmlns="http://openconfig.net/yang/alarms">false</equipment-failure>
                    <equipment-mismatch xmlns="http://openconfig.net/yang/alarms">false</equipment-mismatch>
                </state>
                <port>
                    <breakout-mode xmlns="http://openconfig.net/yang/platform/port">
                        <groups>
                            <group>
                                <index>1</index>
                                <config>
                                    <index>1</index>
                                    <num-breakouts>3</num-breakouts>
                                    <breakout-speed xmlns:oc-eth="http://openconfig.net/yang/interfaces/ethernet">oc-eth:SPEED_1GB</breakout-speed>
                                    <num-physical-channels>2</num-physical-channels>
                                </config>
                                <state>
                                    <index>1</index>
                                    <num-breakouts>3</num-breakouts>
                                    <breakout-speed xmlns:oc-eth="http://openconfig.net/yang/interfaces/ethernet">oc-eth:SPEED_1GB</breakout-speed>
                                    <num-physical-channels>2</num-physical-channels>
                                </state>
                            </group>
                        </groups>
                    </breakout-mode>
                </port>
            </component>
        </components>
    </data>
</rpc-reply>

```

Is my thinking correct?

---

<div class="post-metadata">

**Author:** ![cohult](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/cohult/32/221_2.png) [@cohult](https://dmap-community.ductus.global/u/cohult)\
**Post date:** [March 18, 2022, 7:17am UTC](https://dmap-community.ductus.global/t/about-request-get-filter-for-components-component/4027/2 "2022-03-18T07:17:52Z")

</div>

I believe you are missing a `<name/>` “selection node” for the first key, and then you can just use a `<config/>` selection node for the config container since it just contains a single leaf.

```xml
...
<component>
  <name/>
  <config/>
  <state>
...

```

See [RFC 6241 - Network Configuration Protocol (NETCONF)](https://datatracker.ietf.org/doc/html/rfc6241#section-6.2.4) section 6.2.4 “Selection Nodes”
