This commit is contained in:
2024-05-31 14:05:21 +03:00
parent 84b7a80e1b
commit db1760cb72
815 changed files with 58194 additions and 11049 deletions

View File

@@ -78,6 +78,7 @@ func flattenLinkedJobs(ljl *audit.ListLinkedJobs) []map[string]interface{} {
for _, item := range linkedJobs {
temp := map[string]interface{}{
"cmd": item.CMD,
"guid": item.GUID,
"nid": item.NID,
"state": item.State,
"time_create": item.TimeCreate,

View File

@@ -87,10 +87,20 @@ func dataSourceAuditListSchemaMake() map[string]*schema.Schema {
Optional: true,
Description: "find by api endpoint (Mongo RegExp supported)",
},
"status_code": {
"min_status_code": {
Type: schema.TypeInt,
Optional: true,
Description: "find by HTTP status code",
Description: "find by HTTP min status code",
},
"max_status_code": {
Type: schema.TypeInt,
Optional: true,
Description: "find by HTTP max status code",
},
"sort_by": {
Type: schema.TypeString,
Optional: true,
Description: "sort by one of supported fields, format +|-(field)",
},
"page": {
Type: schema.TypeInt,
@@ -161,6 +171,11 @@ func dataSourceLinkedJobsSchemaMake() map[string]*schema.Schema {
Computed: true,
Description: "cmd",
},
"guid": {
Type: schema.TypeString,
Computed: true,
Description: "guid",
},
"nid": {
Type: schema.TypeInt,
Computed: true,

View File

@@ -58,8 +58,14 @@ func utilityAuditListCheckPresence(ctx context.Context, d *schema.ResourceData,
if call, ok := d.GetOk("call"); ok {
req.Call = call.(string)
}
if statusCode, ok := d.GetOk("status_code"); ok {
req.StatusCode = uint64(statusCode.(int))
if minStatusCode, ok := d.GetOk("min_status_code"); ok {
req.MinStatusCode = uint64(minStatusCode.(int))
}
if maxStatusCode, ok := d.GetOk("max_status_code"); ok {
req.MaxStatusCode = uint64(maxStatusCode.(int))
}
if sortBy, ok := d.GetOk("sort_by"); ok {
req.SortBy = sortBy.(string)
}
if Page, ok := d.GetOk("page"); ok {
req.Page = uint64(Page.(int))