问题
I have the same issue as SL ReloadOS API inquiry and I am using maven dependency.
<dependency>
<groupId>com.softlayer.api</groupId>
<artifactId>softlayer-api-client</artifactId>
<version>0.2.2</version>
</dependency>
Server.Service serverService = Server.service(client, hardware.getId()); fails to compile with error Type mismatch: cannot convert from Hardware.Service to Server.Service
serverService.reloadOperatingSystem("FORCE", config);
Since I am using maven,
how to change the code of com.softlayer.api.service.hardware.Server
class?
回答1:
The issue has been fixed and it was released on master branch of SoftLayer API Client for Java.
Issue: https://github.com/softlayer/softlayer-java/issues/21
Follow these steps to use master branch:
- Download the softlayer-java-master.zip(91kb)
Using git:
git clone -b master https://github.com/softlayer/softlayer-java.git
Open a command prompt (I suppose that you are using Windows), go to path that you unzipped the project and compile the project using
maven mvn compileOpen the project and try to run the script that you have
来源:https://stackoverflow.com/questions/38381633/softlayer-os-reload-api