import re


def get_job_details(job):
    """Given a Nomad Job, as returned by the API, returns the type and volume id"""

    # Surveyor jobs don't have ids and RAM, so handle them specially.
    if job["ID"].startswith("SURVEYOR"):
        return "SURVEYOR", False

    # example SALMON_1_2323
    name_match = re.match(r"(?P<type>\w+)_(?P<volume_id>\d+)_\d+$", job["ID"])
    if not name_match:
        return False, False

    return name_match.group("type"), name_match.group("volume_id")