Changed api command name from "enable/disableOneToOneNat" to "enable/disableStaticNat"

This commit is contained in:
alena 2011-01-26 11:00:41 -08:00
parent 347fa866d8
commit 976ec54eb3
4 changed files with 17 additions and 17 deletions

View File

@ -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");
}
}
}

View File

@ -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());

View File

@ -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";
}

View File

@ -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