|
| 1 | +openapi: 3.1.0 |
| 2 | +info: |
| 3 | + title: Resource Recommender API |
| 4 | + description: Analyzes the history of resource usage (such as CPU and memory) for Kubernetes workloads in a specific cluster and generates data-backed recommendations for optimal resource allocation. |
| 5 | + version: 0.0.1 |
| 6 | +servers: |
| 7 | + - url: http://localhost:8080/orchestrator |
| 8 | + description: Devtron API Server |
| 9 | + |
| 10 | +paths: |
| 11 | + /k8s/resource/recommended: |
| 12 | + post: |
| 13 | + summary: Get Resource Recommendation for a particular resource |
| 14 | + description: Fetch resource recommendations for a specific Kubernetes resource. |
| 15 | + operationId: GetResourceRecommendation |
| 16 | + security: [] |
| 17 | + requestBody: |
| 18 | + description: JSON containing details required to fetch cluster resource recommendations. |
| 19 | + required: true |
| 20 | + content: |
| 21 | + application/json: |
| 22 | + schema: |
| 23 | + $ref: '#/components/schemas/ResourceRequestObject' |
| 24 | + responses: |
| 25 | + '200': |
| 26 | + description: Resource recommendation response |
| 27 | + content: |
| 28 | + application/json: |
| 29 | + schema: |
| 30 | + $ref: '#/components/schemas/ResourceGetResponse' |
| 31 | + tags: |
| 32 | + - Resource Recommendation |
| 33 | + |
| 34 | + /k8s/resource/recommendation/sync: |
| 35 | + post: |
| 36 | + summary: Sync Cluster Resource Recommendations |
| 37 | + description: Sync resource recommendations for a cluster. |
| 38 | + operationId: SyncClusterResourceRecommendations |
| 39 | + security: [] |
| 40 | + requestBody: |
| 41 | + description: JSON containing details required to sync cluster resource recommendations. |
| 42 | + required: true |
| 43 | + content: |
| 44 | + application/json: |
| 45 | + schema: |
| 46 | + $ref: '#/components/schemas/SyncResourceRecommendation' |
| 47 | + responses: |
| 48 | + '200': |
| 49 | + description: Cluster resource recommendation sync response |
| 50 | + content: |
| 51 | + application/json: |
| 52 | + schema: |
| 53 | + type: string |
| 54 | + description: Message indicating sync status |
| 55 | + tags: |
| 56 | + - Resource Recommendation |
| 57 | + |
| 58 | + /k8s/resource/{clusterId}/recommendation/details: |
| 59 | + get: |
| 60 | + summary: Get Cluster Resource Recommendation Details |
| 61 | + description: Fetch metadata of resource recommendations for a cluster. |
| 62 | + operationId: GetClusterResourceRecommendationDetails |
| 63 | + security: [] |
| 64 | + parameters: |
| 65 | + - name: clusterId |
| 66 | + in: path |
| 67 | + required: true |
| 68 | + description: ID of the target cluster. |
| 69 | + schema: |
| 70 | + type: number |
| 71 | + responses: |
| 72 | + '200': |
| 73 | + description: Cluster resource recommendation details response |
| 74 | + content: |
| 75 | + application/json: |
| 76 | + schema: |
| 77 | + $ref: '#/components/schemas/ResourceRecommendationDetails' |
| 78 | + tags: |
| 79 | + - Resource Recommendation |
| 80 | + |
| 81 | + /k8s/resource/recommendation/list: |
| 82 | + post: |
| 83 | + summary: Get Cluster Resource Recommendation List |
| 84 | + description: Fetch all workloads and their resource recommendations. |
| 85 | + operationId: GetClusterResourceRecommendationList |
| 86 | + security: [] |
| 87 | + requestBody: |
| 88 | + description: JSON containing details required to fetch cluster resource recommendations. |
| 89 | + required: true |
| 90 | + content: |
| 91 | + application/json: |
| 92 | + schema: |
| 93 | + $ref: '#/components/schemas/ResourceRequestObject' |
| 94 | + responses: |
| 95 | + '200': |
| 96 | + description: Cluster resource recommendation list response |
| 97 | + content: |
| 98 | + application/json: |
| 99 | + schema: |
| 100 | + $ref: '#/components/schemas/ClusterResourceRecommendationList' |
| 101 | + tags: |
| 102 | + - Resource Recommendation |
| 103 | + |
| 104 | +components: |
| 105 | + schemas: |
| 106 | + ManifestResponse: |
| 107 | + type: object |
| 108 | + required: |
| 109 | + - manifest |
| 110 | + properties: |
| 111 | + recommendedManifest: |
| 112 | + description: Recommended manifest for the resource. |
| 113 | + $ref: '#/components/schemas/K8sManifest' |
| 114 | + manifest: |
| 115 | + description: Current manifest for the resource. |
| 116 | + $ref: '#/components/schemas/K8sManifest' |
| 117 | + |
| 118 | + SyncResourceRecommendation: |
| 119 | + type: object |
| 120 | + description: Request object for syncing resource recommendations for a cluster. |
| 121 | + required: |
| 122 | + - clusterId |
| 123 | + properties: |
| 124 | + clusterId: |
| 125 | + type: number |
| 126 | + description: ID of the target cluster. |
| 127 | + |
| 128 | + ResourceRecommendationDetails: |
| 129 | + type: object |
| 130 | + description: Details of resource recommendations for a cluster. |
| 131 | + required: |
| 132 | + - supportedGVKs |
| 133 | + properties: |
| 134 | + supportedGVKs: |
| 135 | + type: array |
| 136 | + description: List of supported workload GVKs for resource recommendations. |
| 137 | + items: |
| 138 | + $ref: '#/components/schemas/GroupVersionKind' |
| 139 | + lastScannedOn: |
| 140 | + type: string |
| 141 | + format: date-time |
| 142 | + description: Timestamp of the last scan for resource recommendations. |
| 143 | + |
| 144 | + ResourceRequestObject: |
| 145 | + type: object |
| 146 | + required: |
| 147 | + - clusterId |
| 148 | + properties: |
| 149 | + clusterId: |
| 150 | + type: number |
| 151 | + description: ID of the target cluster. |
| 152 | + k8sRequest: |
| 153 | + $ref: '#/components/schemas/K8sRequestObject' |
| 154 | + |
| 155 | + K8sRequestObject: |
| 156 | + type: object |
| 157 | + description: Kubernetes request object containing resource identifiers for filtering. |
| 158 | + properties: |
| 159 | + resourceIdentifier: |
| 160 | + type: object |
| 161 | + description: Resource identifier filter for the Kubernetes resource. |
| 162 | + allOf: |
| 163 | + - $ref: '#/components/schemas/GroupVersionKind' |
| 164 | + properties: |
| 165 | + namespace: |
| 166 | + type: string |
| 167 | + description: Namespace of the Kubernetes resource for filtering. |
| 168 | + |
| 169 | + GroupVersionKind: |
| 170 | + type: object |
| 171 | + description: Group, Version, and Kind of the Kubernetes resource. |
| 172 | + properties: |
| 173 | + group: |
| 174 | + type: string |
| 175 | + description: Group of the Kubernetes resource. |
| 176 | + version: |
| 177 | + type: string |
| 178 | + description: Version of the Kubernetes resource. |
| 179 | + kind: |
| 180 | + type: string |
| 181 | + description: Kind of the Kubernetes resource. |
| 182 | + |
| 183 | + ClusterResourceRecommendationList: |
| 184 | + type: object |
| 185 | + properties: |
| 186 | + headers: |
| 187 | + type: array |
| 188 | + items: |
| 189 | + type: string |
| 190 | + enum: |
| 191 | + - name |
| 192 | + - namespace |
| 193 | + - kind |
| 194 | + - apiVersion |
| 195 | + - containerName |
| 196 | + - cpuRequest |
| 197 | + - cpuLimit |
| 198 | + - memoryRequest |
| 199 | + - memoryLimit |
| 200 | + data: |
| 201 | + type: array |
| 202 | + items: |
| 203 | + type: object |
| 204 | + properties: |
| 205 | + name: |
| 206 | + type: string |
| 207 | + description: Name of the workload resource. |
| 208 | + namespace: |
| 209 | + type: string |
| 210 | + description: Namespace of the workload resource. |
| 211 | + kind: |
| 212 | + type: string |
| 213 | + description: Kind of the workload resource. |
| 214 | + apiVersion: |
| 215 | + type: string |
| 216 | + description: API version of the workload resource. |
| 217 | + containerName: |
| 218 | + type: string |
| 219 | + description: Name of the container in the workload resource. |
| 220 | + cpuRequest: |
| 221 | + $ref: '#/components/schemas/ResourceRecommendation' |
| 222 | + cpuLimit: |
| 223 | + $ref: '#/components/schemas/ResourceRecommendation' |
| 224 | + memoryRequest: |
| 225 | + $ref: '#/components/schemas/ResourceRecommendation' |
| 226 | + memoryLimit: |
| 227 | + $ref: '#/components/schemas/ResourceRecommendation' |
| 228 | + |
| 229 | + ResourceRecommendation: |
| 230 | + type: object |
| 231 | + description: Resource recommendation details for a workload. |
| 232 | + required: |
| 233 | + - current |
| 234 | + properties: |
| 235 | + delta: |
| 236 | + type: number |
| 237 | + format: float64 |
| 238 | + description: Percentage change in resource recommendation. |
| 239 | + current: |
| 240 | + type: string |
| 241 | + description: Current value of the resource recommendation. |
| 242 | + recommended: |
| 243 | + type: string |
| 244 | + description: Recommended value of the resource recommendation. |
| 245 | + |
| 246 | + ResourceGetResponse: |
| 247 | + type: object |
| 248 | + required: |
| 249 | + - manifestResponse |
| 250 | + - secretViewAccess |
| 251 | + properties: |
| 252 | + manifestResponse: |
| 253 | + $ref: '#/components/schemas/ManifestResponse' |
| 254 | + secretViewAccess: |
| 255 | + type: boolean |
| 256 | + description: Whether a user can see obscured secret values. |
| 257 | + |
| 258 | + K8sManifest: |
| 259 | + type: object |
| 260 | + description: Kubernetes manifest of the resource. |
| 261 | + additionalProperties: true |
0 commit comments