Hi Phil,
For submit scl action:
The request url: http(s)://<hostname>:<port>/EndevorService/rest/<stc>/scl
Method: POST
The request header: authorization, Content-Type:multipart/form-data
The request body: form-data.
I'm going to give here 3 examples explaining how request body looks like.
I don't know which client you are using, so I will put the screenshot of my restlet client, as well as the curl command line.
Example 1: performing a list environment action by providing the scl string in text format
Request body will be:
And here is how the curl command looks like (hiding authorization and request url):
curl -i -X POST \
-H "Authorization:Basic xxxx" \
-H "Content-Type:multipart/form-data" \
-F "sclString=LIST ENV \"*\" ." \
-F "submitType=list" \
'http://<hostname>:<port>/EndevorService/rest/<stc>/scl'
Your response will have Content-Type:text/csv. The response body will be the result of list environment in csv format.
Example 2: performing an update element action, using the scl provided in file submitscl.txt, providing the element content in "element.ASMPGM"
Request body will be:
Inside submitscl.txt, the scl looks like:
UPDATE ELEMENT TESTELM
FROM LOCALFILE TO ENV DEV SYS ....
Please note that, "FROM LOCALFILE" will instruct web services to look for the file in "fromLocalFile" option.
And here is how the curl command looks like (hiding authorization and request url):
curl -i -X POST \
-H "Authorization:Basic xxxx" \
-H "Content-Type:multipart/form-data" \
-F "sclString=@\"./submitscl.txt\";type=text/plain;filename=\"submitscl.txt\"" \
-F "submitType=addUpdRtv" \
-F "fromLocalFile=@\"./element.ASMPGM\";filename=\"element.ASMPGM\"" \
'http://<hostname>:<port>/EndevorService/rest/<stc>/scl'
The response will be the classic application/json type, same as the rest api update element endpoint.
Example 3: performing a print element action, using the scl provided in file submitscl.txt
Request body will be:
Inside submitscl.txt, the scl looks like:
PRINT ELEMENT TESTELM FROM ENV DEV ....
TO LOCALFILE ....
Please note that, "TO LOCALFILE" will instruct web services to send you the result of print element in your response body.
And here is how the curl command looks like (hiding authorization and request url):
curl -i -X POST \
-H "Authorization:Basic xxxx" \
-H "Content-Type:multipart/form-data" \
-F "sclString=@\"./submitscl.txt\";type=text/plain;filename=\"submitscl.txt\"" \
-F "submitType=element" \
'http://<hostname>:<port>/EndevorService/rest/<stc>/scl'
The response will be the print result with Content-Type:application/octet-stream.
Also the link to APIMSGS and C1MSGS1 will be returned in your response header.
Please let me know if there's anything else you would like an example of.
I am very sorry that this action is not thoroughly documented. We are currently working on it.
Regards,
Yuanbo Xue from Endevor team
Original Message:
Sent: 07-17-2019 08:49 AM
From: Philip Gineo
Subject: Endevor RESTapi
Does anyone have an example of the syntax for "SUBMIT SCL ACTION" via the Endevor RESTapi? This is all I see in the doc:
https://docops.ca.com/ca-endevor-SCM/18-0/en/using/using-the-rest-api/submit-scl-action
------------------------------
Phil Gineo
------------------------------