בקרת גישה לממשקי Cloud Billing API

ב-Google Cloud יש ממשק לניהול זהויות והרשאות גישה (IAM), שדרכו אתם יכולים לתת למשתמשי Google Cloud גישה למשאבים ספציפיים. ממשק IAM עוזר לכם ליישם את העקרון של הרשאות מינימליות ולתת למשתמשים רק את רמת הגישה שהם צריכים למשאבים ולא יותר.

באמצעות כללי המדיניות ב-IAM תוכלו לקבוע למי (משתמשים) יהיו הרשאות גישה (תפקידים) למשאבים מסוימים. התפקידים שאתם מקצים למשתמשים באמצעות כללי המדיניות קובעים אילו הרשאות יהיו להם.

בדף הזה מוסבר אילו תפקידים של IAM זמינים בממשקי Cloud Billing API. לדוגמה, דרך IAM אתם יכולים לתת בחשבון לחיוב ב-Cloud תפקידים כמו "ניהול עלויות בחשבון לחיוב" או "צפייה בחשבון לחיוב". למידע מפורט על IAM והמאפיינים שלו, תוכלו לעיין במסמכי העזרה של IAM. תוכלו לקרוא בהם גם איך מנהלים את הגישה לפרויקטים, לתיקיות ולארגונים ואיך מנהלים את הגישה למשאבים אחרים.

הרשאות ותפקידים

כדי שמשתמש יוכל לראות במסוףGoogle Cloud את פרטי החשבון לחיוב ב-Cloud, או כדי שה-method מ-Cloud Billing API תחזיר את פרטי החשבון לחיוב ב-Cloud, למשתמש או למבצע הקריאה החוזרת (caller) צריכות להיות ההרשאות הנדרשות.

ההרשאות הנדרשות ל-Cloud Billing Catalog API

אין צורך בהרשאות כדי להשתמש ב-Cloud Billing Catalog API (רשימות השירותים והמק"טים). כל הנתונים ב-API הזה ציבוריים.

ההרשאות שנדרשות ל-Cloud Billing Budget API

בטבלה הבאה מפורטות ההרשאות הנדרשות כדי לקרוא לכל method של Cloud Billing Budget API. בטבלה מופיעים גם התפקידים הרגילים של חיוב ב-IAM שמעניקים את ההרשאות האלו באופן אוטומטי.

ה-Method ב-API ההרשאה שנדרשת התפקיד ב-IAM שנותן את ההרשאות הנדרשות
GetBudget כדי להציג את פרטי התקציב, למבצע הקריאה החוזרת (caller) צריכה להיות ההרשאה billing.budgets.get בחשבון לחיוב ב-Cloud שהתקציב משויך אליו.

בתקציבים שמשויכים רק לפרויקט אחד, במקום הרשאות בחשבון לחיוב, למבצע הקריאה החוזרת יכולות להיות ההרשאות resourcemanager.projects.get ו-billing.resourcebudgets.read.

"אדמין של חשבון לחיוב", "ניהול עלויות בחשבון לחיוב" או "צפייה בחשבון לחיוב" בחשבון שאליו משויך התקציב.

בתקציבים שמשויכים רק לפרויקט אחד, התפקידים "בעלי הפרויקט", "עריכת פרויקטים" או "צפייה בפרויקטים".

ListBudgets כדי להחזיר רשימה של תקציבים ששויכו לחשבון לחיוב ב-Cloud, למבצע הקריאה החוזרת צריכה להיות ההרשאה billing.budgets.list בחשבון לחיוב ב-Cloud.

בתקציבים שמשויכים רק לפרויקט אחד, במקום הרשאות בחשבון לחיוב, למבצע הקריאה החוזרת יכולות להיות ההרשאות resourcemanager.projects.get ו-billing.resourcebudgets.read.

"אדמין של חשבון לחיוב", "ניהול עלויות בחשבון לחיוב" או "צפייה בחשבון לחיוב" בחשבון שאליו משויך התקציב.

בתקציבים שמשויכים רק לפרויקט אחד, התפקידים "בעלי הפרויקט", "עריכת פרויקטים" או "צפייה בפרויקטים".

CreateBudget כדי ליצור תקציב חדש, למבצע הקריאה החוזרת צריכה להיות ההרשאה billing.budgets.create בחשבון לחיוב ב-Cloud שהתקציב משויך אליו.

בתקציבים שמשויכים רק לפרויקט אחד, במקום הרשאות לחשבון לחיוב, למבצע הקריאה החוזרת יכולות להיות ההרשאות resourcemanager.projects.get,‏ billing.resourcebudgets.read ו-billing.resourcebudgets.write בפרויקט.

"אדמין של חשבון לחיוב" או "ניהול עלויות בחשבון לחיוב" בחשבון שאליו משויך התקציב.

בתקציבים שמשויכים רק לפרויקט אחד, התפקידים "בעלי הפרויקט" או "עריכת פרויקטים".

UpdateBudget כדי לעדכן תקציב קיים, למבצע הקריאה החוזרת צריכה להיות ההרשאה billing.budgets.update בחשבון לחיוב ב-Cloud שאליו משויך התקציב.

בתקציבים שמשויכים רק לפרויקט אחד, במקום הרשאות לחשבון לחיוב, למבצע הקריאה החוזרת יכולות להיות ההרשאות resourcemanager.projects.get,‏ billing.resourcebudgets.read ו-billing.resourcebudgets.write בפרויקט.

"אדמין של חשבון לחיוב" או "ניהול עלויות בחשבון לחיוב" בחשבון שאליו משויך התקציב.

בתקציבים שמשויכים רק לפרויקט אחד, התפקידים "בעלי הפרויקט" או "עריכת פרויקטים".

DeleteBudget כדי למחוק תקציב קיים, למבצע הקריאה החוזרת צריכה להיות ההרשאה billing.budgets.delete בחשבון לחיוב ב-Cloud שאליו משויך התקציב.

בתקציבים שמשויכים רק לפרויקט אחד, במקום הרשאות לחשבון לחיוב, למבצע הקריאה החוזרת יכולות להיות ההרשאות resourcemanager.projects.get,‏ billing.resourcebudgets.read ו-billing.resourcebudgets.write בפרויקט.

"אדמין של חשבון לחיוב" או "ניהול עלויות בחשבון לחיוב" בחשבון שאליו משויך התקציב.

בתקציבים שמשויכים רק לפרויקט אחד, התפקידים "בעלי הפרויקט" או "עריכת פרויקטים".

ההרשאות שנדרשות ל-Cloud Billing Account API

פירטנו כאן בטבלה את כל ההרשאות שנדרשות כדי להפעיל כל method ב-Cloud Billing Account API, יחד עם תפקידי IAM לחיוב ב-Cloud שנותנים את ההרשאות האלה.

ה-Method ב-API ההרשאות הנדרשות תפקידי IAM שכוללים את ההרשאה
billingAccounts.create השיטה הזו משמשת ליצירת חשבונות משניים חדשים לחיוב ב-Cloud למבצע הקריאה החוזרת צריכה להיות ההרשאה billing.accounts.update בחשבון המשני לחיוב ב-Cloud. אדמין של חשבון לחיוב
billingAccounts.get billing.accounts.get בחשבון לחיוב ב-Cloud. אדמין של חשבון לחיוב, ניהול עלויות בחשבון לחיוב, צפייה בחשבון לחיוב או משתמש בחשבון לחיוב
billingAccounts.list אין. ה-method הזה מחזיר את כל החשבונות שמבצע הקריאה החוזרת (caller) רשאי לגשת אליהם. אדמין של חשבון לחיוב, ניהול עלויות בחשבון לחיוב, צפייה בחשבון לחיוב או משתמש בחשבונות לחיוב ב-Cloud או ניהול החיוב בפרויקטים.
billingAccounts.getIamPolicy billing.accounts.getIamPolicy בחשבון לחיוב ב-Cloud. אדמין של חשבון לחיוב, ניהול עלויות בחשבון לחיוב, צפייה בחשבון לחיוב או משתמש בחשבון לחיוב
billingAccounts.setIamPolicy billing.accounts.setIamPolicy בחשבון לחיוב ב-Cloud. אדמין של חשבון לחיוב
billingAccounts.testIamPermissions אין. השיטה הזו משמשת לקביעת ההרשאות שיש למבצע קריאה חוזרת בחשבון לחיוב ב-Cloud. לא רלוונטי
billingAccounts.patch billing.accounts.update בחשבון לחיוב ב-Cloud. אדמין של חשבון לחיוב
billingAccounts.projects.list billing.resourceAssociations.list בחשבון לחיוב ב-Cloud. אדמין של חשבון לחיוב, ניהול עלויות בחשבון לחיוב או צפייה בחשבון לחיוב
projects.getBillingInfo resourcemanager.projects.get בפרויקט.
מידע נוסף זמין במאמר בקרת גישה לפרויקטים.
בעלי הפרויקט, עריכה בפרויקט או צפייה בפרויקט
projects.updateBillingInfo billing.resourceAssociations.create בחשבון לחיוב ב-Cloud וגם resourcemanager.projects.createBillingAssignment בפרויקט. אדמין של חשבון לחיוב או משתמש בחשבון לחיוב, וגם ניהול החיוב בפרויקט

תפקידים

המשתמשים לא מקבלים הרשאות בצורה ישירה. כדי להעניק להם הרשאות, צריך להקצות להם תפקידים שמוגדרת להם הרשאה אחת או יותר.

אפשר להקצות תפקיד אחד או יותר באותו משאב.

בטבלה הבאה מפורטים: 1) התפקידים הרגילים ב-IAM שתוכלו להעניק כדי לתת גישה לממשקי Cloud Billing API;‏ 2) התיאור של התפקידים; ו-3) ההרשאות שמוגדרות להם. חלק מהתפקידים כוללים הרשאות גם לשירותים אחרים של Google Cloud .

Role Permissions

(roles/billing.admin)

Provides access to see and manage all aspects of billing accounts.

Lowest-level resources where you can grant this role:

  • Billing Account

billing.accounts.close

billing.accounts.get

billing.accounts.getCarbonInformation

billing.accounts.getIamPolicy

billing.accounts.getPaymentInfo

billing.accounts.getPricing

billing.accounts.getSpendingInformation

billing.accounts.getUsageExportSpec

billing.accounts.list

billing.accounts.move

billing.accounts.redeemPromotion

billing.accounts.removeFromOrganization

billing.accounts.reopen

billing.accounts.setIamPolicy

billing.accounts.update

billing.accounts.updatePaymentInfo

billing.accounts.updateUsageExportSpec

billing.anomalies.*

  • billing.anomalies.get
  • billing.anomalies.list
  • billing.anomalies.submitFeedback

billing.anomaliesConfigs.*

  • billing.anomaliesConfigs.get
  • billing.anomaliesConfigs.update

billing.billingAccountPrice.get

billing.billingAccountPrices.list

billing.billingAccountServices.*

  • billing.billingAccountServices.get
  • billing.billingAccountServices.list

billing.billingAccountSkuGroupSkus.*

  • billing.billingAccountSkuGroupSkus.get
  • billing.billingAccountSkuGroupSkus.list

billing.billingAccountSkuGroups.*

  • billing.billingAccountSkuGroups.get
  • billing.billingAccountSkuGroups.list

billing.billingAccountSkus.*

  • billing.billingAccountSkus.get
  • billing.billingAccountSkus.list

billing.budgets.*

  • billing.budgets.create
  • billing.budgets.delete
  • billing.budgets.get
  • billing.budgets.list
  • billing.budgets.update

billing.credits.list

billing.finOpsBenchmarkInformation.get

billing.finOpsHealthInformation.get

billing.resourceAssociations.*

  • billing.resourceAssociations.create
  • billing.resourceAssociations.delete
  • billing.resourceAssociations.list

billing.subscriptions.*

  • billing.subscriptions.create
  • billing.subscriptions.get
  • billing.subscriptions.list
  • billing.subscriptions.update

cloudasset.assets.searchAllResources

cloudnotifications.activities.list

cloudsupport.properties.get

cloudsupport.techCases.*

  • cloudsupport.techCases.create
  • cloudsupport.techCases.escalate
  • cloudsupport.techCases.get
  • cloudsupport.techCases.list
  • cloudsupport.techCases.update

commerceoffercatalog.*

  • commerceoffercatalog.agreements.get
  • commerceoffercatalog.agreements.list
  • commerceoffercatalog.documents.get
  • commerceoffercatalog.documents.list
  • commerceoffercatalog.offers.get

compute.commitments.*

  • compute.commitments.create
  • compute.commitments.get
  • compute.commitments.list
  • compute.commitments.update
  • compute.commitments.updateReservations

consumerprocurement.accounts.*

  • consumerprocurement.accounts.create
  • consumerprocurement.accounts.delete
  • consumerprocurement.accounts.get
  • consumerprocurement.accounts.list

consumerprocurement.consents.check

consumerprocurement.consents.grant

consumerprocurement.consents.list

consumerprocurement.consents.revoke

consumerprocurement.events.*

  • consumerprocurement.events.get
  • consumerprocurement.events.list

consumerprocurement.licensePools.*

  • consumerprocurement.licensePools.assign
  • consumerprocurement.licensePools.enumerateLicensedUsers
  • consumerprocurement.licensePools.get
  • consumerprocurement.licensePools.unassign
  • consumerprocurement.licensePools.update

consumerprocurement.orderAttributions.*

  • consumerprocurement.orderAttributions.get
  • consumerprocurement.orderAttributions.list
  • consumerprocurement.orderAttributions.update

consumerprocurement.orders.*

  • consumerprocurement.orders.cancel
  • consumerprocurement.orders.get
  • consumerprocurement.orders.list
  • consumerprocurement.orders.modify
  • consumerprocurement.orders.place

dataprocessing.datasources.get

dataprocessing.datasources.list

dataprocessing.groupcontrols.get

dataprocessing.groupcontrols.list

logging.logEntries.list

logging.logServiceIndexes.list

logging.logServices.list

logging.logs.list

logging.privateLogEntries.list

recommender.cloudsqlIdleInstanceRecommendations.get

recommender.cloudsqlIdleInstanceRecommendations.list

recommender.cloudsqlOverprovisionedInstanceRecommendations.get

recommender.cloudsqlOverprovisionedInstanceRecommendations.list

recommender.commitmentUtilizationInsights.*

  • recommender.commitmentUtilizationInsights.get
  • recommender.commitmentUtilizationInsights.list
  • recommender.commitmentUtilizationInsights.update

recommender.computeAddressIdleResourceRecommendations.get

recommender.computeAddressIdleResourceRecommendations.list

recommender.computeDiskIdleResourceRecommendations.get

recommender.computeDiskIdleResourceRecommendations.list

recommender.computeImageIdleResourceRecommendations.get

recommender.computeImageIdleResourceRecommendations.list

recommender.computeInstanceGroupManagerMachineTypeRecommendations.get

recommender.computeInstanceGroupManagerMachineTypeRecommendations.list

recommender.computeInstanceIdleResourceRecommendations.get

recommender.computeInstanceIdleResourceRecommendations.list

recommender.computeInstanceMachineTypeRecommendations.get

recommender.computeInstanceMachineTypeRecommendations.list

recommender.costInsights.*

  • recommender.costInsights.get
  • recommender.costInsights.list
  • recommender.costInsights.update

recommender.costRecommendations.*

  • recommender.costRecommendations.listAll
  • recommender.costRecommendations.summarizeAll

recommender.resourcemanagerProjectUtilizationRecommendations.get

recommender.resourcemanagerProjectUtilizationRecommendations.list

recommender.spendBasedCommitmentInsights.*

  • recommender.spendBasedCommitmentInsights.get
  • recommender.spendBasedCommitmentInsights.list
  • recommender.spendBasedCommitmentInsights.update

recommender.spendBasedCommitmentRecommendations.*

  • recommender.spendBasedCommitmentRecommendations.get
  • recommender.spendBasedCommitmentRecommendations.list
  • recommender.spendBasedCommitmentRecommendations.update

recommender.spendBasedCommitmentRecommenderConfig.*

  • recommender.spendBasedCommitmentRecommenderConfig.get
  • recommender.spendBasedCommitmentRecommenderConfig.update

recommender.usageCommitmentRecommendations.*

  • recommender.usageCommitmentRecommendations.get
  • recommender.usageCommitmentRecommendations.list
  • recommender.usageCommitmentRecommendations.update

resourcemanager.projects.createBillingAssignment

resourcemanager.projects.deleteBillingAssignment

resourcemanager.projects.get

resourcemanager.projects.list

(roles/billing.costsManager)

Manage budgets for a billing account, and view, analyze, and export cost information of a billing account.

Lowest-level resources where you can grant this role:

  • Billing Account

billing.accounts.get

billing.accounts.getIamPolicy

billing.accounts.getSpendingInformation

billing.accounts.getUsageExportSpec

billing.accounts.list

billing.accounts.updateUsageExportSpec

billing.anomalies.get

billing.anomalies.list

billing.anomaliesConfigs.*

  • billing.anomaliesConfigs.get
  • billing.anomaliesConfigs.update

billing.budgets.*

  • billing.budgets.create
  • billing.budgets.delete
  • billing.budgets.get
  • billing.budgets.list
  • billing.budgets.update

billing.resourceAssociations.list

recommender.costInsights.*

  • recommender.costInsights.get
  • recommender.costInsights.list
  • recommender.costInsights.update

(roles/billing.creator)

Provides access to create billing accounts.

Lowest-level resources where you can grant this role:

  • Organization

billing.accounts.create

resourcemanager.organizations.get

(roles/billing.projectManager)

When granted in conjunction with the Billing Account User role, provides access to assign a project's billing account or disable its billing.

Lowest-level resources where you can grant this role:

  • Project

resourcemanager.projects.createBillingAssignment

resourcemanager.projects.deleteBillingAssignment

(roles/billing.user)

When granted in conjunction with the Project Owner role or Project Billing Manager role, provides access to associate projects with billing accounts.

Lowest-level resources where you can grant this role:

  • Billing Account

billing.accounts.get

billing.accounts.getIamPolicy

billing.accounts.list

billing.accounts.redeemPromotion

billing.credits.list

billing.resourceAssociations.create

(roles/billing.viewer)

View billing account cost and pricing information, transactions, and billing and commitment recommendations.

Lowest-level resources where you can grant this role:

  • Billing Account

billing.accounts.get

billing.accounts.getCarbonInformation

billing.accounts.getIamPolicy

billing.accounts.getPaymentInfo

billing.accounts.getPricing

billing.accounts.getSpendingInformation

billing.accounts.getUsageExportSpec

billing.accounts.list

billing.anomalies.get

billing.anomalies.list

billing.anomaliesConfigs.get

billing.billingAccountPrice.get

billing.billingAccountPrices.list

billing.billingAccountServices.*

  • billing.billingAccountServices.get
  • billing.billingAccountServices.list

billing.billingAccountSkuGroupSkus.*

  • billing.billingAccountSkuGroupSkus.get
  • billing.billingAccountSkuGroupSkus.list

billing.billingAccountSkuGroups.*

  • billing.billingAccountSkuGroups.get
  • billing.billingAccountSkuGroups.list

billing.billingAccountSkus.*

  • billing.billingAccountSkus.get
  • billing.billingAccountSkus.list

billing.budgets.get

billing.budgets.list

billing.credits.list

billing.finOpsBenchmarkInformation.get

billing.finOpsHealthInformation.get

billing.resourceAssociations.list

billing.subscriptions.get

billing.subscriptions.list

commerceoffercatalog.*

  • commerceoffercatalog.agreements.get
  • commerceoffercatalog.agreements.list
  • commerceoffercatalog.documents.get
  • commerceoffercatalog.documents.list
  • commerceoffercatalog.offers.get

consumerprocurement.accounts.get

consumerprocurement.accounts.list

consumerprocurement.consents.check

consumerprocurement.consents.list

consumerprocurement.orderAttributions.get

consumerprocurement.orderAttributions.list

consumerprocurement.orders.get

consumerprocurement.orders.list

dataprocessing.datasources.get

dataprocessing.datasources.list

dataprocessing.groupcontrols.get

dataprocessing.groupcontrols.list

recommender.commitmentUtilizationInsights.get

recommender.commitmentUtilizationInsights.list

recommender.costInsights.get

recommender.costInsights.list

recommender.costRecommendations.*

  • recommender.costRecommendations.listAll
  • recommender.costRecommendations.summarizeAll

recommender.spendBasedCommitmentInsights.get

recommender.spendBasedCommitmentInsights.list

recommender.spendBasedCommitmentRecommendations.get

recommender.spendBasedCommitmentRecommendations.list

recommender.spendBasedCommitmentRecommenderConfig.get

recommender.usageCommitmentRecommendations.get

recommender.usageCommitmentRecommendations.list

שימו לב שהתפקידים roles/billing.admin,‏ roles/billing.costsManager,‏ roles/billing.viewer ו-roles/billing.projectManager כוללים הרשאות גם לשירותים אחרים של Google Cloud .