使用REST API createObject创建DNS A记录 [英] Creating a DNS A Record using REST API createObject

查看:74
本文介绍了使用REST API createObject创建DNS A记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法获得createARecord的工作,所以我正在尝试使用createObject.

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

我在GET方法中使用的URL.

The URL I am using with GET method.

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

发送的内容是:

      {
    "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
       }
    ]
  }

RC为500,MSG为内部服务器错误",内容为 "{"错误:"收到无效的修改结构.预期一个 的骨架 \'SoftLayer_Dns_Domain_ResourceRecord \'.,"代码:" SoftLayer_Exception}"

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"}"

这些REST API并没有取得很大的成功.

I am not having much success with these REST APIs.

可以请你帮忙.

推荐答案

请执行以下POST请求:

Please the following POST request:

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

方法:开机自检

Json有效载荷:

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

参考文献:

SoftLayer_Dns_Domain_ResourceRecord :: createObject

这篇关于使用REST API createObject创建DNS A记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆