Documentation ¶
Index ¶
- Constants
- func Create(c *edgecloud.ServiceClient, opts CreateOptsBuilder) (r tasks.Result)
- func CreateRule(c *edgecloud.ServiceClient, policyID string, opts CreateRuleOptsBuilder) (r tasks.Result)
- func Delete(c *edgecloud.ServiceClient, policyID string) (r tasks.Result)
- func DeleteRule(c *edgecloud.ServiceClient, policyID, ruleID string) (r tasks.Result)
- func ExtractL7PolicesInto(r pagination.Page, v interface{}) error
- func ExtractL7PolicyIDFromTask(task *tasks.Task) (string, error)
- func ExtractRuleIDFromTask(task *tasks.Task) (string, error)
- func ExtractRuleInto(r pagination.Page, v interface{}) error
- func List(c *edgecloud.ServiceClient) pagination.Pager
- func ListRule(c *edgecloud.ServiceClient, policyID string) pagination.Pager
- func Replace(c *edgecloud.ServiceClient, policyID string, opts ReplaceOptsBuilder) (r tasks.Result)
- func ReplaceRule(c *edgecloud.ServiceClient, policyID, ruleID string, ...) (r tasks.Result)
- type Action
- type CompareType
- func (ct CompareType) IsValid() error
- func (ct CompareType) List() []CompareType
- func (ct *CompareType) MarshalJSON() ([]byte, error)
- func (ct CompareType) String() string
- func (ct CompareType) StringList() []string
- func (ct *CompareType) UnmarshalJSON(data []byte) error
- func (ct CompareType) ValidOrNil() (*CompareType, error)
- type CreateOpts
- type CreateOptsBuilder
- type CreateRuleOpts
- type CreateRuleOptsBuilder
- type GetResult
- type GetRuleResult
- type L7Policy
- type L7PolicyPage
- type L7PolicyTaskResult
- type L7Rule
- type ReplaceOpts
- type ReplaceOptsBuilder
- type RulePage
- type RuleTaskResult
- type RuleType
- func (rt RuleType) IsValid() error
- func (rt RuleType) List() []RuleType
- func (rt *RuleType) MarshalJSON() ([]byte, error)
- func (rt RuleType) String() string
- func (rt RuleType) StringList() []string
- func (rt *RuleType) UnmarshalJSON(data []byte) error
- func (rt RuleType) ValidOrNil() (*RuleType, error)
Constants ¶
const ( ActionRedirectToPool Action = "REDIRECT_TO_POOL" ActionRedirectToURL Action = "REDIRECT_TO_URL" ActionRedirectPrefix Action = "REDIRECT_PREFIX" ActionReject Action = "REJECT" TypeCookie RuleType = "COOKIE" TypeFileType RuleType = "FILE_TYPE" TypeHeader RuleType = "HEADER" TypeHostName RuleType = "HOST_NAME" TypePath RuleType = "PATH" TypeSSLConnHasCert RuleType = "SSL_CONN_HAS_CERT" TypeSSLVerifyResult RuleType = "SSL_VERIFY_RESULT" TypeSSLDNField RuleType = "SSL_DN_FIELD" CompareTypeContains CompareType = "CONTAINS" CompareTypeEndWith CompareType = "ENDS_WITH" CompareTypeEqual CompareType = "EQUAL_TO" CompareTypeRegex CompareType = "REGEX" CompareTypeStartWith CompareType = "STARTS_WITH" )
Variables ¶
This section is empty.
Functions ¶
func Create ¶
func Create(c *edgecloud.ServiceClient, opts CreateOptsBuilder) (r tasks.Result)
Create accepts a CreateOpts struct and creates a new policy using the values provided.
func CreateRule ¶
func CreateRule(c *edgecloud.ServiceClient, policyID string, opts CreateRuleOptsBuilder) (r tasks.Result)
CreateRule accepts a policy id and CreateRuleOpts struct and creates a new rule using the values provided.
func Delete ¶
func Delete(c *edgecloud.ServiceClient, policyID string) (r tasks.Result)
Delete accepts a policy id and delete existing policy.
func DeleteRule ¶
func DeleteRule(c *edgecloud.ServiceClient, policyID, ruleID string) (r tasks.Result)
DeleteRule accepts a policy id, rule id and delete existing rule.
func ExtractL7PolicesInto ¶
func ExtractL7PolicesInto(r pagination.Page, v interface{}) error
func ExtractRuleInto ¶
func ExtractRuleInto(r pagination.Page, v interface{}) error
func ListRule ¶
func ListRule(c *edgecloud.ServiceClient, policyID string) pagination.Pager
ListRule accept a policy id and retrieves list of rules.
func Replace ¶
func Replace(c *edgecloud.ServiceClient, policyID string, opts ReplaceOptsBuilder) (r tasks.Result)
Replace accepts a ReplaceOpts struct and policy id and replaced an existing policy using the values provided.
func ReplaceRule ¶
func ReplaceRule(c *edgecloud.ServiceClient, policyID, ruleID string, opts CreateRuleOptsBuilder) (r tasks.Result)
ReplaceRule accepts a CreateRuleOpts struct, rule id and policy id and replaced an existing rule using the values provided.
Types ¶
type Action ¶
type Action string
func (*Action) MarshalJSON ¶
MarshalJSON - implements Marshaler interface.
func (Action) StringList ¶
func (*Action) UnmarshalJSON ¶
UnmarshalJSON - implements Unmarshaler interface.
func (Action) ValidOrNil ¶
type CompareType ¶
type CompareType string
func (CompareType) IsValid ¶
func (ct CompareType) IsValid() error
func (CompareType) List ¶
func (ct CompareType) List() []CompareType
func (*CompareType) MarshalJSON ¶
func (ct *CompareType) MarshalJSON() ([]byte, error)
MarshalJSON - implements Marshaler interface.
func (CompareType) String ¶
func (ct CompareType) String() string
func (CompareType) StringList ¶
func (ct CompareType) StringList() []string
func (*CompareType) UnmarshalJSON ¶
func (ct *CompareType) UnmarshalJSON(data []byte) error
UnmarshalJSON - implements Unmarshaler interface.
func (CompareType) ValidOrNil ¶
func (ct CompareType) ValidOrNil() (*CompareType, error)
type CreateOpts ¶
type CreateOpts struct { Name string `json:"name,omitempty"` ListenerID string `json:"listener_id" required:"true" validate:"required,uuid"` Action Action `json:"action" required:"true" validate:"required,enum"` Position int32 `json:"position,omitempty" validate:"gt=-1,omitempty"` RedirectHTTPCode int `json:"redirect_http_code,omitempty"` RedirectPoolID string `json:"redirect_pool_id,omitempty" validate:"rfe=Action:REDIRECT_TO_POOL"` RedirectPrefix string `json:"redirect_prefix,omitempty" validate:"rfe=Action:REDIRECT_PREFIX"` RedirectURL string `json:"redirect_url,omitempty" validate:"rfe=Action:REDIRECT_TO_URL"` Tags []string `json:"tags,omitempty"` }
CreateOpts represents options used to create a l7 policy.
func (CreateOpts) ToL7PolicyCreateMap ¶
func (opts CreateOpts) ToL7PolicyCreateMap() (map[string]interface{}, error)
ToL7PolicyCreateMap builds a request body from CreateOpts.
type CreateOptsBuilder ¶
CreateOptsBuilder allows extensions to add additional parameters to the Create request.
type CreateRuleOpts ¶
type CreateRuleOpts struct { CompareType CompareType `json:"compare_type" required:"true" validate:"required,enum"` Invert bool `json:"invert"` Key string `json:"key,omitempty"` Type RuleType `json:"type" required:"true" validate:"required,enum"` Value string `json:"value" required:"true"` Tags []string `json:"tags,omitempty"` }
CreateRuleOpts represents options used to create a rule for policy.
func (CreateRuleOpts) ToRuleCreateMap ¶
func (opts CreateRuleOpts) ToRuleCreateMap() (map[string]interface{}, error)
ToRuleCreateMap builds a request body from CreateRuleOpts.
type CreateRuleOptsBuilder ¶
CreateOptsBuilder allows extensions to add additional parameters to the Create request.
type GetResult ¶
type GetResult struct {
// contains filtered or unexported fields
}
GetResult represents the result of a get operation. Call its Extract method to interpret it as a L7Policy.
func Get ¶
func Get(c *edgecloud.ServiceClient, policyID string) (r GetResult)
Get retrieves a specific policy based on its unique ID.
func (GetResult) Extract ¶
Extract is a function that accepts a result and extracts a l7 policy resource.
func (GetResult) ExtractRule ¶
Extract is a function that accepts a result and extracts a rule policy resource.
type GetRuleResult ¶
type GetRuleResult struct {
// contains filtered or unexported fields
}
GetRuleResult represents the result of a get operation. Call its Extract method to interpret it as a L7Rule.
func GetRule ¶
func GetRule(c *edgecloud.ServiceClient, plid string, rlid string) (r GetRuleResult)
GetRule retrieves a specific policy based on its policy id and rule unique ID.
func (GetRuleResult) Extract ¶
Extract is a function that accepts a result and extracts a l7 rule resource.
func (GetRuleResult) ExtractInto ¶
func (r GetRuleResult) ExtractInto(v interface{}) error
type L7Policy ¶
type L7Policy struct { ID string `json:"id"` Name string `json:"name"` Action Action `json:"action"` ListenerID string `json:"listener_id"` RedirectPoolID string `json:"redirect_pool_id"` Position int32 `json:"position"` ProjectID int32 `json:"project_id"` RegionID int `json:"region_id"` Region string `json:"region"` OperatingStatus string `json:"operating_status"` ProvisioningStatus string `json:"provisioning_status"` RedirectHTTPCode *int `json:"redirect_http_code"` RedirectPrefix *string `json:"redirect_prefix"` RedirectURL *string `json:"redirect_url"` Tags []string `json:"tags"` CreatedAt edgecloud.JSONRFC3339Z `json:"created_at"` UpdatedAt *edgecloud.JSONRFC3339Z `json:"updated_at"` Rules []L7Rule `json:"rules"` }
L7Policy represents a policy structure.
func ExtractL7Polices ¶
func ExtractL7Polices(r pagination.Page) ([]L7Policy, error)
type L7PolicyPage ¶
type L7PolicyPage struct {
pagination.LinkedPageBase
}
L7PolicyPage is the page returned by a pager when traversing over a collection of l7polices.
func (L7PolicyPage) IsEmpty ¶
func (r L7PolicyPage) IsEmpty() (bool, error)
IsEmpty checks whether a L7PolicyPage struct is empty.
func (L7PolicyPage) NextPageURL ¶
func (r L7PolicyPage) NextPageURL() (string, error)
type L7PolicyTaskResult ¶
type L7PolicyTaskResult struct {
L7Polices []string `json:"l7polices"`
}
type L7Rule ¶
type L7Rule struct { ID string `json:"id"` CompareType CompareType `json:"compare_type"` Invert bool `json:"invert"` Key *string `json:"key"` OperatingStatus string `json:"operating_status"` ProvisioningStatus string `json:"provisioning_status"` CreatedAt edgecloud.JSONRFC3339Z `json:"created_at"` UpdatedAt *edgecloud.JSONRFC3339Z `json:"updated_at"` Type RuleType `json:"type"` Value string `json:"value"` Tags []string `json:"tags"` ProjectID int `json:"project_id"` RegionID int `json:"region_id"` Region string `json:"region"` }
L7Rule represents layer 7 load balancing rule.
func ExtractL7Rules ¶
func ExtractL7Rules(r pagination.Page) ([]L7Rule, error)
func ListAllRule ¶
func ListAllRule(c *edgecloud.ServiceClient, policyID string) ([]L7Rule, error)
ListAllRule accept a policy id and retrieves list of rules.
type ReplaceOpts ¶
type ReplaceOpts struct { Name string `json:"name,omitempty"` Action Action `json:"action" required:"true" validate:"required,enum"` Position int32 `json:"position,omitempty" validate:"gt=-1,omitempty"` RedirectHTTPCode int `json:"redirect_http_code,omitempty"` RedirectPoolID string `json:"redirect_pool_id,omitempty" validate:"rfe=Action:REDIRECT_TO_POOL"` RedirectPrefix string `json:"redirect_prefix,omitempty" validate:"rfe=Action:REDIRECT_PREFIX"` RedirectURL string `json:"redirect_url,omitempty" validate:"rfe=Action:REDIRECT_TO_URL"` Tags []string `json:"tags,omitempty"` }
ReplaceOpts represents options used to replace a l7 policy.
func (ReplaceOpts) ToL7PolicyReplaceMap ¶
func (opts ReplaceOpts) ToL7PolicyReplaceMap() (map[string]interface{}, error)
ToL7PolicyReplaceMap builds a request body from ReplaceOpts.
type ReplaceOptsBuilder ¶
ReplaceOptsBuilder allows extensions to add additional parameters to the Replace request.
type RulePage ¶
type RulePage struct {
pagination.LinkedPageBase
}
L7PolicyPage is the page returned by a pager when traversing over a collection of l7polices.
func (RulePage) NextPageURL ¶
type RuleTaskResult ¶
type RuleTaskResult struct {
L7Rules []string `json:"l7rules"`
}
type RuleType ¶
type RuleType string
func (*RuleType) MarshalJSON ¶
MarshalJSON - implements Marshaler interface.
func (RuleType) StringList ¶
func (*RuleType) UnmarshalJSON ¶
UnmarshalJSON - implements Unmarshaler interface.