Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement GET /devices/hierarchy in Go Client Library #347

Open
davidraker opened this issue Jul 10, 2020 · 0 comments
Open

Implement GET /devices/hierarchy in Go Client Library #347

davidraker opened this issue Jul 10, 2020 · 0 comments

Comments

@davidraker
Copy link
Owner

Retrieve a topical hierarchy of all devices on all platforms.

The response provides a dictionary organized hierarchically by segments within the device topic. There is no special meaning to the segments of device topics, but the example response shown here assumes that devices are organized in a pattern common for a campus of buildings: /:campus/:building/:device/:point.

⚠️ It is not necessary that topics all have the same number of segments, therefore some parts of the tree may be deeper than others. Users should not assume a uniform depth to all branches of the tree. It is also possible that a given level of the tree is not uniformly either a dict or a string. For example, in the third building shown in the example, zone level devices have an extra segment to indicate they are served by a particular air handling unit, however the air handling unit device itself has the normal number of segments.

Request:

  • Authorization: BEARER <jwt_token>

Response:

  • With valid BEARER token on success: 200 OK 201 Created 204 No Content
    • Content Type: application/json
    • Body:
      {
          "<campus>": {
              "<building>": {
                  "<device>": "/platforms/:platform/devices/:topic/",
                  "<device>": "/platforms/:platform/devices/:topic/",
                  ...
              },
              "<building>"" {
                  "<device>": "/platforms/:platform/devices/:topic/",
                  "<device>": [
                      "/platforms/:platform1/devices/:topic/",
                      "/platforms/:platform2/devices/:topic/",
                      ...
                  ],
                  ...
              },
              "<building>": {
                  <ahu_device>: "/platforms/:platform/devices/:topic/",
                  <ahu>: {
                      "<zone_device>": "/platforms/:platform/devices/:topic/",
                      "<zone_device>": "/platforms/:platform/devices/:topic/",
                      ...
                  },
                  ...
              },
              ...
          },
          ...
      }
      
  • With valid BEARER token on failure: 400 Bad Request
    • Content Type: application/json
    • Body:
      {
          "error": "<Error Message>"
      }
      
  • With invalid BEARER token: 401 Unauthorized
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant