volcano-sdk 0.9.4 → 0.10.0
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 +69 -0
- data/lib/volcano/client.rb +2 -1
- data/lib/volcano/durable.rb +136 -0
- data/lib/volcano/durable_models.rb +143 -0
- data/lib/volcano/generated/lib/volcano-generated/api/databases_api.rb +2 -2
- data/lib/volcano/generated/lib/volcano-generated/api/durable_functions_api.rb +1239 -0
- data/lib/volcano/generated/lib/volcano-generated/api/frontends_api.rb +2 -2
- data/lib/volcano/generated/lib/volcano-generated/api/functions_api.rb +18 -6
- data/lib/volcano/generated/lib/volcano-generated/api/o_auth_authentication_api.rb +2 -2
- data/lib/volcano/generated/lib/volcano-generated/api/projects_api.rb +76 -2
- data/lib/volcano/generated/lib/volcano-generated/models/create_database_request.rb +6 -8
- data/lib/volcano/generated/lib/volcano-generated/models/create_variable_request.rb +11 -1
- data/lib/volcano/generated/lib/volcano-generated/models/durable_execution.rb +358 -0
- data/lib/volcano/generated/lib/volcano-generated/models/durable_execution_error.rb +157 -0
- data/lib/volcano/generated/lib/volcano-generated/models/durable_execution_status.rb +45 -0
- data/lib/volcano/generated/lib/volcano-generated/models/durable_function.rb +479 -0
- data/lib/volcano/generated/lib/volcano-generated/models/durable_function_config.rb +193 -0
- data/lib/volcano/generated/lib/volcano-generated/models/function_kind.rb +40 -0
- data/lib/volcano/generated/lib/volcano-generated/models/function_runtime_option.rb +28 -1
- data/lib/volcano/generated/lib/volcano-generated/models/function_scheduler.rb +11 -1
- data/lib/volcano/generated/lib/volcano-generated/models/list_database_regions200_response_inner.rb +1 -1
- data/lib/volcano/generated/lib/volcano-generated/models/metric_usage_data.rb +1 -1
- data/lib/volcano/generated/lib/volcano-generated/models/paginated_durable_executions.rb +274 -0
- data/lib/volcano/generated/lib/volcano-generated/models/paginated_durable_functions.rb +274 -0
- data/lib/volcano/generated/lib/volcano-generated/models/project_config.rb +23 -1
- data/lib/volcano/generated/lib/volcano-generated/models/project_config_function.rb +47 -2
- data/lib/volcano/generated/lib/volcano-generated/models/project_config_variable.rb +11 -1
- data/lib/volcano/generated/lib/volcano-generated/models/project_deployment_resource.rb +14 -4
- data/lib/volcano/generated/lib/volcano-generated/models/project_health_resource.rb +14 -4
- data/lib/volcano/generated/lib/volcano-generated/models/replace_shared_variables_request.rb +237 -0
- data/lib/volcano/generated/lib/volcano-generated/models/update_variable_request.rb +11 -1
- data/lib/volcano/generated/lib/volcano-generated/models/variable.rb +11 -1
- data/lib/volcano/generated/lib/volcano-generated.rb +10 -0
- data/lib/volcano/generated_transport.rb +2 -1
- data/lib/volcano/generated_transport_durable.rb +50 -0
- data/lib/volcano/generated_transport_support.rb +1 -0
- data/lib/volcano/version.rb +1 -1
- data/lib/volcano.rb +2 -0
- metadata +14 -1
|
@@ -0,0 +1,1239 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Volcano Hosting API
|
|
3
|
+
|
|
4
|
+
#Public API for Volcano Hosting clients, SDKs, and CLI tooling (Port 8000). This specification intentionally excludes first-party/internal APIs. See api/openapi-internal.yaml for non-public internal and Builder operations.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 3.0.0
|
|
7
|
+
Contact: support@volcano.dev
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.17.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module Volcano::Generated
|
|
16
|
+
class DurableFunctionsApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Create or update a durable function
|
|
23
|
+
# Upload a durable function source bundle. Creates the function on the first call for a name and redeploys it on every call after that, the same create-or-update contract `POST /projects/{id}/functions` has. Volcano builds and deploys asynchronously. A deployment that starts immediately returns `status: provisioning`, then transitions to `active` or `failed`; a deployment that has to wait for a running one is exposed through `pending_deployment_id`. Existing executions keep running against the runtime they started on. The `durable` configuration is derived from the project's plan rather than supplied here, and is fixed once the function exists. A name already held by a standard function is rejected with 409: a function cannot change kind.
|
|
24
|
+
# @param id [String] Project ID
|
|
25
|
+
# @param name [String] DNS-safe function name (lowercase letters, numbers, hyphens; cannot start or end with hyphen)
|
|
26
|
+
# @param code [File] ZIP or tar.gz archive containing function source code plus dependency manifests/lockfiles.
|
|
27
|
+
# @param runtime [String] Runtime environment. Required. Durable execution needs the durable authoring API, which ships for these runtimes only; any other runtime is rejected with 400 and the response names the ones that work. Note that a durable Python function needs a newer runtime than a standard one defaults to. `GET /functions/runtimes` reports `durable_capable` per runtime.
|
|
28
|
+
# @param [Hash] opts the optional parameters
|
|
29
|
+
# @option opts [String] :handler The name of the function to invoke. Defaults to \\\"handler\\\" if not specified. (default to 'handler')
|
|
30
|
+
# @option opts [Boolean] :is_public Whether anon keys with `functions.invoke` may start an execution. Redeploying is the only way to change it, since the collection has no update endpoint; omit it to keep the current visibility, and a new function starts private. The standard collection's synchronous invocation fields — `invocation_mode`, `http_auth_mode`, `openapi_spec` — configure a request path no durable route serves, and are rejected with 400 rather than ignored.
|
|
31
|
+
# @option opts [String] :variable_scope Which project variables this function receives. `all` (the default) gives it every project variable; `scoped` gives it only the variables it selects. Omitting this leaves an existing function's scope unchanged.
|
|
32
|
+
# @option opts [String] :variables JSON-encoded array of project variable names this function requires, on top of the ones detected in its source. A declared name the project does not define is rejected with 400; a detected name it does not define is ignored. Only used when `variable_scope` is `scoped`. Omitting this leaves an existing function's declared names unchanged.
|
|
33
|
+
# @return [DurableFunction]
|
|
34
|
+
def create_durable_function(id, name, code, runtime, opts = {})
|
|
35
|
+
data, _status_code, _headers = create_durable_function_with_http_info(id, name, code, runtime, opts)
|
|
36
|
+
data
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# Create or update a durable function
|
|
40
|
+
# Upload a durable function source bundle. Creates the function on the first call for a name and redeploys it on every call after that, the same create-or-update contract `POST /projects/{id}/functions` has. Volcano builds and deploys asynchronously. A deployment that starts immediately returns `status: provisioning`, then transitions to `active` or `failed`; a deployment that has to wait for a running one is exposed through `pending_deployment_id`. Existing executions keep running against the runtime they started on. The `durable` configuration is derived from the project's plan rather than supplied here, and is fixed once the function exists. A name already held by a standard function is rejected with 409: a function cannot change kind.
|
|
41
|
+
# @param id [String] Project ID
|
|
42
|
+
# @param name [String] DNS-safe function name (lowercase letters, numbers, hyphens; cannot start or end with hyphen)
|
|
43
|
+
# @param code [File] ZIP or tar.gz archive containing function source code plus dependency manifests/lockfiles.
|
|
44
|
+
# @param runtime [String] Runtime environment. Required. Durable execution needs the durable authoring API, which ships for these runtimes only; any other runtime is rejected with 400 and the response names the ones that work. Note that a durable Python function needs a newer runtime than a standard one defaults to. `GET /functions/runtimes` reports `durable_capable` per runtime.
|
|
45
|
+
# @param [Hash] opts the optional parameters
|
|
46
|
+
# @option opts [String] :handler The name of the function to invoke. Defaults to \\\"handler\\\" if not specified. (default to 'handler')
|
|
47
|
+
# @option opts [Boolean] :is_public Whether anon keys with `functions.invoke` may start an execution. Redeploying is the only way to change it, since the collection has no update endpoint; omit it to keep the current visibility, and a new function starts private. The standard collection's synchronous invocation fields — `invocation_mode`, `http_auth_mode`, `openapi_spec` — configure a request path no durable route serves, and are rejected with 400 rather than ignored.
|
|
48
|
+
# @option opts [String] :variable_scope Which project variables this function receives. `all` (the default) gives it every project variable; `scoped` gives it only the variables it selects. Omitting this leaves an existing function's scope unchanged.
|
|
49
|
+
# @option opts [String] :variables JSON-encoded array of project variable names this function requires, on top of the ones detected in its source. A declared name the project does not define is rejected with 400; a detected name it does not define is ignored. Only used when `variable_scope` is `scoped`. Omitting this leaves an existing function's declared names unchanged.
|
|
50
|
+
# @return [Array<(DurableFunction, Integer, Hash)>] DurableFunction data, response status code and response headers
|
|
51
|
+
def create_durable_function_with_http_info(id, name, code, runtime, opts = {})
|
|
52
|
+
if @api_client.config.debugging
|
|
53
|
+
@api_client.config.logger.debug 'Calling API: DurableFunctionsApi.create_durable_function ...'
|
|
54
|
+
end
|
|
55
|
+
# verify the required parameter 'id' is set
|
|
56
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
57
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling DurableFunctionsApi.create_durable_function"
|
|
58
|
+
end
|
|
59
|
+
# verify the required parameter 'name' is set
|
|
60
|
+
if @api_client.config.client_side_validation && name.nil?
|
|
61
|
+
fail ArgumentError, "Missing the required parameter 'name' when calling DurableFunctionsApi.create_durable_function"
|
|
62
|
+
end
|
|
63
|
+
if @api_client.config.client_side_validation && name.to_s.length > 63
|
|
64
|
+
fail ArgumentError, 'invalid value for "name" when calling DurableFunctionsApi.create_durable_function, the character length must be smaller than or equal to 63.'
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
pattern = Regexp.new(/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/)
|
|
68
|
+
if @api_client.config.client_side_validation && name !~ pattern
|
|
69
|
+
fail ArgumentError, "invalid value for 'name' when calling DurableFunctionsApi.create_durable_function, must conform to the pattern #{pattern}."
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
# verify the required parameter 'code' is set
|
|
73
|
+
if @api_client.config.client_side_validation && code.nil?
|
|
74
|
+
fail ArgumentError, "Missing the required parameter 'code' when calling DurableFunctionsApi.create_durable_function"
|
|
75
|
+
end
|
|
76
|
+
# verify the required parameter 'runtime' is set
|
|
77
|
+
if @api_client.config.client_side_validation && runtime.nil?
|
|
78
|
+
fail ArgumentError, "Missing the required parameter 'runtime' when calling DurableFunctionsApi.create_durable_function"
|
|
79
|
+
end
|
|
80
|
+
# verify enum value
|
|
81
|
+
allowable_values = ["nodejs22.x", "nodejs24.x", "python3.13", "python3.14"]
|
|
82
|
+
if @api_client.config.client_side_validation && !allowable_values.include?(runtime)
|
|
83
|
+
fail ArgumentError, "invalid value for \"runtime\", must be one of #{allowable_values}"
|
|
84
|
+
end
|
|
85
|
+
allowable_values = ["all", "scoped"]
|
|
86
|
+
if @api_client.config.client_side_validation && opts[:'variable_scope'] && !allowable_values.include?(opts[:'variable_scope'])
|
|
87
|
+
fail ArgumentError, "invalid value for \"variable_scope\", must be one of #{allowable_values}"
|
|
88
|
+
end
|
|
89
|
+
# resource path
|
|
90
|
+
local_var_path = '/projects/{id}/durable-functions'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
91
|
+
|
|
92
|
+
# query parameters
|
|
93
|
+
query_params = opts[:query_params] || {}
|
|
94
|
+
|
|
95
|
+
# header parameters
|
|
96
|
+
header_params = opts[:header_params] || {}
|
|
97
|
+
# HTTP header 'Accept' (if needed)
|
|
98
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
99
|
+
# HTTP header 'Content-Type'
|
|
100
|
+
content_type = @api_client.select_header_content_type(['multipart/form-data'])
|
|
101
|
+
if !content_type.nil?
|
|
102
|
+
header_params['Content-Type'] = content_type
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
# form parameters
|
|
106
|
+
form_params = opts[:form_params] || {}
|
|
107
|
+
form_params['name'] = name
|
|
108
|
+
form_params['code'] = code
|
|
109
|
+
form_params['runtime'] = runtime
|
|
110
|
+
form_params['handler'] = opts[:'handler'] if !opts[:'handler'].nil?
|
|
111
|
+
form_params['is_public'] = opts[:'is_public'] if !opts[:'is_public'].nil?
|
|
112
|
+
form_params['variable_scope'] = opts[:'variable_scope'] if !opts[:'variable_scope'].nil?
|
|
113
|
+
form_params['variables'] = opts[:'variables'] if !opts[:'variables'].nil?
|
|
114
|
+
|
|
115
|
+
# http body (model)
|
|
116
|
+
post_body = opts[:debug_body]
|
|
117
|
+
|
|
118
|
+
# return_type
|
|
119
|
+
return_type = opts[:debug_return_type] || 'DurableFunction'
|
|
120
|
+
|
|
121
|
+
# auth_names
|
|
122
|
+
auth_names = opts[:debug_auth_names] || ['UserToken']
|
|
123
|
+
|
|
124
|
+
new_options = opts.merge(
|
|
125
|
+
:operation => :"DurableFunctionsApi.create_durable_function",
|
|
126
|
+
:header_params => header_params,
|
|
127
|
+
:query_params => query_params,
|
|
128
|
+
:form_params => form_params,
|
|
129
|
+
:body => post_body,
|
|
130
|
+
:auth_names => auth_names,
|
|
131
|
+
:return_type => return_type
|
|
132
|
+
)
|
|
133
|
+
|
|
134
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
135
|
+
if @api_client.config.debugging
|
|
136
|
+
@api_client.config.logger.debug "API called: DurableFunctionsApi#create_durable_function\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
137
|
+
end
|
|
138
|
+
return data, status_code, headers
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# Create a scheduler for a durable function
|
|
142
|
+
# Each tick starts an execution rather than invoking the function, under an execution name derived from the run, so a retried tick resolves to the execution it already started. Requested regions must be a subset of the function's deployed regions. A tick draws on the same durable allowances and concurrency cap a manual start does, and a tick that would exceed the cap fails that run.
|
|
143
|
+
# @param id [String] Project ID
|
|
144
|
+
# @param function_id [String] Durable function ID, or its name within the project
|
|
145
|
+
# @param create_function_scheduler_request [CreateFunctionSchedulerRequest]
|
|
146
|
+
# @param [Hash] opts the optional parameters
|
|
147
|
+
# @return [FunctionScheduler]
|
|
148
|
+
def create_durable_function_scheduler(id, function_id, create_function_scheduler_request, opts = {})
|
|
149
|
+
data, _status_code, _headers = create_durable_function_scheduler_with_http_info(id, function_id, create_function_scheduler_request, opts)
|
|
150
|
+
data
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
# Create a scheduler for a durable function
|
|
154
|
+
# Each tick starts an execution rather than invoking the function, under an execution name derived from the run, so a retried tick resolves to the execution it already started. Requested regions must be a subset of the function's deployed regions. A tick draws on the same durable allowances and concurrency cap a manual start does, and a tick that would exceed the cap fails that run.
|
|
155
|
+
# @param id [String] Project ID
|
|
156
|
+
# @param function_id [String] Durable function ID, or its name within the project
|
|
157
|
+
# @param create_function_scheduler_request [CreateFunctionSchedulerRequest]
|
|
158
|
+
# @param [Hash] opts the optional parameters
|
|
159
|
+
# @return [Array<(FunctionScheduler, Integer, Hash)>] FunctionScheduler data, response status code and response headers
|
|
160
|
+
def create_durable_function_scheduler_with_http_info(id, function_id, create_function_scheduler_request, opts = {})
|
|
161
|
+
if @api_client.config.debugging
|
|
162
|
+
@api_client.config.logger.debug 'Calling API: DurableFunctionsApi.create_durable_function_scheduler ...'
|
|
163
|
+
end
|
|
164
|
+
# verify the required parameter 'id' is set
|
|
165
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
166
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling DurableFunctionsApi.create_durable_function_scheduler"
|
|
167
|
+
end
|
|
168
|
+
# verify the required parameter 'function_id' is set
|
|
169
|
+
if @api_client.config.client_side_validation && function_id.nil?
|
|
170
|
+
fail ArgumentError, "Missing the required parameter 'function_id' when calling DurableFunctionsApi.create_durable_function_scheduler"
|
|
171
|
+
end
|
|
172
|
+
# verify the required parameter 'create_function_scheduler_request' is set
|
|
173
|
+
if @api_client.config.client_side_validation && create_function_scheduler_request.nil?
|
|
174
|
+
fail ArgumentError, "Missing the required parameter 'create_function_scheduler_request' when calling DurableFunctionsApi.create_durable_function_scheduler"
|
|
175
|
+
end
|
|
176
|
+
# resource path
|
|
177
|
+
local_var_path = '/projects/{id}/durable-functions/{functionId}/schedulers'.sub('{' + 'id' + '}', CGI.escape(id.to_s)).sub('{' + 'functionId' + '}', CGI.escape(function_id.to_s))
|
|
178
|
+
|
|
179
|
+
# query parameters
|
|
180
|
+
query_params = opts[:query_params] || {}
|
|
181
|
+
|
|
182
|
+
# header parameters
|
|
183
|
+
header_params = opts[:header_params] || {}
|
|
184
|
+
# HTTP header 'Accept' (if needed)
|
|
185
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
186
|
+
# HTTP header 'Content-Type'
|
|
187
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
188
|
+
if !content_type.nil?
|
|
189
|
+
header_params['Content-Type'] = content_type
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
# form parameters
|
|
193
|
+
form_params = opts[:form_params] || {}
|
|
194
|
+
|
|
195
|
+
# http body (model)
|
|
196
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(create_function_scheduler_request)
|
|
197
|
+
|
|
198
|
+
# return_type
|
|
199
|
+
return_type = opts[:debug_return_type] || 'FunctionScheduler'
|
|
200
|
+
|
|
201
|
+
# auth_names
|
|
202
|
+
auth_names = opts[:debug_auth_names] || ['UserToken']
|
|
203
|
+
|
|
204
|
+
new_options = opts.merge(
|
|
205
|
+
:operation => :"DurableFunctionsApi.create_durable_function_scheduler",
|
|
206
|
+
:header_params => header_params,
|
|
207
|
+
:query_params => query_params,
|
|
208
|
+
:form_params => form_params,
|
|
209
|
+
:body => post_body,
|
|
210
|
+
:auth_names => auth_names,
|
|
211
|
+
:return_type => return_type
|
|
212
|
+
)
|
|
213
|
+
|
|
214
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
215
|
+
if @api_client.config.debugging
|
|
216
|
+
@api_client.config.logger.debug "API called: DurableFunctionsApi#create_durable_function_scheduler\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
217
|
+
end
|
|
218
|
+
return data, status_code, headers
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
# Delete a durable function
|
|
222
|
+
# Accepted for asynchronous teardown; the work continues after the response. The function's executions go with it: history stops being readable whatever `retention_days` had left, and the executions still running stop counting against the project's concurrency cap. Stop an execution first if you need it to end before the function does.
|
|
223
|
+
# @param id [String] Project ID
|
|
224
|
+
# @param function_id [String] Durable function ID, or its name within the project
|
|
225
|
+
# @param [Hash] opts the optional parameters
|
|
226
|
+
# @return [nil]
|
|
227
|
+
def delete_durable_function(id, function_id, opts = {})
|
|
228
|
+
delete_durable_function_with_http_info(id, function_id, opts)
|
|
229
|
+
nil
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
# Delete a durable function
|
|
233
|
+
# Accepted for asynchronous teardown; the work continues after the response. The function's executions go with it: history stops being readable whatever `retention_days` had left, and the executions still running stop counting against the project's concurrency cap. Stop an execution first if you need it to end before the function does.
|
|
234
|
+
# @param id [String] Project ID
|
|
235
|
+
# @param function_id [String] Durable function ID, or its name within the project
|
|
236
|
+
# @param [Hash] opts the optional parameters
|
|
237
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
238
|
+
def delete_durable_function_with_http_info(id, function_id, opts = {})
|
|
239
|
+
if @api_client.config.debugging
|
|
240
|
+
@api_client.config.logger.debug 'Calling API: DurableFunctionsApi.delete_durable_function ...'
|
|
241
|
+
end
|
|
242
|
+
# verify the required parameter 'id' is set
|
|
243
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
244
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling DurableFunctionsApi.delete_durable_function"
|
|
245
|
+
end
|
|
246
|
+
# verify the required parameter 'function_id' is set
|
|
247
|
+
if @api_client.config.client_side_validation && function_id.nil?
|
|
248
|
+
fail ArgumentError, "Missing the required parameter 'function_id' when calling DurableFunctionsApi.delete_durable_function"
|
|
249
|
+
end
|
|
250
|
+
# resource path
|
|
251
|
+
local_var_path = '/projects/{id}/durable-functions/{functionId}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)).sub('{' + 'functionId' + '}', CGI.escape(function_id.to_s))
|
|
252
|
+
|
|
253
|
+
# query parameters
|
|
254
|
+
query_params = opts[:query_params] || {}
|
|
255
|
+
|
|
256
|
+
# header parameters
|
|
257
|
+
header_params = opts[:header_params] || {}
|
|
258
|
+
# HTTP header 'Accept' (if needed)
|
|
259
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
260
|
+
|
|
261
|
+
# form parameters
|
|
262
|
+
form_params = opts[:form_params] || {}
|
|
263
|
+
|
|
264
|
+
# http body (model)
|
|
265
|
+
post_body = opts[:debug_body]
|
|
266
|
+
|
|
267
|
+
# return_type
|
|
268
|
+
return_type = opts[:debug_return_type]
|
|
269
|
+
|
|
270
|
+
# auth_names
|
|
271
|
+
auth_names = opts[:debug_auth_names] || ['UserToken']
|
|
272
|
+
|
|
273
|
+
new_options = opts.merge(
|
|
274
|
+
:operation => :"DurableFunctionsApi.delete_durable_function",
|
|
275
|
+
:header_params => header_params,
|
|
276
|
+
:query_params => query_params,
|
|
277
|
+
:form_params => form_params,
|
|
278
|
+
:body => post_body,
|
|
279
|
+
:auth_names => auth_names,
|
|
280
|
+
:return_type => return_type
|
|
281
|
+
)
|
|
282
|
+
|
|
283
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
|
284
|
+
if @api_client.config.debugging
|
|
285
|
+
@api_client.config.logger.debug "API called: DurableFunctionsApi#delete_durable_function\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
286
|
+
end
|
|
287
|
+
return data, status_code, headers
|
|
288
|
+
end
|
|
289
|
+
|
|
290
|
+
# Delete a durable function scheduler
|
|
291
|
+
# @param id [String] Project ID
|
|
292
|
+
# @param function_id [String] Durable function ID, or its name within the project
|
|
293
|
+
# @param scheduler_id [String] Function scheduler ID
|
|
294
|
+
# @param [Hash] opts the optional parameters
|
|
295
|
+
# @return [nil]
|
|
296
|
+
def delete_durable_function_scheduler(id, function_id, scheduler_id, opts = {})
|
|
297
|
+
delete_durable_function_scheduler_with_http_info(id, function_id, scheduler_id, opts)
|
|
298
|
+
nil
|
|
299
|
+
end
|
|
300
|
+
|
|
301
|
+
# Delete a durable function scheduler
|
|
302
|
+
# @param id [String] Project ID
|
|
303
|
+
# @param function_id [String] Durable function ID, or its name within the project
|
|
304
|
+
# @param scheduler_id [String] Function scheduler ID
|
|
305
|
+
# @param [Hash] opts the optional parameters
|
|
306
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
307
|
+
def delete_durable_function_scheduler_with_http_info(id, function_id, scheduler_id, opts = {})
|
|
308
|
+
if @api_client.config.debugging
|
|
309
|
+
@api_client.config.logger.debug 'Calling API: DurableFunctionsApi.delete_durable_function_scheduler ...'
|
|
310
|
+
end
|
|
311
|
+
# verify the required parameter 'id' is set
|
|
312
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
313
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling DurableFunctionsApi.delete_durable_function_scheduler"
|
|
314
|
+
end
|
|
315
|
+
# verify the required parameter 'function_id' is set
|
|
316
|
+
if @api_client.config.client_side_validation && function_id.nil?
|
|
317
|
+
fail ArgumentError, "Missing the required parameter 'function_id' when calling DurableFunctionsApi.delete_durable_function_scheduler"
|
|
318
|
+
end
|
|
319
|
+
# verify the required parameter 'scheduler_id' is set
|
|
320
|
+
if @api_client.config.client_side_validation && scheduler_id.nil?
|
|
321
|
+
fail ArgumentError, "Missing the required parameter 'scheduler_id' when calling DurableFunctionsApi.delete_durable_function_scheduler"
|
|
322
|
+
end
|
|
323
|
+
# resource path
|
|
324
|
+
local_var_path = '/projects/{id}/durable-functions/{functionId}/schedulers/{schedulerId}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)).sub('{' + 'functionId' + '}', CGI.escape(function_id.to_s)).sub('{' + 'schedulerId' + '}', CGI.escape(scheduler_id.to_s))
|
|
325
|
+
|
|
326
|
+
# query parameters
|
|
327
|
+
query_params = opts[:query_params] || {}
|
|
328
|
+
|
|
329
|
+
# header parameters
|
|
330
|
+
header_params = opts[:header_params] || {}
|
|
331
|
+
# HTTP header 'Accept' (if needed)
|
|
332
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
333
|
+
|
|
334
|
+
# form parameters
|
|
335
|
+
form_params = opts[:form_params] || {}
|
|
336
|
+
|
|
337
|
+
# http body (model)
|
|
338
|
+
post_body = opts[:debug_body]
|
|
339
|
+
|
|
340
|
+
# return_type
|
|
341
|
+
return_type = opts[:debug_return_type]
|
|
342
|
+
|
|
343
|
+
# auth_names
|
|
344
|
+
auth_names = opts[:debug_auth_names] || ['UserToken']
|
|
345
|
+
|
|
346
|
+
new_options = opts.merge(
|
|
347
|
+
:operation => :"DurableFunctionsApi.delete_durable_function_scheduler",
|
|
348
|
+
:header_params => header_params,
|
|
349
|
+
:query_params => query_params,
|
|
350
|
+
:form_params => form_params,
|
|
351
|
+
:body => post_body,
|
|
352
|
+
:auth_names => auth_names,
|
|
353
|
+
:return_type => return_type
|
|
354
|
+
)
|
|
355
|
+
|
|
356
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
|
357
|
+
if @api_client.config.debugging
|
|
358
|
+
@api_client.config.logger.debug "API called: DurableFunctionsApi#delete_durable_function_scheduler\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
359
|
+
end
|
|
360
|
+
return data, status_code, headers
|
|
361
|
+
end
|
|
362
|
+
|
|
363
|
+
# Get a durable execution
|
|
364
|
+
# Returns the execution's current state, including its `result` once it has succeeded. Poll this to wait for an execution to finish.
|
|
365
|
+
# @param id [String] Project ID
|
|
366
|
+
# @param function_id [String] Durable function ID, or its name within the project
|
|
367
|
+
# @param execution_id [String] Durable execution ID
|
|
368
|
+
# @param [Hash] opts the optional parameters
|
|
369
|
+
# @return [DurableExecution]
|
|
370
|
+
def get_durable_execution(id, function_id, execution_id, opts = {})
|
|
371
|
+
data, _status_code, _headers = get_durable_execution_with_http_info(id, function_id, execution_id, opts)
|
|
372
|
+
data
|
|
373
|
+
end
|
|
374
|
+
|
|
375
|
+
# Get a durable execution
|
|
376
|
+
# Returns the execution's current state, including its `result` once it has succeeded. Poll this to wait for an execution to finish.
|
|
377
|
+
# @param id [String] Project ID
|
|
378
|
+
# @param function_id [String] Durable function ID, or its name within the project
|
|
379
|
+
# @param execution_id [String] Durable execution ID
|
|
380
|
+
# @param [Hash] opts the optional parameters
|
|
381
|
+
# @return [Array<(DurableExecution, Integer, Hash)>] DurableExecution data, response status code and response headers
|
|
382
|
+
def get_durable_execution_with_http_info(id, function_id, execution_id, opts = {})
|
|
383
|
+
if @api_client.config.debugging
|
|
384
|
+
@api_client.config.logger.debug 'Calling API: DurableFunctionsApi.get_durable_execution ...'
|
|
385
|
+
end
|
|
386
|
+
# verify the required parameter 'id' is set
|
|
387
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
388
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling DurableFunctionsApi.get_durable_execution"
|
|
389
|
+
end
|
|
390
|
+
# verify the required parameter 'function_id' is set
|
|
391
|
+
if @api_client.config.client_side_validation && function_id.nil?
|
|
392
|
+
fail ArgumentError, "Missing the required parameter 'function_id' when calling DurableFunctionsApi.get_durable_execution"
|
|
393
|
+
end
|
|
394
|
+
# verify the required parameter 'execution_id' is set
|
|
395
|
+
if @api_client.config.client_side_validation && execution_id.nil?
|
|
396
|
+
fail ArgumentError, "Missing the required parameter 'execution_id' when calling DurableFunctionsApi.get_durable_execution"
|
|
397
|
+
end
|
|
398
|
+
# resource path
|
|
399
|
+
local_var_path = '/projects/{id}/durable-functions/{functionId}/executions/{executionId}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)).sub('{' + 'functionId' + '}', CGI.escape(function_id.to_s)).sub('{' + 'executionId' + '}', CGI.escape(execution_id.to_s))
|
|
400
|
+
|
|
401
|
+
# query parameters
|
|
402
|
+
query_params = opts[:query_params] || {}
|
|
403
|
+
|
|
404
|
+
# header parameters
|
|
405
|
+
header_params = opts[:header_params] || {}
|
|
406
|
+
# HTTP header 'Accept' (if needed)
|
|
407
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
408
|
+
|
|
409
|
+
# form parameters
|
|
410
|
+
form_params = opts[:form_params] || {}
|
|
411
|
+
|
|
412
|
+
# http body (model)
|
|
413
|
+
post_body = opts[:debug_body]
|
|
414
|
+
|
|
415
|
+
# return_type
|
|
416
|
+
return_type = opts[:debug_return_type] || 'DurableExecution'
|
|
417
|
+
|
|
418
|
+
# auth_names
|
|
419
|
+
auth_names = opts[:debug_auth_names] || ['UserToken']
|
|
420
|
+
|
|
421
|
+
new_options = opts.merge(
|
|
422
|
+
:operation => :"DurableFunctionsApi.get_durable_execution",
|
|
423
|
+
:header_params => header_params,
|
|
424
|
+
:query_params => query_params,
|
|
425
|
+
:form_params => form_params,
|
|
426
|
+
:body => post_body,
|
|
427
|
+
:auth_names => auth_names,
|
|
428
|
+
:return_type => return_type
|
|
429
|
+
)
|
|
430
|
+
|
|
431
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
432
|
+
if @api_client.config.debugging
|
|
433
|
+
@api_client.config.logger.debug "API called: DurableFunctionsApi#get_durable_execution\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
434
|
+
end
|
|
435
|
+
return data, status_code, headers
|
|
436
|
+
end
|
|
437
|
+
|
|
438
|
+
# Get durable function by ID or name
|
|
439
|
+
# @param id [String] Project ID
|
|
440
|
+
# @param function_id [String] Durable function ID, or its name within the project
|
|
441
|
+
# @param [Hash] opts the optional parameters
|
|
442
|
+
# @return [DurableFunction]
|
|
443
|
+
def get_durable_function(id, function_id, opts = {})
|
|
444
|
+
data, _status_code, _headers = get_durable_function_with_http_info(id, function_id, opts)
|
|
445
|
+
data
|
|
446
|
+
end
|
|
447
|
+
|
|
448
|
+
# Get durable function by ID or name
|
|
449
|
+
# @param id [String] Project ID
|
|
450
|
+
# @param function_id [String] Durable function ID, or its name within the project
|
|
451
|
+
# @param [Hash] opts the optional parameters
|
|
452
|
+
# @return [Array<(DurableFunction, Integer, Hash)>] DurableFunction data, response status code and response headers
|
|
453
|
+
def get_durable_function_with_http_info(id, function_id, opts = {})
|
|
454
|
+
if @api_client.config.debugging
|
|
455
|
+
@api_client.config.logger.debug 'Calling API: DurableFunctionsApi.get_durable_function ...'
|
|
456
|
+
end
|
|
457
|
+
# verify the required parameter 'id' is set
|
|
458
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
459
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling DurableFunctionsApi.get_durable_function"
|
|
460
|
+
end
|
|
461
|
+
# verify the required parameter 'function_id' is set
|
|
462
|
+
if @api_client.config.client_side_validation && function_id.nil?
|
|
463
|
+
fail ArgumentError, "Missing the required parameter 'function_id' when calling DurableFunctionsApi.get_durable_function"
|
|
464
|
+
end
|
|
465
|
+
# resource path
|
|
466
|
+
local_var_path = '/projects/{id}/durable-functions/{functionId}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)).sub('{' + 'functionId' + '}', CGI.escape(function_id.to_s))
|
|
467
|
+
|
|
468
|
+
# query parameters
|
|
469
|
+
query_params = opts[:query_params] || {}
|
|
470
|
+
|
|
471
|
+
# header parameters
|
|
472
|
+
header_params = opts[:header_params] || {}
|
|
473
|
+
# HTTP header 'Accept' (if needed)
|
|
474
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
475
|
+
|
|
476
|
+
# form parameters
|
|
477
|
+
form_params = opts[:form_params] || {}
|
|
478
|
+
|
|
479
|
+
# http body (model)
|
|
480
|
+
post_body = opts[:debug_body]
|
|
481
|
+
|
|
482
|
+
# return_type
|
|
483
|
+
return_type = opts[:debug_return_type] || 'DurableFunction'
|
|
484
|
+
|
|
485
|
+
# auth_names
|
|
486
|
+
auth_names = opts[:debug_auth_names] || ['UserToken']
|
|
487
|
+
|
|
488
|
+
new_options = opts.merge(
|
|
489
|
+
:operation => :"DurableFunctionsApi.get_durable_function",
|
|
490
|
+
:header_params => header_params,
|
|
491
|
+
:query_params => query_params,
|
|
492
|
+
:form_params => form_params,
|
|
493
|
+
:body => post_body,
|
|
494
|
+
:auth_names => auth_names,
|
|
495
|
+
:return_type => return_type
|
|
496
|
+
)
|
|
497
|
+
|
|
498
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
499
|
+
if @api_client.config.debugging
|
|
500
|
+
@api_client.config.logger.debug "API called: DurableFunctionsApi#get_durable_function\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
501
|
+
end
|
|
502
|
+
return data, status_code, headers
|
|
503
|
+
end
|
|
504
|
+
|
|
505
|
+
# Get a durable function scheduler
|
|
506
|
+
# @param id [String] Project ID
|
|
507
|
+
# @param function_id [String] Durable function ID, or its name within the project
|
|
508
|
+
# @param scheduler_id [String] Function scheduler ID
|
|
509
|
+
# @param [Hash] opts the optional parameters
|
|
510
|
+
# @return [FunctionScheduler]
|
|
511
|
+
def get_durable_function_scheduler(id, function_id, scheduler_id, opts = {})
|
|
512
|
+
data, _status_code, _headers = get_durable_function_scheduler_with_http_info(id, function_id, scheduler_id, opts)
|
|
513
|
+
data
|
|
514
|
+
end
|
|
515
|
+
|
|
516
|
+
# Get a durable function scheduler
|
|
517
|
+
# @param id [String] Project ID
|
|
518
|
+
# @param function_id [String] Durable function ID, or its name within the project
|
|
519
|
+
# @param scheduler_id [String] Function scheduler ID
|
|
520
|
+
# @param [Hash] opts the optional parameters
|
|
521
|
+
# @return [Array<(FunctionScheduler, Integer, Hash)>] FunctionScheduler data, response status code and response headers
|
|
522
|
+
def get_durable_function_scheduler_with_http_info(id, function_id, scheduler_id, opts = {})
|
|
523
|
+
if @api_client.config.debugging
|
|
524
|
+
@api_client.config.logger.debug 'Calling API: DurableFunctionsApi.get_durable_function_scheduler ...'
|
|
525
|
+
end
|
|
526
|
+
# verify the required parameter 'id' is set
|
|
527
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
528
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling DurableFunctionsApi.get_durable_function_scheduler"
|
|
529
|
+
end
|
|
530
|
+
# verify the required parameter 'function_id' is set
|
|
531
|
+
if @api_client.config.client_side_validation && function_id.nil?
|
|
532
|
+
fail ArgumentError, "Missing the required parameter 'function_id' when calling DurableFunctionsApi.get_durable_function_scheduler"
|
|
533
|
+
end
|
|
534
|
+
# verify the required parameter 'scheduler_id' is set
|
|
535
|
+
if @api_client.config.client_side_validation && scheduler_id.nil?
|
|
536
|
+
fail ArgumentError, "Missing the required parameter 'scheduler_id' when calling DurableFunctionsApi.get_durable_function_scheduler"
|
|
537
|
+
end
|
|
538
|
+
# resource path
|
|
539
|
+
local_var_path = '/projects/{id}/durable-functions/{functionId}/schedulers/{schedulerId}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)).sub('{' + 'functionId' + '}', CGI.escape(function_id.to_s)).sub('{' + 'schedulerId' + '}', CGI.escape(scheduler_id.to_s))
|
|
540
|
+
|
|
541
|
+
# query parameters
|
|
542
|
+
query_params = opts[:query_params] || {}
|
|
543
|
+
|
|
544
|
+
# header parameters
|
|
545
|
+
header_params = opts[:header_params] || {}
|
|
546
|
+
# HTTP header 'Accept' (if needed)
|
|
547
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
548
|
+
|
|
549
|
+
# form parameters
|
|
550
|
+
form_params = opts[:form_params] || {}
|
|
551
|
+
|
|
552
|
+
# http body (model)
|
|
553
|
+
post_body = opts[:debug_body]
|
|
554
|
+
|
|
555
|
+
# return_type
|
|
556
|
+
return_type = opts[:debug_return_type] || 'FunctionScheduler'
|
|
557
|
+
|
|
558
|
+
# auth_names
|
|
559
|
+
auth_names = opts[:debug_auth_names] || ['UserToken']
|
|
560
|
+
|
|
561
|
+
new_options = opts.merge(
|
|
562
|
+
:operation => :"DurableFunctionsApi.get_durable_function_scheduler",
|
|
563
|
+
:header_params => header_params,
|
|
564
|
+
:query_params => query_params,
|
|
565
|
+
:form_params => form_params,
|
|
566
|
+
:body => post_body,
|
|
567
|
+
:auth_names => auth_names,
|
|
568
|
+
:return_type => return_type
|
|
569
|
+
)
|
|
570
|
+
|
|
571
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
572
|
+
if @api_client.config.debugging
|
|
573
|
+
@api_client.config.logger.debug "API called: DurableFunctionsApi#get_durable_function_scheduler\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
574
|
+
end
|
|
575
|
+
return data, status_code, headers
|
|
576
|
+
end
|
|
577
|
+
|
|
578
|
+
# List a durable function's executions
|
|
579
|
+
# Returns the platform's last observed status for each execution; listing does not poll each one. Fetch a single execution for its live state.
|
|
580
|
+
# @param id [String] Project ID
|
|
581
|
+
# @param function_id [String] Durable function ID, or its name within the project
|
|
582
|
+
# @param [Hash] opts the optional parameters
|
|
583
|
+
# @option opts [Integer] :page Page number (1-indexed) for offset pagination. Declares no schema default so the request validator does not inject one: handlers that omit `page` see it unset (nil) and default to 1 in code, while cursor-first endpoints (e.g. the project deployments feed) can detect its absence to stay in keyset/search mode. Supplying `page` selects offset pagination.
|
|
584
|
+
# @option opts [Integer] :limit Number of items per page (max 100) (default to 10)
|
|
585
|
+
# @option opts [DurableExecutionStatus] :status Return only executions in this status.
|
|
586
|
+
# @return [PaginatedDurableExecutions]
|
|
587
|
+
def list_durable_executions(id, function_id, opts = {})
|
|
588
|
+
data, _status_code, _headers = list_durable_executions_with_http_info(id, function_id, opts)
|
|
589
|
+
data
|
|
590
|
+
end
|
|
591
|
+
|
|
592
|
+
# List a durable function's executions
|
|
593
|
+
# Returns the platform's last observed status for each execution; listing does not poll each one. Fetch a single execution for its live state.
|
|
594
|
+
# @param id [String] Project ID
|
|
595
|
+
# @param function_id [String] Durable function ID, or its name within the project
|
|
596
|
+
# @param [Hash] opts the optional parameters
|
|
597
|
+
# @option opts [Integer] :page Page number (1-indexed) for offset pagination. Declares no schema default so the request validator does not inject one: handlers that omit `page` see it unset (nil) and default to 1 in code, while cursor-first endpoints (e.g. the project deployments feed) can detect its absence to stay in keyset/search mode. Supplying `page` selects offset pagination.
|
|
598
|
+
# @option opts [Integer] :limit Number of items per page (max 100) (default to 10)
|
|
599
|
+
# @option opts [DurableExecutionStatus] :status Return only executions in this status.
|
|
600
|
+
# @return [Array<(PaginatedDurableExecutions, Integer, Hash)>] PaginatedDurableExecutions data, response status code and response headers
|
|
601
|
+
def list_durable_executions_with_http_info(id, function_id, opts = {})
|
|
602
|
+
if @api_client.config.debugging
|
|
603
|
+
@api_client.config.logger.debug 'Calling API: DurableFunctionsApi.list_durable_executions ...'
|
|
604
|
+
end
|
|
605
|
+
# verify the required parameter 'id' is set
|
|
606
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
607
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling DurableFunctionsApi.list_durable_executions"
|
|
608
|
+
end
|
|
609
|
+
# verify the required parameter 'function_id' is set
|
|
610
|
+
if @api_client.config.client_side_validation && function_id.nil?
|
|
611
|
+
fail ArgumentError, "Missing the required parameter 'function_id' when calling DurableFunctionsApi.list_durable_executions"
|
|
612
|
+
end
|
|
613
|
+
if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
|
|
614
|
+
fail ArgumentError, 'invalid value for "opts[:"page"]" when calling DurableFunctionsApi.list_durable_executions, must be greater than or equal to 1.'
|
|
615
|
+
end
|
|
616
|
+
|
|
617
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
|
|
618
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling DurableFunctionsApi.list_durable_executions, must be smaller than or equal to 100.'
|
|
619
|
+
end
|
|
620
|
+
|
|
621
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
|
622
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling DurableFunctionsApi.list_durable_executions, must be greater than or equal to 1.'
|
|
623
|
+
end
|
|
624
|
+
|
|
625
|
+
# resource path
|
|
626
|
+
local_var_path = '/projects/{id}/durable-functions/{functionId}/executions'.sub('{' + 'id' + '}', CGI.escape(id.to_s)).sub('{' + 'functionId' + '}', CGI.escape(function_id.to_s))
|
|
627
|
+
|
|
628
|
+
# query parameters
|
|
629
|
+
query_params = opts[:query_params] || {}
|
|
630
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
|
631
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
632
|
+
query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
|
|
633
|
+
|
|
634
|
+
# header parameters
|
|
635
|
+
header_params = opts[:header_params] || {}
|
|
636
|
+
# HTTP header 'Accept' (if needed)
|
|
637
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
638
|
+
|
|
639
|
+
# form parameters
|
|
640
|
+
form_params = opts[:form_params] || {}
|
|
641
|
+
|
|
642
|
+
# http body (model)
|
|
643
|
+
post_body = opts[:debug_body]
|
|
644
|
+
|
|
645
|
+
# return_type
|
|
646
|
+
return_type = opts[:debug_return_type] || 'PaginatedDurableExecutions'
|
|
647
|
+
|
|
648
|
+
# auth_names
|
|
649
|
+
auth_names = opts[:debug_auth_names] || ['UserToken']
|
|
650
|
+
|
|
651
|
+
new_options = opts.merge(
|
|
652
|
+
:operation => :"DurableFunctionsApi.list_durable_executions",
|
|
653
|
+
:header_params => header_params,
|
|
654
|
+
:query_params => query_params,
|
|
655
|
+
:form_params => form_params,
|
|
656
|
+
:body => post_body,
|
|
657
|
+
:auth_names => auth_names,
|
|
658
|
+
:return_type => return_type
|
|
659
|
+
)
|
|
660
|
+
|
|
661
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
662
|
+
if @api_client.config.debugging
|
|
663
|
+
@api_client.config.logger.debug "API called: DurableFunctionsApi#list_durable_executions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
664
|
+
end
|
|
665
|
+
return data, status_code, headers
|
|
666
|
+
end
|
|
667
|
+
|
|
668
|
+
# List durable function deployments
|
|
669
|
+
# @param id [String] Project ID
|
|
670
|
+
# @param function_id [String] Durable function ID, or its name within the project
|
|
671
|
+
# @param [Hash] opts the optional parameters
|
|
672
|
+
# @option opts [Integer] :page Page number (1-indexed) for offset pagination. Declares no schema default so the request validator does not inject one: handlers that omit `page` see it unset (nil) and default to 1 in code, while cursor-first endpoints (e.g. the project deployments feed) can detect its absence to stay in keyset/search mode. Supplying `page` selects offset pagination.
|
|
673
|
+
# @option opts [Integer] :limit Number of items per page (max 100) (default to 10)
|
|
674
|
+
# @return [PaginatedFunctionDeployments]
|
|
675
|
+
def list_durable_function_deployments(id, function_id, opts = {})
|
|
676
|
+
data, _status_code, _headers = list_durable_function_deployments_with_http_info(id, function_id, opts)
|
|
677
|
+
data
|
|
678
|
+
end
|
|
679
|
+
|
|
680
|
+
# List durable function deployments
|
|
681
|
+
# @param id [String] Project ID
|
|
682
|
+
# @param function_id [String] Durable function ID, or its name within the project
|
|
683
|
+
# @param [Hash] opts the optional parameters
|
|
684
|
+
# @option opts [Integer] :page Page number (1-indexed) for offset pagination. Declares no schema default so the request validator does not inject one: handlers that omit `page` see it unset (nil) and default to 1 in code, while cursor-first endpoints (e.g. the project deployments feed) can detect its absence to stay in keyset/search mode. Supplying `page` selects offset pagination.
|
|
685
|
+
# @option opts [Integer] :limit Number of items per page (max 100) (default to 10)
|
|
686
|
+
# @return [Array<(PaginatedFunctionDeployments, Integer, Hash)>] PaginatedFunctionDeployments data, response status code and response headers
|
|
687
|
+
def list_durable_function_deployments_with_http_info(id, function_id, opts = {})
|
|
688
|
+
if @api_client.config.debugging
|
|
689
|
+
@api_client.config.logger.debug 'Calling API: DurableFunctionsApi.list_durable_function_deployments ...'
|
|
690
|
+
end
|
|
691
|
+
# verify the required parameter 'id' is set
|
|
692
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
693
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling DurableFunctionsApi.list_durable_function_deployments"
|
|
694
|
+
end
|
|
695
|
+
# verify the required parameter 'function_id' is set
|
|
696
|
+
if @api_client.config.client_side_validation && function_id.nil?
|
|
697
|
+
fail ArgumentError, "Missing the required parameter 'function_id' when calling DurableFunctionsApi.list_durable_function_deployments"
|
|
698
|
+
end
|
|
699
|
+
if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
|
|
700
|
+
fail ArgumentError, 'invalid value for "opts[:"page"]" when calling DurableFunctionsApi.list_durable_function_deployments, must be greater than or equal to 1.'
|
|
701
|
+
end
|
|
702
|
+
|
|
703
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
|
|
704
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling DurableFunctionsApi.list_durable_function_deployments, must be smaller than or equal to 100.'
|
|
705
|
+
end
|
|
706
|
+
|
|
707
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
|
708
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling DurableFunctionsApi.list_durable_function_deployments, must be greater than or equal to 1.'
|
|
709
|
+
end
|
|
710
|
+
|
|
711
|
+
# resource path
|
|
712
|
+
local_var_path = '/projects/{id}/durable-functions/{functionId}/deployments'.sub('{' + 'id' + '}', CGI.escape(id.to_s)).sub('{' + 'functionId' + '}', CGI.escape(function_id.to_s))
|
|
713
|
+
|
|
714
|
+
# query parameters
|
|
715
|
+
query_params = opts[:query_params] || {}
|
|
716
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
|
717
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
718
|
+
|
|
719
|
+
# header parameters
|
|
720
|
+
header_params = opts[:header_params] || {}
|
|
721
|
+
# HTTP header 'Accept' (if needed)
|
|
722
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
723
|
+
|
|
724
|
+
# form parameters
|
|
725
|
+
form_params = opts[:form_params] || {}
|
|
726
|
+
|
|
727
|
+
# http body (model)
|
|
728
|
+
post_body = opts[:debug_body]
|
|
729
|
+
|
|
730
|
+
# return_type
|
|
731
|
+
return_type = opts[:debug_return_type] || 'PaginatedFunctionDeployments'
|
|
732
|
+
|
|
733
|
+
# auth_names
|
|
734
|
+
auth_names = opts[:debug_auth_names] || ['UserToken']
|
|
735
|
+
|
|
736
|
+
new_options = opts.merge(
|
|
737
|
+
:operation => :"DurableFunctionsApi.list_durable_function_deployments",
|
|
738
|
+
:header_params => header_params,
|
|
739
|
+
:query_params => query_params,
|
|
740
|
+
:form_params => form_params,
|
|
741
|
+
:body => post_body,
|
|
742
|
+
:auth_names => auth_names,
|
|
743
|
+
:return_type => return_type
|
|
744
|
+
)
|
|
745
|
+
|
|
746
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
747
|
+
if @api_client.config.debugging
|
|
748
|
+
@api_client.config.logger.debug "API called: DurableFunctionsApi#list_durable_function_deployments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
749
|
+
end
|
|
750
|
+
return data, status_code, headers
|
|
751
|
+
end
|
|
752
|
+
|
|
753
|
+
# List schedulers for a durable function
|
|
754
|
+
# The durable collection's counterpart to `/projects/{id}/functions/{functionId}/schedulers`. A standard function's id is not accepted here, and a durable function's id is not accepted there.
|
|
755
|
+
# @param id [String] Project ID
|
|
756
|
+
# @param function_id [String] Durable function ID, or its name within the project
|
|
757
|
+
# @param [Hash] opts the optional parameters
|
|
758
|
+
# @return [FunctionSchedulerListResponse]
|
|
759
|
+
def list_durable_function_schedulers(id, function_id, opts = {})
|
|
760
|
+
data, _status_code, _headers = list_durable_function_schedulers_with_http_info(id, function_id, opts)
|
|
761
|
+
data
|
|
762
|
+
end
|
|
763
|
+
|
|
764
|
+
# List schedulers for a durable function
|
|
765
|
+
# The durable collection's counterpart to `/projects/{id}/functions/{functionId}/schedulers`. A standard function's id is not accepted here, and a durable function's id is not accepted there.
|
|
766
|
+
# @param id [String] Project ID
|
|
767
|
+
# @param function_id [String] Durable function ID, or its name within the project
|
|
768
|
+
# @param [Hash] opts the optional parameters
|
|
769
|
+
# @return [Array<(FunctionSchedulerListResponse, Integer, Hash)>] FunctionSchedulerListResponse data, response status code and response headers
|
|
770
|
+
def list_durable_function_schedulers_with_http_info(id, function_id, opts = {})
|
|
771
|
+
if @api_client.config.debugging
|
|
772
|
+
@api_client.config.logger.debug 'Calling API: DurableFunctionsApi.list_durable_function_schedulers ...'
|
|
773
|
+
end
|
|
774
|
+
# verify the required parameter 'id' is set
|
|
775
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
776
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling DurableFunctionsApi.list_durable_function_schedulers"
|
|
777
|
+
end
|
|
778
|
+
# verify the required parameter 'function_id' is set
|
|
779
|
+
if @api_client.config.client_side_validation && function_id.nil?
|
|
780
|
+
fail ArgumentError, "Missing the required parameter 'function_id' when calling DurableFunctionsApi.list_durable_function_schedulers"
|
|
781
|
+
end
|
|
782
|
+
# resource path
|
|
783
|
+
local_var_path = '/projects/{id}/durable-functions/{functionId}/schedulers'.sub('{' + 'id' + '}', CGI.escape(id.to_s)).sub('{' + 'functionId' + '}', CGI.escape(function_id.to_s))
|
|
784
|
+
|
|
785
|
+
# query parameters
|
|
786
|
+
query_params = opts[:query_params] || {}
|
|
787
|
+
|
|
788
|
+
# header parameters
|
|
789
|
+
header_params = opts[:header_params] || {}
|
|
790
|
+
# HTTP header 'Accept' (if needed)
|
|
791
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
792
|
+
|
|
793
|
+
# form parameters
|
|
794
|
+
form_params = opts[:form_params] || {}
|
|
795
|
+
|
|
796
|
+
# http body (model)
|
|
797
|
+
post_body = opts[:debug_body]
|
|
798
|
+
|
|
799
|
+
# return_type
|
|
800
|
+
return_type = opts[:debug_return_type] || 'FunctionSchedulerListResponse'
|
|
801
|
+
|
|
802
|
+
# auth_names
|
|
803
|
+
auth_names = opts[:debug_auth_names] || ['UserToken']
|
|
804
|
+
|
|
805
|
+
new_options = opts.merge(
|
|
806
|
+
:operation => :"DurableFunctionsApi.list_durable_function_schedulers",
|
|
807
|
+
:header_params => header_params,
|
|
808
|
+
:query_params => query_params,
|
|
809
|
+
:form_params => form_params,
|
|
810
|
+
:body => post_body,
|
|
811
|
+
:auth_names => auth_names,
|
|
812
|
+
:return_type => return_type
|
|
813
|
+
)
|
|
814
|
+
|
|
815
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
816
|
+
if @api_client.config.debugging
|
|
817
|
+
@api_client.config.logger.debug "API called: DurableFunctionsApi#list_durable_function_schedulers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
818
|
+
end
|
|
819
|
+
return data, status_code, headers
|
|
820
|
+
end
|
|
821
|
+
|
|
822
|
+
# List all durable functions in a project
|
|
823
|
+
# Standard functions never appear here, and durable functions never appear under `/projects/{id}/functions`. The two are separate collections.
|
|
824
|
+
# @param id [String] Project ID
|
|
825
|
+
# @param [Hash] opts the optional parameters
|
|
826
|
+
# @option opts [Integer] :page Page number (1-indexed) for offset pagination. Declares no schema default so the request validator does not inject one: handlers that omit `page` see it unset (nil) and default to 1 in code, while cursor-first endpoints (e.g. the project deployments feed) can detect its absence to stay in keyset/search mode. Supplying `page` selects offset pagination.
|
|
827
|
+
# @option opts [Integer] :limit Number of items per page (max 100) (default to 10)
|
|
828
|
+
# @option opts [String] :search Case-insensitive substring match on the resource `name`. See the endpoint description for supported pagination modes.
|
|
829
|
+
# @return [PaginatedDurableFunctions]
|
|
830
|
+
def list_durable_functions(id, opts = {})
|
|
831
|
+
data, _status_code, _headers = list_durable_functions_with_http_info(id, opts)
|
|
832
|
+
data
|
|
833
|
+
end
|
|
834
|
+
|
|
835
|
+
# List all durable functions in a project
|
|
836
|
+
# Standard functions never appear here, and durable functions never appear under `/projects/{id}/functions`. The two are separate collections.
|
|
837
|
+
# @param id [String] Project ID
|
|
838
|
+
# @param [Hash] opts the optional parameters
|
|
839
|
+
# @option opts [Integer] :page Page number (1-indexed) for offset pagination. Declares no schema default so the request validator does not inject one: handlers that omit `page` see it unset (nil) and default to 1 in code, while cursor-first endpoints (e.g. the project deployments feed) can detect its absence to stay in keyset/search mode. Supplying `page` selects offset pagination.
|
|
840
|
+
# @option opts [Integer] :limit Number of items per page (max 100) (default to 10)
|
|
841
|
+
# @option opts [String] :search Case-insensitive substring match on the resource `name`. See the endpoint description for supported pagination modes.
|
|
842
|
+
# @return [Array<(PaginatedDurableFunctions, Integer, Hash)>] PaginatedDurableFunctions data, response status code and response headers
|
|
843
|
+
def list_durable_functions_with_http_info(id, opts = {})
|
|
844
|
+
if @api_client.config.debugging
|
|
845
|
+
@api_client.config.logger.debug 'Calling API: DurableFunctionsApi.list_durable_functions ...'
|
|
846
|
+
end
|
|
847
|
+
# verify the required parameter 'id' is set
|
|
848
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
849
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling DurableFunctionsApi.list_durable_functions"
|
|
850
|
+
end
|
|
851
|
+
if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
|
|
852
|
+
fail ArgumentError, 'invalid value for "opts[:"page"]" when calling DurableFunctionsApi.list_durable_functions, must be greater than or equal to 1.'
|
|
853
|
+
end
|
|
854
|
+
|
|
855
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
|
|
856
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling DurableFunctionsApi.list_durable_functions, must be smaller than or equal to 100.'
|
|
857
|
+
end
|
|
858
|
+
|
|
859
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
|
860
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling DurableFunctionsApi.list_durable_functions, must be greater than or equal to 1.'
|
|
861
|
+
end
|
|
862
|
+
|
|
863
|
+
if @api_client.config.client_side_validation && !opts[:'search'].nil? && opts[:'search'].to_s.length > 256
|
|
864
|
+
fail ArgumentError, 'invalid value for "opts[:"search"]" when calling DurableFunctionsApi.list_durable_functions, the character length must be smaller than or equal to 256.'
|
|
865
|
+
end
|
|
866
|
+
|
|
867
|
+
# resource path
|
|
868
|
+
local_var_path = '/projects/{id}/durable-functions'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
869
|
+
|
|
870
|
+
# query parameters
|
|
871
|
+
query_params = opts[:query_params] || {}
|
|
872
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
|
873
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
874
|
+
query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?
|
|
875
|
+
|
|
876
|
+
# header parameters
|
|
877
|
+
header_params = opts[:header_params] || {}
|
|
878
|
+
# HTTP header 'Accept' (if needed)
|
|
879
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
880
|
+
|
|
881
|
+
# form parameters
|
|
882
|
+
form_params = opts[:form_params] || {}
|
|
883
|
+
|
|
884
|
+
# http body (model)
|
|
885
|
+
post_body = opts[:debug_body]
|
|
886
|
+
|
|
887
|
+
# return_type
|
|
888
|
+
return_type = opts[:debug_return_type] || 'PaginatedDurableFunctions'
|
|
889
|
+
|
|
890
|
+
# auth_names
|
|
891
|
+
auth_names = opts[:debug_auth_names] || ['UserToken']
|
|
892
|
+
|
|
893
|
+
new_options = opts.merge(
|
|
894
|
+
:operation => :"DurableFunctionsApi.list_durable_functions",
|
|
895
|
+
:header_params => header_params,
|
|
896
|
+
:query_params => query_params,
|
|
897
|
+
:form_params => form_params,
|
|
898
|
+
:body => post_body,
|
|
899
|
+
:auth_names => auth_names,
|
|
900
|
+
:return_type => return_type
|
|
901
|
+
)
|
|
902
|
+
|
|
903
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
904
|
+
if @api_client.config.debugging
|
|
905
|
+
@api_client.config.logger.debug "API called: DurableFunctionsApi#list_durable_functions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
906
|
+
end
|
|
907
|
+
return data, status_code, headers
|
|
908
|
+
end
|
|
909
|
+
|
|
910
|
+
# Start a durable execution
|
|
911
|
+
# 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.
|
|
912
|
+
# @param id [String] Project ID
|
|
913
|
+
# @param function_id [String] Durable function ID, or its name within the project
|
|
914
|
+
# @param [Hash] opts the optional parameters
|
|
915
|
+
# @option opts [String] :x_volcano_execution_name Idempotency key for this execution. Generated when omitted. A repeat under a name that already names a running execution returns that execution and is not charged again. Letters, digits, `-`, `_` and `.`, up to 255 characters. Anything else is rejected with `400`.
|
|
916
|
+
# @option opts [Object] :body
|
|
917
|
+
# @return [DurableExecution]
|
|
918
|
+
def start_durable_execution(id, function_id, opts = {})
|
|
919
|
+
data, _status_code, _headers = start_durable_execution_with_http_info(id, function_id, opts)
|
|
920
|
+
data
|
|
921
|
+
end
|
|
922
|
+
|
|
923
|
+
# Start a durable execution
|
|
924
|
+
# 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.
|
|
925
|
+
# @param id [String] Project ID
|
|
926
|
+
# @param function_id [String] Durable function ID, or its name within the project
|
|
927
|
+
# @param [Hash] opts the optional parameters
|
|
928
|
+
# @option opts [String] :x_volcano_execution_name Idempotency key for this execution. Generated when omitted. A repeat under a name that already names a running execution returns that execution and is not charged again. Letters, digits, `-`, `_` and `.`, up to 255 characters. Anything else is rejected with `400`.
|
|
929
|
+
# @option opts [Object] :body
|
|
930
|
+
# @return [Array<(DurableExecution, Integer, Hash)>] DurableExecution data, response status code and response headers
|
|
931
|
+
def start_durable_execution_with_http_info(id, function_id, opts = {})
|
|
932
|
+
if @api_client.config.debugging
|
|
933
|
+
@api_client.config.logger.debug 'Calling API: DurableFunctionsApi.start_durable_execution ...'
|
|
934
|
+
end
|
|
935
|
+
# verify the required parameter 'id' is set
|
|
936
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
937
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling DurableFunctionsApi.start_durable_execution"
|
|
938
|
+
end
|
|
939
|
+
# verify the required parameter 'function_id' is set
|
|
940
|
+
if @api_client.config.client_side_validation && function_id.nil?
|
|
941
|
+
fail ArgumentError, "Missing the required parameter 'function_id' when calling DurableFunctionsApi.start_durable_execution"
|
|
942
|
+
end
|
|
943
|
+
if @api_client.config.client_side_validation && !opts[:'x_volcano_execution_name'].nil? && opts[:'x_volcano_execution_name'].to_s.length > 255
|
|
944
|
+
fail ArgumentError, 'invalid value for "opts[:"x_volcano_execution_name"]" when calling DurableFunctionsApi.start_durable_execution, the character length must be smaller than or equal to 255.'
|
|
945
|
+
end
|
|
946
|
+
|
|
947
|
+
pattern = Regexp.new(/^[A-Za-z0-9._-]+$/)
|
|
948
|
+
if @api_client.config.client_side_validation && !opts[:'x_volcano_execution_name'].nil? && opts[:'x_volcano_execution_name'] !~ pattern
|
|
949
|
+
fail ArgumentError, "invalid value for 'opts[:\"x_volcano_execution_name\"]' when calling DurableFunctionsApi.start_durable_execution, must conform to the pattern #{pattern}."
|
|
950
|
+
end
|
|
951
|
+
|
|
952
|
+
# resource path
|
|
953
|
+
local_var_path = '/projects/{id}/durable-functions/{functionId}/executions'.sub('{' + 'id' + '}', CGI.escape(id.to_s)).sub('{' + 'functionId' + '}', CGI.escape(function_id.to_s))
|
|
954
|
+
|
|
955
|
+
# query parameters
|
|
956
|
+
query_params = opts[:query_params] || {}
|
|
957
|
+
|
|
958
|
+
# header parameters
|
|
959
|
+
header_params = opts[:header_params] || {}
|
|
960
|
+
# HTTP header 'Accept' (if needed)
|
|
961
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
962
|
+
# HTTP header 'Content-Type'
|
|
963
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
964
|
+
if !content_type.nil?
|
|
965
|
+
header_params['Content-Type'] = content_type
|
|
966
|
+
end
|
|
967
|
+
header_params[:'X-Volcano-Execution-Name'] = opts[:'x_volcano_execution_name'] if !opts[:'x_volcano_execution_name'].nil?
|
|
968
|
+
|
|
969
|
+
# form parameters
|
|
970
|
+
form_params = opts[:form_params] || {}
|
|
971
|
+
|
|
972
|
+
# http body (model)
|
|
973
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
|
|
974
|
+
|
|
975
|
+
# return_type
|
|
976
|
+
return_type = opts[:debug_return_type] || 'DurableExecution'
|
|
977
|
+
|
|
978
|
+
# auth_names
|
|
979
|
+
auth_names = opts[:debug_auth_names] || ['UserToken']
|
|
980
|
+
|
|
981
|
+
new_options = opts.merge(
|
|
982
|
+
:operation => :"DurableFunctionsApi.start_durable_execution",
|
|
983
|
+
:header_params => header_params,
|
|
984
|
+
:query_params => query_params,
|
|
985
|
+
:form_params => form_params,
|
|
986
|
+
:body => post_body,
|
|
987
|
+
:auth_names => auth_names,
|
|
988
|
+
:return_type => return_type
|
|
989
|
+
)
|
|
990
|
+
|
|
991
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
992
|
+
if @api_client.config.debugging
|
|
993
|
+
@api_client.config.logger.debug "API called: DurableFunctionsApi#start_durable_execution\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
994
|
+
end
|
|
995
|
+
return data, status_code, headers
|
|
996
|
+
end
|
|
997
|
+
|
|
998
|
+
# Start a durable execution from an application
|
|
999
|
+
# Starts an execution of a durable function using an application credential, and returns its handle. This is the durable counterpart of `POST /functions/{functionId}/invoke`, and it is the endpoint an application calls. Like that one, it is not project-scoped: an anon key, a service key and an auth user token each carry their own project. The project-scoped collection under `/projects/{id}/durable-functions/...` remains the owner's management surface. **With a service key or an auth user token:** any durable function in the project. **With an anon key:** requires the `functions.invoke` permission, and the function must have `is_public: true`. Starting is all this endpoint does. Reading a result or stopping an execution requires the project owner's token, because an anon key is shared by everyone who loads the page and an execution is addressed by id alone. 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 once against the project's durable execution allowance, however many times the start is retried under the same execution name, and the number in flight at once is capped by the plan. The operations the execution performs are counted against the durable operations allowance when it finishes.
|
|
1000
|
+
# @param function_id [String] Durable function ID, or its name within the project
|
|
1001
|
+
# @param [Hash] opts the optional parameters
|
|
1002
|
+
# @option opts [String] :x_volcano_execution_name Idempotency key for this execution. Generated when omitted. A repeat under a name that already names a running execution returns that execution and is not charged again. Letters, digits, `-`, `_` and `.`, up to 255 characters. Anything else is rejected with `400`.
|
|
1003
|
+
# @option opts [Object] :body
|
|
1004
|
+
# @return [DurableExecution]
|
|
1005
|
+
def start_durable_execution_from_application(function_id, opts = {})
|
|
1006
|
+
data, _status_code, _headers = start_durable_execution_from_application_with_http_info(function_id, opts)
|
|
1007
|
+
data
|
|
1008
|
+
end
|
|
1009
|
+
|
|
1010
|
+
# Start a durable execution from an application
|
|
1011
|
+
# Starts an execution of a durable function using an application credential, and returns its handle. This is the durable counterpart of `POST /functions/{functionId}/invoke`, and it is the endpoint an application calls. Like that one, it is not project-scoped: an anon key, a service key and an auth user token each carry their own project. The project-scoped collection under `/projects/{id}/durable-functions/...` remains the owner's management surface. **With a service key or an auth user token:** any durable function in the project. **With an anon key:** requires the `functions.invoke` permission, and the function must have `is_public: true`. Starting is all this endpoint does. Reading a result or stopping an execution requires the project owner's token, because an anon key is shared by everyone who loads the page and an execution is addressed by id alone. 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 once against the project's durable execution allowance, however many times the start is retried under the same execution name, and the number in flight at once is capped by the plan. The operations the execution performs are counted against the durable operations allowance when it finishes.
|
|
1012
|
+
# @param function_id [String] Durable function ID, or its name within the project
|
|
1013
|
+
# @param [Hash] opts the optional parameters
|
|
1014
|
+
# @option opts [String] :x_volcano_execution_name Idempotency key for this execution. Generated when omitted. A repeat under a name that already names a running execution returns that execution and is not charged again. Letters, digits, `-`, `_` and `.`, up to 255 characters. Anything else is rejected with `400`.
|
|
1015
|
+
# @option opts [Object] :body
|
|
1016
|
+
# @return [Array<(DurableExecution, Integer, Hash)>] DurableExecution data, response status code and response headers
|
|
1017
|
+
def start_durable_execution_from_application_with_http_info(function_id, opts = {})
|
|
1018
|
+
if @api_client.config.debugging
|
|
1019
|
+
@api_client.config.logger.debug 'Calling API: DurableFunctionsApi.start_durable_execution_from_application ...'
|
|
1020
|
+
end
|
|
1021
|
+
# verify the required parameter 'function_id' is set
|
|
1022
|
+
if @api_client.config.client_side_validation && function_id.nil?
|
|
1023
|
+
fail ArgumentError, "Missing the required parameter 'function_id' when calling DurableFunctionsApi.start_durable_execution_from_application"
|
|
1024
|
+
end
|
|
1025
|
+
if @api_client.config.client_side_validation && !opts[:'x_volcano_execution_name'].nil? && opts[:'x_volcano_execution_name'].to_s.length > 255
|
|
1026
|
+
fail ArgumentError, 'invalid value for "opts[:"x_volcano_execution_name"]" when calling DurableFunctionsApi.start_durable_execution_from_application, the character length must be smaller than or equal to 255.'
|
|
1027
|
+
end
|
|
1028
|
+
|
|
1029
|
+
pattern = Regexp.new(/^[A-Za-z0-9._-]+$/)
|
|
1030
|
+
if @api_client.config.client_side_validation && !opts[:'x_volcano_execution_name'].nil? && opts[:'x_volcano_execution_name'] !~ pattern
|
|
1031
|
+
fail ArgumentError, "invalid value for 'opts[:\"x_volcano_execution_name\"]' when calling DurableFunctionsApi.start_durable_execution_from_application, must conform to the pattern #{pattern}."
|
|
1032
|
+
end
|
|
1033
|
+
|
|
1034
|
+
# resource path
|
|
1035
|
+
local_var_path = '/durable-functions/{functionId}/executions'.sub('{' + 'functionId' + '}', CGI.escape(function_id.to_s))
|
|
1036
|
+
|
|
1037
|
+
# query parameters
|
|
1038
|
+
query_params = opts[:query_params] || {}
|
|
1039
|
+
|
|
1040
|
+
# header parameters
|
|
1041
|
+
header_params = opts[:header_params] || {}
|
|
1042
|
+
# HTTP header 'Accept' (if needed)
|
|
1043
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
1044
|
+
# HTTP header 'Content-Type'
|
|
1045
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
1046
|
+
if !content_type.nil?
|
|
1047
|
+
header_params['Content-Type'] = content_type
|
|
1048
|
+
end
|
|
1049
|
+
header_params[:'X-Volcano-Execution-Name'] = opts[:'x_volcano_execution_name'] if !opts[:'x_volcano_execution_name'].nil?
|
|
1050
|
+
|
|
1051
|
+
# form parameters
|
|
1052
|
+
form_params = opts[:form_params] || {}
|
|
1053
|
+
|
|
1054
|
+
# http body (model)
|
|
1055
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
|
|
1056
|
+
|
|
1057
|
+
# return_type
|
|
1058
|
+
return_type = opts[:debug_return_type] || 'DurableExecution'
|
|
1059
|
+
|
|
1060
|
+
# auth_names
|
|
1061
|
+
auth_names = opts[:debug_auth_names] || ['ServiceRoleKey', 'AuthUserAccessToken', 'AnonKey']
|
|
1062
|
+
|
|
1063
|
+
new_options = opts.merge(
|
|
1064
|
+
:operation => :"DurableFunctionsApi.start_durable_execution_from_application",
|
|
1065
|
+
:header_params => header_params,
|
|
1066
|
+
:query_params => query_params,
|
|
1067
|
+
:form_params => form_params,
|
|
1068
|
+
:body => post_body,
|
|
1069
|
+
:auth_names => auth_names,
|
|
1070
|
+
:return_type => return_type
|
|
1071
|
+
)
|
|
1072
|
+
|
|
1073
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
1074
|
+
if @api_client.config.debugging
|
|
1075
|
+
@api_client.config.logger.debug "API called: DurableFunctionsApi#start_durable_execution_from_application\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
1076
|
+
end
|
|
1077
|
+
return data, status_code, headers
|
|
1078
|
+
end
|
|
1079
|
+
|
|
1080
|
+
# Stop a durable execution
|
|
1081
|
+
# Cancels a running execution. Its completed steps are not undone. The call is accepted rather than awaited: cancellation happens behind it, so the response reports the execution as it was read back and may still say `running`. Do not branch on that status — the execution settles into `stopped` shortly after, and polling `GET /projects/{id}/durable-functions/{functionId}/executions/{executionId}` is how you see it get there. Stopping an execution that already finished is not an error: the response carries the state it settled in.
|
|
1082
|
+
# @param id [String] Project ID
|
|
1083
|
+
# @param function_id [String] Durable function ID, or its name within the project
|
|
1084
|
+
# @param execution_id [String] Durable execution ID
|
|
1085
|
+
# @param [Hash] opts the optional parameters
|
|
1086
|
+
# @return [DurableExecution]
|
|
1087
|
+
def stop_durable_execution(id, function_id, execution_id, opts = {})
|
|
1088
|
+
data, _status_code, _headers = stop_durable_execution_with_http_info(id, function_id, execution_id, opts)
|
|
1089
|
+
data
|
|
1090
|
+
end
|
|
1091
|
+
|
|
1092
|
+
# Stop a durable execution
|
|
1093
|
+
# Cancels a running execution. Its completed steps are not undone. The call is accepted rather than awaited: cancellation happens behind it, so the response reports the execution as it was read back and may still say `running`. Do not branch on that status — the execution settles into `stopped` shortly after, and polling `GET /projects/{id}/durable-functions/{functionId}/executions/{executionId}` is how you see it get there. Stopping an execution that already finished is not an error: the response carries the state it settled in.
|
|
1094
|
+
# @param id [String] Project ID
|
|
1095
|
+
# @param function_id [String] Durable function ID, or its name within the project
|
|
1096
|
+
# @param execution_id [String] Durable execution ID
|
|
1097
|
+
# @param [Hash] opts the optional parameters
|
|
1098
|
+
# @return [Array<(DurableExecution, Integer, Hash)>] DurableExecution data, response status code and response headers
|
|
1099
|
+
def stop_durable_execution_with_http_info(id, function_id, execution_id, opts = {})
|
|
1100
|
+
if @api_client.config.debugging
|
|
1101
|
+
@api_client.config.logger.debug 'Calling API: DurableFunctionsApi.stop_durable_execution ...'
|
|
1102
|
+
end
|
|
1103
|
+
# verify the required parameter 'id' is set
|
|
1104
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
1105
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling DurableFunctionsApi.stop_durable_execution"
|
|
1106
|
+
end
|
|
1107
|
+
# verify the required parameter 'function_id' is set
|
|
1108
|
+
if @api_client.config.client_side_validation && function_id.nil?
|
|
1109
|
+
fail ArgumentError, "Missing the required parameter 'function_id' when calling DurableFunctionsApi.stop_durable_execution"
|
|
1110
|
+
end
|
|
1111
|
+
# verify the required parameter 'execution_id' is set
|
|
1112
|
+
if @api_client.config.client_side_validation && execution_id.nil?
|
|
1113
|
+
fail ArgumentError, "Missing the required parameter 'execution_id' when calling DurableFunctionsApi.stop_durable_execution"
|
|
1114
|
+
end
|
|
1115
|
+
# resource path
|
|
1116
|
+
local_var_path = '/projects/{id}/durable-functions/{functionId}/executions/{executionId}/stop'.sub('{' + 'id' + '}', CGI.escape(id.to_s)).sub('{' + 'functionId' + '}', CGI.escape(function_id.to_s)).sub('{' + 'executionId' + '}', CGI.escape(execution_id.to_s))
|
|
1117
|
+
|
|
1118
|
+
# query parameters
|
|
1119
|
+
query_params = opts[:query_params] || {}
|
|
1120
|
+
|
|
1121
|
+
# header parameters
|
|
1122
|
+
header_params = opts[:header_params] || {}
|
|
1123
|
+
# HTTP header 'Accept' (if needed)
|
|
1124
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
1125
|
+
|
|
1126
|
+
# form parameters
|
|
1127
|
+
form_params = opts[:form_params] || {}
|
|
1128
|
+
|
|
1129
|
+
# http body (model)
|
|
1130
|
+
post_body = opts[:debug_body]
|
|
1131
|
+
|
|
1132
|
+
# return_type
|
|
1133
|
+
return_type = opts[:debug_return_type] || 'DurableExecution'
|
|
1134
|
+
|
|
1135
|
+
# auth_names
|
|
1136
|
+
auth_names = opts[:debug_auth_names] || ['UserToken']
|
|
1137
|
+
|
|
1138
|
+
new_options = opts.merge(
|
|
1139
|
+
:operation => :"DurableFunctionsApi.stop_durable_execution",
|
|
1140
|
+
:header_params => header_params,
|
|
1141
|
+
:query_params => query_params,
|
|
1142
|
+
:form_params => form_params,
|
|
1143
|
+
:body => post_body,
|
|
1144
|
+
:auth_names => auth_names,
|
|
1145
|
+
:return_type => return_type
|
|
1146
|
+
)
|
|
1147
|
+
|
|
1148
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
1149
|
+
if @api_client.config.debugging
|
|
1150
|
+
@api_client.config.logger.debug "API called: DurableFunctionsApi#stop_durable_execution\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
1151
|
+
end
|
|
1152
|
+
return data, status_code, headers
|
|
1153
|
+
end
|
|
1154
|
+
|
|
1155
|
+
# Update a durable function scheduler
|
|
1156
|
+
# @param id [String] Project ID
|
|
1157
|
+
# @param function_id [String] Durable function ID, or its name within the project
|
|
1158
|
+
# @param scheduler_id [String] Function scheduler ID
|
|
1159
|
+
# @param update_function_scheduler_request [UpdateFunctionSchedulerRequest]
|
|
1160
|
+
# @param [Hash] opts the optional parameters
|
|
1161
|
+
# @return [FunctionScheduler]
|
|
1162
|
+
def update_durable_function_scheduler(id, function_id, scheduler_id, update_function_scheduler_request, opts = {})
|
|
1163
|
+
data, _status_code, _headers = update_durable_function_scheduler_with_http_info(id, function_id, scheduler_id, update_function_scheduler_request, opts)
|
|
1164
|
+
data
|
|
1165
|
+
end
|
|
1166
|
+
|
|
1167
|
+
# Update a durable function scheduler
|
|
1168
|
+
# @param id [String] Project ID
|
|
1169
|
+
# @param function_id [String] Durable function ID, or its name within the project
|
|
1170
|
+
# @param scheduler_id [String] Function scheduler ID
|
|
1171
|
+
# @param update_function_scheduler_request [UpdateFunctionSchedulerRequest]
|
|
1172
|
+
# @param [Hash] opts the optional parameters
|
|
1173
|
+
# @return [Array<(FunctionScheduler, Integer, Hash)>] FunctionScheduler data, response status code and response headers
|
|
1174
|
+
def update_durable_function_scheduler_with_http_info(id, function_id, scheduler_id, update_function_scheduler_request, opts = {})
|
|
1175
|
+
if @api_client.config.debugging
|
|
1176
|
+
@api_client.config.logger.debug 'Calling API: DurableFunctionsApi.update_durable_function_scheduler ...'
|
|
1177
|
+
end
|
|
1178
|
+
# verify the required parameter 'id' is set
|
|
1179
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
1180
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling DurableFunctionsApi.update_durable_function_scheduler"
|
|
1181
|
+
end
|
|
1182
|
+
# verify the required parameter 'function_id' is set
|
|
1183
|
+
if @api_client.config.client_side_validation && function_id.nil?
|
|
1184
|
+
fail ArgumentError, "Missing the required parameter 'function_id' when calling DurableFunctionsApi.update_durable_function_scheduler"
|
|
1185
|
+
end
|
|
1186
|
+
# verify the required parameter 'scheduler_id' is set
|
|
1187
|
+
if @api_client.config.client_side_validation && scheduler_id.nil?
|
|
1188
|
+
fail ArgumentError, "Missing the required parameter 'scheduler_id' when calling DurableFunctionsApi.update_durable_function_scheduler"
|
|
1189
|
+
end
|
|
1190
|
+
# verify the required parameter 'update_function_scheduler_request' is set
|
|
1191
|
+
if @api_client.config.client_side_validation && update_function_scheduler_request.nil?
|
|
1192
|
+
fail ArgumentError, "Missing the required parameter 'update_function_scheduler_request' when calling DurableFunctionsApi.update_durable_function_scheduler"
|
|
1193
|
+
end
|
|
1194
|
+
# resource path
|
|
1195
|
+
local_var_path = '/projects/{id}/durable-functions/{functionId}/schedulers/{schedulerId}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)).sub('{' + 'functionId' + '}', CGI.escape(function_id.to_s)).sub('{' + 'schedulerId' + '}', CGI.escape(scheduler_id.to_s))
|
|
1196
|
+
|
|
1197
|
+
# query parameters
|
|
1198
|
+
query_params = opts[:query_params] || {}
|
|
1199
|
+
|
|
1200
|
+
# header parameters
|
|
1201
|
+
header_params = opts[:header_params] || {}
|
|
1202
|
+
# HTTP header 'Accept' (if needed)
|
|
1203
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
1204
|
+
# HTTP header 'Content-Type'
|
|
1205
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
1206
|
+
if !content_type.nil?
|
|
1207
|
+
header_params['Content-Type'] = content_type
|
|
1208
|
+
end
|
|
1209
|
+
|
|
1210
|
+
# form parameters
|
|
1211
|
+
form_params = opts[:form_params] || {}
|
|
1212
|
+
|
|
1213
|
+
# http body (model)
|
|
1214
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(update_function_scheduler_request)
|
|
1215
|
+
|
|
1216
|
+
# return_type
|
|
1217
|
+
return_type = opts[:debug_return_type] || 'FunctionScheduler'
|
|
1218
|
+
|
|
1219
|
+
# auth_names
|
|
1220
|
+
auth_names = opts[:debug_auth_names] || ['UserToken']
|
|
1221
|
+
|
|
1222
|
+
new_options = opts.merge(
|
|
1223
|
+
:operation => :"DurableFunctionsApi.update_durable_function_scheduler",
|
|
1224
|
+
:header_params => header_params,
|
|
1225
|
+
:query_params => query_params,
|
|
1226
|
+
:form_params => form_params,
|
|
1227
|
+
:body => post_body,
|
|
1228
|
+
:auth_names => auth_names,
|
|
1229
|
+
:return_type => return_type
|
|
1230
|
+
)
|
|
1231
|
+
|
|
1232
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
|
1233
|
+
if @api_client.config.debugging
|
|
1234
|
+
@api_client.config.logger.debug "API called: DurableFunctionsApi#update_durable_function_scheduler\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
1235
|
+
end
|
|
1236
|
+
return data, status_code, headers
|
|
1237
|
+
end
|
|
1238
|
+
end
|
|
1239
|
+
end
|