| Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1 | <html><body> |
| 2 | <style> |
| 3 | |
| 4 | body, h1, h2, h3, div, span, p, pre, a { |
| 5 | margin: 0; |
| 6 | padding: 0; |
| 7 | border: 0; |
| 8 | font-weight: inherit; |
| 9 | font-style: inherit; |
| 10 | font-size: 100%; |
| 11 | font-family: inherit; |
| 12 | vertical-align: baseline; |
| 13 | } |
| 14 | |
| 15 | body { |
| 16 | font-size: 13px; |
| 17 | padding: 1em; |
| 18 | } |
| 19 | |
| 20 | h1 { |
| 21 | font-size: 26px; |
| 22 | margin-bottom: 1em; |
| 23 | } |
| 24 | |
| 25 | h2 { |
| 26 | font-size: 24px; |
| 27 | margin-bottom: 1em; |
| 28 | } |
| 29 | |
| 30 | h3 { |
| 31 | font-size: 20px; |
| 32 | margin-bottom: 1em; |
| 33 | margin-top: 1em; |
| 34 | } |
| 35 | |
| 36 | pre, code { |
| 37 | line-height: 1.5; |
| 38 | font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; |
| 39 | } |
| 40 | |
| 41 | pre { |
| 42 | margin-top: 0.5em; |
| 43 | } |
| 44 | |
| 45 | h1, h2, h3, p { |
| 46 | font-family: Arial, sans serif; |
| 47 | } |
| 48 | |
| 49 | h1, h2, h3 { |
| 50 | border-bottom: solid #CCC 1px; |
| 51 | } |
| 52 | |
| 53 | .toc_element { |
| 54 | margin-top: 0.5em; |
| 55 | } |
| 56 | |
| 57 | .firstline { |
| 58 | margin-left: 2 em; |
| 59 | } |
| 60 | |
| 61 | .method { |
| 62 | margin-top: 1em; |
| 63 | border: solid 1px #CCC; |
| 64 | padding: 1em; |
| 65 | background: #EEE; |
| 66 | } |
| 67 | |
| 68 | .details { |
| 69 | font-weight: bold; |
| 70 | font-size: 14px; |
| 71 | } |
| 72 | |
| 73 | </style> |
| 74 | |
| 75 | <h1><a href="billingbudgets_v1beta1.html">Cloud Billing Budget API</a> . <a href="billingbudgets_v1beta1.billingAccounts.html">billingAccounts</a> . <a href="billingbudgets_v1beta1.billingAccounts.budgets.html">budgets</a></h1> |
| 76 | <h2>Instance Methods</h2> |
| 77 | <p class="toc_element"> |
| 78 | <code><a href="#create">create(parent, body=None, x__xgafv=None)</a></code></p> |
| 79 | <p class="firstline">Creates a new budget. See</p> |
| 80 | <p class="toc_element"> |
| 81 | <code><a href="#delete">delete(name, x__xgafv=None)</a></code></p> |
| 82 | <p class="firstline">Deletes a budget. Returns successfully if already deleted.</p> |
| 83 | <p class="toc_element"> |
| 84 | <code><a href="#get">get(name, x__xgafv=None)</a></code></p> |
| 85 | <p class="firstline">Returns a budget.</p> |
| 86 | <p class="toc_element"> |
| Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 87 | <code><a href="#list">list(parent, pageToken=None, pageSize=None, x__xgafv=None)</a></code></p> |
| Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 88 | <p class="firstline">Returns a list of budgets for a billing account.</p> |
| 89 | <p class="toc_element"> |
| 90 | <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p> |
| 91 | <p class="firstline">Retrieves the next page of results.</p> |
| 92 | <p class="toc_element"> |
| 93 | <code><a href="#patch">patch(name, body=None, x__xgafv=None)</a></code></p> |
| 94 | <p class="firstline">Updates a budget and returns the updated budget.</p> |
| 95 | <h3>Method Details</h3> |
| 96 | <div class="method"> |
| 97 | <code class="details" id="create">create(parent, body=None, x__xgafv=None)</code> |
| 98 | <pre>Creates a new budget. See |
| 99 | <a href="https://cloud.google.com/billing/quotas">Quotas and limits</a> |
| 100 | for more information on the limits of the number of budgets you can create. |
| 101 | |
| 102 | Args: |
| 103 | parent: string, Required. The name of the billing account to create the budget in. Values |
| 104 | are of the form `billingAccounts/{billingAccountId}`. (required) |
| 105 | body: object, The request body. |
| 106 | The object takes the form of: |
| 107 | |
| 108 | { # Request for CreateBudget |
| 109 | "budget": { # A budget is a plan that describes what you expect to spend on Cloud # Required. Budget to create. |
| 110 | # projects, plus the rules to execute as spend is tracked against that plan, |
| 111 | # (for example, send an alert when 90% of the target spend is met). |
| 112 | # Currently all plans are monthly budgets so the usage period(s) tracked are |
| 113 | # implied (calendar months of usage back-to-back). |
| Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 114 | "displayName": "A String", # User data for display name in UI. |
| 115 | # Validation: <= 60 chars. |
| Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 116 | "amount": { # The budgeted amount for each usage period. # Required. Budgeted amount. |
| 117 | "lastPeriodAmount": { # Describes a budget amount targeted to last period's spend. # Use the last period's actual spend as the budget for the present period. |
| 118 | # At this time, the amount is automatically 100% of last period's spend; |
| 119 | # that is, there are no other options yet. |
| 120 | # Future configuration will be described here (for example, configuring a |
| 121 | # percentage of last period's spend). |
| 122 | }, |
| 123 | "specifiedAmount": { # Represents an amount of money with its currency type. # A specified amount to use as the budget. |
| 124 | # `currency_code` is optional. If specified, it must match the |
| 125 | # currency of the billing account. The `currency_code` is provided on |
| 126 | # output. |
| Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 127 | "currencyCode": "A String", # The 3-letter currency code defined in ISO 4217. |
| Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 128 | "nanos": 42, # Number of nano (10^-9) units of the amount. |
| 129 | # The value must be between -999,999,999 and +999,999,999 inclusive. |
| 130 | # If `units` is positive, `nanos` must be positive or zero. |
| 131 | # If `units` is zero, `nanos` can be positive, zero, or negative. |
| 132 | # If `units` is negative, `nanos` must be negative or zero. |
| 133 | # For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. |
| Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 134 | "units": "A String", # The whole units of the amount. |
| 135 | # For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. |
| Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 136 | }, |
| 137 | }, |
| Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 138 | "name": "A String", # Output only. Resource name of the budget. |
| 139 | # The resource name implies the scope of a budget. Values are of the form |
| 140 | # `billingAccounts/{billingAccountId}/budgets/{budgetId}`. |
| 141 | "allUpdatesRule": { # AllUpdatesRule defines notifications that are sent based on budget spend # Optional. Rules to apply to notifications sent based on budget spend and thresholds. |
| 142 | # and thresholds. |
| 143 | "monitoringNotificationChannels": [ # Optional. Targets to send notifications to when a threshold is exceeded. This is in |
| 144 | # addition to default recipients who have billing account roles. |
| 145 | # The value is the full REST resource name of a monitoring notification |
| 146 | # channel with the form |
| 147 | # `projects/{project_id}/notificationChannels/{channel_id}`. A maximum of 5 |
| 148 | # channels are allowed. See |
| 149 | # https://cloud.google.com/billing/docs/how-to/budgets-notification-recipients |
| 150 | # for more details. |
| 151 | "A String", |
| 152 | ], |
| Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 153 | "pubsubTopic": "A String", # Required. The name of the Cloud Pub/Sub topic where budget related messages will be |
| 154 | # published, in the form `projects/{project_id}/topics/{topic_id}`. Updates |
| 155 | # are sent at regular intervals to the topic. |
| 156 | # The topic needs to be created before the budget is created; see |
| 157 | # https://cloud.google.com/billing/docs/how-to/budgets#manage-notifications |
| 158 | # for more details. |
| 159 | # Caller is expected to have |
| 160 | # `pubsub.topics.setIamPolicy` permission on the topic when it's set for a |
| 161 | # budget, otherwise, the API call will fail with PERMISSION_DENIED. See |
| Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 162 | # https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications |
| 163 | # for more details on Pub/Sub roles and permissions. |
| 164 | "schemaVersion": "A String", # Required. The schema version of the notification sent to `pubsub_topic`. |
| Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 165 | # Only "1.0" is accepted. It represents the JSON schema as defined in |
| Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 166 | # https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications#notification_format |
| Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 167 | }, |
| Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 168 | "budgetFilter": { # A filter for a budget, limiting the scope of the cost to calculate. # Optional. Filters that define which resources are used to compute |
| 169 | # the actual spend against the budget. |
| 170 | "projects": [ # Optional. A set of projects of the form `projects/{project}`, |
| 171 | # specifying that usage from only this set of projects should be |
| 172 | # included in the budget. If omitted, the report will include all usage for |
| 173 | # the billing account, regardless of which project the usage occurred on. |
| 174 | # Only zero or one project can be specified currently. |
| 175 | "A String", |
| 176 | ], |
| 177 | "subaccounts": [ # Optional. A set of subaccounts of the form `billingAccounts/{account_id}`, specifying |
| 178 | # that usage from only this set of subaccounts should be included in the |
| 179 | # budget. If a subaccount is set to the name of the parent account, |
| 180 | # usage from the parent account will be included. If omitted, the |
| 181 | # report will include usage from the parent account and all |
| 182 | # subaccounts, if they exist. |
| 183 | "A String", |
| 184 | ], |
| 185 | "creditTypesTreatment": "A String", # Optional. If not set, default behavior is `INCLUDE_ALL_CREDITS`. |
| 186 | "services": [ # Optional. A set of services of the form `services/{service_id}`, |
| 187 | # specifying that usage from only this set of services should be |
| 188 | # included in the budget. If omitted, the report will include usage for |
| 189 | # all the services. |
| 190 | # The service names are available through the Catalog API: |
| 191 | # https://cloud.google.com/billing/v1/how-tos/catalog-api. |
| 192 | "A String", |
| 193 | ], |
| 194 | "labels": { # Optional. A single label and value pair specifying that usage from only this set of |
| 195 | # labeled resources should be included in the budget. Currently, multiple |
| 196 | # entries or multiple values per entry are not allowed. If omitted, the |
| 197 | # report will include all labeled and unlabeled usage. |
| 198 | "a_key": [ |
| 199 | "", |
| 200 | ], |
| 201 | }, |
| 202 | }, |
| Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 203 | "thresholdRules": [ # Optional. Rules that trigger alerts (notifications of thresholds |
| 204 | # being crossed) when spend exceeds the specified percentages of the budget. |
| 205 | { # ThresholdRule contains a definition of a threshold which triggers |
| 206 | # an alert (a notification of a threshold being crossed) to be sent when |
| 207 | # spend goes above the specified amount. |
| 208 | # Alerts are automatically e-mailed to users with the Billing Account |
| 209 | # Administrator role or the Billing Account User role. |
| 210 | # The thresholds here have no effect on notifications sent to anything |
| 211 | # configured under `Budget.all_updates_rule`. |
| Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 212 | "spendBasis": "A String", # Optional. The type of basis used to determine if spend has passed the |
| 213 | # threshold. Behavior defaults to CURRENT_SPEND if not set. |
| Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 214 | "thresholdPercent": 3.14, # Required. Send an alert when this threshold is exceeded. |
| 215 | # This is a 1.0-based percentage, so 0.5 = 50%. |
| 216 | # Validation: non-negative number. |
| 217 | }, |
| 218 | ], |
| Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 219 | "etag": "A String", # Optional. Etag to validate that the object is unchanged for a |
| 220 | # read-modify-write operation. |
| 221 | # An empty etag will cause an update to overwrite other changes. |
| Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 222 | }, |
| 223 | } |
| 224 | |
| 225 | x__xgafv: string, V1 error format. |
| 226 | Allowed values |
| 227 | 1 - v1 error format |
| 228 | 2 - v2 error format |
| 229 | |
| 230 | Returns: |
| 231 | An object of the form: |
| 232 | |
| 233 | { # A budget is a plan that describes what you expect to spend on Cloud |
| 234 | # projects, plus the rules to execute as spend is tracked against that plan, |
| 235 | # (for example, send an alert when 90% of the target spend is met). |
| 236 | # Currently all plans are monthly budgets so the usage period(s) tracked are |
| 237 | # implied (calendar months of usage back-to-back). |
| Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 238 | "displayName": "A String", # User data for display name in UI. |
| 239 | # Validation: <= 60 chars. |
| Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 240 | "amount": { # The budgeted amount for each usage period. # Required. Budgeted amount. |
| 241 | "lastPeriodAmount": { # Describes a budget amount targeted to last period's spend. # Use the last period's actual spend as the budget for the present period. |
| 242 | # At this time, the amount is automatically 100% of last period's spend; |
| 243 | # that is, there are no other options yet. |
| 244 | # Future configuration will be described here (for example, configuring a |
| 245 | # percentage of last period's spend). |
| 246 | }, |
| 247 | "specifiedAmount": { # Represents an amount of money with its currency type. # A specified amount to use as the budget. |
| 248 | # `currency_code` is optional. If specified, it must match the |
| 249 | # currency of the billing account. The `currency_code` is provided on |
| 250 | # output. |
| Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 251 | "currencyCode": "A String", # The 3-letter currency code defined in ISO 4217. |
| Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 252 | "nanos": 42, # Number of nano (10^-9) units of the amount. |
| 253 | # The value must be between -999,999,999 and +999,999,999 inclusive. |
| 254 | # If `units` is positive, `nanos` must be positive or zero. |
| 255 | # If `units` is zero, `nanos` can be positive, zero, or negative. |
| 256 | # If `units` is negative, `nanos` must be negative or zero. |
| 257 | # For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. |
| Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 258 | "units": "A String", # The whole units of the amount. |
| 259 | # For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. |
| Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 260 | }, |
| 261 | }, |
| Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 262 | "name": "A String", # Output only. Resource name of the budget. |
| 263 | # The resource name implies the scope of a budget. Values are of the form |
| 264 | # `billingAccounts/{billingAccountId}/budgets/{budgetId}`. |
| 265 | "allUpdatesRule": { # AllUpdatesRule defines notifications that are sent based on budget spend # Optional. Rules to apply to notifications sent based on budget spend and thresholds. |
| 266 | # and thresholds. |
| 267 | "monitoringNotificationChannels": [ # Optional. Targets to send notifications to when a threshold is exceeded. This is in |
| 268 | # addition to default recipients who have billing account roles. |
| 269 | # The value is the full REST resource name of a monitoring notification |
| 270 | # channel with the form |
| 271 | # `projects/{project_id}/notificationChannels/{channel_id}`. A maximum of 5 |
| 272 | # channels are allowed. See |
| 273 | # https://cloud.google.com/billing/docs/how-to/budgets-notification-recipients |
| 274 | # for more details. |
| 275 | "A String", |
| 276 | ], |
| Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 277 | "pubsubTopic": "A String", # Required. The name of the Cloud Pub/Sub topic where budget related messages will be |
| 278 | # published, in the form `projects/{project_id}/topics/{topic_id}`. Updates |
| 279 | # are sent at regular intervals to the topic. |
| 280 | # The topic needs to be created before the budget is created; see |
| 281 | # https://cloud.google.com/billing/docs/how-to/budgets#manage-notifications |
| 282 | # for more details. |
| 283 | # Caller is expected to have |
| 284 | # `pubsub.topics.setIamPolicy` permission on the topic when it's set for a |
| 285 | # budget, otherwise, the API call will fail with PERMISSION_DENIED. See |
| Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 286 | # https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications |
| 287 | # for more details on Pub/Sub roles and permissions. |
| 288 | "schemaVersion": "A String", # Required. The schema version of the notification sent to `pubsub_topic`. |
| Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 289 | # Only "1.0" is accepted. It represents the JSON schema as defined in |
| Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 290 | # https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications#notification_format |
| Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 291 | }, |
| Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 292 | "budgetFilter": { # A filter for a budget, limiting the scope of the cost to calculate. # Optional. Filters that define which resources are used to compute |
| 293 | # the actual spend against the budget. |
| 294 | "projects": [ # Optional. A set of projects of the form `projects/{project}`, |
| 295 | # specifying that usage from only this set of projects should be |
| 296 | # included in the budget. If omitted, the report will include all usage for |
| 297 | # the billing account, regardless of which project the usage occurred on. |
| 298 | # Only zero or one project can be specified currently. |
| 299 | "A String", |
| 300 | ], |
| 301 | "subaccounts": [ # Optional. A set of subaccounts of the form `billingAccounts/{account_id}`, specifying |
| 302 | # that usage from only this set of subaccounts should be included in the |
| 303 | # budget. If a subaccount is set to the name of the parent account, |
| 304 | # usage from the parent account will be included. If omitted, the |
| 305 | # report will include usage from the parent account and all |
| 306 | # subaccounts, if they exist. |
| 307 | "A String", |
| 308 | ], |
| 309 | "creditTypesTreatment": "A String", # Optional. If not set, default behavior is `INCLUDE_ALL_CREDITS`. |
| 310 | "services": [ # Optional. A set of services of the form `services/{service_id}`, |
| 311 | # specifying that usage from only this set of services should be |
| 312 | # included in the budget. If omitted, the report will include usage for |
| 313 | # all the services. |
| 314 | # The service names are available through the Catalog API: |
| 315 | # https://cloud.google.com/billing/v1/how-tos/catalog-api. |
| 316 | "A String", |
| 317 | ], |
| 318 | "labels": { # Optional. A single label and value pair specifying that usage from only this set of |
| 319 | # labeled resources should be included in the budget. Currently, multiple |
| 320 | # entries or multiple values per entry are not allowed. If omitted, the |
| 321 | # report will include all labeled and unlabeled usage. |
| 322 | "a_key": [ |
| 323 | "", |
| 324 | ], |
| 325 | }, |
| 326 | }, |
| Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 327 | "thresholdRules": [ # Optional. Rules that trigger alerts (notifications of thresholds |
| 328 | # being crossed) when spend exceeds the specified percentages of the budget. |
| 329 | { # ThresholdRule contains a definition of a threshold which triggers |
| 330 | # an alert (a notification of a threshold being crossed) to be sent when |
| 331 | # spend goes above the specified amount. |
| 332 | # Alerts are automatically e-mailed to users with the Billing Account |
| 333 | # Administrator role or the Billing Account User role. |
| 334 | # The thresholds here have no effect on notifications sent to anything |
| 335 | # configured under `Budget.all_updates_rule`. |
| Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 336 | "spendBasis": "A String", # Optional. The type of basis used to determine if spend has passed the |
| 337 | # threshold. Behavior defaults to CURRENT_SPEND if not set. |
| Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 338 | "thresholdPercent": 3.14, # Required. Send an alert when this threshold is exceeded. |
| 339 | # This is a 1.0-based percentage, so 0.5 = 50%. |
| 340 | # Validation: non-negative number. |
| 341 | }, |
| 342 | ], |
| Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 343 | "etag": "A String", # Optional. Etag to validate that the object is unchanged for a |
| 344 | # read-modify-write operation. |
| 345 | # An empty etag will cause an update to overwrite other changes. |
| Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 346 | }</pre> |
| 347 | </div> |
| 348 | |
| 349 | <div class="method"> |
| 350 | <code class="details" id="delete">delete(name, x__xgafv=None)</code> |
| 351 | <pre>Deletes a budget. Returns successfully if already deleted. |
| 352 | |
| 353 | Args: |
| 354 | name: string, Required. Name of the budget to delete. Values are of the form |
| 355 | `billingAccounts/{billingAccountId}/budgets/{budgetId}`. (required) |
| 356 | x__xgafv: string, V1 error format. |
| 357 | Allowed values |
| 358 | 1 - v1 error format |
| 359 | 2 - v2 error format |
| 360 | |
| 361 | Returns: |
| 362 | An object of the form: |
| 363 | |
| 364 | { # A generic empty message that you can re-use to avoid defining duplicated |
| 365 | # empty messages in your APIs. A typical example is to use it as the request |
| 366 | # or the response type of an API method. For instance: |
| 367 | # |
| 368 | # service Foo { |
| 369 | # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); |
| 370 | # } |
| 371 | # |
| 372 | # The JSON representation for `Empty` is empty JSON object `{}`. |
| 373 | }</pre> |
| 374 | </div> |
| 375 | |
| 376 | <div class="method"> |
| 377 | <code class="details" id="get">get(name, x__xgafv=None)</code> |
| 378 | <pre>Returns a budget. |
| 379 | |
| 380 | WARNING: There are some fields exposed on the Google Cloud Console that |
| 381 | aren't available on this API. When reading from the API, you will not |
| 382 | see these fields in the return value, though they may have been set |
| 383 | in the Cloud Console. |
| 384 | |
| 385 | Args: |
| 386 | name: string, Required. Name of budget to get. Values are of the form |
| 387 | `billingAccounts/{billingAccountId}/budgets/{budgetId}`. (required) |
| 388 | x__xgafv: string, V1 error format. |
| 389 | Allowed values |
| 390 | 1 - v1 error format |
| 391 | 2 - v2 error format |
| 392 | |
| 393 | Returns: |
| 394 | An object of the form: |
| 395 | |
| 396 | { # A budget is a plan that describes what you expect to spend on Cloud |
| 397 | # projects, plus the rules to execute as spend is tracked against that plan, |
| 398 | # (for example, send an alert when 90% of the target spend is met). |
| 399 | # Currently all plans are monthly budgets so the usage period(s) tracked are |
| 400 | # implied (calendar months of usage back-to-back). |
| Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 401 | "displayName": "A String", # User data for display name in UI. |
| 402 | # Validation: <= 60 chars. |
| Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 403 | "amount": { # The budgeted amount for each usage period. # Required. Budgeted amount. |
| 404 | "lastPeriodAmount": { # Describes a budget amount targeted to last period's spend. # Use the last period's actual spend as the budget for the present period. |
| 405 | # At this time, the amount is automatically 100% of last period's spend; |
| 406 | # that is, there are no other options yet. |
| 407 | # Future configuration will be described here (for example, configuring a |
| 408 | # percentage of last period's spend). |
| 409 | }, |
| 410 | "specifiedAmount": { # Represents an amount of money with its currency type. # A specified amount to use as the budget. |
| 411 | # `currency_code` is optional. If specified, it must match the |
| 412 | # currency of the billing account. The `currency_code` is provided on |
| 413 | # output. |
| Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 414 | "currencyCode": "A String", # The 3-letter currency code defined in ISO 4217. |
| Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 415 | "nanos": 42, # Number of nano (10^-9) units of the amount. |
| 416 | # The value must be between -999,999,999 and +999,999,999 inclusive. |
| 417 | # If `units` is positive, `nanos` must be positive or zero. |
| 418 | # If `units` is zero, `nanos` can be positive, zero, or negative. |
| 419 | # If `units` is negative, `nanos` must be negative or zero. |
| 420 | # For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. |
| Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 421 | "units": "A String", # The whole units of the amount. |
| 422 | # For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. |
| Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 423 | }, |
| 424 | }, |
| Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 425 | "name": "A String", # Output only. Resource name of the budget. |
| 426 | # The resource name implies the scope of a budget. Values are of the form |
| 427 | # `billingAccounts/{billingAccountId}/budgets/{budgetId}`. |
| 428 | "allUpdatesRule": { # AllUpdatesRule defines notifications that are sent based on budget spend # Optional. Rules to apply to notifications sent based on budget spend and thresholds. |
| 429 | # and thresholds. |
| 430 | "monitoringNotificationChannels": [ # Optional. Targets to send notifications to when a threshold is exceeded. This is in |
| 431 | # addition to default recipients who have billing account roles. |
| 432 | # The value is the full REST resource name of a monitoring notification |
| 433 | # channel with the form |
| 434 | # `projects/{project_id}/notificationChannels/{channel_id}`. A maximum of 5 |
| 435 | # channels are allowed. See |
| 436 | # https://cloud.google.com/billing/docs/how-to/budgets-notification-recipients |
| 437 | # for more details. |
| 438 | "A String", |
| 439 | ], |
| Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 440 | "pubsubTopic": "A String", # Required. The name of the Cloud Pub/Sub topic where budget related messages will be |
| 441 | # published, in the form `projects/{project_id}/topics/{topic_id}`. Updates |
| 442 | # are sent at regular intervals to the topic. |
| 443 | # The topic needs to be created before the budget is created; see |
| 444 | # https://cloud.google.com/billing/docs/how-to/budgets#manage-notifications |
| 445 | # for more details. |
| 446 | # Caller is expected to have |
| 447 | # `pubsub.topics.setIamPolicy` permission on the topic when it's set for a |
| 448 | # budget, otherwise, the API call will fail with PERMISSION_DENIED. See |
| Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 449 | # https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications |
| 450 | # for more details on Pub/Sub roles and permissions. |
| 451 | "schemaVersion": "A String", # Required. The schema version of the notification sent to `pubsub_topic`. |
| Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 452 | # Only "1.0" is accepted. It represents the JSON schema as defined in |
| Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 453 | # https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications#notification_format |
| Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 454 | }, |
| Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 455 | "budgetFilter": { # A filter for a budget, limiting the scope of the cost to calculate. # Optional. Filters that define which resources are used to compute |
| 456 | # the actual spend against the budget. |
| 457 | "projects": [ # Optional. A set of projects of the form `projects/{project}`, |
| 458 | # specifying that usage from only this set of projects should be |
| 459 | # included in the budget. If omitted, the report will include all usage for |
| 460 | # the billing account, regardless of which project the usage occurred on. |
| 461 | # Only zero or one project can be specified currently. |
| 462 | "A String", |
| 463 | ], |
| 464 | "subaccounts": [ # Optional. A set of subaccounts of the form `billingAccounts/{account_id}`, specifying |
| 465 | # that usage from only this set of subaccounts should be included in the |
| 466 | # budget. If a subaccount is set to the name of the parent account, |
| 467 | # usage from the parent account will be included. If omitted, the |
| 468 | # report will include usage from the parent account and all |
| 469 | # subaccounts, if they exist. |
| 470 | "A String", |
| 471 | ], |
| 472 | "creditTypesTreatment": "A String", # Optional. If not set, default behavior is `INCLUDE_ALL_CREDITS`. |
| 473 | "services": [ # Optional. A set of services of the form `services/{service_id}`, |
| 474 | # specifying that usage from only this set of services should be |
| 475 | # included in the budget. If omitted, the report will include usage for |
| 476 | # all the services. |
| 477 | # The service names are available through the Catalog API: |
| 478 | # https://cloud.google.com/billing/v1/how-tos/catalog-api. |
| 479 | "A String", |
| 480 | ], |
| 481 | "labels": { # Optional. A single label and value pair specifying that usage from only this set of |
| 482 | # labeled resources should be included in the budget. Currently, multiple |
| 483 | # entries or multiple values per entry are not allowed. If omitted, the |
| 484 | # report will include all labeled and unlabeled usage. |
| 485 | "a_key": [ |
| 486 | "", |
| 487 | ], |
| 488 | }, |
| 489 | }, |
| Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 490 | "thresholdRules": [ # Optional. Rules that trigger alerts (notifications of thresholds |
| 491 | # being crossed) when spend exceeds the specified percentages of the budget. |
| 492 | { # ThresholdRule contains a definition of a threshold which triggers |
| 493 | # an alert (a notification of a threshold being crossed) to be sent when |
| 494 | # spend goes above the specified amount. |
| 495 | # Alerts are automatically e-mailed to users with the Billing Account |
| 496 | # Administrator role or the Billing Account User role. |
| 497 | # The thresholds here have no effect on notifications sent to anything |
| 498 | # configured under `Budget.all_updates_rule`. |
| Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 499 | "spendBasis": "A String", # Optional. The type of basis used to determine if spend has passed the |
| 500 | # threshold. Behavior defaults to CURRENT_SPEND if not set. |
| Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 501 | "thresholdPercent": 3.14, # Required. Send an alert when this threshold is exceeded. |
| 502 | # This is a 1.0-based percentage, so 0.5 = 50%. |
| 503 | # Validation: non-negative number. |
| 504 | }, |
| 505 | ], |
| Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 506 | "etag": "A String", # Optional. Etag to validate that the object is unchanged for a |
| 507 | # read-modify-write operation. |
| 508 | # An empty etag will cause an update to overwrite other changes. |
| Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 509 | }</pre> |
| 510 | </div> |
| 511 | |
| 512 | <div class="method"> |
| Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 513 | <code class="details" id="list">list(parent, pageToken=None, pageSize=None, x__xgafv=None)</code> |
| Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 514 | <pre>Returns a list of budgets for a billing account. |
| 515 | |
| 516 | WARNING: There are some fields exposed on the Google Cloud Console that |
| 517 | aren't available on this API. When reading from the API, you will not |
| 518 | see these fields in the return value, though they may have been set |
| 519 | in the Cloud Console. |
| 520 | |
| 521 | Args: |
| 522 | parent: string, Required. Name of billing account to list budgets under. Values |
| 523 | are of the form `billingAccounts/{billingAccountId}`. (required) |
| Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 524 | pageToken: string, Optional. The value returned by the last `ListBudgetsResponse` which |
| 525 | indicates that this is a continuation of a prior `ListBudgets` call, |
| 526 | and that the system should return the next page of data. |
| Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 527 | pageSize: integer, Optional. The maximum number of budgets to return per page. |
| 528 | The default and maximum value are 100. |
| Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 529 | x__xgafv: string, V1 error format. |
| 530 | Allowed values |
| 531 | 1 - v1 error format |
| 532 | 2 - v2 error format |
| 533 | |
| 534 | Returns: |
| 535 | An object of the form: |
| 536 | |
| 537 | { # Response for ListBudgets |
| 538 | "nextPageToken": "A String", # If not empty, indicates that there may be more budgets that match the |
| 539 | # request; this value should be passed in a new `ListBudgetsRequest`. |
| 540 | "budgets": [ # List of the budgets owned by the requested billing account. |
| 541 | { # A budget is a plan that describes what you expect to spend on Cloud |
| 542 | # projects, plus the rules to execute as spend is tracked against that plan, |
| 543 | # (for example, send an alert when 90% of the target spend is met). |
| 544 | # Currently all plans are monthly budgets so the usage period(s) tracked are |
| 545 | # implied (calendar months of usage back-to-back). |
| Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 546 | "displayName": "A String", # User data for display name in UI. |
| 547 | # Validation: <= 60 chars. |
| Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 548 | "amount": { # The budgeted amount for each usage period. # Required. Budgeted amount. |
| 549 | "lastPeriodAmount": { # Describes a budget amount targeted to last period's spend. # Use the last period's actual spend as the budget for the present period. |
| 550 | # At this time, the amount is automatically 100% of last period's spend; |
| 551 | # that is, there are no other options yet. |
| 552 | # Future configuration will be described here (for example, configuring a |
| 553 | # percentage of last period's spend). |
| 554 | }, |
| 555 | "specifiedAmount": { # Represents an amount of money with its currency type. # A specified amount to use as the budget. |
| 556 | # `currency_code` is optional. If specified, it must match the |
| 557 | # currency of the billing account. The `currency_code` is provided on |
| 558 | # output. |
| Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 559 | "currencyCode": "A String", # The 3-letter currency code defined in ISO 4217. |
| Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 560 | "nanos": 42, # Number of nano (10^-9) units of the amount. |
| 561 | # The value must be between -999,999,999 and +999,999,999 inclusive. |
| 562 | # If `units` is positive, `nanos` must be positive or zero. |
| 563 | # If `units` is zero, `nanos` can be positive, zero, or negative. |
| 564 | # If `units` is negative, `nanos` must be negative or zero. |
| 565 | # For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. |
| Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 566 | "units": "A String", # The whole units of the amount. |
| 567 | # For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. |
| Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 568 | }, |
| 569 | }, |
| Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 570 | "name": "A String", # Output only. Resource name of the budget. |
| 571 | # The resource name implies the scope of a budget. Values are of the form |
| 572 | # `billingAccounts/{billingAccountId}/budgets/{budgetId}`. |
| 573 | "allUpdatesRule": { # AllUpdatesRule defines notifications that are sent based on budget spend # Optional. Rules to apply to notifications sent based on budget spend and thresholds. |
| 574 | # and thresholds. |
| 575 | "monitoringNotificationChannels": [ # Optional. Targets to send notifications to when a threshold is exceeded. This is in |
| 576 | # addition to default recipients who have billing account roles. |
| 577 | # The value is the full REST resource name of a monitoring notification |
| 578 | # channel with the form |
| 579 | # `projects/{project_id}/notificationChannels/{channel_id}`. A maximum of 5 |
| 580 | # channels are allowed. See |
| 581 | # https://cloud.google.com/billing/docs/how-to/budgets-notification-recipients |
| 582 | # for more details. |
| 583 | "A String", |
| 584 | ], |
| Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 585 | "pubsubTopic": "A String", # Required. The name of the Cloud Pub/Sub topic where budget related messages will be |
| 586 | # published, in the form `projects/{project_id}/topics/{topic_id}`. Updates |
| 587 | # are sent at regular intervals to the topic. |
| 588 | # The topic needs to be created before the budget is created; see |
| 589 | # https://cloud.google.com/billing/docs/how-to/budgets#manage-notifications |
| 590 | # for more details. |
| 591 | # Caller is expected to have |
| 592 | # `pubsub.topics.setIamPolicy` permission on the topic when it's set for a |
| 593 | # budget, otherwise, the API call will fail with PERMISSION_DENIED. See |
| Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 594 | # https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications |
| 595 | # for more details on Pub/Sub roles and permissions. |
| 596 | "schemaVersion": "A String", # Required. The schema version of the notification sent to `pubsub_topic`. |
| Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 597 | # Only "1.0" is accepted. It represents the JSON schema as defined in |
| Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 598 | # https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications#notification_format |
| Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 599 | }, |
| Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 600 | "budgetFilter": { # A filter for a budget, limiting the scope of the cost to calculate. # Optional. Filters that define which resources are used to compute |
| 601 | # the actual spend against the budget. |
| 602 | "projects": [ # Optional. A set of projects of the form `projects/{project}`, |
| 603 | # specifying that usage from only this set of projects should be |
| 604 | # included in the budget. If omitted, the report will include all usage for |
| 605 | # the billing account, regardless of which project the usage occurred on. |
| 606 | # Only zero or one project can be specified currently. |
| 607 | "A String", |
| 608 | ], |
| 609 | "subaccounts": [ # Optional. A set of subaccounts of the form `billingAccounts/{account_id}`, specifying |
| 610 | # that usage from only this set of subaccounts should be included in the |
| 611 | # budget. If a subaccount is set to the name of the parent account, |
| 612 | # usage from the parent account will be included. If omitted, the |
| 613 | # report will include usage from the parent account and all |
| 614 | # subaccounts, if they exist. |
| 615 | "A String", |
| 616 | ], |
| 617 | "creditTypesTreatment": "A String", # Optional. If not set, default behavior is `INCLUDE_ALL_CREDITS`. |
| 618 | "services": [ # Optional. A set of services of the form `services/{service_id}`, |
| 619 | # specifying that usage from only this set of services should be |
| 620 | # included in the budget. If omitted, the report will include usage for |
| 621 | # all the services. |
| 622 | # The service names are available through the Catalog API: |
| 623 | # https://cloud.google.com/billing/v1/how-tos/catalog-api. |
| 624 | "A String", |
| 625 | ], |
| 626 | "labels": { # Optional. A single label and value pair specifying that usage from only this set of |
| 627 | # labeled resources should be included in the budget. Currently, multiple |
| 628 | # entries or multiple values per entry are not allowed. If omitted, the |
| 629 | # report will include all labeled and unlabeled usage. |
| 630 | "a_key": [ |
| 631 | "", |
| 632 | ], |
| 633 | }, |
| 634 | }, |
| Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 635 | "thresholdRules": [ # Optional. Rules that trigger alerts (notifications of thresholds |
| 636 | # being crossed) when spend exceeds the specified percentages of the budget. |
| 637 | { # ThresholdRule contains a definition of a threshold which triggers |
| 638 | # an alert (a notification of a threshold being crossed) to be sent when |
| 639 | # spend goes above the specified amount. |
| 640 | # Alerts are automatically e-mailed to users with the Billing Account |
| 641 | # Administrator role or the Billing Account User role. |
| 642 | # The thresholds here have no effect on notifications sent to anything |
| 643 | # configured under `Budget.all_updates_rule`. |
| Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 644 | "spendBasis": "A String", # Optional. The type of basis used to determine if spend has passed the |
| 645 | # threshold. Behavior defaults to CURRENT_SPEND if not set. |
| Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 646 | "thresholdPercent": 3.14, # Required. Send an alert when this threshold is exceeded. |
| 647 | # This is a 1.0-based percentage, so 0.5 = 50%. |
| 648 | # Validation: non-negative number. |
| 649 | }, |
| 650 | ], |
| Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 651 | "etag": "A String", # Optional. Etag to validate that the object is unchanged for a |
| 652 | # read-modify-write operation. |
| 653 | # An empty etag will cause an update to overwrite other changes. |
| Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 654 | }, |
| 655 | ], |
| 656 | }</pre> |
| 657 | </div> |
| 658 | |
| 659 | <div class="method"> |
| 660 | <code class="details" id="list_next">list_next(previous_request, previous_response)</code> |
| 661 | <pre>Retrieves the next page of results. |
| 662 | |
| 663 | Args: |
| 664 | previous_request: The request for the previous page. (required) |
| 665 | previous_response: The response from the request for the previous page. (required) |
| 666 | |
| 667 | Returns: |
| 668 | A request object that you can call 'execute()' on to request the next |
| 669 | page. Returns None if there are no more items in the collection. |
| 670 | </pre> |
| 671 | </div> |
| 672 | |
| 673 | <div class="method"> |
| 674 | <code class="details" id="patch">patch(name, body=None, x__xgafv=None)</code> |
| 675 | <pre>Updates a budget and returns the updated budget. |
| 676 | |
| 677 | WARNING: There are some fields exposed on the Google Cloud Console that |
| 678 | aren't available on this API. Budget fields that are not exposed in |
| 679 | this API will not be changed by this method. |
| 680 | |
| 681 | Args: |
| 682 | name: string, Output only. Resource name of the budget. |
| 683 | The resource name implies the scope of a budget. Values are of the form |
| 684 | `billingAccounts/{billingAccountId}/budgets/{budgetId}`. (required) |
| 685 | body: object, The request body. |
| 686 | The object takes the form of: |
| 687 | |
| 688 | { # Request for UpdateBudget |
| Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 689 | "updateMask": "A String", # Optional. Indicates which fields in the provided budget to update. |
| 690 | # Read-only fields (such as `name`) cannot be changed. If this is not |
| 691 | # provided, then only fields with non-default values from the request are |
| 692 | # updated. See |
| 693 | # https://developers.google.com/protocol-buffers/docs/proto3#default for more |
| 694 | # details about default values. |
| Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 695 | "budget": { # A budget is a plan that describes what you expect to spend on Cloud # Required. The updated budget object. |
| 696 | # The budget to update is specified by the budget name in the budget. |
| 697 | # projects, plus the rules to execute as spend is tracked against that plan, |
| 698 | # (for example, send an alert when 90% of the target spend is met). |
| 699 | # Currently all plans are monthly budgets so the usage period(s) tracked are |
| 700 | # implied (calendar months of usage back-to-back). |
| Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 701 | "displayName": "A String", # User data for display name in UI. |
| 702 | # Validation: <= 60 chars. |
| Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 703 | "amount": { # The budgeted amount for each usage period. # Required. Budgeted amount. |
| 704 | "lastPeriodAmount": { # Describes a budget amount targeted to last period's spend. # Use the last period's actual spend as the budget for the present period. |
| 705 | # At this time, the amount is automatically 100% of last period's spend; |
| 706 | # that is, there are no other options yet. |
| 707 | # Future configuration will be described here (for example, configuring a |
| 708 | # percentage of last period's spend). |
| 709 | }, |
| 710 | "specifiedAmount": { # Represents an amount of money with its currency type. # A specified amount to use as the budget. |
| 711 | # `currency_code` is optional. If specified, it must match the |
| 712 | # currency of the billing account. The `currency_code` is provided on |
| 713 | # output. |
| Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 714 | "currencyCode": "A String", # The 3-letter currency code defined in ISO 4217. |
| Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 715 | "nanos": 42, # Number of nano (10^-9) units of the amount. |
| 716 | # The value must be between -999,999,999 and +999,999,999 inclusive. |
| 717 | # If `units` is positive, `nanos` must be positive or zero. |
| 718 | # If `units` is zero, `nanos` can be positive, zero, or negative. |
| 719 | # If `units` is negative, `nanos` must be negative or zero. |
| 720 | # For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. |
| Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 721 | "units": "A String", # The whole units of the amount. |
| 722 | # For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. |
| Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 723 | }, |
| 724 | }, |
| Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 725 | "name": "A String", # Output only. Resource name of the budget. |
| 726 | # The resource name implies the scope of a budget. Values are of the form |
| 727 | # `billingAccounts/{billingAccountId}/budgets/{budgetId}`. |
| 728 | "allUpdatesRule": { # AllUpdatesRule defines notifications that are sent based on budget spend # Optional. Rules to apply to notifications sent based on budget spend and thresholds. |
| 729 | # and thresholds. |
| 730 | "monitoringNotificationChannels": [ # Optional. Targets to send notifications to when a threshold is exceeded. This is in |
| 731 | # addition to default recipients who have billing account roles. |
| 732 | # The value is the full REST resource name of a monitoring notification |
| 733 | # channel with the form |
| 734 | # `projects/{project_id}/notificationChannels/{channel_id}`. A maximum of 5 |
| 735 | # channels are allowed. See |
| 736 | # https://cloud.google.com/billing/docs/how-to/budgets-notification-recipients |
| 737 | # for more details. |
| 738 | "A String", |
| 739 | ], |
| Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 740 | "pubsubTopic": "A String", # Required. The name of the Cloud Pub/Sub topic where budget related messages will be |
| 741 | # published, in the form `projects/{project_id}/topics/{topic_id}`. Updates |
| 742 | # are sent at regular intervals to the topic. |
| 743 | # The topic needs to be created before the budget is created; see |
| 744 | # https://cloud.google.com/billing/docs/how-to/budgets#manage-notifications |
| 745 | # for more details. |
| 746 | # Caller is expected to have |
| 747 | # `pubsub.topics.setIamPolicy` permission on the topic when it's set for a |
| 748 | # budget, otherwise, the API call will fail with PERMISSION_DENIED. See |
| Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 749 | # https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications |
| 750 | # for more details on Pub/Sub roles and permissions. |
| 751 | "schemaVersion": "A String", # Required. The schema version of the notification sent to `pubsub_topic`. |
| Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 752 | # Only "1.0" is accepted. It represents the JSON schema as defined in |
| Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 753 | # https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications#notification_format |
| Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 754 | }, |
| Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 755 | "budgetFilter": { # A filter for a budget, limiting the scope of the cost to calculate. # Optional. Filters that define which resources are used to compute |
| 756 | # the actual spend against the budget. |
| 757 | "projects": [ # Optional. A set of projects of the form `projects/{project}`, |
| 758 | # specifying that usage from only this set of projects should be |
| 759 | # included in the budget. If omitted, the report will include all usage for |
| 760 | # the billing account, regardless of which project the usage occurred on. |
| 761 | # Only zero or one project can be specified currently. |
| 762 | "A String", |
| 763 | ], |
| 764 | "subaccounts": [ # Optional. A set of subaccounts of the form `billingAccounts/{account_id}`, specifying |
| 765 | # that usage from only this set of subaccounts should be included in the |
| 766 | # budget. If a subaccount is set to the name of the parent account, |
| 767 | # usage from the parent account will be included. If omitted, the |
| 768 | # report will include usage from the parent account and all |
| 769 | # subaccounts, if they exist. |
| 770 | "A String", |
| 771 | ], |
| 772 | "creditTypesTreatment": "A String", # Optional. If not set, default behavior is `INCLUDE_ALL_CREDITS`. |
| 773 | "services": [ # Optional. A set of services of the form `services/{service_id}`, |
| 774 | # specifying that usage from only this set of services should be |
| 775 | # included in the budget. If omitted, the report will include usage for |
| 776 | # all the services. |
| 777 | # The service names are available through the Catalog API: |
| 778 | # https://cloud.google.com/billing/v1/how-tos/catalog-api. |
| 779 | "A String", |
| 780 | ], |
| 781 | "labels": { # Optional. A single label and value pair specifying that usage from only this set of |
| 782 | # labeled resources should be included in the budget. Currently, multiple |
| 783 | # entries or multiple values per entry are not allowed. If omitted, the |
| 784 | # report will include all labeled and unlabeled usage. |
| 785 | "a_key": [ |
| 786 | "", |
| 787 | ], |
| 788 | }, |
| 789 | }, |
| Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 790 | "thresholdRules": [ # Optional. Rules that trigger alerts (notifications of thresholds |
| 791 | # being crossed) when spend exceeds the specified percentages of the budget. |
| 792 | { # ThresholdRule contains a definition of a threshold which triggers |
| 793 | # an alert (a notification of a threshold being crossed) to be sent when |
| 794 | # spend goes above the specified amount. |
| 795 | # Alerts are automatically e-mailed to users with the Billing Account |
| 796 | # Administrator role or the Billing Account User role. |
| 797 | # The thresholds here have no effect on notifications sent to anything |
| 798 | # configured under `Budget.all_updates_rule`. |
| Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 799 | "spendBasis": "A String", # Optional. The type of basis used to determine if spend has passed the |
| 800 | # threshold. Behavior defaults to CURRENT_SPEND if not set. |
| Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 801 | "thresholdPercent": 3.14, # Required. Send an alert when this threshold is exceeded. |
| 802 | # This is a 1.0-based percentage, so 0.5 = 50%. |
| 803 | # Validation: non-negative number. |
| 804 | }, |
| 805 | ], |
| Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 806 | "etag": "A String", # Optional. Etag to validate that the object is unchanged for a |
| 807 | # read-modify-write operation. |
| 808 | # An empty etag will cause an update to overwrite other changes. |
| Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 809 | }, |
| Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 810 | } |
| 811 | |
| 812 | x__xgafv: string, V1 error format. |
| 813 | Allowed values |
| 814 | 1 - v1 error format |
| 815 | 2 - v2 error format |
| 816 | |
| 817 | Returns: |
| 818 | An object of the form: |
| 819 | |
| 820 | { # A budget is a plan that describes what you expect to spend on Cloud |
| 821 | # projects, plus the rules to execute as spend is tracked against that plan, |
| 822 | # (for example, send an alert when 90% of the target spend is met). |
| 823 | # Currently all plans are monthly budgets so the usage period(s) tracked are |
| 824 | # implied (calendar months of usage back-to-back). |
| Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 825 | "displayName": "A String", # User data for display name in UI. |
| 826 | # Validation: <= 60 chars. |
| Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 827 | "amount": { # The budgeted amount for each usage period. # Required. Budgeted amount. |
| 828 | "lastPeriodAmount": { # Describes a budget amount targeted to last period's spend. # Use the last period's actual spend as the budget for the present period. |
| 829 | # At this time, the amount is automatically 100% of last period's spend; |
| 830 | # that is, there are no other options yet. |
| 831 | # Future configuration will be described here (for example, configuring a |
| 832 | # percentage of last period's spend). |
| 833 | }, |
| 834 | "specifiedAmount": { # Represents an amount of money with its currency type. # A specified amount to use as the budget. |
| 835 | # `currency_code` is optional. If specified, it must match the |
| 836 | # currency of the billing account. The `currency_code` is provided on |
| 837 | # output. |
| Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 838 | "currencyCode": "A String", # The 3-letter currency code defined in ISO 4217. |
| Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 839 | "nanos": 42, # Number of nano (10^-9) units of the amount. |
| 840 | # The value must be between -999,999,999 and +999,999,999 inclusive. |
| 841 | # If `units` is positive, `nanos` must be positive or zero. |
| 842 | # If `units` is zero, `nanos` can be positive, zero, or negative. |
| 843 | # If `units` is negative, `nanos` must be negative or zero. |
| 844 | # For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. |
| Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 845 | "units": "A String", # The whole units of the amount. |
| 846 | # For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. |
| Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 847 | }, |
| 848 | }, |
| Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 849 | "name": "A String", # Output only. Resource name of the budget. |
| 850 | # The resource name implies the scope of a budget. Values are of the form |
| 851 | # `billingAccounts/{billingAccountId}/budgets/{budgetId}`. |
| 852 | "allUpdatesRule": { # AllUpdatesRule defines notifications that are sent based on budget spend # Optional. Rules to apply to notifications sent based on budget spend and thresholds. |
| 853 | # and thresholds. |
| 854 | "monitoringNotificationChannels": [ # Optional. Targets to send notifications to when a threshold is exceeded. This is in |
| 855 | # addition to default recipients who have billing account roles. |
| 856 | # The value is the full REST resource name of a monitoring notification |
| 857 | # channel with the form |
| 858 | # `projects/{project_id}/notificationChannels/{channel_id}`. A maximum of 5 |
| 859 | # channels are allowed. See |
| 860 | # https://cloud.google.com/billing/docs/how-to/budgets-notification-recipients |
| 861 | # for more details. |
| 862 | "A String", |
| 863 | ], |
| Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 864 | "pubsubTopic": "A String", # Required. The name of the Cloud Pub/Sub topic where budget related messages will be |
| 865 | # published, in the form `projects/{project_id}/topics/{topic_id}`. Updates |
| 866 | # are sent at regular intervals to the topic. |
| 867 | # The topic needs to be created before the budget is created; see |
| 868 | # https://cloud.google.com/billing/docs/how-to/budgets#manage-notifications |
| 869 | # for more details. |
| 870 | # Caller is expected to have |
| 871 | # `pubsub.topics.setIamPolicy` permission on the topic when it's set for a |
| 872 | # budget, otherwise, the API call will fail with PERMISSION_DENIED. See |
| Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 873 | # https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications |
| 874 | # for more details on Pub/Sub roles and permissions. |
| 875 | "schemaVersion": "A String", # Required. The schema version of the notification sent to `pubsub_topic`. |
| Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 876 | # Only "1.0" is accepted. It represents the JSON schema as defined in |
| Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 877 | # https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications#notification_format |
| Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 878 | }, |
| Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 879 | "budgetFilter": { # A filter for a budget, limiting the scope of the cost to calculate. # Optional. Filters that define which resources are used to compute |
| 880 | # the actual spend against the budget. |
| 881 | "projects": [ # Optional. A set of projects of the form `projects/{project}`, |
| 882 | # specifying that usage from only this set of projects should be |
| 883 | # included in the budget. If omitted, the report will include all usage for |
| 884 | # the billing account, regardless of which project the usage occurred on. |
| 885 | # Only zero or one project can be specified currently. |
| 886 | "A String", |
| 887 | ], |
| 888 | "subaccounts": [ # Optional. A set of subaccounts of the form `billingAccounts/{account_id}`, specifying |
| 889 | # that usage from only this set of subaccounts should be included in the |
| 890 | # budget. If a subaccount is set to the name of the parent account, |
| 891 | # usage from the parent account will be included. If omitted, the |
| 892 | # report will include usage from the parent account and all |
| 893 | # subaccounts, if they exist. |
| 894 | "A String", |
| 895 | ], |
| 896 | "creditTypesTreatment": "A String", # Optional. If not set, default behavior is `INCLUDE_ALL_CREDITS`. |
| 897 | "services": [ # Optional. A set of services of the form `services/{service_id}`, |
| 898 | # specifying that usage from only this set of services should be |
| 899 | # included in the budget. If omitted, the report will include usage for |
| 900 | # all the services. |
| 901 | # The service names are available through the Catalog API: |
| 902 | # https://cloud.google.com/billing/v1/how-tos/catalog-api. |
| 903 | "A String", |
| 904 | ], |
| 905 | "labels": { # Optional. A single label and value pair specifying that usage from only this set of |
| 906 | # labeled resources should be included in the budget. Currently, multiple |
| 907 | # entries or multiple values per entry are not allowed. If omitted, the |
| 908 | # report will include all labeled and unlabeled usage. |
| 909 | "a_key": [ |
| 910 | "", |
| 911 | ], |
| 912 | }, |
| 913 | }, |
| Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 914 | "thresholdRules": [ # Optional. Rules that trigger alerts (notifications of thresholds |
| 915 | # being crossed) when spend exceeds the specified percentages of the budget. |
| 916 | { # ThresholdRule contains a definition of a threshold which triggers |
| 917 | # an alert (a notification of a threshold being crossed) to be sent when |
| 918 | # spend goes above the specified amount. |
| 919 | # Alerts are automatically e-mailed to users with the Billing Account |
| 920 | # Administrator role or the Billing Account User role. |
| 921 | # The thresholds here have no effect on notifications sent to anything |
| 922 | # configured under `Budget.all_updates_rule`. |
| Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 923 | "spendBasis": "A String", # Optional. The type of basis used to determine if spend has passed the |
| 924 | # threshold. Behavior defaults to CURRENT_SPEND if not set. |
| Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 925 | "thresholdPercent": 3.14, # Required. Send an alert when this threshold is exceeded. |
| 926 | # This is a 1.0-based percentage, so 0.5 = 50%. |
| 927 | # Validation: non-negative number. |
| 928 | }, |
| 929 | ], |
| Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame^] | 930 | "etag": "A String", # Optional. Etag to validate that the object is unchanged for a |
| 931 | # read-modify-write operation. |
| 932 | # An empty etag will cause an update to overwrite other changes. |
| Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 933 | }</pre> |
| 934 | </div> |
| 935 | |
| 936 | </body></html> |