import requests


def get_instance_metadata(compute_url, instance_id, token):
    """ Retrieve details about the running instance """

    url = "%s/servers/%s" % (compute_url, instance_id)
    headers = {"X-Auth-Token": "%s" % token, "Content-type": "application/json"}

    curl = requests.get(url=url, headers=headers)
    data = curl.json()

    return data