First question: Is it possible to modify job definition with REST API? Can you show an example of code to do it?
I was able to do it with a reports and METHOD="PUT":
PROC HTTP METHOD="PUT" URL="&BASE_URI./&dstReportURI./content" OAUTH_BEARER=SAS_SERVICES
IN=&contentFile. HEADEROUT=hdrout ;
HEADERS "Accept"="*/*"
"Content-Type"="application/vnd.sas.report.content+json"
"IF-MATCH"=""&ETAG""
"IF-UNMODIFIED-SINCE"=&MODDATE.;
RUN;
Second question: How can I extract ETAG from the existing job? I was able to extract headers from the report, but a similar code doesn't return ETAG for jobs.
This code returns header info with ETAG for reports:
PROC HTTP METHOD="HEAD" URL="&BASE_URI&report_uri."
OUT=rep_id HEADEROUT=hdrout OAUTH_BEARER=SAS_SERVICES;
HEADERS "Accept"="application/vnd.sas.report+json"
"Content-Type"="application/vnd.sas.report+json";
RUN;
This code returns a header content, but with no ETAG for the job:
PROC HTTP METHOD="HEAD" URL="&BASE_URI/jobDefinitions/definitions/&job_uri
OUT=rep_id HEADEROUT=hdrout OAUTH_BEARER=SAS_SERVICES;
HEADERS "Accept"="application/vnd.sas.job.definition+json"
"Content-Type"="application/vnd.sas.job.definition+json";
RUN;
At that moment I see 2 milestones:
1. How to extract ETAG from existing job?
2. How to update existing report with new code/parameter?
Thanks in advance,
Ivan