-
Notifications
You must be signed in to change notification settings - Fork 4
/
regionZones.clj
35 lines (31 loc) · 1.21 KB
/
regionZones.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
(ns happygapi.compute.regionZones
"Compute Engine API: regionZones.
Creates and runs virtual machines on Google Cloud Platform.
See: https://cloud.google.com/compute/api/reference/rest/v1/regionZones"
(:require [cheshire.core :as json]
[clj-http.client :as http]
[happy.util :as util]))
(defn list$
"https://cloud.google.com/compute/api/reference/rest/v1/regionZones/list
Required parameters: project, region
Optional parameters: filter, maxResults, orderBy, pageToken, returnPartialSuccess
Retrieves the list of Zone resources under the specific region available to the specified project."
{:scopes ["https://www.googleapis.com/auth/cloud-platform"
"https://www.googleapis.com/auth/compute"
"https://www.googleapis.com/auth/compute.readonly"]}
[auth parameters]
{:pre [(util/has-keys? parameters #{:region :project})]}
(util/get-response
(http/get
(util/get-url
"https://compute.googleapis.com/compute/v1/"
"projects/{project}/regions/{region}/zones"
#{:region :project}
parameters)
(merge-with
merge
{:throw-exceptions false,
:query-params parameters,
:accept :json,
:as :json}
auth))))