我们正在审查此API的票证功能实施。 (https://softlayer.github.io/reference/services/SoftLayer_Ticket/)
我有一个问题:
createStandardTicket函数只能设置一台设备的密码。
如果我还有其他设备,如何设置有关另一台设备的密码?
添加代码
Ticket.Service service = Ticket.service(client);
ticket = service.createStandardTicket(ticket, contents, null, rootPassword, null, null, null, attachmentType);
service = ticket.asService(client);
...
if(attachedDevices != null && attachedDevices.size() > 0){
for(HashMap<String, Object> deviceInfo : attachedDevices){
if(DeviceType.from(deviceInfo.get("deviceType").toString()) == DeviceType.BAREMETAL_SERVER){
service.addAttachedHardware(Long.parseLong(deviceInfo.get("deviceId").toString()));
}else if(DeviceType.from(deviceInfo.get("deviceType").toString()) == DeviceType.VIRTUAL_SERVER){
service.addAttachedVirtualGuest(Long.parseLong(deviceInfo.get("deviceId").toString()));
}
}
}
答案 0 :(得分:0)
您只能使用createStandardTicket或createAdministrativeTicket方法设置第一个设备的密码,并且无法为下一个连接的设备设置密码,因为addAttachedHardware和addAttachedVirtualGuest仅需要设备的ID。 / p>
我确定您正在尝试像在门户网站页面中那样设置密码,但这无法通过API进行,这已报告给Softlayer,但没有ETA。