Clean up API
Part of: https://github.com/weaveworks/weave-gitops-enterprise/issues/3220
What changed? Protobuf changes
- Refactored APIs to meet the styling guide.
- Ref: https://protobuf.dev/programming-guides/style/
- Routes should contain dashes rather than underscores
- Some routes removed as they were not implemented:
-
/v1/namespace/flux -
/v1/namespaces
-
- Some routes hidden from docs as
INTERNAL-
/v1/crds/{name}/is-available-- not really designed to be used by users -
/v1/reconciled_objects-- unused, remove in a follow up PR -
/v1/child_objects-- unused, remove in a follow up PR -
/v1/session-logs-- discussions to remove
-
User-guide changes
- Adds a small intro section here with API usage examples https://staging.docs.gitops.weave.works/api-cleanup/docs/next/api-server/intro/
- Publish an API reference at https://staging.docs.gitops.weave.works/api-cleanup/docs/next/api-server/reference/
Weave GitOps Core API
What version should we declare? Maybe the same as the Weave GitOps version? Can we automate updating this?
GET /v1/flux/deployments
Determine which controllers are installed, their image versions, status, etc.
Maybe mention “Flux controllers” ?
GET /v1/namespaces/{namespace}/objects/{kind}/{name}
What happens if you don’t provide a cluster?
GET /v1/namespaces/{namespace}/objects/{kind}/{name}/events
What happens if you don’t provide a cluster?
GET /v1/namespaces/{namespace}/objects/{kind}/{name}/inventory
Replace kubernetes with Kubernetes
Weird linespacing here?
What happens if you don’t provide a clusterName?
GET /v1/objects/{kind}
It says “List objects of kind across all clusters” but there’s a clusterName parameter?
Does it only list across all clusters if you don't provide a clusterName?
Can we add an example of a labelSelector?
What happens if you don’t provide a namespace?
PATCH /v1/suspend
Doesn’t say what it does? Maybe something like “This will set the .spec.suspend field on the provided resources which will suspend reconciliation of that resource.”.
PATCH /v1/sync
Doesn’t say what it does? Maybe something like “This will trigger a reconciliation of the referenced objects.”?
GET /v1/policy-validations
Doesn’t say what it does? And I don’t quite get what it does, it looks like it’s querying for events based on involvedObject ?
What happens if you don’t provide clusterName?
GET /v1/policy-validations/{validationId}
What happens if you don’t provide clusterName?
Can we include an example validationId?
What are valid validationTypes?