0
通過使用此代碼,我可以順序連接磁盤。
設備2,設備3,設備4將外部磁盤連接到特定位置
但我想附加一個特定位置的磁盤。 我想直接連接第3張磁盤或第4張磁盤。 沒有升級之前的磁盤
代碼
for disk in external_disks:
obj = {}
obj['id'] = getDiskPriceId(client, disk)
#obj['id'] = 2277
#logger.info("disk %s size: %s --\n" ,(str(disk_num)), (str(disk)))
if obj['id'] == "":
print("Invalid external disk size")
exit(1)
categories = {}
categories['categoryCode'] = "guest_disk"+str(disk_num)
categories['complexType'] = "SoftLayer_Product_Item_Category"
obj['categories'] =[categories]
obj["complexType"] = "SoftLayer_Product_Item_Price"
prices.append(obj)
disk_num = disk_num + 1
response = client.call('SoftLayer_Product_Order','placeOrder', {
"virtualGuests": [{
"id": id
}],
"prices": prices,
"properties": [{
"name": "NOTE_GENERAL",
"value": "adding disks"
},{
"name": "MAINTENANCE_WINDOW",
"value": "now"
}],
"complexType": "SoftLayer_Container_Product_Order_Virtual_Guest_Upgrade"
})
謝謝@Albert :) –