From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 13 06:56:39 2019 Received: (at 37083) by debbugs.gnu.org; 13 Oct 2019 10:56:39 +0000 Received: from localhost ([127.0.0.1]:35265 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iJbYE-000842-Ph for submit@debbugs.gnu.org; Sun, 13 Oct 2019 06:56:39 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52141) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iJbY8-00083l-9L for 37083@debbugs.gnu.org; Sun, 13 Oct 2019 06:56:37 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:56533) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iJbY2-0007KD-9I; Sun, 13 Oct 2019 06:56:27 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=37524 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1iJbXz-0005uI-62; Sun, 13 Oct 2019 06:56:25 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: zerodaysfordays@sdf.lonestar.org (Jakob L. Kreuze) Subject: Re: [bug#37083] [PATCH] machine: Implement 'digital-ocean-environment-type'. References: <87ftlxf6q3.fsf@sdf.lonestar.org> <875zmirizk.fsf@gnu.org> <87y2z45knp.fsf@gnu.org> <87blvysuaz.fsf@sdf.lonestar.org> <87tv9nc1fz.fsf@sdf.lonestar.org> <87y2yy7f64.fsf@gnu.org> <87y2yh5px7.fsf@sdf.lonestar.org> <87sgonl8t4.fsf@gnu.org> <87ftkgno80.fsf@sdf.lonestar.org> <87blv4no6e.fsf_-_@sdf.lonestar.org> <877e5sm4kl.fsf@gnu.org> Date: Sun, 13 Oct 2019 12:56:21 +0200 In-Reply-To: <877e5sm4kl.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Sun, 29 Sep 2019 00:36:10 +0200") Message-ID: <87lftoap7u.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 37083 Cc: 37083@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi Jakob, A friendly reminder. :-) I can commit it on your behalf if you lack the bandwidth right now. Thanks, Ludo=E2=80=99. Ludovic Court=C3=A8s skribis: > Hi Jakob! > > zerodaysfordays@sdf.lonestar.org (Jakob L. Kreuze) skribis: > >> gnu/machine/digital-ocean.scm: New file. >> gnu/local.mk (GNU_SYSTEM_MODULES): Add it. >> doc/guix.texi (Invoking 'guix deploy'): Add documentation for > ^ > Nitpick: please add a =E2=80=9C*=E2=80=9D before each bullet. :-) > > Apart from that, LGTM, woohoo! > >> +(define (fetch-endpoint endpoint) >> + "Return the contents of the Digital Ocean API endpoint ENDPOINT as an >> +alist. This procedure is quite a bit more specialized than 'json-fetch'= , as it >> +takes care to set headers such as 'Accept' and 'Authorization' appropri= ately." >> + (define headers >> + `((user-agent . "Guix Deploy") >> + (Accept . "application/json") >> + (Authorization . ,(format #f "Bearer ~a" (%digital-ocean-token)))= )) >> + (json-fetch (string-append %api-base endpoint) #:headers headers)) > > Note for later: we could use =E2=80=98define-json-mapping=E2=80=99 to wor= k on Scheme > records rather than on alists. > >> + (message (G_ "No Digital Ocean access token was provided. = This \ >> +may be fixed by setting the environment variable GUIX_DIGITAL_OCAEN_TOK= EN to \ > ^^ > Typo. > > Thank you! > > Ludo=E2=80=99.