-
Notifications
You must be signed in to change notification settings - Fork 4
/
locations.clj
101 lines (89 loc) · 3.34 KB
/
locations.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
(ns happygapi.logging.locations
"Stackdriver Logging API: locations.
Writes log entries and manages your Stackdriver Logging configuration. The table entries below are presented in alphabetical order, not in order of common use. For explanations of the concepts found in the table entries, read the <a href=https://cloud.google.com/logging/docs>Stackdriver Logging documentation</a>.
See: https://cloud.google.com/logging/docs/api/reference/rest/v2/locations"
(:require [cheshire.core :as json]
[clj-http.client :as http]
[happy.util :as util]))
(defn buckets-list$
"https://cloud.google.com/logging/docs/api/reference/rest/v2/locations/buckets/list
Required parameters: parent
Optional parameters: pageToken, pageSize
Lists buckets (Beta)."
{:scopes ["https://www.googleapis.com/auth/cloud-platform"
"https://www.googleapis.com/auth/cloud-platform.read-only"
"https://www.googleapis.com/auth/logging.admin"
"https://www.googleapis.com/auth/logging.read"]}
[auth args]
{:pre [(util/has-keys? args #{:parent})]}
(util/get-response
(http/get
(util/get-url
"https://logging.googleapis.com/"
"v2/{+parent}/buckets"
#{:parent}
args)
(merge-with
merge
{:throw-exceptions false,
:query-params args,
:accept :json,
:as :json}
auth))))
(defn buckets-get$
"https://cloud.google.com/logging/docs/api/reference/rest/v2/locations/buckets/get
Required parameters: name
Optional parameters: none
Gets a bucket (Beta)."
{:scopes ["https://www.googleapis.com/auth/cloud-platform"
"https://www.googleapis.com/auth/cloud-platform.read-only"
"https://www.googleapis.com/auth/logging.admin"
"https://www.googleapis.com/auth/logging.read"]}
[auth args]
{:pre [(util/has-keys? args #{:name})]}
(util/get-response
(http/get
(util/get-url
"https://logging.googleapis.com/"
"v2/{+name}"
#{:name}
args)
(merge-with
merge
{:throw-exceptions false,
:query-params args,
:accept :json,
:as :json}
auth))))
(defn buckets-patch$
"https://cloud.google.com/logging/docs/api/reference/rest/v2/locations/buckets/patch
Required parameters: name
Optional parameters: updateMask
Body:
{:createTime string,
:updateTime string,
:name string,
:retentionDays integer,
:lifecycleState string,
:description string}
Updates a bucket. This method replaces the following fields in the existing bucket with values from the new bucket: retention_periodIf the retention period is decreased and the bucket is locked, FAILED_PRECONDITION will be returned.If the bucket has a LifecycleState of DELETE_REQUESTED, FAILED_PRECONDITION will be returned.A buckets region may not be modified after it is created. This method is in Beta."
{:scopes ["https://www.googleapis.com/auth/cloud-platform"
"https://www.googleapis.com/auth/logging.admin"]}
[auth args body]
{:pre [(util/has-keys? args #{:name})]}
(util/get-response
(http/patch
(util/get-url
"https://logging.googleapis.com/"
"v2/{+name}"
#{:name}
args)
(merge-with
merge
{:content-type :json,
:body (json/generate-string body),
:throw-exceptions false,
:query-params args,
:accept :json,
:as :json}
auth))))