【发布时间】:2020-07-16 09:56:52
【问题描述】:
云控制台提供了从 GitHub 镜像存储库的接口。
当您使用此功能时,它会在可从 API 读取的存储库上创建一个 mirrorConfig。然而,API 本身似乎没有提供写入此配置的方法。
尝试使用 mirrorConfig 创建存储库时的示例
{
"error": {
"code": 400,
"message": "Request contains an invalid argument.",
"status": "INVALID_ARGUMENT",
"details": [
{
"@type": "type.googleapis.com/google.rpc.BadRequest",
"fieldViolations": [
{
"field": "repo.mirror_config",
"description": "mirror_config is a read-only field and must not be set"
}
]
},
{
"@type": "type.googleapis.com/google.rpc.RequestInfo",
"requestId": "*****"
}
]
}
}
有没有办法在 Google Cloud Platform 中以编程方式创建镜像源代码库?
【问题讨论】:
-
Cloud Source Repositories API 确实提供了Method: projects.repos.create,但没有从 GitHub 镜像的方法。而是使用 Cloud Console GUI 来设置镜像:Mirror a GitHub repository。如果这是一个功能请求,您应该在Public Issue Tracker 中打开它。
标签: github google-cloud-platform google-source-repositories