我正在尝试使用服务帐户和密钥文件调用预算API,但出现此错误:
PERMISSION_DENIED:呼叫者没有权限
async function listBillingAccounts() {
const [account] = await client.getBillingAccount({ name: `billingAccounts/${BILLING_ACCOUNT_ID}` });
console.info({ account });
}
listBillingAccounts();
gcloud config set project my-project-id
键 | 值 |
---|---|
GOOGLE_APPLICATION_CREDENTIALS | path \ to \ gcp-credentials.json |
GCP_PROJECT | 我的项目编号 |
当我转到https://console.cloud.google.com/iam-admin/iam?project=my-project-id时,它将在表中显示服务帐户:
会员 | 名称 | 角色 | 遗产 |
---|---|---|---|
[email protected] | 所有者 | 所有者 | 我的项目编号 |
我不知道下一步该怎么做。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句