def f(v):
     if str(v) in EdgeLabel.labels():
         return str(v)
     else:
         raise Invalid(msg or 100)
 def f(v):
     if str(v) in EdgeLabel.labels():
         return str(v)
     else:
         raise Invalid(msg or 100)
Example #3
0
    'scenarios is a mandatory section.',
    81:
    'At least one scenario must be defined.',
    82:
    'scenario field is required.',
    83:
    'Entity definition must contain condition field.',
    84:
    'Entity definition must contain actions field.',
    85:
    'Failed to convert condition.',

    # relationships status messages 100-119
    100:
    'Invalid relation type. Relation type must be from types: '
    '{labels}'.format(labels=EdgeLabel.labels()),
    101:
    'Relationship field is required.',
    102:
    'Relationship definition must contain source field.',
    103:
    'Relationship definition must contain target field.',
    104:
    'Relationship definition must contain template_id field.',

    # actions status messages 120-139
    120:
    'Invalid action type. Action type must be from types: '
    '{actions}'.format(actions=action_types),
    121:
    'At least one action must be defined.',
Example #4
0
    # metadata section status messages 60-79
    60: 'metadata section must contain id field.',
    62: 'metadata is a mandatory section.',

    # scenarios section status messages 80-99
    80: 'scenarios is a mandatory section.',
    81: 'At least one scenario must be defined.',
    82: 'scenario field is required.',
    83: 'Entity definition must contain condition field.',
    84: 'Entity definition must contain actions field.',
    85: 'Failed to convert condition.',

    # relationships status messages 100-119
    100: 'Invalid relation type. Relation type must be from types: '
         '{labels}'.format(labels=EdgeLabel.labels()),
    101: 'Relationship field is required.',
    102: 'Relationship definition must contain source field.',
    103: 'Relationship definition must contain target field.',
    104: 'Relationship definition must contain template_id field.',

    # actions status messages 120-139
    120: 'Invalid action type. Action type must be from types: '
         '{actions}'.format(actions=action_types),
    121: 'At least one action must be defined.',
    122: 'Action field is required.',
    123: 'Relationship definition must contain action_type field.',
    124: 'Relationship definition must contain action_target field.',
    125: 'raise_alarm action must contain alarm_name field in properties '
         'block.',
    126: 'raise_alarm action must contain severity field in properties block.',