Documentation ¶
Index ¶
- Constants
- func Create(c *gcorecloud.ServiceClient, opts CreateOptsBuilder) (r tasks.Result)
- func CreateRule(c *gcorecloud.ServiceClient, policyID string, opts CreateRuleOptsBuilder) (r tasks.Result)
- func Delete(c *gcorecloud.ServiceClient, policyID string) (r tasks.Result)
- func DeleteRule(c *gcorecloud.ServiceClient, policyID, ruleID string) (r tasks.Result)
- func ExtractL7PolicesInto(r pagination.Page, v interface{}) error
- func ExtractL7PolicyIDFromTask(task *tasks.Task) (string, error)
- func ExtractRuleIDFromTask(task *tasks.Task) (string, error)
- func ExtractRuleInto(r pagination.Page, v interface{}) error
- func List(c *gcorecloud.ServiceClient) pagination.Pager
- func ListRule(c *gcorecloud.ServiceClient, policyID string) pagination.Pager
- func Replace(c *gcorecloud.ServiceClient, policyID string, opts ReplaceOptsBuilder) (r tasks.Result)
- func ReplaceRule(c *gcorecloud.ServiceClient, policyID, ruleID string, ...) (r tasks.Result)
- type Action
- type CompareType
- func (ct CompareType) IsValid() error
- func (ct CompareType) List() []CompareType
- func (ct *CompareType) MarshalJSON() ([]byte, error)
- func (ct CompareType) String() string
- func (ct CompareType) StringList() []string
- func (ct *CompareType) UnmarshalJSON(data []byte) error
- func (ct CompareType) ValidOrNil() (*CompareType, error)
- type CreateOpts
- type CreateOptsBuilder
- type CreateRuleOpts
- type CreateRuleOptsBuilder
- type GetResult
- type GetRuleResult
- type L7Policy
- type L7PolicyPage
- type L7PolicyTaskResult
- type L7Rule
- type ReplaceOpts
- type ReplaceOptsBuilder
- type RulePage
- type RuleTaskResult
- type RuleType
- func (rt RuleType) IsValid() error
- func (rt RuleType) List() []RuleType
- func (rt *RuleType) MarshalJSON() ([]byte, error)
- func (rt RuleType) String() string
- func (rt RuleType) StringList() []string
- func (rt *RuleType) UnmarshalJSON(data []byte) error
- func (rt RuleType) ValidOrNil() (*RuleType, error)
Constants ¶
const ( ActionRedirectToPool Action = "REDIRECT_TO_POOL" ActionRedirectToURL Action = "REDIRECT_TO_URL" ActionRedirectPrefix Action = "REDIRECT_PREFIX" ActionReject Action = "REJECT" TypeCookie RuleType = "COOKIE" TypeFileType RuleType = "FILE_TYPE" TypeHeader RuleType = "HEADER" TypeHostName RuleType = "HOST_NAME" TypePath RuleType = "PATH" TypeSSLConnHasCert RuleType = "SSL_CONN_HAS_CERT" TypeSSLVerifyResult RuleType = "SSL_VERIFY_RESULT" TypeSSLDNField RuleType = "SSL_DN_FIELD" 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 CreateOptsBuilder) (r tasks.Result)
Create accepts a CreateOpts struct and creates a new policy using the values provided.
func CreateRule ¶
func CreateRule(c *gcorecloud.ServiceClient, policyID string, opts CreateRuleOptsBuilder) (r tasks.Result)
CreateRule accepts a policy id and CreateRuleOpts struct and creates a new rule using the values provided.
func Delete ¶
func Delete(c *gcorecloud.ServiceClient, policyID string) (r tasks.Result)
Delete accepts a policy id and delete existing policy.
func DeleteRule ¶ added in v0.3.45
func DeleteRule(c *gcorecloud.ServiceClient, policyID, ruleID string) (r tasks.Result)
DeleteRule accepts a policy id, rule id and delete existing rule.
func ExtractL7PolicesInto ¶
func ExtractL7PolicesInto(r pagination.Page, v interface{}) error
func ExtractRuleInto ¶
func ExtractRuleInto(r pagination.Page, v interface{}) error
func List ¶
func List(c *gcorecloud.ServiceClient) pagination.Pager
List retrieves list of policies.
func ListRule ¶ added in v0.3.45
func ListRule(c *gcorecloud.ServiceClient, policyID string) pagination.Pager
ListRule accept a policy id and retrieves list of rules.
func Replace ¶ added in v0.3.45
func Replace(c *gcorecloud.ServiceClient, policyID string, opts ReplaceOptsBuilder) (r tasks.Result)
Replace accepts a ReplaceOpts struct and policy id and replaced an existing policy using the values provided.
func ReplaceRule ¶ added in v0.3.45
func ReplaceRule(c *gcorecloud.ServiceClient, policyID, ruleID string, opts CreateRuleOptsBuilder) (r tasks.Result)
ReplaceRule accepts a CreateRuleOpts struct, rule id and policy id and replaced an existing rule using the values provided.
Types ¶
type Action ¶
type Action string
func (*Action) MarshalJSON ¶ added in v0.3.45
MarshalJSON - implements Marshaler interface
func (Action) StringList ¶ added in v0.3.45
func (*Action) UnmarshalJSON ¶ added in v0.3.45
UnmarshalJSON - implements Unmarshaler interface
func (Action) ValidOrNil ¶ added in v0.3.45
type CompareType ¶
type CompareType string
func (CompareType) IsValid ¶ added in v0.3.45
func (ct CompareType) IsValid() error
func (CompareType) List ¶ added in v0.3.45
func (ct CompareType) List() []CompareType
func (*CompareType) MarshalJSON ¶ added in v0.3.45
func (ct *CompareType) MarshalJSON() ([]byte, error)
MarshalJSON - implements Marshaler interface
func (CompareType) String ¶ added in v0.3.45
func (ct CompareType) String() string
func (CompareType) StringList ¶ added in v0.3.45
func (ct CompareType) StringList() []string
func (*CompareType) UnmarshalJSON ¶ added in v0.3.45
func (ct *CompareType) UnmarshalJSON(data []byte) error
UnmarshalJSON - implements Unmarshaler interface
func (CompareType) ValidOrNil ¶ added in v0.3.45
func (ct CompareType) ValidOrNil() (*CompareType, error)
type CreateOpts ¶
type CreateOpts struct { Name string `json:"name,omitempty"` ListenerID string `json:"listener_id" required:"true" validate:"required,uuid"` Action Action `json:"action" required:"true" validate:"required,enum"` Position int32 `json:"position,omitempty" validate:"gt=-1,omitempty"` RedirectHTTPCode int `json:"redirect_http_code,omitempty"` RedirectPoolID string `json:"redirect_pool_id,omitempty" validate:"rfe=Action:REDIRECT_TO_POOL"` RedirectPrefix string `json:"redirect_prefix,omitempty" validate:"rfe=Action:REDIRECT_PREFIX"` RedirectURL string `json:"redirect_url,omitempty" validate:"rfe=Action:REDIRECT_TO_URL"` Tags []string `json:"tags,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 CreateOptsBuilder ¶ added in v0.3.45
CreateOptsBuilder allows extensions to add additional parameters to the Create request.
type CreateRuleOpts ¶
type CreateRuleOpts struct { CompareType CompareType `json:"compare_type" required:"true" validate:"required,enum"` Invert bool `json:"invert"` Key string `json:"key,omitempty"` Type RuleType `json:"type" required:"true" validate:"required,enum"` Value string `json:"value" required:"true"` Tags []string `json:"tags,omitempty"` }
CreateRuleOpts 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 CreateRuleOptsBuilder ¶ added in v0.3.45
CreateOptsBuilder allows extensions to add additional parameters to the Create request.
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, policyID string) (r GetResult)
Get retrieves a specific policy based on its unique ID.
func (GetResult) Extract ¶
Extract is a function that accepts a result and extracts a l7 policy resource.
func (GetResult) ExtractRule ¶
Extract is a function that accepts a result and extracts a rule policy resource.
type GetRuleResult ¶ added in v0.3.45
type GetRuleResult struct {
// contains filtered or unexported fields
}
GetRuleResult represents the result of a get operation. Call its Extract method to interpret it as a L7Rule.
func GetRule ¶
func GetRule(c *gcorecloud.ServiceClient, plid string, rlid string) (r GetRuleResult)
GetRule retrieves a specific policy based on its policy id and rule unique ID.
func (GetRuleResult) Extract ¶ added in v0.3.45
Extract is a function that accepts a result and extracts a l7 rule resource.
func (GetRuleResult) ExtractInto ¶ added in v0.3.45
func (r GetRuleResult) ExtractInto(v interface{}) error
type L7Policy ¶
type L7Policy struct { ID string `json:"id"` Name string `json:"name"` Action Action `json:"action"` ListenerID string `json:"listener_id"` RedirectPoolID string `json:"redirect_pool_id"` Position int32 `json:"position"` ProjectID int32 `json:"project_id"` RegionID int `json:"region_id"` Region string `json:"region"` OperatingStatus string `json:"operating_status"` ProvisioningStatus string `json:"provisioning_status"` RedirectHttpCode *int `json:"redirect_http_code"` RedirectPrefix *string `json:"redirect_prefix"` RedirectURL *string `json:"redirect_url"` Tags []string `json:"tags"` CreatedAt gcorecloud.JSONRFC3339Z `json:"created_at"` UpdatedAt *gcorecloud.JSONRFC3339Z `json:"updated_at"` Rules []L7Rule `json:"rules"` }
L7Policy represents a policy structure.
func ExtractL7Polices ¶
func ExtractL7Polices(r pagination.Page) ([]L7Policy, error)
func ListAll ¶ added in v0.3.45
func ListAll(c *gcorecloud.ServiceClient) ([]L7Policy, error)
ListAll retrieves list of policies.
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 L7Rule ¶ added in v0.3.45
type L7Rule struct { ID string `json:"id"` CompareType CompareType `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 RuleType `json:"type"` Value string `json:"value"` Tags []string `json:"tags"` ProjectID int `json:"project_id"` RegionID int `json:"region_id"` Region string `json:"region"` }
L7Rule represents layer 7 load balancing rule.
func ExtractL7Rules ¶ added in v0.3.45
func ExtractL7Rules(r pagination.Page) ([]L7Rule, error)
func ListAllRule ¶ added in v0.3.45
func ListAllRule(c *gcorecloud.ServiceClient, policyID string) ([]L7Rule, error)
ListAllRule accept a policy id and retrieves list of rules.
type ReplaceOpts ¶ added in v0.3.45
type ReplaceOpts struct { Name string `json:"name,omitempty"` Action Action `json:"action" required:"true" validate:"required,enum"` Position int32 `json:"position,omitempty" validate:"gt=-1,omitempty"` RedirectHTTPCode int `json:"redirect_http_code,omitempty"` RedirectPoolID string `json:"redirect_pool_id,omitempty" validate:"rfe=Action:REDIRECT_TO_POOL"` RedirectPrefix string `json:"redirect_prefix,omitempty" validate:"rfe=Action:REDIRECT_PREFIX"` RedirectURL string `json:"redirect_url,omitempty" validate:"rfe=Action:REDIRECT_TO_URL"` Tags []string `json:"tags,omitempty"` }
ReplaceOpts represents options used to replace a l7 policy.
func (ReplaceOpts) ToL7PolicyReplaceMap ¶ added in v0.3.45
func (opts ReplaceOpts) ToL7PolicyReplaceMap() (map[string]interface{}, error)
ToL7PolicyReplaceMap builds a request body from ReplaceOpts.
type ReplaceOptsBuilder ¶ added in v0.3.45
ReplaceOptsBuilder allows extensions to add additional parameters to the Replace request.
type RulePage ¶
type RulePage struct {
pagination.LinkedPageBase
}
L7PolicyPage is the page returned by a pager when traversing over a collection of l7polices.
func (RulePage) NextPageURL ¶
type RuleTaskResult ¶
type RuleTaskResult struct {
L7Rules []string `json:"l7rules"`
}
type RuleType ¶
type RuleType string
func (*RuleType) MarshalJSON ¶ added in v0.3.45
MarshalJSON - implements Marshaler interface
func (RuleType) StringList ¶ added in v0.3.45
func (*RuleType) UnmarshalJSON ¶ added in v0.3.45
UnmarshalJSON - implements Unmarshaler interface