Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateReq ¶
type CreateReq struct {
ID uint `json:"-"` // 安全组ID
Description string `json:"description"` // 描述
Direction string `json:"direction"` // 规则方向(in进方向,out出方向)
Protocol string `json:"protocol"` // 协议(all,all_tcp,all_udp,tcp,udp,icmp,ssh,telnet,http,https,mssql,oracle,mysql,rdp,postgresql,redis,gre)
Port string `json:"port"` // 端口范围(专业版)
Ip string `json:"ip"` // 授权IP(专业版,Hyper-V)
Lock int `json:"lock"` // 是否锁定(0不锁定,1锁定,v2.3.0+)
StartIp string `json:"start_ip"` // 起始IP(轻量版)
EndIp string `json:"end_ip"` // 结束IP(轻量版)
StartPort int `json:"start_port"` // 起始端口(轻量版,Hyper-V)
EndPort int `json:"end_port"` // 结束端口(轻量版,Hyper-V)
Priority int `json:"priority"` // 优先级(轻量版)
Action string `json:"action"` // 授权策略(accept=允许,drop=拒绝,轻量版,Hyper-V)
}
type CreateResp ¶
type CreateResp struct{}
func Create ¶
func Create(ctx *cloudplatform.Context, req *CreateReq) (*CreateResp, error)
Create 添加安全组规则
type DeleteResp ¶
type DeleteResp struct{}
func Delete ¶
func Delete(ctx *cloudplatform.Context, req *DeleteReq) (*DeleteResp, error)
Delete 删除安全组规则
type ListReq ¶
type ListResp ¶
type ListResp struct {
Data []struct {
Id int `json:"id"` // 安全组规则ID
Description string `json:"description"` // 描述
Direction string `json:"direction"` // 规则方向
Protocol string `json:"protocol"` // 协议
Port string `json:"port"` // 端口范围(专业版)
Ip string `json:"ip"` // 授权IP(专业版,Hyper-V)
CreateTime string `json:"create_time"` // 创建时间
Lock int `json:"lock"` // 是否锁定(0不锁定,1锁定,v2.3.0+)
StartIp string `json:"start_ip"` // 起始IP(轻量版)
EndIp string `json:"end_ip"` // 结束IP(轻量版)
StartPort int `json:"start_port"` // 起始端口(轻量版,Hyper-V)
EndPort int `json:"end_port"` // 结束端口(轻量版,Hyper-V)
Priority int `json:"priority"` // 优先级(轻量版)
Action string `json:"action"` // 授权策略(accept=允许,drop=拒绝,轻量版,Hyper-V)
} `json:"data"`
Meta struct {
Total int `json:"total"`
TotalPage int `json:"total_page"`
Page int `json:"page"`
PerPage int `json:"per_page"`
DirectionInNum int `json:"direction_in_num"` // 进方向规则总数(v2.4.1+)
DirectionOutNum int `json:"direction_out_num"` // 出方向规则总数(v2.4.1+)
} `json:"meta"`
}
type ProtocolsReq ¶
type ProtocolsReq struct{}
func (*ProtocolsReq) Body ¶
func (r *ProtocolsReq) Body() any
func (*ProtocolsReq) Form ¶
func (r *ProtocolsReq) Form() (form url.Values)
func (*ProtocolsReq) Header ¶
func (r *ProtocolsReq) Header() http.Header
func (*ProtocolsReq) Method ¶
func (r *ProtocolsReq) Method() string
func (*ProtocolsReq) Url ¶
func (r *ProtocolsReq) Url() string
func (*ProtocolsReq) Values ¶
func (r *ProtocolsReq) Values() (values url.Values)
type ProtocolsResp ¶
type ProtocolsResp struct {
// contains filtered or unexported fields
}
func Protocols ¶
func Protocols(ctx *cloudplatform.Context, req *ProtocolsReq) ([]*ProtocolsResp, error)
Protocols 获取规则可用协议
type UpdateReq ¶
type UpdateReq struct {
ID uint `json:"-"` // 安全组规则ID
Description string `json:"description"` // 描述
Direction string `json:"direction"` // 规则方向(in进方向,out出方向)
Protocol string `json:"protocol"` // 协议(all,all_tcp,all_udp,tcp,udp,icmp,ssh,telnet,http,https,mssql,oracle,mysql,rdp,postgresql,redis,gre)
Port string `json:"port"` // 端口范围(专业版)
Ip string `json:"ip"` // 授权IP(专业版,Hyper-V)
Lock int `json:"lock"` // 是否锁定(0不锁定,1锁定,v2.3.0+)
StartIp string `json:"start_ip"` // 起始IP(轻量版)
EndIp string `json:"end_ip"` // 结束IP(轻量版)
StartPort int `json:"start_port"` // 起始端口(轻量版,Hyper-V)
EndPort int `json:"end_port"` // 结束端口(轻量版,Hyper-V)
Priority int `json:"priority"` // 优先级(轻量版)
Action string `json:"action"` // 授权策略(accept=允许,drop=拒绝,轻量版,Hyper-V)
}
type UpdateResp ¶
type UpdateResp struct{}
func Update ¶
func Update(ctx *cloudplatform.Context, req *UpdateReq) (*UpdateResp, error)
Update 修改安全组规则
Click to show internal directories.
Click to hide internal directories.