简体   繁体   中英

VSTS Get Individual Artifact REST Client API

I have some build artifacts that have some debug information in them that I would like to display in a build summary. However, the only APIs I'm seeing for getting artifacts is as a zip file. If you go to the artifact screen and explore the artifacts, then copy the download URL, you get an API as:

https://{account}/_apis/resources/Containers/{container}?itemPath={file_name}

However, I can't seem to find a REST Client API to utilize this function in my ts script in the extension.

Any thoughts on how to get the actual files from this? The TS script needs to just grab the file and display it in the browser.

There isn't such REST client API to do it.

You can call that API through HTTP request directly. To get container's Id, you can use Get build artifacts REST API (in resource > data value).

There is an article about make http request.

5 Ways to Make HTTP Requests in Node.js

On the other hand, you don't need to do it through extension, just call Logging Command (call command during build/release) to add additional information to build/release summary. ( ##vso[task.uploadsummary]local file path )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM