-
Notifications
You must be signed in to change notification settings - Fork 4
/
logs.clj
61 lines (55 loc) · 2.26 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
(ns happygapi.logging.logs
"Stackdriver Logging API: logs.
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/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. 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 args]
{:pre [(util/has-keys? args #{:logName})]}
(util/get-response
(http/delete
(util/get-url
"https://logging.googleapis.com/"
"v2/{+logName}"
#{:logName}
args)
(merge-with
merge
{:throw-exceptions false,
:query-params args,
:accept :json,
:as :json}
auth))))
(defn list$
"https://cloud.google.com/logging/docs/api/reference/rest/v2/logs/list
Required parameters: parent
Optional parameters: pageToken, pageSize
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 args]
{:pre [(util/has-keys? args #{:parent})]}
(util/get-response
(http/get
(util/get-url
"https://logging.googleapis.com/"
"v2/{+parent}/logs"
#{:parent}
args)
(merge-with
merge
{:throw-exceptions false,
:query-params args,
:accept :json,
:as :json}
auth))))