mirror of https://github.com/apache/cloudstack.git
bug 8737: set entityOwnerId for all api commands including non-Async ones
status 8737: resolved fixed
This commit is contained in:
parent
1970161844
commit
ec76406942
|
|
@ -37,14 +37,6 @@ public abstract class BaseAsyncCmd extends BaseCmd {
|
|||
|
||||
@Parameter(name="starteventid", type=CommandType.LONG)
|
||||
private Long startEventId;
|
||||
|
||||
|
||||
/**
|
||||
* For async commands the API framework needs to know the owner of the object being acted upon. This method is
|
||||
* used to determine that information.
|
||||
* @return the id of the account that owns the object being acted upon
|
||||
*/
|
||||
public abstract long getEntityOwnerId();
|
||||
|
||||
/**
|
||||
* For proper tracking of async commands through the system, events must be generated when the command is
|
||||
|
|
|
|||
|
|
@ -146,6 +146,13 @@ public abstract class BaseCmd {
|
|||
}
|
||||
|
||||
public abstract String getCommandName();
|
||||
|
||||
/**
|
||||
* For commands the API framework needs to know the owner of the object being acted upon. This method is
|
||||
* used to determine that information.
|
||||
* @return the id of the account that owns the object being acted upon
|
||||
*/
|
||||
public abstract long getEntityOwnerId();
|
||||
|
||||
public Object getResponseObject() {
|
||||
return _responseObject;
|
||||
|
|
|
|||
|
|
@ -37,6 +37,12 @@ public abstract class BaseListCmd extends BaseCmd {
|
|||
public Integer getPageSize() {
|
||||
return pageSize;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
//no owner is needed for list command
|
||||
return 0;
|
||||
}
|
||||
|
||||
public Long getPageSizeVal() {
|
||||
Long pageSize = null;
|
||||
|
|
|
|||
|
|
@ -11,11 +11,10 @@ import com.cloud.api.Implementation;
|
|||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.ClusterResponse;
|
||||
import com.cloud.api.response.HostResponse;
|
||||
import com.cloud.api.response.ListResponse;
|
||||
import com.cloud.exception.DiscoveryException;
|
||||
import com.cloud.host.Host;
|
||||
import com.cloud.org.Cluster;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description="Adds a new cluster", responseObject=ClusterResponse.class)
|
||||
public class AddClusterCmd extends BaseCmd {
|
||||
|
|
@ -88,6 +87,11 @@ public class AddClusterCmd extends BaseCmd {
|
|||
public void setClusterType(String type) {
|
||||
this.clusterType = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
return Account.ACCOUNT_ID_SYSTEM;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ import com.cloud.api.response.HostResponse;
|
|||
import com.cloud.api.response.ListResponse;
|
||||
import com.cloud.exception.DiscoveryException;
|
||||
import com.cloud.host.Host;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description="Adds a new host.", responseObject=HostResponse.class)
|
||||
public class AddHostCmd extends BaseCmd {
|
||||
|
|
@ -112,6 +113,11 @@ public class AddHostCmd extends BaseCmd {
|
|||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
return Account.ACCOUNT_ID_SYSTEM;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ import com.cloud.api.ServerApiException;
|
|||
import com.cloud.api.response.HostResponse;
|
||||
import com.cloud.exception.DiscoveryException;
|
||||
import com.cloud.host.Host;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description="Adds secondary storage.", responseObject=HostResponse.class)
|
||||
public class AddSecondaryStorageCmd extends BaseCmd {
|
||||
|
|
@ -67,6 +68,11 @@ public class AddSecondaryStorageCmd extends BaseCmd {
|
|||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
return Account.ACCOUNT_ID_SYSTEM;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ import com.cloud.api.Parameter;
|
|||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.AccountResponse;
|
||||
import com.cloud.api.response.UserResponse;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.UserAccount;
|
||||
|
||||
@Implementation(description="Creates an account", responseObject=UserResponse.class)
|
||||
|
|
@ -115,6 +116,12 @@ public class CreateAccountCmd extends BaseCmd {
|
|||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
return Account.ACCOUNT_ID_SYSTEM;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
UserAccount user = _accountService.createAccount(this);
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ import com.cloud.api.Parameter;
|
|||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.ConfigurationResponse;
|
||||
import com.cloud.configuration.Configuration;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description="Adds configuration value", responseObject=ConfigurationResponse.class)
|
||||
public class CreateCfgCmd extends BaseCmd {
|
||||
|
|
@ -93,6 +94,11 @@ public class CreateCfgCmd extends BaseCmd {
|
|||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
return Account.ACCOUNT_ID_SYSTEM;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
Configuration cfg = _configService.addConfig(this);
|
||||
|
|
|
|||
|
|
@ -24,9 +24,9 @@ import com.cloud.api.BaseCmd;
|
|||
import com.cloud.api.Implementation;
|
||||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.BaseCmd.CommandType;
|
||||
import com.cloud.api.response.DiskOfferingResponse;
|
||||
import com.cloud.offering.DiskOffering;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description="Creates a disk offering.", responseObject=DiskOfferingResponse.class)
|
||||
public class CreateDiskOfferingCmd extends BaseCmd {
|
||||
|
|
@ -92,6 +92,11 @@ public class CreateDiskOfferingCmd extends BaseCmd {
|
|||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
return Account.ACCOUNT_ID_SYSTEM;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
DiskOffering offering = _configService.createDiskOffering(this);
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ import com.cloud.api.Parameter;
|
|||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.DomainResponse;
|
||||
import com.cloud.domain.Domain;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description="Creates a domain", responseObject=DomainResponse.class)
|
||||
public class CreateDomainCmd extends BaseCmd {
|
||||
|
|
@ -66,6 +67,11 @@ public class CreateDomainCmd extends BaseCmd {
|
|||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
return Account.ACCOUNT_ID_SYSTEM;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
Domain domain = _mgr.createDomain(this);
|
||||
|
|
|
|||
|
|
@ -181,5 +181,10 @@ public class CreateLoadBalancerRuleCmd extends BaseCmd implements LoadBalancer
|
|||
@Override
|
||||
public int getDefaultPortEnd() {
|
||||
return privatePort.intValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
return getAccountId();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,6 +29,8 @@ import com.cloud.api.response.NetworkResponse;
|
|||
import com.cloud.exception.ConcurrentOperationException;
|
||||
import com.cloud.exception.InsufficientCapacityException;
|
||||
import com.cloud.network.Network;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.UserContext;
|
||||
|
||||
@Implementation(description="Creates a network", responseObject=NetworkResponse.class)
|
||||
public class CreateNetworkCmd extends BaseCmd {
|
||||
|
|
@ -150,6 +152,25 @@ public class CreateNetworkCmd extends BaseCmd {
|
|||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
Account account = UserContext.current().getCaller();
|
||||
if ((account == null) || isAdmin(account.getType())) {
|
||||
if ((domainId != null) && (accountName != null)) {
|
||||
Account userAccount = _responseGenerator.findAccountByNameDomain(accountName, domainId);
|
||||
if (userAccount != null) {
|
||||
return userAccount.getId();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (account != null) {
|
||||
return account.getId();
|
||||
}
|
||||
|
||||
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() throws InsufficientCapacityException, ConcurrentOperationException{
|
||||
Network result = _networkService.createNetwork(this);
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ import com.cloud.api.ServerApiException;
|
|||
import com.cloud.api.response.NetworkOfferingResponse;
|
||||
import com.cloud.offering.NetworkOffering;
|
||||
import com.cloud.offering.NetworkOffering.Availability;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description="Creates a network offering.", responseObject=NetworkOfferingResponse.class)
|
||||
public class CreateNetworkOfferingCmd extends BaseCmd {
|
||||
|
|
@ -113,6 +114,11 @@ public class CreateNetworkOfferingCmd extends BaseCmd {
|
|||
public String getCommandName() {
|
||||
return _name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
return Account.ACCOUNT_ID_SYSTEM;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ import com.cloud.api.Parameter;
|
|||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.PodResponse;
|
||||
import com.cloud.dc.Pod;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description="Creates a new Pod.", responseObject=PodResponse.class)
|
||||
public class CreatePodCmd extends BaseCmd {
|
||||
|
|
@ -94,6 +95,11 @@ public class CreatePodCmd extends BaseCmd {
|
|||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
return Account.ACCOUNT_ID_SYSTEM;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
|
|
|
|||
|
|
@ -7,7 +7,9 @@ import com.cloud.api.BaseCmd;
|
|||
import com.cloud.api.Implementation;
|
||||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.response.SSHKeyPairResponse;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.SSHKeyPair;
|
||||
import com.cloud.user.UserContext;
|
||||
|
||||
@Implementation(description="Create a new keypair and returns the private key", responseObject=SSHKeyPairResponse.class)
|
||||
public class CreateSSHKeyPairCmd extends BaseCmd {
|
||||
|
|
@ -35,6 +37,17 @@ public class CreateSSHKeyPairCmd extends BaseCmd {
|
|||
/////////////////////////////////////////////////////
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
Account account = UserContext.current().getCaller();
|
||||
|
||||
if (account != null) {
|
||||
return account.getId();
|
||||
}
|
||||
|
||||
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
|
|
|
|||
|
|
@ -26,6 +26,8 @@ import com.cloud.api.Parameter;
|
|||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.SecurityGroupResponse;
|
||||
import com.cloud.network.security.SecurityGroup;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.UserContext;
|
||||
|
||||
@Implementation(responseObject=SecurityGroupResponse.class, description="Creates a security group")
|
||||
public class CreateSecurityGroupCmd extends BaseCmd {
|
||||
|
|
@ -80,6 +82,25 @@ public class CreateSecurityGroupCmd extends BaseCmd {
|
|||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
Account account = UserContext.current().getCaller();
|
||||
if ((account == null) || isAdmin(account.getType())) {
|
||||
if ((domainId != null) && (accountName != null)) {
|
||||
Account userAccount = _responseGenerator.findAccountByNameDomain(accountName, domainId);
|
||||
if (userAccount != null) {
|
||||
return userAccount.getId();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (account != null) {
|
||||
return account.getId();
|
||||
}
|
||||
|
||||
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
SecurityGroup group = _securityGroupService.createSecurityGroup(this);
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ import com.cloud.api.Parameter;
|
|||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.ServiceOfferingResponse;
|
||||
import com.cloud.offering.ServiceOffering;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description="Creates a service offering.", responseObject=ServiceOfferingResponse.class)
|
||||
public class CreateServiceOfferingCmd extends BaseCmd {
|
||||
|
|
@ -111,7 +112,12 @@ public class CreateServiceOfferingCmd extends BaseCmd {
|
|||
@Override
|
||||
public String getCommandName() {
|
||||
return _name;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
return Account.ACCOUNT_ID_SYSTEM;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
|
|
|
|||
|
|
@ -26,7 +26,9 @@ import com.cloud.api.Implementation;
|
|||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.SnapshotPolicyResponse;
|
||||
import com.cloud.storage.Volume;
|
||||
import com.cloud.storage.snapshot.SnapshotPolicy;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description="Creates a snapshot policy for the account.", responseObject=SnapshotPolicyResponse.class)
|
||||
public class CreateSnapshotPolicyCmd extends BaseCmd {
|
||||
|
|
@ -38,12 +40,6 @@ public class CreateSnapshotPolicyCmd extends BaseCmd {
|
|||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="The account of the snapshot policy. The account parameter must be used with the domainId parameter.")
|
||||
private String accountName;
|
||||
|
||||
@Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="The domain ID of the snapshot. If used with the account parameter, specifies a domain for the account associated with the snapshot policy.")
|
||||
private Long domainId;
|
||||
|
||||
@Parameter(name=ApiConstants.INTERVAL_TYPE, type=CommandType.STRING, required=true, description="valid values are HOURLY, DAILY, WEEKLY, and MONTHLY")
|
||||
private String intervalType;
|
||||
|
||||
|
|
@ -69,14 +65,6 @@ public class CreateSnapshotPolicyCmd extends BaseCmd {
|
|||
/////////////////// Accessors ///////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
public String getAccountName() {
|
||||
return accountName;
|
||||
}
|
||||
|
||||
public Long getDomainId() {
|
||||
return domainId;
|
||||
}
|
||||
|
||||
public String getIntervalType() {
|
||||
return intervalType;
|
||||
}
|
||||
|
|
@ -107,6 +95,16 @@ public class CreateSnapshotPolicyCmd extends BaseCmd {
|
|||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
Volume volume = _entityMgr.findById(Volume.class, getVolumeId());
|
||||
if (volume != null) {
|
||||
return volume.getAccountId();
|
||||
}
|
||||
|
||||
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
SnapshotPolicy result = _snapshotService.createPolicy(this);
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ import com.cloud.api.response.StoragePoolResponse;
|
|||
import com.cloud.exception.ResourceInUseException;
|
||||
import com.cloud.exception.ResourceUnavailableException;
|
||||
import com.cloud.storage.StoragePool;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Implementation(description="Creates a storage pool.", responseObject=StoragePoolResponse.class)
|
||||
|
|
@ -105,6 +106,11 @@ public class CreateStoragePoolCmd extends BaseCmd {
|
|||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
return Account.ACCOUNT_ID_SYSTEM;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
|
|
|
|||
|
|
@ -26,7 +26,9 @@ import com.cloud.api.Implementation;
|
|||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.UserResponse;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.User;
|
||||
import com.cloud.user.UserContext;
|
||||
|
||||
@Implementation(description="Creates a user for an account that already exists", responseObject=UserResponse.class)
|
||||
public class CreateUserCmd extends BaseCmd {
|
||||
|
|
@ -107,6 +109,25 @@ public class CreateUserCmd extends BaseCmd {
|
|||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
Account account = UserContext.current().getCaller();
|
||||
if ((account == null) || isAdmin(account.getType())) {
|
||||
if ((domainId != null) && (accountName != null)) {
|
||||
Account userAccount = _responseGenerator.findAccountByNameDomain(accountName, domainId);
|
||||
if (userAccount != null) {
|
||||
return userAccount.getId();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (account != null) {
|
||||
return account.getId();
|
||||
}
|
||||
|
||||
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
User user = _accountService.createUser(this);
|
||||
|
|
|
|||
|
|
@ -25,6 +25,8 @@ import com.cloud.api.Implementation;
|
|||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.InstanceGroupResponse;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.UserContext;
|
||||
import com.cloud.vm.InstanceGroup;
|
||||
|
||||
@Implementation(description="Creates a vm group", responseObject=InstanceGroupResponse.class)
|
||||
|
|
@ -71,6 +73,25 @@ public class CreateVMGroupCmd extends BaseCmd{
|
|||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
Account account = UserContext.current().getCaller();
|
||||
if ((account == null) || isAdmin(account.getType())) {
|
||||
if ((domainId != null) && (accountName != null)) {
|
||||
Account userAccount = _responseGenerator.findAccountByNameDomain(accountName, domainId);
|
||||
if (userAccount != null) {
|
||||
return userAccount.getId();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (account != null) {
|
||||
return account.getId();
|
||||
}
|
||||
|
||||
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
InstanceGroup result = _userVmService.createVmGroup(this);
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ import com.cloud.dc.Vlan;
|
|||
import com.cloud.exception.ConcurrentOperationException;
|
||||
import com.cloud.exception.InsufficientCapacityException;
|
||||
import com.cloud.exception.ResourceUnavailableException;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description="Creates a VLAN IP range.", responseObject=VlanIpRangeResponse.class)
|
||||
public class CreateVlanIpRangeCmd extends BaseCmd {
|
||||
|
|
@ -132,6 +133,11 @@ public class CreateVlanIpRangeCmd extends BaseCmd {
|
|||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
return Account.ACCOUNT_ID_SYSTEM;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() throws ResourceUnavailableException{
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ import com.cloud.api.Parameter;
|
|||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.ZoneResponse;
|
||||
import com.cloud.dc.DataCenter;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description="Creates a Zone.", responseObject=ZoneResponse.class)
|
||||
public class CreateZoneCmd extends BaseCmd {
|
||||
|
|
@ -130,6 +131,11 @@ public class CreateZoneCmd extends BaseCmd {
|
|||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
return Account.ACCOUNT_ID_SYSTEM;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
DataCenter result = _configService.createZone(this);
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ import com.cloud.api.response.SuccessResponse;
|
|||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.User;
|
||||
import com.cloud.user.UserContext;
|
||||
|
||||
@Implementation(description="Deletes a account, and all users associated with this account", responseObject=SuccessResponse.class)
|
||||
public class DeleteAccountCmd extends BaseAsyncCmd {
|
||||
|
|
@ -69,9 +68,9 @@ public class DeleteAccountCmd extends BaseAsyncCmd {
|
|||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
Account account = UserContext.current().getCaller();
|
||||
Account account = _entityMgr.findById(Account.class, getId());
|
||||
if (account != null) {
|
||||
return account.getId();
|
||||
return account.getAccountId();
|
||||
}
|
||||
|
||||
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import com.cloud.api.Implementation;
|
|||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.SuccessResponse;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
|
||||
@Implementation(description="Deletes a cluster.", responseObject=SuccessResponse.class)
|
||||
|
|
@ -42,6 +43,11 @@ public class DeleteClusterCmd extends BaseCmd {
|
|||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
return Account.ACCOUNT_ID_SYSTEM;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
boolean result = _resourceService.deleteCluster(this);
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ import com.cloud.api.Implementation;
|
|||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.SuccessResponse;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description="Updates a disk offering.", responseObject=SuccessResponse.class)
|
||||
public class DeleteDiskOfferingCmd extends BaseCmd {
|
||||
|
|
@ -56,6 +57,11 @@ public class DeleteDiskOfferingCmd extends BaseCmd {
|
|||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
return Account.ACCOUNT_ID_SYSTEM;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
boolean result = _configService.deleteDiskOffering(this);
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ import com.cloud.api.Implementation;
|
|||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.SuccessResponse;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
|
||||
@Implementation(description="Deletes a host.", responseObject=SuccessResponse.class)
|
||||
|
|
@ -60,6 +61,11 @@ public class DeleteHostCmd extends BaseCmd {
|
|||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
return Account.ACCOUNT_ID_SYSTEM;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
boolean result = _resourceService.deleteHost(this);
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ import com.cloud.api.Implementation;
|
|||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.SuccessResponse;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description="Deletes a network offering.", responseObject=SuccessResponse.class)
|
||||
public class DeleteNetworkOfferingCmd extends BaseCmd{
|
||||
|
|
@ -58,6 +59,11 @@ public class DeleteNetworkOfferingCmd extends BaseCmd{
|
|||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
return Account.ACCOUNT_ID_SYSTEM;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
boolean result = _configService.deleteNetworkOffering(this);
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ import com.cloud.api.Implementation;
|
|||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.SuccessResponse;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description="Deletes a Pod.", responseObject=SuccessResponse.class)
|
||||
public class DeletePodCmd extends BaseCmd {
|
||||
|
|
@ -56,6 +57,11 @@ public class DeletePodCmd extends BaseCmd {
|
|||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
return Account.ACCOUNT_ID_SYSTEM;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import com.cloud.api.Implementation;
|
|||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.SuccessResponse;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description="Deletes a storage pool.", responseObject=SuccessResponse.class)
|
||||
public class DeletePoolCmd extends BaseCmd {
|
||||
|
|
@ -40,6 +41,11 @@ public class DeletePoolCmd extends BaseCmd {
|
|||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
return Account.ACCOUNT_ID_SYSTEM;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
boolean result = _storageService.deletePool(this);
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ import com.cloud.api.BaseCmd;
|
|||
import com.cloud.api.Implementation;
|
||||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.response.SuccessResponse;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.UserContext;
|
||||
|
||||
@Implementation(description="Deletes a keypair by name", responseObject=SuccessResponse.class)
|
||||
public class DeleteSSHKeyPairCmd extends BaseCmd {
|
||||
|
|
@ -21,6 +23,11 @@ public class DeleteSSHKeyPairCmd extends BaseCmd {
|
|||
@Parameter(name=ApiConstants.NAME, type=CommandType.STRING, required=true, description="Name of the keypair")
|
||||
private String name;
|
||||
|
||||
@Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="the account associated with the keypair. Must be used with the domainId parameter.")
|
||||
private String accountName;
|
||||
|
||||
@Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="the domain ID associated with the keypair")
|
||||
private Long domainId;
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////////// Accessors ///////////////////////
|
||||
|
|
@ -30,12 +37,20 @@ public class DeleteSSHKeyPairCmd extends BaseCmd {
|
|||
return name;
|
||||
}
|
||||
|
||||
public String getAccountName() {
|
||||
return accountName;
|
||||
}
|
||||
|
||||
public Long getDomainId() {
|
||||
return domainId;
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public void execute() {
|
||||
boolean result = _mgr.deleteSSHKeyPair(this);
|
||||
SuccessResponse response = new SuccessResponse(getCommandName());
|
||||
|
|
@ -47,4 +62,23 @@ public class DeleteSSHKeyPairCmd extends BaseCmd {
|
|||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
Account account = UserContext.current().getCaller();
|
||||
if ((account == null) || isAdmin(account.getType())) {
|
||||
if ((domainId != null) && (accountName != null)) {
|
||||
Account userAccount = _responseGenerator.findAccountByNameDomain(accountName, domainId);
|
||||
if (userAccount != null) {
|
||||
return userAccount.getId();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (account != null) {
|
||||
return account.getId();
|
||||
}
|
||||
|
||||
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ import com.cloud.api.Parameter;
|
|||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.SuccessResponse;
|
||||
import com.cloud.exception.ResourceInUseException;
|
||||
import com.cloud.network.security.SecurityGroup;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description="Deletes security group", responseObject=SuccessResponse.class)
|
||||
public class DeleteSecurityGroupCmd extends BaseCmd {
|
||||
|
|
@ -55,6 +57,16 @@ public class DeleteSecurityGroupCmd extends BaseCmd {
|
|||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
SecurityGroup group = _entityMgr.findById(SecurityGroup.class, getId());
|
||||
if (group != null) {
|
||||
return group.getAccountId();
|
||||
}
|
||||
|
||||
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ import com.cloud.api.Implementation;
|
|||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.SuccessResponse;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description="Deletes a service offering.", responseObject=SuccessResponse.class)
|
||||
public class DeleteServiceOfferingCmd extends BaseCmd{
|
||||
|
|
@ -57,6 +58,11 @@ public class DeleteServiceOfferingCmd extends BaseCmd{
|
|||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
return Account.ACCOUNT_ID_SYSTEM;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ import com.cloud.api.Implementation;
|
|||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.SuccessResponse;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description="Deletes snapshot policies for the account.", responseObject=SuccessResponse.class)
|
||||
public class DeleteSnapshotPoliciesCmd extends BaseCmd {
|
||||
|
|
@ -67,6 +68,11 @@ public class DeleteSnapshotPoliciesCmd extends BaseCmd {
|
|||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
return Account.ACCOUNT_ID_SYSTEM;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
|
|
|
|||
|
|
@ -27,6 +27,8 @@ import com.cloud.api.Parameter;
|
|||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.SuccessResponse;
|
||||
import com.cloud.api.response.UserResponse;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.User;
|
||||
|
||||
@Implementation(description="Creates a user for an account", responseObject=UserResponse.class)
|
||||
public class DeleteUserCmd extends BaseCmd {
|
||||
|
|
@ -58,6 +60,16 @@ public class DeleteUserCmd extends BaseCmd {
|
|||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
User user = _entityMgr.findById(User.class, getId());
|
||||
if (user != null) {
|
||||
return user.getAccountId();
|
||||
}
|
||||
|
||||
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
boolean result = _accountService.deleteUser(this);
|
||||
|
|
|
|||
|
|
@ -25,6 +25,8 @@ import com.cloud.api.Implementation;
|
|||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.SuccessResponse;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.vm.InstanceGroup;
|
||||
|
||||
@Implementation(description="Deletes a vm group", responseObject=SuccessResponse.class)
|
||||
public class DeleteVMGroupCmd extends BaseCmd{
|
||||
|
|
@ -55,6 +57,16 @@ public class DeleteVMGroupCmd extends BaseCmd{
|
|||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
InstanceGroup group = _entityMgr.findById(InstanceGroup.class, getId());
|
||||
if (group != null) {
|
||||
return group.getAccountId();
|
||||
}
|
||||
|
||||
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
boolean result = _userVmService.deleteVmGroup(this);
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ import com.cloud.api.Implementation;
|
|||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.SuccessResponse;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description="Creates a VLAN IP range.", responseObject=SuccessResponse.class)
|
||||
public class DeleteVlanIpRangeCmd extends BaseCmd {
|
||||
|
|
@ -56,6 +57,11 @@ public class DeleteVlanIpRangeCmd extends BaseCmd {
|
|||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
return Account.ACCOUNT_ID_SYSTEM;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
|
|
|
|||
|
|
@ -27,6 +27,8 @@ import com.cloud.api.Parameter;
|
|||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.SuccessResponse;
|
||||
import com.cloud.exception.ConcurrentOperationException;
|
||||
import com.cloud.storage.Volume;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.UserContext;
|
||||
|
||||
@Implementation(description="Deletes a detached disk volume.", responseObject=SuccessResponse.class)
|
||||
|
|
@ -63,6 +65,16 @@ public class DeleteVolumeCmd extends BaseCmd {
|
|||
public static String getResultObjectName() {
|
||||
return "volume";
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
Volume volume = _entityMgr.findById(Volume.class, getId());
|
||||
if (volume != null) {
|
||||
return volume.getAccountId();
|
||||
}
|
||||
|
||||
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() throws ConcurrentOperationException {
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ import com.cloud.api.Implementation;
|
|||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.SuccessResponse;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description="Deletes a Zone.", responseObject=SuccessResponse.class)
|
||||
public class DeleteZoneCmd extends BaseCmd {
|
||||
|
|
@ -58,6 +59,11 @@ public class DeleteZoneCmd extends BaseCmd {
|
|||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
return Account.ACCOUNT_ID_SYSTEM;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ import com.cloud.event.EventTypes;
|
|||
import com.cloud.exception.ConcurrentOperationException;
|
||||
import com.cloud.exception.ResourceUnavailableException;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.UserContext;
|
||||
|
||||
@Implementation(description="Disables an account", responseObject=AccountResponse.class)
|
||||
public class DisableAccountCmd extends BaseAsyncCmd {
|
||||
|
|
@ -78,9 +77,9 @@ public class DisableAccountCmd extends BaseAsyncCmd {
|
|||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
Account account = UserContext.current().getCaller();
|
||||
Account account = _accountService.getActiveAccount(getAccountName(), getDomainId());
|
||||
if (account != null) {
|
||||
return account.getId();
|
||||
return account.getAccountId();
|
||||
}
|
||||
|
||||
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
|
||||
|
|
|
|||
|
|
@ -28,8 +28,8 @@ import com.cloud.api.ServerApiException;
|
|||
import com.cloud.api.response.UserResponse;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.User;
|
||||
import com.cloud.user.UserAccount;
|
||||
import com.cloud.user.UserContext;
|
||||
|
||||
@Implementation(description="Disables a user account", responseObject=UserResponse.class)
|
||||
public class DisableUserCmd extends BaseAsyncCmd {
|
||||
|
|
@ -67,9 +67,9 @@ public class DisableUserCmd extends BaseAsyncCmd {
|
|||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
Account account = UserContext.current().getCaller();
|
||||
if (account != null) {
|
||||
return account.getId();
|
||||
User user = _entityMgr.findById(User.class, getId());
|
||||
if (user != null) {
|
||||
return user.getAccountId();
|
||||
}
|
||||
|
||||
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
|
||||
|
|
|
|||
|
|
@ -61,6 +61,16 @@ public class EnableAccountCmd extends BaseCmd {
|
|||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
Account account = _accountService.getActiveAccount(getAccountName(), getDomainId());
|
||||
if (account != null) {
|
||||
return account.getAccountId();
|
||||
}
|
||||
|
||||
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -27,6 +27,8 @@ import com.cloud.api.Parameter;
|
|||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.SuccessResponse;
|
||||
import com.cloud.exception.NetworkRuleConflictException;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.uservm.UserVm;
|
||||
|
||||
@Implementation(description="Enables static nat for given ip address", responseObject=SuccessResponse.class)
|
||||
public class EnableStaticNatCmd extends BaseCmd{
|
||||
|
|
@ -64,6 +66,16 @@ public class EnableStaticNatCmd extends BaseCmd{
|
|||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
UserVm userVm = _entityMgr.findById(UserVm.class, getVirtualMachineId());
|
||||
if (userVm != null) {
|
||||
return userVm.getAccountId();
|
||||
}
|
||||
|
||||
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
|
|
|
|||
|
|
@ -26,6 +26,8 @@ import com.cloud.api.Implementation;
|
|||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.UserResponse;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.User;
|
||||
import com.cloud.user.UserAccount;
|
||||
|
||||
@Implementation(description="Enables a user account", responseObject=UserResponse.class)
|
||||
|
|
@ -58,6 +60,16 @@ public class EnableUserCmd extends BaseCmd {
|
|||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
User user = _entityMgr.findById(User.class, getId());
|
||||
if (user != null) {
|
||||
return user.getAccountId();
|
||||
}
|
||||
|
||||
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
UserAccount user = _accountService.enableUser(this);
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ import com.cloud.api.Implementation;
|
|||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.CloudIdentifierResponse;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description="Retrieves a cloud identifier.", responseObject=CloudIdentifierResponse.class)
|
||||
public class GetCloudIdentifierCmd extends BaseCmd {
|
||||
|
|
@ -59,6 +60,11 @@ public class GetCloudIdentifierCmd extends BaseCmd {
|
|||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
return Account.ACCOUNT_ID_SYSTEM;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
ArrayList<String> result = _mgr.getCloudIdentifierResponse(this);
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ import com.cloud.api.BaseCmd;
|
|||
import com.cloud.api.Implementation;
|
||||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.response.GetVMPasswordResponse;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.uservm.UserVm;
|
||||
|
||||
@Implementation(responseObject=GetVMPasswordResponse.class, description="Returns an encrypted password for the VM")
|
||||
public class GetVMPasswordCmd extends BaseCmd {
|
||||
|
|
@ -45,6 +47,16 @@ public class GetVMPasswordCmd extends BaseCmd {
|
|||
|
||||
this.setResponseObject(new GetVMPasswordResponse(getCommandName(), passwd));
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
UserVm userVm = _entityMgr.findById(UserVm.class, getId());
|
||||
if (userVm != null) {
|
||||
return userVm.getAccountId();
|
||||
}
|
||||
|
||||
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ import org.apache.log4j.Logger;
|
|||
import com.cloud.api.BaseCmd;
|
||||
import com.cloud.api.Implementation;
|
||||
import com.cloud.api.response.CapabilitiesResponse;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description="Lists capabilities", responseObject=CapabilitiesResponse.class)
|
||||
public class ListCapabilitiesCmd extends BaseCmd {
|
||||
|
|
@ -36,6 +37,11 @@ public class ListCapabilitiesCmd extends BaseCmd {
|
|||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
return Account.ACCOUNT_ID_SYSTEM;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
Map<String, Object> capabilities = _mgr.listCapabilities(this);
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ import com.cloud.api.Implementation;
|
|||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.response.HypervisorResponse;
|
||||
import com.cloud.api.response.ListResponse;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description="List hypervisors", responseObject=HypervisorResponse.class)
|
||||
public class ListHypervisorsCmd extends BaseCmd {
|
||||
|
|
@ -57,6 +58,10 @@ public class ListHypervisorsCmd extends BaseCmd {
|
|||
/////////////////////////////////////////////////////
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
return Account.ACCOUNT_ID_SYSTEM;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
|
|
|
|||
|
|
@ -67,6 +67,15 @@ public class ListTemplateOrIsoPermissionsCmd extends BaseCmd {
|
|||
/////////////////////////////////////////////////////
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
VirtualMachineTemplate template = _entityMgr.findById(VirtualMachineTemplate.class, getId());
|
||||
if (template != null) {
|
||||
return template.getAccountId();
|
||||
}
|
||||
|
||||
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@ import com.cloud.api.ApiConstants;
|
|||
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.AccountResponse;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
|
|
@ -63,17 +62,27 @@ public class LockAccountCmd extends BaseCmd {
|
|||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
Account account = _accountService.getActiveAccount(getAccountName(), getDomainId());
|
||||
if (account != null) {
|
||||
return account.getAccountId();
|
||||
}
|
||||
|
||||
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
Account result = null;
|
||||
// Account result = null;
|
||||
//result = _accountService.lockAccount(this);
|
||||
if (result != null){
|
||||
AccountResponse response = _responseGenerator.createAccountResponse(result);
|
||||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
} else {
|
||||
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to lock account");
|
||||
}
|
||||
// if (result != null){
|
||||
// AccountResponse response = _responseGenerator.createAccountResponse(result);
|
||||
// response.setResponseName(getCommandName());
|
||||
// this.setResponseObject(response);
|
||||
// } else {
|
||||
// throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to lock account");
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,8 @@ import com.cloud.api.Implementation;
|
|||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.UserResponse;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.User;
|
||||
import com.cloud.user.UserAccount;
|
||||
|
||||
@Implementation(description="Locks a user account", responseObject=UserResponse.class)
|
||||
|
|
@ -56,6 +58,16 @@ public class LockUserCmd extends BaseCmd {
|
|||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
User user = _entityMgr.findById(User.class, getId());
|
||||
if (user != null) {
|
||||
return user.getAccountId();
|
||||
}
|
||||
|
||||
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ import com.cloud.api.BaseCmd;
|
|||
import com.cloud.api.Implementation;
|
||||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.response.AsyncJobResponse;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description="Retrieves the current status of asynchronous job.", responseObject=AsyncJobResponse.class)
|
||||
public class QueryAsyncJobResultCmd extends BaseCmd {
|
||||
|
|
@ -54,6 +55,11 @@ public class QueryAsyncJobResultCmd extends BaseCmd {
|
|||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
return Account.ACCOUNT_ID_SYSTEM;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ import com.cloud.api.Parameter;
|
|||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.UserVmResponse;
|
||||
import com.cloud.exception.ResourceAllocationException;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.uservm.UserVm;
|
||||
|
||||
@Implementation(description="Recovers a virtual machine.", responseObject=UserVmResponse.class)
|
||||
|
|
@ -59,6 +60,16 @@ public class RecoverVMCmd extends BaseCmd {
|
|||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
UserVm userVm = _entityMgr.findById(UserVm.class, getId());
|
||||
if (userVm != null) {
|
||||
return userVm.getAccountId();
|
||||
}
|
||||
|
||||
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() throws ResourceAllocationException{
|
||||
UserVm result = _userVmService.recoverVirtualMachine(this);
|
||||
|
|
|
|||
|
|
@ -25,6 +25,8 @@ import com.cloud.api.BaseCmd;
|
|||
import com.cloud.api.Implementation;
|
||||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.response.RegisterResponse;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.User;
|
||||
|
||||
@Implementation(responseObject=RegisterResponse.class, description="This command allows a user to register for the developer API, returning a secret key and an API key. This request is made through the integration API port, so it is a privileged command and must be made on behalf of a user. It is up to the implementer just how the username and password are entered, and then how that translates to an integration API request. Both secret key and API key should be returned to the user")
|
||||
public class RegisterCmd extends BaseCmd {
|
||||
|
|
@ -53,6 +55,16 @@ public class RegisterCmd extends BaseCmd {
|
|||
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
User user = _entityMgr.findById(User.class, getId());
|
||||
if (user != null) {
|
||||
return user.getAccountId();
|
||||
}
|
||||
|
||||
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -28,6 +28,8 @@ import com.cloud.api.response.ListResponse;
|
|||
import com.cloud.api.response.TemplateResponse;
|
||||
import com.cloud.exception.ResourceAllocationException;
|
||||
import com.cloud.template.VirtualMachineTemplate;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.UserContext;
|
||||
|
||||
@Implementation(responseObject=TemplateResponse.class, description="Registers an existing ISO into the Cloud.com Cloud.")
|
||||
public class RegisterIsoCmd extends BaseCmd {
|
||||
|
|
@ -122,6 +124,25 @@ public class RegisterIsoCmd extends BaseCmd {
|
|||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
Account account = UserContext.current().getCaller();
|
||||
if ((account == null) || isAdmin(account.getType())) {
|
||||
if ((domainId != null) && (accountName != null)) {
|
||||
Account userAccount = _responseGenerator.findAccountByNameDomain(accountName, domainId);
|
||||
if (userAccount != null) {
|
||||
return userAccount.getId();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (account != null) {
|
||||
return account.getId();
|
||||
}
|
||||
|
||||
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() throws ResourceAllocationException{
|
||||
VirtualMachineTemplate template = _templateService.registerIso(this);
|
||||
|
|
|
|||
|
|
@ -7,7 +7,9 @@ import com.cloud.api.BaseCmd;
|
|||
import com.cloud.api.Implementation;
|
||||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.response.SSHKeyPairResponse;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.SSHKeyPair;
|
||||
import com.cloud.user.UserContext;
|
||||
|
||||
@Implementation(description="Register a public key in a keypair under a certain name", responseObject=SSHKeyPairResponse.class)
|
||||
public class RegisterSSHKeyPairCmd extends BaseCmd {
|
||||
|
|
@ -43,6 +45,17 @@ public class RegisterSSHKeyPairCmd extends BaseCmd {
|
|||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
Account account = UserContext.current().getCaller();
|
||||
|
||||
if (account != null) {
|
||||
return account.getId();
|
||||
}
|
||||
|
||||
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
SSHKeyPair result = _mgr.registerSSHKeyPair(this);
|
||||
|
|
|
|||
|
|
@ -31,6 +31,8 @@ import com.cloud.api.response.TemplateResponse;
|
|||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.exception.ResourceAllocationException;
|
||||
import com.cloud.template.VirtualMachineTemplate;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.UserContext;
|
||||
|
||||
@Implementation(description="Registers an existing template into the Cloud.com cloud. ", responseObject=TemplateResponse.class)
|
||||
public class RegisterTemplateCmd extends BaseCmd {
|
||||
|
|
@ -163,6 +165,25 @@ public class RegisterTemplateCmd extends BaseCmd {
|
|||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.Template;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
Account account = UserContext.current().getCaller();
|
||||
if ((account == null) || isAdmin(account.getType())) {
|
||||
if ((domainId != null) && (accountName != null)) {
|
||||
Account userAccount = _responseGenerator.findAccountByNameDomain(accountName, domainId);
|
||||
if (userAccount != null) {
|
||||
return userAccount.getId();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (account != null) {
|
||||
return account.getId();
|
||||
}
|
||||
|
||||
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() throws ResourceAllocationException{
|
||||
|
|
|
|||
|
|
@ -34,7 +34,6 @@ import com.cloud.exception.InsufficientCapacityException;
|
|||
import com.cloud.exception.ResourceUnavailableException;
|
||||
import com.cloud.network.router.VirtualRouter;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.uservm.UserVm;
|
||||
|
||||
|
||||
@Implementation(responseObject=DomainRouterResponse.class, description="Starts a router.")
|
||||
|
|
@ -73,9 +72,9 @@ public class StartRouterCmd extends BaseAsyncCmd {
|
|||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
UserVm vm = _entityMgr.findById(UserVm.class, getId());
|
||||
if (vm != null) {
|
||||
return vm.getAccountId();
|
||||
VirtualRouter router = _entityMgr.findById(VirtualRouter.class, getId());
|
||||
if (router != null) {
|
||||
return router.getAccountId();
|
||||
}
|
||||
|
||||
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@ import com.cloud.exception.ConcurrentOperationException;
|
|||
import com.cloud.exception.ResourceUnavailableException;
|
||||
import com.cloud.network.router.VirtualRouter;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.uservm.UserVm;
|
||||
|
||||
|
||||
@Implementation(description="Stops a router.", responseObject=DomainRouterResponse.class)
|
||||
|
|
@ -70,9 +69,9 @@ public class StopRouterCmd extends BaseAsyncCmd {
|
|||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
UserVm vm = _entityMgr.findById(UserVm.class, getId());
|
||||
if (vm != null) {
|
||||
return vm.getAccountId();
|
||||
VirtualRouter router = _entityMgr.findById(VirtualRouter.class, getId());
|
||||
if (router != null) {
|
||||
return router.getAccountId();
|
||||
}
|
||||
|
||||
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
|
||||
|
|
|
|||
|
|
@ -70,6 +70,16 @@ public class UpdateAccountCmd extends BaseCmd{
|
|||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
Account account = _accountService.getActiveAccount(getAccountName(), getDomainId());
|
||||
if (account != null) {
|
||||
return account.getAccountId();
|
||||
}
|
||||
|
||||
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
Account result = _accountService.updateAccount(this);
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ import com.cloud.api.Parameter;
|
|||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.ConfigurationResponse;
|
||||
import com.cloud.configuration.Configuration;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description="Updates a configuration.", responseObject=ConfigurationResponse.class)
|
||||
public class UpdateCfgCmd extends BaseCmd {
|
||||
|
|
@ -64,6 +65,11 @@ public class UpdateCfgCmd extends BaseCmd {
|
|||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
return Account.ACCOUNT_ID_SYSTEM;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
Configuration cfg = _configService.updateConfiguration(this);
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ import com.cloud.api.Parameter;
|
|||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.DiskOfferingResponse;
|
||||
import com.cloud.offering.DiskOffering;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description="Updates a disk offering.", responseObject=DiskOfferingResponse.class)
|
||||
public class UpdateDiskOfferingCmd extends BaseCmd{
|
||||
|
|
@ -71,6 +72,11 @@ public class UpdateDiskOfferingCmd extends BaseCmd{
|
|||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
return Account.ACCOUNT_ID_SYSTEM;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
DiskOffering result = _configService.updateDiskOffering(this);
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ import com.cloud.api.Parameter;
|
|||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.DomainResponse;
|
||||
import com.cloud.domain.Domain;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description="Updates a domain with a new name", responseObject=DomainResponse.class)
|
||||
public class UpdateDomainCmd extends BaseCmd {
|
||||
|
|
@ -63,6 +64,11 @@ public class UpdateDomainCmd extends BaseCmd {
|
|||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
return Account.ACCOUNT_ID_SYSTEM;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
Domain domain = _mgr.updateDomain(this);
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ import com.cloud.api.Parameter;
|
|||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.HostResponse;
|
||||
import com.cloud.host.Host;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description="Updates a host.", responseObject=HostResponse.class)
|
||||
public class UpdateHostCmd extends BaseCmd {
|
||||
|
|
@ -68,6 +69,11 @@ public class UpdateHostCmd extends BaseCmd {
|
|||
return "updatehost";
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
return Account.ACCOUNT_ID_SYSTEM;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
Host result = _resourceService.updateHost(this);
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ import com.cloud.api.Implementation;
|
|||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.TemplateResponse;
|
||||
import com.cloud.template.VirtualMachineTemplate;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description="Updates an ISO file.", responseObject=TemplateResponse.class)
|
||||
public class UpdateIsoCmd extends UpdateTemplateOrIsoCmd {
|
||||
|
|
@ -53,6 +54,16 @@ public class UpdateIsoCmd extends UpdateTemplateOrIsoCmd {
|
|||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
VirtualMachineTemplate template = _entityMgr.findById(VirtualMachineTemplate.class, getId());
|
||||
if (template != null) {
|
||||
return template.getAccountId();
|
||||
}
|
||||
|
||||
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);
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@ import com.cloud.api.BaseCmd;
|
|||
import com.cloud.api.Implementation;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.SuccessResponse;
|
||||
import com.cloud.template.VirtualMachineTemplate;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description="Updates iso permissions", responseObject=SuccessResponse.class)
|
||||
public class UpdateIsoPermissionsCmd extends UpdateTemplateOrIsoPermissionsCmd {
|
||||
|
|
@ -17,6 +19,16 @@ public class UpdateIsoPermissionsCmd extends UpdateTemplateOrIsoPermissionsCmd {
|
|||
return Logger.getLogger(UpdateIsoPermissionsCmd.class.getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
VirtualMachineTemplate template = _entityMgr.findById(VirtualMachineTemplate.class, getId());
|
||||
if (template != null) {
|
||||
return template.getAccountId();
|
||||
}
|
||||
|
||||
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
boolean result = _mgr.updateTemplatePermissions(this);
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ import com.cloud.api.ServerApiException;
|
|||
import com.cloud.api.response.NetworkOfferingResponse;
|
||||
import com.cloud.offering.NetworkOffering;
|
||||
import com.cloud.offering.NetworkOffering.Availability;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description="Updates a network offering.", responseObject=NetworkOfferingResponse.class)
|
||||
public class UpdateNetworkOfferingCmd extends BaseCmd {
|
||||
|
|
@ -77,6 +78,11 @@ public class UpdateNetworkOfferingCmd extends BaseCmd {
|
|||
public String getCommandName() {
|
||||
return _name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
return Account.ACCOUNT_ID_SYSTEM;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ import com.cloud.api.Parameter;
|
|||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.PodResponse;
|
||||
import com.cloud.dc.Pod;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description="Updates a Pod.", responseObject=PodResponse.class)
|
||||
public class UpdatePodCmd extends BaseCmd {
|
||||
|
|
@ -93,6 +94,11 @@ public class UpdatePodCmd extends BaseCmd {
|
|||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
return Account.ACCOUNT_ID_SYSTEM;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
Pod result = _configService.editPod(this);
|
||||
|
|
|
|||
|
|
@ -27,6 +27,8 @@ import com.cloud.api.Parameter;
|
|||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.ResourceLimitResponse;
|
||||
import com.cloud.configuration.ResourceLimit;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.UserContext;
|
||||
|
||||
@Implementation(description="Updates resource limits for an account or domain.", responseObject=ResourceLimitResponse.class)
|
||||
public class UpdateResourceLimitCmd extends BaseCmd {
|
||||
|
|
@ -83,6 +85,25 @@ public class UpdateResourceLimitCmd extends BaseCmd {
|
|||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
Account account = UserContext.current().getCaller();
|
||||
if ((account == null) || isAdmin(account.getType())) {
|
||||
if ((domainId != null) && (accountName != null)) {
|
||||
Account userAccount = _responseGenerator.findAccountByNameDomain(accountName, domainId);
|
||||
if (userAccount != null) {
|
||||
return userAccount.getId();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (account != null) {
|
||||
return account.getId();
|
||||
}
|
||||
|
||||
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ import com.cloud.api.Parameter;
|
|||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.ServiceOfferingResponse;
|
||||
import com.cloud.offering.ServiceOffering;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description="Updates a service offering.", responseObject=ServiceOfferingResponse.class)
|
||||
public class UpdateServiceOfferingCmd extends BaseCmd {
|
||||
|
|
@ -72,6 +73,11 @@ public class UpdateServiceOfferingCmd extends BaseCmd {
|
|||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
return Account.ACCOUNT_ID_SYSTEM;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ import com.cloud.api.Parameter;
|
|||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.StoragePoolResponse;
|
||||
import com.cloud.storage.StoragePool;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description="Updates a storage pool.", responseObject=StoragePoolResponse.class)
|
||||
public class UpdateStoragePoolCmd extends BaseCmd {
|
||||
|
|
@ -65,6 +66,11 @@ public class UpdateStoragePoolCmd extends BaseCmd {
|
|||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
return Account.ACCOUNT_ID_SYSTEM;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
StoragePool result = _storageService.updateStoragePool(this);
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ import com.cloud.api.Implementation;
|
|||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.TemplateResponse;
|
||||
import com.cloud.template.VirtualMachineTemplate;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description="Updates attributes of a template.", responseObject=TemplateResponse.class)
|
||||
public class UpdateTemplateCmd extends UpdateTemplateOrIsoCmd {
|
||||
|
|
@ -53,6 +54,16 @@ public class UpdateTemplateCmd extends UpdateTemplateOrIsoCmd {
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
VirtualMachineTemplate template = _entityMgr.findById(VirtualMachineTemplate.class, getId());
|
||||
if (template != null) {
|
||||
return template.getAccountId();
|
||||
}
|
||||
|
||||
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);
|
||||
|
|
|
|||
|
|
@ -12,8 +12,6 @@ public abstract class UpdateTemplateOrIsoPermissionsCmd extends BaseCmd {
|
|||
public Logger s_logger = getLogger();
|
||||
protected String s_name = getResponseName();
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
|
|
|||
|
|
@ -24,6 +24,8 @@ import com.cloud.api.BaseCmd;
|
|||
import com.cloud.api.Implementation;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.SuccessResponse;
|
||||
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. " +
|
||||
|
|
@ -39,6 +41,16 @@ public class UpdateTemplatePermissionsCmd extends UpdateTemplateOrIsoPermissions
|
|||
return Logger.getLogger(UpdateTemplatePermissionsCmd.class.getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
VirtualMachineTemplate template = _entityMgr.findById(VirtualMachineTemplate.class, getId());
|
||||
if (template != null) {
|
||||
return template.getAccountId();
|
||||
}
|
||||
|
||||
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
boolean result = _mgr.updateTemplatePermissions(this);
|
||||
|
|
|
|||
|
|
@ -26,6 +26,8 @@ import com.cloud.api.Implementation;
|
|||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.UserResponse;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.User;
|
||||
import com.cloud.user.UserAccount;
|
||||
|
||||
@Implementation(description="Updates a user account", responseObject=UserResponse.class)
|
||||
|
|
@ -113,6 +115,16 @@ public class UpdateUserCmd extends BaseCmd {
|
|||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
User user = _entityMgr.findById(User.class, getId());
|
||||
if (user != null) {
|
||||
return user.getAccountId();
|
||||
}
|
||||
|
||||
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ import com.cloud.api.Implementation;
|
|||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.UserVmResponse;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.UserContext;
|
||||
import com.cloud.uservm.UserVm;
|
||||
|
||||
|
|
@ -88,6 +89,16 @@ public class UpdateVMCmd extends BaseCmd{
|
|||
public static String getResultObjectName() {
|
||||
return "virtualmachine";
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
UserVm userVm = _entityMgr.findById(UserVm.class, getId());
|
||||
if (userVm != null) {
|
||||
return userVm.getAccountId();
|
||||
}
|
||||
|
||||
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ import com.cloud.api.Implementation;
|
|||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.InstanceGroupResponse;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.vm.InstanceGroup;
|
||||
|
||||
@Implementation(description="Updates a vm group", responseObject=InstanceGroupResponse.class)
|
||||
|
|
@ -63,6 +64,16 @@ public class UpdateVMGroupCmd extends BaseCmd{
|
|||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
InstanceGroup group = _entityMgr.findById(InstanceGroup.class, getId());
|
||||
if (group != null) {
|
||||
return group.getAccountId();
|
||||
}
|
||||
|
||||
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ import com.cloud.api.Parameter;
|
|||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.ZoneResponse;
|
||||
import com.cloud.dc.DataCenter;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description="Updates a Zone.", responseObject=ZoneResponse.class)
|
||||
public class UpdateZoneCmd extends BaseCmd {
|
||||
|
|
@ -114,6 +115,11 @@ public class UpdateZoneCmd extends BaseCmd {
|
|||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
return Account.ACCOUNT_ID_SYSTEM;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
DataCenter result = _configService.editZone(this);
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ import com.cloud.api.Parameter;
|
|||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.DomainRouterResponse;
|
||||
import com.cloud.network.router.VirtualRouter;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@Implementation(description="Upgrades domain router to a new service offering", responseObject=DomainRouterResponse.class)
|
||||
public class UpgradeRouterCmd extends BaseCmd {
|
||||
|
|
@ -63,6 +64,16 @@ public class UpgradeRouterCmd extends BaseCmd {
|
|||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
VirtualRouter router = _entityMgr.findById(VirtualRouter.class, getId());
|
||||
if (router != null) {
|
||||
return router.getAccountId();
|
||||
}
|
||||
|
||||
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);
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ import com.cloud.api.Implementation;
|
|||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.UserVmResponse;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.UserContext;
|
||||
import com.cloud.uservm.UserVm;
|
||||
|
||||
|
|
@ -70,6 +71,16 @@ public class UpgradeVMCmd extends BaseCmd {
|
|||
return "virtualmachine";
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
UserVm userVm = _entityMgr.findById(UserVm.class, getId());
|
||||
if (userVm != null) {
|
||||
return userVm.getAccountId();
|
||||
}
|
||||
|
||||
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());
|
||||
|
|
|
|||
|
|
@ -124,10 +124,11 @@ public class ApiDispatcher {
|
|||
String errorMsg = "";
|
||||
setupParameters(cmd, params);
|
||||
try {
|
||||
UserContext ctx = UserContext.current();
|
||||
ctx.setAccountId(cmd.getEntityOwnerId());
|
||||
if(cmd instanceof BaseAsyncCmd){
|
||||
UserContext ctx = UserContext.current();
|
||||
|
||||
BaseAsyncCmd asyncCmd = (BaseAsyncCmd)cmd;
|
||||
ctx.setAccountId(asyncCmd.getEntityOwnerId());
|
||||
String startEventId = params.get("ctxStartEventId");
|
||||
ctx.setStartEventId(Long.valueOf(startEventId));
|
||||
|
||||
|
|
|
|||
|
|
@ -1728,6 +1728,8 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag
|
|||
sb.join("domainSearch", domainSearch, sb.entity().getDomainId(), domainSearch.entity().getId(), JoinBuilder.JoinType.INNER);
|
||||
}
|
||||
|
||||
sb.and("removed", sb.entity().getRemoved(), Op.NULL);
|
||||
|
||||
SearchCriteria<NetworkVO> sc = sb.create();
|
||||
|
||||
if (!isSystem) {
|
||||
|
|
@ -1787,6 +1789,8 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag
|
|||
if (!isSystem && path != null && (isShared == null || !isShared)) {
|
||||
sc.setJoinParameters("domainSearch", "path", path + "%");
|
||||
}
|
||||
|
||||
|
||||
|
||||
List<NetworkVO> networks = _networksDao.search(sc, searchFilter);
|
||||
|
||||
|
|
|
|||
|
|
@ -4741,65 +4741,80 @@ public class ManagementServerImpl implements ManagementServer {
|
|||
|
||||
@Override
|
||||
public SSHKeyPair createSSHKeyPair(CreateSSHKeyPairCmd cmd) {
|
||||
Account account = UserContext.current().getCaller();
|
||||
SSHKeyPairVO s = _sshKeyPairDao.findByName(account.getAccountId(), account.getDomainId(), cmd.getName());
|
||||
if (s != null) {
|
||||
throw new InvalidParameterValueException("A key pair with name '" + cmd.getName() + "' already exists.");
|
||||
}
|
||||
Account account = UserContext.current().getCaller();
|
||||
SSHKeyPairVO s = _sshKeyPairDao.findByName(account.getAccountId(), account.getDomainId(), cmd.getName());
|
||||
if (s != null) {
|
||||
throw new InvalidParameterValueException("A key pair with name '" + cmd.getName() + "' already exists.");
|
||||
}
|
||||
|
||||
SSHKeysHelper keys = new SSHKeysHelper();
|
||||
SSHKeysHelper keys = new SSHKeysHelper();
|
||||
|
||||
String name = cmd.getName();
|
||||
String publicKey = keys.getPublicKey();
|
||||
String fingerprint = keys.getPublicKeyFingerPrint();
|
||||
String privateKey = keys.getPrivateKey();
|
||||
String name = cmd.getName();
|
||||
String publicKey = keys.getPublicKey();
|
||||
String fingerprint = keys.getPublicKeyFingerPrint();
|
||||
String privateKey = keys.getPrivateKey();
|
||||
|
||||
return createAndSaveSSHKeyPair(name, fingerprint, publicKey, privateKey);
|
||||
return createAndSaveSSHKeyPair(name, fingerprint, publicKey, privateKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteSSHKeyPair(DeleteSSHKeyPairCmd cmd) {
|
||||
Account account = UserContext.current().getCaller();
|
||||
SSHKeyPairVO s = _sshKeyPairDao.findByName(account.getAccountId(), account.getDomainId(), cmd.getName());
|
||||
if (s == null) {
|
||||
throw new InvalidParameterValueException("A key pair with name '" + cmd.getName() + "' does not exist.");
|
||||
}
|
||||
|
||||
return _sshKeyPairDao.deleteByName(account.getAccountId(), account.getDomainId(), cmd.getName());
|
||||
Account caller = UserContext.current().getCaller();
|
||||
String accountName = cmd.getAccountName();
|
||||
Long domainId = cmd.getDomainId();
|
||||
Account owner = null;
|
||||
|
||||
if (accountName != null && domainId != null) {
|
||||
owner = _accountMgr.getActiveAccount(accountName, domainId);
|
||||
}
|
||||
|
||||
if (owner == null) {
|
||||
owner = caller;
|
||||
} else {
|
||||
//check account permissions
|
||||
_accountMgr.checkAccess(caller, owner);
|
||||
}
|
||||
|
||||
SSHKeyPairVO s = _sshKeyPairDao.findByName(owner.getAccountId(), owner.getDomainId(), cmd.getName());
|
||||
if (s == null) {
|
||||
throw new InvalidParameterValueException("A key pair with name '" + cmd.getName() + "' does not exist.");
|
||||
}
|
||||
|
||||
return _sshKeyPairDao.deleteByName(caller.getAccountId(), caller.getDomainId(), cmd.getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<? extends SSHKeyPair> listSSHKeyPairs(ListSSHKeyPairsCmd cmd) {
|
||||
Account account = UserContext.current().getCaller();
|
||||
|
||||
if (cmd.getName() != null && cmd.getName().length() > 0) {
|
||||
return _sshKeyPairDao.listKeyPairsByName(account.getAccountId(), account.getDomainId(), cmd.getName());
|
||||
}
|
||||
|
||||
if (cmd.getFingerprint() != null && cmd.getFingerprint().length() > 0) {
|
||||
return _sshKeyPairDao.listKeyPairsByFingerprint(account.getAccountId(), account.getDomainId(), cmd.getFingerprint());
|
||||
}
|
||||
|
||||
return _sshKeyPairDao.listKeyPairs(account.getAccountId(), account.getDomainId());
|
||||
Account account = UserContext.current().getCaller();
|
||||
|
||||
if (cmd.getName() != null && cmd.getName().length() > 0) {
|
||||
return _sshKeyPairDao.listKeyPairsByName(account.getAccountId(), account.getDomainId(), cmd.getName());
|
||||
}
|
||||
|
||||
if (cmd.getFingerprint() != null && cmd.getFingerprint().length() > 0) {
|
||||
return _sshKeyPairDao.listKeyPairsByFingerprint(account.getAccountId(), account.getDomainId(), cmd.getFingerprint());
|
||||
}
|
||||
|
||||
return _sshKeyPairDao.listKeyPairs(account.getAccountId(), account.getDomainId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public SSHKeyPair registerSSHKeyPair(RegisterSSHKeyPairCmd cmd) {
|
||||
Account account = UserContext.current().getCaller();
|
||||
SSHKeyPairVO s = _sshKeyPairDao.findByName(account.getAccountId(), account.getDomainId(), cmd.getName());
|
||||
if (s != null) {
|
||||
throw new InvalidParameterValueException("A key pair with name '" + cmd.getName() + "' already exists.");
|
||||
}
|
||||
Account account = UserContext.current().getCaller();
|
||||
SSHKeyPairVO s = _sshKeyPairDao.findByName(account.getAccountId(), account.getDomainId(), cmd.getName());
|
||||
if (s != null) {
|
||||
throw new InvalidParameterValueException("A key pair with name '" + cmd.getName() + "' already exists.");
|
||||
}
|
||||
|
||||
String name = cmd.getName();
|
||||
String publicKey = SSHKeysHelper.getPublicKeyFromKeyMaterial(cmd.getPublicKey());
|
||||
String fingerprint = SSHKeysHelper.getPublicKeyFingerprint(publicKey);
|
||||
String name = cmd.getName();
|
||||
String publicKey = SSHKeysHelper.getPublicKeyFromKeyMaterial(cmd.getPublicKey());
|
||||
String fingerprint = SSHKeysHelper.getPublicKeyFingerprint(publicKey);
|
||||
|
||||
if (publicKey == null) {
|
||||
throw new InvalidParameterValueException("Public key is invalid");
|
||||
}
|
||||
if (publicKey == null) {
|
||||
throw new InvalidParameterValueException("Public key is invalid");
|
||||
}
|
||||
|
||||
return createAndSaveSSHKeyPair(name, fingerprint, publicKey, null);
|
||||
return createAndSaveSSHKeyPair(name, fingerprint, publicKey, null);
|
||||
}
|
||||
|
||||
private SSHKeyPair createAndSaveSSHKeyPair(String name, String fingerprint, String publicKey, String privateKey) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue