我正在尝试使用API将一组分类或标记插入ApacheAlas。 我面临一个错误
有人能帮我克服这个错误并插入分类吗。 我的代码:
import requests
import json
from requests.auth import HTTPBasicAuth
#specify url
url = 'http://aaaaa/api/atlas/v2/entity/classification'
print(url)
bulk = { "classification":{ "typeName":"Confidential","attributes":{ "retention_required":"true","max_retention_time_months":"12"}},"entityGuids":[ "be532571-1663-4550-af6d-28cfe39769f6"]}
#Call REST API
response = requests.put(url, data=bulk,auth=HTTPBasicAuth('xxx', 'yyy'))
print(response)
print(response.text)
此GUID有效
我面临的错误是:
<Response [500]>
There was an error processing your request. It has been logged (ID 7e31c72f5e0f5e3b).
简而言之,我希望通过python实现给定的屏幕功能
多谢各位
将请求发送至:http://aaaaa/api/atlas/v2/types/typedefs
如果分类还不存在,您应该使用post,如果分类存在,您将得到409个客户端错误。 使用PUT更新现有分类
您的json应该如下所示:
json中的属性类型:
列表:entityTypes、attributeDefs、超类型、子类型
字典:选项
编号:版本
rest是字符串或文本类型
相关问题 更多 >
编程相关推荐