volcano-sdk 0.34.0 → 0.35.1
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.
- checksums.yaml +4 -4
- data/README.md +64 -8
- data/lib/volcano/client.rb +1 -1
- data/lib/volcano/durable.rb +11 -6
- data/lib/volcano/durable_approval_models.rb +1 -1
- data/lib/volcano/durable_message_arguments.rb +49 -0
- data/lib/volcano/durable_message_backlog.rb +38 -0
- data/lib/volcano/durable_message_catch_ups.rb +112 -0
- data/lib/volcano/durable_message_models.rb +62 -0
- data/lib/volcano/durable_message_responses.rb +107 -0
- data/lib/volcano/durable_message_session.rb +72 -0
- data/lib/volcano/durable_message_stream.rb +176 -0
- data/lib/volcano/durable_messages.rb +217 -0
- data/lib/volcano/durable_models.rb +32 -3
- data/lib/volcano/generated/lib/volcano-generated/api/auth_admin_api.rb +2 -2
- data/lib/volcano/generated/lib/volcano-generated/api/auth_configuration_api.rb +2 -2
- data/lib/volcano/generated/lib/volcano-generated/api/autofix_api.rb +222 -0
- data/lib/volcano/generated/lib/volcano-generated/api/durable_functions_api.rb +725 -0
- data/lib/volcano/generated/lib/volcano-generated/api/frontends_api.rb +2 -2
- data/lib/volcano/generated/lib/volcano-generated/api/issues_api.rb +254 -0
- data/lib/volcano/generated/lib/volcano-generated/api/sandboxes_api.rb +20 -20
- data/lib/volcano/generated/lib/volcano-generated/api/system_api.rb +57 -0
- data/lib/volcano/generated/lib/volcano-generated/api/variable_environments_api.rb +373 -0
- data/lib/volcano/generated/lib/volcano-generated/api/verified_domains_api.rb +2 -2
- data/lib/volcano/generated/lib/volcano-generated/models/auth_config.rb +46 -4
- data/lib/volcano/generated/lib/volcano-generated/models/auth_insights_series_point.rb +110 -2
- data/lib/volcano/generated/lib/volcano-generated/models/autofix_model.rb +45 -0
- data/lib/volcano/generated/lib/volcano-generated/models/autofix_provider.rb +40 -0
- data/lib/volcano/generated/lib/volcano-generated/models/autofix_settings.rb +385 -0
- data/lib/volcano/generated/lib/volcano-generated/models/autofix_stage.rb +40 -0
- data/lib/volcano/generated/lib/volcano-generated/models/capability.rb +214 -0
- data/lib/volcano/generated/lib/volcano-generated/models/capability_list.rb +166 -0
- data/lib/volcano/generated/lib/volcano-generated/models/capability_status.rb +40 -0
- data/lib/volcano/generated/lib/volcano-generated/models/create_sandbox_session_request.rb +16 -53
- data/lib/volcano/generated/lib/volcano-generated/models/create_variable_environment_request.rb +176 -0
- data/lib/volcano/generated/lib/volcano-generated/models/durable_execution.rb +14 -4
- data/lib/volcano/generated/lib/volcano-generated/models/durable_message.rb +396 -0
- data/lib/volcano/generated/lib/volcano-generated/models/durable_message_direction.rb +40 -0
- data/lib/volcano/generated/lib/volcano-generated/models/durable_message_list.rb +194 -0
- data/lib/volcano/generated/lib/volcano-generated/models/durable_message_sender.rb +203 -0
- data/lib/volcano/generated/lib/volcano-generated/models/durable_message_session_registration.rb +165 -0
- data/lib/volcano/generated/lib/volcano-generated/models/durable_message_status.rb +43 -0
- data/lib/volcano/generated/lib/volcano-generated/models/durable_message_wait.rb +278 -0
- data/lib/volcano/generated/lib/volcano-generated/models/durable_message_wait_list.rb +167 -0
- data/lib/volcano/generated/lib/volcano-generated/models/durable_message_wait_registration.rb +225 -0
- data/lib/volcano/generated/lib/volcano-generated/models/durable_message_wait_status.rb +43 -0
- data/lib/volcano/generated/lib/volcano-generated/models/frontend.rb +11 -1
- data/lib/volcano/generated/lib/volcano-generated/models/frontend_custom_domain_conflict_error.rb +1 -1
- data/lib/volcano/generated/lib/volcano-generated/models/frontend_custom_domain_response.rb +25 -2
- data/lib/volcano/generated/lib/volcano-generated/models/issue.rb +493 -0
- data/lib/volcano/generated/lib/volcano-generated/models/issue_status.rb +41 -0
- data/lib/volcano/generated/lib/volcano-generated/models/metric_usage_data.rb +1 -1
- data/lib/volcano/generated/lib/volcano-generated/models/open_durable_message_session_request.rb +228 -0
- data/lib/volcano/generated/lib/volcano-generated/models/paginated_issues.rb +230 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_config.rb +10 -1
- data/lib/volcano/generated/lib/volcano-generated/models/project_config_autofix.rb +206 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_config_custom_domain.rb +1 -1
- data/lib/volcano/generated/lib/volcano-generated/models/project_config_sandbox.rb +12 -50
- data/lib/volcano/generated/lib/volcano-generated/models/project_frontend_custom_domain.rb +25 -2
- data/lib/volcano/generated/lib/volcano-generated/models/publish_durable_message_request.rb +205 -0
- data/lib/volcano/generated/lib/volcano-generated/models/register_durable_message_wait_request.rb +284 -0
- data/lib/volcano/generated/lib/volcano-generated/models/rename_variable_environment_request.rb +176 -0
- data/lib/volcano/generated/lib/volcano-generated/models/request_durable_approval_request.rb +1 -1
- data/lib/volcano/generated/lib/volcano-generated/models/sandbox_command_request.rb +11 -12
- data/lib/volcano/generated/lib/volcano-generated/models/sandbox_execution_request.rb +51 -13
- data/lib/volcano/generated/lib/volcano-generated/models/sandbox_session.rb +4 -30
- data/lib/volcano/generated/lib/volcano-generated/models/send_durable_message_request.rb +205 -0
- data/lib/volcano/generated/lib/volcano-generated/models/update_auth_config_request.rb +79 -1
- data/lib/volcano/generated/lib/volcano-generated/models/update_autofix_settings_request.rb +273 -0
- data/lib/volcano/generated/lib/volcano-generated/models/update_issue_request.rb +186 -0
- data/lib/volcano/generated/lib/volcano-generated/models/variable_environment.rb +325 -0
- data/lib/volcano/generated/lib/volcano-generated/models/variable_environment_list.rb +175 -0
- data/lib/volcano/generated/lib/volcano-generated.rb +34 -0
- data/lib/volcano/generated_transport.rb +1 -0
- data/lib/volcano/generated_transport_durable_messages.rb +57 -0
- data/lib/volcano/realtime/channel_callbacks.rb +5 -1
- data/lib/volcano/realtime/channel_lifecycle.rb +4 -1
- data/lib/volcano/realtime/durable_channel.rb +47 -0
- data/lib/volcano/realtime/lifecycle.rb +37 -1
- data/lib/volcano/realtime/protocol.rb +7 -3
- data/lib/volcano/realtime/protocol_dispatch.rb +1 -1
- data/lib/volcano/realtime/protocol_io.rb +7 -4
- data/lib/volcano/realtime/protocol_lifecycle.rb +7 -0
- data/lib/volcano/realtime/protocol_recovery.rb +23 -12
- data/lib/volcano/realtime.rb +42 -8
- data/lib/volcano/redaction.rb +1 -1
- data/lib/volcano/version.rb +1 -1
- data/lib/volcano.rb +8 -0
- data/sig/core_facades.rbs +15 -0
- data/sig/durable_message_records.rbs +68 -0
- data/sig/durable_records.rbs +17 -9
- metadata +68 -3
|
@@ -1390,6 +1390,536 @@ module Volcano::Generated
|
|
|
1390
1390
|
return data, status_code, headers
|
|
1391
1391
|
end
|
|
1392
1392
|
|
|
1393
|
+
# List a durable execution's open message waits
|
|
1394
|
+
# Lists the waits an execution has open in `ctx.waitForMessage`, oldest first, so you can see which message names it is waiting for. Project access tokens can list waits, including read-only ones.
|
|
1395
|
+
# @param id [String] Project ID
|
|
1396
|
+
# @param function_id [String] Durable function ID, or its name within the project
|
|
1397
|
+
# @param execution_id [String] Durable execution ID
|
|
1398
|
+
# @param [Hash] opts the optional parameters
|
|
1399
|
+
# @return [DurableMessageWaitList]
|
|
1400
|
+
def list_durable_message_waits(id, function_id, execution_id, opts = {})
|
|
1401
|
+
data, _status_code, _headers = list_durable_message_waits_with_http_info(id, function_id, execution_id, opts)
|
|
1402
|
+
data
|
|
1403
|
+
end
|
|
1404
|
+
|
|
1405
|
+
# List a durable execution's open message waits
|
|
1406
|
+
# Lists the waits an execution has open in `ctx.waitForMessage`, oldest first, so you can see which message names it is waiting for. Project access tokens can list waits, including read-only ones.
|
|
1407
|
+
# @param id [String] Project ID
|
|
1408
|
+
# @param function_id [String] Durable function ID, or its name within the project
|
|
1409
|
+
# @param execution_id [String] Durable execution ID
|
|
1410
|
+
# @param [Hash] opts the optional parameters
|
|
1411
|
+
# @return [Array<(DurableMessageWaitList, Integer, Hash)>] DurableMessageWaitList data, response status code and response headers
|
|
1412
|
+
def list_durable_message_waits_with_http_info(id, function_id, execution_id, opts = {})
|
|
1413
|
+
if @api_client.config.debugging
|
|
1414
|
+
@api_client.config.logger.debug 'Calling API: DurableFunctionsApi.list_durable_message_waits ...'
|
|
1415
|
+
end
|
|
1416
|
+
# verify the required parameter 'id' is set
|
|
1417
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
1418
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling DurableFunctionsApi.list_durable_message_waits"
|
|
1419
|
+
end
|
|
1420
|
+
# verify the required parameter 'function_id' is set
|
|
1421
|
+
if @api_client.config.client_side_validation && function_id.nil?
|
|
1422
|
+
fail ArgumentError, "Missing the required parameter 'function_id' when calling DurableFunctionsApi.list_durable_message_waits"
|
|
1423
|
+
end
|
|
1424
|
+
# verify the required parameter 'execution_id' is set
|
|
1425
|
+
if @api_client.config.client_side_validation && execution_id.nil?
|
|
1426
|
+
fail ArgumentError, "Missing the required parameter 'execution_id' when calling DurableFunctionsApi.list_durable_message_waits"
|
|
1427
|
+
end
|
|
1428
|
+
# resource path
|
|
1429
|
+
local_var_path = '/projects/{id}/durable-functions/{functionId}/executions/{executionId}/message-waits'.sub('{' + 'id' + '}', CGI.escape(id.to_s)).sub('{' + 'functionId' + '}', CGI.escape(function_id.to_s)).sub('{' + 'executionId' + '}', CGI.escape(execution_id.to_s))
|
|
1430
|
+
|
|
1431
|
+
# query parameters
|
|
1432
|
+
query_params = opts[:query_params] || {}
|
|
1433
|
+
|
|
1434
|
+
# header parameters
|
|
1435
|
+
header_params = opts[:header_params] || {}
|
|
1436
|
+
# HTTP header 'Accept' (if needed)
|
|
1437
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
1438
|
+
|
|
1439
|
+
# form parameters
|
|
1440
|
+
form_params = opts[:form_params] || {}
|
|
1441
|
+
|
|
1442
|
+
# http body (model)
|
|
1443
|
+
post_body = opts[:debug_body]
|
|
1444
|
+
|
|
1445
|
+
# return_type
|
|
1446
|
+
return_type = opts[:debug_return_type] || 'DurableMessageWaitList'
|
|
1447
|
+
|
|
1448
|
+
# auth_names
|
|
1449
|
+
auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken']
|
|
1450
|
+
|
|
1451
|
+
new_options = opts.merge(
|
|
1452
|
+
:operation => :"DurableFunctionsApi.list_durable_message_waits",
|
|
1453
|
+
:header_params => header_params,
|
|
1454
|
+
:query_params => query_params,
|
|
1455
|
+
:form_params => form_params,
|
|
1456
|
+
:body => post_body,
|
|
1457
|
+
:auth_names => auth_names,
|
|
1458
|
+
:return_type => return_type
|
|
1459
|
+
)
|
|
1460
|
+
|
|
1461
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
1462
|
+
if @api_client.config.debugging
|
|
1463
|
+
@api_client.config.logger.debug "API called: DurableFunctionsApi#list_durable_message_waits\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
1464
|
+
end
|
|
1465
|
+
return data, status_code, headers
|
|
1466
|
+
end
|
|
1467
|
+
|
|
1468
|
+
# List a durable execution's messages
|
|
1469
|
+
# Lists the messages sent to and published by an execution, oldest first. Pass the last `seq` you read as `after` to read only what came next. Project access tokens can list messages, including read-only ones.
|
|
1470
|
+
# @param id [String] Project ID
|
|
1471
|
+
# @param function_id [String] Durable function ID, or its name within the project
|
|
1472
|
+
# @param execution_id [String] Durable execution ID
|
|
1473
|
+
# @param [Hash] opts the optional parameters
|
|
1474
|
+
# @option opts [DurableMessageDirection] :direction Return only messages travelling this way.
|
|
1475
|
+
# @option opts [String] :name Return only messages with this name.
|
|
1476
|
+
# @option opts [Integer] :after Return only messages whose `seq` is greater than this. (default to 0)
|
|
1477
|
+
# @option opts [Integer] :limit Most messages to return. (default to 100)
|
|
1478
|
+
# @return [DurableMessageList]
|
|
1479
|
+
def list_durable_messages(id, function_id, execution_id, opts = {})
|
|
1480
|
+
data, _status_code, _headers = list_durable_messages_with_http_info(id, function_id, execution_id, opts)
|
|
1481
|
+
data
|
|
1482
|
+
end
|
|
1483
|
+
|
|
1484
|
+
# List a durable execution's messages
|
|
1485
|
+
# Lists the messages sent to and published by an execution, oldest first. Pass the last `seq` you read as `after` to read only what came next. Project access tokens can list messages, including read-only ones.
|
|
1486
|
+
# @param id [String] Project ID
|
|
1487
|
+
# @param function_id [String] Durable function ID, or its name within the project
|
|
1488
|
+
# @param execution_id [String] Durable execution ID
|
|
1489
|
+
# @param [Hash] opts the optional parameters
|
|
1490
|
+
# @option opts [DurableMessageDirection] :direction Return only messages travelling this way.
|
|
1491
|
+
# @option opts [String] :name Return only messages with this name.
|
|
1492
|
+
# @option opts [Integer] :after Return only messages whose `seq` is greater than this. (default to 0)
|
|
1493
|
+
# @option opts [Integer] :limit Most messages to return. (default to 100)
|
|
1494
|
+
# @return [Array<(DurableMessageList, Integer, Hash)>] DurableMessageList data, response status code and response headers
|
|
1495
|
+
def list_durable_messages_with_http_info(id, function_id, execution_id, opts = {})
|
|
1496
|
+
if @api_client.config.debugging
|
|
1497
|
+
@api_client.config.logger.debug 'Calling API: DurableFunctionsApi.list_durable_messages ...'
|
|
1498
|
+
end
|
|
1499
|
+
# verify the required parameter 'id' is set
|
|
1500
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
1501
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling DurableFunctionsApi.list_durable_messages"
|
|
1502
|
+
end
|
|
1503
|
+
# verify the required parameter 'function_id' is set
|
|
1504
|
+
if @api_client.config.client_side_validation && function_id.nil?
|
|
1505
|
+
fail ArgumentError, "Missing the required parameter 'function_id' when calling DurableFunctionsApi.list_durable_messages"
|
|
1506
|
+
end
|
|
1507
|
+
# verify the required parameter 'execution_id' is set
|
|
1508
|
+
if @api_client.config.client_side_validation && execution_id.nil?
|
|
1509
|
+
fail ArgumentError, "Missing the required parameter 'execution_id' when calling DurableFunctionsApi.list_durable_messages"
|
|
1510
|
+
end
|
|
1511
|
+
if @api_client.config.client_side_validation && !opts[:'name'].nil? && opts[:'name'].to_s.length > 237
|
|
1512
|
+
fail ArgumentError, 'invalid value for "opts[:"name"]" when calling DurableFunctionsApi.list_durable_messages, the character length must be smaller than or equal to 237.'
|
|
1513
|
+
end
|
|
1514
|
+
|
|
1515
|
+
if @api_client.config.client_side_validation && !opts[:'name'].nil? && opts[:'name'].to_s.length < 1
|
|
1516
|
+
fail ArgumentError, 'invalid value for "opts[:"name"]" when calling DurableFunctionsApi.list_durable_messages, the character length must be greater than or equal to 1.'
|
|
1517
|
+
end
|
|
1518
|
+
|
|
1519
|
+
pattern = Regexp.new(/^[ -~]+$/)
|
|
1520
|
+
if @api_client.config.client_side_validation && !opts[:'name'].nil? && opts[:'name'] !~ pattern
|
|
1521
|
+
fail ArgumentError, "invalid value for 'opts[:\"name\"]' when calling DurableFunctionsApi.list_durable_messages, must conform to the pattern #{pattern}."
|
|
1522
|
+
end
|
|
1523
|
+
|
|
1524
|
+
if @api_client.config.client_side_validation && !opts[:'after'].nil? && opts[:'after'] < 0
|
|
1525
|
+
fail ArgumentError, 'invalid value for "opts[:"after"]" when calling DurableFunctionsApi.list_durable_messages, must be greater than or equal to 0.'
|
|
1526
|
+
end
|
|
1527
|
+
|
|
1528
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 500
|
|
1529
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling DurableFunctionsApi.list_durable_messages, must be smaller than or equal to 500.'
|
|
1530
|
+
end
|
|
1531
|
+
|
|
1532
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
|
1533
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling DurableFunctionsApi.list_durable_messages, must be greater than or equal to 1.'
|
|
1534
|
+
end
|
|
1535
|
+
|
|
1536
|
+
# resource path
|
|
1537
|
+
local_var_path = '/projects/{id}/durable-functions/{functionId}/executions/{executionId}/messages'.sub('{' + 'id' + '}', CGI.escape(id.to_s)).sub('{' + 'functionId' + '}', CGI.escape(function_id.to_s)).sub('{' + 'executionId' + '}', CGI.escape(execution_id.to_s))
|
|
1538
|
+
|
|
1539
|
+
# query parameters
|
|
1540
|
+
query_params = opts[:query_params] || {}
|
|
1541
|
+
query_params[:'direction'] = opts[:'direction'] if !opts[:'direction'].nil?
|
|
1542
|
+
query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?
|
|
1543
|
+
query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
|
|
1544
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
1545
|
+
|
|
1546
|
+
# header parameters
|
|
1547
|
+
header_params = opts[:header_params] || {}
|
|
1548
|
+
# HTTP header 'Accept' (if needed)
|
|
1549
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
1550
|
+
|
|
1551
|
+
# form parameters
|
|
1552
|
+
form_params = opts[:form_params] || {}
|
|
1553
|
+
|
|
1554
|
+
# http body (model)
|
|
1555
|
+
post_body = opts[:debug_body]
|
|
1556
|
+
|
|
1557
|
+
# return_type
|
|
1558
|
+
return_type = opts[:debug_return_type] || 'DurableMessageList'
|
|
1559
|
+
|
|
1560
|
+
# auth_names
|
|
1561
|
+
auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken']
|
|
1562
|
+
|
|
1563
|
+
new_options = opts.merge(
|
|
1564
|
+
:operation => :"DurableFunctionsApi.list_durable_messages",
|
|
1565
|
+
:header_params => header_params,
|
|
1566
|
+
:query_params => query_params,
|
|
1567
|
+
:form_params => form_params,
|
|
1568
|
+
:body => post_body,
|
|
1569
|
+
:auth_names => auth_names,
|
|
1570
|
+
:return_type => return_type
|
|
1571
|
+
)
|
|
1572
|
+
|
|
1573
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
1574
|
+
if @api_client.config.debugging
|
|
1575
|
+
@api_client.config.logger.debug "API called: DurableFunctionsApi#list_durable_messages\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
1576
|
+
end
|
|
1577
|
+
return data, status_code, headers
|
|
1578
|
+
end
|
|
1579
|
+
|
|
1580
|
+
# List a durable execution's messages from an application
|
|
1581
|
+
# Lists the messages sent to and published by an execution, oldest first. Pass the last `seq` you read as `after` to read only what came next; that is how a client catches up after a live subscription reconnects. Access follows the same rules as sending.
|
|
1582
|
+
# @param function_id [String] Durable function ID, or its name within the project
|
|
1583
|
+
# @param execution_id [String] Durable execution ID
|
|
1584
|
+
# @param [Hash] opts the optional parameters
|
|
1585
|
+
# @option opts [String] :x_volcano_client_token The `client_token` the execution's start returned. Lets an anon key, or a user who did not start the execution, reach it.
|
|
1586
|
+
# @option opts [DurableMessageDirection] :direction Return only messages travelling this way.
|
|
1587
|
+
# @option opts [String] :name Return only messages with this name.
|
|
1588
|
+
# @option opts [Integer] :after Return only messages whose `seq` is greater than this. (default to 0)
|
|
1589
|
+
# @option opts [Integer] :limit Most messages to return. (default to 100)
|
|
1590
|
+
# @return [DurableMessageList]
|
|
1591
|
+
def list_durable_messages_from_application(function_id, execution_id, opts = {})
|
|
1592
|
+
data, _status_code, _headers = list_durable_messages_from_application_with_http_info(function_id, execution_id, opts)
|
|
1593
|
+
data
|
|
1594
|
+
end
|
|
1595
|
+
|
|
1596
|
+
# List a durable execution's messages from an application
|
|
1597
|
+
# Lists the messages sent to and published by an execution, oldest first. Pass the last `seq` you read as `after` to read only what came next; that is how a client catches up after a live subscription reconnects. Access follows the same rules as sending.
|
|
1598
|
+
# @param function_id [String] Durable function ID, or its name within the project
|
|
1599
|
+
# @param execution_id [String] Durable execution ID
|
|
1600
|
+
# @param [Hash] opts the optional parameters
|
|
1601
|
+
# @option opts [String] :x_volcano_client_token The `client_token` the execution's start returned. Lets an anon key, or a user who did not start the execution, reach it.
|
|
1602
|
+
# @option opts [DurableMessageDirection] :direction Return only messages travelling this way.
|
|
1603
|
+
# @option opts [String] :name Return only messages with this name.
|
|
1604
|
+
# @option opts [Integer] :after Return only messages whose `seq` is greater than this. (default to 0)
|
|
1605
|
+
# @option opts [Integer] :limit Most messages to return. (default to 100)
|
|
1606
|
+
# @return [Array<(DurableMessageList, Integer, Hash)>] DurableMessageList data, response status code and response headers
|
|
1607
|
+
def list_durable_messages_from_application_with_http_info(function_id, execution_id, opts = {})
|
|
1608
|
+
if @api_client.config.debugging
|
|
1609
|
+
@api_client.config.logger.debug 'Calling API: DurableFunctionsApi.list_durable_messages_from_application ...'
|
|
1610
|
+
end
|
|
1611
|
+
# verify the required parameter 'function_id' is set
|
|
1612
|
+
if @api_client.config.client_side_validation && function_id.nil?
|
|
1613
|
+
fail ArgumentError, "Missing the required parameter 'function_id' when calling DurableFunctionsApi.list_durable_messages_from_application"
|
|
1614
|
+
end
|
|
1615
|
+
# verify the required parameter 'execution_id' is set
|
|
1616
|
+
if @api_client.config.client_side_validation && execution_id.nil?
|
|
1617
|
+
fail ArgumentError, "Missing the required parameter 'execution_id' when calling DurableFunctionsApi.list_durable_messages_from_application"
|
|
1618
|
+
end
|
|
1619
|
+
if @api_client.config.client_side_validation && !opts[:'x_volcano_client_token'].nil? && opts[:'x_volcano_client_token'].to_s.length > 128
|
|
1620
|
+
fail ArgumentError, 'invalid value for "opts[:"x_volcano_client_token"]" when calling DurableFunctionsApi.list_durable_messages_from_application, the character length must be smaller than or equal to 128.'
|
|
1621
|
+
end
|
|
1622
|
+
|
|
1623
|
+
if @api_client.config.client_side_validation && !opts[:'name'].nil? && opts[:'name'].to_s.length > 237
|
|
1624
|
+
fail ArgumentError, 'invalid value for "opts[:"name"]" when calling DurableFunctionsApi.list_durable_messages_from_application, the character length must be smaller than or equal to 237.'
|
|
1625
|
+
end
|
|
1626
|
+
|
|
1627
|
+
if @api_client.config.client_side_validation && !opts[:'name'].nil? && opts[:'name'].to_s.length < 1
|
|
1628
|
+
fail ArgumentError, 'invalid value for "opts[:"name"]" when calling DurableFunctionsApi.list_durable_messages_from_application, the character length must be greater than or equal to 1.'
|
|
1629
|
+
end
|
|
1630
|
+
|
|
1631
|
+
pattern = Regexp.new(/^[ -~]+$/)
|
|
1632
|
+
if @api_client.config.client_side_validation && !opts[:'name'].nil? && opts[:'name'] !~ pattern
|
|
1633
|
+
fail ArgumentError, "invalid value for 'opts[:\"name\"]' when calling DurableFunctionsApi.list_durable_messages_from_application, must conform to the pattern #{pattern}."
|
|
1634
|
+
end
|
|
1635
|
+
|
|
1636
|
+
if @api_client.config.client_side_validation && !opts[:'after'].nil? && opts[:'after'] < 0
|
|
1637
|
+
fail ArgumentError, 'invalid value for "opts[:"after"]" when calling DurableFunctionsApi.list_durable_messages_from_application, must be greater than or equal to 0.'
|
|
1638
|
+
end
|
|
1639
|
+
|
|
1640
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 500
|
|
1641
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling DurableFunctionsApi.list_durable_messages_from_application, must be smaller than or equal to 500.'
|
|
1642
|
+
end
|
|
1643
|
+
|
|
1644
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
|
1645
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling DurableFunctionsApi.list_durable_messages_from_application, must be greater than or equal to 1.'
|
|
1646
|
+
end
|
|
1647
|
+
|
|
1648
|
+
# resource path
|
|
1649
|
+
local_var_path = '/durable-functions/{functionId}/executions/{executionId}/messages'.sub('{' + 'functionId' + '}', CGI.escape(function_id.to_s)).sub('{' + 'executionId' + '}', CGI.escape(execution_id.to_s))
|
|
1650
|
+
|
|
1651
|
+
# query parameters
|
|
1652
|
+
query_params = opts[:query_params] || {}
|
|
1653
|
+
query_params[:'direction'] = opts[:'direction'] if !opts[:'direction'].nil?
|
|
1654
|
+
query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?
|
|
1655
|
+
query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
|
|
1656
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
1657
|
+
|
|
1658
|
+
# header parameters
|
|
1659
|
+
header_params = opts[:header_params] || {}
|
|
1660
|
+
# HTTP header 'Accept' (if needed)
|
|
1661
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
1662
|
+
header_params[:'X-Volcano-Client-Token'] = opts[:'x_volcano_client_token'] if !opts[:'x_volcano_client_token'].nil?
|
|
1663
|
+
|
|
1664
|
+
# form parameters
|
|
1665
|
+
form_params = opts[:form_params] || {}
|
|
1666
|
+
|
|
1667
|
+
# http body (model)
|
|
1668
|
+
post_body = opts[:debug_body]
|
|
1669
|
+
|
|
1670
|
+
# return_type
|
|
1671
|
+
return_type = opts[:debug_return_type] || 'DurableMessageList'
|
|
1672
|
+
|
|
1673
|
+
# auth_names
|
|
1674
|
+
auth_names = opts[:debug_auth_names] || ['ServiceRoleKey', 'AuthUserAccessToken', 'AnonKey']
|
|
1675
|
+
|
|
1676
|
+
new_options = opts.merge(
|
|
1677
|
+
:operation => :"DurableFunctionsApi.list_durable_messages_from_application",
|
|
1678
|
+
:header_params => header_params,
|
|
1679
|
+
:query_params => query_params,
|
|
1680
|
+
:form_params => form_params,
|
|
1681
|
+
:body => post_body,
|
|
1682
|
+
:auth_names => auth_names,
|
|
1683
|
+
:return_type => return_type
|
|
1684
|
+
)
|
|
1685
|
+
|
|
1686
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
1687
|
+
if @api_client.config.debugging
|
|
1688
|
+
@api_client.config.logger.debug "API called: DurableFunctionsApi#list_durable_messages_from_application\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
1689
|
+
end
|
|
1690
|
+
return data, status_code, headers
|
|
1691
|
+
end
|
|
1692
|
+
|
|
1693
|
+
# Open a messages session from inside a workflow
|
|
1694
|
+
# Opens the session a workflow publishes messages with. The Volcano SDK calls this once per workflow context, on its first `ctx.publish`; applications do not call it directly. As for a wait, `execution_ref` and `callback_id` are the credential. The session's token is delivered to the workflow itself and never appears in a response. Retrying is safe: a request for a session that is already registered returns it with `200`.
|
|
1695
|
+
# @param open_durable_message_session_request [OpenDurableMessageSessionRequest]
|
|
1696
|
+
# @param [Hash] opts the optional parameters
|
|
1697
|
+
# @return [DurableMessageSessionRegistration]
|
|
1698
|
+
def open_durable_message_session(open_durable_message_session_request, opts = {})
|
|
1699
|
+
data, _status_code, _headers = open_durable_message_session_with_http_info(open_durable_message_session_request, opts)
|
|
1700
|
+
data
|
|
1701
|
+
end
|
|
1702
|
+
|
|
1703
|
+
# Open a messages session from inside a workflow
|
|
1704
|
+
# Opens the session a workflow publishes messages with. The Volcano SDK calls this once per workflow context, on its first `ctx.publish`; applications do not call it directly. As for a wait, `execution_ref` and `callback_id` are the credential. The session's token is delivered to the workflow itself and never appears in a response. Retrying is safe: a request for a session that is already registered returns it with `200`.
|
|
1705
|
+
# @param open_durable_message_session_request [OpenDurableMessageSessionRequest]
|
|
1706
|
+
# @param [Hash] opts the optional parameters
|
|
1707
|
+
# @return [Array<(DurableMessageSessionRegistration, Integer, Hash)>] DurableMessageSessionRegistration data, response status code and response headers
|
|
1708
|
+
def open_durable_message_session_with_http_info(open_durable_message_session_request, opts = {})
|
|
1709
|
+
if @api_client.config.debugging
|
|
1710
|
+
@api_client.config.logger.debug 'Calling API: DurableFunctionsApi.open_durable_message_session ...'
|
|
1711
|
+
end
|
|
1712
|
+
# verify the required parameter 'open_durable_message_session_request' is set
|
|
1713
|
+
if @api_client.config.client_side_validation && open_durable_message_session_request.nil?
|
|
1714
|
+
fail ArgumentError, "Missing the required parameter 'open_durable_message_session_request' when calling DurableFunctionsApi.open_durable_message_session"
|
|
1715
|
+
end
|
|
1716
|
+
# resource path
|
|
1717
|
+
local_var_path = '/durable-messages/sessions'
|
|
1718
|
+
|
|
1719
|
+
# query parameters
|
|
1720
|
+
query_params = opts[:query_params] || {}
|
|
1721
|
+
|
|
1722
|
+
# header parameters
|
|
1723
|
+
header_params = opts[:header_params] || {}
|
|
1724
|
+
# HTTP header 'Accept' (if needed)
|
|
1725
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
1726
|
+
# HTTP header 'Content-Type'
|
|
1727
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
1728
|
+
if !content_type.nil?
|
|
1729
|
+
header_params['Content-Type'] = content_type
|
|
1730
|
+
end
|
|
1731
|
+
|
|
1732
|
+
# form parameters
|
|
1733
|
+
form_params = opts[:form_params] || {}
|
|
1734
|
+
|
|
1735
|
+
# http body (model)
|
|
1736
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(open_durable_message_session_request)
|
|
1737
|
+
|
|
1738
|
+
# return_type
|
|
1739
|
+
return_type = opts[:debug_return_type] || 'DurableMessageSessionRegistration'
|
|
1740
|
+
|
|
1741
|
+
# auth_names
|
|
1742
|
+
auth_names = opts[:debug_auth_names] || []
|
|
1743
|
+
|
|
1744
|
+
new_options = opts.merge(
|
|
1745
|
+
:operation => :"DurableFunctionsApi.open_durable_message_session",
|
|
1746
|
+
:header_params => header_params,
|
|
1747
|
+
:query_params => query_params,
|
|
1748
|
+
:form_params => form_params,
|
|
1749
|
+
:body => post_body,
|
|
1750
|
+
:auth_names => auth_names,
|
|
1751
|
+
:return_type => return_type
|
|
1752
|
+
)
|
|
1753
|
+
|
|
1754
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
1755
|
+
if @api_client.config.debugging
|
|
1756
|
+
@api_client.config.logger.debug "API called: DurableFunctionsApi#open_durable_message_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
1757
|
+
end
|
|
1758
|
+
return data, status_code, headers
|
|
1759
|
+
end
|
|
1760
|
+
|
|
1761
|
+
# Publish a message from inside a workflow
|
|
1762
|
+
# Publishes a named message from a running workflow. The Volcano SDK calls this from `ctx.publish`; applications do not call it directly. The message is stored, listed with the execution's messages, and delivered live to clients subscribed to the execution. Live delivery counts against the project's Realtime messages. The SDK sends an `Idempotency-Key` that a rerun of the publishing step repeats, so a step that runs again returns the first message with `200` and publishes nothing.
|
|
1763
|
+
# @param x_volcano_durable_session [String] The session token the workflow received when its session opened.
|
|
1764
|
+
# @param publish_durable_message_request [PublishDurableMessageRequest]
|
|
1765
|
+
# @param [Hash] opts the optional parameters
|
|
1766
|
+
# @option opts [String] :idempotency_key Makes a send safe to retry. A repeat with a key the same sender has used on the execution returns the first message and sends nothing. Keys of different senders never collide. Up to 255 characters.
|
|
1767
|
+
# @return [DurableMessage]
|
|
1768
|
+
def publish_durable_message(x_volcano_durable_session, publish_durable_message_request, opts = {})
|
|
1769
|
+
data, _status_code, _headers = publish_durable_message_with_http_info(x_volcano_durable_session, publish_durable_message_request, opts)
|
|
1770
|
+
data
|
|
1771
|
+
end
|
|
1772
|
+
|
|
1773
|
+
# Publish a message from inside a workflow
|
|
1774
|
+
# Publishes a named message from a running workflow. The Volcano SDK calls this from `ctx.publish`; applications do not call it directly. The message is stored, listed with the execution's messages, and delivered live to clients subscribed to the execution. Live delivery counts against the project's Realtime messages. The SDK sends an `Idempotency-Key` that a rerun of the publishing step repeats, so a step that runs again returns the first message with `200` and publishes nothing.
|
|
1775
|
+
# @param x_volcano_durable_session [String] The session token the workflow received when its session opened.
|
|
1776
|
+
# @param publish_durable_message_request [PublishDurableMessageRequest]
|
|
1777
|
+
# @param [Hash] opts the optional parameters
|
|
1778
|
+
# @option opts [String] :idempotency_key Makes a send safe to retry. A repeat with a key the same sender has used on the execution returns the first message and sends nothing. Keys of different senders never collide. Up to 255 characters.
|
|
1779
|
+
# @return [Array<(DurableMessage, Integer, Hash)>] DurableMessage data, response status code and response headers
|
|
1780
|
+
def publish_durable_message_with_http_info(x_volcano_durable_session, publish_durable_message_request, opts = {})
|
|
1781
|
+
if @api_client.config.debugging
|
|
1782
|
+
@api_client.config.logger.debug 'Calling API: DurableFunctionsApi.publish_durable_message ...'
|
|
1783
|
+
end
|
|
1784
|
+
# verify the required parameter 'x_volcano_durable_session' is set
|
|
1785
|
+
if @api_client.config.client_side_validation && x_volcano_durable_session.nil?
|
|
1786
|
+
fail ArgumentError, "Missing the required parameter 'x_volcano_durable_session' when calling DurableFunctionsApi.publish_durable_message"
|
|
1787
|
+
end
|
|
1788
|
+
if @api_client.config.client_side_validation && x_volcano_durable_session.to_s.length > 128
|
|
1789
|
+
fail ArgumentError, 'invalid value for "x_volcano_durable_session" when calling DurableFunctionsApi.publish_durable_message, the character length must be smaller than or equal to 128.'
|
|
1790
|
+
end
|
|
1791
|
+
|
|
1792
|
+
if @api_client.config.client_side_validation && x_volcano_durable_session.to_s.length < 1
|
|
1793
|
+
fail ArgumentError, 'invalid value for "x_volcano_durable_session" when calling DurableFunctionsApi.publish_durable_message, the character length must be greater than or equal to 1.'
|
|
1794
|
+
end
|
|
1795
|
+
|
|
1796
|
+
# verify the required parameter 'publish_durable_message_request' is set
|
|
1797
|
+
if @api_client.config.client_side_validation && publish_durable_message_request.nil?
|
|
1798
|
+
fail ArgumentError, "Missing the required parameter 'publish_durable_message_request' when calling DurableFunctionsApi.publish_durable_message"
|
|
1799
|
+
end
|
|
1800
|
+
if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255
|
|
1801
|
+
fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling DurableFunctionsApi.publish_durable_message, the character length must be smaller than or equal to 255.'
|
|
1802
|
+
end
|
|
1803
|
+
|
|
1804
|
+
if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length < 1
|
|
1805
|
+
fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling DurableFunctionsApi.publish_durable_message, the character length must be greater than or equal to 1.'
|
|
1806
|
+
end
|
|
1807
|
+
|
|
1808
|
+
# resource path
|
|
1809
|
+
local_var_path = '/durable-messages/publish'
|
|
1810
|
+
|
|
1811
|
+
# query parameters
|
|
1812
|
+
query_params = opts[:query_params] || {}
|
|
1813
|
+
|
|
1814
|
+
# header parameters
|
|
1815
|
+
header_params = opts[:header_params] || {}
|
|
1816
|
+
# HTTP header 'Accept' (if needed)
|
|
1817
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
1818
|
+
# HTTP header 'Content-Type'
|
|
1819
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
1820
|
+
if !content_type.nil?
|
|
1821
|
+
header_params['Content-Type'] = content_type
|
|
1822
|
+
end
|
|
1823
|
+
header_params[:'X-Volcano-Durable-Session'] = x_volcano_durable_session
|
|
1824
|
+
header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
|
|
1825
|
+
|
|
1826
|
+
# form parameters
|
|
1827
|
+
form_params = opts[:form_params] || {}
|
|
1828
|
+
|
|
1829
|
+
# http body (model)
|
|
1830
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(publish_durable_message_request)
|
|
1831
|
+
|
|
1832
|
+
# return_type
|
|
1833
|
+
return_type = opts[:debug_return_type] || 'DurableMessage'
|
|
1834
|
+
|
|
1835
|
+
# auth_names
|
|
1836
|
+
auth_names = opts[:debug_auth_names] || []
|
|
1837
|
+
|
|
1838
|
+
new_options = opts.merge(
|
|
1839
|
+
:operation => :"DurableFunctionsApi.publish_durable_message",
|
|
1840
|
+
:header_params => header_params,
|
|
1841
|
+
:query_params => query_params,
|
|
1842
|
+
:form_params => form_params,
|
|
1843
|
+
:body => post_body,
|
|
1844
|
+
:auth_names => auth_names,
|
|
1845
|
+
:return_type => return_type
|
|
1846
|
+
)
|
|
1847
|
+
|
|
1848
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
1849
|
+
if @api_client.config.debugging
|
|
1850
|
+
@api_client.config.logger.debug "API called: DurableFunctionsApi#publish_durable_message\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
1851
|
+
end
|
|
1852
|
+
return data, status_code, headers
|
|
1853
|
+
end
|
|
1854
|
+
|
|
1855
|
+
# Wait for a message from inside a workflow
|
|
1856
|
+
# Registers a wait for a named message. The Volcano SDK calls this from `ctx.waitForMessage`; applications do not call it directly. `execution_ref` and `callback_id` are opaque values the SDK reads from the running workflow. Together they are the request's credential, so the operation takes no other authentication. When a message for the name is already queued, the wait takes the oldest one at once. Retrying is safe: a request for a wait that is already registered returns it with `200`.
|
|
1857
|
+
# @param register_durable_message_wait_request [RegisterDurableMessageWaitRequest]
|
|
1858
|
+
# @param [Hash] opts the optional parameters
|
|
1859
|
+
# @return [DurableMessageWaitRegistration]
|
|
1860
|
+
def register_durable_message_wait(register_durable_message_wait_request, opts = {})
|
|
1861
|
+
data, _status_code, _headers = register_durable_message_wait_with_http_info(register_durable_message_wait_request, opts)
|
|
1862
|
+
data
|
|
1863
|
+
end
|
|
1864
|
+
|
|
1865
|
+
# Wait for a message from inside a workflow
|
|
1866
|
+
# Registers a wait for a named message. The Volcano SDK calls this from `ctx.waitForMessage`; applications do not call it directly. `execution_ref` and `callback_id` are opaque values the SDK reads from the running workflow. Together they are the request's credential, so the operation takes no other authentication. When a message for the name is already queued, the wait takes the oldest one at once. Retrying is safe: a request for a wait that is already registered returns it with `200`.
|
|
1867
|
+
# @param register_durable_message_wait_request [RegisterDurableMessageWaitRequest]
|
|
1868
|
+
# @param [Hash] opts the optional parameters
|
|
1869
|
+
# @return [Array<(DurableMessageWaitRegistration, Integer, Hash)>] DurableMessageWaitRegistration data, response status code and response headers
|
|
1870
|
+
def register_durable_message_wait_with_http_info(register_durable_message_wait_request, opts = {})
|
|
1871
|
+
if @api_client.config.debugging
|
|
1872
|
+
@api_client.config.logger.debug 'Calling API: DurableFunctionsApi.register_durable_message_wait ...'
|
|
1873
|
+
end
|
|
1874
|
+
# verify the required parameter 'register_durable_message_wait_request' is set
|
|
1875
|
+
if @api_client.config.client_side_validation && register_durable_message_wait_request.nil?
|
|
1876
|
+
fail ArgumentError, "Missing the required parameter 'register_durable_message_wait_request' when calling DurableFunctionsApi.register_durable_message_wait"
|
|
1877
|
+
end
|
|
1878
|
+
# resource path
|
|
1879
|
+
local_var_path = '/durable-messages/waits'
|
|
1880
|
+
|
|
1881
|
+
# query parameters
|
|
1882
|
+
query_params = opts[:query_params] || {}
|
|
1883
|
+
|
|
1884
|
+
# header parameters
|
|
1885
|
+
header_params = opts[:header_params] || {}
|
|
1886
|
+
# HTTP header 'Accept' (if needed)
|
|
1887
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
1888
|
+
# HTTP header 'Content-Type'
|
|
1889
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
1890
|
+
if !content_type.nil?
|
|
1891
|
+
header_params['Content-Type'] = content_type
|
|
1892
|
+
end
|
|
1893
|
+
|
|
1894
|
+
# form parameters
|
|
1895
|
+
form_params = opts[:form_params] || {}
|
|
1896
|
+
|
|
1897
|
+
# http body (model)
|
|
1898
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(register_durable_message_wait_request)
|
|
1899
|
+
|
|
1900
|
+
# return_type
|
|
1901
|
+
return_type = opts[:debug_return_type] || 'DurableMessageWaitRegistration'
|
|
1902
|
+
|
|
1903
|
+
# auth_names
|
|
1904
|
+
auth_names = opts[:debug_auth_names] || []
|
|
1905
|
+
|
|
1906
|
+
new_options = opts.merge(
|
|
1907
|
+
:operation => :"DurableFunctionsApi.register_durable_message_wait",
|
|
1908
|
+
:header_params => header_params,
|
|
1909
|
+
:query_params => query_params,
|
|
1910
|
+
:form_params => form_params,
|
|
1911
|
+
:body => post_body,
|
|
1912
|
+
:auth_names => auth_names,
|
|
1913
|
+
:return_type => return_type
|
|
1914
|
+
)
|
|
1915
|
+
|
|
1916
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
1917
|
+
if @api_client.config.debugging
|
|
1918
|
+
@api_client.config.logger.debug "API called: DurableFunctionsApi#register_durable_message_wait\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
1919
|
+
end
|
|
1920
|
+
return data, status_code, headers
|
|
1921
|
+
end
|
|
1922
|
+
|
|
1393
1923
|
# Request an approval from inside a workflow
|
|
1394
1924
|
# Registers an approval request for a running durable execution. The Volcano SDK calls this from `ctx.waitForApproval`; applications do not call it directly. `execution_ref` and `callback_id` are opaque values the SDK reads from the running workflow. Together they are the request's credential, so the operation takes no other authentication. The approval belongs to the project that owns the execution, and expires when the workflow's own approval timeout does. Retrying is safe: a request for an approval that is already registered returns it with `200`.
|
|
1395
1925
|
# @param request_durable_approval_request [RequestDurableApprovalRequest]
|
|
@@ -1458,6 +1988,201 @@ module Volcano::Generated
|
|
|
1458
1988
|
return data, status_code, headers
|
|
1459
1989
|
end
|
|
1460
1990
|
|
|
1991
|
+
# Send a message to a durable execution
|
|
1992
|
+
# Sends a named message to a running execution, as `POST /durable-functions/{functionId}/executions/{executionId}/messages` does for an application. The workflow receives it from `ctx.waitForMessage` with the same name; until then it is kept, and waits take messages oldest first. Project access tokens can send messages, but read-only ones cannot. A message never decides an approval.
|
|
1993
|
+
# @param id [String] Project ID
|
|
1994
|
+
# @param function_id [String] Durable function ID, or its name within the project
|
|
1995
|
+
# @param execution_id [String] Durable execution ID
|
|
1996
|
+
# @param send_durable_message_request [SendDurableMessageRequest]
|
|
1997
|
+
# @param [Hash] opts the optional parameters
|
|
1998
|
+
# @option opts [String] :idempotency_key Makes a send safe to retry. A repeat with a key the same sender has used on the execution returns the first message and sends nothing. Keys of different senders never collide. Up to 255 characters.
|
|
1999
|
+
# @return [DurableMessage]
|
|
2000
|
+
def send_durable_message(id, function_id, execution_id, send_durable_message_request, opts = {})
|
|
2001
|
+
data, _status_code, _headers = send_durable_message_with_http_info(id, function_id, execution_id, send_durable_message_request, opts)
|
|
2002
|
+
data
|
|
2003
|
+
end
|
|
2004
|
+
|
|
2005
|
+
# Send a message to a durable execution
|
|
2006
|
+
# Sends a named message to a running execution, as `POST /durable-functions/{functionId}/executions/{executionId}/messages` does for an application. The workflow receives it from `ctx.waitForMessage` with the same name; until then it is kept, and waits take messages oldest first. Project access tokens can send messages, but read-only ones cannot. A message never decides an approval.
|
|
2007
|
+
# @param id [String] Project ID
|
|
2008
|
+
# @param function_id [String] Durable function ID, or its name within the project
|
|
2009
|
+
# @param execution_id [String] Durable execution ID
|
|
2010
|
+
# @param send_durable_message_request [SendDurableMessageRequest]
|
|
2011
|
+
# @param [Hash] opts the optional parameters
|
|
2012
|
+
# @option opts [String] :idempotency_key Makes a send safe to retry. A repeat with a key the same sender has used on the execution returns the first message and sends nothing. Keys of different senders never collide. Up to 255 characters.
|
|
2013
|
+
# @return [Array<(DurableMessage, Integer, Hash)>] DurableMessage data, response status code and response headers
|
|
2014
|
+
def send_durable_message_with_http_info(id, function_id, execution_id, send_durable_message_request, opts = {})
|
|
2015
|
+
if @api_client.config.debugging
|
|
2016
|
+
@api_client.config.logger.debug 'Calling API: DurableFunctionsApi.send_durable_message ...'
|
|
2017
|
+
end
|
|
2018
|
+
# verify the required parameter 'id' is set
|
|
2019
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
2020
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling DurableFunctionsApi.send_durable_message"
|
|
2021
|
+
end
|
|
2022
|
+
# verify the required parameter 'function_id' is set
|
|
2023
|
+
if @api_client.config.client_side_validation && function_id.nil?
|
|
2024
|
+
fail ArgumentError, "Missing the required parameter 'function_id' when calling DurableFunctionsApi.send_durable_message"
|
|
2025
|
+
end
|
|
2026
|
+
# verify the required parameter 'execution_id' is set
|
|
2027
|
+
if @api_client.config.client_side_validation && execution_id.nil?
|
|
2028
|
+
fail ArgumentError, "Missing the required parameter 'execution_id' when calling DurableFunctionsApi.send_durable_message"
|
|
2029
|
+
end
|
|
2030
|
+
# verify the required parameter 'send_durable_message_request' is set
|
|
2031
|
+
if @api_client.config.client_side_validation && send_durable_message_request.nil?
|
|
2032
|
+
fail ArgumentError, "Missing the required parameter 'send_durable_message_request' when calling DurableFunctionsApi.send_durable_message"
|
|
2033
|
+
end
|
|
2034
|
+
if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255
|
|
2035
|
+
fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling DurableFunctionsApi.send_durable_message, the character length must be smaller than or equal to 255.'
|
|
2036
|
+
end
|
|
2037
|
+
|
|
2038
|
+
if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length < 1
|
|
2039
|
+
fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling DurableFunctionsApi.send_durable_message, the character length must be greater than or equal to 1.'
|
|
2040
|
+
end
|
|
2041
|
+
|
|
2042
|
+
# resource path
|
|
2043
|
+
local_var_path = '/projects/{id}/durable-functions/{functionId}/executions/{executionId}/messages'.sub('{' + 'id' + '}', CGI.escape(id.to_s)).sub('{' + 'functionId' + '}', CGI.escape(function_id.to_s)).sub('{' + 'executionId' + '}', CGI.escape(execution_id.to_s))
|
|
2044
|
+
|
|
2045
|
+
# query parameters
|
|
2046
|
+
query_params = opts[:query_params] || {}
|
|
2047
|
+
|
|
2048
|
+
# header parameters
|
|
2049
|
+
header_params = opts[:header_params] || {}
|
|
2050
|
+
# HTTP header 'Accept' (if needed)
|
|
2051
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
2052
|
+
# HTTP header 'Content-Type'
|
|
2053
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
2054
|
+
if !content_type.nil?
|
|
2055
|
+
header_params['Content-Type'] = content_type
|
|
2056
|
+
end
|
|
2057
|
+
header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
|
|
2058
|
+
|
|
2059
|
+
# form parameters
|
|
2060
|
+
form_params = opts[:form_params] || {}
|
|
2061
|
+
|
|
2062
|
+
# http body (model)
|
|
2063
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(send_durable_message_request)
|
|
2064
|
+
|
|
2065
|
+
# return_type
|
|
2066
|
+
return_type = opts[:debug_return_type] || 'DurableMessage'
|
|
2067
|
+
|
|
2068
|
+
# auth_names
|
|
2069
|
+
auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken']
|
|
2070
|
+
|
|
2071
|
+
new_options = opts.merge(
|
|
2072
|
+
:operation => :"DurableFunctionsApi.send_durable_message",
|
|
2073
|
+
:header_params => header_params,
|
|
2074
|
+
:query_params => query_params,
|
|
2075
|
+
:form_params => form_params,
|
|
2076
|
+
:body => post_body,
|
|
2077
|
+
:auth_names => auth_names,
|
|
2078
|
+
:return_type => return_type
|
|
2079
|
+
)
|
|
2080
|
+
|
|
2081
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
2082
|
+
if @api_client.config.debugging
|
|
2083
|
+
@api_client.config.logger.debug "API called: DurableFunctionsApi#send_durable_message\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
2084
|
+
end
|
|
2085
|
+
return data, status_code, headers
|
|
2086
|
+
end
|
|
2087
|
+
|
|
2088
|
+
# Send a message to a durable execution from an application
|
|
2089
|
+
# Sends a named message to a running execution. The workflow receives it from `ctx.waitForMessage` with the same name. A message sent before anything waits for its name is kept, and each wait takes the oldest one, so messages arrive in the order they were sent. Messages never decide an approval: a workflow waiting in `ctx.waitForApproval` is not resumed by one. **With a service key:** any execution in the project. **With an auth user token:** an execution the user started, or one whose `X-Volcano-Client-Token` the request carries, of a durable function whose `visibility` is `authenticated` or `public`. **With an anon key:** an execution whose `X-Volcano-Client-Token` the request carries, of a function with `visibility: public`. Any other execution answers `404`, as a missing one does. Send `Idempotency-Key` to make a retry safe: a repeat with a key the same sender has used on the execution returns the first message with `200` and sends nothing.
|
|
2090
|
+
# @param function_id [String] Durable function ID, or its name within the project
|
|
2091
|
+
# @param execution_id [String] Durable execution ID
|
|
2092
|
+
# @param send_durable_message_request [SendDurableMessageRequest]
|
|
2093
|
+
# @param [Hash] opts the optional parameters
|
|
2094
|
+
# @option opts [String] :idempotency_key Makes a send safe to retry. A repeat with a key the same sender has used on the execution returns the first message and sends nothing. Keys of different senders never collide. Up to 255 characters.
|
|
2095
|
+
# @option opts [String] :x_volcano_client_token The `client_token` the execution's start returned. Lets an anon key, or a user who did not start the execution, reach it.
|
|
2096
|
+
# @return [DurableMessage]
|
|
2097
|
+
def send_durable_message_from_application(function_id, execution_id, send_durable_message_request, opts = {})
|
|
2098
|
+
data, _status_code, _headers = send_durable_message_from_application_with_http_info(function_id, execution_id, send_durable_message_request, opts)
|
|
2099
|
+
data
|
|
2100
|
+
end
|
|
2101
|
+
|
|
2102
|
+
# Send a message to a durable execution from an application
|
|
2103
|
+
# Sends a named message to a running execution. The workflow receives it from `ctx.waitForMessage` with the same name. A message sent before anything waits for its name is kept, and each wait takes the oldest one, so messages arrive in the order they were sent. Messages never decide an approval: a workflow waiting in `ctx.waitForApproval` is not resumed by one. **With a service key:** any execution in the project. **With an auth user token:** an execution the user started, or one whose `X-Volcano-Client-Token` the request carries, of a durable function whose `visibility` is `authenticated` or `public`. **With an anon key:** an execution whose `X-Volcano-Client-Token` the request carries, of a function with `visibility: public`. Any other execution answers `404`, as a missing one does. Send `Idempotency-Key` to make a retry safe: a repeat with a key the same sender has used on the execution returns the first message with `200` and sends nothing.
|
|
2104
|
+
# @param function_id [String] Durable function ID, or its name within the project
|
|
2105
|
+
# @param execution_id [String] Durable execution ID
|
|
2106
|
+
# @param send_durable_message_request [SendDurableMessageRequest]
|
|
2107
|
+
# @param [Hash] opts the optional parameters
|
|
2108
|
+
# @option opts [String] :idempotency_key Makes a send safe to retry. A repeat with a key the same sender has used on the execution returns the first message and sends nothing. Keys of different senders never collide. Up to 255 characters.
|
|
2109
|
+
# @option opts [String] :x_volcano_client_token The `client_token` the execution's start returned. Lets an anon key, or a user who did not start the execution, reach it.
|
|
2110
|
+
# @return [Array<(DurableMessage, Integer, Hash)>] DurableMessage data, response status code and response headers
|
|
2111
|
+
def send_durable_message_from_application_with_http_info(function_id, execution_id, send_durable_message_request, opts = {})
|
|
2112
|
+
if @api_client.config.debugging
|
|
2113
|
+
@api_client.config.logger.debug 'Calling API: DurableFunctionsApi.send_durable_message_from_application ...'
|
|
2114
|
+
end
|
|
2115
|
+
# verify the required parameter 'function_id' is set
|
|
2116
|
+
if @api_client.config.client_side_validation && function_id.nil?
|
|
2117
|
+
fail ArgumentError, "Missing the required parameter 'function_id' when calling DurableFunctionsApi.send_durable_message_from_application"
|
|
2118
|
+
end
|
|
2119
|
+
# verify the required parameter 'execution_id' is set
|
|
2120
|
+
if @api_client.config.client_side_validation && execution_id.nil?
|
|
2121
|
+
fail ArgumentError, "Missing the required parameter 'execution_id' when calling DurableFunctionsApi.send_durable_message_from_application"
|
|
2122
|
+
end
|
|
2123
|
+
# verify the required parameter 'send_durable_message_request' is set
|
|
2124
|
+
if @api_client.config.client_side_validation && send_durable_message_request.nil?
|
|
2125
|
+
fail ArgumentError, "Missing the required parameter 'send_durable_message_request' when calling DurableFunctionsApi.send_durable_message_from_application"
|
|
2126
|
+
end
|
|
2127
|
+
if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255
|
|
2128
|
+
fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling DurableFunctionsApi.send_durable_message_from_application, the character length must be smaller than or equal to 255.'
|
|
2129
|
+
end
|
|
2130
|
+
|
|
2131
|
+
if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length < 1
|
|
2132
|
+
fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling DurableFunctionsApi.send_durable_message_from_application, the character length must be greater than or equal to 1.'
|
|
2133
|
+
end
|
|
2134
|
+
|
|
2135
|
+
if @api_client.config.client_side_validation && !opts[:'x_volcano_client_token'].nil? && opts[:'x_volcano_client_token'].to_s.length > 128
|
|
2136
|
+
fail ArgumentError, 'invalid value for "opts[:"x_volcano_client_token"]" when calling DurableFunctionsApi.send_durable_message_from_application, the character length must be smaller than or equal to 128.'
|
|
2137
|
+
end
|
|
2138
|
+
|
|
2139
|
+
# resource path
|
|
2140
|
+
local_var_path = '/durable-functions/{functionId}/executions/{executionId}/messages'.sub('{' + 'functionId' + '}', CGI.escape(function_id.to_s)).sub('{' + 'executionId' + '}', CGI.escape(execution_id.to_s))
|
|
2141
|
+
|
|
2142
|
+
# query parameters
|
|
2143
|
+
query_params = opts[:query_params] || {}
|
|
2144
|
+
|
|
2145
|
+
# header parameters
|
|
2146
|
+
header_params = opts[:header_params] || {}
|
|
2147
|
+
# HTTP header 'Accept' (if needed)
|
|
2148
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
2149
|
+
# HTTP header 'Content-Type'
|
|
2150
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
2151
|
+
if !content_type.nil?
|
|
2152
|
+
header_params['Content-Type'] = content_type
|
|
2153
|
+
end
|
|
2154
|
+
header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
|
|
2155
|
+
header_params[:'X-Volcano-Client-Token'] = opts[:'x_volcano_client_token'] if !opts[:'x_volcano_client_token'].nil?
|
|
2156
|
+
|
|
2157
|
+
# form parameters
|
|
2158
|
+
form_params = opts[:form_params] || {}
|
|
2159
|
+
|
|
2160
|
+
# http body (model)
|
|
2161
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(send_durable_message_request)
|
|
2162
|
+
|
|
2163
|
+
# return_type
|
|
2164
|
+
return_type = opts[:debug_return_type] || 'DurableMessage'
|
|
2165
|
+
|
|
2166
|
+
# auth_names
|
|
2167
|
+
auth_names = opts[:debug_auth_names] || ['ServiceRoleKey', 'AuthUserAccessToken', 'AnonKey']
|
|
2168
|
+
|
|
2169
|
+
new_options = opts.merge(
|
|
2170
|
+
:operation => :"DurableFunctionsApi.send_durable_message_from_application",
|
|
2171
|
+
:header_params => header_params,
|
|
2172
|
+
:query_params => query_params,
|
|
2173
|
+
:form_params => form_params,
|
|
2174
|
+
:body => post_body,
|
|
2175
|
+
:auth_names => auth_names,
|
|
2176
|
+
:return_type => return_type
|
|
2177
|
+
)
|
|
2178
|
+
|
|
2179
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
2180
|
+
if @api_client.config.debugging
|
|
2181
|
+
@api_client.config.logger.debug "API called: DurableFunctionsApi#send_durable_message_from_application\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
2182
|
+
end
|
|
2183
|
+
return data, status_code, headers
|
|
2184
|
+
end
|
|
2185
|
+
|
|
1461
2186
|
# Start a durable execution
|
|
1462
2187
|
# Starts an execution and returns its handle. Never returns a result: an execution can outlive any request a client could hold open, so the result is read back from `GET /projects/{id}/durable-functions/{functionId}/executions/{executionId}`. The request body is the execution's input and must be valid JSON if present. An empty body starts the execution with no input. Send `X-Volcano-Execution-Name` to make the start idempotent: repeating a start with the same name returns the existing execution instead of beginning a second one. Each execution counts against the project's durable execution allowance, the operations it performs count against the durable operations allowance when it finishes, and the number of executions in flight at once is capped by the plan.
|
|
1463
2188
|
# @param id [String] Project ID
|