Esempio n. 1
0
def getChatHost(useTLS):

    url = apiHost + '/v1/get_service/rschat'
    response = robot_util.getNoRetry(url, secure=commandArgs.secure_cert)
    response = json.loads(response)

    if response is not None:
        print("get_service response:", response)

    if response is None:

        if useTLS:
            url = apiHost + '/v1/get_random_endpoint/rschatssl/100'
        else:
            url = apiHost + '/v1/get_random_endpoint/rschat/100'

        response = robot_util.getNoRetry(url, secure=commandArgs.secure_cert)
        response = json.loads(response)
        print("get_endpoint response:", response)

    return response
Esempio n. 2
0
def getControlHost():

    url = apiHost + '/v1/get_service/rscontrol'
    response = robot_util.getNoRetry(url, secure=commandArgs.secure_cert)
    response = json.loads(response)
    print("response:", response)

    if response is not None:
        response['protocol'] = 'wss'
        print("get_service response:", response)

    if response is None:

        url = apiHost + '/v1/get_endpoint/rscontrol_robot/' + commandArgs.robot_id
        response = robot_util.getNoRetry(url, secure=commandArgs.secure_cert)
        response = json.loads(response)

        if response is not None:
            response['protocol'] = 'ws'
            print("get_endpoint response:", response)

    return response