Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
252 views
in Technique[技术] by (71.8m points)

ibm cloud infrastructure - what is the API (REST) to find out whether bare metal server provisioned or not?

According to SLDn of softlayer Softlayer_hardware/some id/getObjects?mask with domain name and Vm name will give provision status.But when I make RESt call with same I get 200 ok but xml output hass error.

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

 https://userid:[email protected]/sldn/rest/SoftLayer_Hardware/****/getObject?mask=[hostName,domain]

* is ID which got when we made below rest call

https://userid:[email protected]/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>
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Execute the following requests to get information of Virtual Guest/Hardware already provisioned:

Virtual Guest:

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

Hardware:

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

Method: GET

or

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

Where:

To know that a Server is already provisioned, please review that:

  • “activeTransaction” is NULL, or
  • “provisionDate” has a value different to NULL (i.e. when the VSI is ready, the provisionDate will have the respective provisionDate)
  • The “status” is Active

To get VSI/Hardware ids, please review:

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

Some References:

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...