dpgaspar opened a new issue #8687: [WiP] SIP-31 New dashboards API
URL: https://github.com/apache/incubator-superset/issues/8687
 
 
   ## [SIP] Proposal for new dashboards API
   
   ### Motivation
   
   While moving away from MVC and specifically `ModelView`'s we need to create 
the foundations for supporting React components and plain REST API 
functionality. During this transition I propose we take the chance to 
reorganize the current API that lives on `Superset` class ( exposed on 
`/superset/*`).
   
   Final goals are:
   
   - Restructure Superset's API
   - Create alternatives to `/superset/*` API endpoints, refactor the existing 
functionality respecting a RESTful API design.
   - Prepare/Create base CRUD API endpoints that can eventually replace MVC 
`ModelView`'s and support future React components
   - Superset API is fully documented using OAS 3.X with an optional swagger UI
   
   FAB's new API highlights:
   
   - API resource protection using JWT and/or flask-login signed cookies 
(current authentication method). API defaults to JWT only.
   - Optional CRUD RESTful API using similar class overrides asĀ `ModelViews`.
   - When using auto CRUD we get filter, ordering, pagination and i18n for free.
   - Delegate base API support like handling exceptions to FAB.
   - Leverage Rison style URI arguments (we can use JSON also) out of the box 
with optional JSON schema validation.
   - OpenAPI automatic spec generation for CRUD, and easy generation for 
BaseApi method endpoints.
   
   ### Proposed Change
   
   Migrate and create new CRUD API endpoint for dashboards. This change 
proposes to create the following endpoints:
   
   | New endpoint                           | HTTP method | Old endpoint        
                          |
   
|----------------------------------------|-------------|-----------------------------------------------|
   | /api/v1/dashboard/<id>/published | POST        | 
/superset/dashboard/<dashboard_id>/published/ |
   | /api/v1/dashboard/user_created         | GET         | 
/superset/created_dashboards/<user_id>/       |
   | /api/v1/dashboard/user_favorite        | GET         | 
/superset/fave_dashboards/<user_id>/          |
   | /api/v1/dashboard/&lt;id&gt;/slice     | POST        | 
/superset/add_slices/<dashboard_id>/          |
   | /api/v1/dashboard/&lt;id&gt;/copy      | POST        | /superset/copy_dash 
                          |
   | /api/v1/dashboard/import               | POST        | 
/superset/import_dashboards                   |
   | /api/v1/dashboard/&lt;id&gt;           | PUT         | MVC and old API 
/dashboard/*                  |
   | /api/v1/dashboard/<id>                 | DELETE      | MVC and old API 
/dashboard/*                  |
   | /api/v1/dashboard/                     | POST        | MVC and old API 
/dashboard/*                  |
   | /api/v1/dashboard/_info                | GET         | MVC and old API 
/dashboard/*                  |
   | /api/v1/dashboard/                     | GET         | MVC and old API 
/dashboard/*                  |
   | /api/v1/dashboard/&lt;id&gt;           | GET         | MVC and old API 
/dashboard/*                  |
   | /api/v1/dashboard/export               | GET         | MVC action          
                          |
   
   
   ### New or Changed Public Interfaces
   
   The current dashboard API's endpoints located on `class Superset` will 
continue to exist but would log a deprecation warning when accessed.
   
   List of current endpoint's to be "migrated":
   
   - /superset/dashboard/<dashboard_id>/published/
   - /superset/created_dashboards/<user_id>/
   - /superset/fave_dashboards/<user_id>/
   - /superset/fave_dashboards_by_username/<username>/ (Just deprecation 
warning, this endpoint is probably not used)
   - /superset/add_slices/<dashboard_id>/
   - /superset/copy_dash
   
   All React/JS references to these endpoints would be migrated to the new 
endpoints
   
   ### Migration Plan and Compatibility
   
   This is a side by side migration, the old API would start issuing a 
deprecation warning with a target version for removal. Ex:
   "This superset API is deprecated and will be removed in version 1.0.0"
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to