guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#37083] [PATCH] machine: Implement 'digital-ocean-environment-type'.


From: Ludovic Courtès
Subject: [bug#37083] [PATCH] machine: Implement 'digital-ocean-environment-type'.
Date: Sun, 29 Sep 2019 00:36:10 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)

Hi Jakob!

address@hidden (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 “*” 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' 
> appropriately."
> +  (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 ‘define-json-mapping’ to work 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_TOKEN to 
> \
                                                                   ^^
Typo.

Thank you!

Ludo’.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]