github.com/vmware/go-vmware-nsxt@v0.0.0-20230223012718-d31b8a1ca05e/loadbalancer/lb_rule.go (about) 1 /* 2 * NSX API 3 * 4 * VMware NSX REST API 5 * 6 * API version: 1.0.0 7 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) 8 */ 9 10 package loadbalancer 11 12 import ( 13 "github.com/vmware/go-vmware-nsxt/common" 14 ) 15 16 // Load balancer rules allow customization of load balancing behavior using match/action rules. Currently, load balancer rules are supported for only layer 7 virtual servers with application profile LbHttpProfile. Each application rule consists of one or more match conditions and one or more actions. Load balancer rules could be used by different load balancer services. 17 type LbRule struct { 18 19 // The server will populate this field when returing the resource. Ignored on PUT and POST. 20 Links []common.ResourceLink `json:"_links,omitempty"` 21 22 // Schema for this resource 23 Schema string `json:"_schema,omitempty"` 24 25 // Link to this resource 26 Self *common.SelfResourceLink `json:"_self,omitempty"` 27 28 // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. 29 Revision int32 `json:"_revision"` 30 31 // Timestamp of resource creation 32 CreateTime int64 `json:"_create_time,omitempty"` 33 34 // ID of the user who created this resource 35 CreateUser string `json:"_create_user,omitempty"` 36 37 // Timestamp of last modification 38 LastModifiedTime int64 `json:"_last_modified_time,omitempty"` 39 40 // ID of the user who last modified this resource 41 LastModifiedUser string `json:"_last_modified_user,omitempty"` 42 43 // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. 44 Protection string `json:"_protection,omitempty"` 45 46 // Indicates system owned resource 47 SystemOwned bool `json:"_system_owned,omitempty"` 48 49 // Description of this resource 50 Description string `json:"description,omitempty"` 51 52 // Defaults to ID if not set 53 DisplayName string `json:"display_name,omitempty"` 54 55 // Unique identifier of this resource 56 Id string `json:"id,omitempty"` 57 58 // The type of this resource. 59 ResourceType string `json:"resource_type,omitempty"` 60 61 // Opaque identifiers meaningful to the API user 62 Tags []common.Tag `json:"tags,omitempty"` 63 64 // A list of actions to be executed at specified phase when load balancer rule matches. The actions are used to manipulate application traffic, such as rewrite URI of HTTP messages, redirect HTTP messages, etc. 65 Actions []LbRuleAction `json:"actions"` 66 67 // A list of match conditions used to match application traffic. Multiple match conditions can be specified in one load balancer rule, each match condition defines a criterion to match application traffic. If no match conditions are specified, then the load balancer rule will always match and it is used typically to define default rules. If more than one match condition is specified, then match strategy determines if all conditions should match or any one condition should match for the load balancer rule to considered a match. 68 MatchConditions []LbRuleCondition `json:"match_conditions,omitempty"` 69 70 // Strategy to define how load balancer rule is considered a match when multiple match conditions are specified in one rule. If match_stragety is set to ALL, then load balancer rule is considered a match only if all the conditions match. If match_strategy is set to ANY, then load balancer rule is considered a match if any one of the conditions match. 71 MatchStrategy string `json:"match_strategy"` 72 73 // Each load balancer rule is used at a specific phase of load balancer processing. Currently three phases are supported, HTTP_REQUEST_REWRITE, HTTP_FORWARDING and HTTP_RESPONSE_REWRITE. When an HTTP request message is received by load balancer, all HTTP_REQUEST_REWRITE rules, if present are executed in the order they are applied to virtual server. And then if HTTP_FORWARDING rules present, only first matching rule's action is executed, remaining rules are not checked. HTTP_FORWARDING rules can have only one action. If the request is forwarded to a backend server and the response goes back to load balancer, all HTTP_RESPONSE_REWRITE rules, if present, are executed in the order they are applied to the virtual server. 74 Phase string `json:"phase"` 75 }