Ejemplo n.º 1
0
def api_call(method_name, endpoint=None, params=[], username=None, verbose=False):
    user, _, _, ch_end = _get_ch_params()
    username = username or user
    endpoint = endpoint or ch_end
    key_path, cert_path = "%s-key.pem" % (username,), "%s-cert.pem" % (username,)
    res = ssl_call(method_name, params, endpoint, key_path=key_path, cert_path=cert_path)
    if verbose:
        print_call(method_name, params, res)
    return res.get("code", None), res.get("value", None), res.get("output", None)
Ejemplo n.º 2
0
def api_call(method_name, endpoint=None, params=[], username=None, verbose=False):
    user, _, _, ch_end = _get_ch_params()
    username = username or user
    endpoint = endpoint or ch_end
    key_path, cert_path = "%s-key.pem" % (username,), "%s-cert.pem" % (username,)
    res = ssl_call(method_name, params, endpoint, key_path=key_path, cert_path=cert_path)
    if verbose:
        print_call(method_name, params, res)
    return res.get("code", None), res.get("value", None), res.get("output", None)
Ejemplo n.º 3
0
def api_call(method_name,
             endpoint,
             params=[],
             user_name="alice",
             verbose=False):
    key_path, cert_path = "%s-key.pem" % (user_name, ), "%s-cert.pem" % (
        user_name, )
    res = ssl_call(method_name,
                   params,
                   endpoint,
                   key_path=key_path,
                   cert_path=cert_path)
    if verbose:
        print_call(method_name, params, res)
    return res.get("code", None), res.get("value",
                                          None), res.get("output", None)
Ejemplo n.º 4
0
def api_call(method_name, endpoint, params=[], user_name="alice", verbose=False):
    key_path, cert_path = "%s-key.pem" % (user_name,), "%s-cert.pem" % (user_name,)
    res = ssl_call(method_name, params, endpoint, key_path=key_path, cert_path=cert_path)
    if verbose:
        print_call(method_name, params, res)
    return res.get("code", None), res.get("value", None), res.get("output", None)