查询指定文件的最近一次Git提交。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
授权信息
当前API暂无授权信息透出。
请求语法
GET /repository/{repositoryId}/files/lastCommit
请求参数
| 名称 | 类型 | 必填 | 描述 | 示例值 | 
|---|---|---|---|---|
| accessToken | string | 否 | 个人访问令牌。 使用阿里云 AK+SK 或使用 STS 临时授权方式不需要传该字段。 | f0b1e61db5961df5975a93f9129d2513 | 
| repositoryId | long | 是 | 代码库 ID | 2825387 | 
| organizationId | string | 是 | 企业标识,也称企业 id,字符串形式,可在云效访问链接中获取,如 https://devops.aliyun.com/organization/【OrganizationId】 | 60de7a6852743a5162b5f957 | 
| sha | string | 是 | 分支名称、标签名称或 Commit ID 例如: 分支名称:master 标签名称:tag001 CommitID:ff4fb5ac6d1f44f452654336d2dba468ae6c8d04 | master | 
| filePath | string | 是 | 文件路径 | src/main/test.java | 
| showSignature | boolean | 否 | 展示签名,默认值:false | false | 
返回参数
示例
正常返回示例
JSON格式
{
  "errorMessage": "\"\"",
  "requestId": "F7B85D1B-D1C2-140F-A039-341859F130B9",
  "success": true,
  "errorCode": "SYSTEM_UNKNOWN_ERROR",
  "result": {
    "shortId": "ff4fb5ac",
    "authorName": "test-codeup",
    "authorDate": "2022-08-08 18:09:09",
    "createdAt": "2022-03-18 14:24:54",
    "message": "提交的具体内容",
    "title": "提交标题",
    "committerName": "committer-codeup",
    "authorEmail": "username@example.com",
    "id": "ff4fb5ac6d1f44f452654336d2dba468ae6c8d04 ",
    "committerEmail": "username@example.com",
    "committedDate": "2022-03-18 15:00:02",
    "parentIds": [
      "de02b625ba8488f92eb204bcb3773a40c1b4ddac"
    ],
    "signature": {
      "verificationStatus": "verified",
      "gpgKeyId": "34d2c47c7ce46a5c4639c5ffe208"
    }
  }
}错误码
| HTTP status code | 错误码 | 错误信息 | 
|---|---|---|
| 500 | SystemError.UnKnownError | An error occurred while processing your request. | 
访问错误中心查看更多错误码。
变更历史
| 变更时间 | 变更内容概要 | 操作 | 
|---|---|---|
| 2022-11-21 | OpenAPI 错误码发生变更、OpenAPI 入参发生变更、OpenAPI 返回结构发生变更 | 查看变更详情 | 
