You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
199 lines
4.0 KiB
199 lines
4.0 KiB
package audit
|
|
|
|
import "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
|
|
|
|
func dataSourceAuditSchemaMake() map[string]*schema.Schema {
|
|
return map[string]*schema.Schema{
|
|
"audit_guid": {
|
|
Type: schema.TypeString,
|
|
Required: true,
|
|
Description: "audit guid",
|
|
},
|
|
|
|
"apitask": {
|
|
Type: schema.TypeString,
|
|
Computed: true,
|
|
},
|
|
"args": {
|
|
Type: schema.TypeString,
|
|
Computed: true,
|
|
},
|
|
"call": {
|
|
Type: schema.TypeString,
|
|
Computed: true,
|
|
},
|
|
"guid": {
|
|
Type: schema.TypeString,
|
|
Computed: true,
|
|
},
|
|
"kwargs": {
|
|
Type: schema.TypeString,
|
|
Computed: true,
|
|
},
|
|
"remote_addr": {
|
|
Type: schema.TypeString,
|
|
Computed: true,
|
|
},
|
|
"responsetime": {
|
|
Type: schema.TypeFloat,
|
|
Computed: true,
|
|
},
|
|
"result": {
|
|
Type: schema.TypeString,
|
|
Computed: true,
|
|
},
|
|
"status_code": {
|
|
Type: schema.TypeInt,
|
|
Computed: true,
|
|
},
|
|
"tags": {
|
|
Type: schema.TypeString,
|
|
Computed: true,
|
|
},
|
|
"timestamp": {
|
|
Type: schema.TypeFloat,
|
|
Computed: true,
|
|
},
|
|
"timestamp_end": {
|
|
Type: schema.TypeFloat,
|
|
Computed: true,
|
|
},
|
|
"user": {
|
|
Type: schema.TypeString,
|
|
Computed: true,
|
|
},
|
|
}
|
|
}
|
|
|
|
func dataSourceAuditListSchemaMake() map[string]*schema.Schema {
|
|
return map[string]*schema.Schema{
|
|
"timestamp_at": {
|
|
Type: schema.TypeInt,
|
|
Optional: true,
|
|
Description: "find all audits after point in time (unixtime)",
|
|
},
|
|
"timestamp_to": {
|
|
Type: schema.TypeInt,
|
|
Optional: true,
|
|
Description: "find all audits before point in time (unixtime)",
|
|
},
|
|
"user": {
|
|
Type: schema.TypeString,
|
|
Optional: true,
|
|
Description: "find by user (Mongo RegExp supported)",
|
|
},
|
|
"call": {
|
|
Type: schema.TypeString,
|
|
Optional: true,
|
|
Description: "find by api endpoint (Mongo RegExp supported)",
|
|
},
|
|
"status_code": {
|
|
Type: schema.TypeInt,
|
|
Optional: true,
|
|
Description: "find by HTTP status code",
|
|
},
|
|
"page": {
|
|
Type: schema.TypeInt,
|
|
Optional: true,
|
|
Description: "page number",
|
|
},
|
|
"size": {
|
|
Type: schema.TypeInt,
|
|
Optional: true,
|
|
Description: "page size",
|
|
},
|
|
|
|
"items": {
|
|
Type: schema.TypeList,
|
|
Computed: true,
|
|
Elem: &schema.Resource{
|
|
Schema: map[string]*schema.Schema{
|
|
"call": {
|
|
Type: schema.TypeString,
|
|
Computed: true,
|
|
},
|
|
"guid": {
|
|
Type: schema.TypeString,
|
|
Computed: true,
|
|
},
|
|
"responsetime": {
|
|
Type: schema.TypeFloat,
|
|
Computed: true,
|
|
},
|
|
"status_code": {
|
|
Type: schema.TypeInt,
|
|
Computed: true,
|
|
},
|
|
"timestamp": {
|
|
Type: schema.TypeFloat,
|
|
Computed: true,
|
|
},
|
|
"user": {
|
|
Type: schema.TypeString,
|
|
Computed: true,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
"entry_count": {
|
|
Type: schema.TypeInt,
|
|
Computed: true,
|
|
Description: "entry count",
|
|
},
|
|
}
|
|
}
|
|
|
|
func dataSourceLinkedJobsSchemaMake() map[string]*schema.Schema {
|
|
return map[string]*schema.Schema{
|
|
"audit_guid": {
|
|
Type: schema.TypeString,
|
|
Required: true,
|
|
Description: "audit guid",
|
|
},
|
|
|
|
"items": {
|
|
Type: schema.TypeList,
|
|
Computed: true,
|
|
Elem: &schema.Resource{
|
|
Schema: map[string]*schema.Schema{
|
|
"cmd": {
|
|
Type: schema.TypeString,
|
|
Computed: true,
|
|
Description: "cmd",
|
|
},
|
|
"nid": {
|
|
Type: schema.TypeInt,
|
|
Computed: true,
|
|
Description: "nid",
|
|
},
|
|
"state": {
|
|
Type: schema.TypeString,
|
|
Computed: true,
|
|
Description: "state",
|
|
},
|
|
"time_create": {
|
|
Type: schema.TypeInt,
|
|
Computed: true,
|
|
Description: "time create",
|
|
},
|
|
"time_start": {
|
|
Type: schema.TypeInt,
|
|
Computed: true,
|
|
Description: "time start",
|
|
},
|
|
"time_stop": {
|
|
Type: schema.TypeInt,
|
|
Computed: true,
|
|
Description: "time stop",
|
|
},
|
|
"timeout": {
|
|
Type: schema.TypeInt,
|
|
Computed: true,
|
|
Description: "timeout",
|
|
},
|
|
},
|
|
},
|
|
},
|
|
}
|
|
}
|