source: admin/WebConsole/rest/opengnsys-api.yml @ 3b5daf8

918-git-images-111dconfigfileconfigure-oglivegit-imageslgromero-new-oglivemainmaint-cronmount-efivarfsmultivmmultivm-ogboot-installerogClonningEngineogboot-installer-jenkinsoglive-ipv6test-python-scriptsticket-301ticket-50ticket-50-oldticket-577ticket-585ticket-611ticket-612ticket-693ticket-700ubu24tplunification2use-local-agent-oglivevarios-instalacionwebconsole3
Last change on this file since 3b5daf8 was 3b5daf8, checked in by ramon <ramongomez@…>, 9 years ago

#708: Continuar con la documentación de la API REST con Swagger; modificar la respuesta de la ruta GET /ous/:ouid/images/:imageid para normalizar la salida de datos.

git-svn-id: https://opengnsys.es/svn/branches/version1.1@5017 a21b9725-9963-47de-94b9-378ad31fedc9

  • Property mode set to 100644
File size: 17.7 KB
Line 
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.
4swagger: '2.0'
5
6# This is your document metadata
7info:
8  version: "1.1.0"
9  title: OpenGnsys REST API
10  description: |
11    Information about the OpenGnsys REST API functions (including Server and
12    Repository Manager).
13  contact:
14    name: OpenGnsys Project
15    url: http://opengnsys.es/
16    email: opengnsys-devel@listas.unizar.es
17  license:
18    name: Creative Commons 4.0 International
19    url: http://creativecommons.org/licenses/by/4.0/
20basePath: /opengnsys/rest
21schemes:
22  - https
23consumes:
24  - application/json
25produces:
26  - application/json
27securityDefinitions:
28  apikey:
29    type: apiKey
30    name: Authorization
31    in: header
32# Paths description.
33paths:
34  /login:
35    post:
36      description: Check user login and returns his/her API key.
37      parameters:
38        - in: body
39          name: authdata
40          description: JSON authentication data
41          required: true
42          schema:
43            type: object
44            properties:
45              username:
46                type: string
47              password:
48                type: string
49                format: password
50      responses:
51        "200":
52          description: Successful login
53          schema:
54            type: object
55            properties:
56              userid:
57                type: integer
58                format: int32
59              apikey:
60                type: string
61        "400":
62          description: Missing parameters
63        "500":
64          description: Authentication error
65      tags:
66        - server
67        - user
68  /ous:
69    get:
70      description: Gets all `OU` objects.
71      responses:
72        "200":
73          description: Successful response
74          schema:
75            type: array
76            items:
77              type: object
78              properties:
79                id:
80                  type: integer
81                  format: int32
82                name:
83                  type: string
84      tags:
85        - server
86        - ou
87  /ous/{ouid}:
88    get:
89      description: Get an `OU` object.
90      parameters:
91        - name: ouid
92          in: path
93          description: Organization Unit identificator
94          required: true
95          type: integer
96      responses:
97        "200":
98          description: Successful response
99          schema:
100            type: object
101            properties:
102              id:
103                type: integer
104              name:
105                type: string
106              description:
107                type: string
108      security:
109        - apikey: []
110      tags:
111        - server
112        - ou
113  /ous/{ouid}/labs:
114    get:
115      description: Get all `lab` objects defined in an `OU`.
116      parameters:
117        - name: ouid
118          in: path
119          description: OU identificator
120          required: true
121          type: integer
122      responses:
123        "200":
124          description: Successful response
125          schema:
126            type: array
127            items:
128              type: object
129              properties:
130                id:
131                  type: integer
132                  format: int32
133                name:
134                  type: string
135                inremotepc:
136                  type: boolean
137                ou:
138                  type: object
139                  properties:
140                    id:
141                      type: integer
142                      format: int32
143      security:
144        - apikey: []
145      tags:
146        - server
147        - lab
148  /ous/{ouid}/labs/{labid}:
149    get:
150      description: Get a `lab` object.
151      parameters:
152        - name: ouid
153          in: path
154          description: OU identificator
155          required: true
156          type: integer
157        - name: labid
158          in: path
159          description: laboratory identificator
160          required: true
161          type: integer
162      responses:
163        "200":
164          description: Successful response
165          schema:
166            type: object
167            properties:
168              id:
169                description: laboratory identificator
170                type: integer
171                format: int32
172              name:
173                description: laboratory name
174                type: string
175              location:
176                description: laboratory location
177                type: string
178              description:
179                description: laboratory description
180                type: string
181              inremotepc:
182                description: check if this lab will be included in Remote PC Project
183                type: boolean
184              capacity:
185                description: maximum number of people in the lab
186                type: integer
187                format: int32
188              defclients:
189                description: number of defined clients in the lab
190                type: integer
191                format: int32
192              projector:
193                description: check if this lab has a projector
194                type: boolean
195              board:
196                description: check if this lab has an electronic board
197                type: boolean
198              routerip:
199                description: lab router IP address
200                type: string
201              netmask:
202                description: network mask to use in the lab
203                type: string
204              ntp:
205                description: NTP server IP address
206                type: string
207              dns:
208                description: DNS server IP address
209                type: string
210              proxyurl:
211                description: Proxy server URL
212                type: string
213              mcastmode:
214                description: Multicast protocol mode (``full-duplex``, ``half-duplex``).
215                type: string
216              mcastip:
217                description: Multicast IP address
218                type: string
219              mcastport:
220                description: Multicast port
221                type: integer
222                format: int32
223              mcastspeed:
224                description: Multicast speed (in Mbps)
225                type: integer
226                format: int32
227              p2pmode:
228                description: Bittorrent connection type ("peer", "leecher". "seeder").
229                type: string
230              p2ptime:
231                description: Bittorrent connection extra time (in s.)
232                type: integer
233                format: int32
234              image:
235                description: Lab's picture file
236                type: string
237      security:
238        - apikey: []
239      tags:
240        - server
241        - lab
242  /ous/{ouid}/labs/{labid}/clients:
243    get:
244      description: Get all `client` objects defined in an `lab`.
245      parameters:
246        - name: ouid
247          in: path
248          description: OU identificator
249          required: true
250          type: integer
251        - name: labid
252          in: path
253          description: Lab identificator
254          required: true
255          type: integer
256      responses:
257        "200":
258          description: Successful response
259          schema:
260            type: array
261            items:
262              type: object
263              properties:
264                id:
265                  type: integer
266                  format: int32
267                name:
268                  type: string
269                ou:
270                  type: object
271                  properties:
272                    id:
273                      type: integer
274                      format: int32
275                lab:
276                  type: object
277                  properties:
278                    id:
279                      type: integer
280                      format: int32
281      security:
282        - apikey: []
283      tags:
284        - server
285        - client
286  /ous/{ouid}/labs/{labid}/clients/{clientid}:
287    get:
288      description: Get a `client` object.
289      parameters:
290        - name: ouid
291          in: path
292          description: OU identificator
293          required: true
294          type: integer
295        - name: labid
296          in: path
297          description: Lab identificator
298          required: true
299          type: integer
300        - name: clientid
301          in: path
302          description: Client identificator
303          required: true
304          type: integer
305      responses:
306        "200":
307          description: Successful response
308          schema:
309            type: object
310            properties:
311              id:
312                description: client id
313                type: integer
314                format: int32
315              name:
316                description: client name
317                type: string
318              serialno:
319                description: client serial number
320                type: string
321              netiface:
322                description: main network interface
323                type: string
324              netdriver:
325                description: client MAC address (kernel module)
326                type: string
327              mac:
328                description: client MAC address
329                type: string
330              ip:
331                description: client IP address
332                type: string
333              netmask:
334                description: subnet mask address
335                type: string
336              routerip:
337                description: network router IP address
338                type: string
339              repo:
340                description: repository identification
341                type: object
342                properties:
343                  id:
344                    type: integer
345                    format: int32
346              validation:
347                description: boot validation flag
348                type: boolean
349              boottype:
350                description: boot template type
351                type: string
352              image:
353                description: client's picture file
354                type: string
355      security:
356        - apikey: []
357      tags:
358        - server
359        - client
360  /ous/{ouid}/labs/{labid}/clients/{clientid}/hardware:
361    get:
362      description: Get the hardware definition of a `client` object.
363      parameters:
364        - name: ouid
365          in: path
366          description: OU identificator
367          required: true
368          type: integer
369        - name: labid
370          in: path
371          description: Lab identificator
372          required: true
373          type: integer
374        - name: clientid
375          in: path
376          description: Client identificator
377          required: true
378          type: integer
379      responses:
380        "200":
381          description: Successful response
382          schema:
383            type: object
384            properties:
385              id:
386                description: client id
387                type: integer
388                format: int32
389              name:
390                description: client name
391                type: string
392              hardware:
393                description: hardware components
394                type: array
395                items:
396                  type: object
397                  properties:
398                    type:
399                      description: hardware component type
400                      type: string
401                    description:
402                      description: hardware component description
403                      type: string
404      tags:
405        - server
406        - client
407  #/ous/{ouid}/labs/{labid}/clients/{clientid}/diskcfg:
408  #  get:
409  #    description: Get disks configuration of a `client`
410  #    parameters:
411  #    ....
412  #    tags:
413  #      - server
414  #      - client
415  /ous/{ouid}/labs/{labid}/clients/{clientid}/status:
416    get:
417      description: Get execution status of a `client`
418      parameters:
419        - name: ouid
420          in: path
421          description: OU identificator
422          required: true
423          type: integer
424        - name: labid
425          in: path
426          description: Lab identificator
427          required: true
428          type: integer
429        - name: clientid
430          in: path
431          description: Client identificator
432          required: true
433          type: integer
434      responses:
435        "200":
436          description: Successful response
437          schema:
438            type: object
439            properties:
440              id:
441                description: client id
442                type: integer
443                format: int32
444              ip:
445                description: client IP address
446                type: string
447              status:
448                description: execution status
449                type: string
450      tags:
451        - server
452        - client
453  /ous/{ouid}/repos:
454    get:
455      description: Get all `repo` objects defined in an `OU`.
456      parameters:
457        - name: ouid
458          in: path
459          description: OU identificator
460          required: true
461          type: integer
462      responses:
463        "200":
464          description: Successful response
465          schema:
466            type: array
467            items:
468              type: object
469              properties:
470                id:
471                  type: integer
472                  format: int32
473                name:
474                  type: string
475                ou:
476                  type: object
477                  properties:
478                    id:
479                      type: integer
480                      format: int32
481      security:
482        - apikey: []
483      tags:
484        - server
485        - repo
486  /ous/{ouid}/repos/{repoid}:
487    get:
488      description: Get a `repo` object.
489      parameters:
490        - name: ouid
491          in: path
492          description: OU identificator
493          required: true
494          type: integer
495        - name: repoid
496          in: path
497          description: repository identificator
498          required: true
499          type: integer
500      responses:
501        "200":
502          description: Successful response
503          schema:
504            type: object
505            properties:
506              id:
507                description: repository id
508                type: integer
509                format: int32
510              name:
511                description: repository name
512                type: string
513              description:
514                description: repository description
515                type: string
516              ip:
517                description: repository IP address
518                type: string
519      security:
520        - apikey: []
521      tags:
522        - server
523        - repo
524  /ous/{ouid}/images:
525    get:
526      description: Get all `image` objects defined in an `OU`.
527      parameters:
528        - name: ouid
529          in: path
530          description: OU identificator
531          required: true
532          type: integer
533      responses:
534        "200":
535          description: Successful response
536          schema:
537            type: array
538            items:
539              type: object
540              properties:
541                id:
542                  type: integer
543                  format: int32
544                name:
545                  type: string
546                inremotepc:
547                  type: boolean
548                ou:
549                  type: object
550                  properties:
551                    id:
552                      type: integer
553                      format: int32
554      security:
555        - apikey: []
556      tags:
557        - server
558        - image
559  /ous/{ouid}/images/{imageid}:
560    get:
561      description: Get an `image` object.
562      parameters:
563        - name: ouid
564          in: path
565          description: OU identificator
566          required: true
567          type: integer
568        - name: imageid
569          in: path
570          description: image definition identificator
571          required: true
572          type: integer
573      responses:
574        "200":
575          description: Successful response
576          schema:
577            type: object
578            properties:
579              id:
580                description: image id
581                type: integer
582                format: int32
583              name:
584                description: image name
585                type: string
586              description:
587                description: image description
588                type: string
589              inremotepc:
590                description: usable in Remote PC Project flag
591                type: boolean
592              type:
593                description: image type (``monolithic``, ``basic``, ``incremental``)
594                type: string
595              baseimg:
596                description: base image for an incremental image (if ``type`` is ``incremental``)
597                type: string
598              path:
599                description: image path (if ``type`` is ``incremental``)
600                type: string
601              repo:
602                description: repository identification
603                type: object
604                properties:
605                  id:
606                    type: integer
607                    format: int32
608              client:
609                description: model client's data
610                type: object
611                properties:
612                  id:
613                    description: model client's id.
614                    type: integer
615                    format: int32
616                  disk:
617                    description: model client's id.
618                    type: integer
619                    format: int32
620                  partition:
621                    description: model client's id.
622                    type: integer
623                    format: int32
624              creationdate:
625                description: image creation date
626                type: string
627                format: date-time
628              release:
629                description: image creation release
630                type: string
631      security:
632        - apikey: []
633      tags:
634        - server
635        - image
636  #/ous/{ouid}/images/{imageid}/software:
637  #/ous/{ouid}/images/{imageid}/boot:
638  #/repository/images
639  #/repository/poweron
640  #/ogagent/started
641  #/ogagent/stopped
642  #/ogagent/loggedin
643  #/ogagent/loggedout
Note: See TracBrowser for help on using the repository browser.