Deletes a snapshot from the image.

    .. versionadded:: 2016.3.0

    image_id
        The ID of the image from which to delete the snapshot. Can be used instead of
        ``image_name``.

    image_name
        The name of the image from which to delete the snapshot. Can be used instead
        of ``image_id``.

    snapshot_id
        The ID of the snapshot to delete.

    CLI Example:

    .. code-block:: bash

        salt-cloud -f image_snapshot_delete vm_id=106 snapshot_id=45
        salt-cloud -f image_snapshot_delete vm_name=my-vm snapshot_id=111

def image_snapshot_delete(call=None, kwargs=None):
    '''
    Deletes a snapshot from the image.

    .. versionadded:: 2016.3.0

    image_id
        The ID of the image from which to delete the snapshot. Can be used instead of
        ``image_name``.

    image_name
        The name of the image from which to delete the snapshot. Can be used instead
        of ``image_id``.

    snapshot_id
        The ID of the snapshot to delete.

    CLI Example:

    .. code-block:: bash

        salt-cloud -f image_snapshot_delete vm_id=106 snapshot_id=45
        salt-cloud -f image_snapshot_delete vm_name=my-vm snapshot_id=111
    '''
    if call != 'function':
        raise SaltCloudSystemExit(
            'The image_snapshot_delete function must be called with -f or --function.'
        )

    if kwargs is None:
        kwargs = {}

    image_id = kwargs.get('image_id', None)
    image_name = kwargs.get('image_name', None)
    snapshot_id = kwargs.get('snapshot_id', None)

    if snapshot_id is None:
        raise SaltCloudSystemExit(
            'The image_snapshot_delete function requires a \'snapshot_id\' to be provided.'
        )

    if image_id:
        if image_name:
            log.warning(
                'Both the \'image_id\' and \'image_name\' arguments were provided. '
                '\'image_id\' will take precedence.'
            )
    elif image_name:
        image_id = get_image_id(kwargs={'name': image_name})
    else:
        raise SaltCloudSystemExit(
            'The image_snapshot_delete function requires either an \'image_id\' '
            'or a \'image_name\' to be provided.'
        )

    server, user, password = _get_xml_rpc()
    auth = ':'.join([user, password])
    response = server.one.image.snapshotdelete(auth, int(image_id), int(snapshot_id))

    data = {
        'action': 'image.snapshotdelete',
        'deleted': response[0],
        'snapshot_id': response[1],
        'error_code': response[2],
    }

    return data