Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Update ¶
func Update(c *golangsdk.ServiceClient, instnaceId, ip, ruleId string, opts UpdateOpts) error
Update is a method to update the configurations of the forward rule using given parameters.
Types ¶
type BatchCreateOpts ¶
type BatchCreateOpts struct { // Forwarding rules created in batches. Rules []RuleOpts `json:"rules,omitempty"` }
BatchCreateOpts is the structure required by the BatchCreate method to batch create at least one forward rule.
type BatchDeleteOpts ¶
type BatchDeleteOpts struct {
RuleIds []string `json:"ids" required:"true"`
}
BatchDeleteOpts is the structure required by the BatchDelete method to batch delete at least one forward rule.
type BatchResp ¶
type BatchResp struct {
SuccessNum int `json:"successNum"`
}
BatchResp is the structure that represents the API request response for the create and delete methods.
func BatchCreate ¶
func BatchCreate(c *golangsdk.ServiceClient, instnaceId, ip string, opts BatchCreateOpts) (*BatchResp, error)
BatchCreate is a method to to batch create at least one forward rule using given parameters.
func BatchDelete ¶
func BatchDelete(c *golangsdk.ServiceClient, instnaceId, ip string, opts BatchDeleteOpts) (*BatchResp, error)
BatchDelete is a method to to batch delete at least one forward rule using given parameters.
type Rule ¶
type Rule struct { ID string `json:"rule_id"` ForwardProtocol string `json:"forward_protocol"` ForwardPort int `json:"forward_port"` SourcePort int `json:"source_port"` SourceIp string `json:"source_ip"` LbMethod string `json:"lb_method"` Status int `json:"status"` }
Rule is the structure that represents the details of the forward rule.
type RuleOpts ¶
type RuleOpts struct { // The forward protocol. ForwardProtocol string `json:"forward_protocol" required:"true"` // The forward port. // The valid value is range from 1 to 65535. ForwardPort int `json:"forward_port" required:"true"` // The source port. // The valid value is range from 1 to 65535. SourcePort int `json:"source_port" required:"true"` // The source IP list, separate the IPs with commas. SourceIp string `json:"source_ip" required:"true"` }
RuleOpts is the object that represents the forwarding rule configuration structure.
type UpdateOpts ¶
type UpdateOpts struct { // The forward protocol. ForwardProtocol string `json:"forward_protocol" required:"true"` // The forward port. // The valid value is range from 1 to 65535. ForwardPort int `json:"forward_port" required:"true"` // The source port. // The valid value is range from 1 to 65535. SourcePort int `json:"source_port" required:"true"` // The source IP list, separate the IPs with commas. SourceIp string `json:"source_ip" required:"true"` }
UpdateOpts is the structure required by the Update method to update the configurations of the forward rule.