Class LBRuleAction

  • All Implemented Interfaces:
    com.vmware.vapi.bindings.StaticStructure, com.vmware.vapi.bindings.Structure, java.io.Serializable

    public final class LBRuleAction
    extends java.lang.Object
    implements java.io.Serializable, com.vmware.vapi.bindings.StaticStructure
    Load balancer rule actions are used to manipulate application traffic. Currently load balancer rules can be used at three load balancer processing phases. Each phase has its own supported type of actions. Supported actions in HTTP_REQUST_REWRITE phase are: LBHttpRequestUriRewriteAction LBHttpRequestHeaderRewriteAction LBHttpRequestHeaderDeleteAction LBVariableAssignmentAction Supported actions in HTTP_FORWARDING phase are: LBHttpRejectAction LBHttpRedirectAction LBSelectPoolAction LBVariablePersistenceOnAction LBConnectionDropAction Supported action in HTTP_RESPONSE_REWRITE phase is: LBHttpResponseHeaderRewriteAction LBHttpResponseHeaderDeleteAction LBVariablePersistenceLearnAction Supported action in HTTP_ACCESS phase is: LBJwtAuthAction LBConnectionDropAction LBVariableAssignmentAction Supported action in TRANSPORT phase is: LBSslModeSelectionAction LBSelectPoolAction If the match type of an LBRuleCondition field is specified as REGEX and named capturing groups are used in the specified regular expression. The groups can be used as variables in LBRuleAction fields. For example, define a rule with LBHttpRequestUriCondition as match condition and LBHttpRequestUriRewriteAction as action. Set match_type field of LBHttpRequestUriCondition to REGEX, and set uri field to \"/news/(?<year>\\d+)/(?<month>\\d+)/(?<article>.*)\". Set uri field of LBHttpRequestUriRewriteAction to: \"/news/$year-$month/$article\" In uri field of LBHttpRequestUriCondition, the (?<year>\\d+), (?<month>\\d+) and (?<article>.*) are named capturing groups, they define variables named $year, $month and $article respectively. The defined variables are used in LBHttpRequestUriRewriteAction. For a matched HTTP request with URI \"/news/2017/06/xyz.html\", the substring \"2017\" is captured in variable $year, \"06\" is captured in variable $month, and \"xyz.html\" is captured in variable $article. The LBHttpRequestUriRewriteAction will rewrite the URI to: \"/news/2017-06/xyz.html\" A set of built-in variables can be used in LBRuleAction as well. The name of built-in variables start with underscore, the name of user defined variables is not allowed to start with underscore. Following are some of the built-in variables: $_scheme: Reference the scheme part of matched HTTP messages, could be \"http\" or \"https\". $_host: Host of matched HTTP messages, for example \"www.example.com\". $_server_port: Port part of URI, it is also the port of the server which accepted a request. Default port is 80 for http and 443 for https. $_uri: The URI path, for example \"/products/sample.html\". $_request_uri: Full original request URI with arguments, for example, \"/products/sample.html?a=b&c=d\". $_args: URI arguments, for instance \"a=b&c=d\" $_is_args: \"?\" if a request has URI arguments, or an empty string otherwise. For the full list of built-in variables, please reference the NSX-T Administrator's Guide.
    See Also:
    Serialized Form
    • Field Detail

      • _TYPE_IDENTIFIER

        public static final java.lang.String _TYPE_IDENTIFIER
        Identifier denoting this class, when it is used in polymorphic context.

        This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context.

        See Also:
        Constant Field Values
      • TYPE_LBSELECTPOOLACTION

        public static final java.lang.String TYPE_LBSELECTPOOLACTION
        See Also:
        Constant Field Values
      • TYPE_LBHTTPREQUESTURIREWRITEACTION

        public static final java.lang.String TYPE_LBHTTPREQUESTURIREWRITEACTION
        See Also:
        Constant Field Values
      • TYPE_LBHTTPREQUESTHEADERREWRITEACTION

        public static final java.lang.String TYPE_LBHTTPREQUESTHEADERREWRITEACTION
        See Also:
        Constant Field Values
      • TYPE_LBHTTPREJECTACTION

        public static final java.lang.String TYPE_LBHTTPREJECTACTION
        See Also:
        Constant Field Values
      • TYPE_LBHTTPREDIRECTACTION

        public static final java.lang.String TYPE_LBHTTPREDIRECTACTION
        See Also:
        Constant Field Values
      • TYPE_LBHTTPRESPONSEHEADERREWRITEACTION

        public static final java.lang.String TYPE_LBHTTPRESPONSEHEADERREWRITEACTION
        See Also:
        Constant Field Values
      • TYPE_LBHTTPREQUESTHEADERDELETEACTION

        public static final java.lang.String TYPE_LBHTTPREQUESTHEADERDELETEACTION
        See Also:
        Constant Field Values
      • TYPE_LBHTTPRESPONSEHEADERDELETEACTION

        public static final java.lang.String TYPE_LBHTTPRESPONSEHEADERDELETEACTION
        See Also:
        Constant Field Values
      • TYPE_LBVARIABLEASSIGNMENTACTION

        public static final java.lang.String TYPE_LBVARIABLEASSIGNMENTACTION
        See Also:
        Constant Field Values
      • TYPE_LBVARIABLEPERSISTENCEONACTION

        public static final java.lang.String TYPE_LBVARIABLEPERSISTENCEONACTION
        See Also:
        Constant Field Values
      • TYPE_LBVARIABLEPERSISTENCELEARNACTION

        public static final java.lang.String TYPE_LBVARIABLEPERSISTENCELEARNACTION
        See Also:
        Constant Field Values
      • TYPE_LBJWTAUTHACTION

        public static final java.lang.String TYPE_LBJWTAUTHACTION
        See Also:
        Constant Field Values
      • TYPE_LBSSLMODESELECTIONACTION

        public static final java.lang.String TYPE_LBSSLMODESELECTIONACTION
        See Also:
        Constant Field Values
      • TYPE_LBCONNECTIONDROPACTION

        public static final java.lang.String TYPE_LBCONNECTIONDROPACTION
        See Also:
        Constant Field Values
      • __dynamicStructureFields

        protected com.vmware.vapi.data.StructValue __dynamicStructureFields
    • Constructor Detail

      • LBRuleAction

        public LBRuleAction()
        Default constructor.
      • LBRuleAction

        protected LBRuleAction​(com.vmware.vapi.data.StructValue __dynamicStructureFields)
    • Method Detail

      • _getType

        public com.vmware.vapi.bindings.type.StructType _getType()
        Specified by:
        _getType in interface com.vmware.vapi.bindings.StaticStructure
      • _getDataValue

        public com.vmware.vapi.data.StructValue _getDataValue()
        Specified by:
        _getDataValue in interface com.vmware.vapi.bindings.Structure
      • _updateDataValue

        protected void _updateDataValue​(com.vmware.vapi.data.StructValue structValue)
      • _validate

        public void _validate()
        Specified by:
        _validate in interface com.vmware.vapi.bindings.StaticStructure
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Specified by:
        toString in interface com.vmware.vapi.bindings.StaticStructure
        Overrides:
        toString in class java.lang.Object
      • _hasTypeNameOf

        public boolean _hasTypeNameOf​(java.lang.Class<? extends com.vmware.vapi.bindings.Structure> clazz)
        Specified by:
        _hasTypeNameOf in interface com.vmware.vapi.bindings.Structure
      • _convertTo

        public <T extends com.vmware.vapi.bindings.Structure> T _convertTo​(java.lang.Class<T> clazz)
        Specified by:
        _convertTo in interface com.vmware.vapi.bindings.Structure
      • _setDynamicField

        public void _setDynamicField​(java.lang.String fieldName,
                                     com.vmware.vapi.data.DataValue fieldValue)
        Specified by:
        _setDynamicField in interface com.vmware.vapi.bindings.StaticStructure
      • _getDynamicField

        public com.vmware.vapi.data.DataValue _getDynamicField​(java.lang.String fieldName)
        Specified by:
        _getDynamicField in interface com.vmware.vapi.bindings.StaticStructure
      • _getDynamicFieldNames

        public java.util.Set<java.lang.String> _getDynamicFieldNames()
        Specified by:
        _getDynamicFieldNames in interface com.vmware.vapi.bindings.StaticStructure
      • _getClassType

        public static com.vmware.vapi.bindings.type.StructType _getClassType()
        WARNING: Internal method, subject to change in future versions.
        Returns:
        StructType instance representing the static bindings type for this Structure.
      • _getCanonicalName

        public java.lang.String _getCanonicalName()
        Specified by:
        _getCanonicalName in interface com.vmware.vapi.bindings.Structure
      • _getCanonicalTypeName

        public static java.lang.String _getCanonicalTypeName()
        Returns the canonical type name. See _getCanonicalName().
        Returns:
        canonical type name
      • _newInstance

        public static LBRuleAction _newInstance​(com.vmware.vapi.data.StructValue structValue)
        WARNING: Internal method, subject to change in future versions.
        Returns new instance of this binding class and injects the provided data value.
        WARNING: The returned object is not fully initialized.
        Parameters:
        structValue - the source of the data contained in the binding object. Could contain more data than fields of this class can describe i.e. newer version of the binding object. Could be null.
        Returns:
        the static bindings StructType
      • _newInstance2

        public static LBRuleAction _newInstance2​(com.vmware.vapi.data.StructValue structValue)
        WARNING: Internal method, subject to change in future versions.
        Serves as a versioning mechanism.