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.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +69 -0
  3. data/lib/volcano/client.rb +2 -1
  4. data/lib/volcano/durable.rb +136 -0
  5. data/lib/volcano/durable_models.rb +143 -0
  6. data/lib/volcano/generated/lib/volcano-generated/api/databases_api.rb +2 -2
  7. data/lib/volcano/generated/lib/volcano-generated/api/durable_functions_api.rb +1239 -0
  8. data/lib/volcano/generated/lib/volcano-generated/api/frontends_api.rb +2 -2
  9. data/lib/volcano/generated/lib/volcano-generated/api/functions_api.rb +18 -6
  10. data/lib/volcano/generated/lib/volcano-generated/api/o_auth_authentication_api.rb +2 -2
  11. data/lib/volcano/generated/lib/volcano-generated/api/projects_api.rb +76 -2
  12. data/lib/volcano/generated/lib/volcano-generated/models/create_database_request.rb +6 -8
  13. data/lib/volcano/generated/lib/volcano-generated/models/create_variable_request.rb +11 -1
  14. data/lib/volcano/generated/lib/volcano-generated/models/durable_execution.rb +358 -0
  15. data/lib/volcano/generated/lib/volcano-generated/models/durable_execution_error.rb +157 -0
  16. data/lib/volcano/generated/lib/volcano-generated/models/durable_execution_status.rb +45 -0
  17. data/lib/volcano/generated/lib/volcano-generated/models/durable_function.rb +479 -0
  18. data/lib/volcano/generated/lib/volcano-generated/models/durable_function_config.rb +193 -0
  19. data/lib/volcano/generated/lib/volcano-generated/models/function_kind.rb +40 -0
  20. data/lib/volcano/generated/lib/volcano-generated/models/function_runtime_option.rb +28 -1
  21. data/lib/volcano/generated/lib/volcano-generated/models/function_scheduler.rb +11 -1
  22. data/lib/volcano/generated/lib/volcano-generated/models/list_database_regions200_response_inner.rb +1 -1
  23. data/lib/volcano/generated/lib/volcano-generated/models/metric_usage_data.rb +1 -1
  24. data/lib/volcano/generated/lib/volcano-generated/models/paginated_durable_executions.rb +274 -0
  25. data/lib/volcano/generated/lib/volcano-generated/models/paginated_durable_functions.rb +274 -0
  26. data/lib/volcano/generated/lib/volcano-generated/models/project_config.rb +23 -1
  27. data/lib/volcano/generated/lib/volcano-generated/models/project_config_function.rb +47 -2
  28. data/lib/volcano/generated/lib/volcano-generated/models/project_config_variable.rb +11 -1
  29. data/lib/volcano/generated/lib/volcano-generated/models/project_deployment_resource.rb +14 -4
  30. data/lib/volcano/generated/lib/volcano-generated/models/project_health_resource.rb +14 -4
  31. data/lib/volcano/generated/lib/volcano-generated/models/replace_shared_variables_request.rb +237 -0
  32. data/lib/volcano/generated/lib/volcano-generated/models/update_variable_request.rb +11 -1
  33. data/lib/volcano/generated/lib/volcano-generated/models/variable.rb +11 -1
  34. data/lib/volcano/generated/lib/volcano-generated.rb +10 -0
  35. data/lib/volcano/generated_transport.rb +2 -1
  36. data/lib/volcano/generated_transport_durable.rb +50 -0
  37. data/lib/volcano/generated_transport_support.rb +1 -0
  38. data/lib/volcano/version.rb +1 -1
  39. data/lib/volcano.rb +2 -0
  40. metadata +14 -1
@@ -20,7 +20,7 @@ module Volcano::Generated
20
20
  @api_client = api_client
21
21
  end
22
22
  # Create a new frontend deployment
23
- # Creates and deploys a frontend for the project. If a frontend with the same name already exists in the project, this operation updates that frontend using the uploaded archive and starts a new deployment. A deployment that starts immediately returns `status: provisioning`, then transitions to `active`, `degraded`, or `failed`. If another deployment is running, the response preserves the frontend's current status and exposes the queued deployment through `pending_deployment_id`. Existing frontend traffic continues to use an available runtime while the new deployment builds and provisions. Each deployment publishes its own static assets before the runtimes switch to its build, and the live build's assets keep serving until the new deployment is live, so a page loaded mid-deployment resolves its assets whichever build served it. A failed redeploy puts the runtimes back on the build they were running, leaves the frontend `active` on the previous deployment, and records the attempted deployment as failed. `degraded` means the runtime remains available but edge synchronization requires recovery; Volcano retries the edge step without rebuilding. Only one deployment may run for a given frontend, while independent frontends and projects can deploy concurrently. For monorepos, provide `app_root` as a relative path from the uploaded archive root to the Next.js app that should be built. Omit it for single-app archives. Supported frontend environments are Next.js 15.x and 16.x with Node.js 22.x or 24.x. The Node.js runtime is inferred from `package.json` `engines.node`; if omitted, Volcano uses Node.js 22.x. The selected Node.js family must also satisfy the installed Next.js package's `engines.node` constraint. Volcano tests Next 15.5.25 (`^18.18.0 || ^19.8.0 || >=20.0.0`) and Next 16.3.4 (`>=20.9.0`). Source archive size is enforced by the API with `SOURCE_ARCHIVE_SIZE_LIMIT_MB`; the CLI does not apply its own source archive size limit. After the final container images are built, the publish build enforces `LAMBDA_TARGET_CONTAINER_SIZE_LIMIT_MB` before pushing. This operation is limited by plan-based frontend deployment quotas (`FREE_FRONTEND_DEPLOYMENTS`, `PRO_FRONTEND_DEPLOYMENTS`). Each project can contain up to 10,000 frontends regardless of plan.
23
+ # Creates and deploys a frontend for the project. If a frontend with the same name already exists in the project, this operation updates that frontend using the uploaded archive and starts a new deployment. A deployment that starts immediately returns `status: provisioning`, then transitions to `active`, `degraded`, or `failed`. If another deployment is running, the response preserves the frontend's current status and exposes the queued deployment through `pending_deployment_id`. Existing frontend traffic continues to use an available runtime while the new deployment builds and provisions. Each deployment publishes its own static assets before the runtimes switch to its build, and the live build's assets keep serving until the new deployment is live, so a page loaded mid-deployment resolves its assets whichever build served it. A failed redeploy puts the runtimes back on the build they were running, leaves the frontend `active` on the previous deployment, and records the attempted deployment as failed. `degraded` means the runtime remains available but edge synchronization requires recovery; Volcano retries the edge step without rebuilding. Only one deployment may run for a given frontend, while independent frontends and projects can deploy concurrently. For monorepos, provide `app_root` as a relative path from the uploaded archive root to the Next.js app that should be built. Omit it for single-app archives. Supported frontend environments are Next.js 15.x and 16.x with Node.js 22.x or 24.x. The Node.js runtime is inferred from `package.json` `engines.node`; if omitted, Volcano uses Node.js 22.x. The selected Node.js family must also satisfy the installed Next.js package's `engines.node` constraint. Volcano tests Next 15.5.25 (`^18.18.0 || ^19.8.0 || >=20.0.0`) and Next 16.3.5 (`>=20.9.0`). Source archive size is enforced by the API with `SOURCE_ARCHIVE_SIZE_LIMIT_MB`; the CLI does not apply its own source archive size limit. After the final container images are built, the publish build enforces `LAMBDA_TARGET_CONTAINER_SIZE_LIMIT_MB` before pushing. This operation is limited by plan-based frontend deployment quotas (`FREE_FRONTEND_DEPLOYMENTS`, `PRO_FRONTEND_DEPLOYMENTS`). Each project can contain up to 10,000 frontends regardless of plan.
24
24
  # @param id [String] Project ID
25
25
  # @param name [String] DNS-safe frontend name
26
26
  # @param archive [File] ZIP or tar.gz archive of the frontend project directory or monorepo workspace root. The API enforces SOURCE_ARCHIVE_SIZE_LIMIT_MB and stores a normalized tar.gz archive.
@@ -34,7 +34,7 @@ module Volcano::Generated
34
34
  end
35
35
 
36
36
  # Create a new frontend deployment
37
- # Creates and deploys a frontend for the project. If a frontend with the same name already exists in the project, this operation updates that frontend using the uploaded archive and starts a new deployment. A deployment that starts immediately returns `status: provisioning`, then transitions to `active`, `degraded`, or `failed`. If another deployment is running, the response preserves the frontend's current status and exposes the queued deployment through `pending_deployment_id`. Existing frontend traffic continues to use an available runtime while the new deployment builds and provisions. Each deployment publishes its own static assets before the runtimes switch to its build, and the live build's assets keep serving until the new deployment is live, so a page loaded mid-deployment resolves its assets whichever build served it. A failed redeploy puts the runtimes back on the build they were running, leaves the frontend `active` on the previous deployment, and records the attempted deployment as failed. `degraded` means the runtime remains available but edge synchronization requires recovery; Volcano retries the edge step without rebuilding. Only one deployment may run for a given frontend, while independent frontends and projects can deploy concurrently. For monorepos, provide `app_root` as a relative path from the uploaded archive root to the Next.js app that should be built. Omit it for single-app archives. Supported frontend environments are Next.js 15.x and 16.x with Node.js 22.x or 24.x. The Node.js runtime is inferred from `package.json` `engines.node`; if omitted, Volcano uses Node.js 22.x. The selected Node.js family must also satisfy the installed Next.js package's `engines.node` constraint. Volcano tests Next 15.5.25 (`^18.18.0 || ^19.8.0 || >=20.0.0`) and Next 16.3.4 (`>=20.9.0`). Source archive size is enforced by the API with `SOURCE_ARCHIVE_SIZE_LIMIT_MB`; the CLI does not apply its own source archive size limit. After the final container images are built, the publish build enforces `LAMBDA_TARGET_CONTAINER_SIZE_LIMIT_MB` before pushing. This operation is limited by plan-based frontend deployment quotas (`FREE_FRONTEND_DEPLOYMENTS`, `PRO_FRONTEND_DEPLOYMENTS`). Each project can contain up to 10,000 frontends regardless of plan.
37
+ # Creates and deploys a frontend for the project. If a frontend with the same name already exists in the project, this operation updates that frontend using the uploaded archive and starts a new deployment. A deployment that starts immediately returns `status: provisioning`, then transitions to `active`, `degraded`, or `failed`. If another deployment is running, the response preserves the frontend's current status and exposes the queued deployment through `pending_deployment_id`. Existing frontend traffic continues to use an available runtime while the new deployment builds and provisions. Each deployment publishes its own static assets before the runtimes switch to its build, and the live build's assets keep serving until the new deployment is live, so a page loaded mid-deployment resolves its assets whichever build served it. A failed redeploy puts the runtimes back on the build they were running, leaves the frontend `active` on the previous deployment, and records the attempted deployment as failed. `degraded` means the runtime remains available but edge synchronization requires recovery; Volcano retries the edge step without rebuilding. Only one deployment may run for a given frontend, while independent frontends and projects can deploy concurrently. For monorepos, provide `app_root` as a relative path from the uploaded archive root to the Next.js app that should be built. Omit it for single-app archives. Supported frontend environments are Next.js 15.x and 16.x with Node.js 22.x or 24.x. The Node.js runtime is inferred from `package.json` `engines.node`; if omitted, Volcano uses Node.js 22.x. The selected Node.js family must also satisfy the installed Next.js package's `engines.node` constraint. Volcano tests Next 15.5.25 (`^18.18.0 || ^19.8.0 || >=20.0.0`) and Next 16.3.5 (`>=20.9.0`). Source archive size is enforced by the API with `SOURCE_ARCHIVE_SIZE_LIMIT_MB`; the CLI does not apply its own source archive size limit. After the final container images are built, the publish build enforces `LAMBDA_TARGET_CONTAINER_SIZE_LIMIT_MB` before pushing. This operation is limited by plan-based frontend deployment quotas (`FREE_FRONTEND_DEPLOYMENTS`, `PRO_FRONTEND_DEPLOYMENTS`). Each project can contain up to 10,000 frontends regardless of plan.
38
38
  # @param id [String] Project ID
39
39
  # @param name [String] DNS-safe frontend name
40
40
  # @param archive [File] ZIP or tar.gz archive of the frontend project directory or monorepo workspace root. The API enforces SOURCE_ARCHIVE_SIZE_LIMIT_MB and stores a normalized tar.gz archive.
@@ -27,10 +27,12 @@ module Volcano::Generated
27
27
  # @param runtime [String] Runtime environment. Required. - Node.js: nodejs22.x, nodejs24.x - Python: python3.10, python3.11, python3.12, python3.13, python3.14 - Ruby: ruby3.3, ruby3.4, ruby4.0
28
28
  # @param [Hash] opts the optional parameters
29
29
  # @option opts [String] :handler The name of the function to invoke. Defaults to \\\"handler\\\" if not specified. Your code must export/define a function with this name: - Node.js: exports.handler (in index.js) - Python: def handler() (in main.py) - Ruby: def handler() (in main.rb) (default to 'handler')
30
- # @option opts [Boolean] :is_public Whether the function can be reached through public invocation ingress. (default to false)
30
+ # @option opts [Boolean] :is_public Whether the function can be reached through public invocation ingress. Omit it to keep the function's current visibility; a new function starts private.
31
31
  # @option opts [FunctionInvocationMode] :invocation_mode
32
32
  # @option opts [FunctionHTTPAuthMode] :http_auth_mode
33
33
  # @option opts [String] :openapi_spec JSON-encoded OpenAPI 3.0 or 3.1 metadata for an HTTP-mode function.
34
+ # @option opts [String] :variable_scope Which project variables this function receives. `all` (the default) gives it only project variables marked `shared: true`; `scoped` gives it only the variables it selects. Omitting this leaves an existing function's scope unchanged.
35
+ # @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.
34
36
  # @return [Function]
35
37
  def create_function(id, name, code, runtime, opts = {})
36
38
  data, _status_code, _headers = create_function_with_http_info(id, name, code, runtime, opts)
@@ -45,10 +47,12 @@ module Volcano::Generated
45
47
  # @param runtime [String] Runtime environment. Required. - Node.js: nodejs22.x, nodejs24.x - Python: python3.10, python3.11, python3.12, python3.13, python3.14 - Ruby: ruby3.3, ruby3.4, ruby4.0
46
48
  # @param [Hash] opts the optional parameters
47
49
  # @option opts [String] :handler The name of the function to invoke. Defaults to \\\"handler\\\" if not specified. Your code must export/define a function with this name: - Node.js: exports.handler (in index.js) - Python: def handler() (in main.py) - Ruby: def handler() (in main.rb) (default to 'handler')
48
- # @option opts [Boolean] :is_public Whether the function can be reached through public invocation ingress. (default to false)
50
+ # @option opts [Boolean] :is_public Whether the function can be reached through public invocation ingress. Omit it to keep the function's current visibility; a new function starts private.
49
51
  # @option opts [FunctionInvocationMode] :invocation_mode
50
52
  # @option opts [FunctionHTTPAuthMode] :http_auth_mode
51
53
  # @option opts [String] :openapi_spec JSON-encoded OpenAPI 3.0 or 3.1 metadata for an HTTP-mode function.
54
+ # @option opts [String] :variable_scope Which project variables this function receives. `all` (the default) gives it only project variables marked `shared: true`; `scoped` gives it only the variables it selects. Omitting this leaves an existing function's scope unchanged.
55
+ # @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.
52
56
  # @return [Array<(Function, Integer, Hash)>] Function data, response status code and response headers
53
57
  def create_function_with_http_info(id, name, code, runtime, opts = {})
54
58
  if @api_client.config.debugging
@@ -84,6 +88,10 @@ module Volcano::Generated
84
88
  if @api_client.config.client_side_validation && !allowable_values.include?(runtime)
85
89
  fail ArgumentError, "invalid value for \"runtime\", must be one of #{allowable_values}"
86
90
  end
91
+ allowable_values = ["all", "scoped"]
92
+ if @api_client.config.client_side_validation && opts[:'variable_scope'] && !allowable_values.include?(opts[:'variable_scope'])
93
+ fail ArgumentError, "invalid value for \"variable_scope\", must be one of #{allowable_values}"
94
+ end
87
95
  # resource path
88
96
  local_var_path = '/projects/{id}/functions'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
89
97
 
@@ -110,6 +118,8 @@ module Volcano::Generated
110
118
  form_params['invocation_mode'] = opts[:'invocation_mode'] if !opts[:'invocation_mode'].nil?
111
119
  form_params['http_auth_mode'] = opts[:'http_auth_mode'] if !opts[:'http_auth_mode'].nil?
112
120
  form_params['openapi_spec'] = opts[:'openapi_spec'] if !opts[:'openapi_spec'].nil?
121
+ form_params['variable_scope'] = opts[:'variable_scope'] if !opts[:'variable_scope'].nil?
122
+ form_params['variables'] = opts[:'variables'] if !opts[:'variables'].nil?
113
123
 
114
124
  # http body (model)
115
125
  post_body = opts[:debug_body]
@@ -220,7 +230,7 @@ module Volcano::Generated
220
230
  # Deploy multiple functions in one request
221
231
  # Upload multiple function source archives in one multipart request. Each archive should contain source files plus dependency manifests/lockfiles, not installed dependency directories. ZIP and tar.gz uploads are accepted and normalized to tar.gz before storage. The API enforces `SOURCE_ARCHIVE_SIZE_LIMIT_MB` for each uploaded and normalized source archive. The server records a shared deployment batch ID for the resulting function deployments. Each function deployment runs its own compile/publish workflow concurrently, and each publish build enforces `LAMBDA_TARGET_CONTAINER_SIZE_LIMIT_MB` for the final container image. One batch request can include up to 100 functions. Submit multiple batch requests for larger projects. If one function fails before its workflow starts, already-started function deployments are left running and the failed function is reported in the `failed` array. Failed new functions are deleted; failed updates are rolled back to their previous metadata/status where possible.
222
232
  # @param id [String] Project ID
223
- # @param functions [String] JSON array of functions with &#x60;name&#x60;, &#x60;runtime&#x60;, optional &#x60;handler&#x60;, and &#x60;file_field&#x60;. Each &#x60;file_field&#x60; must name a multipart file field containing that function&#39;s ZIP or tar.gz source bundle.
233
+ # @param functions [String] JSON array of functions with &#x60;name&#x60;, &#x60;runtime&#x60;, optional &#x60;handler&#x60;, and &#x60;file_field&#x60;. Each &#x60;file_field&#x60; must name a multipart file field containing that function&#39;s ZIP or tar.gz source bundle. Each entry may also declare &#x60;variable_scope&#x60; (&#x60;all&#x60; or &#x60;scoped&#x60;) and &#x60;variables&#x60; (an array of project variable names). Omitting them leaves the function&#39;s stored declaration unchanged. Volcano detects direct environment references in the uploaded source code and keeps them separate from the declared names: detected names are not written back to the declaration and do not appear in a config export. A scoped function receives its declared names plus the detected ones the project defines; a detected name the project does not define is ignored, since such a reference is often optional. Detection reads code only, so a name appearing solely in a comment or in an unrelated string is not a reference. Declare a name when the function reads it through a computed key, or when it must not deploy without the variable. The request is rejected with 400 before anything is deployed if a scoped function declares a variable the project does not define, or if the resulting environment exceeds 4096 bytes.
224
234
  # @param [Hash] opts the optional parameters
225
235
  # @option opts [File] :code_0 Function ZIP or tar.gz archive referenced by the first manifest entry&#39;s &#x60;file_field&#x60;; additional code_N file fields may be included. Each archive is subject to SOURCE_ARCHIVE_SIZE_LIMIT_MB.
226
236
  # @return [BatchFunctionDeployResponse]
@@ -232,7 +242,7 @@ module Volcano::Generated
232
242
  # Deploy multiple functions in one request
233
243
  # Upload multiple function source archives in one multipart request. Each archive should contain source files plus dependency manifests/lockfiles, not installed dependency directories. ZIP and tar.gz uploads are accepted and normalized to tar.gz before storage. The API enforces &#x60;SOURCE_ARCHIVE_SIZE_LIMIT_MB&#x60; for each uploaded and normalized source archive. The server records a shared deployment batch ID for the resulting function deployments. Each function deployment runs its own compile/publish workflow concurrently, and each publish build enforces &#x60;LAMBDA_TARGET_CONTAINER_SIZE_LIMIT_MB&#x60; for the final container image. One batch request can include up to 100 functions. Submit multiple batch requests for larger projects. If one function fails before its workflow starts, already-started function deployments are left running and the failed function is reported in the &#x60;failed&#x60; array. Failed new functions are deleted; failed updates are rolled back to their previous metadata/status where possible.
234
244
  # @param id [String] Project ID
235
- # @param functions [String] JSON array of functions with &#x60;name&#x60;, &#x60;runtime&#x60;, optional &#x60;handler&#x60;, and &#x60;file_field&#x60;. Each &#x60;file_field&#x60; must name a multipart file field containing that function&#39;s ZIP or tar.gz source bundle.
245
+ # @param functions [String] JSON array of functions with &#x60;name&#x60;, &#x60;runtime&#x60;, optional &#x60;handler&#x60;, and &#x60;file_field&#x60;. Each &#x60;file_field&#x60; must name a multipart file field containing that function&#39;s ZIP or tar.gz source bundle. Each entry may also declare &#x60;variable_scope&#x60; (&#x60;all&#x60; or &#x60;scoped&#x60;) and &#x60;variables&#x60; (an array of project variable names). Omitting them leaves the function&#39;s stored declaration unchanged. Volcano detects direct environment references in the uploaded source code and keeps them separate from the declared names: detected names are not written back to the declaration and do not appear in a config export. A scoped function receives its declared names plus the detected ones the project defines; a detected name the project does not define is ignored, since such a reference is often optional. Detection reads code only, so a name appearing solely in a comment or in an unrelated string is not a reference. Declare a name when the function reads it through a computed key, or when it must not deploy without the variable. The request is rejected with 400 before anything is deployed if a scoped function declares a variable the project does not define, or if the resulting environment exceeds 4096 bytes.
236
246
  # @param [Hash] opts the optional parameters
237
247
  # @option opts [File] :code_0 Function ZIP or tar.gz archive referenced by the first manifest entry&#39;s &#x60;file_field&#x60;; additional code_N file fields may be included. Each archive is subject to SOURCE_ARCHIVE_SIZE_LIMIT_MB.
238
248
  # @return [Array<(BatchFunctionDeployResponse, Integer, Hash)>] BatchFunctionDeployResponse data, response status code and response headers
@@ -405,6 +415,8 @@ module Volcano::Generated
405
415
 
406
416
  # header parameters
407
417
  header_params = opts[:header_params] || {}
418
+ # HTTP header 'Accept' (if needed)
419
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
408
420
 
409
421
  # form parameters
410
422
  form_params = opts[:form_params] || {}
@@ -576,7 +588,7 @@ module Volcano::Generated
576
588
  end
577
589
 
578
590
  # Invoke a function
579
- # Invoke a serverless function. **With Service Key** (admin/background operations): - Use for background jobs, webhooks, cron, admin operations - Function receives payload only (no user context) - Database queries bypass RLS (admin access) **With Auth User Token** (user-facing): - Use for user-initiated actions - Function receives payload + `__volcano_auth` context: ```javascript { user_id: \"uuid\", email: \"user@example.com\", project_id: \"uuid\", role: \"authenticated\" or \"anonymous\" } ``` - Database queries enforce RLS (user-scoped data) **With Anon Key** (public function only): - Requires anon key permission: `functions.invoke` - Function must have `is_public: true` - Function receives payload only (no `__volcano_auth`) **Transport and CORS:** - This operation is the authenticated direct RPC endpoint and always uses the POST `{payload: ...}` contract, including for functions whose DNS ingress is configured in HTTP mode. - The geo-routed DNS ingress is `https://{functionId}.functions.<domain>/`. - RPC-mode DNS ingress accepts POST at `/`. HTTP-mode DNS ingress accepts GET, HEAD, POST, PUT, PATCH, and DELETE at `/` and nested paths. - Direct and RPC-mode CORS preflight advertises `POST, OPTIONS`. HTTP-mode DNS preflight advertises `GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS`. - `http_auth_mode: none` applies only to public HTTP-mode DNS ingress; this direct operation always requires a Volcano credential.
591
+ # Invoke a serverless function. **With Service Key** (admin/background operations): - Use for background jobs, webhooks, cron, admin operations - Function receives payload only (no user context) - Database queries bypass RLS (admin access) **With Auth User Token** (user-facing): - Use for user-initiated actions - Function receives payload + `__volcano_auth` context: ```javascript { user_id: \"uuid\", email: \"user@example.com\", project_id: \"uuid\", role: \"authenticated\" or \"anonymous\" } ``` - Database queries enforce RLS (user-scoped data) **With Anon Key** (public function only): - Requires anon key permission: `functions.invoke` - Function must have `is_public: true` - Function receives payload only (no `__volcano_auth`) **Transport and CORS:** - This operation is the authenticated direct RPC endpoint and always uses the POST `{payload: ...}` contract, including for functions whose DNS ingress is configured in HTTP mode. - The geo-routed DNS ingress is `https://{functionId}.functions.<domain>/`. - RPC-mode DNS ingress accepts POST at `/`. HTTP-mode DNS ingress accepts GET, HEAD, POST, PUT, PATCH, and DELETE at `/` and nested paths. - Direct and RPC-mode CORS preflight advertises `POST, OPTIONS`. HTTP-mode DNS preflight advertises `GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS`. - `http_auth_mode: none` applies only to public HTTP-mode DNS ingress; this direct operation always requires a Volcano credential. **Durable functions are not invocable here.** A durable function's id answers 404, whatever its visibility, because a synchronous call would run it with no execution record, no idempotency and no concurrency accounting. Start one with `POST /durable-functions/{functionId}/executions`.
580
592
  # @param function_id [String] Function ID
581
593
  # @param function_invocation_request [FunctionInvocationRequest]
582
594
  # @param [Hash] opts the optional parameters
@@ -587,7 +599,7 @@ module Volcano::Generated
587
599
  end
588
600
 
589
601
  # Invoke a function
590
- # Invoke a serverless function. **With Service Key** (admin/background operations): - Use for background jobs, webhooks, cron, admin operations - Function receives payload only (no user context) - Database queries bypass RLS (admin access) **With Auth User Token** (user-facing): - Use for user-initiated actions - Function receives payload + &#x60;__volcano_auth&#x60; context: &#x60;&#x60;&#x60;javascript { user_id: \&quot;uuid\&quot;, email: \&quot;user@example.com\&quot;, project_id: \&quot;uuid\&quot;, role: \&quot;authenticated\&quot; or \&quot;anonymous\&quot; } &#x60;&#x60;&#x60; - Database queries enforce RLS (user-scoped data) **With Anon Key** (public function only): - Requires anon key permission: &#x60;functions.invoke&#x60; - Function must have &#x60;is_public: true&#x60; - Function receives payload only (no &#x60;__volcano_auth&#x60;) **Transport and CORS:** - This operation is the authenticated direct RPC endpoint and always uses the POST &#x60;{payload: ...}&#x60; contract, including for functions whose DNS ingress is configured in HTTP mode. - The geo-routed DNS ingress is &#x60;https://{functionId}.functions.&lt;domain&gt;/&#x60;. - RPC-mode DNS ingress accepts POST at &#x60;/&#x60;. HTTP-mode DNS ingress accepts GET, HEAD, POST, PUT, PATCH, and DELETE at &#x60;/&#x60; and nested paths. - Direct and RPC-mode CORS preflight advertises &#x60;POST, OPTIONS&#x60;. HTTP-mode DNS preflight advertises &#x60;GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS&#x60;. - &#x60;http_auth_mode: none&#x60; applies only to public HTTP-mode DNS ingress; this direct operation always requires a Volcano credential.
602
+ # Invoke a serverless function. **With Service Key** (admin/background operations): - Use for background jobs, webhooks, cron, admin operations - Function receives payload only (no user context) - Database queries bypass RLS (admin access) **With Auth User Token** (user-facing): - Use for user-initiated actions - Function receives payload + &#x60;__volcano_auth&#x60; context: &#x60;&#x60;&#x60;javascript { user_id: \&quot;uuid\&quot;, email: \&quot;user@example.com\&quot;, project_id: \&quot;uuid\&quot;, role: \&quot;authenticated\&quot; or \&quot;anonymous\&quot; } &#x60;&#x60;&#x60; - Database queries enforce RLS (user-scoped data) **With Anon Key** (public function only): - Requires anon key permission: &#x60;functions.invoke&#x60; - Function must have &#x60;is_public: true&#x60; - Function receives payload only (no &#x60;__volcano_auth&#x60;) **Transport and CORS:** - This operation is the authenticated direct RPC endpoint and always uses the POST &#x60;{payload: ...}&#x60; contract, including for functions whose DNS ingress is configured in HTTP mode. - The geo-routed DNS ingress is &#x60;https://{functionId}.functions.&lt;domain&gt;/&#x60;. - RPC-mode DNS ingress accepts POST at &#x60;/&#x60;. HTTP-mode DNS ingress accepts GET, HEAD, POST, PUT, PATCH, and DELETE at &#x60;/&#x60; and nested paths. - Direct and RPC-mode CORS preflight advertises &#x60;POST, OPTIONS&#x60;. HTTP-mode DNS preflight advertises &#x60;GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS&#x60;. - &#x60;http_auth_mode: none&#x60; applies only to public HTTP-mode DNS ingress; this direct operation always requires a Volcano credential. **Durable functions are not invocable here.** A durable function&#39;s id answers 404, whatever its visibility, because a synchronous call would run it with no execution record, no idempotency and no concurrency accounting. Start one with &#x60;POST /durable-functions/{functionId}/executions&#x60;.
591
603
  # @param function_id [String] Function ID
592
604
  # @param function_invocation_request [FunctionInvocationRequest]
593
605
  # @param [Hash] opts the optional parameters
@@ -745,7 +745,7 @@ module Volcano::Generated
745
745
  end
746
746
 
747
747
  # Call OAuth provider API
748
- # Make an authenticated request to an OAuth provider's API on behalf of the user. The user's stored access token is automatically used and refreshed if needed. The request is always sent to the provider's fixed API base URL joined with the caller-supplied `endpoint`. `endpoint` must be a relative path beginning with `/` (optionally with a query string); it cannot change the target host. Absolute URLs, protocol-relative `//host` values, or userinfo (`@host`) are rejected with `400` so the request can never be redirected to another host. Examples of `endpoint`: - Google userinfo: `/oauth2/v1/userinfo` - GitHub repositories: `/user/repos` - Microsoft Graph profile: `/me` The response wraps the provider's raw JSON value with request metadata. An empty provider body is represented as `data: null`; the envelope preserves the provider's HTTP status in `status_code`, including errors. Provider response bodies are limited to 8 MiB after decompression. Transport failures, invalid JSON, and oversized bodies return `502`.
748
+ # Make an authenticated request to an OAuth provider's API on behalf of the user. The user's stored access token is automatically used and refreshed if needed. The request is always sent to the provider's fixed API base URL joined with the caller-supplied `endpoint`. `endpoint` must be a relative path beginning with `/` (optionally with a query string); it cannot change the target host. Absolute URLs, protocol-relative `//host` values, or userinfo (`@host`) are rejected with `400` so the request can never be redirected to another host. Examples of `endpoint`: - Google userinfo: `/oauth2/v1/userinfo` - GitHub repositories: `/user/repos` - Microsoft Graph profile: `/me` The response wraps the provider's raw JSON value with request metadata. An empty provider body is represented as `data: null`; the envelope preserves the provider's HTTP status in `status_code`, including errors. Provider response bodies are limited to 8 MiB after decompression. Transport failures, invalid JSON (including invalid UTF-8), and oversized bodies return `502`. Provider redirects to another origin are blocked and return `400`.
749
749
  # @param provider [String]
750
750
  # @param call_o_auth_provider_api_request [CallOAuthProviderAPIRequest]
751
751
  # @param [Hash] opts the optional parameters
@@ -756,7 +756,7 @@ module Volcano::Generated
756
756
  end
757
757
 
758
758
  # Call OAuth provider API
759
- # Make an authenticated request to an OAuth provider&#39;s API on behalf of the user. The user&#39;s stored access token is automatically used and refreshed if needed. The request is always sent to the provider&#39;s fixed API base URL joined with the caller-supplied &#x60;endpoint&#x60;. &#x60;endpoint&#x60; must be a relative path beginning with &#x60;/&#x60; (optionally with a query string); it cannot change the target host. Absolute URLs, protocol-relative &#x60;//host&#x60; values, or userinfo (&#x60;@host&#x60;) are rejected with &#x60;400&#x60; so the request can never be redirected to another host. Examples of &#x60;endpoint&#x60;: - Google userinfo: &#x60;/oauth2/v1/userinfo&#x60; - GitHub repositories: &#x60;/user/repos&#x60; - Microsoft Graph profile: &#x60;/me&#x60; The response wraps the provider&#39;s raw JSON value with request metadata. An empty provider body is represented as &#x60;data: null&#x60;; the envelope preserves the provider&#39;s HTTP status in &#x60;status_code&#x60;, including errors. Provider response bodies are limited to 8 MiB after decompression. Transport failures, invalid JSON, and oversized bodies return &#x60;502&#x60;.
759
+ # Make an authenticated request to an OAuth provider&#39;s API on behalf of the user. The user&#39;s stored access token is automatically used and refreshed if needed. The request is always sent to the provider&#39;s fixed API base URL joined with the caller-supplied &#x60;endpoint&#x60;. &#x60;endpoint&#x60; must be a relative path beginning with &#x60;/&#x60; (optionally with a query string); it cannot change the target host. Absolute URLs, protocol-relative &#x60;//host&#x60; values, or userinfo (&#x60;@host&#x60;) are rejected with &#x60;400&#x60; so the request can never be redirected to another host. Examples of &#x60;endpoint&#x60;: - Google userinfo: &#x60;/oauth2/v1/userinfo&#x60; - GitHub repositories: &#x60;/user/repos&#x60; - Microsoft Graph profile: &#x60;/me&#x60; The response wraps the provider&#39;s raw JSON value with request metadata. An empty provider body is represented as &#x60;data: null&#x60;; the envelope preserves the provider&#39;s HTTP status in &#x60;status_code&#x60;, including errors. Provider response bodies are limited to 8 MiB after decompression. Transport failures, invalid JSON (including invalid UTF-8), and oversized bodies return &#x60;502&#x60;. Provider redirects to another origin are blocked and return &#x60;400&#x60;.
760
760
  # @param provider [String]
761
761
  # @param call_o_auth_provider_api_request [CallOAuthProviderAPIRequest]
762
762
  # @param [Hash] opts the optional parameters
@@ -624,7 +624,7 @@ module Volcano::Generated
624
624
  end
625
625
 
626
626
  # Export project configuration
627
- # Exports the project's current user-facing configuration as a declarative manifest. Returns JSON by default. Request the canonical volcano-config.yaml rendering with `Accept: application/yaml` or `?format=yaml`; the YAML is returned verbatim as the raw response body (`Content-Type: application/yaml`) and is meant to be saved as-is. Write-only secrets (SMTP password, OAuth client secrets, TLS material) are omitted from the export; the YAML rendering adds a header comment describing how to set them via CLI environment interpolation.
627
+ # Exports the project's current user-facing configuration as a declarative manifest. Returns JSON by default. Request the canonical volcano-config.yaml rendering with `Accept: application/yaml` or `?format=yaml`; the YAML is returned verbatim as the raw response body (`Content-Type: application/yaml`) and is meant to be saved as-is. Variable values and write-only secrets (SMTP password, OAuth client secrets, TLS material) are omitted from the export; shared_variables contains names only; the YAML rendering adds a header comment describing how to set them via CLI environment interpolation.
628
628
  # @param id [String] Project ID
629
629
  # @param [Hash] opts the optional parameters
630
630
  # @option opts [String] :format Response format override. Takes precedence over the Accept header.
@@ -635,7 +635,7 @@ module Volcano::Generated
635
635
  end
636
636
 
637
637
  # Export project configuration
638
- # Exports the project&#39;s current user-facing configuration as a declarative manifest. Returns JSON by default. Request the canonical volcano-config.yaml rendering with &#x60;Accept: application/yaml&#x60; or &#x60;?format&#x3D;yaml&#x60;; the YAML is returned verbatim as the raw response body (&#x60;Content-Type: application/yaml&#x60;) and is meant to be saved as-is. Write-only secrets (SMTP password, OAuth client secrets, TLS material) are omitted from the export; the YAML rendering adds a header comment describing how to set them via CLI environment interpolation.
638
+ # Exports the project&#39;s current user-facing configuration as a declarative manifest. Returns JSON by default. Request the canonical volcano-config.yaml rendering with &#x60;Accept: application/yaml&#x60; or &#x60;?format&#x3D;yaml&#x60;; the YAML is returned verbatim as the raw response body (&#x60;Content-Type: application/yaml&#x60;) and is meant to be saved as-is. Variable values and write-only secrets (SMTP password, OAuth client secrets, TLS material) are omitted from the export; shared_variables contains names only; the YAML rendering adds a header comment describing how to set them via CLI environment interpolation.
639
639
  # @param id [String] Project ID
640
640
  # @param [Hash] opts the optional parameters
641
641
  # @option opts [String] :format Response format override. Takes precedence over the Accept header.
@@ -1483,6 +1483,80 @@ module Volcano::Generated
1483
1483
  return data, status_code, headers
1484
1484
  end
1485
1485
 
1486
+ # Replace shared variable names
1487
+ # Atomically replaces the complete shared function-variable list without changing values. Names must already exist. Validates final affected function environments before membership or propagation side effects. An empty list clears membership. Omitted names remain stored as non-shared variables.
1488
+ # @param id [String] Project ID
1489
+ # @param replace_shared_variables_request [ReplaceSharedVariablesRequest]
1490
+ # @param [Hash] opts the optional parameters
1491
+ # @return [nil]
1492
+ def replace_shared_variables(id, replace_shared_variables_request, opts = {})
1493
+ replace_shared_variables_with_http_info(id, replace_shared_variables_request, opts)
1494
+ nil
1495
+ end
1496
+
1497
+ # Replace shared variable names
1498
+ # Atomically replaces the complete shared function-variable list without changing values. Names must already exist. Validates final affected function environments before membership or propagation side effects. An empty list clears membership. Omitted names remain stored as non-shared variables.
1499
+ # @param id [String] Project ID
1500
+ # @param replace_shared_variables_request [ReplaceSharedVariablesRequest]
1501
+ # @param [Hash] opts the optional parameters
1502
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
1503
+ def replace_shared_variables_with_http_info(id, replace_shared_variables_request, opts = {})
1504
+ if @api_client.config.debugging
1505
+ @api_client.config.logger.debug 'Calling API: ProjectsApi.replace_shared_variables ...'
1506
+ end
1507
+ # verify the required parameter 'id' is set
1508
+ if @api_client.config.client_side_validation && id.nil?
1509
+ fail ArgumentError, "Missing the required parameter 'id' when calling ProjectsApi.replace_shared_variables"
1510
+ end
1511
+ # verify the required parameter 'replace_shared_variables_request' is set
1512
+ if @api_client.config.client_side_validation && replace_shared_variables_request.nil?
1513
+ fail ArgumentError, "Missing the required parameter 'replace_shared_variables_request' when calling ProjectsApi.replace_shared_variables"
1514
+ end
1515
+ # resource path
1516
+ local_var_path = '/projects/{id}/shared-variables'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
1517
+
1518
+ # query parameters
1519
+ query_params = opts[:query_params] || {}
1520
+
1521
+ # header parameters
1522
+ header_params = opts[:header_params] || {}
1523
+ # HTTP header 'Accept' (if needed)
1524
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1525
+ # HTTP header 'Content-Type'
1526
+ content_type = @api_client.select_header_content_type(['application/json'])
1527
+ if !content_type.nil?
1528
+ header_params['Content-Type'] = content_type
1529
+ end
1530
+
1531
+ # form parameters
1532
+ form_params = opts[:form_params] || {}
1533
+
1534
+ # http body (model)
1535
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(replace_shared_variables_request)
1536
+
1537
+ # return_type
1538
+ return_type = opts[:debug_return_type]
1539
+
1540
+ # auth_names
1541
+ auth_names = opts[:debug_auth_names] || ['UserToken']
1542
+
1543
+ new_options = opts.merge(
1544
+ :operation => :"ProjectsApi.replace_shared_variables",
1545
+ :header_params => header_params,
1546
+ :query_params => query_params,
1547
+ :form_params => form_params,
1548
+ :body => post_body,
1549
+ :auth_names => auth_names,
1550
+ :return_type => return_type
1551
+ )
1552
+
1553
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
1554
+ if @api_client.config.debugging
1555
+ @api_client.config.logger.debug "API called: ProjectsApi#replace_shared_variables\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1556
+ end
1557
+ return data, status_code, headers
1558
+ end
1559
+
1486
1560
  # Set the branch a project deploys from
1487
1561
  # Changes only the production branch, leaving the repository binding alone. PUT /projects/{id}/git-connection can also set it, but that is a full rebind: it needs connection_id, installation_id and a repository selector resent, and re-resolves the repository against GitHub for a field that does not depend on it. The branch does not have to exist. It is validated as a Git branch name and nothing more, so a project can be pointed at a branch that is about to be pushed — the case a repository created empty depends on. Setting the branch here marks it as the project's own choice, so a later default-branch rename on GitHub no longer moves it. Projects that never set one keep following the repository's default branch.
1488
1562
  # @param id [String] Project ID
@@ -19,7 +19,7 @@ module Volcano::Generated
19
19
  # Database name (must be unique within project)
20
20
  attr_accessor :name
21
21
 
22
- # Region for database hosting
22
+ # Region for database hosting. The accepted values are the regions this environment runs in, so read them from `GET /databases/regions` rather than hardcoding a list. A region the environment does not offer is rejected with 400.
23
23
  attr_accessor :region
24
24
 
25
25
  # PostgreSQL major version
@@ -164,8 +164,6 @@ module Volcano::Generated
164
164
  return false if @name.to_s.length > 64
165
165
  return false if @name !~ Regexp.new(/^[a-z0-9_]+$/)
166
166
  return false if @region.nil?
167
- region_validator = EnumAttributeValidator.new('String', ["aws-us-east-1", "aws-us-east-2", "aws-us-west-2", "aws-eu-central-1", "aws-eu-west-2", "aws-ap-southeast-1", "aws-ap-southeast-2", "aws-sa-east-1"])
168
- return false unless region_validator.valid?(@region)
169
167
  return false if @pg_version.nil?
170
168
  pg_version_validator = EnumAttributeValidator.new('String', ["15", "16"])
171
169
  return false unless pg_version_validator.valid?(@pg_version)
@@ -193,13 +191,13 @@ module Volcano::Generated
193
191
  @name = name
194
192
  end
195
193
 
196
- # Custom attribute writer method checking allowed values (enum).
197
- # @param [Object] region Object to be assigned
194
+ # Custom attribute writer method with validation
195
+ # @param [Object] region Value to be assigned
198
196
  def region=(region)
199
- validator = EnumAttributeValidator.new('String', ["aws-us-east-1", "aws-us-east-2", "aws-us-west-2", "aws-eu-central-1", "aws-eu-west-2", "aws-ap-southeast-1", "aws-ap-southeast-2", "aws-sa-east-1"])
200
- unless validator.valid?(region)
201
- fail ArgumentError, "invalid value for \"region\", must be one of #{validator.allowable_values}."
197
+ if region.nil?
198
+ fail ArgumentError, 'region cannot be nil'
202
199
  end
200
+
203
201
  @region = region
204
202
  end
205
203
 
@@ -15,6 +15,9 @@ require 'time'
15
15
 
16
16
  module Volcano::Generated
17
17
  class CreateVariableRequest < ApiModelBase
18
+ # Include this name in the project's shared function variables. Omission preserves existing membership; new variables default to true for legacy clients. Send false explicitly to create a non-shared variable.
19
+ attr_accessor :shared
20
+
18
21
  attr_accessor :name
19
22
 
20
23
  attr_accessor :value
@@ -22,6 +25,7 @@ module Volcano::Generated
22
25
  # Attribute mapping from ruby-style variable name to JSON key.
23
26
  def self.attribute_map
24
27
  {
28
+ :'shared' => :'shared',
25
29
  :'name' => :'name',
26
30
  :'value' => :'value'
27
31
  }
@@ -40,6 +44,7 @@ module Volcano::Generated
40
44
  # Attribute type mapping.
41
45
  def self.openapi_types
42
46
  {
47
+ :'shared' => :'Boolean',
43
48
  :'name' => :'String',
44
49
  :'value' => :'String'
45
50
  }
@@ -67,6 +72,10 @@ module Volcano::Generated
67
72
  h[k.to_sym] = v
68
73
  }
69
74
 
75
+ if attributes.key?(:'shared')
76
+ self.shared = attributes[:'shared']
77
+ end
78
+
70
79
  if attributes.key?(:'name')
71
80
  self.name = attributes[:'name']
72
81
  else
@@ -159,6 +168,7 @@ module Volcano::Generated
159
168
  def ==(o)
160
169
  return true if self.equal?(o)
161
170
  self.class == o.class &&
171
+ shared == o.shared &&
162
172
  name == o.name &&
163
173
  value == o.value
164
174
  end
@@ -172,7 +182,7 @@ module Volcano::Generated
172
182
  # Calculates hash code according to all attributes.
173
183
  # @return [Integer] Hash code
174
184
  def hash
175
- [name, value].hash
185
+ [shared, name, value].hash
176
186
  end
177
187
 
178
188
  # Builds the object from hash