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

RESTful API Reference

CloudEngine 12800 and 12800E V200R005C10

This document describes the OPS APIs supported by the device, including OPS-supported operations, request examples, elements in the requests, response examples, elements in the responses, and response status codes.
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).
Set Layer 2 Interface Attributes

Set Layer 2 Interface Attributes

Operation

URI

Description

PUT

/ethernet/ethernetIfs/ethernetIf

Set a link type and default VLAN for a Layer 2 interface.

Set link attributes for an interface:

  • Request example
    <?xml version="1.0" encoding="UTF-8"?>
         <ethernetIf>
            <ifName>10GE1/0/1</ifName>
            <l2Enable>enable</l2Enable>
            <l2Attribute>
                <linkType>hybrid</linkType>
                <pvid>10</pvid>
                <trunkVlans></trunkVlans>
                <portBridgEnable>true</portBridgEnable>
                <taggedPacketDiscard>false</taggedPacketDiscard>
                <muxVlanEna>
                    <enableVlans>4000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000:4000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000</enableVlans>
                </muxVlanEna>
            </l2Attribute>
         </ethernetIf>

    Table 18-6 describes elements in requests.

    Table 18-6 Elements

    Element

    Description

    ifName

    Specifies an interface name.

    l2Enable

    Indicates whether an interface is a Layer 2 interface.

    linkType

    Specifies the link type of an interface.

    • access: access interface
    • trunk: trunk interface
    • hybrid: hybrid interface
    • dot1qtunnel: QinQ tunnel interface

    pvid

    Specifies the default VLAN ID of an interface.

    trunkVlans

    Specifies the IDs of the VLANs to which an interface is added. The VLAN IDs are in the bit map type.

    portBridgEnable

    Specifies whether loopback is enabled on the interface.

    untagVlans

    Specifies the VLAN IDs to be removed from an interface. The VLAN IDs are in the bit map type.

    taggedPacketDiscard

    Specifies whether an interface discards tagged packets.

    enableVlans

    Specifies a MUX VLAN, in the bit map type.

  • Response example (XML format)
    <?xml version="1.0" encoding="UTF-8"?> 
    <ok/>

    Table 18-7 describes status codes in responses.

    Table 18-7 Status codes

    Status Code

    Description

    200 OK

    The operation succeeded.

    400 Bad Request

    The request operation failed because the request is incorrect in syntax or the information attribute in the request is incorrect.

    500 Internal Server Error

    The request operation failed because of internal errors in services or unidentified processing errors.

Set VLANs to which an interface is to be added:

  • Request example
    <?xml version="1.0" encoding="UTF-8"?>
    <ethernetIfs>
         <ethernetIf>
         <ifName>10GE1/0/1</ifName>
            <l2Attribute>
                   <trunkVlans>403FFFFFFFFFFFFFFFFFFFFFF800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000:0000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000</trunkVlans>
            </l2Attribute>
         </ethernetIf>
    </ethernetIfs>

    Table 18-8 describes elements in requests.

    Table 18-8 Elements

    Element

    Description

    ifName

    Specifies an interface name.

    trunkVlans

    Specifies the IDs of the VLANs to which an interface is added. The VLAN IDs are in the bit map type.

  • Response example (XML format)
    <?xml version="1.0" encoding="UTF-8"?> 
    <ok/>

    Table 18-9 describes status codes in responses.

    Table 18-9 Status codes

    Status Code

    Description

    200 OK

    The operation succeeded.

    400 Bad Request

    The request operation failed because the request is incorrect in syntax or the information attribute in the request is incorrect.

    500 Internal Server Error

    The request operation failed because of internal errors in services or unidentified processing errors.

Modify the VLANs to which an interface is added:

  • Request example
    <?xml version="1.0" encoding="UTF-8"?>
    <ethernetIfs>
         <ethernetIf operation="merge">
             <ifName>10GE1/0/1</ifName>
             <l2Attribute>
                 <trunkVlans>0000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000:0110010000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000</trunkVlans>
            </l2Attribute>
         </ethernetIf>
    </ethernetIfs>

    Table 18-10 describes elements in requests.

    Table 18-10 Elements

    Element

    Description

    ifName

    Specifies an interface name.

    trunkVlans

    Specifies the IDs of the VLANs to which an interface is added. The VLAN IDs are in the bit map type.

  • Response example (XML format)
    <?xml version="1.0" encoding="UTF-8"?> 
    <ok/>

    Table 18-11 describes status codes in responses.

    Table 18-11 Status codes

    Status Code

    Description

    200 OK

    The operation succeeded.

    400 Bad Request

    The request operation failed because the request is incorrect in syntax or the information attribute in the request is incorrect.

    500 Internal Server Error

    The request operation failed because of internal errors in services or unidentified processing errors.

Translation
Download
Updated: 2019-04-03

Document ID: EDOC1100075372

Views: 10435

Downloads: 16

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