Hi Tatiana,
I've already asked our Mainframe team open a support case as we developers are not allowed to do so. It's been close to 2 months and I don't see any reply yet.
Coming to the question you have asked.
I don't see any output when I run the JCL so I'm unable to figure out what's the issue.
Yesterday when I tried with a different script and I got the below response. The JCL took sometime to complete.
000003 //S5QCUR1 EXEC PGM=BPXBATCH,
000004 // REGION=0M
000005 //STDPARM DD *
000006 SH cd /appshare/4j00/road4z/bin;
000007 curl --get -v URL
000008 https://apigw-int.dev.com/XB80/audit/v1/ca/auditChanges
000009 -H "Content-Type:application/json"
000010 -H "client-metadata:{"appOrg": "com.xxx.fg", "appCode": "XXXX",
000011 "appVersion": "v1.2.3", "locationId": "04538", "assetId": "PROD",
000012 "operatorId": "999996541", "legacyId": "234123411",
000013 "ipAddress": "127.0.0.1"}"
000014 -H "Content-Length: 411"
000015 -H "apigw-int.devfg.rbc.com"
000016 -H "apikey: xWcFqByCZvFv1uFYoNuCqLmrQy9JdXdO"
000017 -H "requestUniqueId: 24345678941"
000018 --key '/dev/API/key.pem'
000019 --cacert '/dev/API/ca.pem'
000020 /*
000021 //*STDOUT DD SYSOUT=*
000022 //STDOUT DD DSN=BB0024.PDGAUDIT.RESP.LOGS,
000023 // DISP=OLD
000024 //STDERR DD SYSOUT=*
Output:
curl: (52) Empty reply from server
I tried another way as below and I got the error, somehow the client meta data is not getting accepted. Without the clientmetadata, Apikey & RequestUniqueId the call is going perfect, however for security reasons we need to pass these parameters for a secure call.
HTTP-CODE: 400 BAD_REQUEST _error_info_catched.","additionalStatus":Ý{"statusCode":"XB80-10001","severity":"Error","statusDesc":"client-metadata error: field: appOrg can't be empty. field: appCode can't be empty. field: appVersion can't be empty. field: operatorId can't be empty. "}¨}}<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
//S5QCUR1 EXEC PGM=BPXBATCH,
// REGION=0M
//STDPARM DD *
SH cd /appshare/4j00/road4z/bin;
curl --get -v https://apigw-int.devfg.rbc.com/XB80/pdg-audit/v1/ca/auditChanges
-H "Accept: application/json"
-H "client-metadata" : {
"appOrg : com.xxx.fg"
"appCode : XXXX"
"appVersion : v1.2.3"
"operatorId : 999996541"
-H "apikey: xWcFqByCZvFv1uFYoNuCqLmrQy9JdXdO"
-H "requestUniqueId: 24345678941"
--key '/dev/API/key.pem'
--cacert '/dev/API/ca.pem'
/*
//*STDOUT DD SYSOUT=*
//STDOUT DD DSN=BB0024.PDGAUDIT.RESP.LOGS,
// DISP=OLD
//STDERR DD SYSOUT=*
Thanks,
Santosh.
------------------------------
Santosh Reddy Chintagari
Technical Systems Analyst
Rocket Forum Shared Account
------------------------------
Original Message:
Sent: 03-10-2023 03:51
From: Tatiana Balaburkina
Subject: Calling an Apigee endpoint URL from a JCL using CURL
Hi Santosh,
Could you share the JCL output? Since your company is on support, would you like to open a support case via customer portal https://my.rocketsoftware.com/?
------------------------------
Tatiana Balaburkina
Engineering Manager
Rocket Internal - All Brands
Original Message:
Sent: 03-09-2023 16:58
From: Santosh Reddy Chintagari
Subject: Calling an Apigee endpoint URL from a JCL using CURL
Hi Alexander,
In continuation to my testing this piece of calling an API from a JCL using cURL, I need some assistance please.
I've tried below script from Windows dos command and it's working fine, I get a successful response, whereas when I try the same using the JCL it isn't.
@echo off
set clientmetadata={\"appOrg\":\"com.xxx.fg\",\"appCode\":\"XXXX\",\"appVersion\":\"v1.2.3\", \"operatorId\":\"123454321\"}
echo %clientmetadata%
curl -X GET https://apigw-int.dev.xxx.com/XB80/audit/v1/ca/auditChanges ^
-H "Accept: application/json" ^
-H "client-metadata: %clientmetadata%" ^
-H "apikey: XXXXXXLATGB42AVTfzUmN47N2nY7iEE1" ^
-H "requestUniqueId: E265685E-XXXX-XXXX-9C8A-XXXXE02DC1155C"
Using JCL:
//S5QCUR1 EXEC PGM=BPXBATCH,
// REGION=0M
//STDPARM DD *
SH cd /appshare/4j00/road4z/bin;
set clientmetadata={\"appOrg\":\"com.xxx.fg\",\"appCode\":\"XXXX\",
\"appVersion\":\"v1.2.3\", \"operatorId\":\"123454321\"}
echo %clientmetadata%
curl --get -v https://apigw-int.dev.xxx.com/XB80/audit/v1/ca/auditChanges
-H "Accept: application/json"
-H "client-metadata: %clientmetadata%"
-H "apikey: XXXXXXLATGB42AVTfzUmN47N2nY7iEE1"
-H "requestUniqueId: E265685E-XXXX-XXXX-9C8A-XXXXE02DC1155C"
--key '/dev/API/key.pem'
--cacert '/dev/API/ca.pem'
/*
//STDOUT DD SYSOUT=*
//STDERR DD SYSOUT=*
@Echo is a DOS command, but not sure the equivalent in Mainframe.
Any thoughts please.
Regards,
Santosh.
------------------------------
Santosh Reddy Chintagari
Technical Systems Analyst
Rocket Forum Shared Account
Original Message:
Sent: 01-19-2023 21:08
From: Alexander Klochkov
Subject: Calling an Apigee endpoint URL from a JCL using CURL
Hi Santosh Reddy Chintagari,
As I understood right you need to send some kind of POST request via curl. In that case, it doesn't matter how to do it in the console or from the JCL, so this question is more to the curl community.
the request probably should be like
curl "https://apigee.googleapis.com/v1/organizations?parent=projects/$PROJECT_ID" \ -H "$AUTH" \ -X POST \ -H "Content-Type:application/json" \ -d '{ "name":"'"$PROJECT_ID"'", "analyticsRegion":"'"$ANALYTICS_REGION"'", "runtimeType":"CLOUD", "billingType":"'"$BILLING_TYPE"'", "authorizedNetwork":"'"$NETWORK_NAME"'", "runtimeDatabaseEncryptionKeyName":"'"$RUNTIMEDB_KEY_ID"'" }'
you can try to adapt it to your situation
info from https://cloud.google.com/apigee/docs/api-platform/get-started/install-cli
Thanks,
Alexander
------------------------------
Alexander Klochkov
QA
Rocket Internal - All Brands
Vilnius LT
Original Message:
Sent: 01-06-2023 15:45
From: Santosh Reddy Chintagari
Subject: Calling an Apigee endpoint URL from a JCL using CURL
Hi,
I've been working to call an API via JCL using CURL by passing public & private keys of the certificate. I was able to successfully make a call to the PCF endpoint URL using below JCL where I got the request as expected by the API developer, however, due to security reasons now I need to make a call to an Apigee endpoint instead of PCF cloud directly. But for that I've been asked by our API team to pass below 3 parameters while making a CURL call.
1.) Client-meta data
2.) API-key
3.) requestUniqueID
Below is the JCL.
//ABCJ4API JOB (XXXX,P),'CURL',MSGCLASS=T,SCHENV=SYSPLEX,USER=XXX
//*
//S5QCUR1 EXEC PGM=BPXBATCH,
// REGION=0M
//STDPARM DD *
SH cd /appshare/XXXX/road4z/bin;
curl --get -v URL
https://apigw-int.devxx.xxx.com/xxxx/pdg/v1
--key '/appshare/API/key.pem'
--cacert '/appshare/API/ca.pem'
/*
//STDOUT DD SYSOUT=*
//STDERR DD SYSOUT=*
Please let me know how to pass the above 3 parameters using CURL and if this is not the correct forum, please let me know where I can post and get some help.
Thanks in advance.
------------------------------
Santosh Reddy Chintagari
Technical Systems Analyst
Rocket Forum Shared Account
------------------------------