【发布时间】:2022-01-06 15:42:00
【问题描述】:
我正在尝试使用azure-devops-python-api 获取仪表板列表。 我不知道如何正确连接库以获取仪表板列表并使用它们。 我所做的是这样的:
from azure.devops.connection import Connection
from msrest.authentication import BasicAuthentication
from azure.devops.v6_0 import DashboardClient
import pprint
import requests
import json
personal_access_token = 'PAT'
organization_url = 'https://dev.azure.com/Orgname/'
team_context = 'Orgname'
# Create a connection to the org
credentials = BasicAuthentication('', personal_access_token)
connection = Connection(base_url=organization_url, creds=credentials)
dashboard_resp = DashboardClient(base_url=organization_url, creds=credentials)
dashboards = dashboard_resp.get_dashboards_by_project('', team_context)
当我尝试执行这段代码时,我得到一个错误
Traceback (most recent call last):
File "az-dev-dash.py", line 16, in <module>
dashboard_resp = azure.DashboardClient(base_url=organization_url, creds=credentials)
AttributeError: module 'azure.devops.v6_0' has no attribute 'DashboardClient'
【问题讨论】:
标签: python python-3.x azure azure-devops azure-devops-rest-api