maqsood1 Absent Member.
Absent Member.
1066 views

NetIQ REST driver - Issue Http Get on Pub ITP

NetiQ IDM 4.5.x
REST driver shim

Hello

I have NETIQ Rest driver shim where subscriber channel policy issues http get as part of driver-operaton-data custom commands


<nds dtdversion="4.0">
<source>
<product version="4.5.6.0">Identity Manager</product>
<contact>NetIQ Corporation</contact>
</source>
<input>
<driver-operation-data api="targetURL:SOMEURL" class-name="User" command="custom-IDM-JOB-POLL-EMPLOYEE" event-id="trigger-job:IDM-JOB-POLL-EMPLOYEE#20181210145639#0#0" src-dn="">
<request method="GET" url="SOMEURL">
<header accept="application/json" content-type="application/json"/>
<value>{}</value>
</request>
</driver-operation-data>
</input>
</nds>



as part of the reply from the service i get some data from the service on the publisher input



<nds dtdversion="3.0">
<source>
<product build="20170130_0359" version="1.0.0.1">Identity Manager REST Driver</product>
<contact>NetIQ Corporation.</contact>
</source>
<output>
<status event-id="trigger-job:IDM-JOB-POLL-EMPLOYEE#20181210143916#0#0" level="success" type="driver-general">
<driver-operation-data api="targetURL:somurl" class-name="User" command="custom-IDM-JOB-POLL-EMPLOYEE" dest-dn="" event-id="trigger-job:IDM-JOB-POLL-EMPLOYEE#20181210143916#0#0" src-dn="">
<response method="GET" url="SOMEURL">
<header accept="application/json" content-type="application/json"/>
<value message="OK" status="200">SOMEDATA</value>
</response>
</driver-operation-data>
</status>
</output>
</nds>


and now based on the data I recieved from the service i want to issue another http get from the publisher input, How to do that like query back??, Any examples would be great.


Regards,
Maqsood.
Labels (1)
0 Likes
12 Replies
maqsood1 Absent Member.
Absent Member.

Re: NetIQ REST driver - Issue Http Get on Pub ITP

Guys any feedback?

maqsood;2492261 wrote:
NetiQ IDM 4.5.x
REST driver shim

Hello

I have NETIQ Rest driver shim where subscriber channel policy issues http get as part of driver-operaton-data custom commands


<nds dtdversion="4.0">
<source>
<product version="4.5.6.0">Identity Manager</product>
<contact>NetIQ Corporation</contact>
</source>
<input>
<driver-operation-data api="targetURL:SOMEURL" class-name="User" command="custom-IDM-JOB-POLL-EMPLOYEE" event-id="trigger-job:IDM-JOB-POLL-EMPLOYEE#20181210145639#0#0" src-dn="">
<request method="GET" url="SOMEURL">
<header accept="application/json" content-type="application/json"/>
<value>{}</value>
</request>
</driver-operation-data>
</input>
</nds>



as part of the reply from the service i get some data from the service on the publisher input



<nds dtdversion="3.0">
<source>
<product build="20170130_0359" version="1.0.0.1">Identity Manager REST Driver</product>
<contact>NetIQ Corporation.</contact>
</source>
<output>
<status event-id="trigger-job:IDM-JOB-POLL-EMPLOYEE#20181210143916#0#0" level="success" type="driver-general">
<driver-operation-data api="targetURL:somurl" class-name="User" command="custom-IDM-JOB-POLL-EMPLOYEE" dest-dn="" event-id="trigger-job:IDM-JOB-POLL-EMPLOYEE#20181210143916#0#0" src-dn="">
<response method="GET" url="SOMEURL">
<header accept="application/json" content-type="application/json"/>
<value message="OK" status="200">SOMEDATA</value>
</response>
</driver-operation-data>
</status>
</output>
</nds>


and now based on the data I recieved from the service i want to issue another http get from the publisher input, How to do that like query back??, Any examples would be great.


Regards,
Maqsood.
0 Likes
Knowledge Partner
Knowledge Partner

Re: NetIQ REST driver - Issue Http Get on Pub ITP

On 12/16/2018 10:14 AM, maqsood wrote:
>
> @geoff any idea?
>
>
> maqsood;2492261 Wrote:
>> NetiQ IDM 4.5.x
>> REST driver shim
>>
>> Hello
>>
>> I have NETIQ Rest driver shim where subscriber channel policy issues
>> http get as part of driver-operaton-data custom commands
>>
>>
>>>

> Code:
> --------------------
> > > <nds dtdversion="4.0">

> > <source>
> > <product version="4.5.6.0">Identity Manager</product>
> > <contact>NetIQ Corporation</contact>
> > </source>
> > <input>
> > <driver-operation-data api="targetURL:SOMEURL" class-name="User" command="custom-IDM-JOB-POLL-EMPLOYEE" event-id="trigger-job:IDM-JOB-POLL-EMPLOYEE#20181210145639#0#0" src-dn="">
> > <request method="GET" url="SOMEURL">
> > <header accept="application/json" content-type="application/json"/>
> > <value>{}</value>
> > </request>
> > </driver-operation-data>
> > </input>
> > </nds>
> >
> >

> --------------------
>>>

>>
>> as part of the reply from the service i get some data from the service
>> on the publisher input
>>
>>
>>
>>>

> Code:
> --------------------
> > > <nds dtdversion="3.0">

> > <source>
> > <product build="20170130_0359" version="1.0.0.1">Identity Manager REST Driver</product>
> > <contact>NetIQ Corporation.</contact>
> > </source>
> > <output>
> > <status event-id="trigger-job:IDM-JOB-POLL-EMPLOYEE#20181210143916#0#0" level="success" type="driver-general">
> > <driver-operation-data api="targetURL:somurl" class-name="User" command="custom-IDM-JOB-POLL-EMPLOYEE" dest-dn="" event-id="trigger-job:IDM-JOB-POLL-EMPLOYEE#20181210143916#0#0" src-dn="">
> > <response method="GET" url="SOMEURL">
> > <header accept="application/json" content-type="application/json"/>
> > <value message="OK" status="200">SOMEDATA</value>
> > </response>
> > </driver-operation-data>
> > </status>
> > </output>
> > </nds>
> >

> --------------------
>>>

>>
>> and now based on the data I recieved from the service i want to issue
>> another http get from the publisher input, How to do that like query
>> back??, Any examples would be great.


So you query for {} (I assume you cleaned up the exmple). You get back
SOMEDATA.

So out of the box, the shim should reformat any JSON into XML as it
passes through the Input Transform.

Then you can XPATH it out.

If not, at this point you could test for:
if operation = status
if XPATH true driver-operation-data/response/value
set local variable MY-DATA driver-operation-data/response/value


Or something like that.

0 Likes
maqsood1 Absent Member.
Absent Member.

Re: NetIQ REST driver - Issue Http Get on Pub ITP

Hello

Actualy i have no issues reading data in Itp (json, xml, text, whatever) - Actually based on the data i recieved from service i wanna issue another query back (http get) to the service from Itp? how do i do it?

In other normal NetIQ drivers, you do something Query-Source or source-attribute while staying on publisher channel, but i dont know how do it the similar on REST driver


Regards,
Maqsood.
0 Likes
Knowledge Partner
Knowledge Partner

Re: NetIQ REST driver - Issue Http Get on Pub ITP

On 12/16/2018 4:14 PM, maqsood wrote:
>
> Hello
>
> Actualy i have no issues reading data in Itp (json, xml, text, whatever)
> - Actually based on the data i recieved from service i wanna issue
> another query back (http get) to the service from Itp? how do i do it?
>
> In other normal NetIQ drivers, you do something Query-Source or
> source-attribute while staying on publisher channel, but i dont know
> how do it the similar on REST driver


If you issue a query to Source in the ITP it won't go through the OTP
and the OTP has the XML to JSON conversion policies. Which is probably
what you are thinking of.

You could build it yourself in XML if needed.

0 Likes
maqsood1 Absent Member.
Absent Member.

Re: NetIQ REST driver - Issue Http Get on Pub ITP

How to build XML on publisher that sends http GET to service , any examples?



geoffc;2492653 wrote:
On 12/16/2018 4:14 PM, maqsood wrote:
>
> Hello
>
> Actualy i have no issues reading data in Itp (json, xml, text, whatever)
> - Actually based on the data i recieved from service i wanna issue
> another query back (http get) to the service from Itp? how do i do it?
>
> In other normal NetIQ drivers, you do something Query-Source or
> source-attribute while staying on publisher channel, but i dont know
> how do it the similar on REST driver


If you issue a query to Source in the ITP it won't go through the OTP
and the OTP has the XML to JSON conversion policies. Which is probably
what you are thinking of.

You could build it yourself in XML if needed.
0 Likes
Knowledge Partner
Knowledge Partner

Re: NetIQ REST driver - Issue Http Get on Pub ITP

On 12/17/2018 3:14 AM, maqsood wrote:
>
> How to build XML on publisher that sends http GET to service , any
> examples?
>
>
>
> geoffc;2492653 Wrote:
>> On 12/16/2018 4:14 PM, maqsood wrote:
>>>
>>> Hello
>>>
>>> Actualy i have no issues reading data in Itp (json, xml, text,

>> whatever)
>>> - Actually based on the data i recieved from service i wanna issue
>>> another query back (http get) to the service from Itp? how do i do

>> it?
>>>
>>> In other normal NetIQ drivers, you do something Query-Source or
>>> source-attribute while staying on publisher channel, but i dont know
>>> how do it the similar on REST driver

>>
>> If you issue a query to Source in the ITP it won't go through the OTP
>> and the OTP has the XML to JSON conversion policies. Which is probably
>> what you are thinking of.
>>
>> You could build it yourself in XML if needed.


Show some trace, of your Sub channel event to the service, then the
response, and where you want to do something with it. Context really
matters here.


0 Likes
maqsood1 Absent Member.
Absent Member.

Re: NetIQ REST driver - Issue Http Get on Pub ITP

This is what you get on the publisher channel in trace as result of trigger command from subscriber

<nds dtdversion="3.0">
<source>
<product build="20170130_0359" version="1.0.0.1">Identity Manager REST Driver</product>
<contact>NetIQ Corporation.</contact>
</source>
<output>
<status event-id="trigger-job:IDM-JOB-POLL-EMPLOYEE#20181210143916#0#0" level="success" type="driver-general">
<driver-operation-data api="targetURL:somurl" class-name="User" command="custom-IDM-JOB-POLL-EMPLOYEE" dest-dn="" event-id="trigger-job:IDM-JOB-POLL-EMPLOYEE#20181210143916#0#0" src-dn="">
<response method="GET" url="SOMEURL">
<header accept="application/json" content-type="application/json"/>
<value message="OK" status="200">SOMEDATA</value>
</response>
</driver-operation-data>
</status>
</output>
</nds>


This is how i read the data on pub itp


<rule>
<description>(CUSTOM)(ShimJSONtoNETIQ) EMPLOYEE POLL</description>
<conditions>
<and>
<if-class-name mode="nocase" op="not-equal">DirXML-Driver</if-class-name>
<if-operation mode="regex" op="equal">status</if-operation>
</and>
</conditions>
<actions>
<do-if>
<arg-conditions>
<or>
<if-operation mode="regex" op="equal">status</if-operation>
</or>
</arg-conditions>
<arg-actions>
<do-if>
<arg-conditions>
<or>
<if-xpath op="true">./driver-operation-data[@command="custom-IDM-JOB-POLL-EMPLOYEE"]</if-xpath>
<if-xpath op="true">./driver-operation-data[@command="custom-IDM-JOB-POLL-EMPLOYEE-NEW"]</if-xpath>
</or>
</arg-conditions>
<arg-actions>
<do-set-local-variable name="getDN" scope="policy">
<arg-string>
<token-xpath expression="./driver-operation-data/@src-dn"/>
</arg-string>
</do-set-local-variable>
<do-set-local-variable name="StatusValue" scope="policy">
<arg-string>
<token-xpath expression="./driver-operation-data/response/value/@status"/>
</arg-string>
</do-set-local-variable>
<do-trace-message>
<arg-string>
<token-text xml:space="preserve">Status value => </token-text>
<token-local-variable name="StatusValue"/>
</arg-string>
</do-trace-message>
<do-set-local-variable name="MessageValue" scope="policy">
<arg-string>
<token-xpath expression="./driver-operation-data/response/value/@message"/>
</arg-string>
</do-set-local-variable>
<do-trace-message>
<arg-string>
<token-text xml:space="preserve">Status value => </token-text>
<token-local-variable name="MessageValue"/>
</arg-string>
</do-trace-message>
<do-set-local-variable name="MessageValueText" scope="policy">
<arg-string>
<token-xpath expression="./driver-operation-data/response/value/text()"/>
</arg-string>
</do-set-local-variable>
</arg-actions>
<arg-actions/>
</do-if>
</arg-actions>
<arg-actions/>
</do-if>
</actions>
</rule>


and then read the payload:



<rule>
<description>Successfull poll-employees command handler actions for changes</description>
<conditions>
<or>
<if-operation mode="regex" op="equal">status</if-operation>
</or>
<or>
<if-local-variable mode="nocase" name="StatusValue" op="equal">200</if-local-variable>
</or>
<or>
<if-xpath op="true">./driver-operation-data[@command="custom-IDM-JOB-POLL-EMPLOYEE"]</if-xpath>
</or>
</conditions>
<actions>
<do-for-each>
<arg-node-set>
<token-local-variable name="entry"/>
</arg-node-set>
<arg-actions>
<do-set-local-variable name="user-entry" scope="policy">
<arg-node-set>
<token-local-variable name="current-node"/>
</arg-node-set>
</do-set-local-variable>
<do-set-local-variable name="user-entry-id" scope="policy">
<arg-string>
<token-xpath expression="$user-entry/*[local-name()='id']/text()"/>
</arg-string>
</do-set-local-variable>
<do-trace-message>
<arg-string>
<token-text xml:space="preserve">============================</token-text>
</arg-string>
</do-trace-message>
<do-trace-message>
<arg-string>
<token-text xml:space="preserve">USER ENTRY ID => </token-text>
<token-local-variable name="user-entry-id"/>
</arg-string>
</do-trace-message>
<do-set-local-variable name="user-entry-lastModifiedWithTZ" scope="policy">
<arg-string>
<token-xpath expression="$user-entry/*//*[local-name()='lastModifiedWithTZ']/text()"/>
</arg-string>
</do-set-local-variable>
<do-trace-message>
<arg-string>
<token-text xml:space="preserve">USER ENTRY LASTMODIFIED => </token-text>
<token-local-variable name="user-entry-lastModifiedWithTZ"/>
</arg-string>
</do-trace-message>
</arg-actions>
</do-for-each>
<do-strip-xpath expression="./driver-operation-data"/>
</actions>
</rule>



Now I want to issue another http get for ID recieved here => <token-xpath expression="$user-entry/*[local-name()='id']/text()"/>
0 Likes
Knowledge Partner
Knowledge Partner

Re: NetIQ REST driver - Issue Http Get on Pub ITP

On 12/17/2018 6:34 AM, maqsood wrote:
>
> This is what you get on the publisher channel in trace as result of
> trigger command from subscriber
>
> <nds dtdversion="3.0">
> <source>
> <product build="20170130_0359" version="1.0.0.1">Identity Manager
> REST Driver</product>
> <contact>NetIQ Corporation.</contact>
> </source>
> <output>
> <status
> event-id="trigger-job:IDM-JOB-POLL-EMPLOYEE#20181210143916#0#0"
> level="success" type="driver-general">
> <driver-operation-data api="targetURL:somurl" class-name="User"
> command="custom-IDM-JOB-POLL-EMPLOYEE" dest-dn=""
> event-id="trigger-job:IDM-JOB-POLL-EMPLOYEE#20181210143916#0#0"
> src-dn="">
> <response method="GET" url="SOMEURL">
> <header accept="application/json"
> content-type="application/json"/>
> <value message="OK" status="200">SOMEDATA</value>
> </response>
> </driver-operation-data>
> </status>
> </output>
> </nds>
>
>
> This is how i read the data on pub itp
>
>
> <rule>
> <description>(CUSTOM)(ShimJSONtoNETIQ) EMPLOYEE POLL</description>
> <conditions>
> <and>
> <if-class-name mode="nocase"
> op="not-equal">DirXML-Driver</if-class-name>
> <if-operation mode="regex" op="equal">status</if-operation>
> </and>
> </conditions>
> <actions>
> <do-if>
> <arg-conditions>
> <or>
> <if-operation mode="regex" op="equal">status</if-operation>
> </or>
> </arg-conditions>
> <arg-actions>
> <do-if>
> <arg-conditions>
> <or>
> <if-xpath
> op="true">./driver-operation-data[@command="custom-IDM-JOB-POLL-EMPLOYEE"]</if-xpath>
> <if-xpath
> op="true">./driver-operation-data[@command="custom-IDM-JOB-POLL-EMPLOYEE-NEW"]</if-xpath>
> </or>
> </arg-conditions>
> <arg-actions>
> <do-set-local-variable name="getDN" scope="policy">
> <arg-string>
> <token-xpath expression="./driver-operation-data/@src-dn"/>
> </arg-string>
> </do-set-local-variable>
> <do-set-local-variable name="StatusValue" scope="policy">
> <arg-string>
> <token-xpath
> expression="./driver-operation-data/response/value/@status"/>
> </arg-string>
> </do-set-local-variable>
> <do-trace-message>
> <arg-string>
> <token-text xml:space="preserve">Status value => </token-text>
> <token-local-variable name="StatusValue"/>
> </arg-string>
> </do-trace-message>
> <do-set-local-variable name="MessageValue" scope="policy">
> <arg-string>
> <token-xpath
> expression="./driver-operation-data/response/value/@message"/>
> </arg-string>
> </do-set-local-variable>
> <do-trace-message>
> <arg-string>
> <token-text xml:space="preserve">Status value => </token-text>
> <token-local-variable name="MessageValue"/>
> </arg-string>
> </do-trace-message>
> <do-set-local-variable name="MessageValueText" scope="policy">
> <arg-string>
> <token-xpath
> expression="./driver-operation-data/response/value/text()"/>
> </arg-string>
> </do-set-local-variable>
> </arg-actions>
> <arg-actions/>
> </do-if>
> </arg-actions>
> <arg-actions/>
> </do-if>
> </actions>
> </rule>
>
>
> and then read the payload:
>
>
>
> <rule>
> <description>Successfull poll-employees command handler actions for
> changes</description>
> <conditions>
> <or>
> <if-operation mode="regex" op="equal">status</if-operation>
> </or>
> <or>
> <if-local-variable mode="nocase" name="StatusValue"
> op="equal">200</if-local-variable>
> </or>
> <or>
> <if-xpath
> op="true">./driver-operation-data[@command="custom-IDM-JOB-POLL-EMPLOYEE"]</if-xpath>
> </or>
> </conditions>
> <actions>
> <do-for-each>
> <arg-node-set>
> <token-local-variable name="entry"/>
> </arg-node-set>
> <arg-actions>
> <do-set-local-variable name="user-entry" scope="policy">
> <arg-node-set>
> <token-local-variable name="current-node"/>
> </arg-node-set>
> </do-set-local-variable>
> <do-set-local-variable name="user-entry-id" scope="policy">
> <arg-string>
> <token-xpath
> expression="$user-entry/*[local-name()='id']/text()"/>
> </arg-string>
> </do-set-local-variable>
> <do-trace-message>
> <arg-string>
> <token-text
> xml:space="preserve">============================</token-text>
> </arg-string>
> </do-trace-message>
> <do-trace-message>
> <arg-string>
> <token-text xml:space="preserve">USER ENTRY ID => </token-text>
> <token-local-variable name="user-entry-id"/>
> </arg-string>
> </do-trace-message>
> <do-set-local-variable name="user-entry-lastModifiedWithTZ"
> scope="policy">
> <arg-string>
> <token-xpath
> expression="$user-entry/*//*[local-name()='lastModifiedWithTZ']/text()"/>
> </arg-string>
> </do-set-local-variable>
> <do-trace-message>
> <arg-string>
> <token-text xml:space="preserve">USER ENTRY LASTMODIFIED =>
> </token-text>
> <token-local-variable name="user-entry-lastModifiedWithTZ"/>
> </arg-string>
> </do-trace-message>
> </arg-actions>
> </do-for-each>
> <do-strip-xpath expression="./driver-operation-data"/>
> </actions>
> </rule>
>
>
>
> Now I want to issue another http get for ID recieved here =>
> <token-xpath expression="$user-entry/*[local-name()='id']/text()"/>


Can you instead of dealing with it in the ITP, deal with it in the ETP?

I.e. <trigger> comes in, sub-ETP reacts, makes query into variable.

Then once you have th evariable, test with XPATH or whatever. Finally do
the query you want from the current rule in sub-ETP and then query dest
as needed? Will go through OTP so should be good.


0 Likes
maqsood1 Absent Member.
Absent Member.

Re: NetIQ REST driver - Issue Http Get on Pub ITP

You mean the response from the service i will have back available on Etp? Never done this before, but i can try..
0 Likes
Knowledge Partner
Knowledge Partner

Re: NetIQ REST driver - Issue Http Get on Pub ITP

On 12/17/2018 9:34 AM, maqsood wrote:
>
> You mean the response from the service i will have back available on
> Etp? Never done this before, but i can try..


I mean, if you do your query in a policy set (ETP, CTP) to source/Dest
as needed, into a local variable, then you can continue processing in
the policy you started it from.

Now if in order to properly reformat a value so that merge/optimize
modify works and keeps data consistent, you need to query for a second
piece of information then ya, that is a problem, but it did not seem
like that


0 Likes
maqsood1 Absent Member.
Absent Member.

Re: NetIQ REST driver - Issue Http Get on Pub ITP

Can you show me some code snippet how do you want me to test this from Etp ?..




geoffc;2492695 wrote:
On 12/17/2018 9:34 AM, maqsood wrote:
>
> You mean the response from the service i will have back available on
> Etp? Never done this before, but i can try..


I mean, if you do your query in a policy set (ETP, CTP) to source/Dest
as needed, into a local variable, then you can continue processing in
the policy you started it from.

Now if in order to properly reformat a value so that merge/optimize
modify works and keeps data consistent, you need to query for a second
piece of information then ya, that is a problem, but it did not seem
like that
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.