Revision e181e86c
Améliorations pour pylint/epydoc.
git-svn-id: https://vigilo-dev.si.c-s.fr/svn@3060 b22e2e97-25c9-44ff-b637-2e5ceca36478
vigiboard/controllers/root.py | ||
---|---|---|
1 | 1 |
# -*- coding: utf-8 -*- |
2 | 2 |
# vim:set expandtab tabstop=4 shiftwidth=4: |
3 |
"""Vigiboard Controller"""
|
|
3 |
"""VigiBoard Controller"""
|
|
4 | 4 |
|
5 | 5 |
from datetime import datetime |
6 | 6 |
from time import mktime |
... | ... | |
67 | 67 |
return dict(kwargs) |
68 | 68 |
|
69 | 69 |
class DefaultSchema(schema.Schema): |
70 |
"""Schéma de validation de la méthode default.""" |
|
70 | 71 |
page = validators.Int(min=1, if_missing=1, if_invalid=1) |
71 | 72 |
supitemgroup = validators.String(if_missing=None) |
72 | 73 |
host = validators.String(if_missing=None) |
... | ... | |
98 | 99 |
@param trouble_ticket: Idem que host mais sur les tickets attribués |
99 | 100 |
|
100 | 101 |
Cette méthode permet de satisfaire les exigences suivantes : |
101 |
- VIGILO_EXIG_VIGILO_BAC_0040, |
|
102 |
- VIGILO_EXIG_VIGILO_BAC_0070, |
|
103 |
- VIGILO_EXIG_VIGILO_BAC_0100, |
|
102 |
- VIGILO_EXIG_VIGILO_BAC_0040,
|
|
103 |
- VIGILO_EXIG_VIGILO_BAC_0070,
|
|
104 |
- VIGILO_EXIG_VIGILO_BAC_0100,
|
|
104 | 105 |
""" |
105 | 106 |
user = get_current_user() |
106 | 107 |
aggregates = VigiboardRequest(user) |
... | ... | |
224 | 225 |
|
225 | 226 |
|
226 | 227 |
class MaskedEventsSchema(schema.Schema): |
228 |
"""Schéma de validation de la méthode masked_events.""" |
|
227 | 229 |
idcorrevent = validators.Int(not_empty=True) |
228 | 230 |
page = validators.Int(min=1, if_missing=1, if_invalid=1) |
229 | 231 |
|
... | ... | |
234 | 236 |
@require(access_restriction) |
235 | 237 |
def masked_events(self, idcorrevent, page): |
236 | 238 |
""" |
237 |
Affichage de la liste des événements bruts masqués dans un
|
|
238 |
événement corrélé (agrégés).
|
|
239 |
Affichage de la liste des événements bruts masqués d'un événement
|
|
240 |
corrélé (événements agrégés dans l'événement corrélé).
|
|
239 | 241 |
|
240 |
@param idevent: identifiant de l'événement souhaité |
|
242 |
@param idcorrevent: identifiant de l'événement corrélé souhaité. |
|
243 |
@type idcorrevent: C{int} |
|
241 | 244 |
""" |
242 | 245 |
user = get_current_user() |
243 | 246 |
|
... | ... | |
330 | 333 |
|
331 | 334 |
|
332 | 335 |
class EventSchema(schema.Schema): |
336 |
"""Schéma de validation de la méthode event.""" |
|
333 | 337 |
idevent = validators.Int(not_empty=True) |
334 | 338 |
page = validators.Int(min=1, if_missing=1, if_invalid=1) |
335 | 339 |
|
... | ... | |
345 | 349 |
|
346 | 350 |
@param idevent: identifiant de l'événement brut souhaité. |
347 | 351 |
@type idevent: C{int} |
352 |
@param page: numéro de la page à afficher. |
|
353 |
@type page: C{int} |
|
348 | 354 |
|
349 |
Cette méthode permet de satisfaire |
|
350 |
l'exigence VIGILO_EXIG_VIGILO_BAC_0080.
|
|
355 |
Cette méthode permet de satisfaire l'exigence
|
|
356 |
VIGILO_EXIG_VIGILO_BAC_0080. |
|
351 | 357 |
""" |
352 |
if not page: |
|
353 |
page = 1 |
|
354 |
|
|
355 | 358 |
user = get_current_user() |
356 | 359 |
events = VigiboardRequest(user, False) |
357 | 360 |
events.add_table( |
... | ... | |
418 | 421 |
|
419 | 422 |
|
420 | 423 |
class ItemSchema(schema.Schema): |
424 |
"""Schéma de validation de la méthode item.""" |
|
421 | 425 |
page = validators.Int(min=1, if_missing=1, if_invalid=1) |
422 | 426 |
host = validators.String(not_empty=True) |
423 | 427 |
service = validators.String(if_missing=None) |
... | ... | |
433 | 437 |
jamais ouverts sur l'hôte / service demandé. |
434 | 438 |
Pour accéder à cette page, l'utilisateur doit être authentifié. |
435 | 439 |
|
440 |
@param page: Numéro de la page à afficher. |
|
436 | 441 |
@param host: Nom de l'hôte souhaité. |
437 | 442 |
@param service: Nom du service souhaité |
438 | 443 |
|
439 |
Cette méthode permet de satisfaire |
|
440 |
l'exigence VIGILO_EXIG_VIGILO_BAC_0080.
|
|
444 |
Cette méthode permet de satisfaire l'exigence
|
|
445 |
VIGILO_EXIG_VIGILO_BAC_0080. |
|
441 | 446 |
""" |
442 | 447 |
idsupitem = SupItem.get_supitem(host, service) |
443 | 448 |
|
... | ... | |
500 | 505 |
|
501 | 506 |
|
502 | 507 |
class UpdateSchema(schema.Schema): |
508 |
"""Schéma de validation de la méthode update.""" |
|
503 | 509 |
id = validators.Regex(r'^[0-9]+(,[0-9]+)*,?$') |
504 | 510 |
last_modification = validators.Number(not_empty=True) |
505 | 511 |
trouble_ticket = validators.String(if_missing='') |
... | ... | |
530 | 536 |
@param ack: Nouvel état d'acquittement des événements sélectionnés. |
531 | 537 |
|
532 | 538 |
Cette méthode permet de satisfaire les exigences suivantes : |
533 |
- VIGILO_EXIG_VIGILO_BAC_0020, |
|
534 |
- VIGILO_EXIG_VIGILO_BAC_0060, |
|
535 |
- VIGILO_EXIG_VIGILO_BAC_0110. |
|
539 |
- VIGILO_EXIG_VIGILO_BAC_0020,
|
|
540 |
- VIGILO_EXIG_VIGILO_BAC_0060,
|
|
541 |
- VIGILO_EXIG_VIGILO_BAC_0110.
|
|
536 | 542 |
""" |
537 | 543 |
|
538 | 544 |
# On vérifie que des identifiants ont bien été transmis via |
... | ... | |
637 | 643 |
|
638 | 644 |
|
639 | 645 |
class GetPluginValueSchema(schema.Schema): |
646 |
"""Schéma de validation de la méthode get_plugin_value.""" |
|
640 | 647 |
idcorrevent = validators.Int(not_empty=True) |
641 | 648 |
plugin_name = validators.OneOf( |
642 | 649 |
[unicode(i[0]) for i in config.get('vigiboard_plugins', [])], |
Also available in: Unified diff