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

Commit

Permalink
feat: add kubernetes_resource field (#107)
Browse files Browse the repository at this point in the history
- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 423151400

Source-Link: googleapis/googleapis@6f4ad75

Source-Link: googleapis/googleapis-gen@7d0abac
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiN2QwYWJhY2IzMjlkZWZkY2I0N2NiMGY2YjIzMzU4NjQzNDk0NDBjYSJ9

docs: update API annotation
  • Loading branch information
gcf-owl-bot[bot] committed Jan 21, 2022
1 parent 0411893 commit a887e18
Show file tree
Hide file tree
Showing 8 changed files with 161 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .coveragerc
Expand Up @@ -4,7 +4,7 @@ branch = True
[report]
show_missing = True
omit =
google/cloud/gkehub/multiclusteringress/__init__.py
google/cloud/gkehub/__init__.py
exclude_lines =
# Re-enable the standard pragma
pragma: NO COVER
Expand Down
6 changes: 6 additions & 0 deletions google/cloud/gkehub/__init__.py
Expand Up @@ -27,9 +27,12 @@
from google.cloud.gkehub_v1.types.membership import Authority
from google.cloud.gkehub_v1.types.membership import GkeCluster
from google.cloud.gkehub_v1.types.membership import KubernetesMetadata
from google.cloud.gkehub_v1.types.membership import KubernetesResource
from google.cloud.gkehub_v1.types.membership import Membership
from google.cloud.gkehub_v1.types.membership import MembershipEndpoint
from google.cloud.gkehub_v1.types.membership import MembershipState
from google.cloud.gkehub_v1.types.membership import ResourceManifest
from google.cloud.gkehub_v1.types.membership import ResourceOptions
from google.cloud.gkehub_v1.types.service import ConnectAgentResource
from google.cloud.gkehub_v1.types.service import CreateFeatureRequest
from google.cloud.gkehub_v1.types.service import CreateMembershipRequest
Expand Down Expand Up @@ -61,9 +64,12 @@
"Authority",
"GkeCluster",
"KubernetesMetadata",
"KubernetesResource",
"Membership",
"MembershipEndpoint",
"MembershipState",
"ResourceManifest",
"ResourceOptions",
"ConnectAgentResource",
"CreateFeatureRequest",
"CreateMembershipRequest",
Expand Down
6 changes: 6 additions & 0 deletions google/cloud/gkehub_v1/__init__.py
Expand Up @@ -27,9 +27,12 @@
from .types.membership import Authority
from .types.membership import GkeCluster
from .types.membership import KubernetesMetadata
from .types.membership import KubernetesResource
from .types.membership import Membership
from .types.membership import MembershipEndpoint
from .types.membership import MembershipState
from .types.membership import ResourceManifest
from .types.membership import ResourceOptions
from .types.service import ConnectAgentResource
from .types.service import CreateFeatureRequest
from .types.service import CreateMembershipRequest
Expand Down Expand Up @@ -68,6 +71,7 @@
"GkeCluster",
"GkeHubClient",
"KubernetesMetadata",
"KubernetesResource",
"ListFeaturesRequest",
"ListFeaturesResponse",
"ListMembershipsRequest",
Expand All @@ -78,6 +82,8 @@
"MembershipFeatureState",
"MembershipState",
"OperationMetadata",
"ResourceManifest",
"ResourceOptions",
"TypeMeta",
"UpdateFeatureRequest",
"UpdateMembershipRequest",
Expand Down
14 changes: 7 additions & 7 deletions google/cloud/gkehub_v1/services/gke_hub/async_client.py
Expand Up @@ -275,8 +275,8 @@ async def list_features(
The request object. Request message for
`GkeHub.ListFeatures` method.
parent (:class:`str`):
The parent (project and location) where the Features
will be listed. Specified in the format
Required. The parent (project and location) where the
Features will be listed. Specified in the format
``projects/*/locations/*``.
This corresponds to the ``parent`` field
Expand Down Expand Up @@ -426,7 +426,7 @@ async def get_feature(
The request object. Request message for
`GkeHub.GetFeature` method.
name (:class:`str`):
The Feature resource name in the format
Required. The Feature resource name in the format
``projects/*/locations/*/features/*``
This corresponds to the ``name`` field
Expand Down Expand Up @@ -614,8 +614,8 @@ async def create_feature(
The request object. Request message for the
`GkeHub.CreateFeature` method.
parent (:class:`str`):
The parent (project and location) where the Feature will
be created. Specified in the format
Required. The parent (project and location) where the
Feature will be created. Specified in the format
``projects/*/locations/*``.
This corresponds to the ``parent`` field
Expand Down Expand Up @@ -808,7 +808,7 @@ async def delete_feature(
The request object. Request message for
`GkeHub.DeleteFeature` method.
name (:class:`str`):
The Feature resource name in the format
Required. The Feature resource name in the format
``projects/*/locations/*/features/*``.
This corresponds to the ``name`` field
Expand Down Expand Up @@ -1009,7 +1009,7 @@ async def update_feature(
The request object. Request message for
`GkeHub.UpdateFeature` method.
name (:class:`str`):
The Feature resource name in the format
Required. The Feature resource name in the format
``projects/*/locations/*/features/*``.
This corresponds to the ``name`` field
Expand Down
14 changes: 7 additions & 7 deletions google/cloud/gkehub_v1/services/gke_hub/client.py
Expand Up @@ -489,8 +489,8 @@ def list_features(
The request object. Request message for
`GkeHub.ListFeatures` method.
parent (str):
The parent (project and location) where the Features
will be listed. Specified in the format
Required. The parent (project and location) where the
Features will be listed. Specified in the format
``projects/*/locations/*``.
This corresponds to the ``parent`` field
Expand Down Expand Up @@ -640,7 +640,7 @@ def get_feature(
The request object. Request message for
`GkeHub.GetFeature` method.
name (str):
The Feature resource name in the format
Required. The Feature resource name in the format
``projects/*/locations/*/features/*``
This corresponds to the ``name`` field
Expand Down Expand Up @@ -828,8 +828,8 @@ def create_feature(
The request object. Request message for the
`GkeHub.CreateFeature` method.
parent (str):
The parent (project and location) where the Feature will
be created. Specified in the format
Required. The parent (project and location) where the
Feature will be created. Specified in the format
``projects/*/locations/*``.
This corresponds to the ``parent`` field
Expand Down Expand Up @@ -1022,7 +1022,7 @@ def delete_feature(
The request object. Request message for
`GkeHub.DeleteFeature` method.
name (str):
The Feature resource name in the format
Required. The Feature resource name in the format
``projects/*/locations/*/features/*``.
This corresponds to the ``name`` field
Expand Down Expand Up @@ -1223,7 +1223,7 @@ def update_feature(
The request object. Request message for
`GkeHub.UpdateFeature` method.
name (str):
The Feature resource name in the format
Required. The Feature resource name in the format
``projects/*/locations/*/features/*``.
This corresponds to the ``name`` field
Expand Down
6 changes: 6 additions & 0 deletions google/cloud/gkehub_v1/types/__init__.py
Expand Up @@ -26,9 +26,12 @@
Authority,
GkeCluster,
KubernetesMetadata,
KubernetesResource,
Membership,
MembershipEndpoint,
MembershipState,
ResourceManifest,
ResourceOptions,
)
from .service import (
ConnectAgentResource,
Expand Down Expand Up @@ -61,9 +64,12 @@
"Authority",
"GkeCluster",
"KubernetesMetadata",
"KubernetesResource",
"Membership",
"MembershipEndpoint",
"MembershipState",
"ResourceManifest",
"ResourceOptions",
"ConnectAgentResource",
"CreateFeatureRequest",
"CreateMembershipRequest",
Expand Down
119 changes: 119 additions & 0 deletions google/cloud/gkehub_v1/types/membership.py
Expand Up @@ -23,6 +23,9 @@
manifest={
"Membership",
"MembershipEndpoint",
"KubernetesResource",
"ResourceOptions",
"ResourceManifest",
"GkeCluster",
"KubernetesMetadata",
"MembershipState",
Expand Down Expand Up @@ -138,12 +141,128 @@ class MembershipEndpoint(proto.Message):
kubernetes_metadata (google.cloud.gkehub_v1.types.KubernetesMetadata):
Output only. Useful Kubernetes-specific
metadata.
kubernetes_resource (google.cloud.gkehub_v1.types.KubernetesResource):
Optional. The in-cluster Kubernetes Resources that should be
applied for a correctly registered cluster, in the steady
state. These resources:
- Ensure that the cluster is exclusively registered to one
and only one Hub Membership.
- Propagate Workload Pool Information available in the
Membership Authority field.
- Ensure proper initial configuration of default Hub
Features.
"""

gke_cluster = proto.Field(proto.MESSAGE, number=1, message="GkeCluster",)
kubernetes_metadata = proto.Field(
proto.MESSAGE, number=2, message="KubernetesMetadata",
)
kubernetes_resource = proto.Field(
proto.MESSAGE, number=3, message="KubernetesResource",
)


class KubernetesResource(proto.Message):
r"""KubernetesResource contains the YAML manifests and
configuration for Membership Kubernetes resources in the
cluster. After CreateMembership or UpdateMembership, these
resources should be re-applied in the cluster.
Attributes:
membership_cr_manifest (str):
Input only. The YAML representation of the
Membership CR. This field is ignored for GKE
clusters where Hub can read the CR directly.
Callers should provide the CR that is currently
present in the cluster during CreateMembership
or UpdateMembership, or leave this field empty
if none exists. The CR manifest is used to
validate the cluster has not been registered
with another Membership.
membership_resources (Sequence[google.cloud.gkehub_v1.types.ResourceManifest]):
Output only. Additional Kubernetes resources
that need to be applied to the cluster after
Membership creation, and after every update.
This field is only populated in the Membership
returned from a successful long-running
operation from CreateMembership or
UpdateMembership. It is not populated during
normal GetMembership or ListMemberships
requests. To get the resource manifest after the
initial registration, the caller should make a
UpdateMembership call with an empty field mask.
connect_resources (Sequence[google.cloud.gkehub_v1.types.ResourceManifest]):
Output only. The Kubernetes resources for
installing the GKE Connect agent
This field is only populated in the Membership
returned from a successful long-running
operation from CreateMembership or
UpdateMembership. It is not populated during
normal GetMembership or ListMemberships
requests. To get the resource manifest after the
initial registration, the caller should make a
UpdateMembership call with an empty field mask.
resource_options (google.cloud.gkehub_v1.types.ResourceOptions):
Optional. Options for Kubernetes resource
generation.
"""

membership_cr_manifest = proto.Field(proto.STRING, number=1,)
membership_resources = proto.RepeatedField(
proto.MESSAGE, number=2, message="ResourceManifest",
)
connect_resources = proto.RepeatedField(
proto.MESSAGE, number=3, message="ResourceManifest",
)
resource_options = proto.Field(proto.MESSAGE, number=4, message="ResourceOptions",)


class ResourceOptions(proto.Message):
r"""ResourceOptions represent options for Kubernetes resource
generation.
Attributes:
connect_version (str):
Optional. The Connect agent version to use for
connect_resources. Defaults to the latest GKE Connect
version. The version must be a currently supported version,
obsolete versions will be rejected.
v1beta1_crd (bool):
Optional. Use ``apiextensions/v1beta1`` instead of
``apiextensions/v1`` for CustomResourceDefinition resources.
This option should be set for clusters with Kubernetes
apiserver versions <1.16.
k8s_version (str):
Optional. Major version of the Kubernetes cluster. This is
only used to determine which version to use for the
CustomResourceDefinition resources,
``apiextensions/v1beta1`` or\ ``apiextensions/v1``.
"""

connect_version = proto.Field(proto.STRING, number=1,)
v1beta1_crd = proto.Field(proto.BOOL, number=2,)
k8s_version = proto.Field(proto.STRING, number=3,)


class ResourceManifest(proto.Message):
r"""ResourceManifest represents a single Kubernetes resource to
be applied to the cluster.
Attributes:
manifest (str):
YAML manifest of the resource.
cluster_scoped (bool):
Whether the resource provided in the manifest is
``cluster_scoped``. If unset, the manifest is assumed to be
namespace scoped.
This field is used for REST mapping when applying the
resource in a cluster.
"""

manifest = proto.Field(proto.STRING, number=1,)
cluster_scoped = proto.Field(proto.BOOL, number=2,)


class GkeCluster(proto.Message):
Expand Down
16 changes: 9 additions & 7 deletions google/cloud/gkehub_v1/types/service.py
Expand Up @@ -360,8 +360,9 @@ class ListFeaturesRequest(proto.Message):
Attributes:
parent (str):
The parent (project and location) where the Features will be
listed. Specified in the format ``projects/*/locations/*``.
Required. The parent (project and location) where the
Features will be listed. Specified in the format
``projects/*/locations/*``.
page_size (int):
When requesting a 'page' of resources, ``page_size``
specifies number of resources to return. If unspecified or
Expand Down Expand Up @@ -428,7 +429,7 @@ class GetFeatureRequest(proto.Message):
Attributes:
name (str):
The Feature resource name in the format
Required. The Feature resource name in the format
``projects/*/locations/*/features/*``
"""

Expand All @@ -440,8 +441,9 @@ class CreateFeatureRequest(proto.Message):
Attributes:
parent (str):
The parent (project and location) where the Feature will be
created. Specified in the format ``projects/*/locations/*``.
Required. The parent (project and location) where the
Feature will be created. Specified in the format
``projects/*/locations/*``.
feature_id (str):
The ID of the feature to create.
resource (google.cloud.gkehub_v1.types.Feature):
Expand Down Expand Up @@ -477,7 +479,7 @@ class DeleteFeatureRequest(proto.Message):
Attributes:
name (str):
The Feature resource name in the format
Required. The Feature resource name in the format
``projects/*/locations/*/features/*``.
force (bool):
If set to true, the delete will ignore any outstanding
Expand Down Expand Up @@ -514,7 +516,7 @@ class UpdateFeatureRequest(proto.Message):
Attributes:
name (str):
The Feature resource name in the format
Required. The Feature resource name in the format
``projects/*/locations/*/features/*``.
update_mask (google.protobuf.field_mask_pb2.FieldMask):
Mask of fields to update.
Expand Down

0 comments on commit a887e18

Please sign in to comment.