Example: GET method

Instructions and examples in this document use an IP address that is reserved for documentation, 192.0.2.5, as an example of the IP address for the switch. To access your switch, you must use the IP address or hostname of that switch.

  • Get the list of all VLANS:

    GET "https://192.0.2.5/rest/v1/system/vlans"
  • Expand the list of URIs in thevlanscollection by one level, which replaces the URI for the VLAN with the JSON data for that VLAN.

    GET "https://192.0.2.5/rest/v1/system/vlans?depth=1"
  • Use thecountparameter to get the total number of VLANs:

    GET "https://192.0.2.5/rest/v1/system/vlans?count"
  • Use thecountparameter with thefilterparameter to get the total number of interfaces in adownadministrative state:

    GET "https://192.0.2.5/rest/v1/system/interfaces?count=true&filter=admin_state:down"
  • Use thefilterparameter with the valuetype:staticto get a list of only the static VLANs:

    GET "https://192.0.2.5/rest/v1/system/vlans?filter=type:static"
  • Use thefilterparameter to get the BGP routes that have 1.1.1.1 as a peer:

    GET "https://192.0.2.5/rest/v1/system/vrfs/default/bgp_routes?filter=peer:1.1.1.1"
  • Use theattributesparameter to get all ports but show only the attributesnameandipv4_address:

    GET "https://192.0.2.5/rest/v1/system/ports?attributes=name,ipv4_address"
  • Use the wildcard character to get a list of routes for all VRFs.

    GET "https://192.0.2.5/rest/v1/system/vrfs/*/routes"
  • Use theselectorparameter to get all the configuration attributes of VLAN 100:

    GET "https://192.0.2.5/rest/v1/system/vlans/100?selector=configuration"
  • Use theselector参数得到所有基于“增大化现实”技术的系统属性e in the categories configuration and status:

    GET "https://192.0.2.5/rest/v1/system?selector=category,status"