Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.Original topic: DM openapi调用错误
According to the official documentation, the error encountered when calling the interface is as follows:
cat test.sh
curl -X ‘POST’
‘http://192.168.85.30:8261/api/v1/sources’
-H ‘accept: application/json’
-H ‘Content-Type: application/json’
-d ‘{
“source_name”: “mysqlmigrate”,
“host”: “192.168.100.17”,
“port”: 3306,
“user”: “otter”,
“password”: “otter”,
“enable”: true,
“enable_gtid”: false,
“security”: {
“ssl_ca_content”: “”,
“ssl_cert_content”: “”,
“ssl_key_content”: “”,
“cert_allowed_cn”: [
“string”
]
},
“purge”: {
“interval”: 3600,
“expires”: 0,
“remain_space”: 15
}
}’
[admin@mysql-dm]$ sh test.sh
{“error”:“error in openapi3filter.RequestError: request body has an error: doesn’t match the schema: Error at "/source": property "source" is missing”}[admin@mysql dm]$