[ac8b234e] | 1 | # Example YAML to get you started quickly. |
---|
| 2 | # Be aware that YAML has indentation based scoping. |
---|
| 3 | # Code completion support is available so start typing for available options. |
---|
| 4 | swagger: '2.0' |
---|
| 5 | |
---|
| 6 | # This is your document metadata |
---|
| 7 | info: |
---|
| 8 | version: "1.1.0" |
---|
| 9 | title: OpenGnsys Server REST API |
---|
| 10 | description: | |
---|
| 11 | Information about OpenGnsys Server REST API functions. |
---|
| 12 | license: |
---|
| 13 | name: Creative Commons 4.0 International |
---|
| 14 | url: http://creativecommons.org/licenses/by/4.0/ |
---|
| 15 | basePath: /rest |
---|
| 16 | schemes: |
---|
| 17 | - https |
---|
| 18 | consumes: |
---|
| 19 | - application/json |
---|
| 20 | produces: |
---|
| 21 | - application/json |
---|
| 22 | securityDefinitions: |
---|
| 23 | apikey: |
---|
| 24 | type: apiKey |
---|
| 25 | name: Authorization |
---|
| 26 | in: header |
---|
| 27 | # Paths description. |
---|
| 28 | paths: |
---|
| 29 | /login: |
---|
| 30 | post: |
---|
| 31 | description: Check user login and returns his/her API key. |
---|
| 32 | parameters: |
---|
| 33 | - in: body |
---|
| 34 | name: authdata |
---|
| 35 | description: JSON authentication data |
---|
| 36 | required: true |
---|
| 37 | schema: |
---|
| 38 | type: object |
---|
| 39 | properties: |
---|
| 40 | username: |
---|
| 41 | type: string |
---|
| 42 | password: |
---|
| 43 | type: string |
---|
| 44 | responses: |
---|
| 45 | "200": |
---|
| 46 | description: Successful login |
---|
| 47 | schema: |
---|
| 48 | type: object |
---|
| 49 | properties: |
---|
| 50 | userid: |
---|
| 51 | type: integer |
---|
| 52 | apikey: |
---|
| 53 | type: string |
---|
| 54 | "400": |
---|
| 55 | description: Missing parameters |
---|
| 56 | "500": |
---|
| 57 | description: Authentication error |
---|
| 58 | tags: |
---|
| 59 | - user |
---|
| 60 | /ous: |
---|
| 61 | get: |
---|
| 62 | description: Gets all `OU` objects. |
---|
| 63 | responses: |
---|
| 64 | "200": |
---|
| 65 | description: Successful response |
---|
| 66 | schema: |
---|
| 67 | type: array |
---|
| 68 | items: |
---|
| 69 | type: object |
---|
| 70 | properties: |
---|
| 71 | id: |
---|
| 72 | type: integer |
---|
| 73 | name: |
---|
| 74 | type: string |
---|
| 75 | tags: |
---|
| 76 | - ou |
---|
| 77 | /ous/{ouid}: |
---|
| 78 | get: |
---|
| 79 | description: Get an `OU` object. |
---|
| 80 | parameters: |
---|
| 81 | - name: ouid |
---|
| 82 | in: path |
---|
| 83 | description: Organization Unit identificator |
---|
| 84 | required: true |
---|
| 85 | type: integer |
---|
| 86 | responses: |
---|
| 87 | "200": |
---|
| 88 | description: Successful response |
---|
| 89 | schema: |
---|
| 90 | type: object |
---|
| 91 | properties: |
---|
| 92 | id: |
---|
| 93 | type: integer |
---|
| 94 | name: |
---|
| 95 | type: string |
---|
| 96 | description: |
---|
| 97 | type: string |
---|
| 98 | security: |
---|
| 99 | - apikey: [] |
---|
| 100 | tags: |
---|
| 101 | - ou |
---|
| 102 | /ous/{ouid}/labs: |
---|
| 103 | get: |
---|
| 104 | description: Get all `lab` objects defined in an `OU`. |
---|
| 105 | parameters: |
---|
| 106 | - name: ouid |
---|
| 107 | in: path |
---|
| 108 | description: OU identificator |
---|
| 109 | required: true |
---|
| 110 | type: integer |
---|
| 111 | responses: |
---|
| 112 | "200": |
---|
| 113 | description: Successful response |
---|
| 114 | schema: |
---|
| 115 | type: array |
---|
| 116 | items: |
---|
| 117 | type: object |
---|
| 118 | properties: |
---|
| 119 | id: |
---|
| 120 | type: integer |
---|
| 121 | name: |
---|
| 122 | type: string |
---|
| 123 | inremotepc: |
---|
| 124 | type: boolean |
---|
| 125 | ou: |
---|
| 126 | type: object |
---|
| 127 | properties: |
---|
| 128 | id: |
---|
| 129 | type: integer |
---|
| 130 | security: |
---|
| 131 | - apikey: [] |
---|
| 132 | tags: |
---|
| 133 | - lab |
---|
| 134 | /ous/{ouid}/labs/{labid}: |
---|
| 135 | get: |
---|
| 136 | description: Get a `lab` object. |
---|
| 137 | parameters: |
---|
| 138 | - name: ouid |
---|
| 139 | in: path |
---|
| 140 | description: OU identificator |
---|
| 141 | required: true |
---|
| 142 | type: integer |
---|
| 143 | - name: labid |
---|
| 144 | in: path |
---|
| 145 | description: laboratory identificator |
---|
| 146 | required: true |
---|
| 147 | type: integer |
---|
| 148 | responses: |
---|
| 149 | "200": |
---|
| 150 | description: Successful response |
---|
| 151 | schema: |
---|
| 152 | type: object |
---|
| 153 | properties: |
---|
| 154 | id: |
---|
| 155 | description: laboratory identificator |
---|
| 156 | type: integer |
---|
| 157 | name: |
---|
| 158 | description: laboratory name |
---|
| 159 | type: string |
---|
| 160 | location: |
---|
| 161 | description: laboratory location |
---|
| 162 | type: string |
---|
| 163 | description: |
---|
| 164 | description: laboratory description |
---|
| 165 | type: string |
---|
| 166 | inremotepc: |
---|
| 167 | description: check if this lab will be included in Remote PC Project |
---|
| 168 | type: boolean |
---|
| 169 | capacity: |
---|
| 170 | description: maximum number of people in the lab |
---|
| 171 | type: integer |
---|
| 172 | defclients: |
---|
| 173 | description: number of defined clients in the lab |
---|
| 174 | type: integer |
---|
| 175 | projector: |
---|
| 176 | description: check if this lab has a projector |
---|
| 177 | type: boolean |
---|
| 178 | board: |
---|
| 179 | description: check if this lab has an electronic board |
---|
| 180 | type: boolean |
---|
| 181 | routerip: |
---|
| 182 | description: lab router IP address |
---|
| 183 | type: string |
---|
| 184 | netmask: |
---|
| 185 | description: network mask to use in the lab |
---|
| 186 | type: string |
---|
| 187 | ntp: |
---|
| 188 | description: NTP server IP address |
---|
| 189 | type: string |
---|
| 190 | dns: |
---|
| 191 | description: DNS server IP address |
---|
| 192 | type: string |
---|
| 193 | proxyurl: |
---|
| 194 | description: Proxy server URL |
---|
| 195 | type: string |
---|
| 196 | mcastmode: |
---|
| 197 | description: Multicast protocol mode ("full-duplex", "half-duplex"). |
---|
| 198 | type: string |
---|
| 199 | mcastip: |
---|
| 200 | description: Multicast IP address |
---|
| 201 | type: string |
---|
| 202 | mcastport: |
---|
| 203 | description: Multicast port |
---|
| 204 | type: integer |
---|
| 205 | mcastspeed: |
---|
| 206 | description: Multicast speed (in Mbps) |
---|
| 207 | type: integer |
---|
| 208 | p2pmode: |
---|
| 209 | description: Bittorrent connection type ("peer", "leecher". "seeder"). |
---|
| 210 | type: string |
---|
| 211 | p2ptime: |
---|
| 212 | description: Bittorrent connection extra time (in s.) |
---|
| 213 | type: integer |
---|
| 214 | image: |
---|
| 215 | description: Lab's picture file |
---|
| 216 | type: string |
---|
| 217 | security: |
---|
| 218 | - apikey: [] |
---|
| 219 | tags: |
---|
| 220 | - lab |
---|
| 221 | /ous/{ouid}/labs/{labid}/clients: |
---|
| 222 | get: |
---|
| 223 | description: Get all `client` objects defined in an `lab`. |
---|
| 224 | parameters: |
---|
| 225 | - name: ouid |
---|
| 226 | in: path |
---|
| 227 | description: OU identificator |
---|
| 228 | required: true |
---|
| 229 | type: integer |
---|
| 230 | - name: labid |
---|
| 231 | in: path |
---|
| 232 | description: Lab identificator |
---|
| 233 | required: true |
---|
| 234 | type: integer |
---|
| 235 | responses: |
---|
| 236 | "200": |
---|
| 237 | description: Successful response |
---|
| 238 | schema: |
---|
| 239 | type: array |
---|
| 240 | items: |
---|
| 241 | type: object |
---|
| 242 | properties: |
---|
| 243 | id: |
---|
| 244 | type: integer |
---|
| 245 | name: |
---|
| 246 | type: string |
---|
| 247 | ou: |
---|
| 248 | type: object |
---|
| 249 | properties: |
---|
| 250 | id: |
---|
| 251 | type: integer |
---|
| 252 | lab: |
---|
| 253 | type: object |
---|
| 254 | properties: |
---|
| 255 | id: |
---|
| 256 | type: integer |
---|
| 257 | security: |
---|
| 258 | - apikey: [] |
---|
| 259 | tags: |
---|
| 260 | - client |
---|
| 261 | /ous/{ouid}/labs/{labid}/clients/{clientid}: |
---|
| 262 | get: |
---|
| 263 | description: Get a `client` object. |
---|
| 264 | parameters: |
---|
| 265 | - name: ouid |
---|
| 266 | in: path |
---|
| 267 | description: OU identificator |
---|
| 268 | required: true |
---|
| 269 | type: integer |
---|
| 270 | - name: labid |
---|
| 271 | in: path |
---|
| 272 | description: Lab identificator |
---|
| 273 | required: true |
---|
| 274 | type: integer |
---|
| 275 | - name: clientid |
---|
| 276 | in: path |
---|
| 277 | description: Client identificator |
---|
| 278 | required: true |
---|
| 279 | type: integer |
---|
| 280 | responses: |
---|
| 281 | "200": |
---|
| 282 | description: Successful response |
---|
| 283 | schema: |
---|
| 284 | type: object |
---|
| 285 | properties: |
---|
| 286 | id: |
---|
| 287 | description: client id |
---|
| 288 | type: integer |
---|
| 289 | name: |
---|
| 290 | description: client name |
---|
| 291 | type: string |
---|
| 292 | serialno: |
---|
| 293 | description: client serial number |
---|
| 294 | type: string |
---|
| 295 | netiface: |
---|
| 296 | description: main network interface |
---|
| 297 | type: string |
---|
| 298 | netdriver: |
---|
| 299 | description: client MAC address (kernel module) |
---|
| 300 | type: string |
---|
| 301 | mac: |
---|
| 302 | description: client MAC address |
---|
| 303 | type: string |
---|
| 304 | ip: |
---|
| 305 | description: client IP address |
---|
| 306 | type: string |
---|
| 307 | netmask: |
---|
| 308 | description: subnet mask address |
---|
| 309 | type: string |
---|
| 310 | routerip: |
---|
| 311 | description: network router IP address |
---|
| 312 | type: string |
---|
| 313 | repo: |
---|
| 314 | description: repository identification |
---|
| 315 | type: object |
---|
| 316 | properties: |
---|
| 317 | id: |
---|
| 318 | type: integer |
---|
| 319 | validation: |
---|
| 320 | description: boot validation flag |
---|
| 321 | type: boolean |
---|
| 322 | boottype: |
---|
| 323 | description: boot template type |
---|
| 324 | type: string |
---|
| 325 | image: |
---|
| 326 | description: client's picture file |
---|
| 327 | type: string |
---|
| 328 | security: |
---|
| 329 | - apikey: [] |
---|
| 330 | tags: |
---|
| 331 | - client |
---|
| 332 | /ous/{ouid}/labs/{labid}/clients/{clientid}/hardware: |
---|
| 333 | get: |
---|
| 334 | description: Get the hardware definition of a `client` object. |
---|
| 335 | parameters: |
---|
| 336 | - name: ouid |
---|
| 337 | in: path |
---|
| 338 | description: OU identificator |
---|
| 339 | required: true |
---|
| 340 | type: integer |
---|
| 341 | - name: labid |
---|
| 342 | in: path |
---|
| 343 | description: Lab identificator |
---|
| 344 | required: true |
---|
| 345 | type: integer |
---|
| 346 | - name: clientid |
---|
| 347 | in: path |
---|
| 348 | description: Client identificator |
---|
| 349 | required: true |
---|
| 350 | type: integer |
---|
| 351 | responses: |
---|
| 352 | "200": |
---|
| 353 | description: Successful response |
---|
| 354 | schema: |
---|
| 355 | type: object |
---|
| 356 | properties: |
---|
| 357 | id: |
---|
| 358 | description: client id |
---|
| 359 | type: integer |
---|
| 360 | name: |
---|
| 361 | description: client name |
---|
| 362 | type: string |
---|
| 363 | hardware: |
---|
| 364 | description: hardware components |
---|
| 365 | type: array |
---|
| 366 | items: |
---|
| 367 | type: object |
---|
| 368 | properties: |
---|
| 369 | type: |
---|
| 370 | description: hardware component type |
---|
| 371 | type: string |
---|
| 372 | description: |
---|
| 373 | description: hardware component description |
---|
| 374 | type: string |
---|
| 375 | tags: |
---|
| 376 | - client |
---|
| 377 | #/ous/{ouid}/labs/{labid}/clients/{clientid}/diskcfg: |
---|
| 378 | # get: |
---|
| 379 | # description: Get disks configuration of a `client` |
---|
| 380 | # parameters: |
---|
| 381 | # .... |
---|
| 382 | # tags: |
---|
| 383 | # - client |
---|
| 384 | /ous/{ouid}/labs/{labid}/clients/{clientid}/status: |
---|
| 385 | get: |
---|
| 386 | description: Get execution status of a `client` |
---|
| 387 | parameters: |
---|
| 388 | - name: ouid |
---|
| 389 | in: path |
---|
| 390 | description: OU identificator |
---|
| 391 | required: true |
---|
| 392 | type: integer |
---|
| 393 | - name: labid |
---|
| 394 | in: path |
---|
| 395 | description: Lab identificator |
---|
| 396 | required: true |
---|
| 397 | type: integer |
---|
| 398 | - name: clientid |
---|
| 399 | in: path |
---|
| 400 | description: Client identificator |
---|
| 401 | required: true |
---|
| 402 | type: integer |
---|
| 403 | responses: |
---|
| 404 | "200": |
---|
| 405 | description: Successful response |
---|
| 406 | schema: |
---|
| 407 | type: object |
---|
| 408 | properties: |
---|
| 409 | id: |
---|
| 410 | description: client id |
---|
| 411 | type: integer |
---|
| 412 | ip: |
---|
| 413 | description: client IP address |
---|
| 414 | type: string |
---|
| 415 | status: |
---|
| 416 | description: execution status |
---|
| 417 | type: string |
---|
| 418 | tags: |
---|
| 419 | - client |
---|
| 420 | /ous/{ouid}/repos: |
---|
| 421 | get: |
---|
| 422 | description: Get all `repo` objects defined in an `OU`. |
---|
| 423 | parameters: |
---|
| 424 | - name: ouid |
---|
| 425 | in: path |
---|
| 426 | description: OU identificator |
---|
| 427 | required: true |
---|
| 428 | type: integer |
---|
| 429 | responses: |
---|
| 430 | "200": |
---|
| 431 | description: Successful response |
---|
| 432 | schema: |
---|
| 433 | type: array |
---|
| 434 | items: |
---|
| 435 | type: object |
---|
| 436 | properties: |
---|
| 437 | id: |
---|
| 438 | type: integer |
---|
| 439 | name: |
---|
| 440 | type: string |
---|
| 441 | ou: |
---|
| 442 | type: object |
---|
| 443 | properties: |
---|
| 444 | id: |
---|
| 445 | type: integer |
---|
| 446 | security: |
---|
| 447 | - apikey: [] |
---|
| 448 | tags: |
---|
| 449 | - repo |
---|
| 450 | /ous/{ouid}/repos/{repoid}: |
---|
| 451 | get: |
---|
| 452 | description: Get a `repo` object. |
---|
| 453 | parameters: |
---|
| 454 | - name: ouid |
---|
| 455 | in: path |
---|
| 456 | description: OU identificator |
---|
| 457 | required: true |
---|
| 458 | type: integer |
---|
| 459 | - name: repoid |
---|
| 460 | in: path |
---|
| 461 | description: repository identificator |
---|
| 462 | required: true |
---|
| 463 | type: integer |
---|
| 464 | responses: |
---|
| 465 | "200": |
---|
| 466 | description: Successful response |
---|
| 467 | schema: |
---|
| 468 | type: object |
---|
| 469 | properties: |
---|
| 470 | id: |
---|
| 471 | description: repository id |
---|
| 472 | type: integer |
---|
| 473 | name: |
---|
| 474 | description: repository name |
---|
| 475 | type: string |
---|
| 476 | description: |
---|
| 477 | description: repository description |
---|
| 478 | type: string |
---|
| 479 | ip: |
---|
| 480 | description: repository IP address |
---|
| 481 | type: string |
---|
| 482 | security: |
---|
| 483 | - apikey: [] |
---|
| 484 | tags: |
---|
| 485 | - repo |
---|
| 486 | #/ous/{ouid}/images: |
---|
| 487 | #/ous/{ouid}/images/{imageid}: |
---|
| 488 | #/ous/{ouid}/images/{imageid}/software: |
---|
| 489 | #/ous/{ouid}/images/{imageid}/boot: |
---|