Google compute engine googleapi:获取了HTTP响应代码404,未找到正文
当我试图使用Golang“libretto”的库从脚本实例VM时,我遇到了这个问题Google compute engine googleapi:获取了HTTP响应代码404,未找到正文,google-compute-engine,Google Compute Engine,当我试图使用Golang“libretto”的库从脚本实例VM时,我遇到了这个问题 vm := &gcp.VM{ Name: "test-vm-2", Zone: "us-central1-f", MachineType: "n1-standard-1", SourceImage: "centos-7-v20181011", Disks: []gcp.Disk{ { DiskTyp
vm := &gcp.VM{
Name: "test-vm-2",
Zone: "us-central1-f",
MachineType: "n1-standard-1",
SourceImage: "centos-7-v20181011",
Disks: []gcp.Disk{
{
DiskType: "pd-standard",
DiskSizeGb: 10,
AutoDelete: true,
},
},
Preemptible: false,
Network: "default",
Subnetwork: "default",
UseInternalIP: false,
Project: os.Getenv(accountFile.ProjectID),
Scopes: []string {
"https://www.googleapis.com/auth/devstorage.read_write",
"https://www.googleapis.com/auth/logging.write",
},
AccountFile: "key.json",
SSHCreds: ssh.Credentials {
SSHUser: "VinCur",
SSHPrivateKey: accountFile.PrivateKey,
},
SSHPublicKey: pub_ssh,
}
这是代码…一些解决方案