-
Notifications
You must be signed in to change notification settings - Fork 4
/
operations.clj
63 lines (57 loc) · 2.09 KB
/
operations.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
(ns happygapi.deploymentmanager.operations
"Google Cloud Deployment Manager API: operations.
Declares, configures, and deploys complex solutions on Google Cloud Platform.
See: https://cloud.google.com/deployment-manager/api/reference/rest/v2/operations"
(:require [cheshire.core :as json]
[clj-http.client :as http]
[happy.util :as util]))
(defn get$
"https://cloud.google.com/deployment-manager/api/reference/rest/v2/operations/get
Required parameters: operation, project
Optional parameters: none
Gets information about a specific operation."
{:scopes ["https://www.googleapis.com/auth/cloud-platform"
"https://www.googleapis.com/auth/cloud-platform.read-only"
"https://www.googleapis.com/auth/ndev.cloudman"
"https://www.googleapis.com/auth/ndev.cloudman.readonly"]}
[auth args]
{:pre [(util/has-keys? args #{:operation :project})]}
(util/get-response
(http/get
(util/get-url
"https://www.googleapis.com/deploymentmanager/v2/projects/"
"{project}/global/operations/{operation}"
#{:operation :project}
args)
(merge-with
merge
{:throw-exceptions false,
:query-params args,
:accept :json,
:as :json}
auth))))
(defn list$
"https://cloud.google.com/deployment-manager/api/reference/rest/v2/operations/list
Required parameters: project
Optional parameters: filter, maxResults, orderBy, pageToken
Lists all operations for a project."
{:scopes ["https://www.googleapis.com/auth/cloud-platform"
"https://www.googleapis.com/auth/cloud-platform.read-only"
"https://www.googleapis.com/auth/ndev.cloudman"
"https://www.googleapis.com/auth/ndev.cloudman.readonly"]}
[auth args]
{:pre [(util/has-keys? args #{:project})]}
(util/get-response
(http/get
(util/get-url
"https://www.googleapis.com/deploymentmanager/v2/projects/"
"{project}/global/operations"
#{:project}
args)
(merge-with
merge
{:throw-exceptions false,
:query-params args,
:accept :json,
:as :json}
auth))))