Exemplo n.º 1
0
class LBPost(Base):
    name = wsattr(wtypes.text, mandatory=True)
    nodes = wsattr(['LBNode'], mandatory=True)
    options = wsattr('LBOptions')
    protocol = wtypes.text
    algorithm = Enum(wtypes.text, 'ROUND_ROBIN', 'LEAST_CONNECTIONS')
    port = int
    virtualIps = wsattr(['LBVip'])
Exemplo n.º 2
0
class LBLogsPost(Base):
    objectStoreType = Enum(wtypes.text, 'Swift')
    objectStoreEndpoint = wtypes.text
    objectStoreBasePath = wtypes.text
    authToken = wtypes.text
Exemplo n.º 3
0
class LBPut(Base):
    name = wtypes.text
    algorithm = Enum(wtypes.text, 'ROUND_ROBIN', 'LEAST_CONNECTIONS')
Exemplo n.º 4
0
class LBNodePut(Base):
    condition = Enum(wtypes.text, 'ENABLED', 'DISABLED')
    weight = int
Exemplo n.º 5
0
class LBNode(Base):
    port = wsattr(int, mandatory=True)
    address = wsattr(wtypes.text, mandatory=True)
    condition = Enum(wtypes.text, 'ENABLED', 'DISABLED')
    backup = Enum(wtypes.text, 'TRUE', 'FALSE')
    weight = int
Exemplo n.º 6
0
class LBMonitorPut(Base):
    type = Enum(wtypes.text, 'CONNECT', 'HTTP')
    delay = int
    timeout = int
    attemptsBeforeDeactivation = int
    path = wtypes.text
Exemplo n.º 7
0
class DevicePut(Base):
    status = Enum(wtypes.text, 'ONLINE', 'ERROR')
    statusDescription = wsattr(wtypes.text, mandatory=True)
Exemplo n.º 8
0
class LBPut(Base):
    name = wtypes.text
    algorithm = Enum(wtypes.text, 'ROUND_ROBIN', 'LEAST_CONNECTIONS')
    options = wsattr('LBOptions')
Exemplo n.º 9
0
    :param query: A list of queries.
    :param storage_func: The name of the storage function to very against.
    """
    translation = {'customer': 'customer_id'}

    criterion = {}
    for q in query:
        key = translation.get(q.field, q.field)
        criterion[key] = q.as_dict()

    criterion.update(kw)

    return criterion


operation_kind = Enum(str, 'lt', 'le', 'eq', 'ne', 'ge', 'gt')


class Query(Base):
    """
    Query filter.
    """

    _op = None  # provide a default

    def get_op(self):
        return self._op or 'eq'

    def set_op(self, value):
        self._op = value