policies

package
v0.5.14 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2022 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

Types

type Action

type Action string
const (
	ActionRedirectToPool     Action = "REDIRECT_TO_POOL"
	ActionRedirectToListener Action = "REDIRECT_TO_LISTENER"
)

type CreateOpts

type CreateOpts struct {
	// Specifies where requests will be forwarded. The value can be one of the following:
	//
	//    REDIRECT_TO_POOL: Requests will be forwarded to another backend server group.
	//    REDIRECT_TO_LISTENER: Requests will be redirected to an HTTPS listener.
	Action Action `json:"action" required:"true"`

	// Provides supplementary information about the forwarding policy.
	Description string `json:"description,omitempty"`

	// Specifies the ID of the listener to which the forwarding policy is added.
	ListenerID string `json:"listener_id" required:"true"`

	// Specifies the forwarding policy name.
	Name string `json:"name,omitempty"`

	// Specifies the forwarding policy priority. The value cannot be updated.
	Position int `json:"position,omitempty"`

	// Specifies the ID of the project where the forwarding policy is used.
	ProjectID string `json:"project_id,omitempty"`

	// Specifies the ID of the listener to which requests are redirected.
	// This parameter is mandatory when action is set to REDIRECT_TO_LISTENER.
	RedirectListenerID string `json:"redirect_listener_id,omitempty"`

	// Specifies the ID of the backend server group that requests are forwarded to.
	//
	// This parameter is valid and mandatory only when action is set to REDIRECT_TO_POOL.
	// The specified backend server group cannot be the default one associated with the listener,
	// or any backend server group associated with the forwarding policies of other listeners.
	RedirectPoolID string `json:"redirect_pool_id,omitempty"`

	// Lists the forwarding rules in the forwarding policy.
	// The list can contain a maximum of 10 forwarding rules (if conditions is specified, a condition is considered as a rule).
	Rules []Rule `json:"rules,omitempty"`
}

func (CreateOpts) ToPolicyCreateMap

func (opts CreateOpts) ToPolicyCreateMap() (map[string]interface{}, error)

type CreateOptsBuilder

type CreateOptsBuilder interface {
	ToPolicyCreateMap() (map[string]interface{}, error)
}

type CreateResult

type CreateResult struct {
	// contains filtered or unexported fields
}

func Create

func Create(client *golangsdk.ServiceClient, opts CreateOptsBuilder) (r CreateResult)

func (CreateResult) Extract

func (r CreateResult) Extract() (*Policy, error)

type DeleteResult

type DeleteResult struct {
	golangsdk.ErrResult
}

func Delete

func Delete(client *golangsdk.ServiceClient, id string) (r DeleteResult)

type GetResult

type GetResult struct {
	// contains filtered or unexported fields
}

func Get

func Get(client *golangsdk.ServiceClient, id string) (r GetResult)

func (GetResult) Extract

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

type ListOpts

type ListOpts struct {
	Marker             string   `q:"marker"`
	Limit              int      `q:"limit"`
	PageReverse        bool     `q:"page_reverse"`
	ID                 []string `q:"id"`
	Name               []string `q:"name"`
	Description        []string `q:"description"`
	ListenerID         []string `q:"listener_id"`
	Action             []string `q:"action"`
	RedirectPoolID     []string `q:"redirect_pool_id"`
	RedirectListenerID []string `q:"redirect_listener_id"`
	ProvisioningStatus []string `q:"provisioning_status"`
	DisplayAllRules    bool     `q:"display_all_rules"`
}

func (ListOpts) ToPolicyListQuery

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

type ListOptsBuilder

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

type Policy

type Policy struct {
	ID                 string                `json:"id"`
	Action             Action                `json:"action"`
	Description        string                `json:"description"`
	ListenerID         string                `json:"listener_id"`
	Name               string                `json:"name"`
	Position           int                   `json:"position"`
	ProjectID          string                `json:"project_id"`
	Status             string                `json:"provisioning_status"`
	RedirectListenerID string                `json:"redirect_listener_id"`
	RedirectPoolID     string                `json:"redirect_pool_id"`
	Rules              []structs.ResourceRef `json:"rules"`
}

func ExtractPolicies

func ExtractPolicies(p pagination.Page) ([]Policy, error)

type PolicyPage

type PolicyPage struct {
	pagination.PageWithInfo
}

func (PolicyPage) IsEmpty

func (p PolicyPage) IsEmpty() (bool, error)

type Rule

type Rule struct {
	// 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 rules.RuleType `json:"type" required:"true"`

	// Specifies how requests are matched with the domain name or URL.
	//
	// If type is set to HOST_NAME, this parameter can only be set to EQUAL_TO (exact match).
	//
	// If type is set to PATH, this parameter can be set to REGEX (regular expression match), STARTS_WITH (prefix match), or EQUAL_TO (exact match).
	CompareType rules.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"`
}

type UpdateOpts

type UpdateOpts struct {
	Name               *string `json:"name,omitempty"`
	Description        *string `json:"description,omitempty"`
	RedirectListenerID string  `json:"redirect_listener_id,omitempty"`
	RedirectPoolID     string  `json:"redirect_pool_id,omitempty"`
	Rules              []Rule  `json:"rules,omitempty"`
}

func (UpdateOpts) ToPolicyUpdateMap

func (opts UpdateOpts) ToPolicyUpdateMap() (map[string]interface{}, error)

type UpdateOptsBuilder

type UpdateOptsBuilder interface {
	ToPolicyUpdateMap() (map[string]interface{}, error)
}

type UpdateResult

type UpdateResult struct {
	// contains filtered or unexported fields
}

func Update

func Update(client *golangsdk.ServiceClient, id string, opts UpdateOptsBuilder) (r UpdateResult)

func (UpdateResult) Extract

func (r UpdateResult) Extract() (*Policy, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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