From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:40613) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iELKr-0004qa-0U for guix-patches@gnu.org; Sat, 28 Sep 2019 18:37:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iELKp-0006XY-0l for guix-patches@gnu.org; Sat, 28 Sep 2019 18:37:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:42662) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iELKn-0006Uh-QJ for guix-patches@gnu.org; Sat, 28 Sep 2019 18:37:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iELKn-00049u-Ks for guix-patches@gnu.org; Sat, 28 Sep 2019 18:37:01 -0400 Subject: [bug#37083] [PATCH] machine: Implement 'digital-ocean-environment-type'. Resent-Message-ID: From: Ludovic =?UTF-8?Q?Court=C3=A8s?= 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> Date: Sun, 29 Sep 2019 00:36:10 +0200 In-Reply-To: <87blv4no6e.fsf_-_@sdf.lonestar.org> (Jakob L. Kreuze's message of "Sat, 28 Sep 2019 16:47:21 -0400") Message-ID: <877e5sm4kl.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: "Jakob L. Kreuze" Cc: 37083@debbugs.gnu.org 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' appropria= tely." > + (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 work = on Scheme records rather than on alists. > + (message (G_ "No Digital Ocean access token was provided. T= his \ > +may be fixed by setting the environment variable GUIX_DIGITAL_OCAEN_TOKE= N to \ ^^ Typo. Thank you! Ludo=E2=80=99.