def setUp(self): super(TestReceiverType, self).setUp() self.field = senlin_fields.ReceiverTypeField() self.coerce_good_values = [(action, action) for action in consts.RECEIVER_TYPES] self.coerce_bad_values = ['BOGUS'] self.to_primitive_values = self.coerce_good_values[0:1] self.from_primitive_values = self.coerce_good_values[0:1]
class ReceiverCreateRequestBody(base.SenlinObject): fields = { 'name': fields.NameField(), 'type': fields.ReceiverTypeField(), 'cluster_id': fields.StringField(nullable=True), 'action': fields.ClusterActionNameField(nullable=True), 'actor': fields.JsonField(nullable=True, default={}), 'params': fields.JsonField(nullable=True, default={}) }