Skip to content

Commit

Permalink
feat: [google-cloud-run]support manual instance count in Cloud Run fo…
Browse files Browse the repository at this point in the history
…r manual scaling feature (#13286)

BEGIN_COMMIT_OVERRIDE
feat:support manual instance count in Cloud Run for manual scaling
feature
END_COMMIT_OVERRIDE

- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 697723876

Source-Link:
googleapis/googleapis@c6eb517

Source-Link:
googleapis/googleapis-gen@7dd2077
Copy-Tag:
eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXJ1bi8uT3dsQm90LnlhbWwiLCJoIjoiN2RkMjA3N2I1YmNhYjlkOGQ3MmQxYzBlMzhjNTI0MTQzNWVjNjE2ZCJ9

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: ohmayr <[email protected]>
  • Loading branch information
3 people authored Nov 20, 2024
1 parent 3535963 commit 16b5ba7
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "0.10.12" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "0.10.12" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,9 @@ class ServiceScaling(proto.Message):
r"""Scaling settings applied at the service level rather than
at the revision level.
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
Attributes:
min_instance_count (int):
Optional. total min instances for the
Expand All @@ -287,6 +290,14 @@ class ServiceScaling(proto.Message):
on the percent of traffic they are receiving.
scaling_mode (google.cloud.run_v2.types.ServiceScaling.ScalingMode):
Optional. The scaling mode for the service.
manual_instance_count (int):
Optional. total instance count for the
service in manual scaling mode. This number of
instances is divided among all revisions with
specified traffic based on the percent of
traffic they are receiving.
This field is a member of `oneof`_ ``_manual_instance_count``.
"""

class ScalingMode(proto.Enum):
Expand Down Expand Up @@ -316,6 +327,11 @@ class ScalingMode(proto.Enum):
number=3,
enum=ScalingMode,
)
manual_instance_count: int = proto.Field(
proto.INT32,
number=6,
optional=True,
)


class NodeSelector(proto.Message):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-run",
"version": "0.10.12"
"version": "0.1.0"
},
"snippets": [
{
Expand Down
12 changes: 10 additions & 2 deletions packages/google-cloud-run/tests/unit/gapic/run_v2/test_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -5865,7 +5865,11 @@ def test_create_service_rest_call_success(request_type):
"tag": "tag_value",
}
],
"scaling": {"min_instance_count": 1920, "scaling_mode": 1},
"scaling": {
"min_instance_count": 1920,
"scaling_mode": 1,
"manual_instance_count": 2234,
},
"invoker_iam_disabled": True,
"default_uri_disabled": True,
"urls": ["urls_value1", "urls_value2"],
Expand Down Expand Up @@ -6486,7 +6490,11 @@ def test_update_service_rest_call_success(request_type):
"tag": "tag_value",
}
],
"scaling": {"min_instance_count": 1920, "scaling_mode": 1},
"scaling": {
"min_instance_count": 1920,
"scaling_mode": 1,
"manual_instance_count": 2234,
},
"invoker_iam_disabled": True,
"default_uri_disabled": True,
"urls": ["urls_value1", "urls_value2"],
Expand Down

0 comments on commit 16b5ba7

Please sign in to comment.