Esempio n. 1
0
def do_algorithm_list(cs, args):
    """
    List out supported algorithms.
    """
    algs = cs.algorithms.list()
    fields = [('name', 'Algorithm Name')]
    utils.print_list(algs, fields=fields)
Esempio n. 2
0
def do_virtualips(cs, args):
    """
    Show VirtualIPs for a LoadBalancer.
    """
    vips = cs.loadbalancers.list_vip(args.id)
    fields = [
        'id',
        'type',
        ('ipVersion', 'IP Version'),
        'address'
    ]
    utils.print_list(vips, fields=fields, titled=True)
Esempio n. 3
0
def do_limit_list(cs, args):
    """
    List out limits
    """
    limits = cs.limits.list_limits()
    out = []
    for l in limits:
        info = l._info
        del info['name']
        info = "\n".join(['%s: %s' % (k, info[k])
                         for k in sorted(info.keys())])
        out.append({'name': l.name, 'info': info})
    fields = ['name', 'info']
    utils.print_list(out, fields=fields)
Esempio n. 4
0
def do_protocol_list(cs, args):
    """
    List Protocols
    """
    protocols = cs.protocols.list()
    utils.print_list(protocols, titled=True)
Esempio n. 5
0
def do_node_list(cs, args):
    """
    List LoadBalancer Nodes.
    """
    nodes = cs.loadbalancers.list_nodes(args.lb_id)
    utils.print_list(nodes, fields=NODE_FIELDS, titled=True)
Esempio n. 6
0
def do_node_create(cs, args):
    """
    Create a LoadBalancer Node.
    """
    nodes = cs.loadbalancers.create_node(args.id, args.node)
    utils.print_list(nodes, fields=NODE_FIELDS, titled=True)
Esempio n. 7
0
def do_list(cs, args):
    """
    List loadbalancers.
    """
    lbs = cs.loadbalancers.list(deleted=args.deleted)
    utils.print_list(lbs, fields=LB_FIELDS, titled=True)