You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by da...@apache.org on 2015/05/21 17:49:49 UTC
[09/10] git commit: updated refs/heads/master to 84266b1
api: firewall: fix and reformat descriptions
Signed-off-by: Daan Hoogland <da...@gmail.com>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/897c7386
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/897c7386
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/897c7386
Branch: refs/heads/master
Commit: 897c73867d85fdc4b41c2d303ed422e34d2a9eb9
Parents: f17ab71
Author: Rene Moser <re...@apache.org>
Authored: Thu May 21 09:52:53 2015 +0200
Committer: Daan Hoogland <da...@gmail.com>
Committed: Thu May 21 17:49:18 2015 +0200
----------------------------------------------------------------------
.../firewall/CreateEgressFirewallRuleCmd.java | 2 +-
.../user/firewall/CreateFirewallRuleCmd.java | 20 ++++++++++----------
.../firewall/CreatePortForwardingRuleCmd.java | 2 +-
.../firewall/DeleteEgressFirewallRuleCmd.java | 2 +-
.../user/firewall/DeleteFirewallRuleCmd.java | 4 ++--
.../firewall/DeletePortForwardingRuleCmd.java | 6 +++---
.../firewall/ListEgressFirewallRulesCmd.java | 6 +++---
.../user/firewall/ListFirewallRulesCmd.java | 2 +-
.../firewall/ListPortForwardingRulesCmd.java | 2 +-
.../firewall/UpdateEgressFirewallRuleCmd.java | 2 +-
.../user/firewall/UpdateFirewallRuleCmd.java | 4 ++--
.../firewall/UpdatePortForwardingRuleCmd.java | 2 +-
12 files changed, 27 insertions(+), 27 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/897c7386/api/src/org/apache/cloudstack/api/command/user/firewall/CreateEgressFirewallRuleCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/CreateEgressFirewallRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/CreateEgressFirewallRuleCmd.java
index b130370..0303445 100644
--- a/api/src/org/apache/cloudstack/api/command/user/firewall/CreateEgressFirewallRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/firewall/CreateEgressFirewallRuleCmd.java
@@ -247,7 +247,7 @@ public class CreateEgressFirewallRuleCmd extends BaseAsyncCreateCmd implements F
}
if (getProtocol().equalsIgnoreCase(NetUtils.ALL_PROTO)) {
if (getSourcePortStart() != null && getSourcePortEnd() != null) {
- throw new InvalidParameterValueException("Do not pass ports to protocol ALL, porotocol ALL do not require ports. Unable to create " +
+ throw new InvalidParameterValueException("Do not pass ports to protocol ALL, protocol ALL do not require ports. Unable to create " +
"firewall rule for the network id=" + networkId);
}
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/897c7386/api/src/org/apache/cloudstack/api/command/user/firewall/CreateFirewallRuleCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/CreateFirewallRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/CreateFirewallRuleCmd.java
index 7595d36..ee62aa5 100644
--- a/api/src/org/apache/cloudstack/api/command/user/firewall/CreateFirewallRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/firewall/CreateFirewallRuleCmd.java
@@ -43,7 +43,7 @@ import com.cloud.network.rules.FirewallRule;
import com.cloud.user.Account;
import com.cloud.utils.net.NetUtils;
-@APICommand(name = "createFirewallRule", description = "Creates a firewall rule for a given ip address", responseObject = FirewallResponse.class, entityType = {FirewallRule.class},
+@APICommand(name = "createFirewallRule", description = "Creates a firewall rule for a given IP address", responseObject = FirewallResponse.class, entityType = {FirewallRule.class},
requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
public class CreateFirewallRuleCmd extends BaseAsyncCreateCmd implements FirewallRule {
public static final Logger s_logger = Logger.getLogger(CreateFirewallRuleCmd.class.getName());
@@ -73,10 +73,10 @@ public class CreateFirewallRuleCmd extends BaseAsyncCreateCmd implements Firewal
@Parameter(name = ApiConstants.END_PORT, type = CommandType.INTEGER, description = "the ending port of firewall rule")
private Integer publicEndPort;
- @Parameter(name = ApiConstants.CIDR_LIST, type = CommandType.LIST, collectionType = CommandType.STRING, description = "the cidr list to forward traffic from")
+ @Parameter(name = ApiConstants.CIDR_LIST, type = CommandType.LIST, collectionType = CommandType.STRING, description = "the CIDR list to forward traffic from")
private List<String> cidrlist;
- @Parameter(name = ApiConstants.ICMP_TYPE, type = CommandType.INTEGER, description = "type of the icmp message being sent")
+ @Parameter(name = ApiConstants.ICMP_TYPE, type = CommandType.INTEGER, description = "type of the ICMP message being sent")
private Integer icmpType;
@Parameter(name = ApiConstants.ICMP_CODE, type = CommandType.INTEGER, description = "error code for this icmp message")
@@ -133,7 +133,7 @@ public class CreateFirewallRuleCmd extends BaseAsyncCreateCmd implements Firewal
boolean success = false;
FirewallRule rule = _entityMgr.findById(FirewallRule.class, getEntityId());
try {
- CallContext.current().setEventDetails("Rule Id: " + getEntityId());
+ CallContext.current().setEventDetails("Rule ID: " + getEntityId());
success = _firewallService.applyIngressFwRules(rule.getSourceIpAddressId(), callerContext.getCallingAccount());
// State is different after the rule is applied, so get new object here
@@ -154,7 +154,7 @@ public class CreateFirewallRuleCmd extends BaseAsyncCreateCmd implements Firewal
@Override
public long getId() {
- throw new UnsupportedOperationException("database id can only provided by VO objects");
+ throw new UnsupportedOperationException("database ID can only provided by VO objects");
}
@Override
@@ -215,8 +215,8 @@ public class CreateFirewallRuleCmd extends BaseAsyncCreateCmd implements Firewal
}
if (ntwkId == null) {
- throw new InvalidParameterValueException("Unable to create firewall rule for the ipAddress id=" + ipAddressId +
- " as ip is not associated with any network and no networkId is passed in");
+ throw new InvalidParameterValueException("Unable to create firewall rule for the IP address ID=" + ipAddressId +
+ " as IP is not associated with any network and no networkId is passed in");
}
return ntwkId;
}
@@ -243,7 +243,7 @@ public class CreateFirewallRuleCmd extends BaseAsyncCreateCmd implements Firewal
if (getSourceCidrList() != null) {
for (String cidr : getSourceCidrList()) {
if (!NetUtils.isValidCIDR(cidr)) {
- throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Source cidrs formatting error " + cidr);
+ throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Source CIDRs formatting error " + cidr);
}
}
}
@@ -268,7 +268,7 @@ public class CreateFirewallRuleCmd extends BaseAsyncCreateCmd implements Firewal
@Override
public String getEventDescription() {
IpAddress ip = _networkService.getIp(ipAddressId);
- return ("Creating firewall rule for Ip: " + ip.getAddress() + " for protocol:" + getProtocol());
+ return ("Creating firewall rule for IP: " + ip.getAddress() + " for protocol:" + getProtocol());
}
@Override
@@ -290,7 +290,7 @@ public class CreateFirewallRuleCmd extends BaseAsyncCreateCmd implements Firewal
private IpAddress getIp() {
IpAddress ip = _networkService.getIp(ipAddressId);
if (ip == null) {
- throw new InvalidParameterValueException("Unable to find ip address by id " + ipAddressId);
+ throw new InvalidParameterValueException("Unable to find IP address by ID " + ipAddressId);
}
return ip;
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/897c7386/api/src/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java
index 122cad0..9a0dffe 100644
--- a/api/src/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java
@@ -79,7 +79,7 @@ public class CreatePortForwardingRuleCmd extends BaseAsyncCreateCmd implements P
@Parameter(name = ApiConstants.PROTOCOL,
type = CommandType.STRING,
required = true,
- description = "the protocol for the port fowarding rule. Valid values are TCP or UDP.")
+ description = "the protocol for the port forwarding rule. Valid values are TCP or UDP.")
private String protocol;
@Parameter(name = ApiConstants.PRIVATE_END_PORT,
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/897c7386/api/src/org/apache/cloudstack/api/command/user/firewall/DeleteEgressFirewallRuleCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/DeleteEgressFirewallRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/DeleteEgressFirewallRuleCmd.java
index d08169d..59a0519 100644
--- a/api/src/org/apache/cloudstack/api/command/user/firewall/DeleteEgressFirewallRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/firewall/DeleteEgressFirewallRuleCmd.java
@@ -38,7 +38,7 @@ import com.cloud.exception.InvalidParameterValueException;
import com.cloud.exception.ResourceUnavailableException;
import com.cloud.network.rules.FirewallRule;
-@APICommand(name = "deleteEgressFirewallRule", description = "Deletes an ggress firewall rule", responseObject = SuccessResponse.class, entityType = {FirewallRule.class},
+@APICommand(name = "deleteEgressFirewallRule", description = "Deletes an egress firewall rule", responseObject = SuccessResponse.class, entityType = {FirewallRule.class},
requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
public class DeleteEgressFirewallRuleCmd extends BaseAsyncCmd {
public static final Logger s_logger = Logger.getLogger(DeleteEgressFirewallRuleCmd.class.getName());
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/897c7386/api/src/org/apache/cloudstack/api/command/user/firewall/DeleteFirewallRuleCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/DeleteFirewallRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/DeleteFirewallRuleCmd.java
index 0f10012..ba8b18e 100644
--- a/api/src/org/apache/cloudstack/api/command/user/firewall/DeleteFirewallRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/firewall/DeleteFirewallRuleCmd.java
@@ -77,7 +77,7 @@ public class DeleteFirewallRuleCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
- return ("Deleting firewall rule id=" + id);
+ return ("Deleting firewall rule ID=" + id);
}
@Override
@@ -85,7 +85,7 @@ public class DeleteFirewallRuleCmd extends BaseAsyncCmd {
if (ownerId == null) {
FirewallRule rule = _entityMgr.findById(FirewallRule.class, id);
if (rule == null) {
- throw new InvalidParameterValueException("Unable to find firewall rule by id=" + id);
+ throw new InvalidParameterValueException("Unable to find firewall rule by ID=" + id);
} else {
ownerId = _entityMgr.findById(FirewallRule.class, id).getAccountId();
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/897c7386/api/src/org/apache/cloudstack/api/command/user/firewall/DeletePortForwardingRuleCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/DeletePortForwardingRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/DeletePortForwardingRuleCmd.java
index 4c7b07f..1c45280 100644
--- a/api/src/org/apache/cloudstack/api/command/user/firewall/DeletePortForwardingRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/firewall/DeletePortForwardingRuleCmd.java
@@ -81,7 +81,7 @@ public class DeletePortForwardingRuleCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
- return ("Deleting port forwarding rule for id=" + id);
+ return ("Deleting port forwarding rule for ID=" + id);
}
@Override
@@ -89,7 +89,7 @@ public class DeletePortForwardingRuleCmd extends BaseAsyncCmd {
if (ownerId == null) {
PortForwardingRule rule = _entityMgr.findById(PortForwardingRule.class, id);
if (rule == null) {
- throw new InvalidParameterValueException("Unable to find port forwarding rule by id=" + id);
+ throw new InvalidParameterValueException("Unable to find port forwarding rule by ID=" + id);
} else {
ownerId = _entityMgr.findById(PortForwardingRule.class, id).getAccountId();
}
@@ -100,7 +100,7 @@ public class DeletePortForwardingRuleCmd extends BaseAsyncCmd {
@Override
public void execute() {
- CallContext.current().setEventDetails("Rule Id: " + id);
+ CallContext.current().setEventDetails("Rule ID: " + id);
//revoke corresponding firewall rule first
boolean result = _firewallService.revokeRelatedFirewallRule(id, true);
result = result && _rulesService.revokePortForwardingRule(id, true);
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/897c7386/api/src/org/apache/cloudstack/api/command/user/firewall/ListEgressFirewallRulesCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/ListEgressFirewallRulesCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/ListEgressFirewallRulesCmd.java
index c56e133..3664031 100644
--- a/api/src/org/apache/cloudstack/api/command/user/firewall/ListEgressFirewallRulesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/firewall/ListEgressFirewallRulesCmd.java
@@ -36,7 +36,7 @@ import org.apache.cloudstack.api.response.NetworkResponse;
import com.cloud.network.rules.FirewallRule;
import com.cloud.utils.Pair;
-@APICommand(name = "listEgressFirewallRules", description = "Lists all egress firewall rules for network id.", responseObject = FirewallResponse.class, entityType = {FirewallRule.class},
+@APICommand(name = "listEgressFirewallRules", description = "Lists all egress firewall rules for network ID.", responseObject = FirewallResponse.class, entityType = {FirewallRule.class},
requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
public class ListEgressFirewallRulesCmd extends BaseListTaggedResourcesCmd implements IListFirewallRulesCmd {
public static final Logger s_logger = Logger.getLogger(ListEgressFirewallRulesCmd.class.getName());
@@ -51,13 +51,13 @@ public class ListEgressFirewallRulesCmd extends BaseListTaggedResourcesCmd imple
@Parameter(name = ApiConstants.NETWORK_ID,
type = CommandType.UUID,
entityType = NetworkResponse.class,
- description = "the network id for the egress firewall services")
+ description = "the network ID for the egress firewall services")
private Long networkId;
@Parameter(name = ApiConstants.IP_ADDRESS_ID,
type = CommandType.UUID,
entityType = IPAddressResponse.class,
- description = "the id of IP address of the firewall services")
+ description = "the ID of IP address of the firewall services")
private Long ipAddressId;
@Parameter(name = ApiConstants.FOR_DISPLAY, type = CommandType.BOOLEAN, description = "list resources by display flag; only ROOT admin is eligible to pass this parameter", since = "4.4", authorized = {RoleType.Admin})
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/897c7386/api/src/org/apache/cloudstack/api/command/user/firewall/ListFirewallRulesCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/ListFirewallRulesCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/ListFirewallRulesCmd.java
index 9ace5bd..3c3feea 100644
--- a/api/src/org/apache/cloudstack/api/command/user/firewall/ListFirewallRulesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/firewall/ListFirewallRulesCmd.java
@@ -50,7 +50,7 @@ public class ListFirewallRulesCmd extends BaseListTaggedResourcesCmd implements
@Parameter(name = ApiConstants.IP_ADDRESS_ID,
type = CommandType.UUID,
entityType = IPAddressResponse.class,
- description = "the id of IP address of the firewall services")
+ description = "the ID of IP address of the firewall services")
private Long ipAddressId;
@Parameter(name = ApiConstants.NETWORK_ID,
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/897c7386/api/src/org/apache/cloudstack/api/command/user/firewall/ListPortForwardingRulesCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/ListPortForwardingRulesCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/ListPortForwardingRulesCmd.java
index 5d44815..d5c49a9 100644
--- a/api/src/org/apache/cloudstack/api/command/user/firewall/ListPortForwardingRulesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/firewall/ListPortForwardingRulesCmd.java
@@ -51,7 +51,7 @@ public class ListPortForwardingRulesCmd extends BaseListTaggedResourcesCmd {
@Parameter(name = ApiConstants.IP_ADDRESS_ID,
type = CommandType.UUID,
entityType = IPAddressResponse.class,
- description = "the id of IP address of the port forwarding services")
+ description = "the ID of IP address of the port forwarding services")
private Long ipAddressId;
@Parameter(name = ApiConstants.NETWORK_ID,
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/897c7386/api/src/org/apache/cloudstack/api/command/user/firewall/UpdateEgressFirewallRuleCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/UpdateEgressFirewallRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/UpdateEgressFirewallRuleCmd.java
index b597a89..ddaaf71 100644
--- a/api/src/org/apache/cloudstack/api/command/user/firewall/UpdateEgressFirewallRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/firewall/UpdateEgressFirewallRuleCmd.java
@@ -112,7 +112,7 @@ public class UpdateEgressFirewallRuleCmd extends BaseAsyncCustomIdCmd {
if (ownerId == null) {
FirewallRule rule = _entityMgr.findById(FirewallRule.class, id);
if (rule == null || rule.getTrafficType() != TrafficType.Egress) {
- throw new InvalidParameterValueException("Unable to find egress firewall rule by id");
+ throw new InvalidParameterValueException("Unable to find egress firewall rule by ID");
} else {
ownerId = _entityMgr.findById(FirewallRule.class, id).getAccountId();
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/897c7386/api/src/org/apache/cloudstack/api/command/user/firewall/UpdateFirewallRuleCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/UpdateFirewallRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/UpdateFirewallRuleCmd.java
index e9c87d0..3d11ed0 100644
--- a/api/src/org/apache/cloudstack/api/command/user/firewall/UpdateFirewallRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/firewall/UpdateFirewallRuleCmd.java
@@ -78,7 +78,7 @@ public class UpdateFirewallRuleCmd extends BaseAsyncCustomIdCmd {
@Override
public void execute() throws ResourceUnavailableException {
- CallContext.current().setEventDetails("Rule Id: " + id);
+ CallContext.current().setEventDetails("Rule ID: " + id);
FirewallRule rule = _firewallService.updateIngressFirewallRule(id, this.getCustomId(), getDisplay());
FirewallResponse fwResponse = new FirewallResponse();
@@ -113,7 +113,7 @@ public class UpdateFirewallRuleCmd extends BaseAsyncCustomIdCmd {
if (ownerId == null) {
FirewallRule rule = _entityMgr.findById(FirewallRule.class, id);
if (rule == null || rule.getTrafficType() != TrafficType.Ingress) {
- throw new InvalidParameterValueException("Unable to find firewall rule by id");
+ throw new InvalidParameterValueException("Unable to find firewall rule by ID");
} else {
ownerId = _entityMgr.findById(FirewallRule.class, id).getAccountId();
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/897c7386/api/src/org/apache/cloudstack/api/command/user/firewall/UpdatePortForwardingRuleCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/UpdatePortForwardingRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/UpdatePortForwardingRuleCmd.java
index 596b1d2..5f609b7 100644
--- a/api/src/org/apache/cloudstack/api/command/user/firewall/UpdatePortForwardingRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/firewall/UpdatePortForwardingRuleCmd.java
@@ -35,7 +35,7 @@ import com.cloud.utils.net.Ip;
@APICommand(name = "updatePortForwardingRule",
responseObject = FirewallRuleResponse.class,
- description = "Updates a port forwarding rule. Only the private port and the virtual machine can be updated.", entityType = {PortForwardingRule.class},
+ description = "Updates a port forwarding rule. Only the private port and the virtual machine can be updated.", entityType = {PortForwardingRule.class},
requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
public class UpdatePortForwardingRuleCmd extends BaseAsyncCustomIdCmd {
public static final Logger s_logger = Logger.getLogger(UpdatePortForwardingRuleCmd.class.getName());