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

Commit 3e1d60b

Browse files
feat: add monitoring_config field (#234)
* feat: add `monitoring_config` field feat: add `cluster_missing` on `GkeResource` feat: add `google_managed` on `MembershipEndpoint` feat: add `force` on `DeleteMembershipRequest` docs: update API annotation PiperOrigin-RevId: 525548423 Source-Link: googleapis/googleapis@1b897f4 Source-Link: https://github.com/googleapis/googleapis-gen/commit/935fadefeae60e94051bdfc9ff60a946734b7abf Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOTM1ZmFkZWZlYWU2MGU5NDA1MWJkZmM5ZmY2MGE5NDY3MzRiN2FiZiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent ed259f9 commit 3e1d60b

File tree

14 files changed

+189
-20
lines changed

14 files changed

+189
-20
lines changed

google/cloud/gkehub/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
Membership,
3838
MembershipEndpoint,
3939
MembershipState,
40+
MonitoringConfig,
4041
ResourceManifest,
4142
ResourceOptions,
4243
)
@@ -77,6 +78,7 @@
7778
"Membership",
7879
"MembershipEndpoint",
7980
"MembershipState",
81+
"MonitoringConfig",
8082
"ResourceManifest",
8183
"ResourceOptions",
8284
"ConnectAgentResource",

google/cloud/gkehub_v1/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
Membership,
3737
MembershipEndpoint,
3838
MembershipState,
39+
MonitoringConfig,
3940
ResourceManifest,
4041
ResourceOptions,
4142
)
@@ -89,6 +90,7 @@
8990
"MembershipFeatureSpec",
9091
"MembershipFeatureState",
9192
"MembershipState",
93+
"MonitoringConfig",
9294
"OperationMetadata",
9395
"ResourceManifest",
9496
"ResourceOptions",

google/cloud/gkehub_v1/services/gke_hub/async_client.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,10 @@ class GkeHubAsyncClient:
6666
- [Membership][google.cloud.gkehub.v1.Membership]
6767
- [Feature][google.cloud.gkehub.v1.Feature]
6868
69-
GKE Hub is currently only available in the global region.
69+
GKE Hub is currently available in the global region and all regions
70+
in https://cloud.google.com/compute/docs/regions-zones. Feature is
71+
only available in global region while membership is global region
72+
and all the regions.
7073
7174
**Membership management may be non-trivial:** it is recommended to
7275
use one of the Google-provided client libraries or tools where
@@ -270,7 +273,8 @@ async def sample_list_memberships():
270273
parent (:class:`str`):
271274
Required. The parent (project and location) where the
272275
Memberships will be listed. Specified in the format
273-
``projects/*/locations/*``.
276+
``projects/*/locations/*``. ``projects/*/locations/-``
277+
list memberships in all the regions.
274278
275279
This corresponds to the ``parent`` field
276280
on the ``request`` instance; if ``request`` is provided, this

google/cloud/gkehub_v1/services/gke_hub/client.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,10 @@ class GkeHubClient(metaclass=GkeHubClientMeta):
106106
- [Membership][google.cloud.gkehub.v1.Membership]
107107
- [Feature][google.cloud.gkehub.v1.Feature]
108108
109-
GKE Hub is currently only available in the global region.
109+
GKE Hub is currently available in the global region and all regions
110+
in https://cloud.google.com/compute/docs/regions-zones. Feature is
111+
only available in global region while membership is global region
112+
and all the regions.
110113
111114
**Membership management may be non-trivial:** it is recommended to
112115
use one of the Google-provided client libraries or tools where
@@ -529,7 +532,8 @@ def sample_list_memberships():
529532
parent (str):
530533
Required. The parent (project and location) where the
531534
Memberships will be listed. Specified in the format
532-
``projects/*/locations/*``.
535+
``projects/*/locations/*``. ``projects/*/locations/-``
536+
list memberships in all the regions.
533537
534538
This corresponds to the ``parent`` field
535539
on the ``request`` instance; if ``request`` is provided, this

google/cloud/gkehub_v1/services/gke_hub/transports/grpc.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ class GkeHubGrpcTransport(GkeHubTransport):
4040
- [Membership][google.cloud.gkehub.v1.Membership]
4141
- [Feature][google.cloud.gkehub.v1.Feature]
4242
43-
GKE Hub is currently only available in the global region.
43+
GKE Hub is currently available in the global region and all regions
44+
in https://cloud.google.com/compute/docs/regions-zones. Feature is
45+
only available in global region while membership is global region
46+
and all the regions.
4447
4548
**Membership management may be non-trivial:** it is recommended to
4649
use one of the Google-provided client libraries or tools where

google/cloud/gkehub_v1/services/gke_hub/transports/grpc_asyncio.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ class GkeHubGrpcAsyncIOTransport(GkeHubTransport):
4141
- [Membership][google.cloud.gkehub.v1.Membership]
4242
- [Feature][google.cloud.gkehub.v1.Feature]
4343
44-
GKE Hub is currently only available in the global region.
44+
GKE Hub is currently available in the global region and all regions
45+
in https://cloud.google.com/compute/docs/regions-zones. Feature is
46+
only available in global region while membership is global region
47+
and all the regions.
4548
4649
**Membership management may be non-trivial:** it is recommended to
4750
use one of the Google-provided client libraries or tools where

google/cloud/gkehub_v1/services/gke_hub/transports/rest.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,10 @@ class GkeHubRestTransport(GkeHubTransport):
424424
- [Membership][google.cloud.gkehub.v1.Membership]
425425
- [Feature][google.cloud.gkehub.v1.Feature]
426426
427-
GKE Hub is currently only available in the global region.
427+
GKE Hub is currently available in the global region and all regions
428+
in https://cloud.google.com/compute/docs/regions-zones. Feature is
429+
only available in global region while membership is global region
430+
and all the regions.
428431
429432
**Membership management may be non-trivial:** it is recommended to
430433
use one of the Google-provided client libraries or tools where

google/cloud/gkehub_v1/types/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
Membership,
3131
MembershipEndpoint,
3232
MembershipState,
33+
MonitoringConfig,
3334
ResourceManifest,
3435
ResourceOptions,
3536
)
@@ -68,6 +69,7 @@
6869
"Membership",
6970
"MembershipEndpoint",
7071
"MembershipState",
72+
"MonitoringConfig",
7173
"ResourceManifest",
7274
"ResourceOptions",
7375
"ConnectAgentResource",

google/cloud/gkehub_v1/types/membership.py

Lines changed: 82 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"ResourceManifest",
3131
"GkeCluster",
3232
"KubernetesMetadata",
33+
"MonitoringConfig",
3334
"MembershipState",
3435
"Authority",
3536
},
@@ -65,7 +66,7 @@ class Membership(proto.Message):
6566
``[a-z0-9]([-a-z0-9]*[a-z0-9])?``, with a maximum length of
6667
63 characters.
6768
labels (MutableMapping[str, str]):
68-
Optional. GCP labels for this membership.
69+
Optional. Labels for this membership.
6970
description (str):
7071
Output only. Description of this membership, limited to 63
7172
characters. Must match the regex:
@@ -111,6 +112,9 @@ class Membership(proto.Message):
111112
Membership. See the documentation on Workload
112113
Identity for more details:
113114
https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity
115+
monitoring_config (google.cloud.gkehub_v1.types.MonitoringConfig):
116+
Optional. The monitoring config information
117+
for this membership.
114118
"""
115119

116120
endpoint: "MembershipEndpoint" = proto.Field(
@@ -170,6 +174,11 @@ class Membership(proto.Message):
170174
number=12,
171175
message="Authority",
172176
)
177+
monitoring_config: "MonitoringConfig" = proto.Field(
178+
proto.MESSAGE,
179+
number=14,
180+
message="MonitoringConfig",
181+
)
173182

174183

175184
class MembershipEndpoint(proto.Message):
@@ -194,6 +203,10 @@ class MembershipEndpoint(proto.Message):
194203
Membership Authority field.
195204
- Ensure proper initial configuration of default Hub
196205
Features.
206+
google_managed (bool):
207+
Output only. Whether the lifecycle of this
208+
membership is managed by a google cluster
209+
platform service.
197210
"""
198211

199212
gke_cluster: "GkeCluster" = proto.Field(
@@ -211,6 +224,10 @@ class MembershipEndpoint(proto.Message):
211224
number=3,
212225
message="KubernetesResource",
213226
)
227+
google_managed: bool = proto.Field(
228+
proto.BOOL,
229+
number=8,
230+
)
214231

215232

216233
class KubernetesResource(proto.Message):
@@ -346,16 +363,24 @@ class GkeCluster(proto.Message):
346363
347364
Attributes:
348365
resource_link (str):
349-
Immutable. Self-link of the GCP resource for
350-
the GKE cluster. For example:
366+
Immutable. Self-link of the Google Cloud
367+
resource for the GKE cluster. For example:
368+
351369
//container.googleapis.com/projects/my-project/locations/us-west1-a/clusters/my-cluster
352370
Zonal clusters are also supported.
371+
cluster_missing (bool):
372+
Output only. If cluster_missing is set then it denotes that
373+
the GKE cluster no longer exists in the GKE Control Plane.
353374
"""
354375

355376
resource_link: str = proto.Field(
356377
proto.STRING,
357378
number=1,
358379
)
380+
cluster_missing: bool = proto.Field(
381+
proto.BOOL,
382+
number=2,
383+
)
359384

360385

361386
class KubernetesMetadata(proto.Message):
@@ -416,6 +441,60 @@ class KubernetesMetadata(proto.Message):
416441
)
417442

418443

444+
class MonitoringConfig(proto.Message):
445+
r"""This field informs Fleet-based applications/services/UIs with
446+
the necessary information for where each underlying Cluster
447+
reports its metrics.
448+
449+
Attributes:
450+
project_id (str):
451+
Immutable. Project used to report Metrics
452+
location (str):
453+
Immutable. Location used to report Metrics
454+
cluster (str):
455+
Immutable. Cluster name used to report metrics. For Anthos
456+
on VMWare/Baremetal, it would be in format
457+
``memberClusters/cluster_name``; And for Anthos on
458+
MultiCloud, it would be in format
459+
``{azureClusters, awsClusters}/cluster_name``.
460+
kubernetes_metrics_prefix (str):
461+
Kubernetes system metrics, if available, are
462+
written to this prefix. This defaults to
463+
kubernetes.io for GKE, and kubernetes.io/anthos
464+
for Anthos eventually. Noted: Anthos MultiCloud
465+
will have kubernetes.io prefix today but will
466+
migration to be under kubernetes.io/anthos
467+
cluster_hash (str):
468+
Immutable. Cluster hash, this is a unique
469+
string generated by google code, which does not
470+
contain any PII, which we can use to reference
471+
the cluster. This is expected to be created by
472+
the monitoring stack and persisted into the
473+
Cluster object as well as to GKE-Hub.
474+
"""
475+
476+
project_id: str = proto.Field(
477+
proto.STRING,
478+
number=1,
479+
)
480+
location: str = proto.Field(
481+
proto.STRING,
482+
number=2,
483+
)
484+
cluster: str = proto.Field(
485+
proto.STRING,
486+
number=3,
487+
)
488+
kubernetes_metrics_prefix: str = proto.Field(
489+
proto.STRING,
490+
number=4,
491+
)
492+
cluster_hash: str = proto.Field(
493+
proto.STRING,
494+
number=5,
495+
)
496+
497+
419498
class MembershipState(proto.Message):
420499
r"""MembershipState describes the state of a Membership resource.
421500

google/cloud/gkehub_v1/types/service.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ class ListMembershipsRequest(proto.Message):
5454
parent (str):
5555
Required. The parent (project and location) where the
5656
Memberships will be listed. Specified in the format
57-
``projects/*/locations/*``.
57+
``projects/*/locations/*``. ``projects/*/locations/-`` list
58+
memberships in all the regions.
5859
page_size (int):
5960
Optional. When requesting a 'page' of resources,
6061
``page_size`` specifies number of resources to return. If
@@ -252,6 +253,11 @@ class DeleteMembershipRequest(proto.Message):
252253
The request ID must be a valid UUID with the
253254
exception that zero UUID is not supported
254255
(00000000-0000-0000-0000-000000000000).
256+
force (bool):
257+
Optional. If set to true, any subresource
258+
from this Membership will also be deleted.
259+
Otherwise, the request will only work if the
260+
Membership has no subresource.
255261
"""
256262

257263
name: str = proto.Field(
@@ -262,6 +268,10 @@ class DeleteMembershipRequest(proto.Message):
262268
proto.STRING,
263269
number=2,
264270
)
271+
force: bool = proto.Field(
272+
proto.BOOL,
273+
number=3,
274+
)
265275

266276

267277
class UpdateMembershipRequest(proto.Message):

0 commit comments

Comments
 (0)