Example #1
0
def get_server_details(authTokenId, novaUrl,
                       fields=['name', 'id', 'created', 'addresses']):
    responseTuple = novaUtils.listServerDetails(novaUrl, authTokenId)
    servers_detail_list = responseTuple[1]['servers']
    details_list = []
    if fields == ['*ALL'] or '*ALL' in fields:
        details_list = servers_detail_list
    else:
        for server in servers_detail_list:
            server_dict = {}
            for key in fields:
                server_dict[key] = server[key]
            details_list.append(server_dict)

    return details_list
Example #2
0
def get_server_dets(authTokenId, novaUrl):
    responseTuple = novaUtils.listServerDetails(novaUrl, authTokenId)
    servers_detail_list = responseTuple[1]['servers']
    return servers_detail_list