code: def get_target_state():
      
      sdp_state = SDPState()
      errval, errdict = _check_status(sdp_state)
      if errval == "error":
          LOG.debug(errdict['reason'])
          return dict(
              current_target_state="unknown",
              last_updated="unknown",
              reason=errdict['reason']
          )
      LOG.debug('Getting target state')
      target_state = sdp_state.target_state
      LOG.debug('Target state = %s', target_state)
      return dict(
          current_target_state=target_state,
          allowed_target_states=sdp_state.allowed_target_states[
              sdp_state.current_state],
          last_updated=sdp_state.target_timestamp.isoformat())
docs: SDP target State.
  
      Returns the target state; allowed target states and time updated