| 1 |
package slb |
| 2 |
|
| 3 |
import "github.com/denverdino/aliyungo/common" |
| 4 |
|
| 5 |
type CreateRulesResponse struct { |
| 6 |
common.Response |
| 7 |
} |
| 8 |
|
| 9 |
type CreateRulesArgs struct { |
| 10 |
RegionId common.Region |
| 11 |
LoadBalancerId string |
| 12 |
ListenerPort int |
| 13 |
RuleList string |
| 14 |
} |
| 15 |
|
| 16 |
type Rule struct { |
| 17 |
RuleId string |
| 18 |
RuleName string |
| 19 |
Domain string |
| 20 |
Url string `json:",omitempty"` |
| 21 |
VServerGroupId string |
| 22 |
} |
| 23 |
|
| 24 |
type Rules struct { |
| 25 |
Rule []Rule |
| 26 |
} |
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
func (client *Client) CreateRules(args *CreateRulesArgs) error { |
| 32 |
response := CreateRulesResponse{} |
| 33 |
err := client.Invoke("CreateRules", args, &response) |
| 34 |
if err != nil { |
| 35 |
return err |
| 36 |
} |
| 37 |
return err |
| 38 |
} |
| 39 |
|
| 40 |
type DeleteRulesArgs struct { |
| 41 |
RegionId common.Region |
| 42 |
RuleIds string |
| 43 |
} |
| 44 |
|
| 45 |
type DeleteRulesResponse struct { |
| 46 |
common.Response |
| 47 |
} |
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
func (client *Client) DeleteRules(args *DeleteRulesArgs) error { |
| 53 |
response := DeleteRulesResponse{} |
| 54 |
err := client.Invoke("DeleteRules", args, &response) |
| 55 |
if err != nil { |
| 56 |
return err |
| 57 |
} |
| 58 |
return err |
| 59 |
} |
| 60 |
|
| 61 |
type SetRuleArgs struct { |
| 62 |
RegionId common.Region |
| 63 |
RuleId string |
| 64 |
VServerGroupId string |
| 65 |
} |
| 66 |
|
| 67 |
type SetRuleResponse struct { |
| 68 |
common.Response |
| 69 |
} |
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
func (client *Client) SetRule(args *SetRuleArgs) error { |
| 75 |
response := SetRuleResponse{} |
| 76 |
err := client.Invoke("SetRule", args, &response) |
| 77 |
if err != nil { |
| 78 |
return err |
| 79 |
} |
| 80 |
return err |
| 81 |
} |
| 82 |
|
| 83 |
type DescribeRuleAttributeArgs struct { |
| 84 |
RegionId common.Region |
| 85 |
RuleId string |
| 86 |
} |
| 87 |
|
| 88 |
type DescribeRuleAttributeResponse struct { |
| 89 |
common.Response |
| 90 |
LoadBalancerId string |
| 91 |
ListenerPort int |
| 92 |
Rule |
| 93 |
} |
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
|
| 98 |
func (client *Client) DescribeRuleAttribute(args *DescribeRuleAttributeArgs) (*DescribeRuleAttributeResponse, error) { |
| 99 |
response := &DescribeRuleAttributeResponse{} |
| 100 |
err := client.Invoke("DescribeRuleAttribute", args, response) |
| 101 |
if err != nil { |
| 102 |
return nil, err |
| 103 |
} |
| 104 |
return response, nil |
| 105 |
} |
| 106 |
|
| 107 |
type DescribeRulesArgs struct { |
| 108 |
RegionId common.Region |
| 109 |
LoadBalancerId string |
| 110 |
ListenerPort int |
| 111 |
} |
| 112 |
|
| 113 |
type DescribeRulesResponse struct { |
| 114 |
common.Response |
| 115 |
Rules struct { |
| 116 |
Rule []Rule |
| 117 |
} |
| 118 |
} |
| 119 |
|
| 120 |
|
| 121 |
|
| 122 |
|
| 123 |
func (client *Client) DescribeRules(args *DescribeRulesArgs) (*DescribeRulesResponse, error) { |
| 124 |
response := &DescribeRulesResponse{} |
| 125 |
err := client.Invoke("DescribeRules", args, response) |
| 126 |
if err != nil { |
| 127 |
return nil, err |
| 128 |
} |
| 129 |
return response, nil |
| 130 |
} |