【发布时间】:2014-09-26 10:43:59
【问题描述】:
我正在尝试使用 REST API 和服务器应用程序的公共 api 密钥列出 Compute Engine 项目中的所有实例。尝试使用和不使用授权标头,但不断收到响应 401:
APIKEY="API KEY"
PROJECT="PROJECT ID"
curl https://www.googleapis.com/compute/v1/projects/$PROJECT/aggregated/instances?key=$APIKEY
curl -H "Authorization: key=$APIKEY" https://www.googleapis.com/compute/v1/projects/$PROJECT/aggregated/instances?key=$APIKEY
我在创建 api 密钥时允许任何 IP 连接。我错过了什么?
【问题讨论】: