HI Steve,
Changing to '=' as the equality operator works.
It is no longer required to use the $apiCtx()function.
Thanks,
Paul
Original Message:
Sent: 3/28/2024 11:18:00 AM
From: Steve Linn
Subject: RE: Client IP Address on Condition Editor
Hi Paul,
Since the SaaS Base Edition doesn't support the GatewayScript policy, I'm assuming the syntax you're showing is from a switch conditional. Switch conditionals use JSONata syntax where you'd use a single =
equality operator, whereas the ==
is JavaScript syntax for an equality operator. If you were to make that change, do you still require the $apiCtx()
function?
Regards,
Steve
------------------------------
Steve Linn
Senior Consulting I/T Specialist
IBM
------------------------------
Original Message:
Sent: Wed March 27, 2024 06:33 PM
From: Paul Dango
Subject: Client IP Address on Condition Editor
HI All,
We working in IBM APIC SaaS Base Edition.
In both case where we specify message.headers.x-client-ip == 'XXX.XXX.XXX.XXX' or session.clientAddress == 'XXX.XXX.XXX.XXX', we get a syntax error.
However when we specify $apiCtx().session.clientAddress = 'xxx.xxx.xxx.xxx' or $apiCtx().message.headers.x-client-ip = 'xxx.xxx.xxx.xxx', it works.
Thanks,
Paul
------------------------------
Paul Dango
Original Message:
Sent: Thu January 04, 2024 03:40 PM
From: Steve Linn
Subject: Client IP Address on Condition Editor
Hi Rajesh,
See https://www.ibm.com/docs/en/api-connect/10.0.5.x_lts?topic=reference-api-connect-context-variables, the variable name has a lower case c
not a capital C
, ie, session.clientAddress
.
Best Regards,
Steve
------------------------------
Steve Linn
Senior Consulting I/T Specialist
IBM
Original Message:
Sent: Wed December 20, 2023 03:14 AM
From: Rajesh Swai
Subject: Client IP Address on Condition Editor
Hello,
I am trying to put some condition to allow the API call from specific client IP . to achieve that I am trying to fetch the IP Address as follows , it's not working for me on APIC 10.X
session.ClientAddress == 'X.XXX.XXX.XXX'
A quick help is much appreciate !!!
Also if I want to debug on certain variables , how can I do that.
Regards,
Rajesh Swain
------------------------------
Rajesh Swai
------------------------------