@temporalio/core-bridge 1.12.2 → 1.12.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/releases/aarch64-apple-darwin/index.node +0 -0
- package/releases/aarch64-unknown-linux-gnu/index.node +0 -0
- package/releases/x86_64-apple-darwin/index.node +0 -0
- package/releases/x86_64-pc-windows-msvc/index.node +0 -0
- package/releases/x86_64-unknown-linux-gnu/index.node +0 -0
- package/sdk-core/.cargo/config.toml +1 -1
- package/sdk-core/client/src/callback_based.rs +123 -0
- package/sdk-core/client/src/lib.rs +96 -28
- package/sdk-core/client/src/metrics.rs +33 -5
- package/sdk-core/client/src/raw.rs +40 -1
- package/sdk-core/client/src/retry.rs +12 -3
- package/sdk-core/core/src/lib.rs +4 -2
- package/sdk-core/core/src/pollers/poll_buffer.rs +62 -14
- package/sdk-core/core/src/worker/client.rs +9 -5
- package/sdk-core/core/src/worker/heartbeat.rs +3 -1
- package/sdk-core/core-api/src/worker.rs +2 -2
- package/sdk-core/core-c-bridge/Cargo.toml +2 -0
- package/sdk-core/core-c-bridge/include/temporal-sdk-core-c-bridge.h +105 -0
- package/sdk-core/core-c-bridge/src/client.rs +265 -8
- package/sdk-core/core-c-bridge/src/tests/context.rs +11 -0
- package/sdk-core/core-c-bridge/src/tests/mod.rs +179 -3
- package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/CODEOWNERS +1 -1
- package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/README.md +1 -1
- package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/VERSION +1 -1
- package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/buf.yaml +1 -0
- package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/temporal/api/cloud/cloudservice/v1/request_response.proto +83 -0
- package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/temporal/api/cloud/cloudservice/v1/service.proto +37 -0
- package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/temporal/api/cloud/connectivityrule/v1/message.proto +64 -0
- package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/temporal/api/cloud/identity/v1/message.proto +3 -1
- package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/temporal/api/cloud/namespace/v1/message.proto +10 -0
- package/sdk-core/sdk-core-protos/protos/api_cloud_upstream/temporal/api/cloud/operation/v1/message.proto +1 -0
- package/sdk-core/sdk-core-protos/protos/api_upstream/openapi/openapiv2.json +644 -9
- package/sdk-core/sdk-core-protos/protos/api_upstream/openapi/openapiv3.yaml +635 -21
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/batch/v1/message.proto +60 -2
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/common/v1/message.proto +84 -15
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/batch_operation.proto +3 -0
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/task_queue.proto +11 -0
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/history/v1/message.proto +5 -0
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/sdk/v1/task_complete_metadata.proto +1 -1
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/sdk/v1/worker_config.proto +36 -0
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/taskqueue/v1/message.proto +29 -0
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/worker/v1/message.proto +11 -1
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/workflowservice/v1/request_response.proto +122 -4
- package/sdk-core/sdk-core-protos/protos/api_upstream/temporal/api/workflowservice/v1/service.proto +41 -0
- package/sdk-core/sdk-core-protos/src/lib.rs +5 -1
- package/sdk-core/test-utils/Cargo.toml +1 -0
- package/sdk-core/test-utils/src/lib.rs +90 -3
- package/sdk-core/tests/cloud_tests.rs +11 -74
- package/sdk-core/tests/integ_tests/client_tests.rs +14 -10
- package/sdk-core/tests/integ_tests/worker_tests.rs +8 -2
- package/sdk-core/tests/integ_tests/workflow_tests/activities.rs +13 -0
- package/sdk-core/tests/integ_tests/workflow_tests/priority.rs +2 -108
- package/sdk-core/tests/main.rs +3 -0
- package/sdk-core/tests/shared_tests/mod.rs +43 -0
- package/sdk-core/tests/shared_tests/priority.rs +155 -0
- package/src/client.rs +5 -0
|
@@ -1,12 +1,22 @@
|
|
|
1
|
-
use crate::
|
|
1
|
+
use crate::ByteArrayRef;
|
|
2
|
+
use crate::client::{
|
|
3
|
+
ClientGrpcOverrideRequest, ClientGrpcOverrideResponse, RpcService,
|
|
4
|
+
temporal_core_client_grpc_override_request_headers,
|
|
5
|
+
temporal_core_client_grpc_override_request_proto,
|
|
6
|
+
temporal_core_client_grpc_override_request_respond,
|
|
7
|
+
temporal_core_client_grpc_override_request_rpc,
|
|
8
|
+
temporal_core_client_grpc_override_request_service,
|
|
9
|
+
};
|
|
2
10
|
use crate::tests::utils::{
|
|
3
11
|
OwnedRpcCallOptions, RpcCallError, default_client_options, default_server_config,
|
|
4
12
|
};
|
|
5
13
|
use context::Context;
|
|
6
14
|
use prost::Message;
|
|
7
|
-
use std::sync::Arc;
|
|
15
|
+
use std::sync::{Arc, LazyLock, Mutex};
|
|
16
|
+
use temporal_sdk_core_protos::temporal::api::failure::v1::Failure;
|
|
8
17
|
use temporal_sdk_core_protos::temporal::api::workflowservice::v1::{
|
|
9
|
-
GetSystemInfoRequest, GetSystemInfoResponse,
|
|
18
|
+
GetSystemInfoRequest, GetSystemInfoResponse, QueryWorkflowRequest,
|
|
19
|
+
StartWorkflowExecutionRequest, StartWorkflowExecutionResponse,
|
|
10
20
|
};
|
|
11
21
|
|
|
12
22
|
mod context;
|
|
@@ -176,3 +186,169 @@ fn test_all_rpc_calls_exist() {
|
|
|
176
186
|
));
|
|
177
187
|
});
|
|
178
188
|
}
|
|
189
|
+
|
|
190
|
+
static CALLBACK_OVERRIDE_CALLS: LazyLock<Mutex<Vec<String>>> =
|
|
191
|
+
LazyLock::new(|| Mutex::new(Vec::new()));
|
|
192
|
+
|
|
193
|
+
struct ClientOverrideError {
|
|
194
|
+
message: String,
|
|
195
|
+
details: Option<Vec<u8>>,
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
impl ClientOverrideError {
|
|
199
|
+
pub fn new(message: String) -> Self {
|
|
200
|
+
Self {
|
|
201
|
+
message,
|
|
202
|
+
details: None,
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
unsafe extern "C" fn callback_override(
|
|
208
|
+
req: *mut ClientGrpcOverrideRequest,
|
|
209
|
+
user_data: *mut libc::c_void,
|
|
210
|
+
) {
|
|
211
|
+
let mut calls = CALLBACK_OVERRIDE_CALLS.lock().unwrap();
|
|
212
|
+
|
|
213
|
+
// Simple header check to confirm headers are working
|
|
214
|
+
let headers =
|
|
215
|
+
temporal_core_client_grpc_override_request_headers(req).to_string_map_on_newlines();
|
|
216
|
+
assert!(headers.get("content-type").unwrap().as_str() == "application/grpc");
|
|
217
|
+
|
|
218
|
+
// Confirm user data is as we expect
|
|
219
|
+
let user_data: &String = unsafe { &*(user_data as *const String) };
|
|
220
|
+
assert!(user_data.as_str() == "some-user-data");
|
|
221
|
+
|
|
222
|
+
calls.push(format!(
|
|
223
|
+
"service: {}, rpc: {}",
|
|
224
|
+
temporal_core_client_grpc_override_request_service(req).to_string(),
|
|
225
|
+
temporal_core_client_grpc_override_request_rpc(req).to_string()
|
|
226
|
+
));
|
|
227
|
+
let resp_raw = match temporal_core_client_grpc_override_request_rpc(req).to_str() {
|
|
228
|
+
"GetSystemInfo" => Ok(GetSystemInfoResponse::default().encode_to_vec()),
|
|
229
|
+
"StartWorkflowExecution" => match StartWorkflowExecutionRequest::decode(
|
|
230
|
+
temporal_core_client_grpc_override_request_proto(req).to_slice(),
|
|
231
|
+
) {
|
|
232
|
+
Ok(req) => Ok(StartWorkflowExecutionResponse {
|
|
233
|
+
run_id: format!("run-id for {}", req.workflow_id),
|
|
234
|
+
..Default::default()
|
|
235
|
+
}
|
|
236
|
+
.encode_to_vec()),
|
|
237
|
+
Err(err) => Err(ClientOverrideError::new(format!("Bad bytes: {err}"))),
|
|
238
|
+
},
|
|
239
|
+
"QueryWorkflow" => match QueryWorkflowRequest::decode(
|
|
240
|
+
temporal_core_client_grpc_override_request_proto(req).to_slice(),
|
|
241
|
+
) {
|
|
242
|
+
// Demonstrate fail details
|
|
243
|
+
Ok(_) => Err(ClientOverrideError {
|
|
244
|
+
message: "query-fail".to_string(),
|
|
245
|
+
details: Some(
|
|
246
|
+
Failure {
|
|
247
|
+
message: "intentional failure".to_string(),
|
|
248
|
+
..Default::default()
|
|
249
|
+
}
|
|
250
|
+
.encode_to_vec(),
|
|
251
|
+
),
|
|
252
|
+
}),
|
|
253
|
+
Err(err) => Err(ClientOverrideError::new(format!("Bad bytes: {err}"))),
|
|
254
|
+
},
|
|
255
|
+
v => Err(ClientOverrideError::new(format!("Unknown RPC: {v}"))),
|
|
256
|
+
};
|
|
257
|
+
// It is very important that we borrow not move resp_raw here. If this were a "match resp_raw"
|
|
258
|
+
// without the &, ownership of bytes moves into the match arm and can drop bytes after the
|
|
259
|
+
// match arm. This is why we have a "let _" below for resp_raw to ensure a developed doesn't
|
|
260
|
+
// accidentally move it.
|
|
261
|
+
let resp = match &resp_raw {
|
|
262
|
+
Ok(bytes) => ClientGrpcOverrideResponse {
|
|
263
|
+
status_code: 0,
|
|
264
|
+
headers: ByteArrayRef::empty(),
|
|
265
|
+
success_proto: bytes.as_slice().into(),
|
|
266
|
+
fail_message: ByteArrayRef::empty(),
|
|
267
|
+
fail_details: ByteArrayRef::empty(),
|
|
268
|
+
},
|
|
269
|
+
Err(err) => ClientGrpcOverrideResponse {
|
|
270
|
+
status_code: tonic::Code::Internal.into(),
|
|
271
|
+
headers: ByteArrayRef::empty(),
|
|
272
|
+
success_proto: ByteArrayRef::empty(),
|
|
273
|
+
fail_message: err.message.as_str().into(),
|
|
274
|
+
fail_details: if let Some(details) = &err.details {
|
|
275
|
+
details.as_slice().into()
|
|
276
|
+
} else {
|
|
277
|
+
ByteArrayRef::empty()
|
|
278
|
+
},
|
|
279
|
+
},
|
|
280
|
+
};
|
|
281
|
+
temporal_core_client_grpc_override_request_respond(req, resp);
|
|
282
|
+
let _ = resp_raw;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
#[test]
|
|
286
|
+
fn test_simple_callback_override() {
|
|
287
|
+
Context::with(|context| {
|
|
288
|
+
let mut user_data = "some-user-data".to_owned();
|
|
289
|
+
context.runtime_new().unwrap();
|
|
290
|
+
// Create client which will invoke GetSystemInfo
|
|
291
|
+
context
|
|
292
|
+
.client_connect_with_override(
|
|
293
|
+
Box::new(default_client_options("127.0.0.1:4567")),
|
|
294
|
+
Some(callback_override),
|
|
295
|
+
&mut user_data as *mut String as *mut libc::c_void,
|
|
296
|
+
)
|
|
297
|
+
.unwrap();
|
|
298
|
+
|
|
299
|
+
// Invoke start workflow so we can confirm complex proto in/out
|
|
300
|
+
let start_resp_raw = context
|
|
301
|
+
.rpc_call(Box::new(OwnedRpcCallOptions {
|
|
302
|
+
service: RpcService::Workflow,
|
|
303
|
+
rpc: "StartWorkflowExecution".into(),
|
|
304
|
+
req: StartWorkflowExecutionRequest {
|
|
305
|
+
workflow_id: "my-workflow-id".into(),
|
|
306
|
+
..Default::default()
|
|
307
|
+
}
|
|
308
|
+
.encode_to_vec(),
|
|
309
|
+
retry: false,
|
|
310
|
+
metadata: None,
|
|
311
|
+
timeout_millis: 0,
|
|
312
|
+
cancellation_token: None,
|
|
313
|
+
}))
|
|
314
|
+
.unwrap();
|
|
315
|
+
let start_resp = StartWorkflowExecutionResponse::decode(&*start_resp_raw).unwrap();
|
|
316
|
+
assert!(start_resp.run_id == "run-id for my-workflow-id");
|
|
317
|
+
|
|
318
|
+
// Try a query where a query failure will actually be delivered as failure details.
|
|
319
|
+
// However, we don't currently have temporal_sdk_core_protos::google::rpc::Status in
|
|
320
|
+
// the crate, so we'll just use the details directly even though a proper gRPC
|
|
321
|
+
// implementation will only provide a google.rpc.Status proto.
|
|
322
|
+
let query_err = context
|
|
323
|
+
.rpc_call(Box::new(OwnedRpcCallOptions {
|
|
324
|
+
service: RpcService::Workflow,
|
|
325
|
+
rpc: "QueryWorkflow".into(),
|
|
326
|
+
req: QueryWorkflowRequest::default().encode_to_vec(),
|
|
327
|
+
retry: false,
|
|
328
|
+
metadata: None,
|
|
329
|
+
timeout_millis: 0,
|
|
330
|
+
cancellation_token: None,
|
|
331
|
+
}))
|
|
332
|
+
.unwrap_err()
|
|
333
|
+
.downcast::<RpcCallError>()
|
|
334
|
+
.unwrap();
|
|
335
|
+
assert!(query_err.status_code == tonic::Code::Internal as u32);
|
|
336
|
+
assert!(query_err.message == "query-fail");
|
|
337
|
+
assert!(
|
|
338
|
+
Failure::decode(query_err.details.as_ref().unwrap().as_slice())
|
|
339
|
+
.unwrap()
|
|
340
|
+
.message
|
|
341
|
+
== "intentional failure"
|
|
342
|
+
);
|
|
343
|
+
|
|
344
|
+
// Confirm we got the expected calls
|
|
345
|
+
assert!(
|
|
346
|
+
*CALLBACK_OVERRIDE_CALLS.lock().unwrap()
|
|
347
|
+
== vec![
|
|
348
|
+
"service: temporal.api.workflowservice.v1.WorkflowService, rpc: GetSystemInfo",
|
|
349
|
+
"service: temporal.api.workflowservice.v1.WorkflowService, rpc: StartWorkflowExecution",
|
|
350
|
+
"service: temporal.api.workflowservice.v1.WorkflowService, rpc: QueryWorkflow"
|
|
351
|
+
]
|
|
352
|
+
);
|
|
353
|
+
});
|
|
354
|
+
}
|
|
@@ -15,7 +15,7 @@ To use the Cloud Ops API in your project, preform the following 4 steps:
|
|
|
15
15
|
|
|
16
16
|
The client is expected to pass in a `temporal-cloud-api-version` header with the api version identifier with every request it makes to the apis. The backend will use the version to safely mutate resources. The `temporal:versioning:min_version` label specifies the minimum version of the API that supports the field.
|
|
17
17
|
|
|
18
|
-
Current Version `v0.
|
|
18
|
+
Current Version `v0.7.1`
|
|
19
19
|
|
|
20
20
|
### URL
|
|
21
21
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
v0.
|
|
1
|
+
v0.7.1
|
|
@@ -18,6 +18,7 @@ import "temporal/api/cloud/nexus/v1/message.proto";
|
|
|
18
18
|
import "temporal/api/cloud/region/v1/message.proto";
|
|
19
19
|
import "temporal/api/cloud/account/v1/message.proto";
|
|
20
20
|
import "temporal/api/cloud/usage/v1/message.proto";
|
|
21
|
+
import "temporal/api/cloud/connectivityrule/v1/message.proto";
|
|
21
22
|
|
|
22
23
|
message GetUsersRequest {
|
|
23
24
|
// The requested size of the page to retrieve - optional.
|
|
@@ -129,6 +130,9 @@ message CreateNamespaceRequest {
|
|
|
129
130
|
// The id to use for this async operation.
|
|
130
131
|
// Optional, if not provided a random id will be generated.
|
|
131
132
|
string async_operation_id = 3;
|
|
133
|
+
// The tags to add to the namespace.
|
|
134
|
+
// Note: This field can be set by global admins or account owners only.
|
|
135
|
+
map<string, string> tags = 4;
|
|
132
136
|
}
|
|
133
137
|
|
|
134
138
|
message CreateNamespaceResponse {
|
|
@@ -845,3 +849,82 @@ message ValidateNamespaceExportSinkRequest {
|
|
|
845
849
|
|
|
846
850
|
message ValidateNamespaceExportSinkResponse {
|
|
847
851
|
}
|
|
852
|
+
|
|
853
|
+
message UpdateNamespaceTagsRequest {
|
|
854
|
+
// The namespace to set tags for.
|
|
855
|
+
string namespace = 1;
|
|
856
|
+
// A list of tags to add or update.
|
|
857
|
+
// If a key of an existing tag is added, the tag's value is updated.
|
|
858
|
+
// At least one of tags_to_upsert or tags_to_remove must be specified.
|
|
859
|
+
map<string, string> tags_to_upsert = 2;
|
|
860
|
+
// A list of tag keys to remove.
|
|
861
|
+
// If a tag key doesn't exist, it is silently ignored.
|
|
862
|
+
// At least one of tags_to_upsert or tags_to_remove must be specified.
|
|
863
|
+
repeated string tags_to_remove = 3;
|
|
864
|
+
// The id to use for this async operation - optional.
|
|
865
|
+
string async_operation_id = 4;
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
message UpdateNamespaceTagsResponse {
|
|
869
|
+
// The async operation.
|
|
870
|
+
temporal.api.cloud.operation.v1.AsyncOperation async_operation = 1;
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
message CreateConnectivityRuleRequest {
|
|
874
|
+
// The connectivity rule specification.
|
|
875
|
+
temporal.api.cloud.connectivityrule.v1.ConnectivityRuleSpec spec = 1;
|
|
876
|
+
// The id to use for this async operation.
|
|
877
|
+
// Optional, if not provided a random id will be generated.
|
|
878
|
+
string async_operation_id = 2;
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
message CreateConnectivityRuleResponse {
|
|
882
|
+
// The id of the connectivity rule that was created.
|
|
883
|
+
string connectivity_rule_id = 1;
|
|
884
|
+
// The async operation
|
|
885
|
+
temporal.api.cloud.operation.v1.AsyncOperation async_operation = 2;
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
message GetConnectivityRuleRequest {
|
|
889
|
+
// The id of the connectivity rule to get.
|
|
890
|
+
string connectivity_rule_id = 1;
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
message GetConnectivityRuleResponse {
|
|
894
|
+
temporal.api.cloud.connectivityrule.v1.ConnectivityRule connectivity_rule = 1;
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
message GetConnectivityRulesRequest {
|
|
898
|
+
// The requested size of the page to retrieve.
|
|
899
|
+
// Optional, defaults to 100.
|
|
900
|
+
int32 page_size = 1;
|
|
901
|
+
// The page token if this is continuing from another response.
|
|
902
|
+
// Optional, defaults to empty.
|
|
903
|
+
string page_token = 2;
|
|
904
|
+
// Filter connectivity rule by the namespace id.
|
|
905
|
+
string namespace = 3;
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
message GetConnectivityRulesResponse {
|
|
909
|
+
// connectivity_rules returned
|
|
910
|
+
repeated temporal.api.cloud.connectivityrule.v1.ConnectivityRule connectivity_rules = 1;
|
|
911
|
+
// The next page token
|
|
912
|
+
string next_page_token = 2;
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
message DeleteConnectivityRuleRequest {
|
|
916
|
+
// The ID of the connectivity rule that need be deleted, required.
|
|
917
|
+
string connectivity_rule_id = 1;
|
|
918
|
+
|
|
919
|
+
// The resource version which should be the same from the the db, required
|
|
920
|
+
// The latest version can be found in the GetConnectivityRule operation response
|
|
921
|
+
string resource_version = 2;
|
|
922
|
+
// The id to use for this async operation.
|
|
923
|
+
// Optional, if not provided a random id will be generated.
|
|
924
|
+
string async_operation_id = 3;
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
message DeleteConnectivityRuleResponse {
|
|
928
|
+
// The async operation
|
|
929
|
+
temporal.api.cloud.operation.v1.AsyncOperation async_operation = 1;
|
|
930
|
+
}
|
|
@@ -395,4 +395,41 @@ service CloudService {
|
|
|
395
395
|
body: "*"
|
|
396
396
|
};
|
|
397
397
|
}
|
|
398
|
+
|
|
399
|
+
// Update the tags for a namespace
|
|
400
|
+
rpc UpdateNamespaceTags(UpdateNamespaceTagsRequest) returns (UpdateNamespaceTagsResponse) {
|
|
401
|
+
option (google.api.http) = {
|
|
402
|
+
post: "/cloud/namespaces/{namespace}/update-tags"
|
|
403
|
+
body: "*"
|
|
404
|
+
};
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
// Creates a connectivity rule
|
|
408
|
+
rpc CreateConnectivityRule(CreateConnectivityRuleRequest) returns (CreateConnectivityRuleResponse) {
|
|
409
|
+
option (google.api.http) = {
|
|
410
|
+
post: "/cloud/connectivity-rules"
|
|
411
|
+
body: "*"
|
|
412
|
+
};
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
// Gets a connectivity rule by id
|
|
416
|
+
rpc GetConnectivityRule(GetConnectivityRuleRequest) returns (GetConnectivityRuleResponse) {
|
|
417
|
+
option (google.api.http) = {
|
|
418
|
+
get: "/cloud/connectivity-rules/{connectivity_rule_id}"
|
|
419
|
+
};
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
// Lists connectivity rules by account
|
|
423
|
+
rpc GetConnectivityRules(GetConnectivityRulesRequest) returns (GetConnectivityRulesResponse) {
|
|
424
|
+
option (google.api.http) = {
|
|
425
|
+
get: "/cloud/connectivity-rules"
|
|
426
|
+
};
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
// Deletes a connectivity rule by id
|
|
430
|
+
rpc DeleteConnectivityRule(DeleteConnectivityRuleRequest) returns (DeleteConnectivityRuleResponse) {
|
|
431
|
+
option (google.api.http) = {
|
|
432
|
+
delete: "/cloud/connectivity-rules/{connectivity_rule_id}"
|
|
433
|
+
};
|
|
434
|
+
}
|
|
398
435
|
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package temporal.api.cloud.connectivityrule.v1;
|
|
4
|
+
|
|
5
|
+
option go_package = "go.temporal.io/api/cloud/connectivityrule/v1;connectivityrule";
|
|
6
|
+
option java_package = "io.temporal.api.cloud.connectivityrule.v1";
|
|
7
|
+
option java_multiple_files = true;
|
|
8
|
+
option java_outer_classname = "MessageProto";
|
|
9
|
+
option ruby_package = "Temporalio::Api::Cloud::ConnectivityRule::V1";
|
|
10
|
+
option csharp_namespace = "Temporalio.Api.Cloud.ConnectivityRule.V1";
|
|
11
|
+
|
|
12
|
+
import "temporal/api/cloud/resource/v1/message.proto";
|
|
13
|
+
import "google/protobuf/timestamp.proto";
|
|
14
|
+
|
|
15
|
+
message ConnectivityRule {
|
|
16
|
+
reserved 3; // Removed endpoint field
|
|
17
|
+
|
|
18
|
+
// The id of the private connectivity rule.
|
|
19
|
+
string id = 1;
|
|
20
|
+
|
|
21
|
+
// The connectivity rule specification.
|
|
22
|
+
ConnectivityRuleSpec spec = 2;
|
|
23
|
+
|
|
24
|
+
// The current version of the connectivity rule specification.
|
|
25
|
+
// The next update operation will have to include this version.
|
|
26
|
+
string resource_version = 4;
|
|
27
|
+
|
|
28
|
+
temporal.api.cloud.resource.v1.ResourceState state = 5;
|
|
29
|
+
|
|
30
|
+
// The id of the async operation that is creating/updating/deleting the connectivity rule, if any.
|
|
31
|
+
string async_operation_id = 6;
|
|
32
|
+
|
|
33
|
+
// The date and time when the connectivity rule was created.
|
|
34
|
+
google.protobuf.Timestamp created_time = 7;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// The connectivity rule specification passed in on create/update operations.
|
|
38
|
+
message ConnectivityRuleSpec {
|
|
39
|
+
oneof connection_type {
|
|
40
|
+
// This allows access via public internet.
|
|
41
|
+
PublicConnectivityRule public_rule = 1;
|
|
42
|
+
// This allows access via specific private vpc.
|
|
43
|
+
PrivateConnectivityRule private_rule = 2;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// A public connectivity rule allows access to the namespace via the public internet.
|
|
48
|
+
message PublicConnectivityRule {}
|
|
49
|
+
|
|
50
|
+
// A private connectivity rule allows connections from a specific private vpc only.
|
|
51
|
+
message PrivateConnectivityRule {
|
|
52
|
+
// Connection id provided to enforce the private connectivity. This is required both by AWS and GCP.
|
|
53
|
+
string connection_id = 1;
|
|
54
|
+
|
|
55
|
+
// For GCP private connectivity service, GCP needs both GCP project id and the Private Service Connect Connection IDs
|
|
56
|
+
// AWS only needs the connection_id
|
|
57
|
+
string gcp_project_id = 2;
|
|
58
|
+
|
|
59
|
+
// The region of the connectivity rule. This should align with the namespace.
|
|
60
|
+
// Example: "aws-us-west-2"
|
|
61
|
+
string region = 3;
|
|
62
|
+
|
|
63
|
+
reserved 4;
|
|
64
|
+
}
|
|
@@ -13,12 +13,13 @@ import "temporal/api/cloud/resource/v1/message.proto";
|
|
|
13
13
|
import "google/protobuf/timestamp.proto";
|
|
14
14
|
|
|
15
15
|
message AccountAccess {
|
|
16
|
-
// The role on the account, should be one of [owner, admin, developer, financeadmin, read]
|
|
16
|
+
// The role on the account, should be one of [owner, admin, developer, financeadmin, read, metricsread]
|
|
17
17
|
// owner - gives full access to the account, including users, namespaces, and billing
|
|
18
18
|
// admin - gives full access the account, including users and namespaces
|
|
19
19
|
// developer - gives access to create namespaces on the account
|
|
20
20
|
// financeadmin - gives read only access and write access for billing
|
|
21
21
|
// read - gives read only access to the account
|
|
22
|
+
// metricsread - gives read only access to all namespace metrics
|
|
22
23
|
// Deprecated: Not supported after v0.3.0 api version. Use role instead.
|
|
23
24
|
// temporal:versioning:max_version=v0.3.0
|
|
24
25
|
string role_deprecated = 1 [deprecated = true];
|
|
@@ -34,6 +35,7 @@ message AccountAccess {
|
|
|
34
35
|
ROLE_DEVELOPER = 3; // Gives access to create namespaces on the account.
|
|
35
36
|
ROLE_FINANCE_ADMIN = 4; // Gives read only access and write access for billing.
|
|
36
37
|
ROLE_READ = 5; // Gives read only access to the account.
|
|
38
|
+
ROLE_METRICS_READ = 6; // Gives read only access to the account metrics.
|
|
37
39
|
}
|
|
38
40
|
}
|
|
39
41
|
|
|
@@ -12,6 +12,7 @@ option csharp_namespace = "Temporalio.Api.Cloud.Namespace.V1";
|
|
|
12
12
|
import "temporal/api/cloud/resource/v1/message.proto";
|
|
13
13
|
import "google/protobuf/timestamp.proto";
|
|
14
14
|
import "temporal/api/cloud/sink/v1/message.proto";
|
|
15
|
+
import "temporal/api/cloud/connectivityrule/v1/message.proto";
|
|
15
16
|
|
|
16
17
|
message CertificateFilterSpec {
|
|
17
18
|
// The common_name in the certificate.
|
|
@@ -139,6 +140,11 @@ message NamespaceSpec {
|
|
|
139
140
|
// The high availability configuration for the namespace.
|
|
140
141
|
// temporal:versioning:min_version=v0.4.0
|
|
141
142
|
HighAvailabilitySpec high_availability = 10;
|
|
143
|
+
// The private connectivity configuration for the namespace.
|
|
144
|
+
// This will apply the connectivity rules specified to the namespace.
|
|
145
|
+
// temporal:versioning:min_version=v0.6.0
|
|
146
|
+
repeated string connectivity_rule_ids = 11;
|
|
147
|
+
|
|
142
148
|
|
|
143
149
|
enum SearchAttributeType {
|
|
144
150
|
SEARCH_ATTRIBUTE_TYPE_UNSPECIFIED = 0;
|
|
@@ -218,6 +224,10 @@ message Namespace {
|
|
|
218
224
|
// The status of each region where the namespace is available.
|
|
219
225
|
// The id of the region is the key and the status is the value of the map.
|
|
220
226
|
map<string, NamespaceRegionStatus> region_status = 12;
|
|
227
|
+
// The connectivity rules that are set on this namespace.
|
|
228
|
+
repeated temporal.api.cloud.connectivityrule.v1.ConnectivityRule connectivity_rules = 14;
|
|
229
|
+
// The tags for the namespace.
|
|
230
|
+
map<string, string> tags = 15;
|
|
221
231
|
}
|
|
222
232
|
|
|
223
233
|
message NamespaceRegionStatus {
|
|
@@ -47,5 +47,6 @@ message AsyncOperation {
|
|
|
47
47
|
STATE_FAILED = 3; // The operation failed, check failure_reason for more details.
|
|
48
48
|
STATE_CANCELLED = 4; // The operation was cancelled.
|
|
49
49
|
STATE_FULFILLED = 5; // The operation was fulfilled.
|
|
50
|
+
STATE_REJECTED = 6; // The operation was rejected.
|
|
50
51
|
}
|
|
51
52
|
}
|