-->

SoftLayer OS Reload API

2019-09-10 11:36发布

问题:

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:

  1. Download the softlayer-java-master.zip(91kb) Using git:

    git clone -b master https://github.com/softlayer/softlayer-java.git

  2. 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 compile

  3. Open the project and try to run the script that you have