全部产品

项目协作域API

API示例

回复:下面的示例 主要是Java语言的示例,更多语言的示例参考这个地址

https://api.aliyun.com/#/?product=devops-rdc&version=2020-03-03&api=GetTaskDetailBase&params={}&tab=DEMO&lang=GO

标题:查看任务详情 GetTaskDetailBase

回复:企业id 可以从企业管理后台获取企业id如何获取项目id和任务id可以从web页面获取

package com.example.demo;import com.aliyuncs.DefaultAcsClient;import com.aliyuncs.IAcsClient;import com.aliyuncs.devops_rdc.model.v20200303.GetTaskDetailBaseRequest;import com.aliyuncs.devops_rdc.model.v20200303.GetTaskDetailBaseResponse;import com.aliyuncs.exceptions.ClientException;import com.aliyuncs.profile.DefaultProfile;public class GetTaskDetailBase {

//查看任务详情 //方法名:GetTaskDetailBase public static void main (String args[]) throws ClientException {

DefaultProfile profile = DefaultProfile.getProfile(

"cn-hangzhou", // 地域ID "Laaaaaaaaaaaaaa9", // RAM账号的AccessKey ID: "e0bbbbbbbbbbbbbbbbbbbbbbbb"); // RAM账号Access Key Secret IAcsClient client = new DefaultAcsClient(profile); GetTaskDetailBaseRequest request = new GetTaskDetailBaseRequest(); request.setOrgId("5ef1aaaaaaaaaae937200"); //企业id request.setTaskId("603aaaaaaaaaaaaaaa0c"); //任务id request.setProjectId("60aaaaaaaaaaaaaaaaaaaaa5a"); 项目id request.setSysEndpoint("api-devops.cn-hangzhou.aliyuncs.com"); GetTaskDetailBaseResponse acsResponse = client.getAcsResponse(request); System.out.println(acsResponse.getObject()); }

}

或者是

package com.example.demo;import com.aliyuncs.DefaultAcsClient;import com.aliyuncs.IAcsClient;import com.aliyuncs.devops_rdc.model.v20200303.GetDevopsProjectTaskInfoRequest;import com.aliyuncs.devops_rdc.model.v20200303.GetDevopsProjectTaskInfoResponse;import com.aliyuncs.exceptions.ClientException;import com.aliyuncs.profile.DefaultProfile;public class testGetDevopsProjectTaskInfo {

//查看任务详情 //方法名:GetDevopsProjectTaskInfo public static void main (String args[]) throws ClientException {

DefaultProfile profile = DefaultProfile.getProfile(

"cn-hangzhou", // 地域ID "LTAaaaaaaaaaaaaaaa9", // RAM账号的AccessKey ID: "ebbbbbbbbbbbbbbbbbbbbbbb"); // RAM账号Access Key Secret IAcsClient client = new DefaultAcsClient(profile); GetDevopsProjectTaskInfoRequest request = new GetDevopsProjectTaskInfoRequest(); request.setOrgId("5eaaaaaaaaaaaaaaaaaaaaaaaaaa00"); //企业id request.setTaskId("6vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvc"); // 任务id request.setSysEndpoint("api-devops.cn-hangzhou.aliyuncs.com"); GetDevopsProjectTaskInfoResponse acsResponse = client.getAcsResponse(request); System.out.println(acsResponse.getObject()); }

}