'Makes REST API call to clone volume.
:param new_vol_name: name of volume
:param resource_uri: uri of source volume
:param sync: synchronous request
:param synctimeout: Query for task status for \'synctimeout\' secs.
If the task doesn\'t complete in synctimeout secs,
an exception is thrown
:returns: Created task details in JSON response payload'

def clone(self, new_vol_name, resource_uri, sync, synctimeout=0):

    is_snapshot_clone = False
    clone_full_uri = None
    if (resource_uri.find('BlockConsistencyGroup') > 0):
        clone_full_uri = Volume.URI_CG_CLONE.format(resource_uri)
    elif (resource_uri.find('BlockSnapshot') > 0):
        is_snapshot_clone = True
        clone_full_uri = Volume.URI_SNAPSHOT_PROTECTION_FULLCOPIES.format(resource_uri)
    else:
        clone_full_uri = Volume.URI_VOLUME_PROTECTION_FULLCOPIES.format(resource_uri)
    request = {'name': new_vol_name, 'type': None, 'count': 1}
    request['count'] = 1
    body = oslo_serialization.jsonutils.dumps(request)
    (s, h) = common.service_json_request(self.ipaddr, self.port, 'POST', clone_full_uri, body)
    o = common.json_decode(s)
    if sync:
        task = o['task'][0]
        if is_snapshot_clone:
            return common.block_until_complete('block', task['resource']['id'], task['id'], self.ipaddr, self.port)
        else:
            return self.check_for_sync(task, sync, synctimeout)
    else:
        return o
