Skip to content
This repository has been archived by the owner on Sep 5, 2023. It is now read-only.

Commit

Permalink
feat: temporally remove the version fields (#3)
Browse files Browse the repository at this point in the history
- [ ] Regenerate this pull request now.

feat: add a field in cluster to describe whether the machine is disabled.
fix: mark VPC project and service account as optional fields and add details for service account format

PiperOrigin-RevId: 478593325

Source-Link: https://togithub.com/googleapis/googleapis/commit/052985c2c39acb3019459d0cc84664d50a616569

Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/3c7cb94bca5bdb00aea1a3695f63d86ba0d62583
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiM2M3Y2I5NGJjYTViZGIwMGFlYTFhMzY5NWY2M2Q4NmJhMGQ2MjU4MyJ9
  • Loading branch information
gcf-owl-bot[bot] committed Oct 3, 2022
1 parent ff0e754 commit 6c98a68
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 53 deletions.
54 changes: 17 additions & 37 deletions google/cloud/edgecontainer_v1/types/resources.py
Expand Up @@ -86,13 +86,6 @@ class Cluster(proto.Message):
maintenance_policy (google.cloud.edgecontainer_v1.types.MaintenancePolicy):
Optional. Cluster-wide maintenance policy
configuration.
control_plane_version (str):
Output only. The control plane release
version
node_version (str):
Output only. The lowest release version among
all worker nodes. This field can be empty if the
cluster does not have any worker nodes.
"""

name = proto.Field(
Expand Down Expand Up @@ -146,14 +139,6 @@ class Cluster(proto.Message):
number=12,
message="MaintenancePolicy",
)
control_plane_version = proto.Field(
proto.STRING,
number=13,
)
node_version = proto.Field(
proto.STRING,
number=14,
)


class ClusterNetworking(proto.Message):
Expand Down Expand Up @@ -275,9 +260,6 @@ class NodePool(proto.Message):
local_disk_encryption (google.cloud.edgecontainer_v1.types.NodePool.LocalDiskEncryption):
Optional. Local disk encryption options. This
field is only used when enabling CMEK support.
node_version (str):
Output only. The lowest release version among
all worker nodes.
"""

class LocalDiskEncryption(proto.Message):
Expand Down Expand Up @@ -364,10 +346,6 @@ class LocalDiskEncryption(proto.Message):
number=9,
message=LocalDiskEncryption,
)
node_version = proto.Field(
proto.STRING,
number=10,
)


class Machine(proto.Message):
Expand All @@ -394,9 +372,10 @@ class Machine(proto.Message):
zone (str):
The Google Distributed Cloud Edge zone of
this machine.
version (str):
Output only. The software version of the
machine.
disabled (bool):
Output only. Whether the machine is disabled.
If disabled, the machine is unable to enter
service.
"""

name = proto.Field(
Expand Down Expand Up @@ -426,9 +405,9 @@ class Machine(proto.Message):
proto.STRING,
number=6,
)
version = proto.Field(
proto.STRING,
number=7,
disabled = proto.Field(
proto.BOOL,
number=8,
)


Expand Down Expand Up @@ -462,9 +441,9 @@ class VpnConnection(proto.Message):
vpc (str):
The network ID of VPC to connect to.
vpc_project (google.cloud.edgecontainer_v1.types.VpnConnection.VpcProject):
Project detail of the VPC network. Required
if VPC is in a different project than the
cluster project.
Optional. Project detail of the VPC network.
Required if VPC is in a different project than
the cluster project.
enable_high_availability (bool):
Whether this VPN connection has HA enabled on
cluster side. If enabled, when creating VPN
Expand All @@ -489,12 +468,13 @@ class VpcProject(proto.Message):
specified, it is the same as the cluster
project.
service_account (str):
The service account in the VPC project configured by user.
It is used to create/delete Cloud Router and Cloud HA VPNs
for VPN connection. If this SA is changed during/after a VPN
connection is created, you need to remove the Cloud Router
and Cloud VPN resources in \|project_id|. Must be set if
\|project_id\| is set.
Optional. The service account in the VPC project configured
by user. It is used to create/delete Cloud Router and Cloud
HA VPNs for VPN connection. If this SA is changed
during/after a VPN connection is created, you need to remove
the Cloud Router and Cloud VPN resources in \|project_id|.
It is in the form of
service-{project_number}@gcp-sa-edgecontainer.iam.gserviceaccount.com.
"""

project_id = proto.Field(
Expand Down
20 changes: 4 additions & 16 deletions tests/unit/gapic/edgecontainer_v1/test_edge_container.py
Expand Up @@ -1143,8 +1143,6 @@ def test_get_cluster(request_type, transport: str = "grpc"):
default_max_pods_per_node=2634,
endpoint="endpoint_value",
cluster_ca_certificate="cluster_ca_certificate_value",
control_plane_version="control_plane_version_value",
node_version="node_version_value",
)
response = client.get_cluster(request)

Expand All @@ -1159,8 +1157,6 @@ def test_get_cluster(request_type, transport: str = "grpc"):
assert response.default_max_pods_per_node == 2634
assert response.endpoint == "endpoint_value"
assert response.cluster_ca_certificate == "cluster_ca_certificate_value"
assert response.control_plane_version == "control_plane_version_value"
assert response.node_version == "node_version_value"


def test_get_cluster_empty_call():
Expand Down Expand Up @@ -1201,8 +1197,6 @@ async def test_get_cluster_async(
default_max_pods_per_node=2634,
endpoint="endpoint_value",
cluster_ca_certificate="cluster_ca_certificate_value",
control_plane_version="control_plane_version_value",
node_version="node_version_value",
)
)
response = await client.get_cluster(request)
Expand All @@ -1218,8 +1212,6 @@ async def test_get_cluster_async(
assert response.default_max_pods_per_node == 2634
assert response.endpoint == "endpoint_value"
assert response.cluster_ca_certificate == "cluster_ca_certificate_value"
assert response.control_plane_version == "control_plane_version_value"
assert response.node_version == "node_version_value"


@pytest.mark.asyncio
Expand Down Expand Up @@ -2769,7 +2761,6 @@ def test_get_node_pool(request_type, transport: str = "grpc"):
node_location="node_location_value",
node_count=1070,
machine_filter="machine_filter_value",
node_version="node_version_value",
)
response = client.get_node_pool(request)

Expand All @@ -2784,7 +2775,6 @@ def test_get_node_pool(request_type, transport: str = "grpc"):
assert response.node_location == "node_location_value"
assert response.node_count == 1070
assert response.machine_filter == "machine_filter_value"
assert response.node_version == "node_version_value"


def test_get_node_pool_empty_call():
Expand Down Expand Up @@ -2825,7 +2815,6 @@ async def test_get_node_pool_async(
node_location="node_location_value",
node_count=1070,
machine_filter="machine_filter_value",
node_version="node_version_value",
)
)
response = await client.get_node_pool(request)
Expand All @@ -2841,7 +2830,6 @@ async def test_get_node_pool_async(
assert response.node_location == "node_location_value"
assert response.node_count == 1070
assert response.machine_filter == "machine_filter_value"
assert response.node_version == "node_version_value"


@pytest.mark.asyncio
Expand Down Expand Up @@ -4144,7 +4132,7 @@ def test_get_machine(request_type, transport: str = "grpc"):
name="name_value",
hosted_node="hosted_node_value",
zone="zone_value",
version="version_value",
disabled=True,
)
response = client.get_machine(request)

Expand All @@ -4158,7 +4146,7 @@ def test_get_machine(request_type, transport: str = "grpc"):
assert response.name == "name_value"
assert response.hosted_node == "hosted_node_value"
assert response.zone == "zone_value"
assert response.version == "version_value"
assert response.disabled is True


def test_get_machine_empty_call():
Expand Down Expand Up @@ -4198,7 +4186,7 @@ async def test_get_machine_async(
name="name_value",
hosted_node="hosted_node_value",
zone="zone_value",
version="version_value",
disabled=True,
)
)
response = await client.get_machine(request)
Expand All @@ -4213,7 +4201,7 @@ async def test_get_machine_async(
assert response.name == "name_value"
assert response.hosted_node == "hosted_node_value"
assert response.zone == "zone_value"
assert response.version == "version_value"
assert response.disabled is True


@pytest.mark.asyncio
Expand Down

0 comments on commit 6c98a68

Please sign in to comment.