package com.huawei.esdk.fusionmanager.local.resources.system;

import com.huawei.esdk.fusionmanager.local.model.system.ActionScheduleTaskReq;
import com.huawei.esdk.fusionmanager.local.model.system.ActionScheduleTaskResp;
import com.huawei.esdk.fusionmanager.local.model.system.CreateScheduleTaskReq;
import com.huawei.esdk.fusionmanager.local.model.system.CreateScheduleTaskResp;
import com.huawei.esdk.fusionmanager.local.model.system.QueryPolicyInfoResp;
import com.huawei.esdk.fusionmanager.local.model.system.QueryScheduleTaskDetailResp;
import com.huawei.esdk.fusionmanager.local.model.system.QueryScheduleTaskListReqEx;
import com.huawei.esdk.fusionmanager.local.model.system.QueryScheduleTaskListResp;
import com.huawei.esdk.fusionmanager.local.model.system.RemoveScheduleTaskResp;
import com.huawei.esdk.fusionmanager.local.model.system.UpdateScheduleTaskReq;
import com.huawei.esdk.fusionmanager.local.model.system.UpdateScheduleTaskResp;

/**
 * 计划任务管理。
 * <p><b>代码示例：</b></p>
 * &nbsp;&nbsp;&nbsp;&nbsp;ClientProviderBean bean = new ClientProviderBean();<br>
 * &nbsp;&nbsp;&nbsp;&nbsp;//设置FM所在的IP<br>
 * &nbsp;&nbsp;&nbsp;&nbsp;bean.setServerIp("188.188.40.43");<br>
 * &nbsp;&nbsp;&nbsp;&nbsp;//设置FM的端口<br>
 * &nbsp;&nbsp;&nbsp;&nbsp;bean.setServerPort("543");<br>
 * &nbsp;&nbsp;&nbsp;&nbsp;//设置FM用户名，跟登录用户名保持一致<br>
 * &nbsp;&nbsp;&nbsp;&nbsp;bean.setUserName("FM01");<br>
 * &nbsp;&nbsp;&nbsp;&nbsp;//获取ScheduleTaskResource接口的实现<br>
 * &nbsp;&nbsp;&nbsp;&nbsp;ScheduleTaskResource instance = (ScheduleTaskResource)ServiceFactory.getService(ScheduleTaskResource.class,bean);<br>
 * <p>
 * @since eSDK Cloud V100R003C50
 */
public interface ScheduleTaskResource
{
    /**
     * 启动或停止计划任务。
     * <p><b>代码示例：</b></p>
     * &nbsp;&nbsp;&nbsp;&nbsp;ActionScheduleTaskReq req = new ActionScheduleTaskReq();<br>
     * &nbsp;&nbsp;&nbsp;&nbsp;req.setAction("Start");<br>
     * &nbsp;&nbsp;&nbsp;&nbsp;ActionScheduleTaskResp resp = instance.actionScheduleTask(req, "2", "102", "36");<br>
     * <p>
     * @param actionScheduleTaskReq 【必选】启动或停止计划任务请求
     * @param vdcId 【必选】路由器所在VDC ID。
     * @param scheduleId 【必选】计划任务 ID。
     * @param cloudInfraId 【必选】云资源池编码。
     * @return {@code ActionScheduleTaskResp}
     * @since eSDK Cloud V100R003C30
     */
    public ActionScheduleTaskResp actionScheduleTask(ActionScheduleTaskReq actionScheduleTaskReq, String vdcId,
        String scheduleId, String cloudInfraId);
    
    /**
     * 查询计划任务详情。
     * <p><b>代码示例：</b></p>
     * &nbsp;&nbsp;&nbsp;&nbsp;QueryScheduleTaskDetailResp resp = instance.queryScheduleTaskDetail("5", "102", "34");<br>
     * <p>
     * @param vdcId 【必选】路由器所在VDC ID。
     * @param scheduleId 【必选】计划任务 ID。
     * @param cloudInfraId 【必选】云资源池编码。
     * @return {@code QueryScheduleTaskDetailResp}
     * @since eSDK Cloud V100R003C30
     */
    public QueryScheduleTaskDetailResp queryScheduleTaskDetail(String vdcId, String scheduleId, String cloudInfraId);
    
    /**
     * 删除计划任务。
     * <p><b>代码示例：</b></p>
     * &nbsp;&nbsp;&nbsp;&nbsp;RemoveScheduleTaskResp resp = instance.removeScheduleTask("2", "102", "36");<br>
     * <p>
     * @param vdcId 【必选】路由器所在VDC ID。
     * @param scheduleId 【必选】计划任务 ID。
     * @param cloudInfraId 【必选】云资源池编码。
     * @return {@code RemoveScheduleTaskResp}
     * @since eSDK Cloud V100R003C30
     */
    public RemoveScheduleTaskResp removeScheduleTask(String vdcId, String scheduleId, String cloudInfraId);
    
    /**
     * 修改计划任务。
     * <p><b>代码示例：</b></p>
     * &nbsp;&nbsp;&nbsp;&nbsp;ScheduleTask task = new ScheduleTask();<br>
     * &nbsp;&nbsp;&nbsp;&nbsp;task.setName("test003");<br>
     * &nbsp;&nbsp;&nbsp;&nbsp;task.setTriggerType("PERIOD");<br>
     * &nbsp;&nbsp;&nbsp;&nbsp;UpdateScheduleTaskReq req = new UpdateScheduleTaskReq();<br>
     * &nbsp;&nbsp;&nbsp;&nbsp;req.setScheduleTask(task);<br>
     * &nbsp;&nbsp;&nbsp;&nbsp;AssociatedPolicyInfo assInfo = new AssociatedPolicyInfo();<br>
     * &nbsp;&nbsp;&nbsp;&nbsp;assInfo.setAppId("1eac21f8-e15b-43dd-9cf3-00f8af2974e8");<br>
     * &nbsp;&nbsp;&nbsp;&nbsp;assInfo.setAppName("suibain001");<br>
     * &nbsp;&nbsp;&nbsp;&nbsp;assInfo.setGroupId("3f4053b4-45a0-490e-b871-31ba236fc77e");<br>
     * &nbsp;&nbsp;&nbsp;&nbsp;assInfo.setGroupName("ScalingGroup_19");<br>
     * &nbsp;&nbsp;&nbsp;&nbsp;assInfo.setPolicyId("75bcd457-aea5-49d9-b05c-4f0a3d302b4a");<br>
     * &nbsp;&nbsp;&nbsp;&nbsp;assInfo.setPolicyName("strategy002");<br>
     * &nbsp;&nbsp;&nbsp;&nbsp;List&lt;AssociatedPolicyInfo> policies = new ArrayList&lt;AssociatedPolicyInfo>();<br>
     * &nbsp;&nbsp;&nbsp;&nbsp;policies.add(assInfo);<br>
     * &nbsp;&nbsp;&nbsp;&nbsp;task.setPolicies(policies);<br>
     * &nbsp;&nbsp;&nbsp;&nbsp;ScheduleTaskDateTime time = new ScheduleTaskDateTime();<br>
     * &nbsp;&nbsp;&nbsp;&nbsp;time.setDate("SUN");<br>
     * &nbsp;&nbsp;&nbsp;&nbsp;time.setTime("08:50");<br>
     * &nbsp;&nbsp;&nbsp;&nbsp;List&lt;ScheduleTaskDateTime> dateAndTimeList = new ArrayList&lt;ScheduleTaskDateTime>();<br>
     * &nbsp;&nbsp;&nbsp;&nbsp;dateAndTimeList.add(time);<br>
     * &nbsp;&nbsp;&nbsp;&nbsp;task.setDateAndTimeList(dateAndTimeList);<br>
     * &nbsp;&nbsp;&nbsp;&nbsp;assInfo.setPolicyOperation("START");<br>
     * &nbsp;&nbsp;&nbsp;&nbsp;String vdcId = "5";<br>
     * &nbsp;&nbsp;&nbsp;&nbsp;String scheduleId = "102";<br>
     * &nbsp;&nbsp;&nbsp;&nbsp;String cloudInfraId = "34";<br>
     * &nbsp;&nbsp;&nbsp;&nbsp;UpdateScheduleTaskResp resp = instance.modifyScheduleTask(req, vdcId, scheduleId, cloudInfraId);<br>
     * <p>
     * @param updateScheduleTaskReq 【必选】修改计划任务请求。
     * @param vdcId 【必选】路由器所在VDC ID。
     * @param scheduleId 【必选】计划任务 ID。
     * @param cloudInfraId 【必选】云资源池编码。
     * @return {@code UpdateScheduleTaskResp}
     * @since eSDK Cloud V100R003C30
     */
    public UpdateScheduleTaskResp modifyScheduleTask(UpdateScheduleTaskReq updateScheduleTaskReq, String vdcId,
        String scheduleId, String cloudInfraId);
    
    /**
     * 查询计划任务列表。
     * <p><b>代码示例：</b></p>
     * &nbsp;&nbsp;&nbsp;&nbsp;QueryScheduleTaskListReqEx reqEx = new QueryScheduleTaskListReqEx();<br>
     * &nbsp;&nbsp;&nbsp;&nbsp;reqEx.setCloudInfraId("34");<br>
     * &nbsp;&nbsp;&nbsp;&nbsp;reqEx.setLimit("10");<br>
     * &nbsp;&nbsp;&nbsp;&nbsp;reqEx.setStart("9");<br>
     * &nbsp;&nbsp;&nbsp;&nbsp;reqEx.setVdcId("5");<br>
     * &nbsp;&nbsp;&nbsp;&nbsp;reqEx.setSort("taskname");<br>
     * &nbsp;&nbsp;&nbsp;&nbsp;reqEx.setOrder("DESC");<br>
     * &nbsp;&nbsp;&nbsp;&nbsp;QueryScheduleTaskListResp resp = instance.queryScheduleTaskList(reqEx);<br>
     * <p>
     * @param queryScheduleTaskListReqEx 【必选】查询计划任务列表请求。
     * @return {@code QueryScheduleTaskListResp}
     * @since eSDK Cloud V100R003C30
     */
    public QueryScheduleTaskListResp queryScheduleTaskList(QueryScheduleTaskListReqEx queryScheduleTaskListReqEx);
    
    /**
     * 创建计划任务。
     * <p><b>代码示例：</b></p>
     * &nbsp;&nbsp;&nbsp;&nbsp;ScheduleTask task = new ScheduleTask();<br>
     * &nbsp;&nbsp;&nbsp;&nbsp;task.setName("test003");<br>
     * &nbsp;&nbsp;&nbsp;&nbsp;task.setTriggerType("PERIOD");<br>
     * &nbsp;&nbsp;&nbsp;&nbsp;task.setTaskStatus("ENABLED");<br>
     * &nbsp;&nbsp;&nbsp;&nbsp;CreateScheduleTaskReq req = new CreateScheduleTaskReq();<br>
     * &nbsp;&nbsp;&nbsp;&nbsp;req.setScheduleTask(task);<br>
     * &nbsp;&nbsp;&nbsp;&nbsp;AssociatedPolicyInfo assInfo = new AssociatedPolicyInfo();<br>
     * &nbsp;&nbsp;&nbsp;&nbsp;assInfo.setAppId("1eac21f8-e15b-43dd-9cf3-00f8af2974e8");<br>
     * &nbsp;&nbsp;&nbsp;&nbsp;assInfo.setAppName("suibain001");<br>
     * &nbsp;&nbsp;&nbsp;&nbsp;assInfo.setGroupId("3f4053b4-45a0-490e-b871-31ba236fc77e");<br>
     * &nbsp;&nbsp;&nbsp;&nbsp;assInfo.setGroupName("ScalingGroup_19");<br>
     * &nbsp;&nbsp;&nbsp;&nbsp;assInfo.setPolicyId("75bcd457-aea5-49d9-b05c-4f0a3d302b4a");<br>
     * &nbsp;&nbsp;&nbsp;&nbsp;assInfo.setPolicyName("strategy002");<br>
     * &nbsp;&nbsp;&nbsp;&nbsp;List&lt;AssociatedPolicyInfo> policies = new ArrayList&lt;AssociatedPolicyInfo>();<br>
     * &nbsp;&nbsp;&nbsp;&nbsp;policies.add(assInfo);<br>
     * &nbsp;&nbsp;&nbsp;&nbsp;task.setPolicies(policies);<br>
     * &nbsp;&nbsp;&nbsp;&nbsp;ScheduleTaskDateTime time = new ScheduleTaskDateTime();<br>
     * &nbsp;&nbsp;&nbsp;&nbsp;time.setDate("SUN");<br>
     * &nbsp;&nbsp;&nbsp;&nbsp;time.setTime("08:50");<br>
     * &nbsp;&nbsp;&nbsp;&nbsp;List&lt;ScheduleTaskDateTime> dateAndTimeList = new ArrayList&lt;ScheduleTaskDateTime>();<br>
     * &nbsp;&nbsp;&nbsp;&nbsp;dateAndTimeList.add(time);<br>
     * &nbsp;&nbsp;&nbsp;&nbsp;task.setDateAndTimeList(dateAndTimeList);<br>
     * &nbsp;&nbsp;&nbsp;&nbsp;assInfo.setPolicyOperation("START");<br>
     * &nbsp;&nbsp;&nbsp;&nbsp;String vdcId = "5";<br>
     * &nbsp;&nbsp;&nbsp;&nbsp;String cloudInfraId = "34";<br>
     * &nbsp;&nbsp;&nbsp;&nbsp;CreateScheduleTaskResp resp = instance.createScheduleTask(req, vdcId, cloudInfraId);<br>
     * <p>
     * @param createScheduleTaskReq 【必选】创建计划任务请求。
     * @param vdcId 【必选】路由器所在VDC ID。 
     * @param cloudInfraId 【必选】云资源池编码。
     * @return {@code CreateScheduleTaskResp}
     * @since eSDK Cloud V100R003C30
     */
    public CreateScheduleTaskResp createScheduleTask(CreateScheduleTaskReq createScheduleTaskReq, String vdcId,
        String cloudInfraId);
    
    /**
     * 查询租户下可被计划任务引用的伸缩策略。
     * <p><b>代码示例：</b></p>
     * &nbsp;&nbsp;&nbsp;&nbsp;QueryPolicyInfoResp resp = instance.listPolicies("5","34");<br>
     * @param vdcId 【必选】租户所在VDC 编码。 
     * @param cloudInfraId  【必选】云资源池编码。
     * @return {@code QueryPolicyInfoResp}
     * @since eSDK Cloud V100R003C50
     */
    public QueryPolicyInfoResp listPolicies(String vdcId, String cloudInfraId);
}
