Selector parameter

The selector parameter of the GET method filters the returned data to include only those attributes that belong to the specified category. By using the selector parameter, you avoid having to list attributes individually using the attributes parameter.

The default is to include all categories. Use a comma (,) to separate multiple category values.

The selector categories are the following:

configuration

Contains user-owned information. Attributes in the configuration category can be supplied by users through REST requests or through the switch CLI. Although an attribute must be in the configuration category to be modified by a user, not all attributes in the configuration category can be modified after the resource instance is created.

statistics

Contains system-supplied data such as counters. Attributes in the statistics category cannot be written by users.

status

Contains system-owned data such as the admin account and various status fields. Attributes in the status category cannot be written by users.

For example, to get the configuration attributes of all VLANs, when you specify the URI of the GET method, do the following:
  • Specify depth=1 to direct the REST API return the JSON representations of each VLAN instead of the URI of each VLAN in the list. If you do not specify depth=1, the REST API returns each VLAN represented as a URI, which does not include the attributes of the individual VLANs.

  • Specify the selector parameter with the value configuration.

GET "https://192.0.2.5/rest/v1/system/bridge/vlans?depth=1&selector=configuration"

Example response:

[
  {
    "admin": "up",
    "id": 20,
    "mgmd_enable": {},
    "mgmd_igmp_block_ports": [],
    "mgmd_igmp_fastleave_ports": [],
    "mgmd_igmp_forcedfastleave_ports": [],
    "mgmd_igmp_forward_ports": [],
    "mgmd_igmp_static_groups": [],
    "mgmd_mld_block_ports": [],
    "mgmd_mld_fastleave_ports": [],
    "mgmd_mld_forcedfastleave_ports": [],
    "mgmd_mld_forward_ports": [],
    "mgmd_mld_static_groups": [],
    "name": "VLAN20",
    "type": "static"
  },
  {
    "admin": "up",
    "id": 10,
    "mgmd_enable": {},
    "mgmd_igmp_block_ports": [],
    "mgmd_igmp_fastleave_ports": [],
    "mgmd_igmp_forcedfastleave_ports": [],
    "mgmd_igmp_forward_ports": [],
    "mgmd_igmp_static_groups": [],
    "mgmd_mld_block_ports": [],
    "mgmd_mld_fastleave_ports": [],
    "mgmd_mld_forcedfastleave_ports": [],
    "mgmd_mld_forward_ports": [],
    "mgmd_mld_static_groups": [],
    "name": "VLAN10",
    "type": "static"
  }
]