< Home

Creating VLAN

This section describes how to create VLAN using the rpc method.

Table 1 Creating VLAN

Operation

XPATH

rpc

/huawei-vlan:vlans/id

Data requirement

Table 2 Creating VLAN

Item

Data

Description

VLAN ID

100

Indicates that VLAN 100 is created.

Request example

<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="25" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
    <edit-config>
        <target>
            <running/>
        </target>
        <config>
            <huawei-vlan:vlans xmlns:huawei-vlan="urn:huawei:params:xml:ns:yang:huawei-vlan">
                <huawei-vlan:vlan>
                    <huawei-vlan:id>100</huawei-vlan:id>
                </huawei-vlan:vlan>
            </huawei-vlan:vlans>
        </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="25">
    <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="26">
    <rpc-error>
        <error-type>application</error-type>
        <error-tag>operation-failed</error-tag>
        <error-severity>error</error-severity>
        <error-message>parse rpc config error.</error-message>
    </rpc-error>
</rpc-reply>
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >