This commit is contained in:
2025-11-18 16:20:26 +03:00
parent 4b3f21d9be
commit e42fbcef39
397 changed files with 17560 additions and 1501 deletions

View File

@@ -43,6 +43,7 @@ func flattenAudit(d *schema.ResourceData, au *audit.RecordAudit) {
d.Set("args", au.Arguments)
d.Set("call", au.Call)
d.Set("correlation_id", au.CorrelationID)
d.Set("guid", au.GUID)
d.Set("kwargs", au.Kwargs)
d.Set("remote_addr", au.RemoteAddr)
@@ -54,3 +55,26 @@ func flattenAudit(d *schema.ResourceData, au *audit.RecordAudit) {
d.Set("timestamp_end", au.TimestampEnd)
d.Set("user", au.User)
}
func flattenAuditList(au *audit.ListAudits) []map[string]interface{} {
res := make([]map[string]interface{}, 0, len(au.Data))
for _, item := range au.Data {
temp := map[string]interface{}{
"args": item.Args,
"call": item.Call,
"correlation_id": item.CorrelationID,
"guid": item.GUID,
"kwargs": item.Kwargs,
"remote_addr": item.RemoteAddr,
"result": item.Result,
"responsetime": item.ResponseTime,
"status_code": item.StatusCode,
"timestamp": item.Timestamp,
"timestamp_end": item.TimestampEnd,
"ttl": item.TTL,
"user": item.User,
}
res = append(res, temp)
}
return res
}