我正在尝试使用API网关,但无法启用apigateway.googleapis.com API。
它没有显示在gcloud services list
中。我正在尝试遵循gcp doc的说明。 https://cloud.google.com/api-gateway/docs/configure-dev-env#enabling_required_services
当尝试在gcloud中启用它时,它返回如下错误。
gcloud services enable apigateway.googleapis.com ERROR: (gcloud.services.enable) PERMISSION_DENIED: The caller does not have permission
由于无法找到与apigateway相关的角色,所以无法附加角色。 由于没有相关政策,我无法创建自定义角色。
有什么办法可以解决这个问题?
答案 0 :(得分:1)
要启用“ API Gateway API”,您至少需要one of roles listed below:
您需要运行enable the service旁边的
gcloud services enable apigateway.googleapis.com
gcloud services enable servicemanagement.googleapis.com
gcloud services enable servicecontrol.googleapis.com
输出应该看起来像这样:
wb@cloudshell:~ (wojtek)$ gcloud services enable apigateway.googleapis.com
Operation "operations/acf.f02abf75-b8c8-xxxx-b639-d1e69ed2c4c5" finished successfully.
wb@cloudshell:~ (wojtek)$ gcloud services enable servicemanagement.googleapis.com
Operation "operations/acf.faab3e15-7eb2-xxxx-8b34-2073f7f3518f" finished successfully.
wb@cloudshell:~ (wojtek)$ gcloud services enable servicecontrol.googleapis.com
Operation "operations/acf.faab3e15-7eb2-xxxx-8b34-2073f7f3518f" finished successfully.