@Override public void execute() throws ResourceUnavailableException, ResourceAllocationException, ConcurrentOperationException, InsufficientCapacityException { CallContext.current().setEventDetails("IP ID: " + getEntityId()); IpAddress result = null; if (getVpcId() != null) { result = _vpcService.associateIPToVpc(getEntityId(), getVpcId()); } else if (getNetworkId() != null) { result = _networkService.associateIPToNetwork(getEntityId(), getNetworkId()); } if (result != null) { IPAddressResponse ipResponse = _responseGenerator.createIPAddressResponse(ResponseView.Restricted, result); ipResponse.setResponseName(getCommandName()); setResponseObject(ipResponse); } else { throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to assign IP address"); } }
@Override public void execute() throws ResourceUnavailableException, ResourceAllocationException, ConcurrentOperationException, InsufficientCapacityException { CallContext.current().setEventDetails("Ip Id: " + getEntityId()); IpAddress result = null; if (getVpcId() != null) { result = _vpcService.associateIPToVpc(getEntityId(), getVpcId()); } else if (getNetworkId() != null) { result = _networkService.associateIPToNetwork(getEntityId(), getNetworkId()); } if (result != null) { IPAddressResponse ipResponse = _responseGenerator.createIPAddressResponse(ResponseView.Full, result); ipResponse.setResponseName(getCommandName()); setResponseObject(ipResponse); } else { throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to assign ip address"); } }
_vpcSvc.associateIPToVpc(ipId, network.getVpcId());
@Override public void execute() throws ResourceUnavailableException, ResourceAllocationException, ConcurrentOperationException, InsufficientCapacityException { CallContext.current().setEventDetails("IP ID: " + getEntityId()); IpAddress result = null; if (getVpcId() != null) { result = _vpcService.associateIPToVpc(getEntityId(), getVpcId()); } else if (getNetworkId() != null) { result = _networkService.associateIPToNetwork(getEntityId(), getNetworkId()); } if (result != null) { final IPAddressResponse ipResponse = _responseGenerator.createIPAddressResponse(ResponseView.Restricted, result); ipResponse.setResponseName(getCommandName()); setResponseObject(ipResponse); } else { throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to assign IP address"); } }
@Override public void execute() throws ResourceUnavailableException, ResourceAllocationException, ConcurrentOperationException, InsufficientCapacityException { CallContext.current().setEventDetails("Ip Id: " + getEntityId()); IpAddress result = null; if (getVpcId() != null) { result = _vpcService.associateIPToVpc(getEntityId(), getVpcId()); } else if (getNetworkId() != null) { result = _networkService.associateIPToNetwork(getEntityId(), getNetworkId()); } if (result != null) { final IPAddressResponse ipResponse = _responseGenerator.createIPAddressResponse(ResponseView.Full, result); ipResponse.setResponseName(getCommandName()); setResponseObject(ipResponse); } else { throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to assign ip address"); } } }