通过TFS 2015 RestFul Apis从Version Control下载整个文件夹 [英] Download entire folder from Version Control via TFS 2015 RestFul Apis
问题描述
是否可以使用RestFul API从TFS 2015版本控制中获取整个文件夹的下载URL?
Is there a way to get the download url for an entire folder from TFS 2015 Version Control using the RestFul apis?
我可以通过/_apis//tfvc/items/
api获取有关商品的元数据,但是没有downloadUrl
属性可用.
I can get metadata about items via the /_apis//tfvc/items/
api, but no downloadUrl
property is available.
我可以通过/_apis//build/builds/{buildNumber}/artifacts
api看到downloadUrl
用于构建工件的属性.
I can see the downloadUrl
property for build artifacts via the /_apis//build/builds/{buildNumber}/artifacts
api.
我可以通过GET api下载该项目中文件夹中的每个文件,但这可能需要很多请求.
I could download every file in the folder via the GET api for that item, but that could require a lot of requests.
我正在使用api版本2.0.
I am using api version 2.0.
推荐答案
当前使用版本控制API的项目/文件夹没有下载URL.
There isn't any download url for items/folders with currently Version Control API.
要获取整个文件夹,您可以将其压缩并与Rest Api以以下格式下载:
To get an entire folder, you can zip it and download it with the Rest Api with following format:
[Get] https://xxx/defaultcollection/_apis/tfvc/items?path=<Folder Path>&api-version=1.0
并在请求标头中添加以下内容:Accept: application/zip
And add following in the request header: Accept: application/zip
这篇关于通过TFS 2015 RestFul Apis从Version Control下载整个文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!