Пример #1
0
class ClientPoolUpgradeOperation(MessageValidator):
    schema = (
        (TXN_TYPE, ConstantField(POOL_UPGRADE)),
        (ACTION, ChooseField(values=(
            START,
            CANCEL,
        ))),
        (VERSION,
         VersionField(components_number=(
             2,
             3,
         ),
                      max_length=VERSION_FIELD_LIMIT)),
        # TODO replace actual checks (idr, datetime)
        (SCHEDULE,
         MapField(IdentifierField(), NonEmptyStringField(), optional=True)),
        (SHA256, Sha256HexField()),
        (TIMEOUT, NonNegativeNumberField(optional=True)),
        (JUSTIFICATION,
         LimitedLengthStringField(max_length=JUSTIFICATION_MAX_SIZE,
                                  optional=True,
                                  nullable=True)),
        (NAME, LimitedLengthStringField(max_length=NAME_FIELD_LIMIT)),
        (FORCE, BooleanField(optional=True)),
        (REINSTALL, BooleanField(optional=True)),
    )
Пример #2
0
class ConstraintEntityField(MessageValidator):
    schema = (
        (CONSTRAINT_ID, ChooseField(values=ConstraintsEnum.values())),
        (ROLE, RoleField()),
        (SIG_COUNT, NonNegativeNumberField()),
        (NEED_TO_BE_OWNER, BooleanField(optional=True)),
        (METADATA, AnyMapField(optional=True))
    )