@app.route('/<secret>/<name>', methods=['PUT'])
def put_blueprint(secret, name):
    validate_secret(secret)
    validate_name(name)

    librato.count('blueprint-io-server.bandwidth.in', request.content_length)
    statsd.update('blueprint-io-server.bandwidth.in', request.content_length)
    validate_content_length()

    # Validate the blueprint JSON format.  This could stand more rigor
    # or, dare I say it, a schema?
    try:
        for k in request.json.iterkeys():
            if k not in ('arch', 'files', 'packages', 'services', 'sources'):
                abort(400)
    except __HOLE__:
        abort(400)

    # Remove tarballs referenced by the old blueprint but not the new one.
    b = _blueprint(secret, name)
    if b is not None and b is not False:
        for filename in set(b.sources.itervalues()) - \
                        set(request.json.get('sources', {}).itervalues()):
            backend.delete_tarball(secret, name, filename[0:-4])

    # Store the blueprint JSON in S3.
    if not backend.put_blueprint(secret, name, request.data):
        abort(502)

    return MeteredResponse(response='',
                           status=202,
                           content_type='text/plain')
dataset/ETHPy150Open devstructure/blueprint/blueprint/io/server/__init__.py/put_blueprint