You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bh...@apache.org on 2012/12/04 11:02:56 UTC
[34/55] [abbrv] api_refactor: refactor project apis
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/api/commands/UpdateCfgCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/UpdateCfgCmd.java b/api/src/com/cloud/api/commands/UpdateCfgCmd.java
index 41720d8..ea5e877 100644
--- a/api/src/com/cloud/api/commands/UpdateCfgCmd.java
+++ b/api/src/com/cloud/api/commands/UpdateCfgCmd.java
@@ -62,12 +62,12 @@ public class UpdateCfgCmd extends BaseCmd {
public String getCommandName() {
return s_name;
}
-
+
@Override
public long getEntityOwnerId() {
return Account.ACCOUNT_ID_SYSTEM;
}
-
+
@Override
public void execute(){
Configuration cfg = _configService.updateConfiguration(this);
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/api/commands/UpdateClusterCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/UpdateClusterCmd.java b/api/src/com/cloud/api/commands/UpdateClusterCmd.java
index 6d901e3..7c3b2b3 100755
--- a/api/src/com/cloud/api/commands/UpdateClusterCmd.java
+++ b/api/src/com/cloud/api/commands/UpdateClusterCmd.java
@@ -38,22 +38,22 @@ public class UpdateClusterCmd extends BaseCmd {
@IdentityMapper(entityTableName="cluster")
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the ID of the Cluster")
private Long id;
-
+
@Parameter(name=ApiConstants.CLUSTER_NAME, type=CommandType.STRING, description="the cluster name")
private String clusterName;
@Parameter(name=ApiConstants.HYPERVISOR, type=CommandType.STRING, description="hypervisor type of the cluster")
private String hypervisor;
-
+
@Parameter(name=ApiConstants.CLUSTER_TYPE, type=CommandType.STRING, description="hypervisor type of the cluster")
private String clusterType;
-
+
@Parameter(name=ApiConstants.ALLOCATION_STATE, type=CommandType.STRING, description="Allocation state of this cluster for allocation of new resources")
private String allocationState;
-
+
@Parameter(name=ApiConstants.MANAGED_STATE, type=CommandType.STRING, description="whether this cluster is managed by cloudstack")
private String managedState;
-
+
public String getClusterName() {
return clusterName;
}
@@ -63,34 +63,34 @@ public class UpdateClusterCmd extends BaseCmd {
}
public String getHypervisor() {
- return hypervisor;
+ return hypervisor;
}
-
+
@Override
public String getCommandName() {
- return s_name;
+ return s_name;
}
-
+
public String getClusterType() {
- return clusterType;
+ return clusterType;
}
-
+
public void setClusterType(String type) {
- this.clusterType = type;
+ this.clusterType = type;
}
-
+
@Override
public long getEntityOwnerId() {
return Account.ACCOUNT_ID_SYSTEM;
}
-
+
public String getAllocationState() {
- return allocationState;
+ return allocationState;
}
-
+
public void setAllocationState(String allocationState) {
- this.allocationState = allocationState;
- }
+ this.allocationState = allocationState;
+ }
public String getManagedstate() {
return managedState;
@@ -102,11 +102,11 @@ public class UpdateClusterCmd extends BaseCmd {
@Override
public void execute(){
- Cluster cluster = _resourceService.getCluster(getId());
+ Cluster cluster = _resourceService.getCluster(getId());
if (cluster == null) {
throw new InvalidParameterValueException("Unable to find the cluster by id=" + getId());
}
-
+
Cluster result = _resourceService.updateCluster(cluster, getClusterType(), getHypervisor(), getAllocationState(), getManagedstate());
if (result != null) {
ClusterResponse clusterResponse = _responseGenerator.createClusterResponse(cluster, false);
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/api/commands/UpdateDiskOfferingCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/UpdateDiskOfferingCmd.java b/api/src/com/cloud/api/commands/UpdateDiskOfferingCmd.java
index 8f58ac0..6e10495 100755
--- a/api/src/com/cloud/api/commands/UpdateDiskOfferingCmd.java
+++ b/api/src/com/cloud/api/commands/UpdateDiskOfferingCmd.java
@@ -45,7 +45,7 @@ public class UpdateDiskOfferingCmd extends BaseCmd{
@Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="updates name of the disk offering with this value")
private String diskOfferingName;
-
+
@Parameter(name=ApiConstants.SORT_KEY, type=CommandType.INTEGER, description="sort key of the disk offering, integer")
private Integer sortKey;
@@ -64,26 +64,26 @@ public class UpdateDiskOfferingCmd extends BaseCmd{
public String getDiskOfferingName() {
return diskOfferingName;
}
-
+
public Integer getSortKey() {
- return sortKey;
+ return sortKey;
}
/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////
-
+
@Override
public String getCommandName() {
return s_name;
}
-
+
@Override
public long getEntityOwnerId() {
return Account.ACCOUNT_ID_SYSTEM;
}
-
+
@Override
public void execute(){
DiskOffering result = _configService.updateDiskOffering(this);
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/api/commands/UpdateDomainCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/UpdateDomainCmd.java b/api/src/com/cloud/api/commands/UpdateDomainCmd.java
index 5989e87..950dff6 100644
--- a/api/src/com/cloud/api/commands/UpdateDomainCmd.java
+++ b/api/src/com/cloud/api/commands/UpdateDomainCmd.java
@@ -44,7 +44,7 @@ public class UpdateDomainCmd extends BaseCmd {
@Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="updates domain with this name")
private String domainName;
-
+
@Parameter(name=ApiConstants.NETWORK_DOMAIN, type=CommandType.STRING, description="Network domain for the domain's networks; empty string will update domainName with NULL value")
private String networkDomain;
@@ -59,7 +59,7 @@ public class UpdateDomainCmd extends BaseCmd {
public String getDomainName() {
return domainName;
}
-
+
public String getNetworkDomain() {
return networkDomain;
}
@@ -72,12 +72,12 @@ public class UpdateDomainCmd extends BaseCmd {
public String getCommandName() {
return s_name;
}
-
+
@Override
public long getEntityOwnerId() {
return Account.ACCOUNT_ID_SYSTEM;
}
-
+
@Override
public void execute(){
UserContext.current().setEventDetails("Domain Id: "+getId());
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/api/commands/UpdateHostCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/UpdateHostCmd.java b/api/src/com/cloud/api/commands/UpdateHostCmd.java
index 020a324..e09e4f0 100755
--- a/api/src/com/cloud/api/commands/UpdateHostCmd.java
+++ b/api/src/com/cloud/api/commands/UpdateHostCmd.java
@@ -52,7 +52,7 @@ public class UpdateHostCmd extends BaseCmd {
@Parameter(name=ApiConstants.HOST_TAGS, type=CommandType.LIST, collectionType=CommandType.STRING, description="list of tags to be added to the host")
private List<String> hostTags;
-
+
@Parameter(name=ApiConstants.URL, type=CommandType.STRING, description="the new uri for the secondary storage: nfs://host/path")
private String url;
@@ -74,10 +74,10 @@ public class UpdateHostCmd extends BaseCmd {
public List<String> getHostTags() {
return hostTags;
- }
-
+ }
+
public String getUrl() {
- return url;
+ return url;
}
/////////////////////////////////////////////////////
@@ -102,13 +102,13 @@ public class UpdateHostCmd extends BaseCmd {
public void execute(){
Host result;
try {
- result = _resourceService.updateHost(this);
+ result = _resourceService.updateHost(this);
HostResponse hostResponse = _responseGenerator.createHostResponse(result);
hostResponse.setResponseName(getCommandName());
this.setResponseObject(hostResponse);
} catch (Exception e) {
- s_logger.debug("Failed to update host:" + getId(), e);
- throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to update host:" + getId() + "," + e.getMessage());
+ s_logger.debug("Failed to update host:" + getId(), e);
+ throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to update host:" + getId() + "," + e.getMessage());
}
}
}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/api/commands/UpdateHostPasswordCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/UpdateHostPasswordCmd.java b/api/src/com/cloud/api/commands/UpdateHostPasswordCmd.java
index e71c63d..9f8c02e 100644
--- a/api/src/com/cloud/api/commands/UpdateHostPasswordCmd.java
+++ b/api/src/com/cloud/api/commands/UpdateHostPasswordCmd.java
@@ -48,7 +48,7 @@ public class UpdateHostPasswordCmd extends BaseCmd {
@Parameter(name=ApiConstants.USERNAME, type=CommandType.STRING, required=true, description="the username for the host/cluster")
private String username;
-
+
@Parameter(name=ApiConstants.PASSWORD, type=CommandType.STRING, required=true, description="the new password for the host/cluster")
private String password;
@@ -59,7 +59,7 @@ public class UpdateHostPasswordCmd extends BaseCmd {
public Long getHostId() {
return hostId;
}
-
+
public Long getClusterId() {
return clusterId;
}
@@ -71,7 +71,7 @@ public class UpdateHostPasswordCmd extends BaseCmd {
public String getUsername() {
return username;
}
-
+
// ///////////////////////////////////////////////////
// ///////////// API Implementation///////////////////
// ///////////////////////////////////////////////////
@@ -92,4 +92,4 @@ public class UpdateHostPasswordCmd extends BaseCmd {
_resourceService.updateHostPassword(this);
this.setResponseObject(new SuccessResponse(getCommandName()));
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/api/commands/UpdateIsoCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/UpdateIsoCmd.java b/api/src/com/cloud/api/commands/UpdateIsoCmd.java
index de3a69b..f42c128 100755
--- a/api/src/com/cloud/api/commands/UpdateIsoCmd.java
+++ b/api/src/com/cloud/api/commands/UpdateIsoCmd.java
@@ -33,12 +33,12 @@ public class UpdateIsoCmd extends UpdateTemplateOrIsoCmd {
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
-
+
@Override
public Boolean isPasswordEnabled() {
return null;
}
-
+
@Override
public String getFormat() {
return null;
@@ -52,7 +52,7 @@ public class UpdateIsoCmd extends UpdateTemplateOrIsoCmd {
public String getCommandName() {
return s_name;
}
-
+
@Override
public long getEntityOwnerId() {
VirtualMachineTemplate template = _entityMgr.findById(VirtualMachineTemplate.class, getId());
@@ -62,7 +62,7 @@ public class UpdateIsoCmd extends UpdateTemplateOrIsoCmd {
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
}
-
+
@Override
public void execute(){
VirtualMachineTemplate result = _mgr.updateTemplate(this);
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/api/commands/UpdateIsoPermissionsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/UpdateIsoPermissionsCmd.java b/api/src/com/cloud/api/commands/UpdateIsoPermissionsCmd.java
index 7b55769..208ee1c 100644
--- a/api/src/com/cloud/api/commands/UpdateIsoPermissionsCmd.java
+++ b/api/src/com/cloud/api/commands/UpdateIsoPermissionsCmd.java
@@ -26,13 +26,13 @@ import com.cloud.user.Account;
@Implementation(description="Updates iso permissions", responseObject=SuccessResponse.class)
public class UpdateIsoPermissionsCmd extends UpdateTemplateOrIsoPermissionsCmd {
protected String getResponseName() {
- return "updateisopermissionsresponse";
+ return "updateisopermissionsresponse";
+ }
+
+ protected Logger getLogger() {
+ return Logger.getLogger(UpdateIsoPermissionsCmd.class.getName());
}
- protected Logger getLogger() {
- return Logger.getLogger(UpdateIsoPermissionsCmd.class.getName());
- }
-
@Override
public long getEntityOwnerId() {
VirtualMachineTemplate template = _entityMgr.findById(VirtualMachineTemplate.class, getId());
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/api/commands/UpdateLoadBalancerRuleCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/UpdateLoadBalancerRuleCmd.java b/api/src/com/cloud/api/commands/UpdateLoadBalancerRuleCmd.java
index 8cb2ca5..91ed7d3 100644
--- a/api/src/com/cloud/api/commands/UpdateLoadBalancerRuleCmd.java
+++ b/api/src/com/cloud/api/commands/UpdateLoadBalancerRuleCmd.java
@@ -100,7 +100,7 @@ public class UpdateLoadBalancerRuleCmd extends BaseAsyncCmd {
public String getEventDescription() {
return "updating load balancer rule";
}
-
+
@Override
public void execute(){
UserContext.current().setEventDetails("Load balancer Id: "+getId());
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/api/commands/UpdateNetworkCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/UpdateNetworkCmd.java b/api/src/com/cloud/api/commands/UpdateNetworkCmd.java
index c801e89..b5bb48e 100644
--- a/api/src/com/cloud/api/commands/UpdateNetworkCmd.java
+++ b/api/src/com/cloud/api/commands/UpdateNetworkCmd.java
@@ -47,43 +47,43 @@ public class UpdateNetworkCmd extends BaseAsyncCmd {
@IdentityMapper(entityTableName="networks")
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the ID of the network")
private Long id;
-
+
@Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="the new name for the network")
private String name;
-
+
@Parameter(name=ApiConstants.DISPLAY_TEXT, type=CommandType.STRING, description="the new display text for the network")
private String displayText;
-
+
@Parameter(name=ApiConstants.NETWORK_DOMAIN, type=CommandType.STRING, description="network domain")
private String networkDomain;
-
+
@Parameter(name=ApiConstants.CHANGE_CIDR, type=CommandType.BOOLEAN, description="Force update even if cidr type is different")
private Boolean changeCidr;
-
+
@IdentityMapper(entityTableName="network_offerings")
@Parameter(name=ApiConstants.NETWORK_OFFERING_ID, type=CommandType.LONG, description="network offering ID")
private Long networkOfferingId;
-
+
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
-
+
public Long getId() {
return id;
}
-
+
public String getNetworkName() {
return name;
}
-
+
public String getDisplayText() {
return displayText;
}
-
+
private String getNetworkDomain() {
return networkDomain;
}
-
+
private Long getNetworkOfferingId() {
return networkOfferingId;
}
@@ -102,7 +102,7 @@ public class UpdateNetworkCmd extends BaseAsyncCmd {
public String getCommandName() {
return s_name;
}
-
+
@Override
public long getEntityOwnerId() {
Network network = _networkService.getNetwork(id);
@@ -112,7 +112,7 @@ public class UpdateNetworkCmd extends BaseAsyncCmd {
return _networkService.getNetwork(id).getAccountId();
}
}
-
+
@Override
public void execute() throws InsufficientCapacityException, ConcurrentOperationException{
User callerUser = _accountService.getActiveUser(UserContext.current().getCallerUserId());
@@ -121,7 +121,7 @@ public class UpdateNetworkCmd extends BaseAsyncCmd {
if (network == null) {
throw new InvalidParameterValueException("Couldn't find network by id");
}
-
+
Network result = null;
if (network.getVpcId() != null) {
result = _vpcService.updateVpcGuestNetwork(getId(), getNetworkName(), getDisplayText(), callerAccount,
@@ -130,7 +130,7 @@ public class UpdateNetworkCmd extends BaseAsyncCmd {
result = _networkService.updateGuestNetwork(getId(), getNetworkName(), getDisplayText(), callerAccount,
callerUser, getNetworkDomain(), getNetworkOfferingId(), getChangeCidr());
}
-
+
if (result != null) {
NetworkResponse response = _responseGenerator.createNetworkResponse(result);
response.setResponseName(getCommandName());
@@ -139,12 +139,12 @@ public class UpdateNetworkCmd extends BaseAsyncCmd {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to update network");
}
}
-
+
@Override
public String getEventDescription() {
return "Updating network: " + getId();
}
-
+
@Override
public String getEventType() {
return EventTypes.EVENT_NETWORK_UPDATE;
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/api/commands/UpdateNetworkOfferingCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/UpdateNetworkOfferingCmd.java b/api/src/com/cloud/api/commands/UpdateNetworkOfferingCmd.java
index 2521dea..0c3f829 100755
--- a/api/src/com/cloud/api/commands/UpdateNetworkOfferingCmd.java
+++ b/api/src/com/cloud/api/commands/UpdateNetworkOfferingCmd.java
@@ -36,21 +36,21 @@ public class UpdateNetworkOfferingCmd extends BaseCmd {
/////////////////////////////////////////////////////
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
-
+
@IdentityMapper(entityTableName="network_offerings")
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="the id of the network offering")
private Long id;
@Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="the name of the network offering")
private String networkOfferingName;
-
+
@Parameter(name=ApiConstants.DISPLAY_TEXT, type=CommandType.STRING, description="the display text of the network offering")
private String displayText;
-
+
@Parameter(name=ApiConstants.AVAILABILITY, type=CommandType.STRING, description="the availability of network offering." +
- " Default value is Required for Guest Virtual network offering; Optional for Guest Direct network offering")
+ " Default value is Required for Guest Virtual network offering; Optional for Guest Direct network offering")
private String availability;
-
+
@Parameter(name=ApiConstants.SORT_KEY, type=CommandType.INTEGER, description="sort key of the network offering, integer")
private Integer sortKey;
@@ -60,15 +60,15 @@ public class UpdateNetworkOfferingCmd extends BaseCmd {
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
-
+
public String getNetworkOfferingName() {
return networkOfferingName;
}
-
+
public String getDisplayText() {
return displayText;
}
-
+
public Long getId() {
return id;
}
@@ -80,9 +80,9 @@ public class UpdateNetworkOfferingCmd extends BaseCmd {
public String getState() {
return state;
}
-
+
public Integer getSortKey() {
- return sortKey;
+ return sortKey;
}
/////////////////////////////////////////////////////
@@ -92,7 +92,7 @@ public class UpdateNetworkOfferingCmd extends BaseCmd {
public String getCommandName() {
return _name;
}
-
+
@Override
public long getEntityOwnerId() {
return Account.ACCOUNT_ID_SYSTEM;
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/api/commands/UpdateNetworkServiceProviderCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/UpdateNetworkServiceProviderCmd.java b/api/src/com/cloud/api/commands/UpdateNetworkServiceProviderCmd.java
index be38523..fb34038 100644
--- a/api/src/com/cloud/api/commands/UpdateNetworkServiceProviderCmd.java
+++ b/api/src/com/cloud/api/commands/UpdateNetworkServiceProviderCmd.java
@@ -44,14 +44,14 @@ public class UpdateNetworkServiceProviderCmd extends BaseAsyncCmd {
/////////////////////////////////////////////////////
@Parameter(name=ApiConstants.STATE, type=CommandType.STRING, description="Enabled/Disabled/Shutdown the physical network service provider")
private String state;
-
+
@IdentityMapper(entityTableName="physical_network_service_providers")
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="network service provider id")
- private Long id;
+ private Long id;
@Parameter(name=ApiConstants.SERVICE_LIST, type=CommandType.LIST, collectionType = CommandType.STRING, description="the list of services to be enabled for this physical network service provider")
private List<String> enabledServices;
-
+
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
@@ -59,14 +59,14 @@ public class UpdateNetworkServiceProviderCmd extends BaseAsyncCmd {
public String getState() {
return state;
}
-
+
private Long getId() {
return id;
- }
-
+ }
+
public List<String> getEnabledServices() {
return enabledServices;
- }
+ }
/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////
@@ -75,12 +75,12 @@ public class UpdateNetworkServiceProviderCmd extends BaseAsyncCmd {
public String getCommandName() {
return s_name;
}
-
+
@Override
public long getEntityOwnerId() {
return Account.ACCOUNT_ID_SYSTEM;
}
-
+
@Override
public void execute(){
PhysicalNetworkServiceProvider result = _networkService.updateNetworkServiceProvider(getId(), getState(), getEnabledServices());
@@ -102,7 +102,7 @@ public class UpdateNetworkServiceProviderCmd extends BaseAsyncCmd {
public String getEventDescription() {
return "Updating physical network ServiceProvider: " + getId();
}
-
+
@Override
public AsyncJob.Type getInstanceType() {
return AsyncJob.Type.PhysicalNetworkServiceProvider;
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/api/commands/UpdatePhysicalNetworkCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/UpdatePhysicalNetworkCmd.java b/api/src/com/cloud/api/commands/UpdatePhysicalNetworkCmd.java
index 19dd9ae..32c29a4 100644
--- a/api/src/com/cloud/api/commands/UpdatePhysicalNetworkCmd.java
+++ b/api/src/com/cloud/api/commands/UpdatePhysicalNetworkCmd.java
@@ -49,17 +49,17 @@ public class UpdatePhysicalNetworkCmd extends BaseAsyncCmd {
@Parameter(name=ApiConstants.TAGS, type=CommandType.LIST, collectionType=CommandType.STRING, description="Tag the physical network")
private List<String> tags;
-
+
@Parameter(name=ApiConstants.STATE, type=CommandType.STRING, description="Enabled/Disabled")
private String state;
@Parameter(name=ApiConstants.VLAN, type=CommandType.STRING, description="the VLAN for the physical network")
private String vlan;
-
+
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
-
+
public List<String> getTags() {
return tags;
}
@@ -67,7 +67,7 @@ public class UpdatePhysicalNetworkCmd extends BaseAsyncCmd {
public String getNetworkSpeed() {
return speed;
}
-
+
public String getState() {
return state;
}
@@ -79,7 +79,7 @@ public class UpdatePhysicalNetworkCmd extends BaseAsyncCmd {
public String getVlan() {
return vlan;
}
-
+
/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////
@@ -88,12 +88,12 @@ public class UpdatePhysicalNetworkCmd extends BaseAsyncCmd {
public String getCommandName() {
return s_name;
}
-
+
@Override
public long getEntityOwnerId() {
return Account.ACCOUNT_ID_SYSTEM;
}
-
+
@Override
public void execute(){
PhysicalNetwork result = _networkService.updatePhysicalNetwork(getId(),getNetworkSpeed(), getTags(), getVlan(), getState());
@@ -106,12 +106,12 @@ public class UpdatePhysicalNetworkCmd extends BaseAsyncCmd {
public String getEventDescription() {
return "Updating Physical network: " + getId();
}
-
+
@Override
public String getEventType() {
return EventTypes.EVENT_PHYSICAL_NETWORK_UPDATE;
}
-
+
@Override
public AsyncJob.Type getInstanceType() {
return AsyncJob.Type.PhysicalNetwork;
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/api/commands/UpdatePodCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/UpdatePodCmd.java b/api/src/com/cloud/api/commands/UpdatePodCmd.java
index 48207b9..515a02d 100755
--- a/api/src/com/cloud/api/commands/UpdatePodCmd.java
+++ b/api/src/com/cloud/api/commands/UpdatePodCmd.java
@@ -47,16 +47,16 @@ public class UpdatePodCmd extends BaseCmd {
@Parameter(name=ApiConstants.START_IP, type=CommandType.STRING, description="the starting IP address for the Pod")
private String startIp;
-
+
@Parameter(name=ApiConstants.END_IP, type=CommandType.STRING, description="the ending IP address for the Pod")
private String endIp;
-
+
@Parameter(name=ApiConstants.NETMASK, type=CommandType.STRING, description="the netmask of the Pod")
private String netmask;
@Parameter(name=ApiConstants.GATEWAY, type=CommandType.STRING, description="the gateway for the Pod")
private String gateway;
-
+
@Parameter(name=ApiConstants.ALLOCATION_STATE, type=CommandType.STRING, description="Allocation state of this cluster for allocation of new resources")
private String allocationState;
@@ -89,7 +89,7 @@ public class UpdatePodCmd extends BaseCmd {
}
public String getAllocationState() {
- return allocationState;
+ return allocationState;
}
/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
@@ -99,12 +99,12 @@ public class UpdatePodCmd extends BaseCmd {
public String getCommandName() {
return s_name;
}
-
+
@Override
public long getEntityOwnerId() {
return Account.ACCOUNT_ID_SYSTEM;
}
-
+
@Override
public void execute(){
Pod result = _configService.editPod(this);
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/api/commands/UpdateProjectCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/UpdateProjectCmd.java b/api/src/com/cloud/api/commands/UpdateProjectCmd.java
deleted file mode 100644
index 54320d5..0000000
--- a/api/src/com/cloud/api/commands/UpdateProjectCmd.java
+++ /dev/null
@@ -1,114 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.api.commands;
-
-import org.apache.log4j.Logger;
-
-import org.apache.cloudstack.api.ApiConstants;
-import org.apache.cloudstack.api.BaseAsyncCmd;
-import org.apache.cloudstack.api.BaseCmd;
-import org.apache.cloudstack.api.IdentityMapper;
-import org.apache.cloudstack.api.Implementation;
-import org.apache.cloudstack.api.Parameter;
-import org.apache.cloudstack.api.ServerApiException;
-import com.cloud.api.response.ProjectResponse;
-import com.cloud.event.EventTypes;
-import com.cloud.exception.InvalidParameterValueException;
-import com.cloud.exception.ResourceAllocationException;
-import com.cloud.projects.Project;
-import com.cloud.user.UserContext;
-
-@Implementation(description="Updates a project", responseObject=ProjectResponse.class, since="3.0.0")
-public class UpdateProjectCmd extends BaseAsyncCmd {
- public static final Logger s_logger = Logger.getLogger(UpdateProjectCmd.class.getName());
-
- private static final String s_name = "updateprojectresponse";
-
- /////////////////////////////////////////////////////
- //////////////// API parameters /////////////////////
- /////////////////////////////////////////////////////
-
- @IdentityMapper(entityTableName="projects")
- @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="id of the project to be modified")
- private Long id;
-
- @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="new Admin account for the project")
- private String accountName;
-
- @Parameter(name=ApiConstants.DISPLAY_TEXT, type=CommandType.STRING, description="display text of the project")
- private String displayText;
-
- /////////////////////////////////////////////////////
- /////////////////// Accessors ///////////////////////
- /////////////////////////////////////////////////////
-
- public String getAccountName() {
- return accountName;
- }
-
- public Long getId() {
- return id;
- }
-
- public String getDisplayText() {
- return displayText;
- }
-
- @Override
- public String getCommandName() {
- return s_name;
- }
-
- @Override
- public long getEntityOwnerId() {
- Project project= _projectService.getProject(id);
- //verify input parameters
- if (project == null) {
- throw new InvalidParameterValueException("Unable to find project by id " + id);
- }
-
- return _projectService.getProjectOwner(id).getId();
- }
-
-
- /////////////////////////////////////////////////////
- /////////////// API Implementation///////////////////
- /////////////////////////////////////////////////////
-
- @Override
- public void execute() throws ResourceAllocationException{
- UserContext.current().setEventDetails("Project id: "+ getId());
- Project project = _projectService.updateProject(getId(), getDisplayText(), getAccountName());
- if (project != null) {
- ProjectResponse response = _responseGenerator.createProjectResponse(project);
- response.setResponseName(getCommandName());
- this.setResponseObject(response);
- } else {
- throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to update a project");
- }
- }
-
- @Override
- public String getEventType() {
- return EventTypes.EVENT_PROJECT_UPDATE;
- }
-
- @Override
- public String getEventDescription() {
- return "Updating project: " + id;
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/api/commands/UpdateProjectInvitationCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/UpdateProjectInvitationCmd.java b/api/src/com/cloud/api/commands/UpdateProjectInvitationCmd.java
deleted file mode 100644
index 83aa03d..0000000
--- a/api/src/com/cloud/api/commands/UpdateProjectInvitationCmd.java
+++ /dev/null
@@ -1,112 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.api.commands;
-
-import org.apache.log4j.Logger;
-
-import org.apache.cloudstack.api.ApiConstants;
-import org.apache.cloudstack.api.BaseAsyncCmd;
-import org.apache.cloudstack.api.BaseCmd;
-import org.apache.cloudstack.api.IdentityMapper;
-import org.apache.cloudstack.api.Implementation;
-import org.apache.cloudstack.api.Parameter;
-import org.apache.cloudstack.api.ServerApiException;
-import com.cloud.api.response.SuccessResponse;
-import com.cloud.event.EventTypes;
-import com.cloud.user.Account;
-import com.cloud.user.UserContext;
-
-@Implementation(description = "Accepts or declines project invitation", responseObject = SuccessResponse.class, since = "3.0.0")
-public class UpdateProjectInvitationCmd extends BaseAsyncCmd {
- public static final Logger s_logger = Logger.getLogger(UpdateProjectInvitationCmd.class.getName());
- private static final String s_name = "updateprojectinvitationresponse";
-
- // ///////////////////////////////////////////////////
- // ////////////// API parameters /////////////////////
- // ///////////////////////////////////////////////////
- @IdentityMapper(entityTableName = "projects")
- @Parameter(name = ApiConstants.PROJECT_ID, required = true, type = CommandType.LONG, description = "id of the project to join")
- private Long projectId;
-
- @Parameter(name = ApiConstants.ACCOUNT, type = CommandType.STRING, description = "account that is joining the project")
- private String accountName;
-
- @Parameter(name = ApiConstants.TOKEN, type = CommandType.STRING, description = "list invitations for specified account; this parameter has to be specified with domainId")
- private String token;
-
- @Parameter(name = ApiConstants.ACCEPT, type = CommandType.BOOLEAN, description = "if true, accept the invitation, decline if false. True by default")
- private Boolean accept;
-
- // ///////////////////////////////////////////////////
- // ///////////////// Accessors ///////////////////////
- // ///////////////////////////////////////////////////
- public Long getProjectId() {
- return projectId;
- }
-
- public String getAccountName() {
- return accountName;
- }
-
- @Override
- public String getCommandName() {
- return s_name;
- }
-
- public String getToken() {
- return token;
- }
-
- public Boolean getAccept() {
- if (accept == null) {
- return true;
- }
- return accept;
- }
-
- // ///////////////////////////////////////////////////
- // ///////////// API Implementation///////////////////
- // ///////////////////////////////////////////////////
- @Override
- public long getEntityOwnerId() {
- // TODO - return project entity ownerId
- return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are
-// tracked
- }
-
- @Override
- public void execute() {
- UserContext.current().setEventDetails("Project id: " + projectId + "; accountName " + accountName + "; accept " + getAccept());
- boolean result = _projectService.updateInvitation(projectId, accountName, token, getAccept());
- if (result) {
- SuccessResponse response = new SuccessResponse(getCommandName());
- this.setResponseObject(response);
- } else {
- throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to join the project");
- }
- }
-
- @Override
- public String getEventType() {
- return EventTypes.EVENT_PROJECT_INVITATION_UPDATE;
- }
-
- @Override
- public String getEventDescription() {
- return "Updating project invitation for projectId " + projectId;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/api/commands/UpdateResourceCountCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/UpdateResourceCountCmd.java b/api/src/com/cloud/api/commands/UpdateResourceCountCmd.java
index 30cc5db..811b917 100644
--- a/api/src/com/cloud/api/commands/UpdateResourceCountCmd.java
+++ b/api/src/com/cloud/api/commands/UpdateResourceCountCmd.java
@@ -53,13 +53,13 @@ public class UpdateResourceCountCmd extends BaseCmd {
private Long domainId;
@Parameter(name=ApiConstants.RESOURCE_TYPE, type=CommandType.INTEGER, description= "Type of resource to update. If specifies valid values are 0, 1, 2, 3, and 4. If not specified will update all resource counts" +
- "0 - Instance. Number of instances a user can create. " +
- "1 - IP. Number of public IP addresses a user can own. " +
- "2 - Volume. Number of disk volumes a user can create." +
- "3 - Snapshot. Number of snapshots a user can create." +
- "4 - Template. Number of templates that a user can register/create.")
+ "0 - Instance. Number of instances a user can create. " +
+ "1 - IP. Number of public IP addresses a user can own. " +
+ "2 - Volume. Number of disk volumes a user can create." +
+ "3 - Snapshot. Number of snapshots a user can create." +
+ "4 - Template. Number of templates that a user can register/create.")
private Integer resourceType;
-
+
@IdentityMapper(entityTableName="projects")
@Parameter(name=ApiConstants.PROJECT_ID, type=CommandType.LONG, description="Update resource limits for project")
private Long projectId;
@@ -83,12 +83,12 @@ public class UpdateResourceCountCmd extends BaseCmd {
/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////
-
+
@Override
public String getCommandName() {
return s_name;
}
-
+
@Override
public long getEntityOwnerId() {
Account account = UserContext.current().getCaller();
@@ -110,7 +110,7 @@ public class UpdateResourceCountCmd extends BaseCmd {
@Override
public void execute(){
- List<? extends ResourceCount> result = _resourceLimitService.recalculateResourceCount(finalyzeAccountId(accountName, domainId, projectId, true), getDomainId(), getResourceType());
+ List<? extends ResourceCount> result = _resourceLimitService.recalculateResourceCount(finalyzeAccountId(accountName, domainId, projectId, true), getDomainId(), getResourceType());
if ((result != null) && (result.size()>0)){
ListResponse<ResourceCountResponse> response = new ListResponse<ResourceCountResponse>();
@@ -129,4 +129,4 @@ public class UpdateResourceCountCmd extends BaseCmd {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to recalculate resource counts");
}
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/api/commands/UpdateResourceLimitCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/UpdateResourceLimitCmd.java b/api/src/com/cloud/api/commands/UpdateResourceLimitCmd.java
index 4459518..9ef94ef 100644
--- a/api/src/com/cloud/api/commands/UpdateResourceLimitCmd.java
+++ b/api/src/com/cloud/api/commands/UpdateResourceLimitCmd.java
@@ -45,25 +45,25 @@ public class UpdateResourceLimitCmd extends BaseCmd {
@IdentityMapper(entityTableName="domain")
@Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="Update resource limits for all accounts in specified domain. If used with the account parameter, updates resource limits for a specified account in specified domain.")
private Long domainId;
-
+
@IdentityMapper(entityTableName="projects")
@Parameter(name=ApiConstants.PROJECT_ID, type=CommandType.LONG, description="Update resource limits for project")
private Long projectId;
- @Parameter(name=ApiConstants.MAX, type=CommandType.LONG, description=" Maximum resource limit.")
+ @Parameter(name=ApiConstants.MAX, type=CommandType.LONG, description=" Maximum resource limit.")
private Long max;
@Parameter(name=ApiConstants.RESOURCE_TYPE, type=CommandType.INTEGER, required=true, description="Type of resource to update. Values are 0, 1, 2, 3, and 4. 0 - Instance. Number of instances a user can create. " +
- "1 - IP. Number of public IP addresses a user can own. " +
- "2 - Volume. Number of disk volumes a user can create." +
- "3 - Snapshot. Number of snapshots a user can create." +
- "4 - Template. Number of templates that a user can register/create.")
+ "1 - IP. Number of public IP addresses a user can own. " +
+ "2 - Volume. Number of disk volumes a user can create." +
+ "3 - Snapshot. Number of snapshots a user can create." +
+ "4 - Template. Number of templates that a user can register/create.")
private Integer resourceType;
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
-
+
public Long getMax() {
return max;
}
@@ -79,19 +79,19 @@ public class UpdateResourceLimitCmd extends BaseCmd {
/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////
-
+
@Override
public String getCommandName() {
return s_name;
}
-
+
@Override
public long getEntityOwnerId() {
Long accountId = finalyzeAccountId(accountName, domainId, projectId, true);
if (accountId == null) {
return UserContext.current().getCaller().getId();
}
-
+
return accountId;
}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/api/commands/UpdateServiceOfferingCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/UpdateServiceOfferingCmd.java b/api/src/com/cloud/api/commands/UpdateServiceOfferingCmd.java
index 30cecc9..44487fb 100755
--- a/api/src/com/cloud/api/commands/UpdateServiceOfferingCmd.java
+++ b/api/src/com/cloud/api/commands/UpdateServiceOfferingCmd.java
@@ -39,13 +39,13 @@ public class UpdateServiceOfferingCmd extends BaseCmd {
@IdentityMapper(entityTableName="disk_offering")
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the ID of the service offering to be updated")
private Long id;
-
+
@Parameter(name=ApiConstants.DISPLAY_TEXT, type=CommandType.STRING, description="the display text of the service offering to be updated")
private String displayText;
@Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="the name of the service offering to be updated")
private String serviceOfferingName;
-
+
@Parameter(name=ApiConstants.SORT_KEY, type=CommandType.INTEGER, description="sort key of the service offering, integer")
private Integer sortKey;
/////////////////////////////////////////////////////
@@ -65,19 +65,19 @@ public class UpdateServiceOfferingCmd extends BaseCmd {
}
public Integer getSortKey() {
- return sortKey;
+ return sortKey;
}
-
+
/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////
- @Override
+ @Override
public String getCommandName() {
return s_name;
}
-
+
@Override
public long getEntityOwnerId() {
return Account.ACCOUNT_ID_SYSTEM;
@@ -85,8 +85,8 @@ public class UpdateServiceOfferingCmd extends BaseCmd {
@Override
public void execute(){
- //Note
- //Once an offering is created, we cannot update the domainId field (keeping consistent with zones logic)
+ //Note
+ //Once an offering is created, we cannot update the domainId field (keeping consistent with zones logic)
ServiceOffering result = _configService.updateServiceOffering(this);
if (result != null){
ServiceOfferingResponse response = _responseGenerator.createServiceOfferingResponse(result);
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/api/commands/UpdateStorageNetworkIpRangeCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/UpdateStorageNetworkIpRangeCmd.java b/api/src/com/cloud/api/commands/UpdateStorageNetworkIpRangeCmd.java
index 8d8ace3..ec162b6 100755
--- a/api/src/com/cloud/api/commands/UpdateStorageNetworkIpRangeCmd.java
+++ b/api/src/com/cloud/api/commands/UpdateStorageNetworkIpRangeCmd.java
@@ -36,28 +36,28 @@ import com.cloud.user.Account;
@Implementation(description="Update a Storage network IP range, only allowed when no IPs in this range have been allocated.", responseObject=StorageNetworkIpRangeResponse.class, since="3.0.0")
public class UpdateStorageNetworkIpRangeCmd extends BaseAsyncCmd {
- public static final Logger s_logger = Logger.getLogger(UpdateStorageNetworkIpRangeCmd.class);
- private static final String s_name = "updatestoragenetworkiprangeresponse";
-
+ public static final Logger s_logger = Logger.getLogger(UpdateStorageNetworkIpRangeCmd.class);
+ private static final String s_name = "updatestoragenetworkiprangeresponse";
+
/////////////////////////////////////////////////////
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @IdentityMapper(entityTableName="dc_storage_network_ip_range")
+ @IdentityMapper(entityTableName="dc_storage_network_ip_range")
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="UUID of storage network ip range")
private Long id;
-
+
@Parameter(name=ApiConstants.START_IP, type=CommandType.STRING, description="the beginning IP address")
private String startIp;
@Parameter(name=ApiConstants.END_IP, type=CommandType.STRING, description="the ending IP address")
private String endIp;
-
+
@Parameter(name=ApiConstants.VLAN, type=CommandType.INTEGER, description="Optional. the vlan the ip range sits on")
private Integer vlan;
-
+
@Parameter(name=ApiConstants.NETMASK, type=CommandType.STRING, description="the netmask for storage network")
private String netmask;
-
+
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
@@ -72,49 +72,49 @@ public class UpdateStorageNetworkIpRangeCmd extends BaseAsyncCmd {
public Integer getVlan() {
return vlan;
}
-
+
public String getNetmask() {
- return netmask;
+ return netmask;
}
public Long getId() {
- return id;
+ return id;
+ }
+
+ @Override
+ public String getEventType() {
+ return EventTypes.EVENT_STORAGE_IP_RANGE_UPDATE;
+ }
+
+ @Override
+ public String getEventDescription() {
+ return "Update storage ip range " + getId() + " [StartIp=" + getStartIp() + ", EndIp=" + getEndIp() + ", vlan=" + getVlan() + ", netmask=" + getNetmask() + ']';
+ }
+
+ @Override
+ public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException,
+ ResourceAllocationException {
+ try {
+ StorageNetworkIpRange result = _storageNetworkService.updateIpRange(this);
+ StorageNetworkIpRangeResponse response = _responseGenerator.createStorageNetworkIpRangeResponse(result);
+ response.setResponseName(getCommandName());
+ this.setResponseObject(response);
+ } catch (Exception e) {
+ s_logger.warn("Update storage network IP range failed", e);
+ throw new ServerApiException(BaseCmd.INTERNAL_ERROR, e.getMessage());
+ }
+
+ }
+
+ @Override
+ public String getCommandName() {
+ return s_name;
+ }
+
+ @Override
+ public long getEntityOwnerId() {
+ return Account.ACCOUNT_ID_SYSTEM;
}
-
- @Override
- public String getEventType() {
- return EventTypes.EVENT_STORAGE_IP_RANGE_UPDATE;
- }
-
- @Override
- public String getEventDescription() {
- return "Update storage ip range " + getId() + " [StartIp=" + getStartIp() + ", EndIp=" + getEndIp() + ", vlan=" + getVlan() + ", netmask=" + getNetmask() + ']';
- }
-
- @Override
- public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException,
- ResourceAllocationException {
- try {
- StorageNetworkIpRange result = _storageNetworkService.updateIpRange(this);
- StorageNetworkIpRangeResponse response = _responseGenerator.createStorageNetworkIpRangeResponse(result);
- response.setResponseName(getCommandName());
- this.setResponseObject(response);
- } catch (Exception e) {
- s_logger.warn("Update storage network IP range failed", e);
- throw new ServerApiException(BaseCmd.INTERNAL_ERROR, e.getMessage());
- }
-
- }
-
- @Override
- public String getCommandName() {
- return s_name;
- }
-
- @Override
- public long getEntityOwnerId() {
- return Account.ACCOUNT_ID_SYSTEM;
- }
}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/api/commands/UpdateStoragePoolCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/UpdateStoragePoolCmd.java b/api/src/com/cloud/api/commands/UpdateStoragePoolCmd.java
index d4c7630..605c668 100644
--- a/api/src/com/cloud/api/commands/UpdateStoragePoolCmd.java
+++ b/api/src/com/cloud/api/commands/UpdateStoragePoolCmd.java
@@ -46,7 +46,7 @@ public class UpdateStoragePoolCmd extends BaseCmd {
@Parameter(name=ApiConstants.TAGS, type=CommandType.LIST, collectionType=CommandType.STRING, description="comma-separated list of tags for the storage pool")
private List<String> tags;
-
+
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
@@ -68,12 +68,12 @@ public class UpdateStoragePoolCmd extends BaseCmd {
public String getCommandName() {
return s_name;
}
-
+
@Override
public long getEntityOwnerId() {
return Account.ACCOUNT_ID_SYSTEM;
}
-
+
@Override
public void execute(){
StoragePool result = _storageService.updateStoragePool(this);
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/api/commands/UpdateTemplateCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/UpdateTemplateCmd.java b/api/src/com/cloud/api/commands/UpdateTemplateCmd.java
index 339fce9..2cffdac 100755
--- a/api/src/com/cloud/api/commands/UpdateTemplateCmd.java
+++ b/api/src/com/cloud/api/commands/UpdateTemplateCmd.java
@@ -27,13 +27,13 @@ import com.cloud.user.Account;
@Implementation(description="Updates attributes of a template.", responseObject=TemplateResponse.class)
public class UpdateTemplateCmd extends UpdateTemplateOrIsoCmd {
- public static final Logger s_logger = Logger.getLogger(UpdateTemplateCmd.class.getName());
+ public static final Logger s_logger = Logger.getLogger(UpdateTemplateCmd.class.getName());
private static final String s_name = "updatetemplateresponse";
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
-
+
@Override
public Boolean isBootable() {
return null;
@@ -42,17 +42,17 @@ public class UpdateTemplateCmd extends UpdateTemplateOrIsoCmd {
/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////
-
+
@Override
public String getCommandName() {
return s_name;
}
-
+
@SuppressWarnings("unchecked")
public TemplateResponse getResponse() {
return null;
}
-
+
@Override
public long getEntityOwnerId() {
VirtualMachineTemplate template = _entityMgr.findById(VirtualMachineTemplate.class, getId());
@@ -62,7 +62,7 @@ public class UpdateTemplateCmd extends UpdateTemplateOrIsoCmd {
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
}
-
+
@Override
public void execute(){
VirtualMachineTemplate result = _mgr.updateTemplate(this);
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/api/commands/UpdateTemplateOrIsoCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/UpdateTemplateOrIsoCmd.java b/api/src/com/cloud/api/commands/UpdateTemplateOrIsoCmd.java
index 50cf136..36fc540 100755
--- a/api/src/com/cloud/api/commands/UpdateTemplateOrIsoCmd.java
+++ b/api/src/com/cloud/api/commands/UpdateTemplateOrIsoCmd.java
@@ -46,13 +46,13 @@ public abstract class UpdateTemplateOrIsoCmd extends BaseCmd {
@IdentityMapper(entityTableName="guest_os")
@Parameter(name=ApiConstants.OS_TYPE_ID, type=CommandType.LONG, description="the ID of the OS type that best represents the OS of this image.")
private Long osTypeId;
-
+
@Parameter(name=ApiConstants.FORMAT, type=CommandType.STRING, description="the format for the image")
private String format;
-
+
@Parameter(name=ApiConstants.PASSWORD_ENABLED, type=CommandType.BOOLEAN, description="true if the image supports the password reset feature; default is false")
private Boolean passwordEnabled;
-
+
@Parameter(name=ApiConstants.SORT_KEY, type=CommandType.INTEGER, description="sort key of the template, integer")
private Integer sortKey;
@@ -79,16 +79,16 @@ public abstract class UpdateTemplateOrIsoCmd extends BaseCmd {
public Long getOsTypeId() {
return osTypeId;
}
-
+
public Boolean isPasswordEnabled() {
return passwordEnabled;
}
-
+
public String getFormat() {
return format;
}
-
+
public Integer getSortKey() {
- return sortKey;
+ return sortKey;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/api/commands/UpdateTemplateOrIsoPermissionsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/UpdateTemplateOrIsoPermissionsCmd.java b/api/src/com/cloud/api/commands/UpdateTemplateOrIsoPermissionsCmd.java
index 565e0a1..94c8d2b 100755
--- a/api/src/com/cloud/api/commands/UpdateTemplateOrIsoPermissionsCmd.java
+++ b/api/src/com/cloud/api/commands/UpdateTemplateOrIsoPermissionsCmd.java
@@ -48,13 +48,13 @@ public abstract class UpdateTemplateOrIsoPermissionsCmd extends BaseCmd {
@Parameter(name = ApiConstants.IS_PUBLIC, type = CommandType.BOOLEAN, description = "true for public template/iso, false for private templates/isos")
private Boolean isPublic;
-
+
@Parameter(name = ApiConstants.IS_EXTRACTABLE, type = CommandType.BOOLEAN, description = "true if the template/iso is extractable, false other wise. Can be set only by root admin")
private Boolean isExtractable;
@Parameter(name = ApiConstants.OP, type = CommandType.STRING, description = "permission operator (add, remove, reset)")
private String operation;
-
+
@IdentityMapper(entityTableName="projects")
@Parameter(name = ApiConstants.PROJECT_IDS, type = CommandType.LIST, collectionType = CommandType.LONG, description = "a comma delimited list of projects. If specified, \"op\" parameter has to be passed in.")
private List<Long> projectIds;
@@ -65,10 +65,10 @@ public abstract class UpdateTemplateOrIsoPermissionsCmd extends BaseCmd {
public List<String> getAccountNames() {
if (accountNames != null && projectIds != null) {
- throw new InvalidParameterValueException("Accounts and projectIds can't be specified together");
+ throw new InvalidParameterValueException("Accounts and projectIds can't be specified together");
}
-
- return accountNames;
+
+ return accountNames;
}
public Long getId() {
@@ -82,18 +82,18 @@ public abstract class UpdateTemplateOrIsoPermissionsCmd extends BaseCmd {
public Boolean isPublic() {
return isPublic;
}
-
+
public Boolean isExtractable() {
return isExtractable;
}
-
+
public String getOperation() {
return operation;
}
-
+
public List<Long> getProjectIds() {
if (accountNames != null && projectIds != null) {
- throw new InvalidParameterValueException("Accounts and projectIds can't be specified together");
+ throw new InvalidParameterValueException("Accounts and projectIds can't be specified together");
}
return projectIds;
}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/api/commands/UpdateTemplatePermissionsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/UpdateTemplatePermissionsCmd.java b/api/src/com/cloud/api/commands/UpdateTemplatePermissionsCmd.java
index c05e8ff..fac827b 100644
--- a/api/src/com/cloud/api/commands/UpdateTemplatePermissionsCmd.java
+++ b/api/src/com/cloud/api/commands/UpdateTemplatePermissionsCmd.java
@@ -24,19 +24,19 @@ import com.cloud.template.VirtualMachineTemplate;
import com.cloud.user.Account;
@Implementation(responseObject=SuccessResponse.class, description="Updates a template visibility permissions. " +
- "A public template is visible to all accounts within the same domain. " +
- "A private template is visible only to the owner of the template. " +
- "A priviledged template is a private template with account permissions added. " +
- "Only accounts specified under the template permissions are visible to them.")
+ "A public template is visible to all accounts within the same domain. " +
+ "A private template is visible only to the owner of the template. " +
+ "A priviledged template is a private template with account permissions added. " +
+ "Only accounts specified under the template permissions are visible to them.")
public class UpdateTemplatePermissionsCmd extends UpdateTemplateOrIsoPermissionsCmd {
protected String getResponseName() {
- return "updatetemplatepermissionsresponse";
+ return "updatetemplatepermissionsresponse";
}
-
- protected Logger getLogger() {
- return Logger.getLogger(UpdateTemplatePermissionsCmd.class.getName());
- }
-
+
+ protected Logger getLogger() {
+ return Logger.getLogger(UpdateTemplatePermissionsCmd.class.getName());
+ }
+
@Override
public long getEntityOwnerId() {
VirtualMachineTemplate template = _entityMgr.findById(VirtualMachineTemplate.class, getId());
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/api/commands/UpdateTrafficTypeCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/UpdateTrafficTypeCmd.java b/api/src/com/cloud/api/commands/UpdateTrafficTypeCmd.java
index edd82f2..2a24372 100644
--- a/api/src/com/cloud/api/commands/UpdateTrafficTypeCmd.java
+++ b/api/src/com/cloud/api/commands/UpdateTrafficTypeCmd.java
@@ -40,25 +40,25 @@ public class UpdateTrafficTypeCmd extends BaseAsyncCmd {
/////////////////////////////////////////////////////
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
-
+
@IdentityMapper(entityTableName="physical_network_traffic_types")
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="traffic type id")
private Long id;
-
+
@Parameter(name=ApiConstants.XEN_NETWORK_LABEL, type=CommandType.STRING, description="The network name label of the physical device dedicated to this traffic on a XenServer host")
private String xenLabel;
-
+
@Parameter(name=ApiConstants.KVM_NETWORK_LABEL, type=CommandType.STRING, description="The network name label of the physical device dedicated to this traffic on a KVM host")
private String kvmLabel;
-
+
@Parameter(name=ApiConstants.VMWARE_NETWORK_LABEL, type=CommandType.STRING, description="The network name label of the physical device dedicated to this traffic on a VMware host")
private String vmwareLabel;
-
+
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
-
+
public Long getId() {
return id;
}
@@ -69,11 +69,11 @@ public class UpdateTrafficTypeCmd extends BaseAsyncCmd {
public String getKvmLabel() {
return kvmLabel;
}
-
+
public String getVmwareLabel() {
return vmwareLabel;
- }
-
+ }
+
/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////
@@ -82,12 +82,12 @@ public class UpdateTrafficTypeCmd extends BaseAsyncCmd {
public String getCommandName() {
return s_name;
}
-
+
@Override
public long getEntityOwnerId() {
return Account.ACCOUNT_ID_SYSTEM;
}
-
+
@Override
public void execute(){
PhysicalNetworkTrafficType result = _networkService.updatePhysicalNetworkTrafficType(getId(), getXenLabel(), getKvmLabel(), getVmwareLabel());
@@ -104,7 +104,7 @@ public class UpdateTrafficTypeCmd extends BaseAsyncCmd {
public String getEventDescription() {
return "Updating Traffic Type: " + getId();
}
-
+
@Override
public String getEventType() {
return EventTypes.EVENT_TRAFFIC_TYPE_UPDATE;
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/api/commands/UpdateUserCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/UpdateUserCmd.java b/api/src/com/cloud/api/commands/UpdateUserCmd.java
index 1f2f61d..fbe062e 100644
--- a/api/src/com/cloud/api/commands/UpdateUserCmd.java
+++ b/api/src/com/cloud/api/commands/UpdateUserCmd.java
@@ -116,7 +116,7 @@ public class UpdateUserCmd extends BaseCmd {
public String getCommandName() {
return s_name;
}
-
+
@Override
public long getEntityOwnerId() {
User user = _entityMgr.findById(User.class, getId());
@@ -126,7 +126,7 @@ public class UpdateUserCmd extends BaseCmd {
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
}
-
+
@Override
public void execute(){
UserContext.current().setEventDetails("UserId: "+getId());
@@ -139,4 +139,4 @@ public class UpdateUserCmd extends BaseCmd {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to update user");
}
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/api/commands/UpdateVMGroupCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/UpdateVMGroupCmd.java b/api/src/com/cloud/api/commands/UpdateVMGroupCmd.java
index 0dab5a1..7f88701 100644
--- a/api/src/com/cloud/api/commands/UpdateVMGroupCmd.java
+++ b/api/src/com/cloud/api/commands/UpdateVMGroupCmd.java
@@ -38,7 +38,7 @@ public class UpdateVMGroupCmd extends BaseCmd{
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @IdentityMapper(entityTableName="instance_group")
+ @IdentityMapper(entityTableName="instance_group")
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="Instance group ID")
private Long id;
@@ -65,7 +65,7 @@ public class UpdateVMGroupCmd extends BaseCmd{
public String getCommandName() {
return s_name;
}
-
+
@Override
public long getEntityOwnerId() {
InstanceGroup group = _entityMgr.findById(InstanceGroup.class, getId());
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/api/commands/UpdateVPCOfferingCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/UpdateVPCOfferingCmd.java b/api/src/com/cloud/api/commands/UpdateVPCOfferingCmd.java
index eb6da59..fb4362e 100644
--- a/api/src/com/cloud/api/commands/UpdateVPCOfferingCmd.java
+++ b/api/src/com/cloud/api/commands/UpdateVPCOfferingCmd.java
@@ -38,33 +38,33 @@ public class UpdateVPCOfferingCmd extends BaseAsyncCmd{
/////////////////////////////////////////////////////
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
-
+
@IdentityMapper(entityTableName="vpc_offerings")
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="the id of the VPC offering")
private Long id;
@Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="the name of the VPC offering")
private String vpcOffName;
-
+
@Parameter(name=ApiConstants.DISPLAY_TEXT, type=CommandType.STRING, description="the display text of the VPC offering")
private String displayText;
-
+
@Parameter(name=ApiConstants.STATE, type=CommandType.STRING, description="update state for the VPC offering; " +
- "supported states - Enabled/Disabled")
+ "supported states - Enabled/Disabled")
private String state;
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
-
+
public String getVpcOfferingName() {
return vpcOffName;
}
-
+
public String getDisplayText() {
return displayText;
}
-
+
public Long getId() {
return id;
}
@@ -72,7 +72,7 @@ public class UpdateVPCOfferingCmd extends BaseAsyncCmd{
public String getState() {
return state;
}
-
+
/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
@@ -81,7 +81,7 @@ public class UpdateVPCOfferingCmd extends BaseAsyncCmd{
public String getCommandName() {
return _name;
}
-
+
@Override
public long getEntityOwnerId() {
return Account.ACCOUNT_ID_SYSTEM;
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/api/commands/UpdateZoneCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/UpdateZoneCmd.java b/api/src/com/cloud/api/commands/UpdateZoneCmd.java
index cd9891f..36c3404 100755
--- a/api/src/com/cloud/api/commands/UpdateZoneCmd.java
+++ b/api/src/com/cloud/api/commands/UpdateZoneCmd.java
@@ -66,21 +66,21 @@ public class UpdateZoneCmd extends BaseCmd {
@Parameter(name=ApiConstants.IS_PUBLIC, type=CommandType.BOOLEAN, description="updates a private zone to public if set, but not vice-versa")
private Boolean isPublic;
-
+
@Parameter(name=ApiConstants.ALLOCATION_STATE, type=CommandType.STRING, description="Allocation state of this cluster for allocation of new resources")
private String allocationState;
-
+
@Parameter(name=ApiConstants.DETAILS, type=CommandType.MAP, description="the details for the Zone")
private Map details;
-
+
@Parameter(name=ApiConstants.DHCP_PROVIDER, type=CommandType.STRING, description="the dhcp Provider for the Zone")
private String dhcpProvider;
-
+
@Parameter(name=ApiConstants.DOMAIN, type=CommandType.STRING, description="Network domain name for the networks in the zone; empty string will update domain with NULL value")
private String domain;
-
+
@Parameter(name=ApiConstants.DNS_SEARCH_ORDER, type=CommandType.LIST, collectionType = CommandType.STRING, description="the dns search order list")
- private List<String> dnsSearchOrder;
+ private List<String> dnsSearchOrder;
@Parameter(name=ApiConstants.LOCAL_STORAGE_ENABLED, type=CommandType.BOOLEAN, description="true if local storage offering enabled, false otherwise")
private Boolean localStorageEnabled;
@@ -120,26 +120,26 @@ public class UpdateZoneCmd extends BaseCmd {
public Boolean isPublic() {
return isPublic;
}
-
+
public String getAllocationState() {
- return allocationState;
+ return allocationState;
}
-
+
public Map getDetails() {
return details;
}
-
+
public String getDhcpProvider() {
return dhcpProvider;
}
-
+
public String getDomain() {
return domain;
}
public List<String> getDnsSearchOrder() {
return dnsSearchOrder;
- }
+ }
public Boolean getLocalStorageEnabled() {
return localStorageEnabled;
@@ -153,16 +153,16 @@ public class UpdateZoneCmd extends BaseCmd {
public String getCommandName() {
return s_name;
}
-
+
@Override
public long getEntityOwnerId() {
return Account.ACCOUNT_ID_SYSTEM;
}
-
+
@Override
public void execute(){
- UserContext.current().setEventDetails("Zone Id: "+getId());
- DataCenter result = _configService.editZone(this);
+ UserContext.current().setEventDetails("Zone Id: "+getId());
+ DataCenter result = _configService.editZone(this);
if (result != null) {
ZoneResponse response = _responseGenerator.createZoneResponse(result, false);
response.setResponseName(getCommandName());
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/api/commands/UpgradeRouterCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/UpgradeRouterCmd.java b/api/src/com/cloud/api/commands/UpgradeRouterCmd.java
index 1b928e0..c916a5c 100644
--- a/api/src/com/cloud/api/commands/UpgradeRouterCmd.java
+++ b/api/src/com/cloud/api/commands/UpgradeRouterCmd.java
@@ -30,8 +30,8 @@ import com.cloud.user.Account;
@Implementation(description="Upgrades domain router to a new service offering", responseObject=DomainRouterResponse.class)
public class UpgradeRouterCmd extends BaseCmd {
- public static final Logger s_logger = Logger.getLogger(UpgradeRouterCmd.class.getName());
- private static final String s_name = "changeserviceforrouterresponse";
+ public static final Logger s_logger = Logger.getLogger(UpgradeRouterCmd.class.getName());
+ private static final String s_name = "changeserviceforrouterresponse";
/////////////////////////////////////////////////////
//////////////// API parameters /////////////////////
@@ -61,11 +61,11 @@ public class UpgradeRouterCmd extends BaseCmd {
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////
- @Override
- public String getCommandName() {
- return s_name;
- }
-
+ @Override
+ public String getCommandName() {
+ return s_name;
+ }
+
@Override
public long getEntityOwnerId() {
VirtualRouter router = _entityMgr.findById(VirtualRouter.class, getId());
@@ -75,7 +75,7 @@ public class UpgradeRouterCmd extends BaseCmd {
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
}
-
+
@Override
public void execute(){
VirtualRouter router = _routerService.upgradeRouter(this);
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/api/commands/UpgradeSystemVMCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/UpgradeSystemVMCmd.java b/api/src/com/cloud/api/commands/UpgradeSystemVMCmd.java
index 0b46048..cc7deaf 100644
--- a/api/src/com/cloud/api/commands/UpgradeSystemVMCmd.java
+++ b/api/src/com/cloud/api/commands/UpgradeSystemVMCmd.java
@@ -48,7 +48,7 @@ public class UpgradeSystemVMCmd extends BaseCmd {
private Long id;
@IdentityMapper(entityTableName="disk_offering")
- @Parameter(name=ApiConstants.SERVICE_OFFERING_ID, type=CommandType.LONG, required=true,
+ @Parameter(name=ApiConstants.SERVICE_OFFERING_ID, type=CommandType.LONG, required=true,
description="the service offering ID to apply to the system vm")
private Long serviceOfferingId;
@@ -72,7 +72,7 @@ public class UpgradeSystemVMCmd extends BaseCmd {
public String getCommandName() {
return s_name;
}
-
+
@Override
public long getEntityOwnerId() {
Account account = UserContext.current().getCaller();
@@ -82,16 +82,16 @@ public class UpgradeSystemVMCmd extends BaseCmd {
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
}
-
+
@Override
public void execute(){
UserContext.current().setEventDetails("Vm Id: "+getId());
-
+
ServiceOffering serviceOffering = _configService.getServiceOffering(serviceOfferingId);
if (serviceOffering == null) {
throw new InvalidParameterValueException("Unable to find service offering: " + serviceOfferingId);
}
-
+
VirtualMachine result = _mgr.upgradeSystemVM(this);
if (result != null) {
SystemVmResponse response = _responseGenerator.createSystemVmResponse(result);
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/api/commands/UploadCustomCertificateCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/UploadCustomCertificateCmd.java b/api/src/com/cloud/api/commands/UploadCustomCertificateCmd.java
index 38f1ff2..d297dfa 100644
--- a/api/src/com/cloud/api/commands/UploadCustomCertificateCmd.java
+++ b/api/src/com/cloud/api/commands/UploadCustomCertificateCmd.java
@@ -36,10 +36,10 @@ public class UploadCustomCertificateCmd extends BaseAsyncCmd {
@Parameter(name=ApiConstants.CERTIFICATE,type=CommandType.STRING,required=true,description="The certificate to be uploaded.", length=65535)
private String certificate;
-
+
@Parameter(name=ApiConstants.ID,type=CommandType.INTEGER,required=false,description="An integer providing the location in a chain that the certificate will hold. Usually, this can be left empty. When creating a chain, the top level certificate should have an ID of 1, with each step in the chain incrementing by one. Example, CA with id = 1, Intermediate CA with id = 2, Site certificate with ID = 3")
private Integer index;
-
+
@Parameter(name=ApiConstants.NAME,type=CommandType.STRING,required=false,description="A name / alias for the certificate.")
private String alias;
@@ -48,25 +48,25 @@ public class UploadCustomCertificateCmd extends BaseAsyncCmd {
@Parameter(name=ApiConstants.DOMAIN_SUFFIX,type=CommandType.STRING,required=true,description="DNS domain suffix that the certificate is granted for.")
private String domainSuffix;
-
+
public String getCertificate() {
return certificate;
}
-
+
public String getPrivateKey() {
- return privateKey;
+ return privateKey;
}
-
+
public String getDomainSuffix() {
- return domainSuffix;
+ return domainSuffix;
}
-
+
public Integer getCertIndex() {
- return index;
+ return index;
}
-
+
public String getAlias() {
- return alias;
+ return alias;
}
@Override
@@ -78,21 +78,21 @@ public class UploadCustomCertificateCmd extends BaseAsyncCmd {
public String getEventDescription() {
return ("Uploading custom certificate to the db, and applying it to all the cpvms in the system");
}
-
+
@Override
public String getCommandName() {
return s_name;
}
-
+
public static String getResultObjectName() {
- return "certificate";
+ return "certificate";
}
@Override
public long getEntityOwnerId() {
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
}
-
+
@Override
public void execute(){
String result = _mgr.uploadCertificate(this);