Skip to content

Commit 4f468fa

Browse files
feat: [google-cloud-alloydb] support for enabling outbound public IP on an instance (#13035)
BEGIN_COMMIT_OVERRIDE feat: support for enabling outbound public IP on an instance feat: support for getting outbound public IP addresses of an instance feat: support for setting maintenance update policy on a cluster feat: support for getting maintenance schedule of a cluster END_COMMIT_OVERRIDE - [ ] Regenerate this pull request now. feat: support for getting outbound public IP addresses of an instance feat: support for setting maintenance update policy on a cluster feat: support for getting maintenance schedule of a cluster PiperOrigin-RevId: 667707701 Source-Link: googleapis/googleapis@a1185ce Source-Link: googleapis/googleapis-gen@6ca9eb3 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWFsbG95ZGIvLk93bEJvdC55YW1sIiwiaCI6IjZjYTllYjNhNjljMmMzM2ZjYTg2YjhmNDE1MGFiYTg0NjkyNGY5Y2IifQ== --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: ohmayr <omairnaveed@ymail.com>
1 parent ea71725 commit 4f468fa

File tree

4 files changed

+152
-2
lines changed

4 files changed

+152
-2
lines changed

packages/google-cloud-alloydb/google/cloud/alloydb_v1beta/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
EncryptionInfo,
3636
Instance,
3737
InstanceView,
38+
MaintenanceSchedule,
39+
MaintenanceUpdatePolicy,
3840
MigrationSource,
3941
SslConfig,
4042
SupportedDatabaseFlag,
@@ -142,6 +144,8 @@
142144
"ListSupportedDatabaseFlagsResponse",
143145
"ListUsersRequest",
144146
"ListUsersResponse",
147+
"MaintenanceSchedule",
148+
"MaintenanceUpdatePolicy",
145149
"MigrationSource",
146150
"OperationMetadata",
147151
"PromoteClusterRequest",

packages/google-cloud-alloydb/google/cloud/alloydb_v1beta/types/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
EncryptionInfo,
3030
Instance,
3131
InstanceView,
32+
MaintenanceSchedule,
33+
MaintenanceUpdatePolicy,
3234
MigrationSource,
3335
SslConfig,
3436
SupportedDatabaseFlag,
@@ -95,6 +97,8 @@
9597
"EncryptionConfig",
9698
"EncryptionInfo",
9799
"Instance",
100+
"MaintenanceSchedule",
101+
"MaintenanceUpdatePolicy",
98102
"MigrationSource",
99103
"SslConfig",
100104
"SupportedDatabaseFlag",

packages/google-cloud-alloydb/google/cloud/alloydb_v1beta/types/resources.py

Lines changed: 99 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@
4040
"ContinuousBackupInfo",
4141
"BackupSource",
4242
"ContinuousBackupSource",
43+
"MaintenanceUpdatePolicy",
44+
"MaintenanceSchedule",
4345
"Cluster",
4446
"Instance",
4547
"ConnectionInfo",
@@ -622,6 +624,69 @@ class ContinuousBackupSource(proto.Message):
622624
)
623625

624626

627+
class MaintenanceUpdatePolicy(proto.Message):
628+
r"""MaintenanceUpdatePolicy defines the policy for system
629+
updates.
630+
631+
Attributes:
632+
maintenance_windows (MutableSequence[google.cloud.alloydb_v1beta.types.MaintenanceUpdatePolicy.MaintenanceWindow]):
633+
Preferred windows to perform maintenance.
634+
Currently limited to 1.
635+
"""
636+
637+
class MaintenanceWindow(proto.Message):
638+
r"""MaintenanceWindow specifies a preferred day and time for
639+
maintenance.
640+
641+
Attributes:
642+
day (google.type.dayofweek_pb2.DayOfWeek):
643+
Preferred day of the week for maintenance,
644+
e.g. MONDAY, TUESDAY, etc.
645+
start_time (google.type.timeofday_pb2.TimeOfDay):
646+
Preferred time to start the maintenance
647+
operation on the specified day. Maintenance will
648+
start within 1 hour of this time.
649+
"""
650+
651+
day: dayofweek_pb2.DayOfWeek = proto.Field(
652+
proto.ENUM,
653+
number=1,
654+
enum=dayofweek_pb2.DayOfWeek,
655+
)
656+
start_time: timeofday_pb2.TimeOfDay = proto.Field(
657+
proto.MESSAGE,
658+
number=2,
659+
message=timeofday_pb2.TimeOfDay,
660+
)
661+
662+
maintenance_windows: MutableSequence[MaintenanceWindow] = proto.RepeatedField(
663+
proto.MESSAGE,
664+
number=1,
665+
message=MaintenanceWindow,
666+
)
667+
668+
669+
class MaintenanceSchedule(proto.Message):
670+
r"""MaintenanceSchedule stores the maintenance schedule generated
671+
from the MaintenanceUpdatePolicy, once a maintenance rollout is
672+
triggered, if MaintenanceWindow is set, and if there is no
673+
conflicting DenyPeriod. The schedule is cleared once the update
674+
takes place. This field cannot be manually changed; modify the
675+
MaintenanceUpdatePolicy instead.
676+
677+
Attributes:
678+
start_time (google.protobuf.timestamp_pb2.Timestamp):
679+
Output only. The scheduled start time for the
680+
maintenance.
681+
"""
682+
683+
start_time: timestamp_pb2.Timestamp = proto.Field(
684+
proto.MESSAGE,
685+
number=1,
686+
message=timestamp_pb2.Timestamp,
687+
)
688+
689+
625690
class Cluster(proto.Message):
626691
r"""A cluster is a collection of regional AlloyDB resources. It
627692
can include a primary instance and one or more read pool
@@ -693,7 +758,7 @@ class Cluster(proto.Message):
693758
cluster resources are created and from which they are
694759
accessible via Private IP. The network must belong to the
695760
same project as the cluster. It is specified in the form:
696-
"projects/{project}/global/networks/{network_id}". This is
761+
``projects/{project}/global/networks/{network_id}``. This is
697762
required to create a cluster. Deprecated, use
698763
network_config.network instead.
699764
etag (str):
@@ -752,6 +817,13 @@ class Cluster(proto.Message):
752817
specific to PRIMARY cluster.
753818
satisfies_pzs (bool):
754819
Output only. Reserved for future use.
820+
maintenance_update_policy (google.cloud.alloydb_v1beta.types.MaintenanceUpdatePolicy):
821+
Optional. The maintenance update policy
822+
determines when to allow or deny updates.
823+
maintenance_schedule (google.cloud.alloydb_v1beta.types.MaintenanceSchedule):
824+
Output only. The maintenance schedule for the
825+
cluster, generated for a specific rollout if a
826+
maintenance window is set.
755827
"""
756828

757829
class State(proto.Enum):
@@ -830,7 +902,7 @@ class NetworkConfig(proto.Message):
830902
cluster resources are created and from which they are
831903
accessible via Private IP. The network must belong to the
832904
same project as the cluster. It is specified in the form:
833-
"projects/{project_number}/global/networks/{network_id}".
905+
``projects/{project_number}/global/networks/{network_id}``.
834906
This is required to create a cluster.
835907
allocated_ip_range (str):
836908
Optional. Name of the allocated IP range for the private IP
@@ -1014,6 +1086,16 @@ class PrimaryConfig(proto.Message):
10141086
proto.BOOL,
10151087
number=30,
10161088
)
1089+
maintenance_update_policy: "MaintenanceUpdatePolicy" = proto.Field(
1090+
proto.MESSAGE,
1091+
number=32,
1092+
message="MaintenanceUpdatePolicy",
1093+
)
1094+
maintenance_schedule: "MaintenanceSchedule" = proto.Field(
1095+
proto.MESSAGE,
1096+
number=37,
1097+
message="MaintenanceSchedule",
1098+
)
10171099

10181100

10191101
class Instance(proto.Message):
@@ -1147,6 +1229,9 @@ class Instance(proto.Message):
11471229
network_config (google.cloud.alloydb_v1beta.types.Instance.InstanceNetworkConfig):
11481230
Optional. Instance level network
11491231
configuration.
1232+
outbound_public_ip_addresses (MutableSequence[str]):
1233+
Output only. All outbound public IP addresses
1234+
configured for the instance.
11501235
"""
11511236

11521237
class State(proto.Enum):
@@ -1514,6 +1599,10 @@ class InstanceNetworkConfig(proto.Message):
15141599
enable_public_ip (bool):
15151600
Optional. Enabling public ip for the
15161601
instance.
1602+
enable_outbound_public_ip (bool):
1603+
Optional. Enabling an outbound public IP
1604+
address to support a database server sending
1605+
requests out into the internet.
15171606
"""
15181607

15191608
class AuthorizedNetwork(proto.Message):
@@ -1542,6 +1631,10 @@ class AuthorizedNetwork(proto.Message):
15421631
proto.BOOL,
15431632
number=2,
15441633
)
1634+
enable_outbound_public_ip: bool = proto.Field(
1635+
proto.BOOL,
1636+
number=3,
1637+
)
15451638

15461639
name: str = proto.Field(
15471640
proto.STRING,
@@ -1669,6 +1762,10 @@ class AuthorizedNetwork(proto.Message):
16691762
number=29,
16701763
message=InstanceNetworkConfig,
16711764
)
1765+
outbound_public_ip_addresses: MutableSequence[str] = proto.RepeatedField(
1766+
proto.STRING,
1767+
number=34,
1768+
)
16721769

16731770

16741771
class ConnectionInfo(proto.Message):

packages/google-cloud-alloydb/tests/unit/gapic/alloydb_v1beta/test_alloy_db_admin.py

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4942,6 +4942,7 @@ def test_get_instance(request_type, transport: str = "grpc"):
49424942
reconciling=True,
49434943
etag="etag_value",
49444944
satisfies_pzs=True,
4945+
outbound_public_ip_addresses=["outbound_public_ip_addresses_value"],
49454946
)
49464947
response = client.get_instance(request)
49474948

@@ -4965,6 +4966,9 @@ def test_get_instance(request_type, transport: str = "grpc"):
49654966
assert response.reconciling is True
49664967
assert response.etag == "etag_value"
49674968
assert response.satisfies_pzs is True
4969+
assert response.outbound_public_ip_addresses == [
4970+
"outbound_public_ip_addresses_value"
4971+
]
49684972

49694973

49704974
def test_get_instance_empty_call():
@@ -5075,6 +5079,7 @@ async def test_get_instance_empty_call_async():
50755079
reconciling=True,
50765080
etag="etag_value",
50775081
satisfies_pzs=True,
5082+
outbound_public_ip_addresses=["outbound_public_ip_addresses_value"],
50785083
)
50795084
)
50805085
response = await client.get_instance()
@@ -5155,6 +5160,7 @@ async def test_get_instance_async(
51555160
reconciling=True,
51565161
etag="etag_value",
51575162
satisfies_pzs=True,
5163+
outbound_public_ip_addresses=["outbound_public_ip_addresses_value"],
51585164
)
51595165
)
51605166
response = await client.get_instance(request)
@@ -5179,6 +5185,9 @@ async def test_get_instance_async(
51795185
assert response.reconciling is True
51805186
assert response.etag == "etag_value"
51815187
assert response.satisfies_pzs is True
5188+
assert response.outbound_public_ip_addresses == [
5189+
"outbound_public_ip_addresses_value"
5190+
]
51825191

51835192

51845193
@pytest.mark.asyncio
@@ -15285,6 +15294,10 @@ def test_create_cluster_rest(request_type):
1528515294
]
1528615295
},
1528715296
"satisfies_pzs": True,
15297+
"maintenance_update_policy": {
15298+
"maintenance_windows": [{"day": 1, "start_time": {}}]
15299+
},
15300+
"maintenance_schedule": {"start_time": {}},
1528815301
}
1528915302
# The version of a generated dependency at test runtime may differ from the version used during generation.
1529015303
# Delete any fields which are not present in the current runtime dependency
@@ -15766,6 +15779,10 @@ def test_update_cluster_rest(request_type):
1576615779
]
1576715780
},
1576815781
"satisfies_pzs": True,
15782+
"maintenance_update_policy": {
15783+
"maintenance_windows": [{"day": 1, "start_time": {}}]
15784+
},
15785+
"maintenance_schedule": {"start_time": {}},
1576915786
}
1577015787
# The version of a generated dependency at test runtime may differ from the version used during generation.
1577115788
# Delete any fields which are not present in the current runtime dependency
@@ -17093,6 +17110,10 @@ def test_create_secondary_cluster_rest(request_type):
1709317110
]
1709417111
},
1709517112
"satisfies_pzs": True,
17113+
"maintenance_update_policy": {
17114+
"maintenance_windows": [{"day": 1, "start_time": {}}]
17115+
},
17116+
"maintenance_schedule": {"start_time": {}},
1709617117
}
1709717118
# The version of a generated dependency at test runtime may differ from the version used during generation.
1709817119
# Delete any fields which are not present in the current runtime dependency
@@ -17909,6 +17930,7 @@ def test_get_instance_rest(request_type):
1790917930
reconciling=True,
1791017931
etag="etag_value",
1791117932
satisfies_pzs=True,
17933+
outbound_public_ip_addresses=["outbound_public_ip_addresses_value"],
1791217934
)
1791317935

1791417936
# Wrap the value into a proper Response obj
@@ -17936,6 +17958,9 @@ def test_get_instance_rest(request_type):
1793617958
assert response.reconciling is True
1793717959
assert response.etag == "etag_value"
1793817960
assert response.satisfies_pzs is True
17961+
assert response.outbound_public_ip_addresses == [
17962+
"outbound_public_ip_addresses_value"
17963+
]
1793917964

1794017965

1794117966
def test_get_instance_rest_use_cached_wrapped_rpc():
@@ -18283,7 +18308,12 @@ def test_create_instance_rest(request_type):
1828318308
"network_config": {
1828418309
"authorized_external_networks": [{"cidr_range": "cidr_range_value"}],
1828518310
"enable_public_ip": True,
18311+
"enable_outbound_public_ip": True,
1828618312
},
18313+
"outbound_public_ip_addresses": [
18314+
"outbound_public_ip_addresses_value1",
18315+
"outbound_public_ip_addresses_value2",
18316+
],
1828718317
}
1828818318
# The version of a generated dependency at test runtime may differ from the version used during generation.
1828918319
# Delete any fields which are not present in the current runtime dependency
@@ -18759,7 +18789,12 @@ def test_create_secondary_instance_rest(request_type):
1875918789
"network_config": {
1876018790
"authorized_external_networks": [{"cidr_range": "cidr_range_value"}],
1876118791
"enable_public_ip": True,
18792+
"enable_outbound_public_ip": True,
1876218793
},
18794+
"outbound_public_ip_addresses": [
18795+
"outbound_public_ip_addresses_value1",
18796+
"outbound_public_ip_addresses_value2",
18797+
],
1876318798
}
1876418799
# The version of a generated dependency at test runtime may differ from the version used during generation.
1876518800
# Delete any fields which are not present in the current runtime dependency
@@ -19249,7 +19284,12 @@ def test_batch_create_instances_rest(request_type):
1924919284
{"cidr_range": "cidr_range_value"}
1925019285
],
1925119286
"enable_public_ip": True,
19287+
"enable_outbound_public_ip": True,
1925219288
},
19289+
"outbound_public_ip_addresses": [
19290+
"outbound_public_ip_addresses_value1",
19291+
"outbound_public_ip_addresses_value2",
19292+
],
1925319293
},
1925419294
"request_id": "request_id_value",
1925519295
"validate_only": True,
@@ -19654,7 +19694,12 @@ def test_update_instance_rest(request_type):
1965419694
"network_config": {
1965519695
"authorized_external_networks": [{"cidr_range": "cidr_range_value"}],
1965619696
"enable_public_ip": True,
19697+
"enable_outbound_public_ip": True,
1965719698
},
19699+
"outbound_public_ip_addresses": [
19700+
"outbound_public_ip_addresses_value1",
19701+
"outbound_public_ip_addresses_value2",
19702+
],
1965819703
}
1965919704
# The version of a generated dependency at test runtime may differ from the version used during generation.
1966019705
# Delete any fields which are not present in the current runtime dependency

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy