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

import com.bocloud.common.annotations.Log;
import com.bocloud.common.enums.BoCloudService;
import com.bocloud.common.model.BocloudResult;
import com.bocloud.common.model.GridBean;
import com.bocloud.common.model.Pager;
import com.bocloud.common.model.RequestContext;
import com.bocloud.common.utils.Common;
import com.bocloud.ims.entity.resource.pbm.PbmProfile;
import com.bocloud.ims.interfaces.pbm.PbmProfileService;
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.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * vcenter存储策略
 *
 * @author wangyu
 * @version 1.0
 * @since 2020年2月25日
 */
@RestController
@RequestMapping("/v1/pbm/profile")
@Api(value = "存储策略", tags = "存储策略")
public class PbmProfileController {

    @Autowired
    private PbmProfileService profileService;

    /**
     * 获取存储策略列表
     *
     * @param pager
     * @param context
     * @return
     */
    @ApiOperation(tags = {"CMC", "CSC"}, value = "获取存储策略列表",  httpMethod = "GET")
    @Log(module = BoCloudService.IMS, target = "存储策略", operation = "获取存储策略列表")
    @GetMapping
    public BocloudResult<GridBean<PbmProfile>> list(Pager pager, @Value(Common.REQ_CONTEXT) RequestContext context) {
        return profileService.list(pager, context);
    }

}
