Re: [Tools-discuss] RESTful API style guide

Ole Laursen <olau@iola.dk> Tue, 18 June 2013 13:08 UTC

Return-Path: <olau@iola.dk>
X-Original-To: tools-discuss@ietfa.amsl.com
Delivered-To: tools-discuss@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 1DA1221F9EE2 for <tools-discuss@ietfa.amsl.com>; Tue, 18 Jun 2013 06:08:37 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.978
X-Spam-Level:
X-Spam-Status: No, score=-1.978 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, NO_RELAYS=-0.001]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lWP3-OXWqJAh for <tools-discuss@ietfa.amsl.com>; Tue, 18 Jun 2013 06:08:36 -0700 (PDT)
Received: from mail-ve0-x22a.google.com (mail-ve0-x22a.google.com [IPv6:2607:f8b0:400c:c01::22a]) by ietfa.amsl.com (Postfix) with ESMTP id 4B5DF21F9E5E for <tools-discuss@ietf.org>; Tue, 18 Jun 2013 06:08:36 -0700 (PDT)
Received: by mail-ve0-f170.google.com with SMTP id 14so3124638vea.29 for <tools-discuss@ietf.org>; Tue, 18 Jun 2013 06:08:35 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:x-gm-message-state; bh=6VYcdK6ulft9JtUlLyNs9RvS0szu8L0mvdf8SDW7J4U=; b=dlWla/lqLOAVyVc8rbPz8kluhg6qr57PMndEWKMHrbR9kVF3cIDbx6za+JjUG2gzFj D363ndL8tMKHQvpMdAPwmjFFT5UCF1kwjuGzhLLedMypituf4KDGgx10yQ60PBchPWy+ veEVfboTBCUnFO/cPOzR5qFf21Ey7210dLWlr+NHs5YrJB+ad+M4ea4phmlzNbdITXCh jE0D5Jb2m7F6amZ/9PrGsp2Nca7bIbwiLwjgNJJzQWb0TzXSJT/tmFGSFbZbjw0ACacU EU6yiqc35X07Jd2VmsXUOoRBYPC5WBLWTYVvD4eriiAejviSZz9mXNg3ZOKP5+uy9hfB aubQ==
X-Received: by 10.59.2.199 with SMTP id bq7mr6195050ved.51.1371560915711; Tue, 18 Jun 2013 06:08:35 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.58.133.71 with HTTP; Tue, 18 Jun 2013 06:08:15 -0700 (PDT)
In-Reply-To: <21266.1371520672@sandelman.ca>
References: <21266.1371520672@sandelman.ca>
From: Ole Laursen <olau@iola.dk>
Date: Tue, 18 Jun 2013 15:08:15 +0200
Message-ID: <CANb2OvJS5dpZ4HZ6T=i3-9Mj1Zn0f9LzH7Qhj2hffzoxKSc5PQ@mail.gmail.com>
To: Tools Team Discussion <tools-discuss@ietf.org>
Content-Type: text/plain; charset="ISO-8859-1"
X-Gm-Message-State: ALoCoQmFZEp1K0dZgrGGHQO64eSyDPXPsLgMK75nB5kJ+AVvK4ZFcCNqoQuWg4GgBvnufx85GiGS
Subject: Re: [Tools-discuss] RESTful API style guide
X-BeenThere: tools-discuss@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: IETF Tools Discussion <tools-discuss.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/tools-discuss>, <mailto:tools-discuss-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/tools-discuss>
List-Post: <mailto:tools-discuss@ietf.org>
List-Help: <mailto:tools-discuss-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/tools-discuss>, <mailto:tools-discuss-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 18 Jun 2013 13:08:37 -0000

2013/6/18 Michael Richardson <mcr+ietf@sandelman.ca>:
> This is just *TOO SLOW*.  Too many small requests.  (I assume the browser has
> a 1.1-persistent session open, but I haven't checked actually).
> I'd like to replace it with:
>     GET /groups.json
> returning an array of groups.  Does this make sense, architecturally?

IMHO, you've got this question backwards - it doesn't make sense
architecturally to access each individually. :)

>   PUT method.
>
>    Accepts JSON or "application/x-www-form-urlencoded" dictionary. Accepts
>    one argument which is the name of the agenda that should become
>    official. The special name "None" or an empty string will set the
>    agenda empty.
>
>    This call must be authenticated by a user with secretariat role, and
>    the agenda must be already marked public, or an HTTP 406 will be
>    returned.
>
>    The result of this call, if successful, is the updated JSON of the
>    meeting.

Agree with Martin that this is not a PUT, it's a POST. Also, if the
purpose is so specific, you should put it under a separate URL.
Furthermore, it sounds like this is an internal function to be used by
a Secretariat tool that presumably already has access to the database
so why are you even exposing it?


Ole