package com.bocloud.ims.booter.controller.resource.fusionsphere;


import com.bocloud.common.annotations.Log;
import com.bocloud.common.enums.BoCloudService;
import com.bocloud.common.model.BocloudResult;
import com.bocloud.common.model.RequestContext;
import com.bocloud.common.utils.Common;
import com.bocloud.ims.interfaces.resource.fusionsphere.FusionSphereMonitorService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;

@Api(value = "fc_monitor", tags = "fc_monitor管理")
@RestController
@RequestMapping("/v1/fc/monitors")
public class FusionSphereMonitorController {

    @Autowired
    private FusionSphereMonitorService service;

    /**
     * 查询监控数据
     *
     * @param params
     * @param context
     * @return
     */
    @ApiOperation(tags = {"CMC", "CSC"}, value = "数据监控", httpMethod = "GET")
    @Log(module = BoCloudService.IMS, target = "数据监控", operation = "数据监控")
    @GetMapping("/{id}/metrics")
    public BocloudResult metrics(@RequestParam(value = Common.PARAMS) String params, @PathVariable(value = Common.ID) Long id,
                                 @Value(Common.REQ_CONTEXT) RequestContext context) {
        return service.metrics(id, params, context);
    }
}
