def update(config, args):
    url = config['url'] + "/api/session/" + args['session'] + "/"

    data = {}

    if args['name'] is not None:
        data['name'] = args['name']

    if args['description'] is not None:
        data['description'] = args['description']

    if args['upstreamHost'] is not None:
        data['upstreamHost'] = args['upstreamHost']

    if args['upstreamPort'] is not None:
        data['upstreamPort'] = args['upstreamPort']

    if args['testplan'] is not None:
        data['testPlan'] = {"id": args['testplan'] }

    if args['serverOverloadProfile'] is not None:
        data['serverOverloadProfile'] = {"id": args['serverOverloadProfile']}

    if args['qosProfile'] is not None:
        data['qosProfile'] = {"id": args['qosProfile']}

    token = auth.get_token(config)
    r = requests.put(url, data=json.dumps(data), headers={"X-Auth-Token": token})
    print("API returned status code %s" % (r.status_code))
dataset/ETHPy150Open emccode/heliosburn/heliosburn/hbcli/controllers/session.py/update/original