mirror of https://github.com/apache/cloudstack.git
Merge branch 'master' of ssh://git.cloud.com/var/lib/git/cloudstack-oss
This commit is contained in:
commit
a2346a274d
|
|
@ -83,6 +83,10 @@ public class ApiDispatcher {
|
|||
Method method = mgr.getClass().getMethod(methodName, cmd.getClass());
|
||||
Object dbObject = method.invoke(mgr, cmd);
|
||||
|
||||
if (dbObject == null) {
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Create method " + methodName + " in class " + cmd.getClass().getSimpleName() + " failed to create an object.");
|
||||
}
|
||||
|
||||
Method getIdMethod = dbObject.getClass().getMethod("getId");
|
||||
Object id = getIdMethod.invoke(dbObject);
|
||||
|
||||
|
|
|
|||
|
|
@ -22,8 +22,10 @@ import org.apache.log4j.Logger;
|
|||
|
||||
import com.cloud.api.ApiDBUtils;
|
||||
import com.cloud.api.BaseAsyncCreateCmd;
|
||||
import com.cloud.api.BaseCmd;
|
||||
import com.cloud.api.Implementation;
|
||||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.SnapshotResponse;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.storage.Snapshot.SnapshotType;
|
||||
|
|
@ -104,26 +106,30 @@ public class CreateSnapshotCmd extends BaseAsyncCreateCmd {
|
|||
public SnapshotResponse getResponse() {
|
||||
SnapshotVO snapshot = (SnapshotVO)getResponseObject();
|
||||
|
||||
SnapshotResponse response = new SnapshotResponse();
|
||||
response.setId(snapshot.getId());
|
||||
if (snapshot != null) {
|
||||
SnapshotResponse response = new SnapshotResponse();
|
||||
response.setId(snapshot.getId());
|
||||
|
||||
Account account = ApiDBUtils.findAccountById(snapshot.getAccountId());
|
||||
if (account != null) {
|
||||
response.setAccountName(account.getAccountName());
|
||||
response.setDomainId(account.getDomainId());
|
||||
response.setDomainName(ApiDBUtils.findDomainById(account.getDomainId()).getName());
|
||||
Account account = ApiDBUtils.findAccountById(snapshot.getAccountId());
|
||||
if (account != null) {
|
||||
response.setAccountName(account.getAccountName());
|
||||
response.setDomainId(account.getDomainId());
|
||||
response.setDomainName(ApiDBUtils.findDomainById(account.getDomainId()).getName());
|
||||
}
|
||||
|
||||
VolumeVO volume = ApiDBUtils.findVolumeById(snapshot.getVolumeId());
|
||||
String snapshotTypeStr = SnapshotType.values()[snapshot.getSnapshotType()].name();
|
||||
response.setSnapshotType(snapshotTypeStr);
|
||||
response.setVolumeId(snapshot.getVolumeId());
|
||||
response.setVolumeName(volume.getName());
|
||||
response.setVolumeType(volume.getVolumeType().toString());
|
||||
response.setCreated(snapshot.getCreated());
|
||||
response.setName(snapshot.getName());
|
||||
|
||||
response.setResponseName(getName());
|
||||
return response;
|
||||
}
|
||||
|
||||
VolumeVO volume = ApiDBUtils.findVolumeById(snapshot.getVolumeId());
|
||||
String snapshotTypeStr = SnapshotType.values()[snapshot.getSnapshotType()].name();
|
||||
response.setSnapshotType(snapshotTypeStr);
|
||||
response.setVolumeId(snapshot.getVolumeId());
|
||||
response.setVolumeName(volume.getName());
|
||||
response.setVolumeType(volume.getVolumeType().toString());
|
||||
response.setCreated(snapshot.getCreated());
|
||||
response.setName(snapshot.getName());
|
||||
|
||||
response.setResponseName(getName());
|
||||
return response;
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create snapshot due to an internal error creating snapshot for volume " + volumeId);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4535,7 +4535,9 @@ public class ManagementServerImpl implements ManagementServer {
|
|||
@Override
|
||||
public void logoutUser(Long userId) {
|
||||
UserAccount userAcct = _userAccountDao.findById(userId);
|
||||
EventUtils.saveEvent(userId, userAcct.getAccountId(), EventTypes.EVENT_USER_LOGOUT, "user has logged out");
|
||||
if (userAcct != null) {
|
||||
EventUtils.saveEvent(userId, userAcct.getAccountId(), EventTypes.EVENT_USER_LOGOUT, "user has logged out");
|
||||
} // else log some kind of error event? This likely means the user doesn't exist, or has been deleted...
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -949,7 +949,7 @@ a:hover {
|
|||
font-size:10px;
|
||||
font-weight:normal;
|
||||
text-align:left;
|
||||
margin:1px 0 0 0;
|
||||
margin:0px 0 0 0;
|
||||
padding:0;
|
||||
}
|
||||
.rev_wiztemp_ownertext span {
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 271 B After Width: | Height: | Size: 3.0 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 278 B After Width: | Height: | Size: 3.0 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 253 B After Width: | Height: | Size: 3.0 KiB |
|
|
@ -221,7 +221,61 @@
|
|||
<!--Volume tab (end)-->
|
||||
<!--Statistics tab (start)-->
|
||||
<div style="display: none;" id="tab_content_statistics">
|
||||
statistics
|
||||
<div class="rightpanel_mainloader_panel" style="display:none;">
|
||||
<div class="rightpanel_mainloaderbox">
|
||||
<div class="rightpanel_mainloader_animatedicon"></div>
|
||||
<p>Loading …</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid_container">
|
||||
<div class="grid_header">
|
||||
<div id="grid_header_title" class="grid_header_title">(title)</div>
|
||||
</div>
|
||||
<div class="dbrow odd" id="public_ip_address">
|
||||
<div class="dbrow_cell" style="width: 29%;">
|
||||
<div class="dbgraph_titlebox">
|
||||
<h2>
|
||||
CPU</h2>
|
||||
<div class="dbgraph_title_usedbox">
|
||||
<p>
|
||||
Used: <span id="capacityused">1x500 MHZ</span>/<span id="capacitytotal">A</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dbrow_cell" style="width: 58%; border: none;">
|
||||
<div class="db_barbox low" style="width:20%;" id="bar_chart">
|
||||
</div>
|
||||
</div>
|
||||
<div class="dbrow_cell" style="width: 12%; border: none;">
|
||||
<div class="db_totaltitle" id="percentused">
|
||||
1 x 20 MHZ
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid_rows even">
|
||||
<div class="grid_row_cell" style="width: 20%;">
|
||||
<div class="row_celltitles">
|
||||
Network Read:</div>
|
||||
</div>
|
||||
<div class="grid_row_cell" style="width: 79%;">
|
||||
<div class="row_celltitles" >
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid_rows odd">
|
||||
<div class="grid_row_cell" style="width: 20%;">
|
||||
<div class="row_celltitles">
|
||||
Network Write:</div>
|
||||
</div>
|
||||
<div class="grid_row_cell">
|
||||
<div class="row_celltitles" id="account">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!--Statistics tab (start)-->
|
||||
<!--Routers tab (start)-->
|
||||
|
|
@ -309,8 +363,7 @@
|
|||
Blank Template</div>
|
||||
</div>
|
||||
<div class="rev_wizmid_tempbox_right">
|
||||
<div class="rev_wiztemplistpanel" id="template_container">
|
||||
|
||||
<div class="rev_wiztemplistpanel" id="template_container">
|
||||
|
||||
</div>
|
||||
<div class="rev_wiztemplistactions">
|
||||
|
|
@ -700,7 +753,7 @@
|
|||
<div class="rev_wiztemp_listtext">
|
||||
<span id="name">Centos</span>
|
||||
</div>
|
||||
<div class="rev_wiztemp_listtext hypervisortext">
|
||||
<div class="rev_wiztemp_hypervisortext">
|
||||
Hypervisor:
|
||||
<select id="hypervisor_select" class="select" style="width: 70px; float: none; height: 15px; font-size: 10px; margin: 0 0 0 5px; display: inline;">
|
||||
<option value='XenServer'>XenServer</option>
|
||||
|
|
|
|||
Loading…
Reference in New Issue