

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# GetPublicBuildBatch
<a name="API_GetPublicBuildBatch"></a>

**注意**  
 AWS CLI 或 AWS 软件开发工具包中不包含此 API 元素。

## 请求语法
<a name="API_GetPublicBuildBatch_RequestSyntax"></a>

```
{
   "publicBuildBatchAlias": "{{string}}"
}
```

## 请求参数
<a name="API_GetPublicBuildBatch_RequestParameters"></a>

有关所有操作的通用参数的信息，请参阅[常用参数](https://docs.aws.amazon.com/codebuild/latest/APIReference/CommonParameters.html)。

请求接受采用 JSON 格式的以下数据。

**注意**  
下表中首先描述了必需参数。

 **[公众 BuildBatchAlias](#API_GetPublicBuildBatch_RequestSyntax)**   <a name="CodeBuild-GetPublicBuildBatch-request-publicBuildBatchAlias"></a>
类型：字符串  
长度限制：最小长度为 1。长度上限为 1024。  
模式：`^[0-9a-zA-Z%+=]+:[a-z0-9]{8}(-[a-z0-9]{4}){3}-[a-z0-9]{12}$`  
必需：是

## 响应语法
<a name="API_GetPublicBuildBatch_ResponseSyntax"></a>

```
{
   "publicBuildBatch": { 
      "artifacts": { 
         "artifactIdentifier": "string",
         "packaging": "string",
         "type": "string"
      },
      "buildBatchConfig": { 
         "combineArtifacts": boolean,
         "restrictions": { 
            "[computeTypesAllowed](https://docs.aws.amazon.com/codebuild/latest/APIReference/API_BatchRestrictions.html)": [ "string" ],
            "[maximumBuildsAllowed](https://docs.aws.amazon.com/codebuild/latest/APIReference/API_BatchRestrictions.html)": number
         },
         "timeoutInMins": number
      },
      "buildBatchNumber": number,
      "buildBatchStatus": "string",
      "buildGroups": [ 
         { 
            "currentBuildSummary": { 
               "buildStatus": "string",
               "primaryArtifact": { 
                  "[identifier](https://docs.aws.amazon.com/codebuild/latest/APIReference/API_ResolvedArtifact.html)": "string",
                  "[location](https://docs.aws.amazon.com/codebuild/latest/APIReference/API_ResolvedArtifact.html)": "string",
                  "[type](https://docs.aws.amazon.com/codebuild/latest/APIReference/API_ResolvedArtifact.html)": "string"
               },
               "publicBuildAlias": "string",
               "requestedOn": number,
               "secondaryArtifacts": [ 
                  { 
                     "[identifier](https://docs.aws.amazon.com/codebuild/latest/APIReference/API_ResolvedArtifact.html)": "string",
                     "[location](https://docs.aws.amazon.com/codebuild/latest/APIReference/API_ResolvedArtifact.html)": "string",
                     "[type](https://docs.aws.amazon.com/codebuild/latest/APIReference/API_ResolvedArtifact.html)": "string"
                  }
               ]
            },
            "dependsOn": [ "string" ],
            "identifier": "string",
            "ignoreFailure": boolean,
            "priorBuildSummaryList": [ 
               { 
                  "buildStatus": "string",
                  "primaryArtifact": { 
                     "[identifier](https://docs.aws.amazon.com/codebuild/latest/APIReference/API_ResolvedArtifact.html)": "string",
                     "[location](https://docs.aws.amazon.com/codebuild/latest/APIReference/API_ResolvedArtifact.html)": "string",
                     "[type](https://docs.aws.amazon.com/codebuild/latest/APIReference/API_ResolvedArtifact.html)": "string"
                  },
                  "publicBuildAlias": "string",
                  "requestedOn": number,
                  "secondaryArtifacts": [ 
                     { 
                        "[identifier](https://docs.aws.amazon.com/codebuild/latest/APIReference/API_ResolvedArtifact.html)": "string",
                        "[location](https://docs.aws.amazon.com/codebuild/latest/APIReference/API_ResolvedArtifact.html)": "string",
                        "[type](https://docs.aws.amazon.com/codebuild/latest/APIReference/API_ResolvedArtifact.html)": "string"
                     }
                  ]
               }
            ]
         }
      ],
      "buildTimeoutInMinutes": number,
      "complete": boolean,
      "currentPhase": "string",
      "endTime": number,
      "environment": { 
         "computeType": "string",
         "environmentVariables": [ 
            { 
               "[name](https://docs.aws.amazon.com/codebuild/latest/APIReference/API_EnvironmentVariable.html)": "string",
               "[type](https://docs.aws.amazon.com/codebuild/latest/APIReference/API_EnvironmentVariable.html)": "string",
               "[value](https://docs.aws.amazon.com/codebuild/latest/APIReference/API_EnvironmentVariable.html)": "string"
            }
         ],
         "image": "string",
         "type": "string"
      },
      "id": "string",
      "initiator": "string",
      "logsStatus": { 
         "cloudWatchLogsStatus": "string",
         "s3LogsStatus": "string"
      },
      "phases": [ 
         { 
            "[contexts](https://docs.aws.amazon.com/codebuild/latest/APIReference/API_BuildBatchPhase.html)": [ 
               { 
                  "[message](https://docs.aws.amazon.com/codebuild/latest/APIReference/API_PhaseContext.html)": "string",
                  "[statusCode](https://docs.aws.amazon.com/codebuild/latest/APIReference/API_PhaseContext.html)": "string"
               }
            ],
            "[durationInSeconds](https://docs.aws.amazon.com/codebuild/latest/APIReference/API_BuildBatchPhase.html)": number,
            "[endTime](https://docs.aws.amazon.com/codebuild/latest/APIReference/API_BuildBatchPhase.html)": number,
            "[phaseStatus](https://docs.aws.amazon.com/codebuild/latest/APIReference/API_BuildBatchPhase.html)": "string",
            "[phaseType](https://docs.aws.amazon.com/codebuild/latest/APIReference/API_BuildBatchPhase.html)": "string",
            "[startTime](https://docs.aws.amazon.com/codebuild/latest/APIReference/API_BuildBatchPhase.html)": number
         }
      ],
      "projectName": "string",
      "publicBuildBatchAlias": "string",
      "queuedTimeoutInMinutes": number,
      "resolvedSourceVersion": "string",
      "secondaryArtifacts": [ 
         { 
            "artifactIdentifier": "string",
            "packaging": "string",
            "type": "string"
         }
      ],
      "secondarySources": [ 
         { 
            "buildspec": "string",
            "gitCloneDepth": number,
            "gitSubmodulesConfig": { 
               "[fetchSubmodules](https://docs.aws.amazon.com/codebuild/latest/APIReference/API_GitSubmodulesConfig.html)": boolean
            },
            "location": "string",
            "sourceIdentifier": "string",
            "type": "string"
         }
      ],
      "secondarySourceVersions": [ 
         { 
            "[sourceIdentifier](https://docs.aws.amazon.com/codebuild/latest/APIReference/API_ProjectSourceVersion.html)": "string",
            "[sourceVersion](https://docs.aws.amazon.com/codebuild/latest/APIReference/API_ProjectSourceVersion.html)": "string"
         }
      ],
      "source": { 
         "buildspec": "string",
         "gitCloneDepth": number,
         "gitSubmodulesConfig": { 
            "[fetchSubmodules](https://docs.aws.amazon.com/codebuild/latest/APIReference/API_GitSubmodulesConfig.html)": boolean
         },
         "location": "string",
         "sourceIdentifier": "string",
         "type": "string"
      },
      "sourceVersion": "string",
      "startTime": number
   }
}
```

## 响应元素
<a name="API_GetPublicBuildBatch_ResponseElements"></a>

如果此操作成功，则该服务将会发送回 HTTP 200 响应。

服务以 JSON 格式返回以下数据。

 **[公众 BuildBatch](#API_GetPublicBuildBatch_ResponseSyntax)**   <a name="CodeBuild-GetPublicBuildBatch-response-publicBuildBatch"></a>
类型：[PublicBuildBatch](API_PublicBuildBatch.md) 对象

## 错误
<a name="API_GetPublicBuildBatch_Errors"></a>

有关所有操作中常见的错误的信息，请参阅[常见错误](https://docs.aws.amazon.com/codebuild/latest/APIReference/CommonErrors.html)。

 **InvalidInputException**   
HTTP 状态代码：400

 **ResourceNotFoundException**   
HTTP 状态代码：400