Exemple #1
0
 def list_servers_with_details(self, request, tenant_id):
     """
     Returns list of servers that were created by the mocks, with details such as the metadata.
     """
     response_data = list_server(tenant_id)
     request.setResponseCode(response_data[1])
     return json.dumps(response_data[0])
Exemple #2
0
def _list_servers(request, tenant_id, details=False):
    """
    Return a list of servers, possibly filtered by name, possibly with details
    """
    server_name = None
    if 'name' in request.args:
        server_name = request.args['name'][0]
    response_data = list_server(tenant_id, server_name, details=details)
    request.setResponseCode(response_data[1])
    return json.dumps(response_data[0])
Exemple #3
0
 def list_servers(self, request, tenant_id):
     """
     Returns list of servers that were created by the mocks, with the given name.
     """
     server_name = ""
     if "name" in request.args:
         server_name = request.args["name"][0]
     response_data = list_server(tenant_id, server_name, details=False)
     request.setResponseCode(response_data[1])
     return json.dumps(response_data[0])
Exemple #4
0
def _list_servers(request, tenant_id, details=False):
    """
    Return a list of servers, possibly filtered by name, possibly with details
    """
    server_name = None
    if 'name' in request.args:
        server_name = request.args['name'][0]
    response_data = list_server(tenant_id, server_name, details=details)
    request.setResponseCode(response_data[1])
    return json.dumps(response_data[0])