Creating a DNS A Record using REST API createObject

别等时光非礼了梦想. 提交于 2019-12-13 05:57:49

问题


I couldn't get createARecord to work, so I am trying to use createObject.

The URL I am using with GET method.

https://api.softlayer.com/rest/v3/SoftLayer_Dns_Domain_ResourceRecord/createObject

The content sent is:

      {
    "parameters" :
    [
       {
         "domainId" : "1914686",
         "host" : "dsn-t01",
         "data" : "127.0.0.1",
         "type" : "a",
         "minimum" : undef,
         "retry" : undef,
         "mxPriority" : undef,
         "expire" : undef,
         "responsiblePerson" : undef,
         "id" : undef,
         "ttl"   : 900
       }
    ]
  }

The RC is 500, MSG is "Internal Server Error", the content is "{"error":"Invalid modification structure received. Expected a skeleton of \'SoftLayer_Dns_Domain_ResourceRecord\'.","code":"SoftLayer_Exception"}"

I am not having much success with these REST APIs.

Can you please help.


回答1:


Please the following POST request:

https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Dns_Domain_ResourceRecord/createObject.json

Method: POST

Json payload:

{
  "parameters": [
    {
      "domainId": 1769988,
      "data": "127.0.0.1",
      "host": "@",
      "type": "a"
    }
  ]
}

References:

SoftLayer_Dns_Domain_ResourceRecord::createObject



来源:https://stackoverflow.com/questions/36683735/creating-a-dns-a-record-using-rest-api-createobject

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!