Files
terraform-provider-decort/internal/service/cloudbroker/audit/schema.go

309 lines
6.3 KiB
Go
Raw Normal View History

2023-12-18 18:55:52 +03:00
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",
},
"args": {
Type: schema.TypeString,
Computed: true,
},
"call": {
Type: schema.TypeString,
Computed: true,
},
2025-11-18 16:20:26 +03:00
"correlation_id": {
Type: schema.TypeString,
Computed: true,
},
2023-12-18 18:55:52 +03:00
"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,
},
2025-11-18 16:20:26 +03:00
//TODO
//"tags": {
// Type: schema.TypeString,
// Computed: true,
//},
2023-12-18 18:55:52 +03:00
"timestamp": {
Type: schema.TypeFloat,
Computed: true,
},
"timestamp_end": {
Type: schema.TypeFloat,
Computed: true,
},
2025-05-21 16:38:25 +03:00
"ttl": {
Type: schema.TypeString,
Computed: true,
},
2023-12-18 18:55:52 +03:00
"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)",
},
2024-05-31 14:05:21 +03:00
"min_status_code": {
Type: schema.TypeInt,
Optional: true,
Description: "find by HTTP min status code",
},
"max_status_code": {
2023-12-18 18:55:52 +03:00
Type: schema.TypeInt,
Optional: true,
2024-05-31 14:05:21 +03:00
Description: "find by HTTP max status code",
},
"sort_by": {
Type: schema.TypeString,
Optional: true,
Description: "sort by one of supported fields, format +|-(field)",
2023-12-18 18:55:52 +03:00
},
"page": {
Type: schema.TypeInt,
Optional: true,
Description: "page number",
},
2025-05-21 16:38:25 +03:00
"request_id": {
Type: schema.TypeString,
Optional: true,
Description: "request id",
},
2023-12-18 18:55:52 +03:00
"size": {
Type: schema.TypeInt,
Optional: true,
Description: "page size",
},
2025-11-18 16:20:26 +03:00
"resgroup_id": {
Type: schema.TypeInt,
Optional: true,
},
"compute_id": {
Type: schema.TypeInt,
Optional: true,
},
"account_id": {
Type: schema.TypeInt,
Optional: true,
},
"vins_id": {
Type: schema.TypeInt,
Optional: true,
},
"service_id": {
Type: schema.TypeInt,
Optional: true,
},
"k8s_id": {
Type: schema.TypeInt,
Optional: true,
},
"flipgroup_id": {
Type: schema.TypeInt,
Optional: true,
},
"lb_id": {
Type: schema.TypeInt,
Optional: true,
},
"sep_id": {
Type: schema.TypeInt,
Optional: true,
},
"node_id": {
Type: schema.TypeInt,
Optional: true,
},
"exclude_audit_lines": {
Type: schema.TypeBool,
Optional: true,
},
2023-12-18 18:55:52 +03:00
"items": {
Type: schema.TypeList,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"call": {
Type: schema.TypeString,
Computed: true,
},
2025-11-18 16:20:26 +03:00
"correlation_id": {
Type: schema.TypeString,
Computed: true,
},
2023-12-18 18:55:52 +03:00
"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,
},
2025-05-21 16:38:25 +03:00
"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,
},
2023-12-18 18:55:52 +03:00
},
},
},
"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",
},
2024-05-31 14:05:21 +03:00
"guid": {
Type: schema.TypeString,
Computed: true,
Description: "guid",
},
2023-12-18 18:55:52 +03:00
"nid": {
Type: schema.TypeInt,
Computed: true,
Description: "nid",
},
2025-05-21 16:38:25 +03:00
"physical_node": {
Type: schema.TypeBool,
Computed: true,
},
2023-12-18 18:55:52 +03:00
"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",
},
},
},
},
}
}
2024-11-12 13:41:38 +03:00
func dataSourceAuditToFileSchemaMake() map[string]*schema.Schema {
return map[string]*schema.Schema{
"file_path": {
Type: schema.TypeString,
Optional: true,
Description: "file path",
},
}
}