|
30 | 30 | manifest={
|
31 | 31 | "ReplicaInfo",
|
32 | 32 | "InstanceConfig",
|
| 33 | + "AutoscalingConfig", |
33 | 34 | "Instance",
|
34 | 35 | "ListInstanceConfigsRequest",
|
35 | 36 | "ListInstanceConfigsResponse",
|
@@ -297,6 +298,116 @@ class State(proto.Enum):
|
297 | 298 | )
|
298 | 299 |
|
299 | 300 |
|
| 301 | +class AutoscalingConfig(proto.Message): |
| 302 | + r"""Autoscaling config for an instance. |
| 303 | +
|
| 304 | + Attributes: |
| 305 | + autoscaling_limits (google.cloud.spanner_admin_instance_v1.types.AutoscalingConfig.AutoscalingLimits): |
| 306 | + Required. Autoscaling limits for an instance. |
| 307 | + autoscaling_targets (google.cloud.spanner_admin_instance_v1.types.AutoscalingConfig.AutoscalingTargets): |
| 308 | + Required. The autoscaling targets for an |
| 309 | + instance. |
| 310 | + """ |
| 311 | + |
| 312 | + class AutoscalingLimits(proto.Message): |
| 313 | + r"""The autoscaling limits for the instance. Users can define the |
| 314 | + minimum and maximum compute capacity allocated to the instance, and |
| 315 | + the autoscaler will only scale within that range. Users can either |
| 316 | + use nodes or processing units to specify the limits, but should use |
| 317 | + the same unit to set both the min_limit and max_limit. |
| 318 | +
|
| 319 | + This message has `oneof`_ fields (mutually exclusive fields). |
| 320 | + For each oneof, at most one member field can be set at the same time. |
| 321 | + Setting any member of the oneof automatically clears all other |
| 322 | + members. |
| 323 | +
|
| 324 | + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields |
| 325 | +
|
| 326 | + Attributes: |
| 327 | + min_nodes (int): |
| 328 | + Minimum number of nodes allocated to the |
| 329 | + instance. If set, this number should be greater |
| 330 | + than or equal to 1. |
| 331 | +
|
| 332 | + This field is a member of `oneof`_ ``min_limit``. |
| 333 | + min_processing_units (int): |
| 334 | + Minimum number of processing units allocated |
| 335 | + to the instance. If set, this number should be |
| 336 | + multiples of 1000. |
| 337 | +
|
| 338 | + This field is a member of `oneof`_ ``min_limit``. |
| 339 | + max_nodes (int): |
| 340 | + Maximum number of nodes allocated to the instance. If set, |
| 341 | + this number should be greater than or equal to min_nodes. |
| 342 | +
|
| 343 | + This field is a member of `oneof`_ ``max_limit``. |
| 344 | + max_processing_units (int): |
| 345 | + Maximum number of processing units allocated to the |
| 346 | + instance. If set, this number should be multiples of 1000 |
| 347 | + and be greater than or equal to min_processing_units. |
| 348 | +
|
| 349 | + This field is a member of `oneof`_ ``max_limit``. |
| 350 | + """ |
| 351 | + |
| 352 | + min_nodes: int = proto.Field( |
| 353 | + proto.INT32, |
| 354 | + number=1, |
| 355 | + oneof="min_limit", |
| 356 | + ) |
| 357 | + min_processing_units: int = proto.Field( |
| 358 | + proto.INT32, |
| 359 | + number=2, |
| 360 | + oneof="min_limit", |
| 361 | + ) |
| 362 | + max_nodes: int = proto.Field( |
| 363 | + proto.INT32, |
| 364 | + number=3, |
| 365 | + oneof="max_limit", |
| 366 | + ) |
| 367 | + max_processing_units: int = proto.Field( |
| 368 | + proto.INT32, |
| 369 | + number=4, |
| 370 | + oneof="max_limit", |
| 371 | + ) |
| 372 | + |
| 373 | + class AutoscalingTargets(proto.Message): |
| 374 | + r"""The autoscaling targets for an instance. |
| 375 | +
|
| 376 | + Attributes: |
| 377 | + high_priority_cpu_utilization_percent (int): |
| 378 | + Required. The target high priority cpu utilization |
| 379 | + percentage that the autoscaler should be trying to achieve |
| 380 | + for the instance. This number is on a scale from 0 (no |
| 381 | + utilization) to 100 (full utilization). The valid range is |
| 382 | + [10, 90] inclusive. |
| 383 | + storage_utilization_percent (int): |
| 384 | + Required. The target storage utilization percentage that the |
| 385 | + autoscaler should be trying to achieve for the instance. |
| 386 | + This number is on a scale from 0 (no utilization) to 100 |
| 387 | + (full utilization). The valid range is [10, 100] inclusive. |
| 388 | + """ |
| 389 | + |
| 390 | + high_priority_cpu_utilization_percent: int = proto.Field( |
| 391 | + proto.INT32, |
| 392 | + number=1, |
| 393 | + ) |
| 394 | + storage_utilization_percent: int = proto.Field( |
| 395 | + proto.INT32, |
| 396 | + number=2, |
| 397 | + ) |
| 398 | + |
| 399 | + autoscaling_limits: AutoscalingLimits = proto.Field( |
| 400 | + proto.MESSAGE, |
| 401 | + number=1, |
| 402 | + message=AutoscalingLimits, |
| 403 | + ) |
| 404 | + autoscaling_targets: AutoscalingTargets = proto.Field( |
| 405 | + proto.MESSAGE, |
| 406 | + number=2, |
| 407 | + message=AutoscalingTargets, |
| 408 | + ) |
| 409 | + |
| 410 | + |
300 | 411 | class Instance(proto.Message):
|
301 | 412 | r"""An isolated set of Cloud Spanner resources on which databases
|
302 | 413 | can be hosted.
|
@@ -325,21 +436,37 @@ class Instance(proto.Message):
|
325 | 436 | node_count (int):
|
326 | 437 | The number of nodes allocated to this instance. At most one
|
327 | 438 | of either node_count or processing_units should be present
|
328 |
| - in the message. This may be zero in API responses for |
329 |
| - instances that are not yet in state ``READY``. |
| 439 | + in the message. |
| 440 | +
|
| 441 | + Users can set the node_count field to specify the target |
| 442 | + number of nodes allocated to the instance. |
| 443 | +
|
| 444 | + This may be zero in API responses for instances that are not |
| 445 | + yet in state ``READY``. |
330 | 446 |
|
331 | 447 | See `the
|
332 | 448 | documentation <https://cloud.google.com/spanner/docs/compute-capacity>`__
|
333 | 449 | for more information about nodes and processing units.
|
334 | 450 | processing_units (int):
|
335 | 451 | The number of processing units allocated to this instance.
|
336 | 452 | At most one of processing_units or node_count should be
|
337 |
| - present in the message. This may be zero in API responses |
338 |
| - for instances that are not yet in state ``READY``. |
| 453 | + present in the message. |
| 454 | +
|
| 455 | + Users can set the processing_units field to specify the |
| 456 | + target number of processing units allocated to the instance. |
| 457 | +
|
| 458 | + This may be zero in API responses for instances that are not |
| 459 | + yet in state ``READY``. |
339 | 460 |
|
340 | 461 | See `the
|
341 | 462 | documentation <https://cloud.google.com/spanner/docs/compute-capacity>`__
|
342 | 463 | for more information about nodes and processing units.
|
| 464 | + autoscaling_config (google.cloud.spanner_admin_instance_v1.types.AutoscalingConfig): |
| 465 | + Optional. The autoscaling configuration. Autoscaling is |
| 466 | + enabled if this field is set. When autoscaling is enabled, |
| 467 | + node_count and processing_units are treated as OUTPUT_ONLY |
| 468 | + fields and reflect the current compute capacity allocated to |
| 469 | + the instance. |
343 | 470 | state (google.cloud.spanner_admin_instance_v1.types.Instance.State):
|
344 | 471 | Output only. The current instance state. For
|
345 | 472 | [CreateInstance][google.spanner.admin.instance.v1.InstanceAdmin.CreateInstance],
|
@@ -424,6 +551,11 @@ class State(proto.Enum):
|
424 | 551 | proto.INT32,
|
425 | 552 | number=9,
|
426 | 553 | )
|
| 554 | + autoscaling_config: "AutoscalingConfig" = proto.Field( |
| 555 | + proto.MESSAGE, |
| 556 | + number=17, |
| 557 | + message="AutoscalingConfig", |
| 558 | + ) |
427 | 559 | state: State = proto.Field(
|
428 | 560 | proto.ENUM,
|
429 | 561 | number=6,
|
|
0 commit comments