2023-03-27 19:02:36 +08:00
|
|
|
package dto
|
|
|
|
|
2023-03-30 16:07:28 +08:00
|
|
|
type FirewallBaseInfo struct {
|
2023-03-30 18:03:21 +08:00
|
|
|
Name string `json:"name"`
|
|
|
|
Status string `json:"status"`
|
|
|
|
Version string `json:"version"`
|
|
|
|
PingStatus string `json:"pingStatus"`
|
2023-03-30 16:07:28 +08:00
|
|
|
}
|
|
|
|
|
2023-03-27 19:02:36 +08:00
|
|
|
type RuleSearch struct {
|
|
|
|
PageInfo
|
2023-08-30 14:56:11 +08:00
|
|
|
Info string `json:"info"`
|
|
|
|
Status string `json:"status"`
|
|
|
|
Strategy string `json:"strategy"`
|
|
|
|
Type string `json:"type" validate:"required"`
|
2023-03-27 19:02:36 +08:00
|
|
|
}
|
|
|
|
|
2023-03-30 16:07:28 +08:00
|
|
|
type FirewallOperation struct {
|
2023-03-30 18:03:21 +08:00
|
|
|
Operation string `json:"operation" validate:"required,oneof=start stop disablePing enablePing"`
|
2023-03-30 16:07:28 +08:00
|
|
|
}
|
|
|
|
|
2023-03-27 19:02:36 +08:00
|
|
|
type PortRuleOperate struct {
|
|
|
|
Operation string `json:"operation" validate:"required,oneof=add remove"`
|
|
|
|
Address string `json:"address"`
|
|
|
|
Port string `json:"port" validate:"required"`
|
2023-03-27 23:29:46 +08:00
|
|
|
Protocol string `json:"protocol" validate:"required,oneof=tcp udp tcp/udp"`
|
2023-03-27 19:02:36 +08:00
|
|
|
Strategy string `json:"strategy" validate:"required,oneof=accept drop"`
|
2023-08-15 22:48:11 +08:00
|
|
|
|
|
|
|
Description string `json:"description"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type UpdateFirewallDescription struct {
|
2023-08-30 14:56:11 +08:00
|
|
|
Type string `json:"type"`
|
2023-08-15 22:48:11 +08:00
|
|
|
Address string `json:"address"`
|
|
|
|
Port string `json:"port"`
|
|
|
|
Protocol string `json:"protocol"`
|
|
|
|
Strategy string `json:"strategy" validate:"required,oneof=accept drop"`
|
|
|
|
|
|
|
|
Description string `json:"description"`
|
2023-03-27 19:02:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
type AddrRuleOperate struct {
|
|
|
|
Operation string `json:"operation" validate:"required,oneof=add remove"`
|
|
|
|
Address string `json:"address" validate:"required"`
|
|
|
|
Strategy string `json:"strategy" validate:"required,oneof=accept drop"`
|
2023-08-15 22:48:11 +08:00
|
|
|
|
|
|
|
Description string `json:"description"`
|
2023-03-27 19:02:36 +08:00
|
|
|
}
|
2023-03-28 15:17:13 +08:00
|
|
|
|
|
|
|
type PortRuleUpdate struct {
|
|
|
|
OldRule PortRuleOperate `json:"oldRule"`
|
|
|
|
NewRule PortRuleOperate `json:"newRule"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type AddrRuleUpdate struct {
|
|
|
|
OldRule AddrRuleOperate `json:"oldRule"`
|
|
|
|
NewRule AddrRuleOperate `json:"newRule"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type BatchRuleOperate struct {
|
|
|
|
Type string `json:"type" validate:"required"`
|
|
|
|
Rules []PortRuleOperate `json:"rules"`
|
|
|
|
}
|