Forum Discussion

OCD_JAX's avatar
OCD_JAX
Icon for Nimbostratus rankNimbostratus
Oct 09, 2024

F5 Next - how to reference irule procedures

Hi,

 

Anyone figured how references works for irule objects with the call command?

and if it is possible do i need to assign it to the vs?

 

This is my stack:

 

I manage to use the call command to a proc within the samle irule but i haven't found a way how to reference proclibrary (irule) from my_irule

 

https://clouddocs.f5.com/bigip-next/20-2-0/irules/bigipn_object_naming_irule.html

 

 

{

    "_embedded": {

        "stacks": [

            {

                "_links": {

                    "self": "/applications/a95e7451-d077-4ec3-a9c1-d0f3bea7f615/stacks/e87175a1-34f3-43d2-b52a-7b7466ed8851"

                },

                "clientSide": {

                    "l4ClientSide": "default:service_2:vs",

                    "persistence": {

                        "cookieMethod": {

                            "method": "COOKIE_INSERT_METHOD"

                        },

                        "template": "COOKIE_TEMPLATE"

                    }

                },

                "enabled": true,

                "id": "e87175a1-34f3-43d2-b52a-7b7466ed8851",

                "irules": [

                    {

                        "description": "default:service_2:proclibrary",

                        "rule": "when RULE_INIT {\nlog local0. \"proclib started\"\n}\nproc responder {} {\n    HTTP::respond 200 content {hell from proc}\n}"

                    },

                    {

                        "description": "default:service_2:my_irule",

                        "rule": "proc test {} {\nHTTP::respond  200 content [virtual name]\n}\nwhen HTTP_REQUEST {\nset vs_name [virtual name]\nlog local0. \"hello there\"\ncall /app/default:service_2/proclibrary::responder\n\n}"

                    }

                ],

                "name": "vs",

                "serverSide": {

                    "l4ServerSide": "default:service_2:vs"

                },

                "stackType": "HttpAdvancedProxy"

            }

        ]

    },

    "_links": {

        "self": "/applications/a95e7451-d077-4ec3-a9c1-d0f3bea7f615/stacks?"

    },

    "count": 1,

    "total": 1

}

 

 

 

  • I have not tested this as I have no time at the moment but have you tried How to: Create and manage iRules on BIG-IP Next Central Manager (f5.com) to create the 2 irules in the /api/v1/spaces/default as shown in the article that seems like the F5 Common partition for the normal BIG-IP.

     

    Then you can attach the irule that references the process to your app and try ""call other_rule::my_proc $args"" or ""call /other_partition/other_rule::procname args"" as shown in call (f5.com) as the other partition could the "default" one. Also test without specifying a partition as maybe it is not needed as the two irules could be in the background in the same place.

     

     

    Also your call call "/app/default:service_2/proclibrary::responder" seems strange as you can test it to be just  "/app/default/<irule>::<prco>" name that is as you deployed it in the GUI not as in the description, for example "/app/default/proc_irule::proc_1".

     

    If nothing works you can join the Group: BIG-IP Next Academy | DevCentral (f5.com) as maybe the question could get an answer there.