Documentation
¶
Index ¶
- Constants
- func List(c *golangsdk.ServiceClient, opts ListOptsBuilder) pagination.Pager
- func ListRules(c *golangsdk.ServiceClient, policyID string, opts ListRulesOptsBuilder) pagination.Pager
- type Action
- type CompareType
- type Condition
- type CreateOpts
- type CreateOptsBuilder
- type CreateResult
- type CreateRuleOpts
- type CreateRuleResult
- type DeleteResult
- type DeleteRuleResult
- type FixedResponseConfig
- type GetResult
- type GetRuleResult
- type InsertHeaderConfig
- type InsertHeadersConfig
- type L7Policy
- type L7PolicyPage
- type ListOpts
- type ListOptsBuilder
- type ListRulesOpts
- type ListRulesOptsBuilder
- type RedirectPoolsConfig
- type RedirectPoolsExtendConfig
- type RedirectPoolsStickySessionConfig
- type RedirectUrlConfig
- type RemoveHeaderConfig
- type RemoveHeadersConfig
- type RewriteUrlConfig
- type Rule
- type RulePage
- type RuleType
- type TrafficLimitConfig
- type UpdateOpts
- type UpdateOptsBuilder
- type UpdateResult
- type UpdateRuleOpts
- type UpdateRuleOptsBuilder
- type UpdateRuleResult
Constants ¶
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 ¶
func List(c *golangsdk.ServiceClient, opts ListOptsBuilder) pagination.Pager
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 CompareType ¶
type CompareType string
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 ¶
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 ¶
func Create(c *golangsdk.ServiceClient, opts CreateOptsBuilder) (r CreateResult)
Create accepts a CreateOpts struct and uses the values to create a new 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.
type DeleteResult ¶
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 ¶
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.
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.
type InsertHeaderConfig ¶
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 ¶
ToL7PolicyListQuery formats a ListOpts into a query string.
type ListOptsBuilder ¶
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 ¶
ListRulesOptsBuilder allows extensions to add additional parameters to the ListRules request.
type RedirectPoolsConfig ¶
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 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 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) NextPageURL ¶
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 TrafficLimitConfig ¶
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 ¶
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 ¶
func Update(c *golangsdk.ServiceClient, id string, opts UpdateOptsBuilder) (r UpdateResult)
Update allows l7policy to be updated.
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 ¶
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.