For future reference in case you want something a little more self-contained for those QSH/PASE calls:
https://github.com/richardschoen/QshOni
QshOni
This IBM i library contains useful CL wrapper commands to allow Qshell and Pase apps to be called and consumed from regular IBM i jobs via CL, RPG or COBOL programs. It also has a CL command to scan stdout for a specific value if you need to do something simple to check for a successful command run.
The main benefit of this wrapper is to be able to integrate Qshell/Pase applications on-the-fly with standard IBM i job streams.
QSHONI/QSHEXEC CMDLINE('curl --request POST --url +
https://xxxxx.com/token +
--header "accept: application/json" +
--header "authorization: Basic +
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx+
--data "{\"xxxxx_xxxx\": +
\"client_credentials\"}" -k > +
/tmp/token.txt') SETPKGPATH(*YES)
The SETPKGPATH parm will set the path to the Yum packages from IBM as wellas the multithreading.
You can also monitor for an error on the command if the QSH/PASE command fails and can write STDOUT results to an IFS file, OUTFILE, JOBLOG or Spool File.
Great for incorporating those QSH/PASE commands into standard batch jobs.
Regards,
Richard Schoen
Web:
http://www.richardschoen.net
Email: richard@xxxxxxxxxxxxxxxxx
-----Original Message-----
Subject: Re: cURL Open source installation
From: "Art Tostaine, Jr." <atostaine@xxxxxxxxx>
Date: Thu, 10 Sep 2020 19:23:17 -0400
For the archives, in my CLLE program I did cd '/qopensys/pkgs/bin', then
added an envvar to fix an error per this page:
curl: (6) getaddrinfo() thread failed to start
https://bitbucket.org/ibmi/opensource/issues/92/curllib-7653
QIBM_MULTI_THREADED=Y
I'm able to get this to run in batch and leave the returned token to the
IFS. It's a cake walk from here :-)
CLP
PGM
CD DIR('/qOpenSys/pkgs/bin/')
ADDENVVAR ENVVAR(QIBM_MULTI_THREADED) VALUE(Y)
monmsg CPFA980
STRQSH CMD('curl --request POST --url +
https://xxxxx.com/token +
--header "accept: application/json" +
--header "authorization: Basic +
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx+
--data "{\"xxxxx_xxxx\": +
\"client_credentials\"}" -k > +
/tmp/token.txt')
endpgm
As an Amazon Associate we earn from qualifying purchases.