No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

S600-E V200R012C00 NETCONF YANG API Reference

This document describes the NETCONF YANG API functions supported by the switch, including the data model and samples.
Rate and give feedback :
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
Batch Command Execution

Batch Command Execution

This section describes the configuration model of batch command execution and provides examples of XML packets.

Data Model

The configuration model file matching batch command execution is huawei-execute-cli.yang.

Table 2-36  Batch command execution

Object

Description

Value Range

Remarks

/huawei-execute-cli:clis/cli/name

Indicates the name of the command set to be executed.

The value is a string of characters.

N/A

/huawei-execute-cli:clis/cli/execute-cli

Indicates the commands to be executed.

The value is a string of characters in the following format:

x

y

...

x and y indicate commands to be executed.

For example, the following command set indicates that the return command is executed to return to the user view, the system-view command is executed to enter the system view, and then the vlan 1000 command is executed to create VLAN 1000.

return

system-view

vlan 1000

The command to be executed cannot be undo netconf.

Executing Commands in a Batch

This section describes how to execute commands in a batch using the rpc method.

Table 2-37  Executing commands in a batch

Operation

XPATH

rpc

  • /huawei-execute-cli:clis/cli/name
  • /huawei-execute-cli:clis/cli/execute-cli
Data requirement

Item

Data

Description

Name of the command set to be executed

cli001

Name of the command set to be executed is cli001.

Commands to be executed

return

system-view

vlan 1000

Execute the return command to return to the user view, execute the system-view command to enter the system view, and then execute the vlan 1000 command to create VLAN 1000.

Request example
<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="1" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <edit-config>
    <target>
      <running/>
    </target>
    <config>
      <hw-execute-cli:clis xmlns:hw-execute-cli="urn:huawei:params:xml:ns:yang:huawei-execute-cli">
        <hw-execute-cli:cli>
          <hw-execute-cli:name>cli001</hw-execute-cli:name>
          <hw-execute-cli:execute-cli>return
system-view
vlan 1000</hw-execute-cli:execute-cli>
        </hw-execute-cli:cli>
      </hw-execute-cli:clis>
    </config>
  </edit-config>
</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="1">
  <ok/>
</rpc-reply>
# Sample of failed response.
<?xml version='1.0' encoding='UTF-8'?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1">
  <rpc-error>
    <error-app-tag>3</error-app-tag>
    <error-message>Wrong parameter.</error-message>
    <error-info>Error on node /huawei-execute-cli:clis/cli[name="cli001"]/execute-cli</error-info>
  </rpc-error>
</rpc-reply>
Translation
Download
Updated: 2018-09-01

Document ID: EDOC1100037962

Views: 7253

Downloads: 8

Average rating:
This Document Applies to these Products
Related Documents
Related Version
Share
Previous Next