Enh: don't be mandatory on all host fields

Change-Id: I8e4e9d441cd3254e19e6b35cbeb9e2784dfeb985
This commit is contained in:
Grégory Starck 2015-01-23 15:10:53 -05:00 committed by aviau
parent 1e29bdb1e7
commit c2f87eeca2

@ -25,20 +25,21 @@ class Host(types.Base):
address = wsme.wsattr(wtypes.text, mandatory=True)
"""The address of the host. Normally, this is an IP address."""
max_check_attempts = wsme.wsattr(int, mandatory=True)
max_check_attempts = wsme.wsattr(int, mandatory=False, default=3)
check_period = wsme.wsattr(wtypes.text, mandatory=True)
check_period = wsme.wsattr(wtypes.text, mandatory=False, default='24x7')
"""The time period during which active checks of this host can be made."""
contacts = wsme.wsattr(wtypes.text, mandatory=True)
contacts = wsme.wsattr(wtypes.text, mandatory=False, default='')
"""A list of the short names of the contacts that should be notified."""
contact_groups = wsme.wsattr(wtypes.text, mandatory=True)
contact_groups = wsme.wsattr(wtypes.text, mandatory=False, default='')
"""List of the short names of the contact groups that should be notified"""
notification_interval = wsme.wsattr(int, mandatory=True)
notification_interval = wsme.wsattr(int, mandatory=False, default=30)
notification_period = wsme.wsattr(wtypes.text, mandatory=True)
notification_period = wsme.wsattr(wtypes.text, mandatory=False,
default='24x7')
use = wsme.wsattr(wtypes.text, mandatory=False)
"""The template to use for this host"""