'Create an iSCSI target.
:param interfaces: an array with network interfaces
:param tchapuser, tchapsecret: target\'s chapuser and chapsecret
:returns: target iqn'

def create_target(self, alias, interfaces=None, tchapuser=None, tchapsecret=None):

    svc = ('/api/san/v1/iscsi/targets/alias=' + alias)
    ret = self.rclient.get(svc)
    if (ret.status != restclient.Status.OK):
        svc = '/api/san/v1/iscsi/targets'
        arg = {'alias': alias}
        if (tchapuser and (tchapuser != '') and tchapsecret and (tchapsecret != '')):
            arg.update({'targetchapuser': tchapuser, 'targetchapsecret': tchapsecret, 'auth': 'chap'})
        if ((interfaces is not None) and (len(interfaces) > 0)):
            arg.update({'interfaces': interfaces})
        ret = self.rclient.post(svc, arg)
        if (ret.status != restclient.Status.CREATED):
            exception_msg = (_('Error    Creating    Target:    %(alias)sReturn    code:    %(ret.status)d    Message:    %(ret.data)s    .') % {'alias': alias, 'ret.status': ret.status, 'ret.data': ret.data})
            LOG.error(exception_msg)
            raise exception.VolumeBackendAPIException(data=exception_msg)
    val = json.loads(ret.data)
    return val['target']['iqn']
