Esempio n. 1
0
File: ui.py Progetto: doanac/cya
def install_script():
    base = url_for('index', _external=True)
    if base.endswith('/'):
        base = base[:-1]
    client = url_for('client_py', _external=True)
    return render_template('client_install.sh', base_url=base,
                           client_url=client, version=client_version())
Esempio n. 2
0
def install_script():
    base = url_for('index', _external=True)
    if base.endswith('/'):
        base = base[:-1]
    client = url_for('client_py', _external=True)
    return render_template('client_install.sh',
                           base_url=base,
                           client_url=client,
                           version=client_version())
Esempio n. 3
0
File: api.py Progetto: doanac/cya
def host_get(name):
    h = hosts.get(name)
    if _is_host_authenticated(h):
        h.ping()
        container_requests.handle(h)

    data = h.to_dict()
    data["client_version"] = client_version()
    withcontainers = request.args.get("with_containers") is not None
    if not withcontainers and "containers" in h.data:
        del data["containers"]
    if "api_key" in data:
        del data["api_key"]
    return jsonify(data)
Esempio n. 4
0
File: api.py Progetto: doanac/cya
def host_get(name):
    h = hosts.get(name)
    if _is_host_authenticated(h):
        h.ping()
        container_requests.handle(h)

    data = h.to_dict()
    data['client_version'] = client_version()
    withcontainers = request.args.get('with_containers') is not None
    if not withcontainers and 'containers' in h.data:
        del data['containers']
    if 'api_key' in data:
        del data['api_key']
    return jsonify(data)