Method: projects.locations.connections.gitRepositoryLinks.fetchCommit

從 Git 存放區連結擷取修訂版本詳細資料。

HTTP 要求

GET https://developerconnect.googleapis.com/v1/{name=projects/*/locations/*/connections/*/gitRepositoryLinks/*}:fetchCommit

這個網址使用 gRPC 轉碼語法。

路徑參數

參數
name

string

這是必要旗標,GitRepositoryLink 的資源名稱,格式為 projects/*/locations/*/connections/*/gitRepositoryLinks/*。

查詢參數

參數
commitSha

string

這是必要旗標,修訂版本 SHA 或符號修訂版本 (例如分支版本名稱、標記或 Git 參照)。

view

enum (CommitView)

選用。回應中傳回的修訂版本詳細資料層級。如未指定,則預設值為 FULL。在 FULL 檢視中,系統會傳回 files 中繼資料 (路徑和狀態);您也必須指定 pathFilters,才能填入行修補程式區塊。

pathFilters[]

string

選用。路徑模式或確切路徑,用於篩選傳回的檔案 (僅適用於 FULL 檢視畫面)。指定 pathFilters 時,系統會為所有相符檔案填入 FileDiff.patch (使用 ["**"] 可納入所有變更檔案的修補程式)。如果省略 pathFilters 或留空,系統會傳回完整的 FileDiff 清單,不含修補程式差異 (FileDiff.patch 為空白)。

要求主體

要求主體必須為空白。

回應主體

gitRepositoryLinks.fetchCommit 的回應訊息。

如果成功,回應主體會含有以下結構的資料:

JSON 表示法
{
  "commit": {
    object (SCMCommit)
  },
  "files": [
    {
      object (FileDiff)
    }
  ]
}
欄位
commit

object (SCMCommit)

修訂版本中繼資料。

files[]

object (FileDiff)

檔案變更和修補程式差異清單。如果檢視畫面為 BASIC,則會省略。只有在要求中指定 pathFilters 時,系統才會填入修補程式差異 (FileDiff.patch)。

授權範圍

需要下列 OAuth 範圍:

  • https://www.googleapis.com/auth/cloud-platform

詳情請參閱Authentication Overview。

IAM 權限

需要 name 資源的下列 IAM 權限:

  • developerconnect.gitRepositoryLinks.fetchCommit

詳情請參閱 IAM 說明文件。