Google安全中心Python API失败

问题描述 投票:0回答:1

我正在尝试使用Python API从Google安全中心检索发现。我已经安装了python库,设置了服务帐户,生成了一个密钥,当我尝试获取发现或任何客户端功能时,出现以下错误:

Traceback (most recent call last):
  File "./find.py", line 12, in <module>
    finding_result_iterator = client.list_findings(all_sources)
  File "/usr/local/lib/python3.6/site-packages/google/cloud/securitycenter_v1/gapic/security_center_client.py", line 1532, in list_findings
    self.transport.list_findings,
AttributeError: 'str' object has no attribute 'list_findings'

我正在从此处使用代码示例:https://cloud.google.com/security-command-center/docs/how-to-api-list-findings

使用Python 3.6,在我创建的客户端中有json密钥文件以及我的组织ID。知道为什么我无法使用任何客户端功能吗?

python api security center
1个回答
0
投票

我将API密钥作为这样的身份验证传递给参数

© www.soinside.com 2019 - 2024. All rights reserved.