Issue 158: Added implementation of destroyNode

This commit is contained in:
Jason King 2011-09-27 16:02:10 +01:00
parent c6068d23dc
commit 22bc06243a
1 changed files with 8 additions and 6 deletions

View File

@ -29,10 +29,7 @@ import org.jclouds.compute.domain.Template;
import org.jclouds.domain.Credentials; import org.jclouds.domain.Credentials;
import org.jclouds.softlayer.SoftLayerClient; import org.jclouds.softlayer.SoftLayerClient;
import org.jclouds.softlayer.compute.functions.ProductItems; import org.jclouds.softlayer.compute.functions.ProductItems;
import org.jclouds.softlayer.domain.Datacenter; import org.jclouds.softlayer.domain.*;
import org.jclouds.softlayer.domain.ProductItem;
import org.jclouds.softlayer.domain.ProductPackage;
import org.jclouds.softlayer.domain.VirtualGuest;
import org.jclouds.softlayer.features.AccountClient; import org.jclouds.softlayer.features.AccountClient;
import org.jclouds.softlayer.features.ProductPackageClient; import org.jclouds.softlayer.features.ProductPackageClient;
import org.jclouds.softlayer.reference.SoftLayerConstants; import org.jclouds.softlayer.reference.SoftLayerConstants;
@ -145,8 +142,13 @@ public class SoftLayerComputeServiceAdapter implements
@Override @Override
public void destroyNode(String id) { public void destroyNode(String id) {
// TODO VirtualGuest guest = getNode(id);
// client.getVirtualGuestClient().destroyVirtualGuest(Long.parseLong(id)); if(guest==null) return;
BillingItemVirtualGuest billingItem = guest.getBillingItem();
if (billingItem==null) return;
client.getVirtualGuestClient().cancelService(billingItem.getId());
} }
@Override @Override