[367e6dc] | 1 | openapi: 3.0.3 |
---|
| 2 | |
---|
| 3 | info: |
---|
| 4 | title: OgAgent API |
---|
| 5 | description: OgAgent API |
---|
| 6 | version: 0.0.1 |
---|
| 7 | |
---|
| 8 | paths: |
---|
| 9 | /opengnsys/status: |
---|
| 10 | post: |
---|
| 11 | summary: Get status of the agent |
---|
| 12 | requestBody: |
---|
| 13 | content: |
---|
| 14 | application/json: |
---|
| 15 | schema: |
---|
| 16 | $ref: '#/components/schemas/StatusReq' |
---|
| 17 | responses: |
---|
| 18 | '200': |
---|
| 19 | description: Success |
---|
| 20 | content: |
---|
| 21 | application/json: |
---|
| 22 | schema: |
---|
| 23 | $ref: '#/components/schemas/StatusRes' |
---|
| 24 | |
---|
| 25 | /opengnsys/poweroff: |
---|
| 26 | post: |
---|
| 27 | summary: Power agent off |
---|
| 28 | requestBody: |
---|
| 29 | content: |
---|
| 30 | application/json: |
---|
| 31 | schema: |
---|
| 32 | $ref: '#/components/schemas/EmptyObj' |
---|
| 33 | responses: |
---|
| 34 | '200': |
---|
| 35 | description: Success |
---|
| 36 | content: |
---|
| 37 | application/json: |
---|
| 38 | schema: |
---|
| 39 | $ref: '#/components/schemas/LaunchedRes' |
---|
| 40 | |
---|
| 41 | /opengnsys/reboot: |
---|
| 42 | post: |
---|
| 43 | summary: Reboot agent |
---|
| 44 | requestBody: |
---|
| 45 | content: |
---|
| 46 | application/json: |
---|
| 47 | schema: |
---|
| 48 | $ref: '#/components/schemas/EmptyObj' |
---|
| 49 | responses: |
---|
| 50 | '200': |
---|
| 51 | description: Success |
---|
| 52 | content: |
---|
| 53 | application/json: |
---|
| 54 | schema: |
---|
| 55 | $ref: '#/components/schemas/LaunchedRes' |
---|
| 56 | |
---|
| 57 | /opengnsys/script: |
---|
| 58 | post: |
---|
| 59 | summary: Run script on agent |
---|
| 60 | requestBody: |
---|
| 61 | content: |
---|
| 62 | application/json: |
---|
| 63 | schema: |
---|
| 64 | $ref: '#/components/schemas/ScriptReq' |
---|
| 65 | required: true |
---|
| 66 | responses: |
---|
| 67 | '200': |
---|
| 68 | description: Success |
---|
| 69 | content: |
---|
| 70 | application/json: |
---|
| 71 | schema: |
---|
| 72 | $ref: '#/components/schemas/ScriptRes' |
---|
| 73 | |
---|
| 74 | /opengnsys/terminatescript: |
---|
| 75 | post: |
---|
| 76 | summary: Terminate running script on agent |
---|
| 77 | requestBody: |
---|
| 78 | content: |
---|
| 79 | application/json: |
---|
| 80 | schema: |
---|
| 81 | $ref: '#/components/schemas/TerminateScriptReq' |
---|
| 82 | responses: |
---|
| 83 | '200': |
---|
| 84 | description: Success |
---|
| 85 | content: |
---|
| 86 | application/json: |
---|
| 87 | schema: |
---|
| 88 | $ref: '#/components/schemas/EmptyObj' |
---|
| 89 | |
---|
| 90 | /opengnsys/preparescripts: |
---|
| 91 | post: |
---|
| 92 | summary: Prepare list of scripts running on agent |
---|
| 93 | requestBody: |
---|
| 94 | content: |
---|
| 95 | application/json: |
---|
| 96 | schema: |
---|
| 97 | $ref: '#/components/schemas/EmptyObj' |
---|
| 98 | responses: |
---|
| 99 | '200': |
---|
| 100 | description: Success |
---|
| 101 | content: |
---|
| 102 | application/json: |
---|
| 103 | schema: |
---|
| 104 | $ref: '#/components/schemas/EmptyObj' |
---|
| 105 | |
---|
| 106 | /opengnsys/getscripts: |
---|
| 107 | post: |
---|
| 108 | summary: Get the list of scripts running on agent |
---|
| 109 | requestBody: |
---|
| 110 | content: |
---|
| 111 | application/json: |
---|
| 112 | schema: |
---|
| 113 | $ref: '#/components/schemas/EmptyObj' |
---|
| 114 | responses: |
---|
| 115 | '200': |
---|
| 116 | description: Success |
---|
| 117 | content: |
---|
| 118 | application/json: |
---|
| 119 | schema: |
---|
| 120 | $ref: '#/components/schemas/GetScriptsRes' |
---|
| 121 | |
---|
| 122 | /opengnsys/logoff: |
---|
| 123 | post: |
---|
| 124 | summary: Log remote user off |
---|
| 125 | requestBody: |
---|
| 126 | content: |
---|
| 127 | application/json: |
---|
| 128 | schema: |
---|
| 129 | $ref: '#/components/schemas/EmptyObj' |
---|
| 130 | responses: |
---|
| 131 | '200': |
---|
| 132 | description: Success |
---|
| 133 | content: |
---|
| 134 | application/json: |
---|
| 135 | schema: |
---|
| 136 | $ref: '#/components/schemas/LogoffRes' |
---|
| 137 | |
---|
| 138 | /opengnsys/popup: |
---|
| 139 | post: |
---|
| 140 | summary: Show message on agent |
---|
| 141 | requestBody: |
---|
| 142 | content: |
---|
| 143 | application/json: |
---|
| 144 | schema: |
---|
| 145 | $ref: '#/components/schemas/Popup' |
---|
| 146 | required: true |
---|
| 147 | responses: |
---|
| 148 | '200': |
---|
| 149 | description: Success |
---|
| 150 | content: |
---|
| 151 | application/json: |
---|
| 152 | schema: |
---|
| 153 | $ref: '#/components/schemas/LaunchedRes' |
---|
| 154 | |
---|
| 155 | components: |
---|
| 156 | schemas: |
---|
| 157 | EmptyObj: |
---|
| 158 | type: object |
---|
| 159 | additionalProperties: false |
---|
| 160 | |
---|
| 161 | Jobid: |
---|
| 162 | type: string |
---|
| 163 | example: |
---|
| 164 | - "deadbeef" |
---|
| 165 | |
---|
| 166 | StatusReq: |
---|
| 167 | type: object |
---|
| 168 | properties: |
---|
| 169 | detail: |
---|
| 170 | type: boolean |
---|
| 171 | |
---|
| 172 | StatusRes: |
---|
| 173 | type: object |
---|
| 174 | required: |
---|
| 175 | - status |
---|
| 176 | properties: |
---|
| 177 | status: |
---|
| 178 | type: string |
---|
| 179 | enum: |
---|
| 180 | - "LNX" |
---|
| 181 | - "OSX" |
---|
| 182 | - "WIN" |
---|
| 183 | loggedin: |
---|
| 184 | type: boolean |
---|
| 185 | session: |
---|
| 186 | type: string |
---|
| 187 | example: |
---|
| 188 | - "x11" |
---|
| 189 | agent_version: |
---|
| 190 | type: string |
---|
| 191 | os_version: |
---|
| 192 | type: string |
---|
| 193 | sys_load: |
---|
| 194 | type: number |
---|
| 195 | |
---|
| 196 | LaunchedRes: |
---|
| 197 | type: object |
---|
| 198 | required: |
---|
| 199 | - op |
---|
| 200 | properties: |
---|
| 201 | op: |
---|
| 202 | type: string |
---|
| 203 | enum: |
---|
| 204 | - "launched" |
---|
| 205 | |
---|
| 206 | ScriptReq: |
---|
| 207 | type: object |
---|
| 208 | required: |
---|
| 209 | - script |
---|
| 210 | properties: |
---|
| 211 | script: |
---|
| 212 | type: string |
---|
| 213 | example: |
---|
| 214 | - "uptime\nwho" |
---|
| 215 | - "Start-Process notepad.exe" |
---|
| 216 | client: |
---|
| 217 | type: boolean |
---|
| 218 | default: false |
---|
| 219 | |
---|
| 220 | ScriptRes: |
---|
| 221 | type: object |
---|
| 222 | required: |
---|
| 223 | - op |
---|
| 224 | properties: |
---|
| 225 | op: |
---|
| 226 | type: string |
---|
| 227 | enum: |
---|
| 228 | - "launched" |
---|
| 229 | jobid: |
---|
| 230 | $ref: '#/components/schemas/Jobid' |
---|
| 231 | |
---|
| 232 | TerminateScriptReq: |
---|
| 233 | type: object |
---|
| 234 | required: |
---|
| 235 | - jobid |
---|
| 236 | properties: |
---|
| 237 | jobid: |
---|
| 238 | $ref: '#/components/schemas/Jobid' |
---|
| 239 | |
---|
| 240 | |
---|
| 241 | RunningScript: |
---|
| 242 | type: object |
---|
| 243 | required: |
---|
| 244 | - jobid |
---|
| 245 | - pid |
---|
| 246 | - starttime |
---|
| 247 | - script |
---|
| 248 | - client |
---|
| 249 | - status |
---|
| 250 | - stdout |
---|
| 251 | - stderr |
---|
| 252 | properties: |
---|
| 253 | jobid: |
---|
| 254 | $ref: '#/components/schemas/Jobid' |
---|
| 255 | pid: |
---|
| 256 | type: integer |
---|
| 257 | starttime: |
---|
| 258 | type: string |
---|
| 259 | example: "2024-12-31 23:59:59.123456+0000" |
---|
| 260 | script: |
---|
| 261 | type: string |
---|
| 262 | client: |
---|
| 263 | type: boolean |
---|
| 264 | status: |
---|
| 265 | type: string |
---|
| 266 | enum: |
---|
| 267 | - "running" |
---|
| 268 | - "finished" |
---|
| 269 | stdout: |
---|
| 270 | type: string |
---|
| 271 | stderr: |
---|
| 272 | type: string |
---|
| 273 | rc: |
---|
| 274 | type: integer |
---|
| 275 | |
---|
| 276 | GetScriptsRes: |
---|
| 277 | type: array |
---|
| 278 | items: |
---|
| 279 | $ref: '#/components/schemas/RunningScript' |
---|
| 280 | |
---|
| 281 | LogoffRes: |
---|
| 282 | type: object |
---|
| 283 | required: |
---|
| 284 | - op |
---|
| 285 | properties: |
---|
| 286 | op: |
---|
| 287 | type: string |
---|
| 288 | enum: |
---|
| 289 | - "sent to client" |
---|
| 290 | |
---|
| 291 | Popup: |
---|
| 292 | type: object |
---|
| 293 | properties: |
---|
| 294 | title: |
---|
| 295 | type: string |
---|
| 296 | message: |
---|
| 297 | type: string |
---|