例如:在一个接口上启用路由

The following example shows how to enable routing on an interface.

interface 1/1/1 routing
  1. Getting the writable configuration information for the interface.

    $curl --noproxy 192.0.2.5 -k GET \ -b /tmp/auth_cookie \ -H 'Content-Type:application/json' -H 'Accept: application/json' "https://192.0.2.5/rest/v10.04/system/interfaces/1%2F1%2F1?selector=writable"

    Response body:

    The GET response body includes only the configuration attributes that have been set.

    {…“routing": false, "udld_arubaos_compatibility_mode": "forward_then_verify", "udld_compatibility": "aruba_os", "udld_enable": false, "udld_interval": 7000, "udld_retries": 4, "udld_rfc5171_compatibility_mode": "normal", "user_config": {} "vlan_mode": null, "vlan_tag": null, "vlan_translations": {}, "vlan_trunks": [], "vlans_per_protocol": {}, "vrf": null, ... }
  2. Update the interface using the return body received from the GET request, modifying theroutingattribute to be:“routing": true.

    Any writable attributes you do not include in the PUT request body are set to their defaults, which could be empty.

    $curl --noproxy -X PUT \ -b /tmp/auth_cookie \ -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{ ... "routing":true, ... }' "https://192.0.2.5/rest/v10.04/system/interfaces/1%2F1%2F1"