通过GCP控制台创建非托管实例组时,我可以看到REST请求为:
POST https://www.googleapis.com/compute/v1/projects/my-project/zones/us-east1-d/instanceGroups
{
"name": "ig-web",
"network": "https://www.googleapis.com/compute/v1/projects/my-project/global/networks/nomad-network",
"namedPorts": [
{
"name": "http",
"port": 11080
}
]
}
但是,according to the API docs和client library generated code,无法设置network
网址。
有人在意澄清吗?
答案 0 :(得分:0)
这实际上是一个文档错误。以下内容适用:
op, err := gce.service.InstanceGroups.Insert(projectID, zone, &compute.InstanceGroup{
Name: name,
NamedPorts: namedPorts,
Network: networkURL}).Do()