annotations api and page

This commit is contained in:
allanice001
2025-09-03 23:10:23 +01:00
parent 4e254fc569
commit d831e911fd
6 changed files with 3030 additions and 8 deletions

View File

@@ -278,6 +278,627 @@
}
}
},
"/api/v1/annotations": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Returns annotations for the organization in X-Org-ID. Filters: `name`, `value`, and `q` (name contains). Add `include=node_pools` to include linked node pools.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"annotations"
],
"summary": "List annotations (org scoped)",
"parameters": [
{
"type": "string",
"description": "Organization UUID",
"name": "X-Org-ID",
"in": "header",
"required": true
},
{
"type": "string",
"description": "Exact name",
"name": "name",
"in": "query"
},
{
"type": "string",
"description": "Exact value",
"name": "value",
"in": "query"
},
{
"type": "string",
"description": "name contains (case-insensitive)",
"name": "q",
"in": "query"
},
{
"type": "string",
"description": "Optional: node_pools",
"name": "include",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/annotations.annotationResponse"
}
}
},
"401": {
"description": "Unauthorized",
"schema": {
"type": "string"
}
},
"403": {
"description": "organization required",
"schema": {
"type": "string"
}
},
"500": {
"description": "failed to list annotations",
"schema": {
"type": "string"
}
}
}
},
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Creates an annotation. Optionally link to node pools.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"annotations"
],
"summary": "Create annotation (org scoped)",
"parameters": [
{
"type": "string",
"description": "Organization UUID",
"name": "X-Org-ID",
"in": "header",
"required": true
},
{
"description": "Annotation payload",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/annotations.createAnnotationRequest"
}
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"$ref": "#/definitions/annotations.annotationResponse"
}
},
"400": {
"description": "invalid json / missing fields / invalid node_pool_ids",
"schema": {
"type": "string"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"type": "string"
}
},
"403": {
"description": "organization required",
"schema": {
"type": "string"
}
},
"500": {
"description": "create failed",
"schema": {
"type": "string"
}
}
}
}
},
"/api/v1/annotations/{id}": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Returns one annotation. Add `include=node_pools` to include node pools.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"annotations"
],
"summary": "Get annotation by ID (org scoped)",
"parameters": [
{
"type": "string",
"description": "Organization UUID",
"name": "X-Org-ID",
"in": "header",
"required": true
},
{
"type": "string",
"description": "Annotation ID (UUID)",
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Optional: node_pools",
"name": "include",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/annotations.annotationResponse"
}
},
"400": {
"description": "invalid id",
"schema": {
"type": "string"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"type": "string"
}
},
"403": {
"description": "organization required",
"schema": {
"type": "string"
}
},
"404": {
"description": "not found",
"schema": {
"type": "string"
}
},
"500": {
"description": "fetch failed",
"schema": {
"type": "string"
}
}
}
},
"delete": {
"security": [
{
"BearerAuth": []
}
],
"description": "Permanently deletes the annotation.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"annotations"
],
"summary": "Delete annotation (org scoped)",
"parameters": [
{
"type": "string",
"description": "Organization UUID",
"name": "X-Org-ID",
"in": "header",
"required": true
},
{
"type": "string",
"description": "Annotation ID (UUID)",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"204": {
"description": "No Content",
"schema": {
"type": "string"
}
},
"400": {
"description": "invalid id",
"schema": {
"type": "string"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"type": "string"
}
},
"403": {
"description": "organization required",
"schema": {
"type": "string"
}
},
"500": {
"description": "delete failed",
"schema": {
"type": "string"
}
}
}
},
"patch": {
"security": [
{
"BearerAuth": []
}
],
"description": "Partially update annotation fields.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"annotations"
],
"summary": "Update annotation (org scoped)",
"parameters": [
{
"type": "string",
"description": "Organization UUID",
"name": "X-Org-ID",
"in": "header",
"required": true
},
{
"type": "string",
"description": "Annotation ID (UUID)",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Fields to update",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/annotations.updateAnnotationRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/annotations.annotationResponse"
}
},
"400": {
"description": "invalid id / invalid json",
"schema": {
"type": "string"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"type": "string"
}
},
"403": {
"description": "organization required",
"schema": {
"type": "string"
}
},
"404": {
"description": "not found",
"schema": {
"type": "string"
}
},
"500": {
"description": "update failed",
"schema": {
"type": "string"
}
}
}
}
},
"/api/v1/annotations/{id}/node_pools": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Returns node pools attached to the annotation. Supports `q` (name contains, case-insensitive).",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"annotations"
],
"summary": "List node pools linked to an annotation (org scoped)",
"parameters": [
{
"type": "string",
"description": "Organization UUID",
"name": "X-Org-ID",
"in": "header",
"required": true
},
{
"type": "string",
"description": "Annotation ID (UUID)",
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Name contains (case-insensitive)",
"name": "q",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/annotations.nodePoolBrief"
}
}
},
"400": {
"description": "invalid id",
"schema": {
"type": "string"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"type": "string"
}
},
"403": {
"description": "organization required",
"schema": {
"type": "string"
}
},
"404": {
"description": "not found",
"schema": {
"type": "string"
}
},
"500": {
"description": "fetch failed",
"schema": {
"type": "string"
}
}
}
},
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Links the annotation to one or more node pools in the same organization.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"annotations"
],
"summary": "Attach annotation to node pools (org scoped)",
"parameters": [
{
"type": "string",
"description": "Organization UUID",
"name": "X-Org-ID",
"in": "header",
"required": true
},
{
"type": "string",
"description": "Annotation ID (UUID)",
"name": "id",
"in": "path",
"required": true
},
{
"description": "IDs to attach",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/annotations.addAnnotationToNodePool"
}
},
{
"type": "string",
"description": "Optional: node_pools",
"name": "include",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/annotations.annotationResponse"
}
},
"400": {
"description": "invalid id / invalid json / invalid node_pool_ids",
"schema": {
"type": "string"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"type": "string"
}
},
"403": {
"description": "organization required",
"schema": {
"type": "string"
}
},
"404": {
"description": "not found",
"schema": {
"type": "string"
}
},
"500": {
"description": "attach failed",
"schema": {
"type": "string"
}
}
}
}
},
"/api/v1/annotations/{id}/node_pools/{poolId}": {
"delete": {
"security": [
{
"BearerAuth": []
}
],
"description": "Unlinks the annotation from the specified node pool.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"annotations"
],
"summary": "Detach annotation from a node pool (org scoped)",
"parameters": [
{
"type": "string",
"description": "Organization UUID",
"name": "X-Org-ID",
"in": "header",
"required": true
},
{
"type": "string",
"description": "Annotation ID (UUID)",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"204": {
"description": "No Content",
"schema": {
"type": "string"
}
},
"400": {
"description": "invalid id",
"schema": {
"type": "string"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"type": "string"
}
},
"403": {
"description": "organization required",
"schema": {
"type": "string"
}
},
"404": {
"description": "not found",
"schema": {
"type": "string"
}
},
"500": {
"description": "detach failed",
"schema": {
"type": "string"
}
}
}
}
},
"/api/v1/auth/introspect": {
"post": {
"description": "Returns whether the token is active and basic metadata",
@@ -4168,6 +4789,76 @@
}
},
"definitions": {
"annotations.addAnnotationToNodePool": {
"type": "object",
"properties": {
"node_pool_ids": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"annotations.annotationResponse": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"node_pools": {
"type": "array",
"items": {
"$ref": "#/definitions/annotations.nodePoolBrief"
}
},
"value": {
"type": "string"
}
}
},
"annotations.createAnnotationRequest": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"node_pool_ids": {
"type": "array",
"items": {
"type": "string"
}
},
"value": {
"type": "string"
}
}
},
"annotations.nodePoolBrief": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
}
}
},
"annotations.updateAnnotationRequest": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"value": {
"type": "string"
}
}
},
"authn.AdminCreateUserRequest": {
"type": "object",
"properties": {