4.9.0
This commit is contained in:
@@ -52,6 +52,7 @@ func flattenAudit(d *schema.ResourceData, au *audit.RecordAudit) {
|
||||
d.Set("tags", au.Tags)
|
||||
d.Set("timestamp", au.Timestamp)
|
||||
d.Set("timestamp_end", au.TimestampEnd)
|
||||
d.Set("ttl", au.TTL)
|
||||
d.Set("user", au.User)
|
||||
}
|
||||
|
||||
@@ -59,12 +60,19 @@ 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{}{
|
||||
"call": item.Call,
|
||||
"guid": item.GUID,
|
||||
"responsetime": item.ResponseTime,
|
||||
"status_code": item.StatusCode,
|
||||
"timestamp": item.Timestamp,
|
||||
"user": item.User,
|
||||
"args": item.Args,
|
||||
"call": item.Call,
|
||||
"guid": item.GUID,
|
||||
"kwargs": item.Kwargs,
|
||||
"remote_addr": item.RemoteAddr,
|
||||
"result": item.Result,
|
||||
"responsetime": item.ResponseTime,
|
||||
"status_code": item.StatusCode,
|
||||
"tags": item.Tags,
|
||||
"timestamp": item.Timestamp,
|
||||
"timestamp_end": item.TimestampEnd,
|
||||
"ttl": item.TTL,
|
||||
"user": item.User,
|
||||
}
|
||||
res = append(res, temp)
|
||||
}
|
||||
@@ -76,14 +84,15 @@ func flattenLinkedJobs(ljl *audit.ListLinkedJobs) []map[string]interface{} {
|
||||
linkedJobs := *ljl
|
||||
for _, item := range linkedJobs {
|
||||
temp := map[string]interface{}{
|
||||
"cmd": item.CMD,
|
||||
"guid": item.GUID,
|
||||
"nid": item.NID,
|
||||
"state": item.State,
|
||||
"time_create": item.TimeCreate,
|
||||
"time_start": item.TimeStart,
|
||||
"time_stop": item.TimeStop,
|
||||
"timeout": item.Timeout,
|
||||
"cmd": item.CMD,
|
||||
"guid": item.GUID,
|
||||
"nid": item.NID,
|
||||
"physical_node": item.PhysicalNode,
|
||||
"state": item.State,
|
||||
"time_create": item.TimeCreate,
|
||||
"time_start": item.TimeStart,
|
||||
"time_stop": item.TimeStop,
|
||||
"timeout": item.Timeout,
|
||||
}
|
||||
res = append(res, temp)
|
||||
}
|
||||
|
||||
@@ -54,6 +54,10 @@ func dataSourceAuditSchemaMake() map[string]*schema.Schema {
|
||||
Type: schema.TypeFloat,
|
||||
Computed: true,
|
||||
},
|
||||
"ttl": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
"user": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
@@ -103,12 +107,16 @@ func dataSourceAuditListSchemaMake() map[string]*schema.Schema {
|
||||
Optional: true,
|
||||
Description: "page number",
|
||||
},
|
||||
"request_id": {
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
Description: "request id",
|
||||
},
|
||||
"size": {
|
||||
Type: schema.TypeInt,
|
||||
Optional: true,
|
||||
Description: "page size",
|
||||
},
|
||||
|
||||
"items": {
|
||||
Type: schema.TypeList,
|
||||
Computed: true,
|
||||
@@ -138,6 +146,34 @@ func dataSourceAuditListSchemaMake() map[string]*schema.Schema {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
"ttl": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
"args": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
"kwargs": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
"result": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
"timestamp_end": {
|
||||
Type: schema.TypeFloat,
|
||||
Computed: true,
|
||||
},
|
||||
"remote_addr": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
"tags": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -177,6 +213,10 @@ func dataSourceLinkedJobsSchemaMake() map[string]*schema.Schema {
|
||||
Computed: true,
|
||||
Description: "nid",
|
||||
},
|
||||
"physical_node": {
|
||||
Type: schema.TypeBool,
|
||||
Computed: true,
|
||||
},
|
||||
"state": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
|
||||
@@ -70,6 +70,9 @@ func utilityAuditListCheckPresence(ctx context.Context, d *schema.ResourceData,
|
||||
if Page, ok := d.GetOk("page"); ok {
|
||||
req.Page = uint64(Page.(int))
|
||||
}
|
||||
if RequestID, ok := d.GetOk("request_id"); ok {
|
||||
req.RequestID = RequestID.(string)
|
||||
}
|
||||
if Size, ok := d.GetOk("size"); ok {
|
||||
req.Size = uint64(Size.(int))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user