'Creates a volume snapshot.'

def create_snapshot(self, volume_path, volume_name, volume_id, snapshot_name, deletion_policy=None):

    request = {'typeId': (('com.tintri.api.rest.' + self.api_version) + '.dto.domain.beans.cinder.CinderSnapshotSpec'), 'file': TClient._remove_prefix(volume_path, tintri_path), 'vmName': (volume_name or snapshot_name), 'description': (((snapshot_name + '    (') + volume_id) + ')'), 'vmTintriUuid': volume_id, 'instanceId': volume_id, 'snapshotCreator': 'Cinder', 'deletionPolicy': deletion_policy}
    payload = (('/' + self.api_version) + '/cinder/snapshot')
    r = self.post(payload, request)
    if (r.status_code != 200):
        msg = (_('Failed    to    create    snapshot    for    volume    %s.') % volume_path)
        raise exception.VolumeDriverException(msg)
    return r.json()[0]
