Skip to content

Commit 113505c

Browse files
feat(spanner): add processing_units to Instance resource (#364)
* feat(spanner): add processing_units to Instance resource PiperOrigin-RevId: 378758342 Source-Link: googleapis/googleapis@d869871 Source-Link: googleapis/googleapis-gen@54cfa76 * 🦉 Updates from OwlBot Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 11853a5 commit 113505c

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

google/cloud/spanner_admin_instance_v1/types/spanner_instance_admin.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,11 @@ class Instance(proto.Message):
128128
See `the
129129
documentation <https://cloud.google.com/spanner/docs/instances#node_count>`__
130130
for more information about nodes.
131+
processing_units (int):
132+
The number of processing units allocated to this instance.
133+
At most one of processing_units or node_count should be
134+
present in the message. This may be zero in API responses
135+
for instances that are not yet in state ``READY``.
131136
state (google.cloud.spanner_admin_instance_v1.types.Instance.State):
132137
Output only. The current instance state. For
133138
[CreateInstance][google.spanner.admin.instance.v1.InstanceAdmin.CreateInstance],
@@ -177,6 +182,7 @@ class State(proto.Enum):
177182
config = proto.Field(proto.STRING, number=2,)
178183
display_name = proto.Field(proto.STRING, number=3,)
179184
node_count = proto.Field(proto.INT32, number=5,)
185+
processing_units = proto.Field(proto.INT32, number=9,)
180186
state = proto.Field(proto.ENUM, number=6, enum=State,)
181187
labels = proto.MapField(proto.STRING, proto.STRING, number=7,)
182188
endpoint_uris = proto.RepeatedField(proto.STRING, number=8,)

tests/unit/gapic/spanner_admin_instance_v1/test_instance_admin.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1488,6 +1488,7 @@ def test_get_instance(
14881488
config="config_value",
14891489
display_name="display_name_value",
14901490
node_count=1070,
1491+
processing_units=1743,
14911492
state=spanner_instance_admin.Instance.State.CREATING,
14921493
endpoint_uris=["endpoint_uris_value"],
14931494
)
@@ -1504,6 +1505,7 @@ def test_get_instance(
15041505
assert response.config == "config_value"
15051506
assert response.display_name == "display_name_value"
15061507
assert response.node_count == 1070
1508+
assert response.processing_units == 1743
15071509
assert response.state == spanner_instance_admin.Instance.State.CREATING
15081510
assert response.endpoint_uris == ["endpoint_uris_value"]
15091511

@@ -1549,6 +1551,7 @@ async def test_get_instance_async(
15491551
config="config_value",
15501552
display_name="display_name_value",
15511553
node_count=1070,
1554+
processing_units=1743,
15521555
state=spanner_instance_admin.Instance.State.CREATING,
15531556
endpoint_uris=["endpoint_uris_value"],
15541557
)
@@ -1566,6 +1569,7 @@ async def test_get_instance_async(
15661569
assert response.config == "config_value"
15671570
assert response.display_name == "display_name_value"
15681571
assert response.node_count == 1070
1572+
assert response.processing_units == 1743
15691573
assert response.state == spanner_instance_admin.Instance.State.CREATING
15701574
assert response.endpoint_uris == ["endpoint_uris_value"]
15711575

0 commit comments

Comments
 (0)