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