NETCONF를 사용하여 구성 객체에 대해 특정 하위 태그 요청
Junos OS 실행되는 디바이스가 있는 NETCONF 세션에서 구성 객체에 대한 특정 하위 태그 요소 및 하위 항목을 요청하기 위해 클라이언트 애플리케이션은 루트(태그 요소로 표시<configuration>)에서 구성 계층의 모든 수준을 나타내는 태그 요소를 개체의 바로 상위 수준으로 묶는 태그 요소를 내 <filter> 보낸다. 요청된 개체를 나타내기 위해 애플리케이션은 컨테이너 태그 요소를 내보낸다. 특정 구성 개체를 요청하려면 식별자 태그 요소를 포함합니다. 단일 식별자를 가진 개체의 <name> 경우, 실제 식별자 태그 요소가 다른 이름을 가지고 있더라도 태그 요소를 항상 사용할 수 있습니다. 실제 이름도 유효합니다. 여러 식별자를 가진 개체의 경우, 식별자 태그 요소의 실제 이름을 사용해야 합니다. 식별자 태그 요소를 생략하면 서버는 해당 유형의 모든 구성 객체에 대해 하위 태그를 반환합니다. 특정 하위 태그를 선택하기 위해 클라이언트 애플리케이션은 컨테이너 태그 요소 내에서 원하는 모든 하위 태그 요소와 하위 요소를 내보낸다. 전체 요청은 태그 요소로 <rpc> 묶입니다.
<rpc>
<get-config>
<source>
<!-- tag specifying the source configuration -->
</source>
<filter type="subtree">
<configuration>
<!-- opening tags for each parent of the object -->
<object>
<name>identifier</name>
<first-child/>
<second-child/>
<third-child>
<!--tags for descendents-->
</third-child>
<!-- tag for each additional child to return -->
</object>
<!-- closing tags for each parent of the object -->
</configuration>
</filter>
</get-config>
</rpc>
]]>]]>
태그 요소에 <source> 대한 정보는 NETCONF를 사용하여 구성 정보 요청에 대한 소스 지정을 참조하십시오.
NETCONF 서버는 및 태그 요소( <data> <rpc-reply> 여기에서 식별자 태그 요소라고 하는 <name>)개체)의 요청된 자식을 반환합니다. 오프닝 <configuration> 태그의 속성에 대한 정보는 NETCONF를 사용하여 구성 정보 요청 소스 지정을 참조하십시오.
<rpc-reply xmlns="URN" xmlns:junos="URL">
<data>
<configuration attributes>
<!-- opening tags for each parent of the object -->
<object>
<name>identifier</name>
<!-- requested child tags -->
</object>
<!-- closing tags for each parent of the object -->
</configuration>
</data>
</rpc-reply>
]]>]]>
또한 애플리케이션은 동일한 <get-config> 태그 요소에 적절한 태그 요소를 포함하여 동일하거나 다른 유형의 추가 구성 요소를 요청할 수 있습니다. 자세한 내용은 NETCONF를 사용하여 동시에 여러 구성 요소 요청을 참조하십시오.
다음 예는 후보 구성의 계층 수준에서 192.168.5.0/24 경로에 [edit routing-options static] 대한 다음 홉 디바이스의 주소만 요청하는 방법을 보여줍니다.
다음 예는 후보 구성의 그룹 계층 수준 내의 각 물리적 인터페이스에 대해 구성된 모든 논리적 인터페이스에 대한 주소를 요청하는 방법을 보여줍니다.
<rpc>
<get-config>
<source>
<candidate/>
</source>
<filter type="subtree">
<configuration>
<groups>
<interfaces>
<interface>
<unit>
<family>
<inet>
<address/>
</inet>
</family>
</unit>
</interface>
</interfaces>
</groups>
</configuration>
</filter>
</get-config>
</rpc>
<rpc-reply xmlns="URN" xmlns:junos="URL">
<data>
<configuration xmlns="URL" junos:commit-seconds=seconds junos:commit-localtime="timestamp" junos:commit-user="user">
<groups>
<name>re0</name>
<interfaces>
<interface>
<name>lo0</name>
<unit>
<name>0</name>
<family>
<inet>
<address>
<name>127.0.0.1/32</name>
</address>
</inet>
</family>
</unit>
</interface>
<interface>
<name>em0</name>
<unit>
<name>0</name>
<family>
<inet>
<address>
<name>198.51.100.1/24</name>
</address>
<address>
<name>198.51.100.11/24</name>
</address>
</inet>
</family>
</unit>
</interface>
</interfaces>
</groups>
</configuration>
</data>
</rpc-reply>