Creating a DNS A Record using REST API createObjec

2019-09-02 04:28发布

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条回答
叛逆
2楼-- · 2019-09-02 05:00

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

查看更多
登录 后发表回答