全部产品
阿里云办公

查看构建

更新时间:2018-06-26 13:09:36

描述

说明:查看您在Codepipeline中单个项目的单次构建信息。

请求信息

请求行 RequestLine

  1. GET /job/{JobName}/build/{BuildNumber} HTTP/1.1

请求行参数 URI Param

名称 类型 是否必须 描述
JobName String 项目名称
BuildNumber String 构建号

返回信息

返回行 ResponseLine

  1. HTTP/1.1 200 OK

返回码 HTTP Status Code

Status Code 描述
401 Authentication failed
403 The request was valid, but the server is refusing action. The user might not have the necessary permissions for a resource, or may need an account of some sort.
404 Job not found
405 Invalid input
500 Internal Error

返回体 ResponseBody

  1. {
  2. "BuildEnv": "string",
  3. "BuildNumber": 0,
  4. "Duration": 0,
  5. "Log": "string",
  6. "RequestId": "string",
  7. "StartTime": 0,
  8. "BuildStatus": "string"
  9. }

返回体解释

名称 类型 描述
BuildNumber int 构建号
StartTime Long 构建开始时间,格式是Unix时间戳(毫秒)
BuildStatus string 构建结果,如RUNNING SUCCES FAILED ABORT等

示例

  1. @Test
  2. public void getJobBuild() {
  3. GetBuildRequest getBuildRequest = new GetBuildRequest();
  4. try {
  5. getBuildRequest.setAcceptFormat(FormatType.JSON);
  6. getBuildRequest.setJobName("test");
  7. getBuildRequest.setBuildNumber(1);
  8. getBuildRequest.setMethod(MethodType.GET);
  9. GetBuildResponse getBuildResponse = client.getAcsResponse(getBuildRequest);
  10. Assert.assertNotNull(getBuildRequest.getJobName());
  11. } catch (ServerException e) {
  12. e.printStackTrace();
  13. Assert.fail();
  14. } catch (ClientException e) {
  15. Assert.fail();
  16. e.printStackTrace();
  17. }
  18. }