我找到了一种方法来做到这一点。
这是我从现有服务器的订单模板修改的示例订单:client['Virtual_Guest'].getOrderTemplate("HOURLY", id=12345678)
。
订单.json
{
"preTaxSetup": "0",
"storageGroups": [],
"postTaxRecurring": "0.111",
"billingOrderItemId": "",
"presetId": "",
"prices": [
{"id": 52123},
{"id": 1800},
{"id": 2202},
{"id": 57731},
{"id": 56679},
{"id": 57},
{"id": 13945},
{"id": 273},
{"id": 21},
{"id": 52265},
{"id": 905},
{"id": 57755},
{"id": 420},
{"id": 418}
],
"sendQuoteEmailFlag": "",
"packageId": 46,
"useHourlyPricing": true,
"preTaxRecurringMonthly": "0",
"message": "",
"virtualGuests": [{"domain": "yukaary.craft.net", "hostname": "test"}],
"preTaxRecurring": "0.111",
"primaryDiskPartitionId": 1,
"taxCompletedFlag": true,
"isManagedOrder": 0,
"imageTemplateId": "",
"postTaxRecurringMonthly": "0",
"resourceGroupTemplateId": "",
"postTaxSetup": "0",
"sshKeys": [{"sshKeyIds":[012345]}],
"location": 449604,
"stepId": "",
"proratedInitialCharge": "0",
"totalRecurringTax": 0,
"paymentType": "",
"resourceGroupId": "",
"sourceVirtualGuestId": "",
"bigDataOrderFlag": false,
"extendedHardwareTesting": "",
"preTaxRecurringHourly": "0.111",
"monitoringAgentConfigurationTemplateGroupId": "",
"postTaxRecurringHourly": "0.111",
"currencyShortName": "USD",
"proratedOrderTotal": "0",
"serverCoreCount": 4,
"privateCloudOrderFlag": false,
"totalSetupTax": "0",
"quantity": 1
}
然后我订购了虚拟服务器
client['Product_Order'].placeOrder(order)
该服务器是使用以下选项创建的:“监控包 - 高级应用程序”和“从监控自动重启”。