MCP Tools Reference: dataform.googleapis.com

工具:list_repositories

列出给定 Google Cloud 项目和位置中的 Dataform 代码库。

parent 参数值必须采用 projects/{project_id}/locations/{location} 格式。

以下示例演示了如何使用 curl 调用 list_repositories MCP 工具。

Curl 请求
                  
curl --location 'https://dataform.googleapis.com/mcp' \
--header 'content-type: application/json' \
--header 'accept: application/json, text/event-stream' \
--data '{
  "method": "tools/call",
  "params": {
    "name": "list_repositories",
    "arguments": {
      // provide these details according to the tool's MCP specification
    }
  },
  "jsonrpc": "2.0",
  "id": 1
}'
                

输入架构

ListRepositories 请求消息。

ListRepositoriesRequest

JSON 表示法
{
  "parent": string,
  "pageSize": integer,
  "pageToken": string,
  "orderBy": string,
  "filter": string
}
字段
parent

string

必需。要列出代码库的位置。必须采用 projects/*/locations/* 格式。

pageSize

integer

可选。要返回的仓库数量上限。服务器返回的项目数量可能少于请求的数量。如果未指定,服务器将选择合适的默认值。

pageToken

string

可选。从之前的 ListRepositories 调用接收的页面令牌。利用其进行后续页面检索。

进行分页时,提供给 ListRepositories 的所有其他参数(page_size 除外)必须与提供页面令牌的调用匹配。

orderBy

string

可选。此字段仅支持按 name 排序。如果未指定,服务器将选择排序方式。如果指定了此参数,则 name 字段的默认顺序为升序。

filter

string

可选。返回列表的过滤条件。

输出架构

ListRepositories 响应消息。

ListRepositoriesResponse

JSON 表示法
{
  "repositories": [
    {
      object (Repository)
    }
  ],
  "nextPageToken": string,
  "unreachable": [
    string
  ]
}
字段
repositories[]

object (Repository)

代码库列表。

nextPageToken

string

可作为 page_token 发送并用于检索下一页的令牌。如果省略此字段,则不存在后续页面。

unreachable[]

string

无法到达的位置。

代码库

JSON 表示法
{
  "name": string,
  "createTime": string,
  "displayName": string,
  "gitRemoteSettings": {
    object (GitRemoteSettings)
  },
  "npmrcEnvironmentVariablesSecretVersion": string,
  "workspaceCompilationOverrides": {
    object (WorkspaceCompilationOverrides)
  },
  "labels": {
    string: string,
    ...
  },
  "setAuthenticatedUserAdmin": boolean,
  "serviceAccount": string,
  "kmsKeyName": string,
  "dataEncryptionState": {
    object (DataEncryptionState)
  },

  // Union field _containing_folder can be only one of the following:
  "containingFolder": string
  // End of list of possible types for union field _containing_folder.

  // Union field _team_folder_name can be only one of the following:
  "teamFolderName": string
  // End of list of possible types for union field _team_folder_name.

  // Union field _internal_metadata can be only one of the following:
  "internalMetadata": string
  // End of list of possible types for union field _internal_metadata.
}
字段
name

string

标识符。代码库的名称。

createTime

string (Timestamp format)

仅限输出。相应代码库的创建时间戳。

采用 RFC 3339 标准,生成的输出将始终进行 Z 规范化(即转换为 UTC 零时区格式并在末尾附加 Z),并使用 0、3、6 或 9 个小数位。不带“Z”的偏差时间也是可以接受的。示例:"2014-10-02T15:01:23Z""2014-10-02T15:01:23.045123456Z""2014-10-02T15:01:23+05:30"

displayName

string

可选。代码库的简单易懂的名称。

gitRemoteSettings

object (GitRemoteSettings)

可选。如果设置,则将此代码库配置为与 Git 远程库相关联。

npmrcEnvironmentVariablesSecretVersion

string

可选。要用于将变量插值到 .npmrc 文件中以进行软件包安装操作的 Secret Manager Secret 版本的名称。必须采用 projects/*/secrets/*/versions/* 格式。文件本身必须采用 JSON 格式。

workspaceCompilationOverrides

object (WorkspaceCompilationOverrides)

可选。如果设置,则在创建工作区范围的编译结果时,workspace_compilation_overrides 的字段会替换 dataform.json 中指定的默认编译设置。如需了解详情,请参阅 WorkspaceCompilationOverrides 的文档。

labels

map (key: string, value: string)

可选。代码库用户标签。

包含一系列 "key": value 对的对象。示例:{ "name": "wrench", "mass": "1.3kg", "count": "3" }

setAuthenticatedUserAdmin

boolean

可选。仅限输入。如果设置为 true,则向经过身份验证的用户授予所创建代码库的 roles/dataform.admin 角色。如需稍后修改对已创建仓库的访问权限,请应用来自 https://cloud.google.com/dataform/reference/rest#rest-resource:-v1beta1.projects.locations.repositories 的 setIamPolicy

serviceAccount

string

可选。用于运行工作流调用的服务账号。

kmsKeyName

string

可选。对 KMS 加密密钥的引用。如果提供,则将用于加密资源库和所有子资源中的用户数据。创建代码库后,无法添加或更新加密密钥。示例:projects/{kms_project}/locations/{location}/keyRings/{key_location}/cryptoKeys/{key}

dataEncryptionState

object (DataEncryptionState)

仅限输出。相应 Git 代码库的数据加密状态(如果该代码库受 KMS 密钥保护)。

联合字段 _containing_folder

_containing_folder 只能是下列其中一项:

containingFolder

string

可选。代码库的父文件夹的名称。该字段不可变,可以通过 MoveRepository 操作进行修改。格式:projects/*/locations/*/folders/*。或 projects/*/locations/*/teamFolders/*

联合字段 _team_folder_name

_team_folder_name 只能是下列其中一项:

teamFolderName

string

仅限输出。相应代码库所关联的团队文件夹的资源名称。此参数应采用以下格式:projects/{project}/locations/{location}/teamFolders/{teamFolder}。如果未设置此属性,则代码库不会与 TeamFolder 相关联。

联合字段 _internal_metadata

_internal_metadata 只能是下列其中一项:

internalMetadata

string

仅限输出。用于在内部提供资源的所有元数据信息。例如:时间戳、标志、状态字段等。此字段的格式为 JSON 字符串。

时间戳

JSON 表示法
{
  "seconds": string,
  "nanos": integer
}
字段
seconds

string (int64 format)

表示世界协调时间 (UTC) 的秒数(从 Unix 纪元 1970-01-01T00:00:00Z 开始算起)。必须介于 -62135596800 到 253402300799 之间(含边界值),对应于 0001-01-01T00:00:00Z 到 9999-12-31T23:59:59Z。

nanos

integer

秒数的非负小数部分(以纳秒为单位)。此字段是时长的纳秒部分,而不是秒的替代项。对于含小数部分的负秒数,仍必须包含按时间递升的非负纳秒值。必须在 0 到 999,999,999 之间(含边界值)。

GitRemoteSettings

JSON 表示法
{
  "url": string,
  "defaultBranch": string,
  "effectiveDefaultBranch": string,
  "authenticationTokenSecretVersion": string,
  "sshAuthenticationConfig": {
    object (SshAuthenticationConfig)
  },
  "tokenStatus": enum (TokenStatus),

  // Union field _git_repository_link can be only one of the following:
  "gitRepositoryLink": string
  // End of list of possible types for union field _git_repository_link.
}
字段
url

string

必需。Git 远程代码库的网址。

defaultBranch

string

可选。Git 远程代码库的默认分支名称。如果未设置,则使用 main

effectiveDefaultBranch

string

仅限输出。Git 远程代码库的有效默认分支名称。这是 Git 远程代码库的默认分支名称(如果已设置),否则为 main

authenticationTokenSecretVersion

string

可选。要用作 Git 操作的身份验证令牌的 Secret Manager 密文版本的名称。必须采用 projects/*/secrets/*/versions/* 格式。

sshAuthenticationConfig

object (SshAuthenticationConfig)

可选。使用 SSH 协议的远程 URI 的身份验证字段。

tokenStatus
(deprecated)

enum (TokenStatus)

仅限输出。已弃用:相应字段不包含任何令牌状态信息。请改用 https://cloud.google.com/dataform/reference/rest/v1beta1/projects.locations.repositories/computeAccessTokenStatus

联合字段 _git_repository_link

_git_repository_link 只能是下列其中一项:

gitRepositoryLink

string

可选。用于机器凭据的 GitRepositoryLink 的资源名称。必须采用 projects/*/locations/*/connections/*/gitRepositoryLinks/* 格式

SshAuthenticationConfig

JSON 表示法
{
  "userPrivateKeySecretVersion": string,
  "hostPublicKey": string
}
字段
userPrivateKeySecretVersion

string

必需。要用作 Git 操作的 SSH 私钥的 Secret Manager 密文版本的名称。必须采用 projects/*/secrets/*/versions/* 格式。

hostPublicKey

string

必需。用于验证远程 Git 主机身份的 SSH 公钥的内容。

WorkspaceCompilationOverrides

JSON 表示法
{
  "defaultDatabase": string,
  "schemaSuffix": string,
  "tablePrefix": string
}
字段
defaultDatabase

string

可选。默认数据库(Google Cloud 项目 ID)。

schemaSuffix

string

可选。应附加到所有架构(BigQuery 数据集 ID)名称的后缀。

tablePrefix

string

可选。应附加到所有表名称的前缀。

LabelsEntry

JSON 表示法
{
  "key": string,
  "value": string
}
字段
key

string

value

string

DataEncryptionState

JSON 表示法
{
  "kmsKeyVersionName": string
}
字段
kmsKeyVersionName

string

必需。用于加密资源数据的 KMS 密钥版本名称。

TokenStatus

身份验证令牌的状态。

枚举
TOKEN_STATUS_UNSPECIFIED 默认值。此值未使用。
NOT_FOUND 在 Secret Manager 中找不到令牌(或者 Dataform 服务账号无权访问该令牌)。
INVALID 该令牌无法用于针对 Git 远程服务器进行身份验证。
VALID 令牌已成功用于针对 Git 远程服务器进行身份验证。

工具注释

破坏性提示:❌ | 等幂性提示:✅ | 只读提示:✅ | 开放世界提示:❌