< Home

Querying the Suffix of a Device Name

This section describes how to query the suffix of a device name using the get method.

Table 1 Querying the suffix of a device name

Operation

XPATH

get

/huawei-device:device-state/domain-name

Request Example

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>

Response Example

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>
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >