Project

General

Profile

Actions

Bug #43165

closed

Feature #40907: mgr/dashboard: REST API improvements

mgr/dashboard: remove `/api/orchestrator/<resource>` endpoints if possible

Added by Kiefer Chang over 4 years ago. Updated about 3 years ago.

Status:
Resolved
Priority:
High
Assignee:
Category:
General - Back-end
Target version:
% Done:

50%

Source:
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

We are using `/api/orchestrator/<resource>` endpoints to expose information from orchestrator to users.
In order to make the API much RESTful, we should try to minimize the use of the endpoints and integrate those orchestrator calls into suitable existing endpoints.
See these discussions for more information:

Some thoughts of improvement:

/api/orchestrator/status

Keep it or move to /api/summary.

/api/orchestrator/inventory

We use this endpoint to expose devices that belonged to all hosts or one host.

/api/orchestrator/inventory
/api/orchestrator/inventory?hostname=node1

Which might be moved to:

/api/host/node1/devices
The difficulties here are:
  • /host/<hostname>/devices endpoints is already used for devices reported from Ceph. Which needs further integration.
  • There is a page Cluster -> Inventory that lists all devices on all hosts. To keep that page, we need to
    • forkjoin or merge individual calls for each host
    • Create a special endpoint to return all inventory devices, which is the reason I choose /api/orchestrator/inventory before.

/api/orchestrator/service (Moved to /api/services)

May just rename to /api/service.

/api/orchestrator/osd (Removed)

Integrate into /api/osd.

Actions #1

Updated by Alfonso Martínez over 4 years ago

  • Parent task set to #40907
Actions #2

Updated by Lenz Grimmer over 4 years ago

Adding a comment from Ernesto on PR#31851 :

If I were a user of this REST API and wanted to blink lights on a device device_id attached to host host_id I would first look for something like /api/host/<host_id>/device/<device_id>, but I wouldn't figure out that I need to go to some API endpoint called /orchestrator/identify_device

Actions #3

Updated by Lenz Grimmer over 4 years ago

  • Priority changed from Normal to High
  • Target version set to v15.0.0

Raising priority and setting target version to "15.0.0" - this ought to be fixed before the Octopus stable release.

Actions #4

Updated by Ernesto Puerta over 4 years ago

/api/orchestrator/status
Keep it or move to /api/summary.

We can keep this one (perhaps moving it to the root component /api/orchestrator). This simply returns something like:

{
  "available": true,
  "description": "" 
}

/api/orchestrator/inventory
The difficulties here are:
/host/<hostname>/devices endpoints is already used for devices reported from Ceph. Which needs further integration.
There is a page Cluster -> Inventory that lists all devices on all hosts. To keep that page, we need to
forkjoin or merge individual calls for each host
Create a special endpoint to return all inventory devices, which is the reason I choose /api/orchestrator/inventory before.

We may introduce URI templates - RFC6570 (as a way of mapping single URIs to multiple resources either client or server-side, and there are distro-packaged libraries for Python and JS). Nevertheless, the mapping is resolved statically. There's no such a thing as "/hosts/{*}/devices" meaning "fetch all devices from all hosts" (although "/hosts/{host_id}/devices" could do the trick). I think this server-side expansions can be dangerous, as they are basically "SELECT *"-like queries, which might cause scalability issues (e.g.: OSDs, RBD images, RGW buckets, etc.) and force the front-end to perform paged queries by default.

Actions #5

Updated by Kiefer Chang almost 4 years ago

  • Description updated (diff)

Some endpoints are removed. The description is updated to reflect the current state.

Actions #6

Updated by Ernesto Puerta almost 4 years ago

  • % Done changed from 0 to 50

Kiefer Chang wrote:

Some endpoints are removed. The description is updated to reflect the current state.

I will update the %progress of this issue. Would you mind adding a comment with the PR where this has been changed? Thanks a lot, Kiefer!

Actions #7

Updated by Stephan Müller over 3 years ago

How about moving the calls

/api/orchestrator/inventory
/api/orchestrator/inventory?hostname=node1

to

/api/host/inventory
or
/ui-api/host/inventory

/api/host/<$host>/inventory
or
/api/host/inventory/<$host>

or

/api/inventory
/api/inventory/<$host>
Actions #8

Updated by Kiefer Chang over 3 years ago

  • Status changed from New to In Progress
  • Assignee set to Kiefer Chang
Actions #9

Updated by Kiefer Chang over 3 years ago

  • Target version changed from v15.0.0 to v16.0.0
  • Affected Versions v15.2.7, v16.0.0 added
  • Affected Versions deleted (v15.0.0)
Actions #10

Updated by Kiefer Chang over 3 years ago

  • Status changed from In Progress to Fix Under Review
  • Pull request ID set to 38298
Actions #11

Updated by Kiefer Chang over 3 years ago

  • Status changed from Fix Under Review to Resolved
Actions #12

Updated by Ernesto Puerta about 3 years ago

  • Tracker changed from Fix to Bug
  • Project changed from mgr to Dashboard
  • Category changed from 146 to General - Back-end
  • Regression set to No
  • Severity set to 3 - minor
Actions

Also available in: Atom PDF