-export function processOrchStatusVisualizationOnSearchChange(requestObject) {
- return dispatch => {
- return fetch(VNF_RESULT_URL, {
- method: POST,
- headers: POST_HEADER,
- body: JSON.stringify(getVnfOrchStatusQueryString(requestObject))
- }).then(
- (response) => response.json()
- ).then(
- (responseJson) => {
- dispatch(getOrchStatusEvent(responseJson));
- }
- ).catch(
- () => {
- dispatch(getInvalidQueryEvent());
- }
- );
+function getVnfVisualizationsResultsEvent(results) {
+ let count = TOTAL_VNF_COUNT.emptyData;
+ let provData = CHART_PROV_STATUS.emptyData;
+ let orchData = CHART_ORCH_STATUS.emptyData;
+ let netFuncTypeData = CHART_NF_TYPE.emptyData;
+ let netFuncRoleData = CHART_NF_ROLE.emptyData;
+
+ if (results.total) {
+ count = results.total;
+ }
+
+ if (results['aggregations'] && results['aggregations']['prov-status']) {
+ provData = processProvData(results['aggregations']['prov-status']);
+ }
+
+ if (results['aggregations'] &&
+ results['aggregations']['orchestration-status']) {
+ orchData = processOrchData(results['aggregations']['orchestration-status']);
+ }
+
+ if (results['aggregations'] &&
+ results['aggregations']['nf-type']) {
+ netFuncTypeData = processNfTypeData(results['aggregations']['nf-type']);
+ }
+
+ if (results['aggregations'] &&
+ results['aggregations']['nf-role']) {
+ netFuncRoleData = processNfRoleData(results['aggregations']['nf-role']);
+ }
+
+ return {
+ type: vnfActionTypes.VNF_SEARCH_RESULTS_RECEIVED,
+ data: {
+ count: count,
+ provStatusData: provData,
+ orchStatusData: orchData,
+ nfTypeData: netFuncTypeData,
+ nfRoleData: netFuncRoleData
+ }