l7policies

package
v0.3.41 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 16, 2021 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
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 ExtractL7PolicyIDFromTask

func ExtractL7PolicyIDFromTask(task *tasks.Task) (string, error)

func ExtractRuleIDFromTask

func ExtractRuleIDFromTask(task *tasks.Task) (string, error)

func ExtractRuleInto

func ExtractRuleInto(r pagination.Page, v interface{}) error

Types

type Action

type Action string

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

func (r GetResult) Extract() (*L7Policy, error)

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

func (r GetResult) ExtractRule() (*Rule, error)

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

func (opts ListOpts) ToL7PolicesListQuery() (string, error)

ToL7PolicesListQuery formats a ListOpts into a query string.

type ListOptsBuilder

type ListOptsBuilder interface {
	ToL7PolicesListQuery() (string, error)
}

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) IsEmpty

func (r RulePage) IsEmpty() (bool, error)

IsEmpty checks whether a RulePage struct is empty.

func (RulePage) NextPageURL

func (r RulePage) NextPageURL() (string, error)

type RuleTaskResult

type RuleTaskResult struct {
	L7Rules []string `json:"l7rules"`
}

type RuleType

type RuleType string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL