l7policies

package
v0.0.0-...-25154fd Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2025 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ActionRedirectToPool     Action = "REDIRECT_TO_POOL"
	ActionRedirectToListener Action = "REDIRECT_TO_LISTENER"
	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 List

List returns a Pager which allows you to iterate over a collection of l7policies. It accepts a ListOpts struct, which allows you to filter and sort the returned collection for greater efficiency.

Default policy settings return only those l7policies that are owned by the project who submits the request, unless an admin user submits the request.

func ListRules

func ListRules(c *golangsdk.ServiceClient, policyID string, opts ListRulesOptsBuilder) pagination.Pager

ListRules returns a Pager which allows you to iterate over a collection of rules. It accepts a ListRulesOptsBuilder, which allows you to filter and sort the returned collection for greater efficiency.

Default policy settings return only those rules that are owned by the project who submits the request, unless an admin user submits the request.

Types

type Action

type Action string

type CompareType

type CompareType string

type Condition

type Condition struct {
	// The key of the match item.
	Key string `json:"key,omitempty"`

	// The value of the match item.
	Value string `json:"value" required:"true"`
}

type CreateOpts

type CreateOpts struct {
	// Name of the L7 policy.
	Name string `json:"name,omitempty"`

	// The ID of the listener.
	ListenerID string `json:"listener_id" required:"true"`

	// The L7 policy action. One of REDIRECT_TO_POOL, REDIRECT_TO_URL, or REJECT.
	Action Action `json:"action" required:"true"`

	// The position of this policy on the listener.
	Position int32 `json:"position,omitempty"`

	// The priority of this policy on the listener.
	Priority int32 `json:"priority,omitempty"`

	// A human-readable description for the resource.
	Description string `json:"description,omitempty"`

	// Requests matching this policy will be redirected to the pool with this ID.
	// Only valid if action is REDIRECT_TO_POOL.
	RedirectPoolID string `json:"redirect_pool_id,omitempty"`

	// Requests matching this policy will be redirected to this Listener.
	// Only valid if action is REDIRECT_TO_LISTENER.
	RedirectListenerID string `json:"redirect_listener_id,omitempty"`

	// Requests matching this policy will be redirected to the URL.
	// Only valid if action is REDIRECT_TO_URL.
	RedirectUrlConfig *RedirectUrlConfig `json:"redirect_url_config,omitempty"`

	// Requests matching this policy will be redirected to the configuration of the page.
	// Only valid if action is FIXED_RESPONSE.
	FixedResponseConfig *FixedResponseConfig `json:"fixed_response_config,omitempty"`

	// Requests matching this policy will be redirected to the multiple pools. 5 at most
	// Only valid if action is REDIRECT_TO_POOL.
	RedirectPoolsConfig []*RedirectPoolsConfig `json:"redirect_pools_config,omitempty"`

	// Config session persistence between pools that associated with the policy.
	// Only valid if action is REDIRECT_TO_POOL.
	RedirectPoolsStickySessionConfig *RedirectPoolsStickySessionConfig `json:"redirect_pools_sticky_session_config,omitempty"`

	// The config of the redirected pool.
	// Only valid if action is REDIRECT_TO_POOL.
	RedirectPoolsExtendConfig *RedirectPoolsExtendConfig `json:"redirect_pools_extend_config,omitempty"`

	// The administrative state of the Loadbalancer. A valid value is true (UP)
	// or false (DOWN).
	AdminStateUp *bool `json:"admin_state_up,omitempty"`
}

CreateOpts is the common options struct used in this package's Create operation.

func (CreateOpts) ToL7PolicyCreateMap

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

ToL7PolicyCreateMap builds a request body from CreateOpts.

type CreateOptsBuilder

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

CreateOptsBuilder allows extensions to add additional parameters to the Create request.

type CreateResult

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

CreateResult represents the result of a Create operation. Call its Extract method to interpret the result as a L7Policy.

func Create

Create accepts a CreateOpts struct and uses the values to create a new l7policy.

func (CreateResult) Extract

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

Extract is a function that accepts a result and extracts a l7policy.

type CreateRuleOpts

type CreateRuleOpts struct {
	// The L7 rule type. One of HOST_NAME, PATH, METHOD, HEADER, QUERY_STRING, or SOURCE_IP.
	RuleType RuleType `json:"type" required:"true"`

	// The comparison type for the L7 rule. One of EQUAL_TO, REGEX, or STARTS_WITH.
	CompareType CompareType `json:"compare_type" required:"true"`

	// The value to use for the comparison.
	Value string `json:"value,omitempty"`

	// TenantID is the UUID of the tenant who owns the rule in octavia.
	// Only administrative users can specify a project UUID other than their own.
	TenantID string `json:"tenant_id,omitempty"`

	// The key to use for the comparison. For example, the name of the cookie to evaluate.
	Key string `json:"key,omitempty"`

	// When true the logic of the rule is inverted. For example, with invert true,
	// equal to would become not equal to. Default is false.
	Invert bool `json:"invert,omitempty"`

	// The administrative state of the Loadbalancer. A valid value is true (UP)
	// or false (DOWN).
	AdminStateUp *bool `json:"admin_state_up,omitempty"`

	// The matching conditions of the forwarding rule.
	// This parameter is available only when enhance_l7policy_enable of the listener is set to true.
	Conditions []Condition `json:"conditions,omitempty"`
}

CreateRuleOpts is the common options struct used in this package's CreateRule operation.

func (CreateRuleOpts) ToRuleCreateMap

func (opts CreateRuleOpts) ToRuleCreateMap() (map[string]interface{}, error)

ToRuleCreateMap builds a request body from CreateRuleOpts.

type CreateRuleResult

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

CreateRuleResult represents the result of a CreateRule operation. Call its Extract method to interpret it as a Rule.

func CreateRule

func CreateRule(c *golangsdk.ServiceClient, policyID string, opts CreateRuleOpts) (r CreateRuleResult)

CreateRule will create and associate a Rule with a particular L7Policy.

func (CreateRuleResult) Extract

func (r CreateRuleResult) Extract() (*Rule, error)

Extract is a function that accepts a result and extracts a rule.

type DeleteResult

type DeleteResult struct {
	golangsdk.ErrResult
}

DeleteResult represents the result of a Delete operation. Call its ExtractErr method to determine if the request succeeded or failed.

func Delete

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

Delete will permanently delete a particular l7policy based on its unique ID.

type DeleteRuleResult

type DeleteRuleResult struct {
	golangsdk.ErrResult
}

DeleteRuleResult represents the result of a DeleteRule operation. Call its ExtractErr method to determine if the request succeeded or failed.

func DeleteRule

func DeleteRule(c *golangsdk.ServiceClient, policyID string, ruleID string) (r DeleteRuleResult)

DeleteRule will remove a Rule from a particular L7Policy.

type FixedResponseConfig

type FixedResponseConfig struct {
	// The fixed HTTP status code configured in the forwarding rule.
	StatusCode string `json:"status_code" required:"true"`

	// The format of the response body.
	ContentType string `json:"content_type,omitempty"`

	// The content of the response message body.
	MessageBody string `json:"message_body"`

	// The list of request header parameters to be added
	InsertHeadersConfig *InsertHeadersConfig `json:"insert_headers_config,omitempty"`

	// The list of request header parameters to be removed
	RemoveHeadersConfig *RemoveHeadersConfig `json:"remove_headers_config,omitempty"`

	// The limit config of the policy
	TrafficLimitConfig *TrafficLimitConfig `json:"traffic_limit_config,omitempty"`
}

type GetResult

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

GetResult represents the result of a Get operation. Call its Extract method to interpret the result as a L7Policy.

func Get

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

Get retrieves a particular l7policy based on its unique ID.

func (GetResult) Extract

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

Extract is a function that accepts a result and extracts a l7policy.

type GetRuleResult

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

GetRuleResult represents the result of a GetRule operation. Call its Extract method to interpret it as a Rule.

func GetRule

func GetRule(c *golangsdk.ServiceClient, policyID string, ruleID string) (r GetRuleResult)

GetRule retrieves a particular L7Policy Rule based on its unique ID.

func (GetRuleResult) Extract

func (r GetRuleResult) Extract() (*Rule, error)

Extract is a function that accepts a result and extracts a rule.

type InsertHeaderConfig

type InsertHeaderConfig struct {
	// The parameter name of the added request header
	Key string `json:"key" required:"true"`

	// The value type of the parameter
	ValueType string `json:"value_type" required:"true"`

	// The value of the parameter
	Value string `json:"value" required:"true"`
}

type InsertHeadersConfig

type InsertHeadersConfig struct {
	// The list of request header parameters to be added
	Configs []*InsertHeaderConfig `json:"configs" required:"true"`
}

type L7Policy

type L7Policy struct {
	// The unique ID for the L7 policy.
	ID string `json:"id"`

	// Name of the L7 policy.
	Name string `json:"name"`

	// The ID of the listener.
	ListenerID string `json:"listener_id"`

	// The L7 policy action. One of REDIRECT_TO_POOL, REDIRECT_TO_URL, or REJECT.
	Action string `json:"action"`

	// The position of this policy on the listener.
	Position int32 `json:"position"`

	// The priority of this policy on the listener.
	Priority int32 `json:"priority"`

	// A human-readable description for the resource.
	Description string `json:"description"`

	// TenantID is the UUID of the tenant who owns the L7 policy in octavia.
	// Only administrative users can specify a project UUID other than their own.
	TenantID string `json:"tenant_id"`

	// Requests matching this policy will be redirected to the pool with this ID.
	// Only valid if action is REDIRECT_TO_POOL.
	RedirectPoolID string `json:"redirect_pool_id"`

	// Requests matching this policy will be redirected to this Listener.
	// Only valid if action is REDIRECT_TO_LISTENER.
	RedirectListenerID string `json:"redirect_listener_id"`

	// Requests matching this policy will be redirected to the URL.
	// Only valid if action is REDIRECT_TO_URL.
	RedirectUrlConfig *RedirectUrlConfig `json:"redirect_url_config"`

	// Requests matching this policy will be redirected to the configuration of the page.
	// Only valid if action is FIXED_RESPONSE.
	FixedResponseConfig *FixedResponseConfig `json:"fixed_response_config"`

	// The config of the redirected pool.
	// Only valid if action is REDIRECT_TO_POOL.
	RedirectPoolsConfig []*RedirectPoolsConfig `json:"redirect_pools_config"`

	// The config of the redirected pool.
	// Only valid if action is REDIRECT_TO_POOL.
	RedirectPoolsStickySessionConfig *RedirectPoolsStickySessionConfig `json:"redirect_pools_sticky_session_config"`

	// The config of the redirected pool.
	// Only valid if action is REDIRECT_TO_POOL.
	RedirectPoolsExtendConfig *RedirectPoolsExtendConfig `json:"redirect_pools_extend_config"`

	// The administrative state of the L7 policy, which is up (true) or down (false).
	AdminStateUp bool `json:"admin_state_up"`

	// The provisioning status of the L7 policy.
	// This value is ACTIVE, PENDING_* or ERROR.
	// This field seems to only be returned during a call to a load balancer's /status
	// see: https://github.com/gophercloud/gophercloud/issues/1362
	ProvisioningStatus string `json:"provisioning_status"`

	// The operating status of the L7 policy.
	// This field seems to only be returned during a call to a load balancer's /status
	// see: https://github.com/gophercloud/gophercloud/issues/1362
	OperatingStatus string `json:"operating_status"`

	// Rules are List of associated L7 rule IDs.
	Rules []Rule `json:"rules"`

	// The create time.
	CreatedAt string `json:"created_at"`

	// The update time.
	UpdatedAt string `json:"updated_at"`
}

L7Policy is a collection of L7 rules associated with a Listener, and which may also have an association to a back-end pool.

func ExtractL7Policies

func ExtractL7Policies(r pagination.Page) ([]L7Policy, error)

ExtractL7Policies accepts a Page struct, specifically a L7PolicyPage struct, and extracts the elements into a slice of L7Policy structs. In other words, a generic collection is mapped into a relevant slice.

type L7PolicyPage

type L7PolicyPage struct {
	pagination.LinkedPageBase
}

L7PolicyPage is the page returned by a pager when traversing over a collection of l7policies.

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)

NextPageURL is invoked when a paginated collection of l7policies has reached the end of a page and the pager seeks to traverse over a new one. In order to do this, it needs to construct the next page's URL.

type ListOpts

type ListOpts struct {
	Name               string `q:"name"`
	Description        string `q:"description"`
	ListenerID         string `q:"listener_id"`
	Action             string `q:"action"`
	TenantID           string `q:"tenant_id"`
	RedirectPoolID     string `q:"redirect_pool_id"`
	RedirectListenerID string `q:"redirect_listener_id"`
	Position           int32  `q:"position"`
	AdminStateUp       bool   `q:"admin_state_up"`
	ID                 string `q:"id"`
	Limit              int    `q:"limit"`
	Marker             string `q:"marker"`
	SortKey            string `q:"sort_key"`
	SortDir            string `q:"sort_dir"`
}

ListOpts allows the filtering and sorting of paginated collections through the API.

func (ListOpts) ToL7PolicyListQuery

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

ToL7PolicyListQuery formats a ListOpts into a query string.

type ListOptsBuilder

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

ListOptsBuilder allows extensions to add additional parameters to the List request.

type ListRulesOpts

type ListRulesOpts struct {
	RuleType     RuleType    `q:"type"`
	TenantID     string      `q:"tenant_id"`
	CompareType  CompareType `q:"compare_type"`
	Value        string      `q:"value"`
	Key          string      `q:"key"`
	Invert       bool        `q:"invert"`
	AdminStateUp bool        `q:"admin_state_up"`
	ID           string      `q:"id"`
	Limit        int         `q:"limit"`
	Marker       string      `q:"marker"`
	SortKey      string      `q:"sort_key"`
	SortDir      string      `q:"sort_dir"`
}

ListRulesOpts allows the filtering and sorting of paginated collections through the API.

func (ListRulesOpts) ToRulesListQuery

func (opts ListRulesOpts) ToRulesListQuery() (string, error)

ToRulesListQuery formats a ListOpts into a query string.

type ListRulesOptsBuilder

type ListRulesOptsBuilder interface {
	ToRulesListQuery() (string, error)
}

ListRulesOptsBuilder allows extensions to add additional parameters to the ListRules request.

type RedirectPoolsConfig

type RedirectPoolsConfig struct {
	// The pool ID
	PoolId string `json:"pool_id" required:"true"`

	// The weight of the pool
	Weight int `json:"weight"`
}

type RedirectPoolsExtendConfig

type RedirectPoolsExtendConfig struct {
	// Whether the rewriter url enable
	RewriteUrlEnable bool `json:"rewrite_url_enable,omitempty"`

	// The rewriter url config
	RewriteUrlConfig *RewriteUrlConfig `json:"rewrite_url_config,omitempty"`

	// The header parameters to be added
	InsertHeadersConfig *InsertHeadersConfig `json:"insert_headers_config,omitempty"`

	// The header parameters to be removed
	RemoveHeadersConfig *RemoveHeadersConfig `json:"remove_headers_config,omitempty"`

	// The traffic limit config of the policy
	TrafficLimitConfig *TrafficLimitConfig `json:"traffic_limit_config,omitempty"`
}

type RedirectPoolsStickySessionConfig

type RedirectPoolsStickySessionConfig struct {
	// Whether enable config session persistence between pools
	Enable bool `json:"enable"`

	// The timeout of the session persistence
	Timeout int `json:"timeout"`
}

type RedirectUrlConfig

type RedirectUrlConfig struct {
	// The protocol for redirection.
	Protocol string `json:"protocol,omitempty"`

	// The host name that requests are redirected to.
	Host string `json:"host,omitempty"`

	// The port that requests are redirected to.
	Port string `json:"port,omitempty"`

	// The path that requests are redirected to.
	Path string `json:"path,omitempty"`

	// The query string set in the URL for redirection.
	Query string `json:"query"`

	// The status code returned after the requests are redirected.
	StatusCode string `json:"status_code" required:"true"`

	// The list of request header parameters to be added
	InsertHeadersConfig *InsertHeadersConfig `json:"insert_headers_config,omitempty"`

	// The list of request header parameters to be removed
	RemoveHeadersConfig *RemoveHeadersConfig `json:"remove_headers_config,omitempty"`
}

type RemoveHeaderConfig

type RemoveHeaderConfig struct {
	// The parameter name of the removed request header
	Key string `json:"key" required:"true"`
}

type RemoveHeadersConfig

type RemoveHeadersConfig struct {
	// The list of request header parameters to be removed
	Configs []*RemoveHeaderConfig `json:"configs" required:"true"`
}

type RewriteUrlConfig

type RewriteUrlConfig struct {
	// The host of the rewriter url
	Host string `json:"host,omitempty"`

	// The path that requests are redirected to.
	Path string `json:"path,omitempty"`

	// The query string set in the URL for redirection.
	Query string `json:"query"`
}

type Rule

type Rule struct {
	// The unique ID for the L7 rule.
	ID string `json:"id"`

	// The L7 rule type. One of HOST_NAME, PATH, METHOD, HEADER, QUERY_STRING, or SOURCE_IP.
	RuleType string `json:"type"`

	// The comparison type for the L7 rule. One of EQUAL_TO, REGEX, or STARTS_WITH.
	CompareType string `json:"compare_type"`

	// The value to use for the comparison. For example, the file type to compare.
	Value string `json:"value"`

	// TenantID is the UUID of the tenant who owns the rule in octavia.
	// Only administrative users can specify a project UUID other than their own.
	TenantID string `json:"tenant_id"`

	// The key to use for the comparison. For example, the name of the cookie to evaluate.
	Key string `json:"key"`

	// When true the logic of the rule is inverted. For example, with invert true,
	// equal to would become not equal to. Default is false.
	Invert bool `json:"invert"`

	// The administrative state of the L7 rule, which is up (true) or down (false).
	AdminStateUp bool `json:"admin_state_up"`

	// The provisioning status of the L7 rule.
	// This value is ACTIVE, PENDING_* or ERROR.
	// This field seems to only be returned during a call to a load balancer's /status
	// see: https://github.com/gophercloud/gophercloud/issues/1362
	ProvisioningStatus string `json:"provisioning_status"`

	// The operating status of the L7 policy.
	// This field seems to only be returned during a call to a load balancer's /status
	// see: https://github.com/gophercloud/gophercloud/issues/1362
	OperatingStatus string `json:"operating_status"`

	// The matching conditions of the forwarding rule.
	// This parameter is available only when enhance_l7policy_enable of the listener is set to true.
	Conditions []Condition `json:"conditions"`

	// The creation time.
	CreatedAt string `json:"created_at"`

	// The updated time.
	UpdatedAt string `json:"updated_at"`
}

Rule represents layer 7 load balancing rule.

func ExtractRules

func ExtractRules(r pagination.Page) ([]Rule, error)

ExtractRules accepts a Page struct, specifically a RulePage struct, and extracts the elements into a slice of Rules structs. In other words, a generic collection is mapped into a relevant slice.

type RulePage

type RulePage struct {
	pagination.LinkedPageBase
}

RulePage is the page returned by a pager when traversing over a collection of Rules in a L7Policy.

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)

NextPageURL is invoked when a paginated collection of rules has reached the end of a page and the pager seeks to traverse over a new one. In order to do this, it needs to construct the next page's URL.

type RuleType

type RuleType string

type TrafficLimitConfig

type TrafficLimitConfig struct {
	// The overall qps of the policy
	Qps int `json:"qps"`

	// The single source qps of the policy
	PerSourceIpQps int `json:"per_source_ip_qps"`

	// The qps buffer
	Burst int `json:"burst"`
}

type UpdateOpts

type UpdateOpts struct {
	// Name of the L7 policy, empty string is allowed.
	Name *string `json:"name,omitempty"`

	// The L7 policy action. One of REDIRECT_TO_POOL, REDIRECT_TO_URL, or REJECT.
	Action Action `json:"action,omitempty"`

	// The position of this policy on the listener.
	Position int32 `json:"position,omitempty"`

	// The priority of this policy on the listener.
	Priority int32 `json:"priority,omitempty"`

	// A human-readable description for the resource, empty string is allowed.
	Description *string `json:"description,omitempty"`

	// Requests matching this policy will be redirected to the pool with this ID.
	// Only valid if action is REDIRECT_TO_POOL.
	RedirectPoolID *string `json:"redirect_pool_id,omitempty"`

	// Requests matching this policy will be redirected to this LISTENER.
	// Only valid if action is REDIRECT_TO_LISTENER.
	RedirectListenerID *string `json:"redirect_listener_id,omitempty"`

	// Requests matching this policy will be redirected to the URL.
	// Only valid if action is REDIRECT_TO_URL.
	RedirectUrlConfig *RedirectUrlConfig `json:"redirect_url_config,omitempty"`

	// Requests matching this policy will be redirected to the configuration of the page.
	// Only valid if action is FIXED_RESPONSE.
	FixedResponseConfig *FixedResponseConfig `json:"fixed_response_config,omitempty"`

	// Requests matching this policy will be redirected to the multiple pools. 5 at most
	// Only valid if action is REDIRECT_TO_POOL.
	RedirectPoolsConfig []*RedirectPoolsConfig `json:"redirect_pools_config,omitempty"`

	// Config session persistence between pools that associated with the policy.
	// Only valid if action is REDIRECT_TO_POOL.
	RedirectPoolsStickySessionConfig *RedirectPoolsStickySessionConfig `json:"redirect_pools_sticky_session_config,omitempty"`

	// The config of the redirected pool.
	// Only valid if action is REDIRECT_TO_POOL.
	RedirectPoolsExtendConfig *RedirectPoolsExtendConfig `json:"redirect_pools_extend_config,omitempty"`

	// The administrative state of the Loadbalancer. A valid value is true (UP)
	// or false (DOWN).
	AdminStateUp *bool `json:"admin_state_up,omitempty"`
}

UpdateOpts is the common options struct used in this package's Update operation.

func (UpdateOpts) ToL7PolicyUpdateMap

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

ToL7PolicyUpdateMap builds a request body from UpdateOpts.

type UpdateOptsBuilder

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

UpdateOptsBuilder allows extensions to add additional parameters to the Update request.

type UpdateResult

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

UpdateResult represents the result of an Update operation. Call its Extract method to interpret the result as a L7Policy.

func Update

Update allows l7policy to be updated.

func (UpdateResult) Extract

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

Extract is a function that accepts a result and extracts a l7policy.

type UpdateRuleOpts

type UpdateRuleOpts struct {
	// The L7 rule type. One of HOST_NAME, PATH, METHOD, HEADER, QUERY_STRING, or SOURCE_IP.
	RuleType RuleType `json:"type,omitempty"`

	// The comparison type for the L7 rule. One of EQUAL_TO, REGEX, or STARTS_WITH.
	CompareType CompareType `json:"compare_type,omitempty"`

	// The value to use for the comparison.
	Value string `json:"value,omitempty"`

	// The key to use for the comparison. For example, the name of the cookie to evaluate.
	Key *string `json:"key,omitempty"`

	// When true the logic of the rule is inverted. For example, with invert true,
	// equal to would become not equal to. Default is false.
	Invert *bool `json:"invert,omitempty"`

	// The administrative state of the Loadbalancer. A valid value is true (UP)
	// or false (DOWN).
	AdminStateUp *bool `json:"admin_state_up,omitempty"`

	// The matching conditions of the forwarding rule.
	// This parameter is available only when enhance_l7policy_enable of the listener is set to true.
	Conditions []Condition `json:"conditions,omitempty"`
}

UpdateRuleOpts is the common options struct used in this package's Update operation.

func (UpdateRuleOpts) ToRuleUpdateMap

func (opts UpdateRuleOpts) ToRuleUpdateMap() (map[string]interface{}, error)

ToRuleUpdateMap builds a request body from UpdateRuleOpts.

type UpdateRuleOptsBuilder

type UpdateRuleOptsBuilder interface {
	ToRuleUpdateMap() (map[string]interface{}, error)
}

UpdateRuleOptsBuilder allows to add additional parameters to the PUT request.

type UpdateRuleResult

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

UpdateRuleResult represents the result of an UpdateRule operation. Call its Extract method to interpret it as a Rule.

func UpdateRule

func UpdateRule(c *golangsdk.ServiceClient, policyID string, ruleID string, opts UpdateRuleOptsBuilder) (r UpdateRuleResult)

UpdateRule allows Rule to be updated.

func (UpdateRuleResult) Extract

func (r UpdateRuleResult) Extract() (*Rule, error)

Extract is a function that accepts a result and extracts a rule.

Jump to

Keyboard shortcuts

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