Delete a datasource.

    datasourceid
        Id of the datasource.

    profile
        Configuration profile used to connect to the Grafana instance.
        Default is 'grafana'.

    CLI Example:

    .. code-block:: bash

        salt '*' grafana4.delete_datasource <datasource_id>

def delete_datasource(datasourceid, orgname=None, profile='grafana'):
    '''
    Delete a datasource.

    datasourceid
        Id of the datasource.

    profile
        Configuration profile used to connect to the Grafana instance.
        Default is 'grafana'.

    CLI Example:

    .. code-block:: bash

        salt '*' grafana4.delete_datasource <datasource_id>
    '''
    if isinstance(profile, string_types):
        profile = __salt__['config.option'](profile)
    response = requests.delete(
        '{0}/api/datasources/{1}'.format(profile['grafana_url'], datasourceid),
        auth=_get_auth(profile),
        headers=_get_headers(profile),
        timeout=profile.get('grafana_timeout', 3),
    )
    if response.status_code >= 400:
        response.raise_for_status()
    return response.json()