Skip to content

Commit 08e8c30

Browse files
authored
Move all cluster api definitions to operator service (#191)
1 parent 4e18e83 commit 08e8c30

File tree

4 files changed

+190
-0
lines changed

4 files changed

+190
-0
lines changed
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
// The MIT License
2+
//
3+
// Copyright (c) 2022 Temporal Technologies Inc. All rights reserved.
4+
//
5+
// Permission is hereby granted, free of charge, to any person obtaining a copy
6+
// of this software and associated documentation files (the "Software"), to deal
7+
// in the Software without restriction, including without limitation the rights
8+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
// copies of the Software, and to permit persons to whom the Software is
10+
// furnished to do so, subject to the following conditions:
11+
//
12+
// The above copyright notice and this permission notice shall be included in
13+
// all copies or substantial portions of the Software.
14+
//
15+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
// THE SOFTWARE.
22+
23+
syntax = "proto3";
24+
25+
package temporal.api.cluster.v1;
26+
27+
option go_package = "go.temporal.io/api/cluster/v1;command";
28+
option java_package = "io.temporal.api.cluster.v1";
29+
option java_multiple_files = true;
30+
option java_outer_classname = "MessageProto";
31+
option ruby_package = "Temporal::Api::Cluster::V1";
32+
option csharp_namespace = "Temporal.Api.Cluster.V1";
33+
34+
import "dependencies/gogoproto/gogo.proto";
35+
import "google/protobuf/timestamp.proto";
36+
37+
import "temporal/api/enums/v1/cluster.proto";
38+
import "temporal/api/enums/v1/common.proto";
39+
import "temporal/api/version/v1/message.proto";
40+
41+
// data column
42+
message ClusterMetadata {
43+
string cluster = 1;
44+
int32 history_shard_count = 2;
45+
string cluster_id = 3;
46+
temporal.api.version.v1.VersionInfo version_info = 4;
47+
map<string,IndexSearchAttributes> index_search_attributes = 5;
48+
string cluster_address = 6;
49+
int64 failover_version_increment = 7;
50+
int64 initial_failover_version = 8;
51+
bool is_global_namespace_enabled = 9;
52+
bool is_connection_enabled = 10;
53+
}
54+
55+
message IndexSearchAttributes{
56+
map<string,temporal.api.enums.v1.IndexedValueType> custom_search_attributes = 1;
57+
}
58+
59+
message HostInfo {
60+
string identity = 1;
61+
}
62+
63+
message RingInfo {
64+
string role = 1;
65+
int32 member_count = 2;
66+
repeated HostInfo members = 3;
67+
}
68+
69+
message MembershipInfo {
70+
HostInfo current_host = 1;
71+
repeated string reachable_members = 2;
72+
repeated RingInfo rings = 3;
73+
}
74+
75+
message ClusterMember {
76+
temporal.api.enums.v1.ClusterMemberRole role = 1;
77+
string host_id = 2;
78+
string rpc_address = 3;
79+
int32 rpc_port = 4;
80+
google.protobuf.Timestamp session_start_time = 5 [(gogoproto.stdtime) = true];
81+
google.protobuf.Timestamp last_heartbit_time = 6 [(gogoproto.stdtime) = true];
82+
google.protobuf.Timestamp record_expiry_time = 7 [(gogoproto.stdtime) = true];
83+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// The MIT License
2+
//
3+
// Copyright (c) 2022 Temporal Technologies Inc. All rights reserved.
4+
//
5+
// Permission is hereby granted, free of charge, to any person obtaining a copy
6+
// of this software and associated documentation files (the "Software"), to deal
7+
// in the Software without restriction, including without limitation the rights
8+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
// copies of the Software, and to permit persons to whom the Software is
10+
// furnished to do so, subject to the following conditions:
11+
//
12+
// The above copyright notice and this permission notice shall be included in
13+
// all copies or substantial portions of the Software.
14+
//
15+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
// THE SOFTWARE.
22+
23+
syntax = "proto3";
24+
25+
package temporal.api.enums.v1;
26+
27+
option go_package = "go.temporal.io/api/enums/v1;enums";
28+
option java_package = "io.temporal.api.enums.v1";
29+
option java_multiple_files = true;
30+
option java_outer_classname = "ClusterProto";
31+
option ruby_package = "Temporal::Api::Enums::V1";
32+
option csharp_namespace = "Temporal.Api.Enums.V1";
33+
34+
enum ClusterMemberRole {
35+
CLUSTER_MEMBER_ROLE_UNSPECIFIED = 0;
36+
CLUSTER_MEMBER_ROLE_FRONTEND = 1;
37+
CLUSTER_MEMBER_ROLE_HISTORY = 2;
38+
CLUSTER_MEMBER_ROLE_MATCHING = 3;
39+
CLUSTER_MEMBER_ROLE_WORKER = 4;
40+
}

temporal/api/operatorservice/v1/request_response.proto

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,15 @@ option java_outer_classname = "RequestResponseProto";
3131
option ruby_package = "Temporal::Api::OperatorService::V1";
3232
option csharp_namespace = "Temporal.Api.OperatorService.V1";
3333

34+
import "dependencies/gogoproto/gogo.proto";
35+
import "google/protobuf/timestamp.proto";
36+
import "google/protobuf/duration.proto";
37+
38+
import "temporal/api/cluster/v1/message.proto";
3439
import "temporal/api/common/v1/message.proto";
40+
import "temporal/api/enums/v1/cluster.proto";
3541
import "temporal/api/enums/v1/common.proto";
42+
import "temporal/api/version/v1/message.proto";
3643

3744
// (-- Search Attribute --)
3845

@@ -106,3 +113,51 @@ message RemoveRemoteClusterRequest {
106113

107114
message RemoveRemoteClusterResponse {
108115
}
116+
117+
message DescribeClusterRequest {
118+
string cluster_name = 1;
119+
}
120+
121+
message DescribeClusterResponse {
122+
map<string,string> supported_clients = 1;
123+
string server_version = 2;
124+
temporal.api.cluster.v1.MembershipInfo membership_info = 3;
125+
string cluster_id = 4;
126+
string cluster_name = 5;
127+
int32 history_shard_count = 6;
128+
string persistence_store = 7;
129+
string visibility_store = 8;
130+
temporal.api.version.v1.VersionInfo version_info = 9;
131+
int64 failover_version_increment = 10;
132+
int64 initial_failover_version = 11;
133+
bool is_global_namespace_enabled = 12;
134+
}
135+
136+
message ListClustersRequest {
137+
int32 page_size = 1;
138+
bytes next_page_token = 2;
139+
}
140+
141+
message ListClustersResponse {
142+
repeated temporal.api.cluster.v1.ClusterMetadata clusters = 1;
143+
bytes next_page_token = 2;
144+
}
145+
146+
message ListClusterMembersRequest {
147+
// (-- api-linter: core::0140::prepositions=disabled
148+
// aip.dev/not-precedent: "within" is used to indicate a time range. --)
149+
google.protobuf.Duration last_heartbeat_within = 1 [(gogoproto.stdduration) = true];
150+
string rpc_address = 2;
151+
string host_id = 3;
152+
temporal.api.enums.v1.ClusterMemberRole role = 4;
153+
// (-- api-linter: core::0140::prepositions=disabled
154+
// aip.dev/not-precedent: "after" is used to indicate a time range. --)
155+
google.protobuf.Timestamp session_started_after_time = 5 [(gogoproto.stdtime) = true];
156+
int32 page_size = 6;
157+
bytes next_page_token = 7;
158+
}
159+
160+
message ListClusterMembersResponse {
161+
repeated temporal.api.cluster.v1.ClusterMember active_members = 1;
162+
bytes next_page_token = 2;
163+
}

temporal/api/operatorservice/v1/service.proto

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,16 @@ service OperatorService {
8282
// RemoveRemoteCluster removes remote cluster.
8383
rpc RemoveRemoteCluster(RemoveRemoteClusterRequest) returns (RemoveRemoteClusterResponse) {
8484
}
85+
86+
// DescribeCluster returns information about Temporal cluster.
87+
rpc DescribeCluster(DescribeClusterRequest) returns (DescribeClusterResponse) {
88+
}
89+
90+
// ListClusters returns information about Temporal clusters.
91+
rpc ListClusters(ListClustersRequest) returns (ListClustersResponse) {
92+
}
93+
94+
// ListClusterMembers returns information about Temporal cluster members.
95+
rpc ListClusterMembers(ListClusterMembersRequest) returns (ListClusterMembersResponse) {
96+
}
8597
}

0 commit comments

Comments
 (0)