This section describes how to query the suffix of a device name using the get method.
Operation |
XPATH |
---|---|
get |
/huawei-device:device-state/domain-name |
Query the suffix of a device name configured on the switch.
<?xml version='1.0' encoding='UTF-8'?> <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="4"> <get> <filter type="subtree"> <dev:device-state xmlns:dev="urn:huawei:params:xml:ns:yang:huawei-device"> <dev:domain-name/> </dev:device-state> </filter> </get> </rpc>
Sample of successful response
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="4"> <data> <device-state xmlns="urn:huawei:params:xml:ns:yang:huawei-device"> <domain-name>www.huawei.com</domain-name> </device-state> </data> </rpc-reply>
If no default domain name suffix is configured on the switch, the following information is displayed after a query request is sent:
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="4"> <data/> </rpc-reply>