Search in sources :

Example 1 with PostParam

use of com.qlangtech.tis.manage.common.HttpUtils.PostParam in project tis by qlangtech.

the class GitUtils method createBranch.

private void createBranch(int projectId, String branchName, String ref) {
    String urlString = String.format(GIT_HOST + "/api/v4/projects/%d/repository/branches", projectId);
    List<PostParam> params = new ArrayList<>();
    params.add(new PostParam("branch_name", branchName));
    params.add(new PostParam("ref", ref));
    String result = HttpUtils.post(urlString, params, gitPostStreamProcess);
    System.out.println(result);
}
Also used : PostParam(com.qlangtech.tis.manage.common.HttpUtils.PostParam)

Example 2 with PostParam

use of com.qlangtech.tis.manage.common.HttpUtils.PostParam in project tis by qlangtech.

the class GitUtils method acceptMergeRequest.

/**
 * 接受一个merge请求
 *
 * @param projectId
 * @param mergeRequestId
 * @param mergeCommitMessage
 */
private void acceptMergeRequest(int projectId, int mergeRequestId, String mergeCommitMessage) {
    final String urlString = String.format(GIT_HOST + "/api/v4/projects/%d/merge_request/%d/merge", projectId, mergeRequestId);
    List<PostParam> params = new ArrayList<>();
    if (!StringUtils.isBlank(mergeCommitMessage)) {
        params.add(new PostParam("merge_commit_message", mergeCommitMessage));
    }
    String result = HttpUtils.put(urlString, params, gitPostStreamProcess);
    System.out.println(result);
}
Also used : PostParam(com.qlangtech.tis.manage.common.HttpUtils.PostParam)

Example 3 with PostParam

use of com.qlangtech.tis.manage.common.HttpUtils.PostParam in project tis by qlangtech.

the class GitUtils method closeMergeRequest.

/**
 * 关闭一个MR
 *
 * @param projectId
 * @param mergeRequestId
 */
private void closeMergeRequest(int projectId, int mergeRequestId) {
    String urlString = String.format(GIT_HOST + "/api/v4/projects/%d/merge_request/%d", projectId, mergeRequestId);
    List<PostParam> params = new ArrayList<>();
    params.add(new PostParam("state_event", "close"));
    String result = HttpUtils.put(urlString, params, gitPostStreamProcess);
    System.out.println(result);
}
Also used : PostParam(com.qlangtech.tis.manage.common.HttpUtils.PostParam)

Example 4 with PostParam

use of com.qlangtech.tis.manage.common.HttpUtils.PostParam in project tis by qlangtech.

the class OfflineDatasourceAction method doExecuteWorkflow.

/**
 * Do execute workflow. 执行数据流任务<br>
 * 仅仅只执行DataFlow的数据构建
 *
 * @param context the context
 * @throws Exception the exception
 */
@Func(value = PermissionConstant.DATAFLOW_MANAGE)
public void doExecuteWorkflow(Context context) throws Exception {
    Integer id = this.getInt("id");
    List<PostParam> params = Lists.newArrayList();
    WorkFlow df = this.getWorkflowDAOFacade().getWorkFlowDAO().selectByPrimaryKey(id);
    Assert.assertNotNull(df);
    params.add(new PostParam(IFullBuildContext.KEY_WORKFLOW_NAME, df.getName()));
    params.add(new PostParam(IFullBuildContext.KEY_WORKFLOW_ID, String.valueOf(id)));
    // TODO 单独触发的DF执行后期要保证该流程最后的执行的结果数据不能用于索引build
    params.add(new PostParam(IFullBuildContext.KEY_APP_SHARD_COUNT, IFullBuildContext.KEY_APP_SHARD_COUNT_SINGLE));
    params.add(new PostParam(COMPONENT_START, FullbuildPhase.FullDump.getName()));
    params.add(new PostParam(COMPONENT_END, FullbuildPhase.JOIN.getName()));
    if (!CoreAction.triggerBuild(this, context, params).success) {
    // throw new IllegalStateException("dataflowid:" + id + " trigger faild");
    }
}
Also used : PostParam(com.qlangtech.tis.manage.common.HttpUtils.PostParam) WorkFlow(com.qlangtech.tis.workflow.pojo.WorkFlow) Func(com.qlangtech.tis.manage.spring.aop.Func)

Example 5 with PostParam

use of com.qlangtech.tis.manage.common.HttpUtils.PostParam in project tis by qlangtech.

the class CoreAction method sendRequest2FullIndexSwapeNode.

/**
 * @param context
 * @param appendParams
 * @return
 * @throws MalformedURLException
 */
private static TriggerBuildResult sendRequest2FullIndexSwapeNode(BasicModule module, final Context context, AppendParams appendParams) throws Exception {
    List<HttpUtils.PostParam> params = appendParams.getParam();
    params.add(new PostParam(KEY_APPNAME, module.getCollectionName()));
    return triggerBuild(module, context, params);
}
Also used : PostParam(com.qlangtech.tis.manage.common.HttpUtils.PostParam)

Aggregations

PostParam (com.qlangtech.tis.manage.common.HttpUtils.PostParam)7 Func (com.qlangtech.tis.manage.spring.aop.Func)1 WorkFlow (com.qlangtech.tis.workflow.pojo.WorkFlow)1 JSONObject (org.json.JSONObject)1