Documentation ¶
Index ¶
- Constants
- func List(sc *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager
- func ListRules(sc *gophercloud.ServiceClient, opts RulesListOptsBuilder, policyId string) pagination.Pager
- type CreateOpts
- type CreateOptsBuilder
- type CreateResult
- type CreateRuleOpts
- type CreateRuleOptsBuilder
- type DeleteResult
- type GetResult
- type ListOpts
- type ListOptsBuilder
- type Policies
- type PolicyPage
- type PolicyRule
- type PolicyRulesPage
- type Rule
- type RuleCreateResult
- type RuleDeleteResult
- type RuleGetResult
- type RuleId
- type RuleUpdateOpts
- type RuleUpdateResult
- type Rules
- type RulesListOpts
- type RulesListOptsBuilder
- type UpdateOpts
- type UpdateOptsBuilder
- type UpdateResult
- type UpdateRuleOptsBuilder
Constants ¶
const ( ROOTPATH = "lbaas" RESOURCEPATH = "l7policies" )
const RedirectToPool = "REDIRECT_TO_POOL"
Variables ¶
This section is empty.
Functions ¶
func List ¶
func List(sc *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager
List returns a Pager which allows you to iterate over a collection of policys.
func ListRules ¶
func ListRules(sc *gophercloud.ServiceClient, opts RulesListOptsBuilder, policyId string) pagination.Pager
ListRules returns a Pager which allows you to iterate over a collection of policyrules.
Types ¶
type CreateOpts ¶
type CreateOpts struct { // Specifies the ID of the backend server group to which the requests are forwarded. RedirectPoolID string `json:"redirect_pool_id" required:"true"` // Provides supplementary information about the forwarding policy. Description string `json:"description,omitempty"` // Specifies the administrative status. AdminStateUp *bool `json:"admin_state_up,omitempty"` // Specifies the project ID. TenantID string `json:"tenant_id,omitempty"` // Specifies the ID of the listener for which the forwarding policy is added. ListenerID string `json:"listener_id" required:"true"` // This field is not in use yet. RedirectURL string `json:"redirect_url,omitempty"` // Specifies the URL matching rule. // The value can be REDIRECT_TO_POOL or REDIRECT_TO_LISTENER. Action string `json:"action" required:"true"` // Specifies the forwarding priority. The value ranges from 1 to 100. Position int `json:"position,omitempty"` // Specifies the forwarding policy name. Name string `json:"name,omitempty"` }
CreateOpts represents options for creating a policy.
func (CreateOpts) ToPolicyCreateMap ¶
func (opts CreateOpts) ToPolicyCreateMap() (map[string]interface{}, error)
ToPolicyCreateMap 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 policy.
func Create ¶
func Create(sc *gophercloud.ServiceClient, opts CreateOptsBuilder) (r CreateResult)
Create is an operation which provisions a new policy based on the configuration defined in the CreateOpts struct.
type CreateRuleOpts ¶
type CreateRuleOpts struct { // Specifies the project ID. TenantId string `json:"tenant_id,omitempty"` // Specifies the administrative status. AdminStateUp *bool `json:"admin_state_up,omitempty"` // Specifies the matching content. // The value can be HOST_NAME or PATH. Type string `json:"type" required:"true"` // Specifies the matching mode. CompareType string `json:"compare_type" required:"true"` // Specifies the Key of the matching content. Key string `json:"key,omitempty"` // Specifies the value of the matching content. Value string `json:"value" required:"true"` }
CreateRuleOpts represents options for creating a policyrule.
func (CreateRuleOpts) ToPolicyRuleCreateMap ¶
func (opts CreateRuleOpts) ToPolicyRuleCreateMap() (map[string]interface{}, error)
ToPolicyRuleCreateMap builds a request body from CreateRuleOpts.
type CreateRuleOptsBuilder ¶
CreateRuleOptsBuilder allows extensions to add additional parameters to the CreateRule request.
type DeleteResult ¶
type DeleteResult struct {
gophercloud.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(sc *gophercloud.ServiceClient, id string) (r DeleteResult)
Delete will permanently delete a particular policy based on its policy ID.
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 policy.
type ListOpts ¶
type ListOpts struct { // Specifies the ID of the backend server group to which the requests are forwarded. RedirectPoolID string `q:"redirect_pool_id"` // Provides supplementary information about the forwarding policy. Description string `q:"description"` // Specifies the administrative status. AdminStateUp *bool `q:"admin_state_up"` // Specifies the project ID. TenantID string `q:"tenant_id"` // Specifies the ID of the listener for which the forwarding policy is added. ListenerID string `q:"listener_id"` // This field is not in use yet. RedirectURL string `q:"redirect_url"` // Specifies the URL matching rule. // The value can be REDIRECT_TO_POOL or REDIRECT_TO_LISTENER. Action string `q:"action"` // Specifies the forwarding priority. The value ranges from 1 to 100. Position int `q:"position"` // Specifies the forwarding policy ID. ID string `q:"id"` // Specifies the forwarding policy name. Name string `q:"name"` // Specifies the number of records on each page. Limit int `q:"limit"` // Specifies the ID of the last forwarding policy on the previous page. Marker string `q:"marker"` // Specifies the pagination direction. PageReverse *bool `q:"page_reverse"` // Specifies the provisioning status. // The value can be ACTIVE, PENDING_CREATE, or ERROR. ProvisioningStatus string `q:"provisioning_status"` }
ListOpts allows the filtering and sorting of paginated collections through the API. Filtering is achieved by passing in struct field values that map the floating policies attributes you want to see returned. Marker and Limit are used for pagination.
func (ListOpts) ToPolicyListMap ¶
ToPolicyListMap formats a ListOpts into a query string.
type ListOptsBuilder ¶
ListOptsBuilder allows extensions to add additional parameters to the List request.
type Policies ¶
type Policies struct { // Specifies the ID of the backend server group to which the requests are forwarded. RedirectPoolID string `json:"redirect_pool_id"` // Provides supplementary information about the forwarding policy. Description string `json:"description"` // Specifies the administrative status. AdminStateUp bool `json:"admin_state_up"` // Lists the forwarding rules under a forwarding policy. Rules []RuleId `json:"rules"` // Specifies the project ID. TenantID string `json:"tenant_id"` // Specifies the ID of the listener for which the forwarding policy is added. ListenerID string `json:"listener_id"` // This field is not in use yet. RedirectURL string `json:"redirect_url"` // Specifies the URL matching rule. // The value can be REDIRECT_TO_POOL or REDIRECT_TO_LISTENER. Action string `json:"action"` // Specifies the forwarding priority. The value ranges from 1 to 100. Position int `json:"position"` // Specifies the forwarding policy ID. ID string `json:"id"` // Specifies the forwarding policy name. Name string `json:"name"` // Specifies the provisioning status. // The value can be ACTIVE, PENDING_CREATE, or ERROR. ProvisioningStatus string `json:"provisioning_status"` }
func ExtractPolcies ¶
func ExtractPolcies(r pagination.Page) ([]Policies, error)
ExtractPolcies accepts a Page struct, specifically a PolicyPage struct, and extracts the elements into a slice of Policies structs. In other words, a generic collection is mapped into a relevant slice.
type PolicyPage ¶
type PolicyPage struct {
pagination.LinkedPageBase
}
PolicyPage is the page returned by a pager when traversing over a collection of policy.
func (PolicyPage) IsEmpty ¶
func (p PolicyPage) IsEmpty() (bool, error)
IsEmpty checks whether a PolicyPage struct is empty.
func (PolicyPage) NextPageURL ¶
func (page PolicyPage) NextPageURL() (string, error)
NextPageURL will retrieve the next page URL.
type PolicyRule ¶
type PolicyRule struct { // Specifies the forwarding rule ID. ID string `json:"id"` // Specifies the project ID. TenantId string `json:"tenant_id"` // Specifies the administrative status. AdminStateUp bool `json:"admin_state_up"` // Specifies the matching content. // The value can be HOST_NAME or PATH. Type string `json:"type"` // Specifies the matching mode. CompareType string `json:"compare_type"` // Specifies whether reverse match is supported. Invert bool `json:"invert"` // Specifies the Key of the matching content. Key string `json:"key"` // Specifies the Value of the matching content. Value string `json:"value"` }
type PolicyRulesPage ¶
type PolicyRulesPage struct {
pagination.LinkedPageBase
}
PolicyRulesPage is the page returned by a pager when traversing over a collection of policyrules.
func (PolicyRulesPage) IsEmpty ¶
func (p PolicyRulesPage) IsEmpty() (bool, error)
IsEmpty checks whether a PolicyRulesPage struct is empty.
func (PolicyRulesPage) NextPageURL ¶
func (page PolicyRulesPage) NextPageURL() (string, error)
NextPageURL will retrieve the next page URL.
type Rule ¶
type Rule struct {
Rule PolicyRule `json:"rule"`
}
type RuleCreateResult ¶
type RuleCreateResult struct {
// contains filtered or unexported fields
}
RuleCreateResult represents the result of a create operation. Call its Extract method to interpret it as a policyrule.
func CreateRule ¶
func CreateRule(sc *gophercloud.ServiceClient, opts CreateRuleOptsBuilder, policyid string) (r RuleCreateResult)
Create is an operation which provisions a new policyrule based on the configuration defined in the CreateRuleOpts struct.
type RuleDeleteResult ¶
type RuleDeleteResult struct {
gophercloud.ErrResult
}
RuleDeleteResult represents the result of a delete operation. Call its ExtractErr method to determine if the request succeeded or failed.
func DeleteRule ¶
func DeleteRule(sc *gophercloud.ServiceClient, policyId string, policyruleId string) (r RuleDeleteResult)
Delete will permanently delete a particular policyrule based on its policyrule ID.
type RuleGetResult ¶
type RuleGetResult struct {
// contains filtered or unexported fields
}
RuleGetResult represents the result of a get operation. Call its Extract method to interpret it as a policyrule.
func GetRule ¶
func GetRule(sc *gophercloud.ServiceClient, policyId string, policyruleId string) (r RuleGetResult)
Get retrieves a particular policyrule based on its policyrule ID.
type RuleUpdateOpts ¶
type RuleUpdateOpts struct { // Specifies the administrative status. AdminStateUp *bool `json:"admin_state_up,omitempty"` // Specifies the matching mode. CompareType string `json:"compare_type,omitempty"` // Specifies whether reverse match is supported. Invert string `json:"invert,omitempty"` // Specifies the Key of the matching content. Key string `json:"key,omitempty"` // Specifies the value of the matching content. Value string `json:"value,omitempty"` }
RuleUpdateOpts represents options for updating a policyrule.
func (RuleUpdateOpts) ToPolicyRuleUpdateMap ¶
func (opts RuleUpdateOpts) ToPolicyRuleUpdateMap() (map[string]interface{}, error)
ToPolicyRuleUpdateMap builds a request body from RuleUpdateOpts.
type RuleUpdateResult ¶
type RuleUpdateResult struct {
// contains filtered or unexported fields
}
RuleUpdateResult represents the result of an update operation. Call its Extract method to interpret it as a policyrule.
func UpdateRule ¶
func UpdateRule(sc *gophercloud.ServiceClient, opts UpdateRuleOptsBuilder, policyId string, policyruleId string) (r RuleUpdateResult)
UpdateRule is an operation which modifies the attributes of the specified policyrule.
type Rules ¶
type Rules struct {
Rules []PolicyRule `json:"rules"`
}
func ExtractPolicyRules ¶
func ExtractPolicyRules(r pagination.Page) (Rules, error)
ExtractPolicyRules accepts a Page struct, specifically a PolicyRulesPage struct, and extracts the elements into a slice of policyrules structs. In other words, a generic collection is mapped into a relevant slice.
type RulesListOpts ¶
type RulesListOpts struct { // Specifies the forwarding rule ID. ID string `q:"id"` // Specifies the project ID. TenantID string `q:"tenant_id"` // Specifies the administrative status. AdminStateUp *bool `q:"admin_state_up"` // Specifies the matching content. // The value can be HOST_NAME or PATH. Type string `q:"type"` // Specifies the matching mode. CompareType string `q:"compare_type"` // Specifies whether reverse match is supported. Invert *bool `q:"invert"` // Specifies the Key of the matching content. Key string `q:"key"` // Specifies the value of the matching content. Values string `q:"values"` }
RulesListOpts allows the filtering through the API. Filtering is achieved by passing in struct field values that map the policyrules attributes you want to see returned.
func (RulesListOpts) ToPolicyRulesListMap ¶
func (opts RulesListOpts) ToPolicyRulesListMap() (string, error)
ToPolicyRulesListMap formats a RulesListOpts into a query string.
type RulesListOptsBuilder ¶
RulesListOptsBuilder allows extensions to add additional parameters to the List request.
type UpdateOpts ¶
type UpdateOpts struct { Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` RedirectPoolID string `json:"redirect_pool_id,omitempty"` AdminStateUp *bool `json:"admin_state_up,omitempty"` }
UpdateOpts represents options for updating a policy.
func (UpdateOpts) ToPolicyUpdateMap ¶
func (opts UpdateOpts) ToPolicyUpdateMap() (map[string]interface{}, error)
ToPolicyUpdateMap 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 policy.
func Update ¶
func Update(sc *gophercloud.ServiceClient, id string, opts UpdateOptsBuilder) (r UpdateResult)
Update is an operation which modifies the attributes of the specified policy.
type UpdateRuleOptsBuilder ¶
UpdateRuleOptsBuilder allows extensions to add additional parameters to the UpdateRule request.