@@ -12,7 +12,7 @@ func getOpenAPISpec(r *http.Request) map[string]interface{} {
1212 "openapi" : "3.0.0" ,
1313 "info" : map [string ]interface {}{
1414 "title" : "DeployScope API" ,
15- "description" : "RESTful API for monitoring Kubernetes deployment statuses" ,
15+ "description" : "RESTful API for monitoring Kubernetes workload statuses (Deployments, StatefulSets, DaemonSets) " ,
1616 "version" : APIVersion ,
1717 },
1818 "servers" : []map [string ]interface {}{
@@ -21,8 +21,8 @@ func getOpenAPISpec(r *http.Request) map[string]interface{} {
2121 "paths" : map [string ]interface {}{
2222 "/services" : map [string ]interface {}{
2323 "get" : map [string ]interface {}{
24- "summary" : "List all services " ,
25- "description" : "List all services with pagination, filtering, and sorting" ,
24+ "summary" : "List all workloads " ,
25+ "description" : "List all workloads with pagination, filtering, and sorting" ,
2626 "parameters" : []map [string ]interface {}{
2727 {
2828 "name" : "page" , "in" : "query" ,
@@ -54,6 +54,11 @@ func getOpenAPISpec(r *http.Request) map[string]interface{} {
5454 "description" : "Filter by version" ,
5555 "schema" : map [string ]string {"type" : "string" },
5656 },
57+ {
58+ "name" : "type" , "in" : "query" ,
59+ "description" : "Filter by workload type" ,
60+ "schema" : map [string ]interface {}{"type" : "string" , "enum" : []string {"deployment" , "statefulset" , "daemonset" }},
61+ },
5762 {
5863 "name" : "sort" , "in" : "query" ,
5964 "description" : "Sort field (name, namespace, version, status, replicas). Prefix '-' for desc" ,
@@ -74,30 +79,30 @@ func getOpenAPISpec(r *http.Request) map[string]interface{} {
7479 },
7580 "/services/{namespace}/{name}" : map [string ]interface {}{
7681 "get" : map [string ]interface {}{
77- "summary" : "Get service by ID" ,
78- "description" : "Get details for a specific service " ,
82+ "summary" : "Get workload by ID" ,
83+ "description" : "Get details for a specific workload " ,
7984 "parameters" : []map [string ]interface {}{
8085 {
8186 "name" : "namespace" , "in" : "path" , "required" : true ,
82- "description" : "Service namespace" ,
87+ "description" : "Workload namespace" ,
8388 "schema" : map [string ]string {"type" : "string" },
8489 },
8590 {
8691 "name" : "name" , "in" : "path" , "required" : true ,
87- "description" : "Service name" ,
92+ "description" : "Workload name" ,
8893 "schema" : map [string ]string {"type" : "string" },
8994 },
9095 },
9196 "responses" : map [string ]interface {}{
9297 "200" : map [string ]interface {}{"description" : "Successful response" },
93- "404" : map [string ]interface {}{"description" : "Service not found" },
98+ "404" : map [string ]interface {}{"description" : "Workload not found" },
9499 },
95100 },
96101 },
97102 "/summary" : map [string ]interface {}{
98103 "get" : map [string ]interface {}{
99104 "summary" : "Get summary statistics" ,
100- "description" : "Get aggregate statistics for all services " ,
105+ "description" : "Get aggregate statistics for all workloads " ,
101106 "responses" : map [string ]interface {}{
102107 "200" : map [string ]interface {}{"description" : "Successful response" },
103108 },
@@ -106,7 +111,7 @@ func getOpenAPISpec(r *http.Request) map[string]interface{} {
106111 "/namespaces" : map [string ]interface {}{
107112 "get" : map [string ]interface {}{
108113 "summary" : "List all namespaces" ,
109- "description" : "List all namespaces with service counts" ,
114+ "description" : "List all namespaces with workload counts" ,
110115 "responses" : map [string ]interface {}{
111116 "200" : map [string ]interface {}{"description" : "Successful response" },
112117 },
@@ -118,16 +123,38 @@ func getOpenAPISpec(r *http.Request) map[string]interface{} {
118123 "ServiceStatus" : map [string ]interface {}{
119124 "type" : "object" ,
120125 "properties" : map [string ]interface {}{
121- "id" : map [string ]string {"type" : "string" , "example" : "production/my-service" },
122- "name" : map [string ]string {"type" : "string" },
123- "namespace" : map [string ]string {"type" : "string" },
124- "version" : map [string ]string {"type" : "string" },
125- "image" : map [string ]string {"type" : "string" },
126- "replicas" : map [string ]string {"type" : "integer" },
127- "ready_replicas" : map [string ]string {"type" : "integer" },
128- "status" : map [string ]interface {}{"type" : "string" , "enum" : []string {"green" , "yellow" , "red" }},
129- "created_at" : map [string ]string {"type" : "string" , "format" : "date-time" },
130- "updated_at" : map [string ]string {"type" : "string" , "format" : "date-time" },
126+ "id" : map [string ]string {"type" : "string" , "example" : "production/my-service" },
127+ "name" : map [string ]string {"type" : "string" },
128+ "namespace" : map [string ]string {"type" : "string" },
129+ "workload_type" : map [string ]interface {}{"type" : "string" , "enum" : []string {"deployment" , "statefulset" , "daemonset" }},
130+ "version" : map [string ]string {"type" : "string" },
131+ "image" : map [string ]string {"type" : "string" },
132+ "replicas" : map [string ]string {"type" : "integer" },
133+ "ready_replicas" : map [string ]string {"type" : "integer" },
134+ "status" : map [string ]interface {}{"type" : "string" , "enum" : []string {"green" , "yellow" , "red" }},
135+ "owner" : map [string ]interface {}{"type" : "string" , "nullable" : true , "description" : "From deployscope.dev/owner annotation" },
136+ "tier" : map [string ]interface {}{"type" : "string" , "nullable" : true , "description" : "From deployscope.dev/tier annotation (critical, standard, best-effort)" },
137+ "managed_by" : map [string ]interface {}{"type" : "string" , "nullable" : true , "description" : "From app.kubernetes.io/managed-by label" },
138+ "part_of" : map [string ]interface {}{"type" : "string" , "nullable" : true , "description" : "From app.kubernetes.io/part-of label" },
139+ "depends_on" : map [string ]interface {}{"type" : "array" , "items" : map [string ]string {"type" : "string" }, "description" : "From deployscope.dev/depends-on annotation" },
140+ "integration" : map [string ]string {"$ref" : "#/components/schemas/Integration" },
141+ "last_transition" : map [string ]interface {}{"type" : "string" , "format" : "date-time" , "nullable" : true , "description" : "Most recent K8s condition transition" },
142+ "created_at" : map [string ]string {"type" : "string" , "format" : "date-time" },
143+ "updated_at" : map [string ]string {"type" : "string" , "format" : "date-time" },
144+ },
145+ },
146+ "Integration" : map [string ]interface {}{
147+ "type" : "object" ,
148+ "description" : "Integration pointers from deployscope.dev/* annotations" ,
149+ "properties" : map [string ]interface {}{
150+ "gitops_repo" : map [string ]interface {}{"type" : "string" , "nullable" : true },
151+ "gitops_path" : map [string ]interface {}{"type" : "string" , "nullable" : true },
152+ "oncall" : map [string ]interface {}{"type" : "string" , "nullable" : true },
153+ "runbook" : map [string ]interface {}{"type" : "string" , "nullable" : true },
154+ "dashboard" : map [string ]interface {}{"type" : "string" , "nullable" : true },
155+ "health_endpoint" : map [string ]interface {}{"type" : "string" , "nullable" : true },
156+ "deep_health" : map [string ]interface {}{"type" : "string" , "nullable" : true },
157+ "deep_health_detail" : map [string ]interface {}{"type" : "string" , "nullable" : true },
131158 },
132159 },
133160 "PaginatedResponse" : map [string ]interface {}{
0 commit comments