Selector parameter
Theselector
parameter of the GET method filters the returned data to include only those attributes that belong to the specified category. By using theselector
参数,你一个void having to list attributes individually using theattributes
parameter.
The default is to include all categories. Use a comma (,
) to separate multiple category values.
The selector categories are the following:
-
配置
-
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.
-
writable
-
Contains the mutable (writable) configuration attributes.
-
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.
指定
depth=2
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 specifydepth=2
, the REST API returns each VLAN represented as a URI, which does not include the attributes of the individual VLANs.指定
selector
parameter with the value配置
.
GET "https://192.0.2.5/rest/v10.04/system/vlans?depth=2&selector=configuration"
Example response:
{ { "admin": "up", "id": 1, "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": "VLAN1", "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" }, { "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" } }