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

feat: Add OnPremCluster and MultiCloudCluster as GkeCluster equivalent field #91

Merged
merged 2 commits into from
Aug 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 69 additions & 5 deletions protos/google/cloud/gkehub/v1alpha2/membership.proto
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,14 @@ option java_package = "com.google.cloud.gkehub.v1alpha2";
option php_namespace = "Google\\Cloud\\GkeHub\\V1alpha2";
option ruby_package = "Google::Cloud::GkeHub::V1alpha2";

// GKE Hub CRUD API for the Membership resource.
// The Membership service is currently only available in the global location.
// The GKE Hub service handles the registration of many Kubernetes
// clusters to Google Cloud, represented with the [Membership][google.cloud.gkehub.v1alpha2.Membership] resource.
//
// GKE Hub is currently only available in the global region.
//
// **Membership management may be non-trivial:** it is recommended to use one
// of the Google-provided client libraries or tools where possible when working
// with Membership resources.
service GkeHub {
option (google.api.default_host) = "gkehub.googleapis.com";
option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
Expand All @@ -54,7 +60,11 @@ service GkeHub {
option (google.api.method_signature) = "name";
}

// Adds a new Membership.
// Creates a new Membership.
//
// **This is currently only supported for GKE clusters on Google Cloud**.
// To register other clusters, follow the instructions at
// https://cloud.google.com/anthos/multicluster-management/connect/registering-a-cluster.
rpc CreateMembership(CreateMembershipRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1alpha2/{parent=projects/*/locations/*}/memberships"
Expand All @@ -68,6 +78,10 @@ service GkeHub {
}

// Removes a Membership.
//
// **This is currently only supported for GKE clusters on Google Cloud**.
// To unregister other clusters, follow the instructions at
// https://cloud.google.com/anthos/multicluster-management/connect/unregistering-a-cluster.
rpc DeleteMembership(DeleteMembershipRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
delete: "/v1alpha2/{name=projects/*/locations/*/memberships/*}"
Expand All @@ -93,6 +107,9 @@ service GkeHub {
}

// Generates the manifest for deployment of the GKE connect agent.
//
// **This method is used internally by Google-provided libraries.**
// Most clients should not need to call this method directly.
rpc GenerateConnectManifest(GenerateConnectManifestRequest) returns (GenerateConnectManifestResponse) {
option (google.api.http) = {
get: "/v1alpha2/{name=projects/*/locations/*/memberships/*}:generateConnectManifest"
Expand Down Expand Up @@ -214,8 +231,17 @@ message Membership {
// MembershipEndpoint contains information needed to contact a Kubernetes API,
// endpoint and any additional Kubernetes metadata.
message MembershipEndpoint {
// Optional. GKE-specific information. Only present if this Membership is a GKE cluster.
GkeCluster gke_cluster = 1 [(google.api.field_behavior) = OPTIONAL];
// Cluster information of the registered cluster.
oneof type {
// Optional. Specific information for a GKE-on-GCP cluster.
GkeCluster gke_cluster = 1 [(google.api.field_behavior) = OPTIONAL];

// Optional. Specific information for a GKE On-Prem cluster.
OnPremCluster on_prem_cluster = 4 [(google.api.field_behavior) = OPTIONAL];

// Optional. Specific information for a GKE Multi-Cloud cluster.
MultiCloudCluster multi_cloud_cluster = 5 [(google.api.field_behavior) = OPTIONAL];
}

// Output only. Useful Kubernetes-specific metadata.
KubernetesMetadata kubernetes_metadata = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
Expand Down Expand Up @@ -289,6 +315,42 @@ message GkeCluster {
//
// Zonal clusters are also supported.
string resource_link = 1 [(google.api.field_behavior) = IMMUTABLE];

// Output only. If cluster_missing is set then it denotes that the GKE cluster no longer
// exists in the GKE Control Plane.
bool cluster_missing = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// OnPremCluster contains information specific to GKE On-Prem clusters.
message OnPremCluster {
// Immutable. Self-link of the GCP resource for the GKE On-Prem cluster. For example:
//
// //gkeonprem.googleapis.com/projects/my-project/locations/us-west1-a/vmwareClusters/my-cluster
// //gkeonprem.googleapis.com/projects/my-project/locations/us-west1-a/bareMetalClusters/my-cluster
string resource_link = 1 [(google.api.field_behavior) = IMMUTABLE];

// Output only. If cluster_missing is set then it denotes that
// API(gkeonprem.googleapis.com) resource for this GKE On-Prem cluster no
// longer exists.
bool cluster_missing = 2 [(google.api.field_behavior) = OUTPUT_ONLY];

// Immutable. Whether the cluster is an admin cluster.
bool admin_cluster = 3 [(google.api.field_behavior) = IMMUTABLE];
}

// MultiCloudCluster contains information specific to GKE Multi-Cloud clusters.
message MultiCloudCluster {
// Immutable. Self-link of the GCP resource for the GKE Multi-Cloud cluster. For
// example:
//
// //gkemulticloud.googleapis.com/projects/my-project/locations/us-west1-a/awsClusters/my-cluster
// //gkemulticloud.googleapis.com/projects/my-project/locations/us-west1-a/azureClusters/my-cluster
string resource_link = 1 [(google.api.field_behavior) = IMMUTABLE];

// Output only. If cluster_missing is set then it denotes that
// API(gkemulticloud.googleapis.com) resource for this GKE Multi-Cloud cluster
// no longer exists.
bool cluster_missing = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// KubernetesMetadata provides informational metadata for Memberships
Expand Down Expand Up @@ -511,6 +573,8 @@ message UpdateMembershipRequest {
// If you are updating a map field, set the value of a key to null or empty
// string to delete the key from the map. It's not possible to update a key's
// value to the empty string.
// If you specify the update_mask to be a special path "*", fully replaces all
// user-modifiable fields to match `resource`.
Membership resource = 3 [(google.api.field_behavior) = REQUIRED];
}

Expand Down
219 changes: 219 additions & 0 deletions protos/protos.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading