Esempio n. 1
0
def do_unet_sec_list(cs, args):
    '''
    get security group info.you can filte by reource id or resource type.
    '''

    result = cs.unet.sec_get(args.ucloud_region, args.resource_type,
                             args.resource_id).get('DataSet')
    shell_utils.print_list(result, ['GroupName', 'GroupId', 'Type'])
def do_unet_sec_list(cs,args):
    '''
    get security group info.you can filte by reource id or resource type.
    '''
    
    result=cs.unet.sec_get(args.ucloud_region,args.resource_type,
                              args.resource_id).get('DataSet')
    shell_utils.print_list(result,['GroupName','GroupId','Type'])
Esempio n. 3
0
def do_uhost_image_list(cs, args):
    '''
    list all images
    '''
    images = cs.uhost.get_image(args.ucloud_region, args.imagetype,
                                args.ostype, args.imageid, args.offset,
                                args.limit).get('ImageSet')
    shell_utils.print_list(images, ['ImageId', 'ImageName', 'OsType'])
def do_uhost_image_list(cs,args):
    '''
    list all images
    '''
    images=cs.uhost.get_image(args.ucloud_region,args.imagetype,args.ostype,
                              args.imageid,args.offset,
                              args.limit).get('ImageSet')
    shell_utils.print_list(images,['ImageId','ImageName','OsType'])
def do_uhost_list(cs,args):
    '''
    list  uhosts
    '''

    uhosts = cs.uhost.get(args.ucloud_region,offset=args.offset,limit=args.limit).get('UHostSet')
    shell_utils.print_list(uhosts,['Name','UHostId','Tag','State',
                                   'BasicImageName'])
Esempio n. 6
0
def do_unet_vip_list(cs, args):
    '''
    list  vip
    '''
    vips = []
    result = cs.unet.vip_get(args.ucloud_region).get('DataSet')
    for vip in result:
        vips.append({'virtual ip': vip})
    shell_utils.print_list(vips, ['virtual ip'])
def do_unet_vip_list(cs,args):
    '''
    list  vip
    '''
    vips=[]
    result=cs.unet.vip_get(args.ucloud_region).get('DataSet')
    for vip in result:
        vips.append({'virtual ip':vip})
    shell_utils.print_list(vips,['virtual ip'])
Esempio n. 8
0
def do_udisk_list(cs, args):
    '''
    get all udisks list
    '''

    result = cs.udisk.list(args.ucloud_region).get('DataSet')
    for i in result:
        shell_utils.parse_time(i)
    shell_utils.print_list(
        result,
        ['Name', 'UDiskId', 'Size', 'Status', 'ChargeType', 'ExpiredTime'])
def do_unet_eip_list(cs,args):
    '''
    list eip
    '''

    result=cs.unet.eip_get(args.ucloud_region,
                              args.offset,args.limit).get('EIPSet')
    for eip in result:
        ip=eip.get('EIPAddr')[0]
        eip.update(ip)
    shell_utils.print_list(result,['Name','EIPId','Bandwidth','IP','OperatorName'])
Esempio n. 10
0
def do_uhost_list(cs, args):
    '''
    list  uhosts
    '''

    result = cs.uhost.list(args.ucloud_region,
                           offset=args.offset,
                           limit=args.limit).get('UHostSet')
    for i in result:
        shell_utils.parse_time(i)
    shell_utils.print_list(
        result,
        ['Name', 'UHostId', 'Tag', 'State', 'BasicImageName', 'ExpireTime'])
Esempio n. 11
0
def do_unet_eip_list(cs, args):
    '''
    list eip
    '''

    result = cs.unet.eip_list(args.ucloud_region, args.offset,
                              args.limit).get('EIPSet')
    if result:
        for eip in result:
            ip = eip.get('EIPAddr')[0]
            eip.update(ip)
            shell_utils.parse_time(eip)
        shell_utils.print_list(
            result,
            ['Name', 'EIPId', 'Bandwidth', 'IP', 'OperatorName', 'ExpireTime'])
    else:
        _print_nodata()