def delete(ctx, resource, id):
    """Delete given device model or instance.
    """
    session, api_url, project_id = build_client_from_context(ctx)
    url = '/'.join([api_url, resource, id])
    r = session.delete(url)
    if r.status_code != 200:
        raise failed_request_exception('failed to delete resource', r)
    click.echo(r.text)
Delete given device model or instance.