Documentation ¶
Index ¶
- Constants
- func List(client *golangsdk.ServiceClient, policyID string, opts ListOptsBuilder) pagination.Pager
- type CompareType
- type Condition
- type CreateOpts
- type CreateOptsBuilder
- type CreateResult
- type DeleteResult
- type ForwardingRule
- type GetResult
- type ListOpts
- type ListOptsBuilder
- type RulePage
- type RuleType
- type UpdateOpts
- type UpdateOptsBuilder
- type UpdateResult
Constants ¶
View Source
const ( HostName RuleType = "HOST_NAME" Path RuleType = "PATH" EqualTo CompareType = "EQUAL_TO" Regex CompareType = "REGEX" StartsWith CompareType = "STARTS_WITH" )
Variables ¶
This section is empty.
Functions ¶
func List ¶
func List(client *golangsdk.ServiceClient, policyID string, opts ListOptsBuilder) pagination.Pager
Types ¶
type CompareType ¶
type CompareType string
type CreateOpts ¶
type CreateOpts struct { // Specifies the conditions contained in a forwarding rule. // This parameter will take effect when enhance_l7policy_enable is set to true. // If conditions is specified, key and value will not take effect, // and the value of this parameter will contain all conditions configured for the forwarding rule. // The keys in the list must be the same, whereas each value must be unique. Conditions []Condition `json:"conditions,omitempty"` // Specifies the match content. The value can be one of the following: // // HOST_NAME: A domain name will be used for matching. // PATH: A URL will be used for matching. // If type is set to HOST_NAME, PATH, METHOD, or SOURCE_IP, only one forwarding rule can be created for each type. Type RuleType `json:"type" required:"true"` // Specifies how requests are matched and forwarded. // // If type is set to HOST_NAME, this parameter can only be set to EQUAL_TO. Asterisks (*) can be used as wildcard characters. // If type is set to PATH, this parameter can be set to REGEX, STARTS_WITH, or EQUAL_TO. CompareType CompareType `json:"compare_type" required:"true"` // Specifies the value of the match item. For example, if a domain name is used for matching, value is the domain name. // // If type is set to HOST_NAME, the value can contain letters, digits, hyphens (-), and periods (.) and must // start with a letter or digit. If you want to use a wildcard domain name, enter an asterisk (*) as the leftmost // label of the domain name. // // If type is set to PATH and compare_type to STARTS_WITH or EQUAL_TO, the value must start with a slash (/) and // can contain only letters, digits, and special characters _~';@^-%#&$.*+?,=!:|/()[]{} Value string `json:"value" required:"true"` // Specifies the project ID. ProjectID string `json:"project_id,omitempty"` }
func (CreateOpts) ToRuleCreateMap ¶
func (opts CreateOpts) ToRuleCreateMap() (map[string]interface{}, error)
type CreateOptsBuilder ¶
type CreateResult ¶
type CreateResult struct {
// contains filtered or unexported fields
}
func Create ¶
func Create(client *golangsdk.ServiceClient, policyID string, opts CreateOptsBuilder) (r CreateResult)
func (CreateResult) Extract ¶
func (r CreateResult) Extract() (*ForwardingRule, error)
type DeleteResult ¶
func Delete ¶
func Delete(client *golangsdk.ServiceClient, policyID, id string) (r DeleteResult)
type ForwardingRule ¶
type ForwardingRule struct { ID string `json:"id"` Type RuleType `json:"type"` CompareType CompareType `json:"compare_type"` Value string `json:"value"` ProjectID string `json:"project_id"` Conditions []Condition `json:"conditions"` }
func ExtractRules ¶
func ExtractRules(p pagination.Page) ([]ForwardingRule, error)
type GetResult ¶
type GetResult struct {
// contains filtered or unexported fields
}
func (GetResult) Extract ¶
func (r GetResult) Extract() (*ForwardingRule, error)
type ListOptsBuilder ¶
type RulePage ¶
type RulePage struct {
pagination.PageWithInfo
}
type UpdateOpts ¶
type UpdateOpts struct { CompareType CompareType `json:"compare_type,omitempty"` Value string `json:"value,omitempty"` Conditions []Condition `json:"conditions,omitempty"` }
func (UpdateOpts) ToUpdateRuleMap ¶
func (opts UpdateOpts) ToUpdateRuleMap() (map[string]interface{}, error)
type UpdateOptsBuilder ¶
type UpdateResult ¶
type UpdateResult struct {
// contains filtered or unexported fields
}
func Update ¶
func Update(client *golangsdk.ServiceClient, policyID, id string, opts UpdateOptsBuilder) (r UpdateResult)
func (UpdateResult) Extract ¶
func (r UpdateResult) Extract() (*ForwardingRule, error)
Click to show internal directories.
Click to hide internal directories.