CenturyLinkCloud / clc-java-sdk

Apache License 2.0
6 stars 4 forks source link

modifying a server produces NullPointerException #149

Closed cljvf9 closed 9 years ago

cljvf9 commented 9 years ago

One thing I wanted to try is moving a server from one group to another. I did so by modifying the server with this piece of code:

GroupMetadata group = clcSdk.groupService().find(new GroupFilter()
                .dataCenters(DataCenter.US_EAST_STERLING)
                .names("group_name")
).get(0);

clcSdk.serverService()
        .modify(
                Server.refById("server_alias"),
                new ModifyServerConfig().groupId(group.getId())
);

It does the move, but the API call results in a NullPointerException on ServerService.java:121

pslam commented 9 years ago

Hi, @cljvf9 Do you use the latest java-sdk version ? Now ServerService.java:121 is } the end of create server method

cljvf9 commented 9 years ago

Hi @pslam, thanks for looking into it. I just included the clc-java-sdk as a maven dependency in my project's pom. Here are the coordinates I used:

<dependency>
    <groupId>com.centurylink.cloud</groupId>
    <artifactId>clc-java-sdk</artifactId>
    <version>1.0.0</version>
</dependency>

However when I cloned the master branch from here I did not encounter the exception. Is the version in maven's central repository a bit behind?

pslam commented 9 years ago

Yep I think we will update the version in maven's central repository in the near future

cljvf9 commented 9 years ago

Cool, glad to hear it.