def request_atom_resend()

in atomresponder/media_atom.py [0:0]


def request_atom_resend(atomid, host, secret):
    """
    Message the media atom tool to request that the atom is resynced
    :param options:
    :return:
    """
    uri = "https://{host}/api/pluto/resend/{id}".format(host=host, id=atomid)
    logger.debug("uri is " + uri)
    authtoken, httpdate = get_token(uri, secret)
    logger.debug(authtoken)

    headers = {
        'X-Gu-Tools-HMAC-Date': httpdate,
        'X-Gu-Tools-HMAC-Token': authtoken
    }

    logger.debug(headers)
    response = requests.post(uri,headers=headers)
    logger.debug("Server returned {0}".format(response.status_code))
    logger.debug(pformat(response.headers))
    if response.status_code==200:
        logger.debug(pformat(response.json()))
    else:
        raise HttpError(uri,response.status_code, response.text, headers, response.headers)