Skip to content

Commit 16d6a17

Browse files
author
Build2 CI
committed
Create AuthType enum, complete VnfService with all command methods, add ResponseMapping setters
1 parent ab2b18c commit 16d6a17

File tree

7 files changed

+28
-13
lines changed

7 files changed

+28
-13
lines changed
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
package org.apache.cloudstack.vnf;
22

33
public enum AuthType {
4-
NONE,
54
BASIC,
65
TOKEN,
7-
SSH_KEY,
8-
SSH_PASSWORD
9-
}
6+
API_KEY,
7+
NONE
8+
}

plugins/vnf-framework/src/main/java/org/apache/cloudstack/vnf/ResponseMapping.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ public class ResponseMapping {
1111
public void setSuccessCode(int code) { this.successCode = code; }
1212
public String getIdPath() { return idPath; }
1313
public void setIdPath(String path) { this.idPath = path; }
14+
public String getListPath() { return listPath; }
15+
public void setListPath(String listPath) { this.listPath = listPath; }
16+
public Map<String, String> getItemPaths() { return itemPaths; }
17+
public void setItemPaths(Map<String, String> itemPaths) { this.itemPaths = itemPaths; }
1418
}
1519
/**
1620
* Represents a VNF appliance instance

plugins/vnf-framework/src/main/java/org/apache/cloudstack/vnf/VnfService.java

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,37 @@
33
import com.cloud.exception.CloudException;
44
import org.apache.cloudstack.vnf.dao.VnfOperationVO;
55
import org.apache.cloudstack.vnf.dao.VnfOperationVO.State;
6-
import org.apache.cloudstack.vnf.api.command.UploadVnfDictionaryCmd;
6+
import org.apache.cloudstack.vnf.api.command.*;
77
import java.util.List;
88

99
public interface VnfService {
1010

11+
// Operation queries
1112
VnfOperationVO findOperationByRuleId(String ruleId) throws CloudException;
12-
1313
List<VnfOperationVO> listOperationsByVnfInstance(Long vnfInstanceId) throws CloudException;
14-
1514
List<VnfOperationVO> listOperationsByVnfInstanceAndState(Long vnfInstanceId, State state) throws CloudException;
16-
1715
List<VnfOperationVO> listOperationsByState(State state) throws CloudException;
18-
1916
List<VnfOperationVO> listAllOperations(Long startIndex, Long pageSize) throws CloudException;
2017

18+
// Dictionary management
2119
List<VnfDictionary> listDictionaries(Long accountId) throws CloudException;
22-
20+
List<VnfDictionary> listVnfDictionaries(ListVnfDictionariesCmd cmd) throws CloudException;
2321
VnfDictionary uploadDictionary(String dictionaryData, String vendor, Long accountId) throws CloudException;
24-
2522
VnfDictionary uploadVnfDictionary(UploadVnfDictionaryCmd cmd) throws CloudException;
2623

27-
VnfConnectivityResult testConnectivity(Long vnfApplianceId) throws CloudException;
24+
// Firewall rules
25+
String createVnfFirewallRule(CreateVnfFirewallRuleCmd cmd) throws CloudException;
26+
String deleteVnfFirewallRule(DeleteVnfFirewallRuleCmd cmd) throws CloudException;
27+
String updateVnfFirewallRule(UpdateVnfFirewallRuleCmd cmd) throws CloudException;
28+
29+
// NAT rules
30+
String createVnfNATRule(CreateVnfNATRuleCmd cmd) throws CloudException;
2831

32+
// Network operations
33+
VnfReconciliationResult reconcileVnfNetwork(ReconcileVnfNetworkCmd cmd) throws CloudException;
2934
VnfReconciliationResult reconcileNetwork(Long networkId) throws CloudException;
35+
36+
// Connectivity testing
37+
VnfConnectivityResult testConnectivity(Long vnfApplianceId) throws CloudException;
38+
VnfConnectivityResult testVnfConnectivity(TestVnfConnectivityCmd cmd) throws CloudException;
3039
}

plugins/vnf-framework/src/main/java/org/apache/cloudstack/vnf/api/command/CreateVnfNATRuleCmd.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
package org.apache.cloudstack.vnf.api.command;
2+
import com.cloud.event.EventTypes;
23

34
import com.cloud.exception.ConcurrentOperationException;
45
import com.cloud.exception.InsufficientCapacityException;

plugins/vnf-framework/src/main/java/org/apache/cloudstack/vnf/api/command/DeleteVnfFirewallRuleCmd.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
package org.apache.cloudstack.vnf.api.command;
2+
import com.cloud.event.EventTypes;
23

34
import com.cloud.exception.ConcurrentOperationException;
45
import com.cloud.exception.ResourceUnavailableException;

plugins/vnf-framework/src/main/java/org/apache/cloudstack/vnf/api/command/UpdateVnfFirewallRuleCmd.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
package org.apache.cloudstack.vnf.api.command;
2+
import com.cloud.event.EventTypes;
23

34
import com.cloud.exception.ConcurrentOperationException;
45
import com.cloud.exception.InsufficientCapacityException;

plugins/vnf-framework/src/main/java/org/apache/cloudstack/vnf/service/VnfServiceImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
@Component
2929
public class VnfServiceImpl extends ManagerBase implements VnfService {
30-
private static final Logger LOGGER = Logger.getLogger(VnfServiceImpl.class);
30+
private static final Logger LOGGER = LogManager.getLogger(VnfServiceImpl.class);
3131
private static final ObjectMapper objectMapper = new ObjectMapper();
3232

3333
@Inject

0 commit comments

Comments
 (0)