@@ -562,6 +562,66 @@ message InstanceConfig {
562
562
State state = 11 [(google.api.field_behavior ) = OUTPUT_ONLY ];
563
563
}
564
564
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
+
565
625
// An isolated set of Cloud Spanner resources on which databases can be hosted.
566
626
message Instance {
567
627
option (google.api.resource ) = {
@@ -606,8 +666,12 @@ message Instance {
606
666
string display_name = 3 [(google.api.field_behavior ) = REQUIRED ];
607
667
608
668
// 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
611
675
// `READY`.
612
676
//
613
677
// See [the
@@ -616,14 +680,26 @@ message Instance {
616
680
int32 node_count = 5 ;
617
681
618
682
// 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`.
621
690
//
622
691
// See [the
623
692
// documentation](https://cloud.google.com/spanner/docs/compute-capacity)
624
693
// for more information about nodes and processing units.
625
694
int32 processing_units = 9 ;
626
695
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
+
627
703
// Output only. The current instance state. For
628
704
// [CreateInstance][google.spanner.admin.instance.v1.InstanceAdmin.CreateInstance],
629
705
// the state must be either omitted or set to `CREATING`. For
0 commit comments