-2

根据 softlayer Softlayer_hardware/some id/getObjects?mask 的 SLDn 和域名和 Vm 名称将给出配置状态。但是当我用相同的方式进行 REST 调用时,我得到 200 ok 但 xml 输出有错误。

Please let me know how can I get VM provision successful or not? Help me with REST API.

 https://userid:apikey@api.softlayer.com/sldn/rest/SoftLayer_Hardware/****/getObject?mask=[hostName,domain]

* is ID which got when we made below rest call

https://userid:apikey@api.softlayer.com/rest/v3/SoftLayer_Hardware.json

<?xml version="1.0" encoding="UTF-8" ?>
<SOAP-ENV:Envelope>
<SOAP-ENV:Body>
 <SOAP-ENV:Fault>
<faultcode>SOAP-ENV:Client</faultcode>
<faultstring>Service does not exist</faultstring>
 </SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
4

1 回答 1

0

执行以下请求以获取已配置的 Virtual Guest/Hardware 的信息:

虚拟客人:

https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest/[VSI_id]/getObject?objectMask=mask[id,fullyQualifiedDomainName,createDate,provisionDate,activeTransaction,activeTransactionCount,status]

Method: GET

硬件:

https://[username]:[apikey @api.softlayer.com/rest/v3/SoftLayer_Hardware/[Hardware_id]/getObject?objectMask=mask[id,fullyQualifiedDomainName,provisionDate,hardwareStatus,lastTransaction]

Method: GET

或者

https://[username]:[apikey @api.softlayer.com/rest/v3/SoftLayer_Hardware_Server/[Hardware_id]/getObject?objectMask=mask[id,fullyQualifiedDomainName,provisionDate,activeTransaction,activeTransactionCount,hardwareStatus]

在哪里:

要知道已经配置了服务器,请查看:

  • “activeTransaction” 为 NULL,或
  • “provisionDate”具有不同于 NULL 的值(即,当 VSI 准备好时,provisionDate 将具有相应的provisionDate)
  • “状态”是活跃的

要获取 VSI/硬件 ID,请查看:

http://sldn.softlayer.com/reference/services/SoftLayer_Account/getHardware http://sldn.softlayer.com/reference/services/SoftLayer_Account/getVirtualGuests

一些参考资料:

http://sldn.softlayer.com/reference/services/SoftLayer_Hardware/getObject http://sldn.softlayer.com/reference/services/SoftLayer_Hardware_Server/getObject http://sldn.softlayer.com/reference/services/SoftLayer_Virtual_Guest https ://sldn.softlayer.com/article/rest

于 2016-02-16T17:15:40.843 回答