Exemplo n.º 1
0
def _process_splice_server_metadata_upload(addr, port, url, since=None):
    url = url + "/spliceserver/" # must end in '/'
    cursor = _get_splice_server_metadata(addr, since)
    data = list(cursor)
    if not data:
        _LOG.info("No new splice server data to upload")
        return True
    last_timestamp = data[-1].updated
    try:
        _LOG.info("Uploading %s SpliceServer objects to %s:%s/%s" % (len(data), addr, port, url))
        splice_server_client.upload_splice_server_metadata(addr, port, url, data)
    except RequestException, e:
        _LOG.exception("Received exception attempting to send %s records from %s to %s:%s\%s" % (len(data), last_timestamp, addr, port, url))
        return False
Exemplo n.º 2
0
def upload(host, port, data):
    return splice_server_client.upload_splice_server_metadata(host, port, "/splice/api/v1/spliceserver/", data)