Depth parameter

The depth parameter of the GET method specifies to what level URIs in response bodies are to be expanded and replaced by the JSON representation of that resource:

  • Default: 0

  • Maximum: 3

For each level of depth, the REST API expands one level of URIs into their JSON data representations in the response body.

NOTE:

Using the depth parameter can result in large amounts of returned data, depending on the number of items in the list and the amount of JSON data that represents each item.

For example, a GET request on the vlans resource returns a list of URIs. Example request:

GET "https://192.0.2.5/rest/v1/system/vlans"

Example response:

[
  "/rest/v1/system/vlans/1",
  "/rest/v1/system/vlans/10",
  "/rest/v1/system/vlans/20"
]

To specify that those URIs also be expanded and replaced with the JSON data, specify depth=1 as a parameter in the GET request.

Example request:

GET "https://192.0.2.5/rest/v1/system/vlans?depth=1"

Example response (ellipses represent data omitted from this example):

[
  { 
    "id": 1,
	   "name": "DEFAULT_VLAN_1",
	   "type": "default",
	   … 
    "flood_enabled_subsystems": [
      {
         URI-of-first-subsystem
      },
      …
      {
         URI-of-last-subsystem
      } 
    ]
  },
	 { "id": 10,
	   "name": "vlan10",
	   "type": "static",
	   … 
    "flood_enabled_subsystems": [
      {
         URI-of-first-subsystem
      },
      …
      {
         URI-of-last-subsystem
      } 
    ]
  } 
]

Each VLAN in the preceding example includes an attribute, flood_enabled_subsystems, which contains a list of URIs that represent the flood-enabled systems. To specify that those URIs also be expanded and replaced with the JSON data, specify depth=2 as a parameter in the GET request.