aboutsummaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/main/java/org/onap/vid/controllers/ProbeController.java
blob: a2145de393413b6d092c4be13ad258360f419fa3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package org.onap.vid.controllers;

import org.onap.vid.aai.AaiClient;
import org.onap.vid.model.probes.ExternalComponentStatus;
import org.onap.portalsdk.core.controller.RestrictedBaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController
@RequestMapping("probe")
public class ProbeController extends RestrictedBaseController {
    @Autowired
    private AaiClient aaiClient;

    @RequestMapping(method= RequestMethod.GET)
    public List<ExternalComponentStatus> getProbe(){
        List<ExternalComponentStatus> componentStatuses = new ArrayList<>();
        componentStatuses.add(aaiClient.probeAaiGetAllSubscribers());
        return componentStatuses;
    }

}