def stop_bundle(server, bundlename, options):
    form_data = {'action': 'stop'}
    url = server.url('/system/console/bundles/{bundle}'.format(bundle=bundlename))
    log("POSTing to service {}".format(url))
    resp = requests.post(url, auth=(server.username, server.password), data=form_data)
    if resp.status_code != 200:
        error("Failed to stop bundle {bundle}: {status}".format(bundle=bundlename, status=resp.status_code))
        return -1
    elif options.raw:
        sys.stdout.write("{}\n".format(resp.content))
curl -u admin:admin http://localhost:4505/system/console/bundles/org.apache.sling.scripting.jsp
dataset/ETHPy150Open bjorns/aem-cmd/acmd/tools/bundles.py/stop_bundle