Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
surbhigarg92 committed Nov 6, 2023
2 parents ee5b3a3 + 38d62b2 commit f8c258d
Show file tree
Hide file tree
Showing 57 changed files with 2,407 additions and 477 deletions.
4 changes: 2 additions & 2 deletions .github/.OwlBot.lock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
# limitations under the License.
docker:
image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest
digest: sha256:3e3800bb100af5d7f9e810d48212b37812c1856d20ffeafb99ebe66461b61fc7
# created: 2023-08-02T10:53:29.114535628Z
digest: sha256:30470597773378105e239b59fce8eb27cc97375580d592699206d17d117143d0
# created: 2023-11-03T00:57:07.335914631Z
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ docs.metadata

# Virtual environment
env/
venv/

# Test logs
coverage.xml
Expand Down
55 changes: 28 additions & 27 deletions .kokoro/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -113,30 +113,30 @@ commonmark==0.9.1 \
--hash=sha256:452f9dc859be7f06631ddcb328b6919c67984aca654e5fefb3914d54691aed60 \
--hash=sha256:da2f38c92590f83de410ba1a3cbceafbc74fee9def35f9251ba9a971d6d66fd9
# via rich
cryptography==41.0.3 \
--hash=sha256:0d09fb5356f975974dbcb595ad2d178305e5050656affb7890a1583f5e02a306 \
--hash=sha256:23c2d778cf829f7d0ae180600b17e9fceea3c2ef8b31a99e3c694cbbf3a24b84 \
--hash=sha256:3fb248989b6363906827284cd20cca63bb1a757e0a2864d4c1682a985e3dca47 \
--hash=sha256:41d7aa7cdfded09b3d73a47f429c298e80796c8e825ddfadc84c8a7f12df212d \
--hash=sha256:42cb413e01a5d36da9929baa9d70ca90d90b969269e5a12d39c1e0d475010116 \
--hash=sha256:4c2f0d35703d61002a2bbdcf15548ebb701cfdd83cdc12471d2bae80878a4207 \
--hash=sha256:4fd871184321100fb400d759ad0cddddf284c4b696568204d281c902fc7b0d81 \
--hash=sha256:5259cb659aa43005eb55a0e4ff2c825ca111a0da1814202c64d28a985d33b087 \
--hash=sha256:57a51b89f954f216a81c9d057bf1a24e2f36e764a1ca9a501a6964eb4a6800dd \
--hash=sha256:652627a055cb52a84f8c448185922241dd5217443ca194d5739b44612c5e6507 \
--hash=sha256:67e120e9a577c64fe1f611e53b30b3e69744e5910ff3b6e97e935aeb96005858 \
--hash=sha256:6af1c6387c531cd364b72c28daa29232162010d952ceb7e5ca8e2827526aceae \
--hash=sha256:6d192741113ef5e30d89dcb5b956ef4e1578f304708701b8b73d38e3e1461f34 \
--hash=sha256:7efe8041897fe7a50863e51b77789b657a133c75c3b094e51b5e4b5cec7bf906 \
--hash=sha256:84537453d57f55a50a5b6835622ee405816999a7113267739a1b4581f83535bd \
--hash=sha256:8f09daa483aedea50d249ef98ed500569841d6498aa9c9f4b0531b9964658922 \
--hash=sha256:95dd7f261bb76948b52a5330ba5202b91a26fbac13ad0e9fc8a3ac04752058c7 \
--hash=sha256:a74fbcdb2a0d46fe00504f571a2a540532f4c188e6ccf26f1f178480117b33c4 \
--hash=sha256:a983e441a00a9d57a4d7c91b3116a37ae602907a7618b882c8013b5762e80574 \
--hash=sha256:ab8de0d091acbf778f74286f4989cf3d1528336af1b59f3e5d2ebca8b5fe49e1 \
--hash=sha256:aeb57c421b34af8f9fe830e1955bf493a86a7996cc1338fe41b30047d16e962c \
--hash=sha256:ce785cf81a7bdade534297ef9e490ddff800d956625020ab2ec2780a556c313e \
--hash=sha256:d0d651aa754ef58d75cec6edfbd21259d93810b73f6ec246436a21b7841908de
cryptography==41.0.4 \
--hash=sha256:004b6ccc95943f6a9ad3142cfabcc769d7ee38a3f60fb0dddbfb431f818c3a67 \
--hash=sha256:047c4603aeb4bbd8db2756e38f5b8bd7e94318c047cfe4efeb5d715e08b49311 \
--hash=sha256:0d9409894f495d465fe6fda92cb70e8323e9648af912d5b9141d616df40a87b8 \
--hash=sha256:23a25c09dfd0d9f28da2352503b23e086f8e78096b9fd585d1d14eca01613e13 \
--hash=sha256:2ed09183922d66c4ec5fdaa59b4d14e105c084dd0febd27452de8f6f74704143 \
--hash=sha256:35c00f637cd0b9d5b6c6bd11b6c3359194a8eba9c46d4e875a3660e3b400005f \
--hash=sha256:37480760ae08065437e6573d14be973112c9e6dcaf5f11d00147ee74f37a3829 \
--hash=sha256:3b224890962a2d7b57cf5eeb16ccaafba6083f7b811829f00476309bce2fe0fd \
--hash=sha256:5a0f09cefded00e648a127048119f77bc2b2ec61e736660b5789e638f43cc397 \
--hash=sha256:5b72205a360f3b6176485a333256b9bcd48700fc755fef51c8e7e67c4b63e3ac \
--hash=sha256:7e53db173370dea832190870e975a1e09c86a879b613948f09eb49324218c14d \
--hash=sha256:7febc3094125fc126a7f6fb1f420d0da639f3f32cb15c8ff0dc3997c4549f51a \
--hash=sha256:80907d3faa55dc5434a16579952ac6da800935cd98d14dbd62f6f042c7f5e839 \
--hash=sha256:86defa8d248c3fa029da68ce61fe735432b047e32179883bdb1e79ed9bb8195e \
--hash=sha256:8ac4f9ead4bbd0bc8ab2d318f97d85147167a488be0e08814a37eb2f439d5cf6 \
--hash=sha256:93530900d14c37a46ce3d6c9e6fd35dbe5f5601bf6b3a5c325c7bffc030344d9 \
--hash=sha256:9eeb77214afae972a00dee47382d2591abe77bdae166bda672fb1e24702a3860 \
--hash=sha256:b5f4dfe950ff0479f1f00eda09c18798d4f49b98f4e2006d644b3301682ebdca \
--hash=sha256:c3391bd8e6de35f6f1140e50aaeb3e2b3d6a9012536ca23ab0d9c35ec18c8a91 \
--hash=sha256:c880eba5175f4307129784eca96f4e70b88e57aa3f680aeba3bab0e980b0f37d \
--hash=sha256:cecfefa17042941f94ab54f769c8ce0fe14beff2694e9ac684176a2535bf9714 \
--hash=sha256:e40211b4923ba5a6dc9769eab704bdb3fbb58d56c5b336d30996c24fcf12aadb \
--hash=sha256:efc8ad4e6fc4f1752ebfb58aefece8b4e3c4cae940b0994d43649bdfce8d0d4f
# via
# gcp-releasetool
# secretstorage
Expand Down Expand Up @@ -382,6 +382,7 @@ protobuf==3.20.3 \
# gcp-docuploader
# gcp-releasetool
# google-api-core
# googleapis-common-protos
pyasn1==0.4.8 \
--hash=sha256:39c7e2ec30515947ff4e87fb6f456dfc6e84857d34be479c9d4a4ba4bf46aa5d \
--hash=sha256:aef77c9fb94a3ac588e87841208bdec464471d9871bd5050a287cc9a475cd0ba
Expand Down Expand Up @@ -466,9 +467,9 @@ typing-extensions==4.4.0 \
--hash=sha256:1511434bb92bf8dd198c12b1cc812e800d4181cfcb867674e0f8279cc93087aa \
--hash=sha256:16fa4864408f655d35ec496218b85f79b3437c829e93320c7c9215ccfd92489e
# via -r requirements.in
urllib3==1.26.12 \
--hash=sha256:3fa96cf423e6987997fc326ae8df396db2a8b7c667747d47ddd8ecba91f4a74e \
--hash=sha256:b930dd878d5a8afb066a637fbb35144fe7901e3b209d1cd4f524bd0e9deee997
urllib3==1.26.18 \
--hash=sha256:34b97092d7e0a3a8cf7cd10e386f401b3737364026c45e622aa02903dffe0f07 \
--hash=sha256:f8ecc1bba5667413457c529ab955bf8c67b45db799d159066261719e328580a0
# via
# requests
# twine
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ repos:
- id: end-of-file-fixer
- id: check-yaml
- repo: https://github.com/psf/black
rev: 22.3.0
rev: 23.7.0
hooks:
- id: black
- repo: https://github.com/pycqa/flake8
Expand Down
12 changes: 6 additions & 6 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ API Documentation
spanner_v1/transaction
spanner_v1/streamed

spanner_v1/services
spanner_v1/types
spanner_admin_database_v1/services
spanner_admin_database_v1/types
spanner_v1/services_
spanner_v1/types_
spanner_admin_database_v1/services_
spanner_admin_database_v1/types_
spanner_admin_database_v1/database_admin
spanner_admin_instance_v1/services
spanner_admin_instance_v1/types
spanner_admin_instance_v1/services_
spanner_admin_instance_v1/types_
spanner_admin_instance_v1/instance_admin


Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3183,7 +3183,6 @@ def __call__(
timeout: Optional[float] = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> None:

r"""Call the cancel operation method over HTTP.
Args:
Expand Down Expand Up @@ -3258,7 +3257,6 @@ def __call__(
timeout: Optional[float] = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> None:

r"""Call the delete operation method over HTTP.
Args:
Expand Down Expand Up @@ -3333,7 +3331,6 @@ def __call__(
timeout: Optional[float] = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> operations_pb2.Operation:

r"""Call the get operation method over HTTP.
Args:
Expand Down Expand Up @@ -3412,7 +3409,6 @@ def __call__(
timeout: Optional[float] = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> operations_pb2.ListOperationsResponse:

r"""Call the list operations method over HTTP.
Args:
Expand Down
2 changes: 2 additions & 0 deletions google/cloud/spanner_admin_instance_v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from .services.instance_admin import InstanceAdminAsyncClient

from .types.common import OperationProgress
from .types.spanner_instance_admin import AutoscalingConfig
from .types.spanner_instance_admin import CreateInstanceConfigMetadata
from .types.spanner_instance_admin import CreateInstanceConfigRequest
from .types.spanner_instance_admin import CreateInstanceMetadata
Expand All @@ -46,6 +47,7 @@

__all__ = (
"InstanceAdminAsyncClient",
"AutoscalingConfig",
"CreateInstanceConfigMetadata",
"CreateInstanceConfigRequest",
"CreateInstanceMetadata",
Expand Down
2 changes: 2 additions & 0 deletions google/cloud/spanner_admin_instance_v1/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
OperationProgress,
)
from .spanner_instance_admin import (
AutoscalingConfig,
CreateInstanceConfigMetadata,
CreateInstanceConfigRequest,
CreateInstanceMetadata,
Expand All @@ -42,6 +43,7 @@

__all__ = (
"OperationProgress",
"AutoscalingConfig",
"CreateInstanceConfigMetadata",
"CreateInstanceConfigRequest",
"CreateInstanceMetadata",
Expand Down
140 changes: 136 additions & 4 deletions google/cloud/spanner_admin_instance_v1/types/spanner_instance_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
manifest={
"ReplicaInfo",
"InstanceConfig",
"AutoscalingConfig",
"Instance",
"ListInstanceConfigsRequest",
"ListInstanceConfigsResponse",
Expand Down Expand Up @@ -297,6 +298,116 @@ class State(proto.Enum):
)


class AutoscalingConfig(proto.Message):
r"""Autoscaling config for an instance.
Attributes:
autoscaling_limits (google.cloud.spanner_admin_instance_v1.types.AutoscalingConfig.AutoscalingLimits):
Required. Autoscaling limits for an instance.
autoscaling_targets (google.cloud.spanner_admin_instance_v1.types.AutoscalingConfig.AutoscalingTargets):
Required. The autoscaling targets for an
instance.
"""

class AutoscalingLimits(proto.Message):
r"""The autoscaling limits for the instance. Users can define the
minimum and maximum compute capacity allocated to the instance, and
the autoscaler will only scale within that range. Users can either
use nodes or processing units to specify the limits, but should use
the same unit to set both the min_limit and max_limit.
This message has `oneof`_ fields (mutually exclusive fields).
For each oneof, at most one member field can be set at the same time.
Setting any member of the oneof automatically clears all other
members.
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
Attributes:
min_nodes (int):
Minimum number of nodes allocated to the
instance. If set, this number should be greater
than or equal to 1.
This field is a member of `oneof`_ ``min_limit``.
min_processing_units (int):
Minimum number of processing units allocated
to the instance. If set, this number should be
multiples of 1000.
This field is a member of `oneof`_ ``min_limit``.
max_nodes (int):
Maximum number of nodes allocated to the instance. If set,
this number should be greater than or equal to min_nodes.
This field is a member of `oneof`_ ``max_limit``.
max_processing_units (int):
Maximum number of processing units allocated to the
instance. If set, this number should be multiples of 1000
and be greater than or equal to min_processing_units.
This field is a member of `oneof`_ ``max_limit``.
"""

min_nodes: int = proto.Field(
proto.INT32,
number=1,
oneof="min_limit",
)
min_processing_units: int = proto.Field(
proto.INT32,
number=2,
oneof="min_limit",
)
max_nodes: int = proto.Field(
proto.INT32,
number=3,
oneof="max_limit",
)
max_processing_units: int = proto.Field(
proto.INT32,
number=4,
oneof="max_limit",
)

class AutoscalingTargets(proto.Message):
r"""The autoscaling targets for an instance.
Attributes:
high_priority_cpu_utilization_percent (int):
Required. The target high priority cpu utilization
percentage that the autoscaler should be trying to achieve
for the instance. This number is on a scale from 0 (no
utilization) to 100 (full utilization). The valid range is
[10, 90] inclusive.
storage_utilization_percent (int):
Required. The target storage utilization percentage that the
autoscaler should be trying to achieve for the instance.
This number is on a scale from 0 (no utilization) to 100
(full utilization). The valid range is [10, 100] inclusive.
"""

high_priority_cpu_utilization_percent: int = proto.Field(
proto.INT32,
number=1,
)
storage_utilization_percent: int = proto.Field(
proto.INT32,
number=2,
)

autoscaling_limits: AutoscalingLimits = proto.Field(
proto.MESSAGE,
number=1,
message=AutoscalingLimits,
)
autoscaling_targets: AutoscalingTargets = proto.Field(
proto.MESSAGE,
number=2,
message=AutoscalingTargets,
)


class Instance(proto.Message):
r"""An isolated set of Cloud Spanner resources on which databases
can be hosted.
Expand Down Expand Up @@ -325,21 +436,37 @@ class Instance(proto.Message):
node_count (int):
The number of nodes allocated to this instance. At most one
of either node_count or processing_units should be present
in the message. This may be zero in API responses for
instances that are not yet in state ``READY``.
in the message.
Users can set the node_count field to specify the target
number of nodes allocated to the instance.
This may be zero in API responses for instances that are not
yet in state ``READY``.
See `the
documentation <https://cloud.google.com/spanner/docs/compute-capacity>`__
for more information about nodes and processing units.
processing_units (int):
The number of processing units allocated to this instance.
At most one of processing_units or node_count should be
present in the message. This may be zero in API responses
for instances that are not yet in state ``READY``.
present in the message.
Users can set the processing_units field to specify the
target number of processing units allocated to the instance.
This may be zero in API responses for instances that are not
yet in state ``READY``.
See `the
documentation <https://cloud.google.com/spanner/docs/compute-capacity>`__
for more information about nodes and processing units.
autoscaling_config (google.cloud.spanner_admin_instance_v1.types.AutoscalingConfig):
Optional. The autoscaling configuration. Autoscaling is
enabled if this field is set. When autoscaling is enabled,
node_count and processing_units are treated as OUTPUT_ONLY
fields and reflect the current compute capacity allocated to
the instance.
state (google.cloud.spanner_admin_instance_v1.types.Instance.State):
Output only. The current instance state. For
[CreateInstance][google.spanner.admin.instance.v1.InstanceAdmin.CreateInstance],
Expand Down Expand Up @@ -424,6 +551,11 @@ class State(proto.Enum):
proto.INT32,
number=9,
)
autoscaling_config: "AutoscalingConfig" = proto.Field(
proto.MESSAGE,
number=17,
message="AutoscalingConfig",
)
state: State = proto.Field(
proto.ENUM,
number=6,
Expand Down
15 changes: 15 additions & 0 deletions google/cloud/spanner_v1/gapic_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
"batch_create_sessions"
]
},
"BatchWrite": {
"methods": [
"batch_write"
]
},
"BeginTransaction": {
"methods": [
"begin_transaction"
Expand Down Expand Up @@ -95,6 +100,11 @@
"batch_create_sessions"
]
},
"BatchWrite": {
"methods": [
"batch_write"
]
},
"BeginTransaction": {
"methods": [
"begin_transaction"
Expand Down Expand Up @@ -175,6 +185,11 @@
"batch_create_sessions"
]
},
"BatchWrite": {
"methods": [
"batch_write"
]
},
"BeginTransaction": {
"methods": [
"begin_transaction"
Expand Down
Loading

0 comments on commit f8c258d

Please sign in to comment.