Skip to content

Commit fe285c6

Browse files
feat(spanner): add autoscaling config to the instance proto (#1935)
* feat(spanner): add autoscaling config to the instance proto PiperOrigin-RevId: 573098210 Source-Link: googleapis/googleapis@d6467db Source-Link: googleapis/googleapis-gen@9ea8b73 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOWVhOGI3MzQ1ZWYyZDkzYTQ5YjE1YTMzMmE2ODJhNjE3MTRmMDczZSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 7d0bde9 commit fe285c6

File tree

4 files changed

+1304
-4
lines changed

4 files changed

+1304
-4
lines changed

protos/google/spanner/admin/instance/v1/spanner_instance_admin.proto

Lines changed: 80 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,66 @@ message InstanceConfig {
562562
State state = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
563563
}
564564

565+
// Autoscaling config for an instance.
566+
message AutoscalingConfig {
567+
// The autoscaling limits for the instance. Users can define the minimum and
568+
// maximum compute capacity allocated to the instance, and the autoscaler will
569+
// only scale within that range. Users can either use nodes or processing
570+
// units to specify the limits, but should use the same unit to set both the
571+
// min_limit and max_limit.
572+
message AutoscalingLimits {
573+
// The minimum compute capacity for the instance.
574+
oneof min_limit {
575+
// Minimum number of nodes allocated to the instance. If set, this number
576+
// should be greater than or equal to 1.
577+
int32 min_nodes = 1;
578+
579+
// Minimum number of processing units allocated to the instance. If set,
580+
// this number should be multiples of 1000.
581+
int32 min_processing_units = 2;
582+
}
583+
584+
// The maximum compute capacity for the instance. The maximum compute
585+
// capacity should be less than or equal to 10X the minimum compute
586+
// capacity.
587+
oneof max_limit {
588+
// Maximum number of nodes allocated to the instance. If set, this number
589+
// should be greater than or equal to min_nodes.
590+
int32 max_nodes = 3;
591+
592+
// Maximum number of processing units allocated to the instance. If set,
593+
// this number should be multiples of 1000 and be greater than or equal to
594+
// min_processing_units.
595+
int32 max_processing_units = 4;
596+
}
597+
}
598+
599+
// The autoscaling targets for an instance.
600+
message AutoscalingTargets {
601+
// Required. The target high priority cpu utilization percentage that the
602+
// autoscaler should be trying to achieve for the instance. This number is
603+
// on a scale from 0 (no utilization) to 100 (full utilization). The valid
604+
// range is [10, 90] inclusive.
605+
int32 high_priority_cpu_utilization_percent = 1
606+
[(google.api.field_behavior) = REQUIRED];
607+
608+
// Required. The target storage utilization percentage that the autoscaler
609+
// should be trying to achieve for the instance. This number is on a scale
610+
// from 0 (no utilization) to 100 (full utilization). The valid range is
611+
// [10, 100] inclusive.
612+
int32 storage_utilization_percent = 2
613+
[(google.api.field_behavior) = REQUIRED];
614+
}
615+
616+
// Required. Autoscaling limits for an instance.
617+
AutoscalingLimits autoscaling_limits = 1
618+
[(google.api.field_behavior) = REQUIRED];
619+
620+
// Required. The autoscaling targets for an instance.
621+
AutoscalingTargets autoscaling_targets = 2
622+
[(google.api.field_behavior) = REQUIRED];
623+
}
624+
565625
// An isolated set of Cloud Spanner resources on which databases can be hosted.
566626
message Instance {
567627
option (google.api.resource) = {
@@ -606,8 +666,12 @@ message Instance {
606666
string display_name = 3 [(google.api.field_behavior) = REQUIRED];
607667

608668
// The number of nodes allocated to this instance. At most one of either
609-
// node_count or processing_units should be present in the message. This
610-
// may be zero in API responses for instances that are not yet in state
669+
// node_count or processing_units should be present in the message.
670+
//
671+
// Users can set the node_count field to specify the target number of nodes
672+
// allocated to the instance.
673+
//
674+
// This may be zero in API responses for instances that are not yet in state
611675
// `READY`.
612676
//
613677
// See [the
@@ -616,14 +680,26 @@ message Instance {
616680
int32 node_count = 5;
617681

618682
// The number of processing units allocated to this instance. At most one of
619-
// processing_units or node_count should be present in the message. This may
620-
// be zero in API responses for instances that are not yet in state `READY`.
683+
// processing_units or node_count should be present in the message.
684+
//
685+
// Users can set the processing_units field to specify the target number of
686+
// processing units allocated to the instance.
687+
//
688+
// This may be zero in API responses for instances that are not yet in state
689+
// `READY`.
621690
//
622691
// See [the
623692
// documentation](https://cloud.google.com/spanner/docs/compute-capacity)
624693
// for more information about nodes and processing units.
625694
int32 processing_units = 9;
626695

696+
// Optional. The autoscaling configuration. Autoscaling is enabled if this
697+
// field is set. When autoscaling is enabled, node_count and processing_units
698+
// are treated as OUTPUT_ONLY fields and reflect the current compute capacity
699+
// allocated to the instance.
700+
AutoscalingConfig autoscaling_config = 17
701+
[(google.api.field_behavior) = OPTIONAL];
702+
627703
// Output only. The current instance state. For
628704
// [CreateInstance][google.spanner.admin.instance.v1.InstanceAdmin.CreateInstance],
629705
// the state must be either omitted or set to `CREATING`. For

0 commit comments

Comments
 (0)