예제 #1
0
파일: api.py 프로젝트: alex/services
def post_taskcluster(body):
    # TODO: need to make this route work
    credentials = []

    # XXX: it should get authenticated via Authenticated header
    client_id = current_app.config.get('TASKCLUSTER_CLIENT_ID')
    access_token = current_app.config.get('TASKCLUSTER_ACCESS_TOKEN')

    if client_id and access_token:
        credentials = [dict(
            credentials=dict(
                clientId=client_id,
                accessToken=access_token,
            ))]

    purge_cache = taskcluster.PurgeCache(*credentials)

    for item in body:
        purge_cache.purgeCache(item.provisionerId,
                               item.workerType,
                               dict(cacheName=item.cacheName))

    return None
예제 #2
0
def post_tc_purgecache(body):
    ''' Purge cache on taskcluster. '''

    credentials = []

    client_id = current_app.config['TASKCLUSTER_CLIENT_ID']
    access_token = current_app.config['TASKCLUSTER_ACCESS_TOKEN']

    if client_id and access_token:
        credentials = [{
            'credentials': {
                'clientId': client_id,
                'accessToken': access_token,
            },
        }]

    purge_cache = taskcluster.PurgeCache(*credentials)

    for item in body:
        purge_cache.purgeCache(item.provisionerId, item.workerType,
                               {'cacheName': item.cacheName})

    return None
def tc_purgecache(body):
    """Purge cache on taskcluster
    """

    credentials = []

    client_id = current_app.config.get('TASKCLUSTER_CLIENT_ID')
    access_token = current_app.config.get('TASKCLUSTER_ACCESS_TOKEN')

    if client_id and access_token:
        credentials = [dict(
            credentials=dict(
                clientId=client_id,
                accessToken=access_token,
            ))]

    purge_cache = taskcluster.PurgeCache(*credentials)

    for item in body:
        purge_cache.purgeCache(item.provisionerId,
                               item.workerType,
                               dict(cacheName=item.cacheName))

    return None