'Create a replication action.'

def create_replication_action(self, host_pool, host_project, tgt_name, tgt_pool, volume):

    arg = {'pool': host_pool, 'project': host_project, 'target_pool': tgt_pool, 'target': tgt_name}
    if (volume is not None):
        arg.update({'share': volume})
    svc = '/api/storage/v1/replication/actions'
    ret = self.rclient.post(svc, arg)
    if (ret.status != restclient.Status.CREATED):
        exception_msg = (_('Error    Creating    replication    action    on:    pool:    %(pool)s    Project:    %(proj)s    volume:    %(vol)s    for    target:    %(tgt)s    and    pool:    %(tgt_pool)sReturn    code:    %(ret.status)d    Message:    %(ret.data)s    .') % {'pool': host_pool, 'proj': host_project, 'vol': volume, 'tgt': tgt_name, 'tgt_pool': tgt_pool, '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['action']['id']
