BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
idziemianczyk
Obsidian | Level 7

I would like to repeat sas-admin CLI command  ./sas-admin transfer upload using REST API.

 

 

./sas-admin transfer upload --file </path/transfer_code_20210322.json>

 

When I use --verbose I don't see enough information repeat all the activities using PROC HTTP.

 

 

CLI --verbose response with uploading the file. I would like to prepare REST API query to repeat the same steps. 

POST /transfer/packages HTTP/1.1
Host: XXXXXX
User-Agent: Go-http-client/1.1
Transfer-Encoding: chunked
Accept: application/vnd.sas.summary+json
Accept-Language: en-US,en
Accept-Locale: en-US,en
Authorization: <AUTHORIZATION>
Content-Type: multipart/form-data; boundary=2ff81854ebb20ed697f11dabfac707cc5247c40e08e1452802cd046e5c04
Accept-Encoding: gzip

8000
--2ff81854ebb20ed697f11dabfac707cc5247c40e08e1452802cd046e5c04
Content-Disposition: form-data; name="file"; filename="transfer_code_20210322.json"
Content-Type: application/octet-stream

{"id":"82294fdd-d98f-4598-a923-2dd82d396ca9","version":1,"name":"transfer_code_20210322","description":"","creationTimeStamp":"2021-03-22T13:20:28.992Z","cBy":"dki","modifiedTimeStamp":"2021-03-22T13:20:30.336Z","mo...........

 

For example I see this POST Query. But I don't see the dependency between the CLI file path: </path/transfer_code_20210322.json> and options( application/octet-stream, boundary= ) we can see in the --verbose  such as: 

 

--2ff81854ebb20ed697f11dabfac707cc5247c40e08e1452802cd046e5c04
Content-Disposition: form-data; name="file"; filename="transfer_code_20210322.json"
Content-Type: application/octet-stream

 

 

The boundary described here LINK but I still can't understand how to use it in that case. 

 

To summarize:

My goal to have a REST API code that allow me to upload package to Viya server. In the further steps I'm going to use the package for promotes between the environments. 

 

Kind regards,

Ivan

 

1 ACCEPTED SOLUTION

Accepted Solutions
alexal
SAS Employee

@idziemianczyk ,

You aren't supposed to use Transfer Service REST API directly. The only supported way of communicating with Transfer Service REST API is using transfer plugin of sas-admin client.

View solution in original post

1 REPLY 1
alexal
SAS Employee

@idziemianczyk ,

You aren't supposed to use Transfer Service REST API directly. The only supported way of communicating with Transfer Service REST API is using transfer plugin of sas-admin client.

suga badge.PNGThe SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment. 

Join SUGA 

Get Started with SAS Information Catalog in SAS Viya

SAS technical trainer Erin Winters shows you how to explore assets, create new data discovery agents, schedule data discovery agents, and much more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 1069 views
  • 0 likes
  • 2 in conversation