Focal Point
[CLOSED] Need help passing parms in Restful Services to a schedule

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/1337065096

July 17, 2018, 04:46 PM
AnnetteTate
[CLOSED] Need help passing parms in Restful Services to a schedule
I have successfully used Restful Services in a bash script using curl to sign in, run a schedule, and signed off.

#!/bin/bash
##Sign In:
URLIN="http://${ServerName}:${ServerPort}/ibi_apps/rs/ibfs?IBIRS_action=signOn&IBIRS_userName=${UserID}&IBIRS_password=${Password}"
returnStrings=$(curl -i -H "Content-type: text/xml" -c cookies.txt -X POST ${URLIN} 2>/dev/null)

##Run Schedule:
URLRUN="http://${ServerName}:${ServerPort}/ibi_apps/rs/ibfs/WFC/Repository/${JobPath}${ScheduleName}?&IBIRS_action=run"
returnStrings3=$(curl -i -H "Content-type: text/xml" -b cookies.txt -X POST ${URLRUN} 2>run.txt)

##Sign Out:
URLOUT="http://${ServerName}:${ServerPort}/ibi_apps/rs/ibfs?IBIRS_action=signOff&IBIRS_userName=${UserID}&IBIRS_password=${Password}"
returnStrings=$(curl -i -H "Content-type: text/xml" -c cookies.txt -X POST ${URLOUT} 2>/dev/null)


---------------------------> ISSUE ISSUE ISSUE ISSUE <-----------------------------

I would like to run the above schedule and override JUST the parameters in the Task area.

---------------------------> ISSUE ISSUE ISSUE ISSUE <-----------------------------


I have tried... FAILS
IFS='' read -r -d '' URLPOST<<"EOF"
http:${ServerName}:${ServerPort}/ibi_apps/rs/ibfs/WFC/Repository/${JobPath}${ScheduleName}
EOF

IFS='' read -r -d '' URLDATA<<"EOF"
?&IBIRS_action=run&IBIRS_args=&Parm(0)=Value(0)&Parm(1)=Value(1)
EOF
*** of course the Parm and Value contain the actual parm names and values

returnStrings=$(curl -i -H "Content-type: text/xml" -b cookies.txt -X POST -d "${URLDATA}" ${URLPOST} 2>run.txt)

and get this message:

WebFOCUS Message[17]: NO_QUERY. No query information to decode.<BR>


No query information to decode.



< !--


I have tried... COMPLETES REPORT, BUT DOESN'T OVERRIDE PARMS, USES VALUE IN SCHEDULE/TASK/PARAMETERS -- SO FAILS - IMO
IFS='' read -r -d '' URLPOST<<"EOF"
http:${ServerName}:${ServerPort}/ibi_apps/rs/ibfs/WFC/Repository/${JobPath}${ScheduleName}?&IBIRS_action=run&IBIRS_args=&Parm(0)=Value(0)&Parm(1)=Value(1)
EOF
*** of course the Parm and Value contain the actual parm names and values

returnStrings=$(curl -i -H "Content-type: text/xml" -b cookies.txt -X POST ${URLPOST} 2>run.txt)


returns this message:
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
X-IBI-UrlID: URLPOST
X-XSS-protection: 0
Expires: Tue, 17 Jul 2018 20:34:42 GMT
Cache-Control: PRIVATE
Content-Type: text/html;charset=iso-8859-1
Transfer-Encoding: chunked
Date: Tue, 17 Jul 2018 20:34:41 GMT

Jb801d0d8j0404j48f1jb838j28c3c4c0caa8


**************************************************************************************************************************************************
ANY ideas would be appreciated. If I can't get this to work I will need to clone many, many schedules!! YUCK!


BTW, I have played with sending over the XML string (returned from an action of GET, stripping off successful header - down to rootObject, replacing the values in parms) and using an action of PUT, but wasn't successful with that either -- and that was a lot of work!

This message has been edited. Last edited by: FP Mod Chuck,


WebFOCUS 8.2
Windows, All Outputs
July 18, 2018, 04:25 AM
Don Garland
What version of 8 are you running, 8.0, 8.1 or 8.2?


WebFOCUS Administrator @ Worldpay FIS
PROD/DEV/TEST: 8204, SANDBOX: 8206 soon - BIP, Reportcaster, Resource Manager, EUM, HyperStage soon, DB: HIVE,Oracle,MSSQL
July 18, 2018, 09:04 AM
Efrem
From what I understand, ReportCaster itself doesn't have a way to pass Parameter Values when running a schedule.

So, RESTful Web Services would have the same functionality as it feeds off the functionality of ReportCaster.

You would actually need to update the parameter values within the schedule and then run it.
July 18, 2018, 09:40 AM
Doug
Don: We'll get the version soon.

Efrem: She wants to override the parameters that reside in the RC Schedule from a Restful post.

RC Is being called from outside of WebFOCUS.

This message has been edited. Last edited by: Doug,
July 18, 2018, 09:43 AM
TobyMills
Hi Annette!

Doug asked me to take a look here and I'm just not great with webservices.

I did read in the Caster manuals on several releases that the parameters you put in your schedule are actually turned into -SETs inside your report at run time (Caster finds your schedule in the tables and locates the parameters and issues the -SET's accordingly).

This has long been a request of Caster users though. Starting with the seemingly simple request to choose different output formats so we didn't have different schedules for different formats.

Preprocessing steps used to be an answer also.

Meantime though, I think the product manager just told me at Summit that we can do this now. I'm not sure what he meant by 'now' though. Remember those guys are usually thinking about the 'next' release which they are actively working on. So he may mean 8204.

Let me ask around. If I hit a roadblock, open a case with a simple CAR file report where you want to dynamically change the COUNTRY=JAPAN to COUNTRY=ENGLAND via your webservices call. It needs to be easy for them to try.

Maybe Chuck will know.

Toby Mills
July 18, 2018, 10:10 AM
Efrem
Yes I know.
ReportCaster itself presently doesn't support that so WebFOCUS RESTful Web Services won't support it.
It needs to first be supported in ReportCaster.
Then it will filter through to WebFOCUS RESTful Web Services.
July 18, 2018, 12:44 PM
Doug
Thanks Toby

I know We Can... But in what release?
July 18, 2018, 12:58 PM
Don Garland
Annette,

Looking through post 8201m manuals, it looks like you could create a one-time schedule. Maybe that is something to consider.


WebFOCUS Administrator @ Worldpay FIS
PROD/DEV/TEST: 8204, SANDBOX: 8206 soon - BIP, Reportcaster, Resource Manager, EUM, HyperStage soon, DB: HIVE,Oracle,MSSQL
July 18, 2018, 02:39 PM
AnnetteTate
Our version info...

8105m

gen 06232017


WebFOCUS 8.2
Windows, All Outputs
July 18, 2018, 02:48 PM
AnnetteTate
Thanks everyone for your post!

I did attempt the one-time schedule with action of PUT... but a lot of XML to manage and I was getting a lot of message about missing this or that. Also tried to do a GET and then manipulate the output from that... user (me) introduced mistakes to that too!

I will probably play with creating a new schedule some more.

Bummed that the easy button to just changes the values you want is a no-go for our version.

Worst case I clone the schedules...


WebFOCUS 8.2
Windows, All Outputs
July 23, 2018, 10:44 AM
TobyMills
Hi Annette,

Just as an update to this, there's something coming in 8204 that might be helpful. This is the word I just got from the product folks about your question:

----
In 8.2.04 you will be able to create a schedule that runs another schedule and when it runs that other schedule you will also be able to pass parameter values to the called schedule that override stored values.
You’ll be able to do this with REST as well as with the UI.
This is not exactly the same thing as running an existing schedule with a REST run command and passing parameter values. You are creating a separate schedule with this new feature, but it can be a run once and delete schedule so it accomplishes the same thing.

This is coming in 8.2.04 but not available in 8.2.03 or any earlier release.
---
Sorry I don't have anything for you in 8015m to make it easier.

Feel free to call or text if you need something. I think you still have my card:
toby_mills@blackpond.com
913 645 9999

Toby Mills, CISSP