'Call host_define using XCLI.'

@proxy._trace_time
def _call_host_define(self, host, chap_name=None, chap_secret=None, domain_name=None):

    LOG.debug('host_define    with    domain:    %s)', domain_name)
    if domain_name:
        if chap_name:
            return self._call_xiv_xcli('host_define', host=host, iscsi_chap_name=chap_name, iscsi_chap_secret=chap_secret, domain=domain_name).as_list[0]
        else:
            return self._call_xiv_xcli('host_define', host=host, domain=domain_name).as_list[0]
    elif chap_name:
        return self._call_xiv_xcli('host_define', host=host, iscsi_chap_name=chap_name, iscsi_chap_secret=chap_secret).as_list[0]
    else:
        return self._call_xiv_xcli('host_define', host=host).as_list[0]
