|
| 1 | +openapi: 3.0.0 |
| 2 | +info: |
| 3 | + title: Drift Detection API |
| 4 | + description: API to detect configuration drifts in an application environment. |
| 5 | + version: 1.0.0 |
| 6 | +servers: |
| 7 | + - url: http://localhost:8080 |
| 8 | + description: Local server |
| 9 | + |
| 10 | +paths: |
| 11 | + /orchestrator/drift/managed-resources: |
| 12 | + get: |
| 13 | + summary: Get Managed Resources |
| 14 | + operationId: getManagedResources |
| 15 | + parameters: |
| 16 | + - name: app-id |
| 17 | + in: query |
| 18 | + required: true |
| 19 | + schema: |
| 20 | + type: integer |
| 21 | + - name: env-id |
| 22 | + in: query |
| 23 | + required: true |
| 24 | + schema: |
| 25 | + type: integer |
| 26 | + responses: |
| 27 | + '200': |
| 28 | + description: Successful response |
| 29 | + content: |
| 30 | + application/json: |
| 31 | + schema: |
| 32 | + $ref: '#/components/schemas/ManagedResourcesResponse' |
| 33 | + '400': |
| 34 | + description: Bad request |
| 35 | + '401': |
| 36 | + description: Unauthorized |
| 37 | + '404': |
| 38 | + description: Not found |
| 39 | + '500': |
| 40 | + description: Internal server error |
| 41 | + |
| 42 | + /orchestrator/drift/managed-resource: |
| 43 | + post: |
| 44 | + summary: Get managed resource details |
| 45 | + description: Returns the managed resource details including desired and live states for a given application and environment. |
| 46 | + requestBody: |
| 47 | + required: true |
| 48 | + content: |
| 49 | + application/json: |
| 50 | + schema: |
| 51 | + type: object |
| 52 | + properties: |
| 53 | + AppId: |
| 54 | + type: string |
| 55 | + description: ID of the application. |
| 56 | + ClusterId: |
| 57 | + type: integer |
| 58 | + description: ID of the cluster. |
| 59 | + AppType: |
| 60 | + type: string |
| 61 | + enum: |
| 62 | + - DevtronAppType |
| 63 | + - HelmAppType |
| 64 | + - ArgoAppType |
| 65 | + - FluxAppType |
| 66 | + description: Type of the application. |
| 67 | + K8sRequest: |
| 68 | + type: object |
| 69 | + properties: |
| 70 | + ResourceIdentifier: |
| 71 | + type: object |
| 72 | + properties: |
| 73 | + GroupVersionKind: |
| 74 | + type: object |
| 75 | + properties: |
| 76 | + Group: |
| 77 | + type: string |
| 78 | + description: API group of the Kubernetes resource. |
| 79 | + Version: |
| 80 | + type: string |
| 81 | + description: API version of the Kubernetes resource. |
| 82 | + Kind: |
| 83 | + type: string |
| 84 | + description: Kind of the Kubernetes resource. |
| 85 | + DevtronAppIdentifier: |
| 86 | + type: object |
| 87 | + properties: |
| 88 | + AppId: |
| 89 | + type: string |
| 90 | + description: ID of the Devtron application. |
| 91 | + EnvId: |
| 92 | + type: string |
| 93 | + description: ID of the environment. |
| 94 | + responses: |
| 95 | + '200': |
| 96 | + description: Successfully retrieved managed resource details |
| 97 | + content: |
| 98 | + application/json: |
| 99 | + schema: |
| 100 | + type: object |
| 101 | + properties: |
| 102 | + DesiredState: |
| 103 | + type: object |
| 104 | + description: The desired state of the resource. |
| 105 | + LiveState: |
| 106 | + type: object |
| 107 | + description: The live state of the resource. |
| 108 | + NormalizedLiveState: |
| 109 | + type: object |
| 110 | + description: The normalized live state of the resource. |
| 111 | + PredictedLiveState: |
| 112 | + type: object |
| 113 | + description: The predicted live state of the resource. |
| 114 | + Modified: |
| 115 | + type: boolean |
| 116 | + description: Indicates if the resource has been modified. |
| 117 | + '400': |
| 118 | + description: Invalid input, missing or incorrect parameters |
| 119 | + '403': |
| 120 | + description: Unauthorized access |
| 121 | + '500': |
| 122 | + description: Internal server error |
| 123 | +components: |
| 124 | + schemas: |
| 125 | + ResourceRequestBean: |
| 126 | + type: object |
| 127 | + properties: |
| 128 | + AppId: |
| 129 | + type: string |
| 130 | + ClusterId: |
| 131 | + type: integer |
| 132 | + ManagedResource: |
| 133 | + type: object |
| 134 | + properties: |
| 135 | + DesiredState: |
| 136 | + type: string |
| 137 | + LiveState: |
| 138 | + type: string |
| 139 | + NormalizedLiveState: |
| 140 | + type: object |
| 141 | + PredictedLiveState: |
| 142 | + type: object |
| 143 | + HasDrift: |
| 144 | + type: boolean |
| 145 | + ManagedResourcesResponse: |
| 146 | + type: object |
| 147 | + properties: |
| 148 | + resources: |
| 149 | + type: array |
| 150 | + items: |
| 151 | + $ref: '#/components/schemas/ManagedResource' |
| 152 | + ManifestComparison: |
| 153 | + type: object |
| 154 | + properties: |
| 155 | + drift: |
| 156 | + type: boolean |
| 157 | + description: Indicates if there is a drift. |
| 158 | + liveManifest: |
| 159 | + type: string |
| 160 | + description: The live manifest data. |
| 161 | + storedManifest: |
| 162 | + type: string |
| 163 | + description: The stored manifest data. |
| 164 | + kind: |
| 165 | + type: string |
| 166 | + description: The Kubernetes resource kind. |
| 167 | + name: |
| 168 | + type: string |
| 169 | + description: The name of the resource. |
| 170 | + namespace: |
| 171 | + type: string |
| 172 | + description: The namespace of the resource. |
| 173 | + |
0 commit comments