Class: Mudbase::FunctionsApi
- Inherits:
-
Object
- Object
- Mudbase::FunctionsApi
- Defined in:
- lib/mudbase/api/functions_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#activate_function(project_id, function_id, opts = {}) ⇒ FunctionResponse
Activate function Activate a deactivated function.
-
#activate_function_with_http_info(project_id, function_id, opts = {}) ⇒ Array<(FunctionResponse, Integer, Hash)>
Activate function Activate a deactivated function.
-
#create_function(project_id, create_function_request, opts = {}) ⇒ FunctionResponse
Create function Create a new serverless function.
-
#create_function_with_http_info(project_id, create_function_request, opts = {}) ⇒ Array<(FunctionResponse, Integer, Hash)>
Create function Create a new serverless function.
-
#deactivate_function(project_id, function_id, opts = {}) ⇒ FunctionResponse
Deactivate function Deactivate a function.
-
#deactivate_function_with_http_info(project_id, function_id, opts = {}) ⇒ Array<(FunctionResponse, Integer, Hash)>
Deactivate function Deactivate a function.
-
#delete_function(project_id, function_id, opts = {}) ⇒ DeleteFunction200Response
Delete function Delete a function permanently.
-
#delete_function_with_http_info(project_id, function_id, opts = {}) ⇒ Array<(DeleteFunction200Response, Integer, Hash)>
Delete function Delete a function permanently.
-
#execute_function(project_id, function_id, opts = {}) ⇒ FunctionExecutionResponse
Execute function Manually execute a function with custom payload.
-
#execute_function_with_http_info(project_id, function_id, opts = {}) ⇒ Array<(FunctionExecutionResponse, Integer, Hash)>
Execute function Manually execute a function with custom payload.
-
#get_function(project_id, function_id, opts = {}) ⇒ FunctionResponse
Get function Get function details by ID including createdBy/updatedBy.
-
#get_function_logs(project_id, function_id, opts = {}) ⇒ FunctionLogsResponse
Get function execution logs Get execution logs with pagination.
-
#get_function_logs_with_http_info(project_id, function_id, opts = {}) ⇒ Array<(FunctionLogsResponse, Integer, Hash)>
Get function execution logs Get execution logs with pagination.
-
#get_function_versions(project_id, function_id, opts = {}) ⇒ GetFunctionVersions200Response
Get function versions List all code versions for a function.
-
#get_function_versions_with_http_info(project_id, function_id, opts = {}) ⇒ Array<(GetFunctionVersions200Response, Integer, Hash)>
Get function versions List all code versions for a function.
-
#get_function_with_http_info(project_id, function_id, opts = {}) ⇒ Array<(FunctionResponse, Integer, Hash)>
Get function Get function details by ID including createdBy/updatedBy.
-
#initialize(api_client = ApiClient.default) ⇒ FunctionsApi
constructor
A new instance of FunctionsApi.
-
#list_functions(project_id, opts = {}) ⇒ FunctionListResponse
List functions List serverless functions in a project with optional search and filters.
-
#list_functions_with_http_info(project_id, opts = {}) ⇒ Array<(FunctionListResponse, Integer, Hash)>
List functions List serverless functions in a project with optional search and filters.
-
#retry_function_execution(project_id, function_id, execution_index, opts = {}) ⇒ FunctionExecutionResponse
Retry failed execution Retry a failed execution by its index (0-based) in the logs.
-
#retry_function_execution_with_http_info(project_id, function_id, execution_index, opts = {}) ⇒ Array<(FunctionExecutionResponse, Integer, Hash)>
Retry failed execution Retry a failed execution by its index (0-based) in the logs.
-
#rollback_function(project_id, function_id, rollback_function_request, opts = {}) ⇒ FunctionResponse
Rollback to previous version Rollback function code to a previous version.
-
#rollback_function_with_http_info(project_id, function_id, rollback_function_request, opts = {}) ⇒ Array<(FunctionResponse, Integer, Hash)>
Rollback to previous version Rollback function code to a previous version.
-
#simulate_function_trigger(project_id, function_id, opts = {}) ⇒ FunctionExecutionResponse
Simulate trigger Test a function with simulated trigger context.
-
#simulate_function_trigger_with_http_info(project_id, function_id, opts = {}) ⇒ Array<(FunctionExecutionResponse, Integer, Hash)>
Simulate trigger Test a function with simulated trigger context.
-
#trigger_function_webhook(project_id, opts = {}) ⇒ TriggerFunctionWebhook200Response
Trigger webhook functions Public endpoint for external services to trigger functions with ‘trigger.type: webhook`.
-
#trigger_function_webhook_with_http_info(project_id, opts = {}) ⇒ Array<(TriggerFunctionWebhook200Response, Integer, Hash)>
Trigger webhook functions Public endpoint for external services to trigger functions with `trigger.type: webhook`.
-
#update_function(project_id, function_id, opts = {}) ⇒ FunctionResponse
Update function Update function configuration.
-
#update_function_with_http_info(project_id, function_id, opts = {}) ⇒ Array<(FunctionResponse, Integer, Hash)>
Update function Update function configuration.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ FunctionsApi
Returns a new instance of FunctionsApi.
19 20 21 |
# File 'lib/mudbase/api/functions_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/mudbase/api/functions_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#activate_function(project_id, function_id, opts = {}) ⇒ FunctionResponse
Activate function Activate a deactivated function. Active functions can be triggered.
28 29 30 31 |
# File 'lib/mudbase/api/functions_api.rb', line 28 def activate_function(project_id, function_id, opts = {}) data, _status_code, _headers = activate_function_with_http_info(project_id, function_id, opts) data end |
#activate_function_with_http_info(project_id, function_id, opts = {}) ⇒ Array<(FunctionResponse, Integer, Hash)>
Activate function Activate a deactivated function. Active functions can be triggered.
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/mudbase/api/functions_api.rb', line 39 def activate_function_with_http_info(project_id, function_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FunctionsApi.activate_function ...' end # verify the required parameter 'project_id' is set if @api_client.config.client_side_validation && project_id.nil? fail ArgumentError, "Missing the required parameter 'project_id' when calling FunctionsApi.activate_function" end # verify the required parameter 'function_id' is set if @api_client.config.client_side_validation && function_id.nil? fail ArgumentError, "Missing the required parameter 'function_id' when calling FunctionsApi.activate_function" end # resource path local_var_path = '/api/functions/projects/{projectId}/functions/{functionId}/activate'.sub('{' + 'projectId' + '}', CGI.escape(project_id.to_s)).sub('{' + 'functionId' + '}', CGI.escape(function_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'FunctionResponse' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKeyAuth', 'ProjectBearerAuth'] = opts.merge( :operation => :"FunctionsApi.activate_function", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: FunctionsApi#activate_function\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#create_function(project_id, create_function_request, opts = {}) ⇒ FunctionResponse
Create function Create a new serverless function. Trigger types: http, document, file, webhook, wallet, cron, messaging. Sandbox utilities available: db, files, messaging, wallet, utils, env, console.
97 98 99 100 |
# File 'lib/mudbase/api/functions_api.rb', line 97 def create_function(project_id, create_function_request, opts = {}) data, _status_code, _headers = create_function_with_http_info(project_id, create_function_request, opts) data end |
#create_function_with_http_info(project_id, create_function_request, opts = {}) ⇒ Array<(FunctionResponse, Integer, Hash)>
Create function Create a new serverless function. Trigger types: http, document, file, webhook, wallet, cron, messaging. Sandbox utilities available: db, files, messaging, wallet, utils, env, console.
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 |
# File 'lib/mudbase/api/functions_api.rb', line 108 def create_function_with_http_info(project_id, create_function_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FunctionsApi.create_function ...' end # verify the required parameter 'project_id' is set if @api_client.config.client_side_validation && project_id.nil? fail ArgumentError, "Missing the required parameter 'project_id' when calling FunctionsApi.create_function" end # verify the required parameter 'create_function_request' is set if @api_client.config.client_side_validation && create_function_request.nil? fail ArgumentError, "Missing the required parameter 'create_function_request' when calling FunctionsApi.create_function" end # resource path local_var_path = '/api/functions/projects/{projectId}/functions'.sub('{' + 'projectId' + '}', CGI.escape(project_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(create_function_request) # return_type return_type = opts[:debug_return_type] || 'FunctionResponse' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKeyAuth', 'ProjectBearerAuth'] = opts.merge( :operation => :"FunctionsApi.create_function", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: FunctionsApi#create_function\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#deactivate_function(project_id, function_id, opts = {}) ⇒ FunctionResponse
Deactivate function Deactivate a function. Deactivated functions will not be triggered.
171 172 173 174 |
# File 'lib/mudbase/api/functions_api.rb', line 171 def deactivate_function(project_id, function_id, opts = {}) data, _status_code, _headers = deactivate_function_with_http_info(project_id, function_id, opts) data end |
#deactivate_function_with_http_info(project_id, function_id, opts = {}) ⇒ Array<(FunctionResponse, Integer, Hash)>
Deactivate function Deactivate a function. Deactivated functions will not be triggered.
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 |
# File 'lib/mudbase/api/functions_api.rb', line 182 def deactivate_function_with_http_info(project_id, function_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FunctionsApi.deactivate_function ...' end # verify the required parameter 'project_id' is set if @api_client.config.client_side_validation && project_id.nil? fail ArgumentError, "Missing the required parameter 'project_id' when calling FunctionsApi.deactivate_function" end # verify the required parameter 'function_id' is set if @api_client.config.client_side_validation && function_id.nil? fail ArgumentError, "Missing the required parameter 'function_id' when calling FunctionsApi.deactivate_function" end # resource path local_var_path = '/api/functions/projects/{projectId}/functions/{functionId}/deactivate'.sub('{' + 'projectId' + '}', CGI.escape(project_id.to_s)).sub('{' + 'functionId' + '}', CGI.escape(function_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'FunctionResponse' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKeyAuth', 'ProjectBearerAuth'] = opts.merge( :operation => :"FunctionsApi.deactivate_function", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: FunctionsApi#deactivate_function\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#delete_function(project_id, function_id, opts = {}) ⇒ DeleteFunction200Response
Delete function Delete a function permanently. This is a destructive operation.
240 241 242 243 |
# File 'lib/mudbase/api/functions_api.rb', line 240 def delete_function(project_id, function_id, opts = {}) data, _status_code, _headers = delete_function_with_http_info(project_id, function_id, opts) data end |
#delete_function_with_http_info(project_id, function_id, opts = {}) ⇒ Array<(DeleteFunction200Response, Integer, Hash)>
Delete function Delete a function permanently. This is a destructive operation.
251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 |
# File 'lib/mudbase/api/functions_api.rb', line 251 def delete_function_with_http_info(project_id, function_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FunctionsApi.delete_function ...' end # verify the required parameter 'project_id' is set if @api_client.config.client_side_validation && project_id.nil? fail ArgumentError, "Missing the required parameter 'project_id' when calling FunctionsApi.delete_function" end # verify the required parameter 'function_id' is set if @api_client.config.client_side_validation && function_id.nil? fail ArgumentError, "Missing the required parameter 'function_id' when calling FunctionsApi.delete_function" end # resource path local_var_path = '/api/functions/projects/{projectId}/functions/{functionId}'.sub('{' + 'projectId' + '}', CGI.escape(project_id.to_s)).sub('{' + 'functionId' + '}', CGI.escape(function_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'DeleteFunction200Response' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKeyAuth', 'ProjectBearerAuth'] = opts.merge( :operation => :"FunctionsApi.delete_function", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: FunctionsApi#delete_function\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#execute_function(project_id, function_id, opts = {}) ⇒ FunctionExecutionResponse
Execute function Manually execute a function with custom payload. Payload is merged with auto-injected trigger context. Rate limited (data mutation rate limiter). Enforces maxExecutionsPerMinute/maxExecutionsPerHour.
310 311 312 313 |
# File 'lib/mudbase/api/functions_api.rb', line 310 def execute_function(project_id, function_id, opts = {}) data, _status_code, _headers = execute_function_with_http_info(project_id, function_id, opts) data end |
#execute_function_with_http_info(project_id, function_id, opts = {}) ⇒ Array<(FunctionExecutionResponse, Integer, Hash)>
Execute function Manually execute a function with custom payload. Payload is merged with auto-injected trigger context. Rate limited (data mutation rate limiter). Enforces maxExecutionsPerMinute/maxExecutionsPerHour.
322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 |
# File 'lib/mudbase/api/functions_api.rb', line 322 def execute_function_with_http_info(project_id, function_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FunctionsApi.execute_function ...' end # verify the required parameter 'project_id' is set if @api_client.config.client_side_validation && project_id.nil? fail ArgumentError, "Missing the required parameter 'project_id' when calling FunctionsApi.execute_function" end # verify the required parameter 'function_id' is set if @api_client.config.client_side_validation && function_id.nil? fail ArgumentError, "Missing the required parameter 'function_id' when calling FunctionsApi.execute_function" end # resource path local_var_path = '/api/functions/projects/{projectId}/functions/{functionId}/execute'.sub('{' + 'projectId' + '}', CGI.escape(project_id.to_s)).sub('{' + 'functionId' + '}', CGI.escape(function_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'execute_function_request']) # return_type return_type = opts[:debug_return_type] || 'FunctionExecutionResponse' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKeyAuth', 'ProjectBearerAuth'] = opts.merge( :operation => :"FunctionsApi.execute_function", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: FunctionsApi#execute_function\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_function(project_id, function_id, opts = {}) ⇒ FunctionResponse
Get function Get function details by ID including createdBy/updatedBy.
385 386 387 388 |
# File 'lib/mudbase/api/functions_api.rb', line 385 def get_function(project_id, function_id, opts = {}) data, _status_code, _headers = get_function_with_http_info(project_id, function_id, opts) data end |
#get_function_logs(project_id, function_id, opts = {}) ⇒ FunctionLogsResponse
Get function execution logs Get execution logs with pagination. Includes stats (totalExecutions, successful, failed, successRate, avgExecutionTime, lastRun).
456 457 458 459 |
# File 'lib/mudbase/api/functions_api.rb', line 456 def get_function_logs(project_id, function_id, opts = {}) data, _status_code, _headers = get_function_logs_with_http_info(project_id, function_id, opts) data end |
#get_function_logs_with_http_info(project_id, function_id, opts = {}) ⇒ Array<(FunctionLogsResponse, Integer, Hash)>
Get function execution logs Get execution logs with pagination. Includes stats (totalExecutions, successful, failed, successRate, avgExecutionTime, lastRun).
469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 |
# File 'lib/mudbase/api/functions_api.rb', line 469 def get_function_logs_with_http_info(project_id, function_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FunctionsApi.get_function_logs ...' end # verify the required parameter 'project_id' is set if @api_client.config.client_side_validation && project_id.nil? fail ArgumentError, "Missing the required parameter 'project_id' when calling FunctionsApi.get_function_logs" end # verify the required parameter 'function_id' is set if @api_client.config.client_side_validation && function_id.nil? fail ArgumentError, "Missing the required parameter 'function_id' when calling FunctionsApi.get_function_logs" end # resource path local_var_path = '/api/functions/projects/{projectId}/functions/{functionId}/logs'.sub('{' + 'projectId' + '}', CGI.escape(project_id.to_s)).sub('{' + 'functionId' + '}', CGI.escape(function_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'FunctionLogsResponse' # auth_names auth_names = opts[:debug_auth_names] || ['ProjectBearerAuth'] = opts.merge( :operation => :"FunctionsApi.get_function_logs", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: FunctionsApi#get_function_logs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_function_versions(project_id, function_id, opts = {}) ⇒ GetFunctionVersions200Response
Get function versions List all code versions for a function. Used for rollback.
529 530 531 532 |
# File 'lib/mudbase/api/functions_api.rb', line 529 def get_function_versions(project_id, function_id, opts = {}) data, _status_code, _headers = get_function_versions_with_http_info(project_id, function_id, opts) data end |
#get_function_versions_with_http_info(project_id, function_id, opts = {}) ⇒ Array<(GetFunctionVersions200Response, Integer, Hash)>
Get function versions List all code versions for a function. Used for rollback.
540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 |
# File 'lib/mudbase/api/functions_api.rb', line 540 def get_function_versions_with_http_info(project_id, function_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FunctionsApi.get_function_versions ...' end # verify the required parameter 'project_id' is set if @api_client.config.client_side_validation && project_id.nil? fail ArgumentError, "Missing the required parameter 'project_id' when calling FunctionsApi.get_function_versions" end # verify the required parameter 'function_id' is set if @api_client.config.client_side_validation && function_id.nil? fail ArgumentError, "Missing the required parameter 'function_id' when calling FunctionsApi.get_function_versions" end # resource path local_var_path = '/api/functions/projects/{projectId}/functions/{functionId}/versions'.sub('{' + 'projectId' + '}', CGI.escape(project_id.to_s)).sub('{' + 'functionId' + '}', CGI.escape(function_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'GetFunctionVersions200Response' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKeyAuth', 'ProjectBearerAuth'] = opts.merge( :operation => :"FunctionsApi.get_function_versions", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: FunctionsApi#get_function_versions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_function_with_http_info(project_id, function_id, opts = {}) ⇒ Array<(FunctionResponse, Integer, Hash)>
Get function Get function details by ID including createdBy/updatedBy.
396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 |
# File 'lib/mudbase/api/functions_api.rb', line 396 def get_function_with_http_info(project_id, function_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FunctionsApi.get_function ...' end # verify the required parameter 'project_id' is set if @api_client.config.client_side_validation && project_id.nil? fail ArgumentError, "Missing the required parameter 'project_id' when calling FunctionsApi.get_function" end # verify the required parameter 'function_id' is set if @api_client.config.client_side_validation && function_id.nil? fail ArgumentError, "Missing the required parameter 'function_id' when calling FunctionsApi.get_function" end # resource path local_var_path = '/api/functions/projects/{projectId}/functions/{functionId}'.sub('{' + 'projectId' + '}', CGI.escape(project_id.to_s)).sub('{' + 'functionId' + '}', CGI.escape(function_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'FunctionResponse' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKeyAuth', 'ProjectBearerAuth'] = opts.merge( :operation => :"FunctionsApi.get_function", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: FunctionsApi#get_function\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_functions(project_id, opts = {}) ⇒ FunctionListResponse
List functions List serverless functions in a project with optional search and filters. Supports trigger types: http, event, document, file, webhook, wallet, cron, messaging.
602 603 604 605 |
# File 'lib/mudbase/api/functions_api.rb', line 602 def list_functions(project_id, opts = {}) data, _status_code, _headers = list_functions_with_http_info(project_id, opts) data end |
#list_functions_with_http_info(project_id, opts = {}) ⇒ Array<(FunctionListResponse, Integer, Hash)>
List functions List serverless functions in a project with optional search and filters. Supports trigger types: http, event, document, file, webhook, wallet, cron, messaging.
617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 |
# File 'lib/mudbase/api/functions_api.rb', line 617 def list_functions_with_http_info(project_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FunctionsApi.list_functions ...' end # verify the required parameter 'project_id' is set if @api_client.config.client_side_validation && project_id.nil? fail ArgumentError, "Missing the required parameter 'project_id' when calling FunctionsApi.list_functions" end allowable_values = ["http", "event", "document", "file", "webhook", "wallet", "cron", "messaging"] if @api_client.config.client_side_validation && opts[:'trigger_type'] && !allowable_values.include?(opts[:'trigger_type']) fail ArgumentError, "invalid value for \"trigger_type\", must be one of #{allowable_values}" end # resource path local_var_path = '/api/functions/projects/{projectId}/functions'.sub('{' + 'projectId' + '}', CGI.escape(project_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil? query_params[:'triggerType'] = opts[:'trigger_type'] if !opts[:'trigger_type'].nil? query_params[:'isActive'] = opts[:'is_active'] if !opts[:'is_active'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'FunctionListResponse' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKeyAuth', 'ProjectBearerAuth'] = opts.merge( :operation => :"FunctionsApi.list_functions", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: FunctionsApi#list_functions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#retry_function_execution(project_id, function_id, execution_index, opts = {}) ⇒ FunctionExecutionResponse
Retry failed execution Retry a failed execution by its index (0-based) in the logs. Cannot retry successful executions.
681 682 683 684 |
# File 'lib/mudbase/api/functions_api.rb', line 681 def retry_function_execution(project_id, function_id, execution_index, opts = {}) data, _status_code, _headers = retry_function_execution_with_http_info(project_id, function_id, execution_index, opts) data end |
#retry_function_execution_with_http_info(project_id, function_id, execution_index, opts = {}) ⇒ Array<(FunctionExecutionResponse, Integer, Hash)>
Retry failed execution Retry a failed execution by its index (0-based) in the logs. Cannot retry successful executions.
693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 |
# File 'lib/mudbase/api/functions_api.rb', line 693 def retry_function_execution_with_http_info(project_id, function_id, execution_index, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FunctionsApi.retry_function_execution ...' end # verify the required parameter 'project_id' is set if @api_client.config.client_side_validation && project_id.nil? fail ArgumentError, "Missing the required parameter 'project_id' when calling FunctionsApi.retry_function_execution" end # verify the required parameter 'function_id' is set if @api_client.config.client_side_validation && function_id.nil? fail ArgumentError, "Missing the required parameter 'function_id' when calling FunctionsApi.retry_function_execution" end # verify the required parameter 'execution_index' is set if @api_client.config.client_side_validation && execution_index.nil? fail ArgumentError, "Missing the required parameter 'execution_index' when calling FunctionsApi.retry_function_execution" end # resource path local_var_path = '/api/functions/projects/{projectId}/functions/{functionId}/retry/{executionIndex}'.sub('{' + 'projectId' + '}', CGI.escape(project_id.to_s)).sub('{' + 'functionId' + '}', CGI.escape(function_id.to_s)).sub('{' + 'executionIndex' + '}', CGI.escape(execution_index.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'FunctionExecutionResponse' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKeyAuth', 'ProjectBearerAuth'] = opts.merge( :operation => :"FunctionsApi.retry_function_execution", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: FunctionsApi#retry_function_execution\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#rollback_function(project_id, function_id, rollback_function_request, opts = {}) ⇒ FunctionResponse
Rollback to previous version Rollback function code to a previous version. Version number is required.
756 757 758 759 |
# File 'lib/mudbase/api/functions_api.rb', line 756 def rollback_function(project_id, function_id, rollback_function_request, opts = {}) data, _status_code, _headers = rollback_function_with_http_info(project_id, function_id, rollback_function_request, opts) data end |
#rollback_function_with_http_info(project_id, function_id, rollback_function_request, opts = {}) ⇒ Array<(FunctionResponse, Integer, Hash)>
Rollback to previous version Rollback function code to a previous version. Version number is required.
768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 |
# File 'lib/mudbase/api/functions_api.rb', line 768 def rollback_function_with_http_info(project_id, function_id, rollback_function_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FunctionsApi.rollback_function ...' end # verify the required parameter 'project_id' is set if @api_client.config.client_side_validation && project_id.nil? fail ArgumentError, "Missing the required parameter 'project_id' when calling FunctionsApi.rollback_function" end # verify the required parameter 'function_id' is set if @api_client.config.client_side_validation && function_id.nil? fail ArgumentError, "Missing the required parameter 'function_id' when calling FunctionsApi.rollback_function" end # verify the required parameter 'rollback_function_request' is set if @api_client.config.client_side_validation && rollback_function_request.nil? fail ArgumentError, "Missing the required parameter 'rollback_function_request' when calling FunctionsApi.rollback_function" end # resource path local_var_path = '/api/functions/projects/{projectId}/functions/{functionId}/rollback'.sub('{' + 'projectId' + '}', CGI.escape(project_id.to_s)).sub('{' + 'functionId' + '}', CGI.escape(function_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(rollback_function_request) # return_type return_type = opts[:debug_return_type] || 'FunctionResponse' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKeyAuth', 'ProjectBearerAuth'] = opts.merge( :operation => :"FunctionsApi.rollback_function", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: FunctionsApi#rollback_function\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#simulate_function_trigger(project_id, function_id, opts = {}) ⇒ FunctionExecutionResponse
Simulate trigger Test a function with simulated trigger context. Use to verify document, file, webhook, wallet, or cron payloads. Executes the function with the provided eventContext merged into the payload.
836 837 838 839 |
# File 'lib/mudbase/api/functions_api.rb', line 836 def simulate_function_trigger(project_id, function_id, opts = {}) data, _status_code, _headers = simulate_function_trigger_with_http_info(project_id, function_id, opts) data end |
#simulate_function_trigger_with_http_info(project_id, function_id, opts = {}) ⇒ Array<(FunctionExecutionResponse, Integer, Hash)>
Simulate trigger Test a function with simulated trigger context. Use to verify document, file, webhook, wallet, or cron payloads. Executes the function with the provided eventContext merged into the payload.
848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 |
# File 'lib/mudbase/api/functions_api.rb', line 848 def simulate_function_trigger_with_http_info(project_id, function_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FunctionsApi.simulate_function_trigger ...' end # verify the required parameter 'project_id' is set if @api_client.config.client_side_validation && project_id.nil? fail ArgumentError, "Missing the required parameter 'project_id' when calling FunctionsApi.simulate_function_trigger" end # verify the required parameter 'function_id' is set if @api_client.config.client_side_validation && function_id.nil? fail ArgumentError, "Missing the required parameter 'function_id' when calling FunctionsApi.simulate_function_trigger" end # resource path local_var_path = '/api/functions/projects/{projectId}/functions/{functionId}/simulate'.sub('{' + 'projectId' + '}', CGI.escape(project_id.to_s)).sub('{' + 'functionId' + '}', CGI.escape(function_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'simulate_function_trigger_request']) # return_type return_type = opts[:debug_return_type] || 'FunctionExecutionResponse' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKeyAuth', 'ProjectBearerAuth'] = opts.merge( :operation => :"FunctionsApi.simulate_function_trigger", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: FunctionsApi#simulate_function_trigger\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#trigger_function_webhook(project_id, opts = {}) ⇒ TriggerFunctionWebhook200Response
Trigger webhook functions Public endpoint for external services to trigger functions with ‘trigger.type: webhook`. No authentication required. Optionally verify using X-Webhook-Secret header (configure per project or via FUNCTION_WEBHOOK_SECRET). Rate limited to 30 requests per 15 minutes per IP.
912 913 914 915 |
# File 'lib/mudbase/api/functions_api.rb', line 912 def trigger_function_webhook(project_id, opts = {}) data, _status_code, _headers = trigger_function_webhook_with_http_info(project_id, opts) data end |
#trigger_function_webhook_with_http_info(project_id, opts = {}) ⇒ Array<(TriggerFunctionWebhook200Response, Integer, Hash)>
Trigger webhook functions Public endpoint for external services to trigger functions with `trigger.type: webhook`. No authentication required. Optionally verify using `X-Webhook-Secret` header (configure per project or via FUNCTION_WEBHOOK_SECRET). Rate limited to 30 requests per 15 minutes per IP.
924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 |
# File 'lib/mudbase/api/functions_api.rb', line 924 def trigger_function_webhook_with_http_info(project_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FunctionsApi.trigger_function_webhook ...' end # verify the required parameter 'project_id' is set if @api_client.config.client_side_validation && project_id.nil? fail ArgumentError, "Missing the required parameter 'project_id' when calling FunctionsApi.trigger_function_webhook" end # resource path local_var_path = '/api/functions/webhook/{projectId}'.sub('{' + 'projectId' + '}', CGI.escape(project_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded', 'text/plain']) if !content_type.nil? header_params['Content-Type'] = content_type end header_params[:'X-Webhook-Secret'] = opts[:'x_webhook_secret'] if !opts[:'x_webhook_secret'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body']) # return_type return_type = opts[:debug_return_type] || 'TriggerFunctionWebhook200Response' # auth_names auth_names = opts[:debug_auth_names] || [] = opts.merge( :operation => :"FunctionsApi.trigger_function_webhook", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: FunctionsApi#trigger_function_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#update_function(project_id, function_id, opts = {}) ⇒ FunctionResponse
Update function Update function configuration. Code changes are versioned automatically.
985 986 987 988 |
# File 'lib/mudbase/api/functions_api.rb', line 985 def update_function(project_id, function_id, opts = {}) data, _status_code, _headers = update_function_with_http_info(project_id, function_id, opts) data end |
#update_function_with_http_info(project_id, function_id, opts = {}) ⇒ Array<(FunctionResponse, Integer, Hash)>
Update function Update function configuration. Code changes are versioned automatically.
997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 |
# File 'lib/mudbase/api/functions_api.rb', line 997 def update_function_with_http_info(project_id, function_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FunctionsApi.update_function ...' end # verify the required parameter 'project_id' is set if @api_client.config.client_side_validation && project_id.nil? fail ArgumentError, "Missing the required parameter 'project_id' when calling FunctionsApi.update_function" end # verify the required parameter 'function_id' is set if @api_client.config.client_side_validation && function_id.nil? fail ArgumentError, "Missing the required parameter 'function_id' when calling FunctionsApi.update_function" end # resource path local_var_path = '/api/functions/projects/{projectId}/functions/{functionId}'.sub('{' + 'projectId' + '}', CGI.escape(project_id.to_s)).sub('{' + 'functionId' + '}', CGI.escape(function_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'update_function_request']) # return_type return_type = opts[:debug_return_type] || 'FunctionResponse' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKeyAuth', 'ProjectBearerAuth'] = opts.merge( :operation => :"FunctionsApi.update_function", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PUT, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: FunctionsApi#update_function\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |