Errors

Most API calls feature an "errors" array even in their successful responses. If all went well, the "errors" array will be empty. However, if an API partially succeeded and partially failed, the "errors" array will show which servers or server groups for which the API call failed, and the reason(s) for the failure. For example, assume that a client has connected to server groups 'group1' and 'group2', and that server group 'group2' is no longer reachable by the proxy. A call to GET /users would result in a response similar to:

{
  "errors": [
    {
      "detail": "server group 'group2' has no active server: Not available",
      "server_group": "group2",
      "status": 503,
      "type": "Not available"
    }
  ],
  "first": "Cs2do2M05Mon-wvRN8WI9GwTjfEwG1KrASAolyY8A7wc1rd_VA",
  "last": "Cs2do2M05Mon-wvRN8WI9GwTjfEwG1KrASAolyY8A7wc1rd_VA",
  "next": "",
  "prev": "",
  "self": "Cs2do2M05Mon-wvRN8WI9GwTjfEwG1KrASAolyY8A7wc1rd_VA",
  "users": [
    {
      "description": "Route Server",
      "external": false,
      "name": "EMS-SERVER2",
      "server_group": "group1",
      "server_role": "srv1"
    },
    {
      "description": "Main Server",
      "external": false,
      "name": "EMS-SERVER",
      "server_group": "group1",
      "server_role": "srv1"
    },
    {
      "description": "Administrator",
      "external": false,
      "name": "admin",
      "server_group": "group1",
      "server_role": "srv1"
    }
  ]
}

The overall response is an HTTP 200 OK success, with the users from group1 returned and annotated as such. The fact that group2 could not be reached is indicated in the errors array.