From 976ec54eb347ee15f94b052c09b2bc43cdfe022a Mon Sep 17 00:00:00 2001 From: alena Date: Wed, 26 Jan 2011 11:00:41 -0800 Subject: [PATCH] Changed api command name from "enable/disableOneToOneNat" to "enable/disableStaticNat" --- ...sableOneToOneNat.java => DisableStaticNat.java} | 14 +++++++------- ...EnableOneToOneNat.java => EnableStaticNat.java} | 12 ++++++------ api/src/com/cloud/event/EventTypes.java | 4 ++-- client/tomcatconf/commands.properties.in | 4 ++-- 4 files changed, 17 insertions(+), 17 deletions(-) rename api/src/com/cloud/api/commands/{DisableOneToOneNat.java => DisableStaticNat.java} (86%) rename api/src/com/cloud/api/commands/{EnableOneToOneNat.java => EnableStaticNat.java} (89%) diff --git a/api/src/com/cloud/api/commands/DisableOneToOneNat.java b/api/src/com/cloud/api/commands/DisableStaticNat.java similarity index 86% rename from api/src/com/cloud/api/commands/DisableOneToOneNat.java rename to api/src/com/cloud/api/commands/DisableStaticNat.java index 724cc69b8bd..64a26c39a2a 100644 --- a/api/src/com/cloud/api/commands/DisableOneToOneNat.java +++ b/api/src/com/cloud/api/commands/DisableStaticNat.java @@ -31,16 +31,16 @@ import com.cloud.exception.ResourceUnavailableException; import com.cloud.network.IpAddress; import com.cloud.utils.net.Ip; -@Implementation(description="Disables one to one nat rule", responseObject=SuccessResponse.class) -public class DisableOneToOneNat extends BaseAsyncCmd { +@Implementation(description="Disables static rule for given ip address", responseObject=SuccessResponse.class) +public class DisableStaticNat extends BaseAsyncCmd { public static final Logger s_logger = Logger.getLogger(DeletePortForwardingRuleCmd.class.getName()); - private static final String s_name = "disableonetoonenatresponse"; + private static final String s_name = "disablestaticnatresponse"; ///////////////////////////////////////////////////// //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name=ApiConstants.IP_ADDRESS, type=CommandType.STRING, required=true, description="the public IP address for which one-to-one nat feature is being disableed") + @Parameter(name=ApiConstants.IP_ADDRESS, type=CommandType.STRING, required=true, description="the public IP address for which static nat feature is being disableed") private String ipAddress; ///////////////////////////////////////////////////// @@ -61,12 +61,12 @@ public class DisableOneToOneNat extends BaseAsyncCmd { @Override public String getEventType() { - return EventTypes.EVENT_DISABLE_ONE_TO_ONE_NAT; + return EventTypes.EVENT_DISABLE_STATIC_NAT; } @Override public String getEventDescription() { - return ("Disabling one to one nat for ip=" + ipAddress); + return ("Disabling static nat for ip=" + ipAddress); } @Override @@ -82,7 +82,7 @@ public class DisableOneToOneNat extends BaseAsyncCmd { SuccessResponse response = new SuccessResponse(getCommandName()); this.setResponseObject(response); } else { - throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to disable oneToOne nat rule"); + throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to disable static nat"); } } } diff --git a/api/src/com/cloud/api/commands/EnableOneToOneNat.java b/api/src/com/cloud/api/commands/EnableStaticNat.java similarity index 89% rename from api/src/com/cloud/api/commands/EnableOneToOneNat.java rename to api/src/com/cloud/api/commands/EnableStaticNat.java index 9f92391294f..a5b5f4efe3e 100644 --- a/api/src/com/cloud/api/commands/EnableOneToOneNat.java +++ b/api/src/com/cloud/api/commands/EnableStaticNat.java @@ -29,20 +29,20 @@ import com.cloud.api.response.SuccessResponse; import com.cloud.exception.NetworkRuleConflictException; import com.cloud.utils.net.Ip; -@Implementation(description="Enables one to one nat for the ip address", responseObject=SuccessResponse.class) -public class EnableOneToOneNat extends BaseCmd{ +@Implementation(description="Enables static nat for given ip address", responseObject=SuccessResponse.class) +public class EnableStaticNat extends BaseCmd{ public static final Logger s_logger = Logger.getLogger(CreateIpForwardingRuleCmd.class.getName()); - private static final String s_name = "enableonetoonenatresponse"; + private static final String s_name = "enablestaticnatresponse"; ///////////////////////////////////////////////////// //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name=ApiConstants.IP_ADDRESS, type=CommandType.STRING, required=true, description="the public IP address for which one-to-one nat feature is being enabled") + @Parameter(name=ApiConstants.IP_ADDRESS, type=CommandType.STRING, required=true, description="the public IP address for which static nat feature is being enabled") private String ipAddress; - @Parameter(name=ApiConstants.VIRTUAL_MACHINE_ID, type=CommandType.LONG, required=true, description="the ID of the virtual machine for enabling one-to-one nat feature") + @Parameter(name=ApiConstants.VIRTUAL_MACHINE_ID, type=CommandType.LONG, required=true, description="the ID of the virtual machine for enabling static nat feature") private Long virtualMachineId; ///////////////////////////////////////////////////// @@ -74,7 +74,7 @@ public class EnableOneToOneNat extends BaseCmd{ SuccessResponse response = new SuccessResponse(getCommandName()); this.setResponseObject(response); } else { - throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to enable one-to-one nat"); + throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to enable static nat"); } } catch (NetworkRuleConflictException ex) { s_logger.info("Network rule conflict: " + ex.getMessage()); diff --git a/api/src/com/cloud/event/EventTypes.java b/api/src/com/cloud/event/EventTypes.java index 28b4614e405..cd98b01c25f 100755 --- a/api/src/com/cloud/event/EventTypes.java +++ b/api/src/com/cloud/event/EventTypes.java @@ -185,7 +185,7 @@ public class EventTypes { public static final String EVENT_UPLOAD_CUSTOM_CERTIFICATE = "UPLOAD.CUSTOM.CERTIFICATE"; //OneToOnenat - public static final String EVENT_ENABLE_ONE_TO_ONE_NAT = "ONETOONENAT.ENABLE"; - public static final String EVENT_DISABLE_ONE_TO_ONE_NAT = "ONETOONENAT.DISABLE"; + public static final String EVENT_ENABLE_STATIC_NAT = "STATICNAT.ENABLE"; + public static final String EVENT_DISABLE_STATIC_NAT = "STATICNAT.DISABLE"; } diff --git a/client/tomcatconf/commands.properties.in b/client/tomcatconf/commands.properties.in index 2577e8e26fb..33dfa564d70 100755 --- a/client/tomcatconf/commands.properties.in +++ b/client/tomcatconf/commands.properties.in @@ -111,11 +111,11 @@ deletePortForwardingRule=com.cloud.api.commands.DeletePortForwardingRuleCmd;15 #### updatePortForwardingRule=com.cloud.api.commands.UpdatePortForwardingRuleCmd;15 #### NAT commands -enableOneToOneNat=com.cloud.api.commands.EnableOneToOneNat;15 +enableStaticNat=com.cloud.api.commands.EnableStaticNat;15 createIpForwardingRule=com.cloud.api.commands.CreateIpForwardingRuleCmd;15 deleteIpForwardingRule=com.cloud.api.commands.DeleteIpForwardingRuleCmd;15 listIpForwardingRules=com.cloud.api.commands.ListIpForwardingRulesCmd;15 -disableOneToOneNat=com.cloud.api.commands.DisableOneToOneNat;15 +disableStaticNat=com.cloud.api.commands.DisableStaticNat;15 #### load balancer commands createLoadBalancerRule=com.cloud.api.commands.CreateLoadBalancerRuleCmd;15