-
Notifications
You must be signed in to change notification settings - Fork 12
/
audit_get.Rd
116 lines (97 loc) · 3.2 KB
/
audit_get.Rd
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/audit_get.R
\name{audit_get}
\alias{audit_get}
\title{Get server audit log entries.}
\usage{
audit_get(
action = NULL,
start = NULL,
end = NULL,
limit = NULL,
offset = NULL,
url = Sys.getenv("ODKC_URL"),
un = Sys.getenv("ODKC_UN"),
pw = Sys.getenv("ODKC_PW"),
retries = get_retries()
)
}
\arguments{
\item{action}{string. The action to filter the logs, e.g. "user.create".
See \url{https://docs.getodk.org/central-api-system-endpoints/#getting-audit-log-entries}
for the full list of available actions.}
\item{start}{string. The ISO8601 timestamp of the earliest log entry to
return.
E.g. \verb{2000-01-01z} or \verb{2000-12-31T23:59.999z}, \verb{2000-01-01T12:12:12+08} or
\code{2000-01-01+08}.}
\item{end}{string. The ISO8601 timestamp of the last log entry to return.}
\item{limit}{integer. The max number of log entries to return.}
\item{offset}{integer. The number of log entries to skip.}
\item{url}{The ODK Central base URL without trailing slash.
Default: \code{\link{get_default_url}}.
Set default \code{url} through \code{ru_setup(url="...")}.
See \code{vignette("Setup", package = "ruODK")}.}
\item{un}{The ODK Central username (an email address).
Default: \code{\link{get_default_un}}.
Set default \code{un} through \code{ru_setup(un="...")}.
See \code{vignette("Setup", package = "ruODK")}.}
\item{pw}{The ODK Central password.
Default: \code{\link{get_default_pw}}.
Set default \code{pw} through \code{ru_setup(pw="...")}.
See \code{vignette("Setup", package = "ruODK")}.}
\item{retries}{The number of attempts to retrieve a web resource.
This parameter is given to \code{\link[httr]{RETRY}(times = retries)}.
Default: 3.}
}
\value{
A tibble containing server audit logs.
One row per audited action, columns are submission attributes:
\itemize{
\item actor_id: integer. The ID of the actor, if any, that initiated the
action.
\item action: string. The action that was taken.
\item actee_id: uuid, string. The ID of the permissioning object against
which the action was taken.
\item details: list. Additional details about the action that vary
according to the type of action.
\item logged_at: dttm. Time of action on server.
}
}
\description{
\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#stable}{\figure{lifecycle-stable.svg}{options: alt='[Stable]'}}}{\strong{[Stable]}}
}
\details{
Parameters to filter the audit logs:
\verb{action=form.create&start=2000-01-01z&end=2000-12-31T23\%3A59.999z}
}
\examples{
\dontrun{
# See vignette("setup") for setup and authentication options
# ruODK::ru_setup(svc = "....svc", un = "me@email.com", pw = "...")
logs <- audit_get()
# With search parameters
logs <- audit_get(
action = "project.update",
start = "2019-08-01Z",
end = "2019-08-31Z",
limit = 100,
offset = 0
)
# With partial search parameters
logs <- audit_get(
limit = 100,
offset = 0
)
logs \%>\% knitr::kable(.)
# audit_get returns a tibble
class(logs)
# > c("tbl_df", "tbl", "data.frame")
# Audit details
names(logs)
# > "actor_id" "action" "actee_id" "details" "logged_at"
}
}
\seealso{
\url{https://docs.getodk.org/central-api-system-endpoints/#getting-audit-log-entries}
}
\concept{server-management}