/
v2.clj
40 lines (36 loc) · 1.37 KB
/
v2.clj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
(ns happygapi.remotebuildexecution.v2
"Remote Build Execution API: v2.
Supplies a Remote Execution API service for tools such as bazel.
See: https://cloud.google.com/remote-build-execution/docs/api/reference/rest/v2/v2"
(:require [cheshire.core :as json]
[clj-http.client :as http]
[happy.util :as util]))
(defn $
"https://cloud.google.com/remote-build-execution/docs/api/reference/rest/v2/getCapabilities
Required parameters: instanceName
Optional parameters: none
GetCapabilities returns the server capabilities configuration of the
remote endpoint.
Only the capabilities of the services supported by the endpoint will
be returned:
* Execution + CAS + Action Cache endpoints should return both
CacheCapabilities and ExecutionCapabilities.
* Execution only endpoints should return ExecutionCapabilities.
* CAS + Action Cache only endpoints should return CacheCapabilities."
{:scopes ["https://www.googleapis.com/auth/cloud-platform"]}
[auth parameters]
{:pre [(util/has-keys? parameters #{:instanceName})]}
(util/get-response
(http/get
(util/get-url
"https://remotebuildexecution.googleapis.com/"
"v2/{+instanceName}/capabilities"
#{:instanceName}
parameters)
(merge-with
merge
{:throw-exceptions false,
:query-params parameters,
:accept :json,
:as :json}
auth))))