api: address: fix and reformat descriptions Signed-off-by: Daan Hoogland <daan.hoogl...@gmail.com>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/4c65acff Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/4c65acff Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/4c65acff Branch: refs/heads/master Commit: 4c65acfff7bfd5633a7adfaf062603ddea4742df Parents: 68e867f Author: Rene Moser <re...@apache.org> Authored: Thu May 21 09:37:27 2015 +0200 Committer: Daan Hoogland <daan.hoogl...@gmail.com> Committed: Thu May 21 17:49:18 2015 +0200 ---------------------------------------------------------------------- .../user/address/AssociateIPAddrCmd.java | 30 ++++++++++---------- .../user/address/DisassociateIPAddrCmd.java | 14 ++++----- .../user/address/ListPublicIpAddressesCmd.java | 16 +++++------ .../command/user/address/UpdateIPAddrCmd.java | 12 ++++---- 4 files changed, 36 insertions(+), 36 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4c65acff/api/src/org/apache/cloudstack/api/command/user/address/AssociateIPAddrCmd.java ---------------------------------------------------------------------- diff --git a/api/src/org/apache/cloudstack/api/command/user/address/AssociateIPAddrCmd.java b/api/src/org/apache/cloudstack/api/command/user/address/AssociateIPAddrCmd.java index 63939dc..75bd9d2 100644 --- a/api/src/org/apache/cloudstack/api/command/user/address/AssociateIPAddrCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/address/AssociateIPAddrCmd.java @@ -85,13 +85,13 @@ public class AssociateIPAddrCmd extends BaseAsyncCreateCmd { @Parameter(name = ApiConstants.NETWORK_ID, type = CommandType.UUID, entityType = NetworkResponse.class, - description = "The network this ip address should be associated to.") + description = "The network this IP address should be associated to.") private Long networkId; - @Parameter(name = ApiConstants.PROJECT_ID, type = CommandType.UUID, entityType = ProjectResponse.class, description = "Deploy vm for the project") + @Parameter(name = ApiConstants.PROJECT_ID, type = CommandType.UUID, entityType = ProjectResponse.class, description = "Deploy VM for the project") private Long projectId; - @Parameter(name = ApiConstants.VPC_ID, type = CommandType.UUID, entityType = VpcResponse.class, description = "the VPC you want the ip address to " + @Parameter(name = ApiConstants.VPC_ID, type = CommandType.UUID, entityType = VpcResponse.class, description = "the VPC you want the IP address to " + "be associated with") private Long vpcId; @@ -103,10 +103,10 @@ public class AssociateIPAddrCmd extends BaseAsyncCreateCmd { type = CommandType.INTEGER, entityType = RegionResponse.class, required = false, - description = "region ID from where portable ip is to be associated.") + description = "region ID from where portable IP is to be associated.") private Integer regionId; - @Parameter(name = ApiConstants.FOR_DISPLAY, type = CommandType.BOOLEAN, description = "an optional field, whether to the display the ip to the end user or not", since = "4.4", authorized = {RoleType.Admin}) + @Parameter(name = ApiConstants.FOR_DISPLAY, type = CommandType.BOOLEAN, description = "an optional field, whether to the display the IP to the end user or not", since = "4.4", authorized = {RoleType.Admin}) private Boolean display; ///////////////////////////////////////////////////// @@ -142,7 +142,7 @@ public class AssociateIPAddrCmd extends BaseAsyncCreateCmd { } } - throw new InvalidParameterValueException("Unable to figure out zone to assign ip to." + throw new InvalidParameterValueException("Unable to figure out zone to assign IP to." + " Please specify either zoneId, or networkId, or vpcId in the call"); } @@ -182,16 +182,16 @@ public class AssociateIPAddrCmd extends BaseAsyncCreateCmd { } if (networks.size() < 1) { - throw new InvalidParameterValueException("Account doesn't have any Isolated networks in the zone"); + throw new InvalidParameterValueException("Account doesn't have any isolated networks in the zone"); } else if (networks.size() > 1) { - throw new InvalidParameterValueException("Account has more than one Isolated network in the zone"); + throw new InvalidParameterValueException("Account has more than one isolated network in the zone"); } return networks.get(0).getId(); } else { Network defaultGuestNetwork = _networkService.getExclusiveGuestNetwork(zoneId); if (defaultGuestNetwork == null) { - throw new InvalidParameterValueException("Unable to find a default Guest network for account " + getAccountName() + " in domain id=" + getDomainId()); + throw new InvalidParameterValueException("Unable to find a default guest network for account " + getAccountName() + " in domain ID=" + getDomainId()); } else { return defaultGuestNetwork.getId(); } @@ -227,7 +227,7 @@ public class AssociateIPAddrCmd extends BaseAsyncCreateCmd { " as it's no longer active"); } } else { - throw new InvalidParameterValueException("Unable to find project by id"); + throw new InvalidParameterValueException("Unable to find project by ID"); } } else if (networkId != null) { Network network = _networkService.getNetwork(networkId); @@ -249,7 +249,7 @@ public class AssociateIPAddrCmd extends BaseAsyncCreateCmd { } else if (vpcId != null) { Vpc vpc = _entityMgr.findById(Vpc.class, getVpcId()); if (vpc == null) { - throw new InvalidParameterValueException("Can't find Enabled vpc by id specified"); + throw new InvalidParameterValueException("Can't find enabled VPC by ID specified"); } return vpc.getAccountId(); } @@ -268,7 +268,7 @@ public class AssociateIPAddrCmd extends BaseAsyncCreateCmd { @Override public String getEventDescription() { - return "associating ip to network id: " + getNetworkId() + " in zone " + getZoneId(); + return "associating IP to network ID: " + getNetworkId() + " in zone " + getZoneId(); } ///////////////////////////////////////////////////// @@ -299,7 +299,7 @@ public class AssociateIPAddrCmd extends BaseAsyncCreateCmd { setEntityId(ip.getId()); setEntityUuid(ip.getUuid()); } else { - throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to allocate ip address"); + throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to allocate IP address"); } } catch (ConcurrentOperationException ex) { s_logger.warn("Exception: ", ex); @@ -313,7 +313,7 @@ public class AssociateIPAddrCmd extends BaseAsyncCreateCmd { @Override public void execute() throws ResourceUnavailableException, ResourceAllocationException, ConcurrentOperationException, InsufficientCapacityException { - CallContext.current().setEventDetails("Ip Id: " + getEntityId()); + CallContext.current().setEventDetails("IP ID: " + getEntityId()); IpAddress result = null; @@ -328,7 +328,7 @@ public class AssociateIPAddrCmd extends BaseAsyncCreateCmd { ipResponse.setResponseName(getCommandName()); setResponseObject(ipResponse); } else { - throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to assign ip address"); + throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to assign IP address"); } } http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4c65acff/api/src/org/apache/cloudstack/api/command/user/address/DisassociateIPAddrCmd.java ---------------------------------------------------------------------- diff --git a/api/src/org/apache/cloudstack/api/command/user/address/DisassociateIPAddrCmd.java b/api/src/org/apache/cloudstack/api/command/user/address/DisassociateIPAddrCmd.java index ba41844..c2e173c 100644 --- a/api/src/org/apache/cloudstack/api/command/user/address/DisassociateIPAddrCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/address/DisassociateIPAddrCmd.java @@ -36,7 +36,7 @@ import com.cloud.exception.InvalidParameterValueException; import com.cloud.network.IpAddress; import com.cloud.user.Account; -@APICommand(name = "disassociateIpAddress", description = "Disassociates an ip address from the account.", responseObject = SuccessResponse.class, +@APICommand(name = "disassociateIpAddress", description = "Disassociates an IP address from the account.", responseObject = SuccessResponse.class, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false, entityType = { IpAddress.class }) public class DisassociateIPAddrCmd extends BaseAsyncCmd { public static final Logger s_logger = Logger.getLogger(DisassociateIPAddrCmd.class.getName()); @@ -47,7 +47,7 @@ public class DisassociateIPAddrCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = IPAddressResponse.class, required = true, description = "the id of the public ip address" + @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = IPAddressResponse.class, required = true, description = "the ID of the public IP address" + " to disassociate") private Long id; @@ -74,7 +74,7 @@ public class DisassociateIPAddrCmd extends BaseAsyncCmd { @Override public void execute() throws InsufficientAddressCapacityException { - CallContext.current().setEventDetails("Ip Id: " + getIpAddressId()); + CallContext.current().setEventDetails("IP ID: " + getIpAddressId()); boolean result = false; if (!isPortable(id)) { result = _networkService.releaseIpAddress(getIpAddressId()); @@ -85,7 +85,7 @@ public class DisassociateIPAddrCmd extends BaseAsyncCmd { SuccessResponse response = new SuccessResponse(getCommandName()); this.setResponseObject(response); } else { - throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to disassociate ip address"); + throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to disassociate IP address"); } } @@ -100,7 +100,7 @@ public class DisassociateIPAddrCmd extends BaseAsyncCmd { @Override public String getEventDescription() { - return ("Disassociating ip address with id=" + id); + return ("Disassociating IP address with ID=" + id); } @Override @@ -108,7 +108,7 @@ public class DisassociateIPAddrCmd extends BaseAsyncCmd { if (ownerId == null) { IpAddress ip = getIpAddress(id); if (ip == null) { - throw new InvalidParameterValueException("Unable to find ip address by id=" + id); + throw new InvalidParameterValueException("Unable to find IP address by ID=" + id); } ownerId = ip.getAccountId(); } @@ -134,7 +134,7 @@ public class DisassociateIPAddrCmd extends BaseAsyncCmd { IpAddress ip = _entityMgr.findById(IpAddress.class, id); if (ip == null) { - throw new InvalidParameterValueException("Unable to find ip address by id=" + id); + throw new InvalidParameterValueException("Unable to find IP address by ID=" + id); } else { return ip; } http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4c65acff/api/src/org/apache/cloudstack/api/command/user/address/ListPublicIpAddressesCmd.java ---------------------------------------------------------------------- diff --git a/api/src/org/apache/cloudstack/api/command/user/address/ListPublicIpAddressesCmd.java b/api/src/org/apache/cloudstack/api/command/user/address/ListPublicIpAddressesCmd.java index 5720a50..0a0e7a1 100644 --- a/api/src/org/apache/cloudstack/api/command/user/address/ListPublicIpAddressesCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/address/ListPublicIpAddressesCmd.java @@ -39,7 +39,7 @@ import org.apache.cloudstack.api.response.ZoneResponse; import com.cloud.network.IpAddress; import com.cloud.utils.Pair; -@APICommand(name = "listPublicIpAddresses", description = "Lists all public ip addresses", responseObject = IPAddressResponse.class, responseView = ResponseView.Restricted, +@APICommand(name = "listPublicIpAddresses", description = "Lists all public IP addresses", responseObject = IPAddressResponse.class, responseView = ResponseView.Restricted, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false, entityType = { IpAddress.class }) public class ListPublicIpAddressesCmd extends BaseListTaggedResourcesCmd { public static final Logger s_logger = Logger.getLogger(ListPublicIpAddressesCmd.class.getName()); @@ -59,7 +59,7 @@ public class ListPublicIpAddressesCmd extends BaseListTaggedResourcesCmd { @Parameter(name = ApiConstants.FOR_VIRTUAL_NETWORK, type = CommandType.BOOLEAN, description = "the virtual network for the IP address") private Boolean forVirtualNetwork; - @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = IPAddressResponse.class, description = "lists ip address by id") + @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = IPAddressResponse.class, description = "lists IP address by ID") private Long id; @Parameter(name = ApiConstants.IP_ADDRESS, type = CommandType.STRING, description = "lists the specified IP address") @@ -68,16 +68,16 @@ public class ListPublicIpAddressesCmd extends BaseListTaggedResourcesCmd { @Parameter(name = ApiConstants.VLAN_ID, type = CommandType.UUID, entityType = VlanIpRangeResponse.class, description = "lists all public IP addresses by VLAN ID") private Long vlanId; - @Parameter(name = ApiConstants.ZONE_ID, type = CommandType.UUID, entityType = ZoneResponse.class, description = "lists all public IP addresses by Zone ID") + @Parameter(name = ApiConstants.ZONE_ID, type = CommandType.UUID, entityType = ZoneResponse.class, description = "lists all public IP addresses by zone ID") private Long zoneId; - @Parameter(name = ApiConstants.FOR_LOAD_BALANCING, type = CommandType.BOOLEAN, description = "list only ips used for load balancing") + @Parameter(name = ApiConstants.FOR_LOAD_BALANCING, type = CommandType.BOOLEAN, description = "list only IPs used for load balancing") private Boolean forLoadBalancing; @Parameter(name = ApiConstants.PHYSICAL_NETWORK_ID, type = CommandType.UUID, entityType = PhysicalNetworkResponse.class, - description = "lists all public IP addresses by physical network id") + description = "lists all public IP addresses by physical network ID") private Long physicalNetworkId; @Parameter(name = ApiConstants.ASSOCIATED_NETWORK_ID, @@ -86,13 +86,13 @@ public class ListPublicIpAddressesCmd extends BaseListTaggedResourcesCmd { description = "lists all public IP addresses associated to the network specified") private Long associatedNetworkId; - @Parameter(name = ApiConstants.IS_SOURCE_NAT, type = CommandType.BOOLEAN, description = "list only source nat ip addresses") + @Parameter(name = ApiConstants.IS_SOURCE_NAT, type = CommandType.BOOLEAN, description = "list only source NAT IP addresses") private Boolean isSourceNat; - @Parameter(name = ApiConstants.IS_STATIC_NAT, type = CommandType.BOOLEAN, description = "list only static nat ip addresses") + @Parameter(name = ApiConstants.IS_STATIC_NAT, type = CommandType.BOOLEAN, description = "list only static NAT IP addresses") private Boolean isStaticNat; - @Parameter(name = ApiConstants.VPC_ID, type = CommandType.UUID, entityType = VpcResponse.class, description = "List ips belonging to the VPC") + @Parameter(name = ApiConstants.VPC_ID, type = CommandType.UUID, entityType = VpcResponse.class, description = "List IPs belonging to the VPC") private Long vpcId; @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/4c65acff/api/src/org/apache/cloudstack/api/command/user/address/UpdateIPAddrCmd.java ---------------------------------------------------------------------- diff --git a/api/src/org/apache/cloudstack/api/command/user/address/UpdateIPAddrCmd.java b/api/src/org/apache/cloudstack/api/command/user/address/UpdateIPAddrCmd.java index f0ea667..6d20283 100644 --- a/api/src/org/apache/cloudstack/api/command/user/address/UpdateIPAddrCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/address/UpdateIPAddrCmd.java @@ -38,7 +38,7 @@ import com.cloud.exception.ResourceUnavailableException; import com.cloud.network.IpAddress; import com.cloud.user.Account; -@APICommand(name = "updateIpAddress", description = "Updates an ip address", responseObject = IPAddressResponse.class, +@APICommand(name = "updateIpAddress", description = "Updates an IP address", responseObject = IPAddressResponse.class, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false, entityType = { IpAddress.class }) public class UpdateIPAddrCmd extends BaseAsyncCustomIdCmd { public static final Logger s_logger = Logger.getLogger(UpdateIPAddrCmd.class.getName()); @@ -48,14 +48,14 @@ public class UpdateIPAddrCmd extends BaseAsyncCustomIdCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = IPAddressResponse.class, required = true, description = "the id of the public ip address" + @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = IPAddressResponse.class, required = true, description = "the ID of the public IP address" + " to update") private Long id; // unexposed parameter needed for events logging @Parameter(name = ApiConstants.ACCOUNT_ID, type = CommandType.UUID, entityType = AccountResponse.class, expose = false) private Long ownerId; - @Parameter(name = ApiConstants.FOR_DISPLAY, type = CommandType.BOOLEAN, description = "an optional field, whether to the display the ip to the end user or not", since = "4.4", authorized = {RoleType.Admin}) + @Parameter(name = ApiConstants.FOR_DISPLAY, type = CommandType.BOOLEAN, description = "an optional field, whether to the display the IP to the end user or not", since = "4.4", authorized = {RoleType.Admin}) private Boolean display; ///////////////////////////////////////////////////// @@ -85,7 +85,7 @@ public class UpdateIPAddrCmd extends BaseAsyncCustomIdCmd { @Override public String getEventDescription() { - return ("Updating ip address with id=" + id); + return ("Updating IP address with ID=" + id); } @@ -94,7 +94,7 @@ public class UpdateIPAddrCmd extends BaseAsyncCustomIdCmd { if (ownerId == null) { IpAddress ip = getIpAddress(id); if (ip == null) { - throw new InvalidParameterValueException("Unable to find ip address by id=" + id); + throw new InvalidParameterValueException("Unable to find IP address by ID=" + id); } ownerId = ip.getAccountId(); } @@ -109,7 +109,7 @@ public class UpdateIPAddrCmd extends BaseAsyncCustomIdCmd { IpAddress ip = _entityMgr.findById(IpAddress.class, id); if (ip == null) { - throw new InvalidParameterValueException("Unable to find ip address by id=" + id); + throw new InvalidParameterValueException("Unable to find IP address by ID=" + id); } else { return ip; }