Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/290.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
AzureDevOps Python REST API中的神奇客户端字符串是什么?_Python_Rest_Azure Devops_Azure Devops Rest Api - Fatal编程技术网

AzureDevOps 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

在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 = '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
      模块的文件夹组织

      这是一条具有以下特征的路径:

      • 用点指示文件夹层次结构
      • 末尾类的名称
      例如,在我的电脑上,我在文件C:\Python36\Lib\site packages\vsts\core\v4\u 0\core\u client.py中有一个类“
      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”