mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Merge branch 'master' into vpc
This commit is contained in:
commit
7cf7002571
@ -33,6 +33,7 @@ import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.response.SuccessResponse;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.exception.InvalidParameterValueException;
|
||||
import com.cloud.server.ResourceTag;
|
||||
import com.cloud.server.ResourceTag.TaggedResourceType;
|
||||
@Implementation(description = "Creates resource tag(s)", responseObject = SuccessResponse.class, since = "Burbank")
|
||||
|
||||
@ -3768,13 +3768,9 @@ public class ApiResponseHelper implements ResponseGenerator {
|
||||
Site2SiteVpnGatewayResponse response = new Site2SiteVpnGatewayResponse();
|
||||
response.setId(result.getId());
|
||||
response.setIp(ApiDBUtils.findIpAddressById(result.getAddrId()).getAddress().toString());
|
||||
response.setVpcId(result.getVpcId());
|
||||
response.setRemoved(result.getRemoved());
|
||||
response.setObjectName("vpngateway");
|
||||
|
||||
populateAccount(response, result.getAccountId());
|
||||
populateDomain(response, result.getDomainId());
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
@ -113,5 +113,19 @@ public class SecurityGroupDaoImpl extends GenericDaoBase<SecurityGroupVO, Long>
|
||||
boolean result = super.remove(id);
|
||||
txn.commit();
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@DB
|
||||
public boolean expunge(Long id) {
|
||||
Transaction txn = Transaction.currentTxn();
|
||||
txn.start();
|
||||
SecurityGroupVO entry = findById(id);
|
||||
if (entry != null) {
|
||||
_tagsDao.removeByIdAndType(id, TaggedResourceType.SecurityGroup);
|
||||
}
|
||||
boolean result = super.expunge(id);
|
||||
txn.commit();
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@ -231,7 +231,7 @@ public class TaggedResourceManagerImpl implements TaggedResourceService, Manager
|
||||
Transaction txn = Transaction.currentTxn();
|
||||
txn.start();
|
||||
|
||||
for (String tag : tags.keySet()) {
|
||||
for (String key : tags.keySet()) {
|
||||
for (String resourceId : resourceIds) {
|
||||
Long id = getResourceId(resourceId, resourceType);
|
||||
String resourceUuid = getUuid(resourceId, resourceType);
|
||||
@ -252,10 +252,16 @@ public class TaggedResourceManagerImpl implements TaggedResourceService, Manager
|
||||
_accountMgr.checkAccess(caller, _domainMgr.getDomain(domainId));
|
||||
} else {
|
||||
throw new PermissionDeniedException("Account " + caller + " doesn't have permissions to create tags" +
|
||||
" for resource " + tag);
|
||||
" for resource " + key);
|
||||
}
|
||||
|
||||
String value = tags.get(key);
|
||||
|
||||
if (value == null || value.isEmpty()) {
|
||||
throw new InvalidParameterValueException("Value for the key " + key + " is either null or empty");
|
||||
}
|
||||
|
||||
ResourceTagVO resourceTag = new ResourceTagVO(tag, tags.get(tag), accountDomainPair.first(),
|
||||
ResourceTagVO resourceTag = new ResourceTagVO(key, value, accountDomainPair.first(),
|
||||
accountDomainPair.second(),
|
||||
id, resourceType, customer, resourceUuid);
|
||||
resourceTag = _resourceTagDao.persist(resourceTag);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user