Documentation ¶
Index ¶
- Constants
- func Create(c *gcorecloud.ServiceClient, opts CreateOpts) (r tasks.Result)
- func CreateRule(c *gcorecloud.ServiceClient, policyID string, opts CreateRuleOpts) (r tasks.Result)
- func Delete(c *gcorecloud.ServiceClient, policyID 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 *gcorecloud.ServiceClient, opts ListOptsBuilder) pagination.Pager
- type Action
- type CompareType
- type CreateOpts
- type CreateRuleOpts
- type GetResult
- type L7Policy
- type L7PolicyPage
- type L7PolicyTaskResult
- type ListOpts
- type ListOptsBuilder
- type Rule
- type RulePage
- type RuleTaskResult
- type RuleType
Constants ¶
const ( ActionRedirectToPool Action = "REDIRECT_TO_POOL" ActionRedirectToURL Action = "REDIRECT_TO_URL" ActionReject Action = "REJECT" TypeCookie RuleType = "COOKIE" TypeFileType RuleType = "FILE_TYPE" TypeHeader RuleType = "HEADER" TypeHostName RuleType = "HOST_NAME" TypePath RuleType = "PATH" 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 *gcorecloud.ServiceClient, opts CreateOpts) (r tasks.Result)
func CreateRule ¶
func CreateRule(c *gcorecloud.ServiceClient, policyID string, opts CreateRuleOpts) (r tasks.Result)
func Delete ¶
func Delete(c *gcorecloud.ServiceClient, policyID string) (r tasks.Result)
func ExtractL7PolicesInto ¶
func ExtractL7PolicesInto(r pagination.Page, v interface{}) error
func ExtractRuleInto ¶
func ExtractRuleInto(r pagination.Page, v interface{}) error
func List ¶
func List(c *gcorecloud.ServiceClient, opts ListOptsBuilder) pagination.Pager
Types ¶
type CompareType ¶
type CompareType string
type CreateOpts ¶
type CreateOpts struct { Name string `json:"name,omitempty"` ListenerID string `json:"listener_id" required:"true"` Action Action `json:"action" required:"true"` Position int32 `json:"position,omitempty"` Description string `json:"description,omitempty"` RedirectPoolID string `json:"redirect_pool_id,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 CreateRuleOpts ¶
type CreateRuleOpts struct { CompareType CompareType `json:"compare_type" required:"true"` Invert bool `json:"invert,omitempty"` Key string `json:"key,omitempty"` Type RuleType `json:"type" required:"true"` Value string `json:"value" required:"true"` }
CreateOpts 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 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 *gcorecloud.ServiceClient, id string) (r GetResult)
func GetRule ¶
func GetRule(c *gcorecloud.ServiceClient, plid string, rlid string) (r GetResult)
func (GetResult) Extract ¶
Extract is a function that accepts a result and extracts a l7 policy resource.
func (GetResult) ExtractInto ¶
func (r GetResult) ExtractInto(v interface{}) error
func (GetResult) ExtractRule ¶
Extract is a function that accepts a result and extracts a rule policy resource.
type L7Policy ¶
type L7Policy struct { ID string `json:"id"` Name string `json:"name"` Description string `json:"description"` Action string `json:"action"` ListenerID string `json:"listener_id"` RedirectPoolID string `json:"redirect_pool_id"` Position int32 `json:"position"` ProjectID int32 `json:"project_id"` OperatingStatus string `json:"operating_status"` ProvisioningStatus string `json:"provisioning_status"` CreatedAt gcorecloud.JSONRFC3339Z `json:"created_at"` UpdatedAt *gcorecloud.JSONRFC3339Z `json:"updated_at"` Rules []Rule `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 ListOpts ¶
type ListOpts struct { Name string `q:"name"` ListenerID string `q:"listener_id"` Action string `q:"action"` Position int32 `q:"position"` Description string `q:"description"` RedirectPoolID string `q:"redirect_pool_id"` }
ListOpts allows the filtering and sorting of paginated collections through the API.
func (ListOpts) ToL7PolicesListQuery ¶
ToL7PolicesListQuery formats a ListOpts into a query string.
type ListOptsBuilder ¶
ListOptsBuilder allows extensions to add additional parameters to the List request.
type Rule ¶
type Rule struct { ID string `json:"id"` CompareType string `json:"compare_type"` Invert bool `json:"invert"` Key string `json:"key"` OperatingStatus string `json:"operating_status"` ProvisioningStatus string `json:"provisioning_status"` CreatedAt gcorecloud.JSONRFC3339Z `json:"created_at"` UpdatedAt *gcorecloud.JSONRFC3339Z `json:"updated_at"` Type string `json:"type"` Value string `json:"value"` }
Rule represents layer 7 load balancing rule.
func ExtractRule ¶
func ExtractRule(r pagination.Page) ([]Rule, error)
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"`
}