class HealthMonitorPOST(BaseHealthMonitorType): """Defines mandatory and optional attributes of a POST request.""" name = wtypes.wsattr(wtypes.StringType(max_length=255)) type = wtypes.wsattr( wtypes.Enum(str, *constants.SUPPORTED_HEALTH_MONITOR_TYPES), mandatory=True) delay = wtypes.wsattr(wtypes.IntegerType(minimum=0), mandatory=True) timeout = wtypes.wsattr(wtypes.IntegerType(minimum=0), mandatory=True) max_retries_down = wtypes.wsattr( wtypes.IntegerType(minimum=constants.MIN_HM_RETRIES, maximum=constants.MAX_HM_RETRIES), default=3) max_retries = wtypes.wsattr( wtypes.IntegerType(minimum=constants.MIN_HM_RETRIES, maximum=constants.MAX_HM_RETRIES), mandatory=True) http_method = wtypes.wsattr( wtypes.Enum(str, *constants.SUPPORTED_HEALTH_MONITOR_HTTP_METHODS)) url_path = wtypes.wsattr( types.URLPathType()) expected_codes = wtypes.wsattr( wtypes.StringType(pattern=r'^(\d{3}(\s*,\s*\d{3})*)$|^(\d{3}-\d{3})$')) admin_state_up = wtypes.wsattr(bool, default=True) # TODO(johnsom) Remove after deprecation (R series) project_id = wtypes.wsattr(wtypes.StringType(max_length=36)) pool_id = wtypes.wsattr(wtypes.UuidType(), mandatory=True) tags = wtypes.wsattr(wtypes.ArrayType(wtypes.StringType(max_length=255)))
class HealthMonitorSingleCreate(BaseHealthMonitorType): """Defines mandatory and optional attributes of a POST request.""" name = wtypes.wsattr(wtypes.StringType(max_length=255)) type = wtypes.wsattr(wtypes.Enum( str, *constants.SUPPORTED_HEALTH_MONITOR_TYPES), mandatory=True) delay = wtypes.wsattr(wtypes.IntegerType(minimum=0), mandatory=True) timeout = wtypes.wsattr(wtypes.IntegerType(minimum=0), mandatory=True) max_retries_down = wtypes.wsattr( wtypes.IntegerType(minimum=constants.MIN_HM_RETRIES, maximum=constants.MAX_HM_RETRIES), default=constants.DEFAULT_MAX_RETRIES_DOWN) max_retries = wtypes.wsattr(wtypes.IntegerType( minimum=constants.MIN_HM_RETRIES, maximum=constants.MAX_HM_RETRIES), mandatory=True) http_method = wtypes.wsattr( wtypes.Enum(str, *constants.SUPPORTED_HEALTH_MONITOR_HTTP_METHODS)) url_path = wtypes.wsattr(types.URLPathType()) expected_codes = wtypes.wsattr( wtypes.StringType(pattern=r'^(\d{3}(\s*,\s*\d{3})*)$|^(\d{3}-\d{3})$')) admin_state_up = wtypes.wsattr(bool, default=True) tags = wtypes.wsattr(wtypes.ArrayType(wtypes.StringType(max_length=255))) http_version = wtypes.wsattr( wtypes.Enum(float, *constants.SUPPORTED_HTTP_VERSIONS)) domain_name = wtypes.wsattr( wtypes.StringType(min_length=1, max_length=255, pattern=constants.DOMAIN_NAME_REGEX))
class HealthMonitorPUT(BaseHealthMonitorType): """Defines attributes that are acceptable of a PUT request.""" name = wtypes.wsattr(wtypes.StringType(max_length=255)) delay = wtypes.wsattr(wtypes.IntegerType(minimum=0)) timeout = wtypes.wsattr(wtypes.IntegerType(minimum=0)) max_retries_down = wtypes.wsattr( wtypes.IntegerType(minimum=constants.MIN_HM_RETRIES, maximum=constants.MAX_HM_RETRIES)) max_retries = wtypes.wsattr( wtypes.IntegerType(minimum=constants.MIN_HM_RETRIES, maximum=constants.MAX_HM_RETRIES)) http_method = wtypes.wsattr( wtypes.Enum(str, *constants.SUPPORTED_HEALTH_MONITOR_HTTP_METHODS)) url_path = wtypes.wsattr(types.URLPathType()) expected_codes = wtypes.wsattr( wtypes.StringType(pattern=r'^(\d{3}(\s*,\s*\d{3})*)$|^(\d{3}-\d{3})$')) admin_state_up = wtypes.wsattr(bool)
class HealthMonitorSingleCreate(BaseHealthMonitorType): """Defines mandatory and optional attributes of a POST request.""" name = wtypes.wsattr(wtypes.StringType(max_length=255)) type = wtypes.wsattr(wtypes.Enum( str, *constants.SUPPORTED_HEALTH_MONITOR_TYPES), mandatory=True) delay = wtypes.wsattr(wtypes.IntegerType(minimum=0), mandatory=True) timeout = wtypes.wsattr(wtypes.IntegerType(minimum=0), mandatory=True) max_retries_down = wtypes.wsattr(wtypes.IntegerType( minimum=constants.MIN_HM_RETRIES, maximum=constants.MAX_HM_RETRIES), default=3) max_retries = wtypes.wsattr(wtypes.IntegerType( minimum=constants.MIN_HM_RETRIES, maximum=constants.MAX_HM_RETRIES), mandatory=True) http_method = wtypes.wsattr( wtypes.Enum(str, *constants.SUPPORTED_HEALTH_MONITOR_HTTP_METHODS), default=constants.HEALTH_MONITOR_HTTP_DEFAULT_METHOD) url_path = wtypes.wsattr(types.URLPathType(), default=constants.HEALTH_MONITOR_DEFAULT_URL_PATH) expected_codes = wtypes.wsattr( wtypes.StringType(pattern=r'^(\d{3}(\s*,\s*\d{3})*)$|^(\d{3}-\d{3})$'), default=constants.HEALTH_MONITOR_DEFAULT_EXPECTED_CODES) admin_state_up = wtypes.wsattr(bool, default=True)