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

Updated URL Structure #23

Open
invisibleroads opened this issue Dec 26, 2019 · 0 comments
Open

Updated URL Structure #23

invisibleroads opened this issue Dec 26, 2019 · 0 comments

Comments

@invisibleroads
Copy link
Member

invisibleroads commented Dec 26, 2019

In this morning's Asset Tracker Engineering Sprint, Rodrigo, Junbin, Roy drafted the URL structure for the updated back-end.

GET /authorizations.json

  • INPUT
  • OUTPUT
    • 200 returns dictionary
      • userId (string) = 123

      • roles (list of strings) = ["con-edison member", "pg-and-e member"]
        leader = APPA superuser
        member
        spectator
        con-edison leader

        • Can add and edit assets in sketch mode (has access to SKETCH mode)

        pg-and-e member

        • Can only add and edit and comment on tasks
        • Does not have access to sketch mode

        pg-and-e spectator

        • Cannot edit anything, only view
        • Does not have access to sketch mode
    • 401 Unauthorized

GET /authorizations/leave

  • INPUT
  • OUTPUT
    • 200

GET /assets.json

  • INPUT
    • (optional) q = search string = ‘assets x’
  • OUTPUT
    • 400 BAD REQUEST
    • 401 NOT AUTHORIZED
    • 200 returns List of assets that match string
      Each asset
      • id = STRING

      • typeId = STRING (m for meter, s for substation, t for transformer)

      • name = STRING

      • attributes = DICTIONARY of asset type specific attributes (depends on asset type)
        - vendor = STRING
        - product = STRING
        - version = STRING

      • busByIndex = DICTIONARY
        0: {
        id of bus
        attributes for connection
        }

PATCH /assets.json

  • INPUT
  • OUTPUT
    • Same as output of GET /assets.json

DELETE /assets/123.json

  • INPUT
  • OUTPUT
    • 200 SUCCESS
    • 401 NOT AUTHORIZED
    • 404 NOT FOUND

GET /tasks.json

  • INPUT
  • OUTPUT
    • 200 returns List of object
      Each object
      • id = STRING
      • name = STRING
      • status = INTEGER
        0 = New
        100 = Done

POST /tasks.json Create new task

  • INPUT = Object
    • id
    • name
    • status = 0 default
  • OUTPUT
    • 201 Created
      • id = id of new task
    • 400 Bad Request

PATCH /tasks/123.json Update existing task

  • INPUT
    • Same as input for post (but can omit fields that are not being updated)
  • OUTPUT
    • 200 Success
    • 400 bad request
    • 404 not found

DELETE /tasks/123.json Delete existing task

  • OUTPUT
    • 200 success
    • 404 not found

GET /tasks/123/comments.json Get all comments for task

  • INPUT
  • OUTPUT: List/Array that match the tasks’ id
    • id = id of comment = STRING
    • text = text of comment
    • creationTime = timestamp when comment was created
    • modificationTime = timestamp when comment was modified
    • userId = user who made comment

POST /tasks/123/comments.json Add a new comment

  • INPUT
  • OUTPUT
    • 200
      • id = id of new comment

PATCH /tasks/123/comments/123.json Edit an existing comment

  • INPUT
  • OUTPUT
    • 200 success
    • 404 not found

DELETE /tasks/123/comments/123.json Delete an existing comment

  • INPUT
  • OUTPUT
    • 200 success
    • 404 not found

GET /risks.json

  • INPUT
  • OUTPUT = list of objects
    • id = STRING
    • assetId = STRING
    • name = STRING
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant