<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Modify Job Definition with REST API in Administration and Deployment</title>
    <link>https://communities.sas.com/t5/Administration-and-Deployment/Modify-Job-Definition-with-REST-API/m-p/793146#M23729</link>
    <description>&lt;P&gt;First question: Is it possible to modify job definition with REST API? Can you show an example of code to do it?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I was able to do it with a reports and METHOD="PUT":&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC HTTP METHOD="PUT" URL="&amp;amp;BASE_URI./&amp;amp;dstReportURI./content" OAUTH_BEARER=SAS_SERVICES
IN=&amp;amp;contentFile. HEADEROUT=hdrout ;
HEADERS "Accept"="*/*"
"Content-Type"="application/vnd.sas.report.content+json"
"IF-MATCH"=""&amp;amp;ETAG""
"IF-UNMODIFIED-SINCE"=&amp;amp;MODDATE.;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This code returns header info with ETAG for reports:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;	PROC HTTP METHOD="HEAD" URL="&amp;amp;BASE_URI&amp;amp;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;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This code returns a header content, but with no ETAG for the job:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;	PROC HTTP METHOD="HEAD" URL="&amp;amp;BASE_URI/jobDefinitions/definitions/&amp;amp;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;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;At that moment I see 2 milestones:&lt;/P&gt;
&lt;P&gt;1. How to extract ETAG from existing job?&lt;/P&gt;
&lt;P&gt;2. How to update existing report with new code/parameter?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance,&lt;/P&gt;
&lt;P&gt;Ivan&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 28 Jan 2022 14:59:28 GMT</pubDate>
    <dc:creator>idziemianczyk</dc:creator>
    <dc:date>2022-01-28T14:59:28Z</dc:date>
    <item>
      <title>Modify Job Definition with REST API</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Modify-Job-Definition-with-REST-API/m-p/793146#M23729</link>
      <description>&lt;P&gt;First question: Is it possible to modify job definition with REST API? Can you show an example of code to do it?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I was able to do it with a reports and METHOD="PUT":&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC HTTP METHOD="PUT" URL="&amp;amp;BASE_URI./&amp;amp;dstReportURI./content" OAUTH_BEARER=SAS_SERVICES
IN=&amp;amp;contentFile. HEADEROUT=hdrout ;
HEADERS "Accept"="*/*"
"Content-Type"="application/vnd.sas.report.content+json"
"IF-MATCH"=""&amp;amp;ETAG""
"IF-UNMODIFIED-SINCE"=&amp;amp;MODDATE.;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This code returns header info with ETAG for reports:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;	PROC HTTP METHOD="HEAD" URL="&amp;amp;BASE_URI&amp;amp;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;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This code returns a header content, but with no ETAG for the job:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;	PROC HTTP METHOD="HEAD" URL="&amp;amp;BASE_URI/jobDefinitions/definitions/&amp;amp;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;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;At that moment I see 2 milestones:&lt;/P&gt;
&lt;P&gt;1. How to extract ETAG from existing job?&lt;/P&gt;
&lt;P&gt;2. How to update existing report with new code/parameter?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance,&lt;/P&gt;
&lt;P&gt;Ivan&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jan 2022 14:59:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Modify-Job-Definition-with-REST-API/m-p/793146#M23729</guid>
      <dc:creator>idziemianczyk</dc:creator>
      <dc:date>2022-01-28T14:59:28Z</dc:date>
    </item>
    <item>
      <title>Re: Modify Job Definition with REST API</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Modify-Job-Definition-with-REST-API/m-p/793195#M23730</link>
      <description>&lt;P&gt;Hi Ivan (&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/54649"&gt;@idziemianczyk&lt;/a&gt;&amp;nbsp;),&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;1. How to extract ETAG from existing job?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I'm not sure why your response does not contain an ETag in the header? I passed an API call for a job definition and I see the ETag header in the response:&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="getJobDefinition.jpg" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/67958i3D4E8DD1717A365A/image-size/large?v=v2&amp;amp;px=999" role="button" title="getJobDefinition.jpg" alt="getJobDefinition.jpg" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;2. How to update existing report with new code/parameter?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Take a look at the SAS Viya API documentation. There is a good example of a &lt;A href="https://developer.sas.com/apis/rest/Compute/#create-a-job-definition" target="_self"&gt;create job&lt;/A&gt; and an &lt;A href="https://developer.sas.com/apis/rest/Compute/#update-a-job-definition" target="_self"&gt;update job&lt;/A&gt; API call. The example uses similar parameters and code, so you should be able to see the difference in the update call.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Please let me know if I can assist further.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Joe&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jan 2022 19:27:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Modify-Job-Definition-with-REST-API/m-p/793195#M23730</guid>
      <dc:creator>joeFurbee</dc:creator>
      <dc:date>2022-01-28T19:27:37Z</dc:date>
    </item>
    <item>
      <title>Re: Modify Job Definition with REST API</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Modify-Job-Definition-with-REST-API/m-p/793824#M23741</link>
      <description>&lt;P&gt;I missed etag because I read the file in SAS code (hasn't checked the file itself). There was no ETAG.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My code for reading a header file was wrong, the line with ETAG wasn't visible. Anyway, the problem solved. Thanks a lot.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="idziemianczyk_0-1643727928905.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/68111iF95947491381F671/image-size/medium?v=v2&amp;amp;px=400" role="button" title="idziemianczyk_0-1643727928905.png" alt="idziemianczyk_0-1643727928905.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="idziemianczyk_1-1643728549661.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/68117iB35639CE8B3C4A32/image-size/medium?v=v2&amp;amp;px=400" role="button" title="idziemianczyk_1-1643728549661.png" alt="idziemianczyk_1-1643728549661.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Feb 2022 15:16:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Modify-Job-Definition-with-REST-API/m-p/793824#M23741</guid>
      <dc:creator>idziemianczyk</dc:creator>
      <dc:date>2022-02-01T15:16:47Z</dc:date>
    </item>
  </channel>
</rss>

