0
APIを使用してHardware_Serverでノートを設定するにはどうすればよいですか?私はHardware_Serverの利用可能な方法を見てきましたが、setNote
の方法はありません。SoftLayer APIを使用してハードウェアノートを設定する方法
APIを使用してHardware_Serverでノートを設定するにはどうすればよいですか?私はHardware_Serverの利用可能な方法を見てきましたが、setNote
の方法はありません。SoftLayer APIを使用してハードウェアノートを設定する方法
他のSoftLayer_Hardware_Serverプロパティを追加または編集するには、SoftLayer_Hardware_Server :: editObjectメソッドを使用する必要があります。あなた以下
は、IDとBMSに123456
"""
Edit a bare metal server's basic information
This example shows how to edit the property 'notes' for a single bare metal server by
using the editObject() method in the SoftLayer_Hardware_Server API service.
See below for more details.
Important manual pages:
http://sldn.softlayer.com/reference/services/SoftLayer_Hardware_Server/editObject
License: http://sldn.softlayer.com/article/License
Author: SoftLayer Technologies, Inc. <[email protected]>
"""
import SoftLayer
# Your SoftLayer API username and key.
USERNAME = 'set me'
API_KEY = 'set me'
# The id of the bare metal you wish to edit
hardwareId = 123456
'''
The template object used to edit a SoftLayer_Hardware_Server.
Take account you can edit other properties by using a similar skeleton
'''
templateObject = {
'notes': 'This is my bare metal server!'
}
# Declare a new API service object
client = SoftLayer.create_client_from_env(username=USERNAME, api_key=API_KEY)
try:
# Add notes to the Bare Metal server
result = client['SoftLayer_Hardware_Server'].editObject(templateObject,
id=hardwareId)
print('Bare Metal Server edited')
except SoftLayer.SoftLayerAPIError as e:
print("Unable to edit the server: %s, %s" % (e.faultCode, e.faultString))
参照のメモを追加する例を見ることができます:
http://sldn.softlayer.com/reference/services/SoftLayer_Hardware_Server/editObject
http://sldn.softlayer.com/reference/datatypes/SoftLayer_Hardware_Server
私はこのヘルプあなたを願っています。
よろしくお願いします。