-
Notifications
You must be signed in to change notification settings - Fork 4
/
logs.clj
63 lines (55 loc) · 2.1 KB
/
logs.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.logging.logs
"Cloud Logging API: logs.
Writes log entries and manages your Cloud Logging configuration.
See: https://cloud.google.com/logging/docs/api/reference/rest/v2/logs"
(:require [cheshire.core :as json]
[clj-http.client :as http]
[happy.util :as util]))
(defn delete$
"https://cloud.google.com/logging/docs/api/reference/rest/v2/logs/delete
Required parameters: logName
Optional parameters: none
Deletes all the log entries in a log for the _Default Log Bucket. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. Entries received after the delete operation with a timestamp before the operation will be deleted."
{:scopes ["https://www.googleapis.com/auth/cloud-platform"
"https://www.googleapis.com/auth/logging.admin"]}
[auth parameters]
{:pre [(util/has-keys? parameters #{:logName})]}
(util/get-response
(http/delete
(util/get-url
"https://logging.googleapis.com/"
"v2/{+logName}"
#{:logName}
parameters)
(merge-with
merge
{:throw-exceptions false,
:query-params parameters,
:accept :json,
:as :json}
auth))))
(defn list$
"https://cloud.google.com/logging/docs/api/reference/rest/v2/logs/list
Required parameters: parent
Optional parameters: resourceNames, pageSize, pageToken
Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed."
{: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 parameters]
{:pre [(util/has-keys? parameters #{:parent})]}
(util/get-response
(http/get
(util/get-url
"https://logging.googleapis.com/"
"v2/{+parent}/logs"
#{:parent}
parameters)
(merge-with
merge
{:throw-exceptions false,
:query-params parameters,
:accept :json,
:as :json}
auth))))