docs: add dashboard BFF API reference#115
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: poox41 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Welcome @poox41! It looks like this is your first PR to kubeedge/dashboard 🎉 |
There was a problem hiding this comment.
Code Review
This pull request introduces a new documentation file, docs/bff-api-reference.md, which provides a detailed reference for the KubeEdge Dashboard BFF API. The document covers authentication, cluster connection, and lists various endpoints for Kubernetes, RBAC, and KubeEdge resources. Review feedback suggested removing specific route counts to reduce maintenance overhead and identified missing name parameters in the PUT request paths for several resources, including Nodes and Deployments, to ensure consistency with other CRUD operations.
| /api/v1 | ||
| ``` | ||
|
|
||
| The current BFF server registers 99 HTTP routes, covering Kubernetes native resources, KubeEdge resources, RBAC resources, CRD query APIs, version query APIs, and Keink installation APIs. |
There was a problem hiding this comment.
The specific count of 99 HTTP routes is likely to become outdated as the API evolves. Consider using a more general description to reduce maintenance overhead. This also applies to the summary table on line 330.
| The current BFF server registers 99 HTTP routes, covering Kubernetes native resources, KubeEdge resources, RBAC resources, CRD query APIs, version query APIs, and Keink installation APIs. | |
| The current BFF server registers a comprehensive set of HTTP routes, covering Kubernetes native resources, KubeEdge resources, RBAC resources, CRD query APIs, version query APIs, and Keink installation APIs. |
| | --- | --- | --- | | ||
| | GET | `/api/v1/node` | List nodes. Supports pagination, filtering, and sorting. | | ||
| | GET | `/api/v1/node/{name}` | Get node detail by name. | | ||
| | PUT | `/api/v1/node` | Update a node. | |
There was a problem hiding this comment.
The PUT path for updating a node is missing the {name} parameter, which is inconsistent with the GET (detail) and DELETE routes for the same resource. Typically, PUT operations target a specific resource instance. Please verify if the actual API implementation requires the name in the path.
| | PUT | `/api/v1/node` | Update a node. | | |
| | PUT | /api/v1/node/{name} | Update a node. | |
| | GET | `/api/v1/deployment/{namespace}` | List deployments in a namespace. Supports pagination, filtering, and sorting. | | ||
| | GET | `/api/v1/deployment/{namespace}/{name}` | Get deployment detail. | | ||
| | POST | `/api/v1/deployment/{namespace}` | Create a deployment in a namespace. | | ||
| | PUT | `/api/v1/deployment/{namespace}` | Update a deployment in a namespace. | |
There was a problem hiding this comment.
Similar to the Node API, the PUT path for Deployment is missing the {name} parameter. For consistency with the GET and DELETE endpoints for the same resource, the path should likely include the resource name. This pattern appears to affect most PUT routes in this document (e.g., ConfigMap, Secret, Service, etc.).
| | PUT | `/api/v1/deployment/{namespace}` | Update a deployment in a namespace. | | |
| | PUT | /api/v1/deployment/{namespace}/{name} | Update a deployment. | |
What type of PR is this?
/kind documentation
What this PR does / why we need it:
This PR adds a Dashboard BFF API reference document.
The document covers:
It helps frontend developers and downstream users understand the existing Dashboard backend APIs.
Which issue(s) this PR fixes:
None
Special notes for your reviewer:
This is a documentation-only change.