Пример #1
0
def get_harness_collection(database="harness"):
    """Connects to the harness admin database (defaults to harness) and returns a pointer
    to the harness collection.
    """
    connection = db_utils.mongo_get_connection(database)
    collection = db_utils.mongo_get_collection(connection, "harness")
    return collection
Пример #2
0
def get_structure_collection(database):
    """Connects to the database and returns a pointer
    to the structures collection.
    """
    connection = db_utils.mongo_get_connection(database)
    collection = db_utils.mongo_get_collection(connection, "mars_structures")
    return collection
Пример #3
0
def get_workflow_collection(harness):
    """Connects to the specified harness and returns a pointer
    to the workflows collection.
    """
    connection = db_utils.mongo_get_connection(harness)
    collection = db_utils.mongo_get_collection(connection, 'workflows')
    return collection
Пример #4
0
def get_translator_collection(database):
    """Connects to the database and returns a pointer
    to the translators collection.
    """
    connection = db_utils.mongo_get_connection(database)
    collection = db_utils.mongo_get_collection(connection, "mars_translators")
    return collection
Пример #5
0
def get_function_collection(harness):
    """Connects to the specified harness and returns a pointer
    to the functions collection.
    """
    connection = db_utils.mongo_get_connection(harness)
    collection = db_utils.mongo_get_collection(connection, "functions")
    return collection
Пример #6
0
def get_component_collection(database):
    """Connects to the specified database and returns a pointer
    to the components collection.
    """
    connection = db_utils.mongo_get_connection(database)
    collection = db_utils.mongo_get_collection(connection, 'components')
    return collection
Пример #7
0
def get_station_collection(database="pha"):
    """Connects to the database (defaults to pha) and returns a pointer
    to the stations collection.
    """
    connection = db_utils.mongo_get_connection(database)
    collection = db_utils.mongo_get_collection(connection, "stations")
    return collection
Пример #8
0
def get_record_collection(database, collection):
    """Connects to the database and returns a pointer
    to the record collection.
    """
    connection = db_utils.mongo_get_connection(database)
    collection = db_utils.mongo_get_collection(connection, collection)
    return collection