AzureDevOps Python REST API中的神奇客户端字符串是什么?
在Azure DevOps()的Python REST API中,只给出了一个示例来解析项目列表:AzureDevOps Python REST API中的神奇客户端字符串是什么?,python,rest,azure-devops,azure-devops-rest-api,Python,Rest,Azure Devops,Azure Devops Rest Api,在Azure DevOps()的Python REST API中,只给出了一个示例来解析项目列表: from vsts.vss_connection import VssConnection from msrest.authentication import BasicAuthentication import pprint # Fill in with your personal access token and org URL personal_access_token = 'YOURPA
from vsts.vss_connection import VssConnection
from msrest.authentication import BasicAuthentication
import pprint
# Fill in with your personal access token and org URL
personal_access_token = 'YOURPAT'
organization_url = 'https://dev.azure.com/YOURORG'
# Create a connection to the org
credentials = BasicAuthentication('', personal_access_token)
connection = VssConnection(base_url=organization_url, creds=credentials)
# Get a client (the "core" client provides access to projects, teams, etc)
core_client = connection.get_client('vsts.core.v4_0.core_client.CoreClient')
这个字符串'vsts.core.v4\u 0.core\u client.CoreClient'
来自哪里
更重要的是,操作的对应“魔术串”是什么:
- 工作项目
- 测试运行和结果
- 任务
- 建立
- 等等
- 这个神奇的字符串来自
vsts
模块的文件夹组织
这是一条具有以下特征的路径:
- 用点指示文件夹层次结构
- 末尾类的名称
CoreClient”
。这将产生一个神奇的字符串'vsts.core.v4\u 0.core\u client.CoreClient'
(恰好是示例中的字符串)
通过进一步探索,我发现了以下字符串(我使用API版本4.1):
- 工作项:
“vsts.work\u item\u tracking.v4\u 1.work\u item\u tracking\u client.workitemtracking client”
- 测试运行/结果:
“vsts.test.v4\u 1.test\u client.TestClient”
- 任务(待检查):
“vsts.task.v4\u 1.task\u client.TaskClient”