我正在使用dyn soap API“ https://api2.dynect.net/wsdl/current/Dynect.wsdl'”
在文档中,写道要获取任何记录,我可以调用“ GetAnyRecord”方法,并且期望以以下方式请求请求
{
'fqdn' => 'www.example.com',
'token' => 'asdlkfjasl23j4879afa',
'zone' => 'example.com',
}
,然后执行以下代码即可。
# Get all records from the root node of a zone
response = client.service.GetANYRecords(
token = token,
zone = ZONE,
fqdn = ZONE,
fault_incompat = 1,
)
现在要添加CNAME文档,它表示调用“ CreateCNAMERecord”方法,并且期望以以下方式提出请求。
{
'fqdn' => 'www.example.com',
'rdata' => {
'cname' => 'example.com',
},
'token' => 'asdlkfjasl23j4879afa',
'ttl' => '3600',
'zone' => 'example.com',
}
我写了如下的python代码:
addstatus = client.service.CreateCNAMERecord(
fqdn = "testapi1.pikachu.com",
ttl = "3600",
zone = ZONE,
rdata = (
{'cname':"testapi1.pikachu.com"}
),
token = token,
)
但是它没有运行并且由于以下错误而失败。
suds.WebFault: Server raised fault: 'Processing Error. See detail section for a structured problem description.'
谁能告诉我如何在python代码中构造“ Rdata”。