From 4a9af125cfd0b8c92a335447e2b81acd4197fbcf Mon Sep 17 00:00:00 2001 From: Rohit Yadav Date: Fri, 8 Feb 2013 16:20:46 +0530 Subject: [PATCH] netapp: Fix as pluggable service and return list of apis it offers Signed-off-by: Rohit Yadav --- .../src/com/cloud/netapp/NetappManager.java | 3 ++- .../com/cloud/netapp/NetappManagerImpl.java | 22 ++++++++++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/plugins/file-systems/netapp/src/com/cloud/netapp/NetappManager.java b/plugins/file-systems/netapp/src/com/cloud/netapp/NetappManager.java index 7216c50f428..1ee87f1a817 100644 --- a/plugins/file-systems/netapp/src/com/cloud/netapp/NetappManager.java +++ b/plugins/file-systems/netapp/src/com/cloud/netapp/NetappManager.java @@ -24,8 +24,9 @@ import com.cloud.exception.InvalidParameterValueException; import com.cloud.exception.ResourceAllocationException; import com.cloud.exception.ResourceInUseException; import com.cloud.utils.component.Manager; +import com.cloud.utils.component.PluggableService; -public interface NetappManager extends Manager { +public interface NetappManager extends Manager, PluggableService { enum AlgorithmType { RoundRobin, LeastFull diff --git a/plugins/file-systems/netapp/src/com/cloud/netapp/NetappManagerImpl.java b/plugins/file-systems/netapp/src/com/cloud/netapp/NetappManagerImpl.java index 90bb9b205fd..8f7b6d8df8d 100644 --- a/plugins/file-systems/netapp/src/com/cloud/netapp/NetappManagerImpl.java +++ b/plugins/file-systems/netapp/src/com/cloud/netapp/NetappManagerImpl.java @@ -17,6 +17,7 @@ package com.cloud.netapp; import java.io.IOException; +import java.lang.Override; import java.net.UnknownHostException; import java.rmi.ServerException; import java.util.ArrayList; @@ -40,6 +41,7 @@ import netapp.manage.NaServer; import org.apache.log4j.Logger; import org.springframework.stereotype.Component; +import com.cloud.api.commands.netapp.*; import com.cloud.exception.InvalidParameterValueException; import com.cloud.exception.ResourceAllocationException; import com.cloud.exception.ResourceInUseException; @@ -123,7 +125,25 @@ public class NetappManagerImpl extends ManagerBase implements NetappManager return s; } - + + @Override + public List> getCommands() { + List> cmdList = new ArrayList>(); + cmdList.add(CreateLunCmd.class); + cmdList.add(ListLunsCmd.class); + cmdList.add(DissociateLunCmd.class); + cmdList.add(CreateVolumeOnFilerCmd.class); + cmdList.add(ModifyVolumePoolCmd.class); + cmdList.add(ListVolumesOnFilerCmd.class); + cmdList.add(ListVolumePoolsCmd.class); + cmdList.add(DestroyLunCmd.class); + cmdList.add(CreateVolumePoolCmd.class); + cmdList.add(DeleteVolumePoolCmd.class); + cmdList.add(AssociateLunCmd.class); + cmdList.add(DestroyVolumeOnFilerCmd.class); + return cmdList; + } + @Override public void modifyPool(String poolName, String algorithm) throws InvalidParameterValueException {