<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def getStatus(rh):
 """ Get status of a VMRelocate request. Input: Request Handle with the following properties: function - 'MIGRATEVM' subfunction - 'STATUS' userid - userid of the virtual machine parms['all'] - If present, set status_target to ALL. parms['incoming'] - If present, set status_target to INCOMING. parms['outgoing'] - If present, set status_target to OUTGOING. if parms does not contain 'all', 'incoming' or 'outgoing', the status_target is set to 'USER <userid>'. Output: Request Handle updated with the results. Return code - 0: ok, non-zero: error """


    rh.printSysLog("Enter migrateVM.getStatus")

    parms = ["-T", rh.userid]

    if 'all' in rh.parms:
        parms.extend(["-k", "status_target=ALL"])
    elif 'incoming' in rh.parms:
        parms.extend(["-k", "status_target=INCOMING"])
    elif 'outgoing' in rh.parms:
        parms.extend(["-k", "status_target=OUTGOING"])
    else:
        parms.extend(["-k", "status_target=USER " + rh.userid + ""])

    results = invokeSMCLI(rh, "VMRELOCATE_Status", parms)
    if results['overallRC'] != 0:
        # SMAPI API failed.
        rh.printLn("ES", results['response'])
        rh.updateResults(results)    # Use results from invokeSMCLI
        if results['rc'] == 4 and results['rs'] == 3001:
            # No relocation in progress
            msg = msgs.msg['0419'][1] % (modId, rh.userid)
            rh.printLn("ES", msg)
            rh.updateResults(msgs.msg['0419'][0])
    else:
        rh.printLn("N", results['response'])

    rh.printSysLog("Exit migrateVM.getStatus, rc: " +
        str(rh.results['overallRC']))
    return rh.results['overallRC']