예제 #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'])
예제 #2
0
class LBLogsPost(Base):
    objectStoreType = Enum(wtypes.text, 'Swift')
    objectStoreEndpoint = wtypes.text
    objectStoreBasePath = wtypes.text
    authToken = wtypes.text
예제 #3
0
class LBPut(Base):
    name = wtypes.text
    algorithm = Enum(wtypes.text, 'ROUND_ROBIN', 'LEAST_CONNECTIONS')
예제 #4
0
class LBNodePut(Base):
    condition = Enum(wtypes.text, 'ENABLED', 'DISABLED')
    weight = int
예제 #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
예제 #6
0
class LBMonitorPut(Base):
    type = Enum(wtypes.text, 'CONNECT', 'HTTP')
    delay = int
    timeout = int
    attemptsBeforeDeactivation = int
    path = wtypes.text
예제 #7
0
class DevicePut(Base):
    status = Enum(wtypes.text, 'ONLINE', 'ERROR')
    statusDescription = wsattr(wtypes.text, mandatory=True)
예제 #8
0
class LBPut(Base):
    name = wtypes.text
    algorithm = Enum(wtypes.text, 'ROUND_ROBIN', 'LEAST_CONNECTIONS')
    options = wsattr('LBOptions')
예제 #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