28-May-2019 04:13
Hi all,
currently we are using F5 device model : BIG-IP-2200, We want to know the API url for below list of functions
Create Irule Path : Local Traffic -> Irules -> IruleList
Add Irule to Workspace Path : Local Traffic -> Irules -> LX Workspace
Add Extension to Workspace Path : Local Traffic -> Irules -> LX Plugins
could anyone let us know.
Thanks in advance.
28-May-2019 05:04
Take a look at CloudDocs, this is where you'll find all the current API documentation.
iRules
https://clouddocs.f5.com/api/icontrol-rest/APIRef_tm_ltm_rule.html
iLX Workspace
https://clouddocs.f5.com/api/icontrol-rest/APIRef_tm_ilx_workspace.html
iLX Plugin
https://clouddocs.f5.com/api/icontrol-rest/APIRef_tm_ilx_plugin.html
There is also a good Article written by Satoshi
https://devcentral.f5.com/s/articles/creating-irules-lx-via-icontrol-rest-33119
29-May-2019 02:33
Thanks for sharing the document. We were able to create irule successfully but unable to add a new irule to existing work space the given document says about uploading .js and tcl file in existing irule or extensuion. Do you know procedure to add a new irule or extension
29-May-2019
05:18
- last edited on
24-Mar-2022
01:21
by
li-migration
You need to create the file manually first, then overwrite the file, it's all documented in 's article. There are three steps needed to add a new iRule
Reference:
https://devcentral.f5.com/s/articles/creating-irules-lx-via-icontrol-rest-33119
10-Sep-2019
02:42
- last edited on
22-Nov-2022
07:48
by
JimmyPackets
Here is an excerpt from my Ansible uri-module based approach to create LTM iRules.
(I dont know if it can be used for iRule/LX as well. Sorry for hijacking this thread.)
The iRules are stored as separate files in a sub-directory on the Ansible host.
Now there is a 1st task to create "empty" iRules first and a 2nd one to actually push the files contents to the newly added iRules:
- name: block of tasks to create iRules
block:
- name: create empty iRules
uri:
validate_certs: no
url: https://{{ inventory_hostname }}/mgmt/tm/ltm/rule
method: POST
headers:
X-F5-Auth-Token: "{{ device_info[inventory_hostname].token }}"
X-F5-REST-Coordination-Id: "{{ transaction_data.json.transId }}"
body_format: json
body:
name: "{{ item.name }}"
with_items: "{{ hostvars[inventory_hostname].irules }}"
when: item.name not in irule_list
- name: push TCL code into empty iRules
uri:
validate_certs: no
url: https://{{ inventory_hostname }}/mgmt/tm/ltm/rule/{{ item.name }}
method: PATCH
headers:
X-F5-Auth-Token: "{{ device_info[inventory_hostname].token }}"
X-F5-REST-Coordination-Id: "{{ transaction_data.json.transId }}"
body_format: json
body:
apiAnonymous: "{{ lookup('file', '~/irules/%s.tcl' | format(item.name)) }}"
with_items: "{{ hostvars[inventory_hostname].irules }}"
when: item.name not in irule_list
when: irule_dict is defined
The code above is just an exerpt from a transaction based approach to get the job done.
It requires the aquisition of an auth token in advance and specific inventories.
But it hopefully illustrates the concept (method, path, content).