From 7a70c6e97b89284e5e2f9060ba04df75c8f04fd1 Mon Sep 17 00:00:00 2001 From: "kong[bot]" <123129154+kong[bot]@users.noreply.github.com> Date: Mon, 21 Sep 2026 07:58:20 +0000 Subject: [PATCH] chore(api): sync OpenAPI contract --- .../generated/.openapi-generator/FILES | 14 + lib/volcano/generated/README.md | 38 +- .../generated/lib/volcano-generated.rb | 14 + .../volcano-generated/api/anon_keys_api.rb | 12 +- .../volcano-generated/api/auth_admin_api.rb | 18 +- .../api/auth_configuration_api.rb | 36 +- .../api/authentication_api.rb | 4 +- .../api/database_backups_api.rb | 18 +- .../api/database_branches_api.rb | 14 +- .../volcano-generated/api/databases_api.rb | 16 +- .../api/durable_functions_api.rb | 4 +- .../volcano-generated/api/frontends_api.rb | 32 +- .../volcano-generated/api/functions_api.rb | 34 +- .../api/git_connections_api.rb | 18 +- .../lib/volcano-generated/api/logs_api.rb | 6 +- .../api/o_auth_configuration_api.rb | 12 +- .../api/project_access_tokens_api.rb | 479 ++++++ .../lib/volcano-generated/api/projects_api.rb | 122 +- .../lib/volcano-generated/api/realtime_api.rb | 6 +- .../volcano-generated/api/service_keys_api.rb | 14 +- .../api/storage_admin_api.rb | 4 +- .../api/storage_buckets_api.rb | 10 +- .../api/storage_policies_api.rb | 6 +- .../lib/volcano-generated/api/system_api.rb | 308 ++++ .../volcano-generated/api/variables_api.rb | 10 +- .../lib/volcano-generated/configuration.rb | 10 +- .../models/call_mcp200_response.rb | 220 +++ .../models/call_mcp200_response_error.rb | 190 +++ .../models/call_mcp200_response_id.rb | 105 ++ .../models/call_mcp_request.rb | 236 +++ .../models/call_mcp_request_id.rb | 105 ++ .../create_project_access_token_request.rb | 241 +++ .../models/created_project_access_token.rb | 459 +++++ .../lib/volcano-generated/models/frontend.rb | 46 +- .../lib/volcano-generated/models/function.rb | 2 +- .../models/paginated_project_access_tokens.rb | 279 +++ .../models/project_access_token.rb | 426 +++++ .../models/project_access_token_scope.rb | 40 + .../models/project_access_token_usage.rb | 299 ++++ .../project_access_token_usage_daily_entry.rb | 191 +++ .../models/project_config.rb | 24 +- .../models/project_config_frontend.rb | 68 +- ...place_frontend_shared_variables_request.rb | 237 +++ .../models/resolve_function_response.rb | 12 +- .../lib/volcano-generated/models/variable.rb | 12 +- openapi/openapi.yaml | 1495 +++++++++++++++-- 46 files changed, 5677 insertions(+), 269 deletions(-) create mode 100644 lib/volcano/generated/lib/volcano-generated/api/project_access_tokens_api.rb create mode 100644 lib/volcano/generated/lib/volcano-generated/models/call_mcp200_response.rb create mode 100644 lib/volcano/generated/lib/volcano-generated/models/call_mcp200_response_error.rb create mode 100644 lib/volcano/generated/lib/volcano-generated/models/call_mcp200_response_id.rb create mode 100644 lib/volcano/generated/lib/volcano-generated/models/call_mcp_request.rb create mode 100644 lib/volcano/generated/lib/volcano-generated/models/call_mcp_request_id.rb create mode 100644 lib/volcano/generated/lib/volcano-generated/models/create_project_access_token_request.rb create mode 100644 lib/volcano/generated/lib/volcano-generated/models/created_project_access_token.rb create mode 100644 lib/volcano/generated/lib/volcano-generated/models/paginated_project_access_tokens.rb create mode 100644 lib/volcano/generated/lib/volcano-generated/models/project_access_token.rb create mode 100644 lib/volcano/generated/lib/volcano-generated/models/project_access_token_scope.rb create mode 100644 lib/volcano/generated/lib/volcano-generated/models/project_access_token_usage.rb create mode 100644 lib/volcano/generated/lib/volcano-generated/models/project_access_token_usage_daily_entry.rb create mode 100644 lib/volcano/generated/lib/volcano-generated/models/replace_frontend_shared_variables_request.rb diff --git a/lib/volcano/generated/.openapi-generator/FILES b/lib/volcano/generated/.openapi-generator/FILES index 1db736c8..fc439f5f 100644 --- a/lib/volcano/generated/.openapi-generator/FILES +++ b/lib/volcano/generated/.openapi-generator/FILES @@ -25,6 +25,7 @@ lib/volcano-generated/api/locks_api.rb lib/volcano-generated/api/logs_api.rb lib/volcano-generated/api/o_auth_authentication_api.rb lib/volcano-generated/api/o_auth_configuration_api.rb +lib/volcano-generated/api/project_access_tokens_api.rb lib/volcano-generated/api/project_imports_api.rb lib/volcano-generated/api/projects_api.rb lib/volcano-generated/api/realtime_api.rb @@ -99,6 +100,11 @@ lib/volcano-generated/models/ban_auth_user_request.rb lib/volcano-generated/models/ban_user_response.rb lib/volcano-generated/models/batch_function_deploy_failure.rb lib/volcano-generated/models/batch_function_deploy_response.rb +lib/volcano-generated/models/call_mcp200_response.rb +lib/volcano-generated/models/call_mcp200_response_error.rb +lib/volcano-generated/models/call_mcp200_response_id.rb +lib/volcano-generated/models/call_mcp_request.rb +lib/volcano-generated/models/call_mcp_request_id.rb lib/volcano-generated/models/call_o_auth_provider_api200_response.rb lib/volcano-generated/models/call_o_auth_provider_api_request.rb lib/volcano-generated/models/complete_upload_session_response.rb @@ -114,6 +120,7 @@ lib/volcano-generated/models/create_email_template_request.rb lib/volcano-generated/models/create_frontend_custom_domain_request.rb lib/volcano-generated/models/create_function_scheduler_request.rb lib/volcano-generated/models/create_o_auth_config_request.rb +lib/volcano-generated/models/create_project_access_token_request.rb lib/volcano-generated/models/create_project_request.rb lib/volcano-generated/models/create_service_key_request.rb lib/volcano-generated/models/create_storage_bucket_request.rb @@ -121,6 +128,7 @@ lib/volcano-generated/models/create_storage_policy_request.rb lib/volcano-generated/models/create_upload_session_request.rb lib/volcano-generated/models/create_upload_session_response.rb lib/volcano-generated/models/create_variable_request.rb +lib/volcano-generated/models/created_project_access_token.rb lib/volcano-generated/models/database.rb lib/volcano-generated/models/database_backup.rb lib/volcano-generated/models/database_backup_list.rb @@ -240,6 +248,7 @@ lib/volcano-generated/models/paginated_frontend_deployments.rb lib/volcano-generated/models/paginated_frontends.rb lib/volcano-generated/models/paginated_function_deployments.rb lib/volcano-generated/models/paginated_functions.rb +lib/volcano-generated/models/paginated_project_access_tokens.rb lib/volcano-generated/models/paginated_project_custom_domains.rb lib/volcano-generated/models/paginated_project_deployments.rb lib/volcano-generated/models/paginated_projects.rb @@ -250,6 +259,10 @@ lib/volcano-generated/models/platform_exchange_response.rb lib/volcano-generated/models/preview_auth_page_request.rb lib/volcano-generated/models/preview_auth_page_response.rb lib/volcano-generated/models/project.rb +lib/volcano-generated/models/project_access_token.rb +lib/volcano-generated/models/project_access_token_scope.rb +lib/volcano-generated/models/project_access_token_usage.rb +lib/volcano-generated/models/project_access_token_usage_daily_entry.rb lib/volcano-generated/models/project_config.rb lib/volcano-generated/models/project_config_apply_result.rb lib/volcano-generated/models/project_config_apply_result_entry.rb @@ -349,6 +362,7 @@ lib/volcano-generated/models/realtime_config.rb lib/volcano-generated/models/realtime_plan_limits.rb lib/volcano-generated/models/realtime_stats.rb lib/volcano-generated/models/refresh_o_auth_provider_token200_response.rb +lib/volcano-generated/models/replace_frontend_shared_variables_request.rb lib/volcano-generated/models/replace_shared_variables_request.rb lib/volcano-generated/models/reset_database_password200_response.rb lib/volcano-generated/models/resolve_function_response.rb diff --git a/lib/volcano/generated/README.md b/lib/volcano/generated/README.md index b48a0aca..81a08762 100644 --- a/lib/volcano/generated/README.md +++ b/lib/volcano/generated/README.md @@ -61,7 +61,12 @@ require 'volcano-generated' # Setup authorization Volcano::Generated.configure do |config| - # Configure Bearer authorization (JWT): UserToken + # Configure Bearer authorization (opaque): UserToken + config.access_token = 'YOUR_BEARER_TOKEN' + # Configure a proc to get access tokens in lieu of the static access_token configuration + config.access_token_getter = -> { 'YOUR TOKEN GETTER PROC' } + + # Configure Bearer authorization (opaque): ProjectAccessToken config.access_token = 'YOUR_BEARER_TOKEN' # Configure a proc to get access tokens in lieu of the static access_token configuration config.access_token_getter = -> { 'YOUR TOKEN GETTER PROC' } @@ -271,6 +276,12 @@ Class | Method | HTTP request | Description *Volcano::Generated::OAuthConfigurationApi* | [**list_available_o_auth_providers**](docs/OAuthConfigurationApi.md#list_available_o_auth_providers) | **GET** /projects/{id}/oauth/providers | List available OAuth providers *Volcano::Generated::OAuthConfigurationApi* | [**list_o_auth_configs**](docs/OAuthConfigurationApi.md#list_o_auth_configs) | **GET** /projects/{id}/oauth/configs | List OAuth configurations *Volcano::Generated::OAuthConfigurationApi* | [**update_o_auth_config**](docs/OAuthConfigurationApi.md#update_o_auth_config) | **PUT** /projects/{id}/oauth/configs/{provider} | Update OAuth configuration +*Volcano::Generated::ProjectAccessTokensApi* | [**create_project_access_token**](docs/ProjectAccessTokensApi.md#create_project_access_token) | **POST** /projects/{id}/access-tokens | Create a project access token +*Volcano::Generated::ProjectAccessTokensApi* | [**get_project_access_token**](docs/ProjectAccessTokensApi.md#get_project_access_token) | **GET** /projects/{id}/access-tokens/{tokenId} | Get a project access token +*Volcano::Generated::ProjectAccessTokensApi* | [**get_project_access_token_usage**](docs/ProjectAccessTokensApi.md#get_project_access_token_usage) | **GET** /projects/{id}/access-tokens/{tokenId}/usage | Per-day request counts for one access token +*Volcano::Generated::ProjectAccessTokensApi* | [**list_project_access_tokens**](docs/ProjectAccessTokensApi.md#list_project_access_tokens) | **GET** /projects/{id}/access-tokens | List a project's access tokens +*Volcano::Generated::ProjectAccessTokensApi* | [**list_project_access_tokens_usage**](docs/ProjectAccessTokensApi.md#list_project_access_tokens_usage) | **GET** /projects/{id}/access-tokens/usage | Per-day request counts for every access token in a project +*Volcano::Generated::ProjectAccessTokensApi* | [**revoke_project_access_token**](docs/ProjectAccessTokensApi.md#revoke_project_access_token) | **DELETE** /projects/{id}/access-tokens/{tokenId} | Revoke a project access token *Volcano::Generated::ProjectImportsApi* | [**complete_import_connect**](docs/ProjectImportsApi.md#complete_import_connect) | **GET** /imports/{provider}/callback | Complete a project import provider connection *Volcano::Generated::ProjectImportsApi* | [**delete_import_connection**](docs/ProjectImportsApi.md#delete_import_connection) | **DELETE** /user/imports/connections/{connectionId} | Delete a project import provider connection *Volcano::Generated::ProjectImportsApi* | [**get_project_import_run**](docs/ProjectImportsApi.md#get_project_import_run) | **GET** /imports/{provider}/runs/{runId} | Get a project import run @@ -299,6 +310,7 @@ Class | Method | HTTP request | Description *Volcano::Generated::ProjectsApi* | [**list_project_deployments**](docs/ProjectsApi.md#list_project_deployments) | **GET** /projects/{id}/deployments | List deployments in a project *Volcano::Generated::ProjectsApi* | [**list_projects**](docs/ProjectsApi.md#list_projects) | **GET** /projects | List all projects for authenticated user *Volcano::Generated::ProjectsApi* | [**query_project_metrics**](docs/ProjectsApi.md#query_project_metrics) | **POST** /projects/{id}/metrics/query | Query project runtime metrics +*Volcano::Generated::ProjectsApi* | [**replace_frontend_shared_variables**](docs/ProjectsApi.md#replace_frontend_shared_variables) | **PUT** /projects/{id}/frontend-shared-variables | Replace frontend shared variable names *Volcano::Generated::ProjectsApi* | [**replace_shared_variables**](docs/ProjectsApi.md#replace_shared_variables) | **PUT** /projects/{id}/shared-variables | Replace shared variable names *Volcano::Generated::ProjectsApi* | [**set_project_git_production_branch**](docs/ProjectsApi.md#set_project_git_production_branch) | **PUT** /projects/{id}/git-connection/production-branch | Set the branch a project deploys from *Volcano::Generated::ProjectsApi* | [**summarize_project_deployments**](docs/ProjectsApi.md#summarize_project_deployments) | **GET** /projects/{id}/deployments/summary | Summarize deployments in a project @@ -332,6 +344,11 @@ Class | Method | HTTP request | Description *Volcano::Generated::StoragePoliciesApi* | [**create_storage_policy**](docs/StoragePoliciesApi.md#create_storage_policy) | **POST** /projects/{id}/storage/buckets/{bucketName}/policies | Create a storage policy *Volcano::Generated::StoragePoliciesApi* | [**delete_storage_policy**](docs/StoragePoliciesApi.md#delete_storage_policy) | **DELETE** /projects/{id}/storage/buckets/{bucketName}/policies/{policyId} | Delete a storage policy *Volcano::Generated::StoragePoliciesApi* | [**list_storage_policies**](docs/StoragePoliciesApi.md#list_storage_policies) | **GET** /projects/{id}/storage/buckets/{bucketName}/policies | List storage policies for a bucket +*Volcano::Generated::SystemApi* | [**call_mcp**](docs/SystemApi.md#call_mcp) | **POST** /mcp | Model Context Protocol endpoint +*Volcano::Generated::SystemApi* | [**get_open_api_spec_json**](docs/SystemApi.md#get_open_api_spec_json) | **GET** /openapi.json | Fetch the OpenAPI specification as JSON +*Volcano::Generated::SystemApi* | [**get_open_api_spec_yaml**](docs/SystemApi.md#get_open_api_spec_yaml) | **GET** /openapi.yaml | Fetch the OpenAPI specification as YAML +*Volcano::Generated::SystemApi* | [**head_open_api_spec_json**](docs/SystemApi.md#head_open_api_spec_json) | **HEAD** /openapi.json | Check the JSON OpenAPI specification +*Volcano::Generated::SystemApi* | [**head_open_api_spec_yaml**](docs/SystemApi.md#head_open_api_spec_yaml) | **HEAD** /openapi.yaml | Check the YAML OpenAPI specification *Volcano::Generated::SystemApi* | [**health_check**](docs/SystemApi.md#health_check) | **GET** /health | Health check endpoint *Volcano::Generated::VariablesApi* | [**create_variable**](docs/VariablesApi.md#create_variable) | **POST** /projects/{id}/variables | Create or update a variable *Volcano::Generated::VariablesApi* | [**delete_variable**](docs/VariablesApi.md#delete_variable) | **DELETE** /projects/{id}/variables/{name} | Delete a variable @@ -402,6 +419,11 @@ Class | Method | HTTP request | Description - [Volcano::Generated::BanUserResponse](docs/BanUserResponse.md) - [Volcano::Generated::BatchFunctionDeployFailure](docs/BatchFunctionDeployFailure.md) - [Volcano::Generated::BatchFunctionDeployResponse](docs/BatchFunctionDeployResponse.md) + - [Volcano::Generated::CallMCP200Response](docs/CallMCP200Response.md) + - [Volcano::Generated::CallMCP200ResponseError](docs/CallMCP200ResponseError.md) + - [Volcano::Generated::CallMCP200ResponseId](docs/CallMCP200ResponseId.md) + - [Volcano::Generated::CallMCPRequest](docs/CallMCPRequest.md) + - [Volcano::Generated::CallMCPRequestId](docs/CallMCPRequestId.md) - [Volcano::Generated::CallOAuthProviderAPI200Response](docs/CallOAuthProviderAPI200Response.md) - [Volcano::Generated::CallOAuthProviderAPIRequest](docs/CallOAuthProviderAPIRequest.md) - [Volcano::Generated::CompleteUploadSessionResponse](docs/CompleteUploadSessionResponse.md) @@ -417,6 +439,7 @@ Class | Method | HTTP request | Description - [Volcano::Generated::CreateFrontendCustomDomainRequest](docs/CreateFrontendCustomDomainRequest.md) - [Volcano::Generated::CreateFunctionSchedulerRequest](docs/CreateFunctionSchedulerRequest.md) - [Volcano::Generated::CreateOAuthConfigRequest](docs/CreateOAuthConfigRequest.md) + - [Volcano::Generated::CreateProjectAccessTokenRequest](docs/CreateProjectAccessTokenRequest.md) - [Volcano::Generated::CreateProjectRequest](docs/CreateProjectRequest.md) - [Volcano::Generated::CreateServiceKeyRequest](docs/CreateServiceKeyRequest.md) - [Volcano::Generated::CreateStorageBucketRequest](docs/CreateStorageBucketRequest.md) @@ -424,6 +447,7 @@ Class | Method | HTTP request | Description - [Volcano::Generated::CreateUploadSessionRequest](docs/CreateUploadSessionRequest.md) - [Volcano::Generated::CreateUploadSessionResponse](docs/CreateUploadSessionResponse.md) - [Volcano::Generated::CreateVariableRequest](docs/CreateVariableRequest.md) + - [Volcano::Generated::CreatedProjectAccessToken](docs/CreatedProjectAccessToken.md) - [Volcano::Generated::Database](docs/Database.md) - [Volcano::Generated::DatabaseBackup](docs/DatabaseBackup.md) - [Volcano::Generated::DatabaseBackupList](docs/DatabaseBackupList.md) @@ -543,6 +567,7 @@ Class | Method | HTTP request | Description - [Volcano::Generated::PaginatedFrontends](docs/PaginatedFrontends.md) - [Volcano::Generated::PaginatedFunctionDeployments](docs/PaginatedFunctionDeployments.md) - [Volcano::Generated::PaginatedFunctions](docs/PaginatedFunctions.md) + - [Volcano::Generated::PaginatedProjectAccessTokens](docs/PaginatedProjectAccessTokens.md) - [Volcano::Generated::PaginatedProjectCustomDomains](docs/PaginatedProjectCustomDomains.md) - [Volcano::Generated::PaginatedProjectDeployments](docs/PaginatedProjectDeployments.md) - [Volcano::Generated::PaginatedProjects](docs/PaginatedProjects.md) @@ -553,6 +578,10 @@ Class | Method | HTTP request | Description - [Volcano::Generated::PreviewAuthPageRequest](docs/PreviewAuthPageRequest.md) - [Volcano::Generated::PreviewAuthPageResponse](docs/PreviewAuthPageResponse.md) - [Volcano::Generated::Project](docs/Project.md) + - [Volcano::Generated::ProjectAccessToken](docs/ProjectAccessToken.md) + - [Volcano::Generated::ProjectAccessTokenScope](docs/ProjectAccessTokenScope.md) + - [Volcano::Generated::ProjectAccessTokenUsage](docs/ProjectAccessTokenUsage.md) + - [Volcano::Generated::ProjectAccessTokenUsageDailyEntry](docs/ProjectAccessTokenUsageDailyEntry.md) - [Volcano::Generated::ProjectConfig](docs/ProjectConfig.md) - [Volcano::Generated::ProjectConfigApplyResult](docs/ProjectConfigApplyResult.md) - [Volcano::Generated::ProjectConfigApplyResultEntry](docs/ProjectConfigApplyResultEntry.md) @@ -652,6 +681,7 @@ Class | Method | HTTP request | Description - [Volcano::Generated::RealtimePlanLimits](docs/RealtimePlanLimits.md) - [Volcano::Generated::RealtimeStats](docs/RealtimeStats.md) - [Volcano::Generated::RefreshOAuthProviderToken200Response](docs/RefreshOAuthProviderToken200Response.md) + - [Volcano::Generated::ReplaceFrontendSharedVariablesRequest](docs/ReplaceFrontendSharedVariablesRequest.md) - [Volcano::Generated::ReplaceSharedVariablesRequest](docs/ReplaceSharedVariablesRequest.md) - [Volcano::Generated::ResetDatabasePassword200Response](docs/ResetDatabasePassword200Response.md) - [Volcano::Generated::ResolveFunctionResponse](docs/ResolveFunctionResponse.md) @@ -711,5 +741,9 @@ Authentication schemes defined for the API: ### UserToken -- **Type**: Bearer authentication (JWT) +- **Type**: Bearer authentication (opaque) + +### ProjectAccessToken + +- **Type**: Bearer authentication (opaque) diff --git a/lib/volcano/generated/lib/volcano-generated.rb b/lib/volcano/generated/lib/volcano-generated.rb index 97b4f52b..58cdcaa3 100644 --- a/lib/volcano/generated/lib/volcano-generated.rb +++ b/lib/volcano/generated/lib/volcano-generated.rb @@ -78,6 +78,11 @@ Volcano::Generated.autoload :BanUserResponse, 'volcano-generated/models/ban_user_response' Volcano::Generated.autoload :BatchFunctionDeployFailure, 'volcano-generated/models/batch_function_deploy_failure' Volcano::Generated.autoload :BatchFunctionDeployResponse, 'volcano-generated/models/batch_function_deploy_response' +Volcano::Generated.autoload :CallMCP200Response, 'volcano-generated/models/call_mcp200_response' +Volcano::Generated.autoload :CallMCP200ResponseError, 'volcano-generated/models/call_mcp200_response_error' +Volcano::Generated.autoload :CallMCP200ResponseId, 'volcano-generated/models/call_mcp200_response_id' +Volcano::Generated.autoload :CallMCPRequest, 'volcano-generated/models/call_mcp_request' +Volcano::Generated.autoload :CallMCPRequestId, 'volcano-generated/models/call_mcp_request_id' Volcano::Generated.autoload :CallOAuthProviderAPI200Response, 'volcano-generated/models/call_o_auth_provider_api200_response' Volcano::Generated.autoload :CallOAuthProviderAPIRequest, 'volcano-generated/models/call_o_auth_provider_api_request' Volcano::Generated.autoload :CompleteUploadSessionResponse, 'volcano-generated/models/complete_upload_session_response' @@ -93,6 +98,7 @@ Volcano::Generated.autoload :CreateFrontendCustomDomainRequest, 'volcano-generated/models/create_frontend_custom_domain_request' Volcano::Generated.autoload :CreateFunctionSchedulerRequest, 'volcano-generated/models/create_function_scheduler_request' Volcano::Generated.autoload :CreateOAuthConfigRequest, 'volcano-generated/models/create_o_auth_config_request' +Volcano::Generated.autoload :CreateProjectAccessTokenRequest, 'volcano-generated/models/create_project_access_token_request' Volcano::Generated.autoload :CreateProjectRequest, 'volcano-generated/models/create_project_request' Volcano::Generated.autoload :CreateServiceKeyRequest, 'volcano-generated/models/create_service_key_request' Volcano::Generated.autoload :CreateStorageBucketRequest, 'volcano-generated/models/create_storage_bucket_request' @@ -100,6 +106,7 @@ Volcano::Generated.autoload :CreateUploadSessionRequest, 'volcano-generated/models/create_upload_session_request' Volcano::Generated.autoload :CreateUploadSessionResponse, 'volcano-generated/models/create_upload_session_response' Volcano::Generated.autoload :CreateVariableRequest, 'volcano-generated/models/create_variable_request' +Volcano::Generated.autoload :CreatedProjectAccessToken, 'volcano-generated/models/created_project_access_token' Volcano::Generated.autoload :Database, 'volcano-generated/models/database' Volcano::Generated.autoload :DatabaseBackup, 'volcano-generated/models/database_backup' Volcano::Generated.autoload :DatabaseBackupList, 'volcano-generated/models/database_backup_list' @@ -219,6 +226,7 @@ Volcano::Generated.autoload :PaginatedFrontends, 'volcano-generated/models/paginated_frontends' Volcano::Generated.autoload :PaginatedFunctionDeployments, 'volcano-generated/models/paginated_function_deployments' Volcano::Generated.autoload :PaginatedFunctions, 'volcano-generated/models/paginated_functions' +Volcano::Generated.autoload :PaginatedProjectAccessTokens, 'volcano-generated/models/paginated_project_access_tokens' Volcano::Generated.autoload :PaginatedProjectCustomDomains, 'volcano-generated/models/paginated_project_custom_domains' Volcano::Generated.autoload :PaginatedProjectDeployments, 'volcano-generated/models/paginated_project_deployments' Volcano::Generated.autoload :PaginatedProjects, 'volcano-generated/models/paginated_projects' @@ -229,6 +237,10 @@ Volcano::Generated.autoload :PreviewAuthPageRequest, 'volcano-generated/models/preview_auth_page_request' Volcano::Generated.autoload :PreviewAuthPageResponse, 'volcano-generated/models/preview_auth_page_response' Volcano::Generated.autoload :Project, 'volcano-generated/models/project' +Volcano::Generated.autoload :ProjectAccessToken, 'volcano-generated/models/project_access_token' +Volcano::Generated.autoload :ProjectAccessTokenScope, 'volcano-generated/models/project_access_token_scope' +Volcano::Generated.autoload :ProjectAccessTokenUsage, 'volcano-generated/models/project_access_token_usage' +Volcano::Generated.autoload :ProjectAccessTokenUsageDailyEntry, 'volcano-generated/models/project_access_token_usage_daily_entry' Volcano::Generated.autoload :ProjectConfig, 'volcano-generated/models/project_config' Volcano::Generated.autoload :ProjectConfigApplyResult, 'volcano-generated/models/project_config_apply_result' Volcano::Generated.autoload :ProjectConfigApplyResultEntry, 'volcano-generated/models/project_config_apply_result_entry' @@ -328,6 +340,7 @@ Volcano::Generated.autoload :RealtimePlanLimits, 'volcano-generated/models/realtime_plan_limits' Volcano::Generated.autoload :RealtimeStats, 'volcano-generated/models/realtime_stats' Volcano::Generated.autoload :RefreshOAuthProviderToken200Response, 'volcano-generated/models/refresh_o_auth_provider_token200_response' +Volcano::Generated.autoload :ReplaceFrontendSharedVariablesRequest, 'volcano-generated/models/replace_frontend_shared_variables_request' Volcano::Generated.autoload :ReplaceSharedVariablesRequest, 'volcano-generated/models/replace_shared_variables_request' Volcano::Generated.autoload :ResetDatabasePassword200Response, 'volcano-generated/models/reset_database_password200_response' Volcano::Generated.autoload :ResolveFunctionResponse, 'volcano-generated/models/resolve_function_response' @@ -385,6 +398,7 @@ Volcano::Generated.autoload :LogsApi, 'volcano-generated/api/logs_api' Volcano::Generated.autoload :OAuthAuthenticationApi, 'volcano-generated/api/o_auth_authentication_api' Volcano::Generated.autoload :OAuthConfigurationApi, 'volcano-generated/api/o_auth_configuration_api' +Volcano::Generated.autoload :ProjectAccessTokensApi, 'volcano-generated/api/project_access_tokens_api' Volcano::Generated.autoload :ProjectImportsApi, 'volcano-generated/api/project_imports_api' Volcano::Generated.autoload :ProjectsApi, 'volcano-generated/api/projects_api' Volcano::Generated.autoload :RealtimeApi, 'volcano-generated/api/realtime_api' diff --git a/lib/volcano/generated/lib/volcano-generated/api/anon_keys_api.rb b/lib/volcano/generated/lib/volcano-generated/api/anon_keys_api.rb index b8e427fa..4663b2fa 100644 --- a/lib/volcano/generated/lib/volcano-generated/api/anon_keys_api.rb +++ b/lib/volcano/generated/lib/volcano-generated/api/anon_keys_api.rb @@ -72,7 +72,7 @@ def create_anon_key_with_http_info(id, create_anon_key_request, opts = {}) return_type = opts[:debug_return_type] || 'AnonKey' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"AnonKeysApi.create_anon_key", @@ -141,7 +141,7 @@ def get_anon_key_with_http_info(id, key_id, opts = {}) return_type = opts[:debug_return_type] || 'AnonKey' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"AnonKeysApi.get_anon_key", @@ -242,7 +242,7 @@ def list_anon_keys_with_http_info(id, opts = {}) return_type = opts[:debug_return_type] || 'ListAnonKeys200Response' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"AnonKeysApi.list_anon_keys", @@ -311,7 +311,7 @@ def regenerate_anon_key_with_http_info(id, key_id, opts = {}) return_type = opts[:debug_return_type] || 'AnonKey' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"AnonKeysApi.regenerate_anon_key", @@ -380,7 +380,7 @@ def revoke_anon_key_with_http_info(id, key_id, opts = {}) return_type = opts[:debug_return_type] # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"AnonKeysApi.revoke_anon_key", @@ -449,7 +449,7 @@ def set_default_anon_key_with_http_info(id, key_id, opts = {}) return_type = opts[:debug_return_type] || 'AnonKey' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"AnonKeysApi.set_default_anon_key", diff --git a/lib/volcano/generated/lib/volcano-generated/api/auth_admin_api.rb b/lib/volcano/generated/lib/volcano-generated/api/auth_admin_api.rb index b8dee32d..449606f4 100644 --- a/lib/volcano/generated/lib/volcano-generated/api/auth_admin_api.rb +++ b/lib/volcano/generated/lib/volcano-generated/api/auth_admin_api.rb @@ -76,7 +76,7 @@ def ban_auth_user_with_http_info(id, user_id, opts = {}) return_type = opts[:debug_return_type] || 'BanUserResponse' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"AuthAdminApi.ban_auth_user", @@ -143,7 +143,7 @@ def delete_all_user_sessions_with_http_info(id, user_id, opts = {}) return_type = opts[:debug_return_type] # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"AuthAdminApi.delete_all_user_sessions", @@ -210,7 +210,7 @@ def delete_auth_user_with_http_info(id, user_id, opts = {}) return_type = opts[:debug_return_type] # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"AuthAdminApi.delete_auth_user", @@ -283,7 +283,7 @@ def delete_user_session_with_http_info(id, user_id, session_id, opts = {}) return_type = opts[:debug_return_type] # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"AuthAdminApi.delete_user_session", @@ -355,7 +355,7 @@ def get_auth_insights_with_http_info(id, opts = {}) return_type = opts[:debug_return_type] || 'AuthInsightsResponse' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"AuthAdminApi.get_auth_insights", @@ -422,7 +422,7 @@ def get_auth_user_with_http_info(id, user_id, opts = {}) return_type = opts[:debug_return_type] || 'AuthUser' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"AuthAdminApi.get_auth_user", @@ -530,7 +530,7 @@ def list_auth_users_with_http_info(id, opts = {}) return_type = opts[:debug_return_type] || 'PaginatedAuthUsers' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"AuthAdminApi.list_auth_users", @@ -648,7 +648,7 @@ def list_user_sessions_with_http_info(id, user_id, opts = {}) return_type = opts[:debug_return_type] || 'AuthGetMySessions200Response' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"AuthAdminApi.list_user_sessions", @@ -717,7 +717,7 @@ def unban_auth_user_with_http_info(id, user_id, opts = {}) return_type = opts[:debug_return_type] || 'UnbanUserResponse' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"AuthAdminApi.unban_auth_user", diff --git a/lib/volcano/generated/lib/volcano-generated/api/auth_configuration_api.rb b/lib/volcano/generated/lib/volcano-generated/api/auth_configuration_api.rb index 8e72f1d7..c352f2c0 100644 --- a/lib/volcano/generated/lib/volcano-generated/api/auth_configuration_api.rb +++ b/lib/volcano/generated/lib/volcano-generated/api/auth_configuration_api.rb @@ -68,7 +68,7 @@ def configure_auth_methods_with_http_info(id, opts = {}) return_type = opts[:debug_return_type] # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"AuthConfigurationApi.configure_auth_methods", @@ -142,7 +142,7 @@ def create_email_template_with_http_info(id, create_email_template_request, opts return_type = opts[:debug_return_type] || 'EmailTemplate' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"AuthConfigurationApi.create_email_template", @@ -209,7 +209,7 @@ def delete_auth_page_layout_with_http_info(id, page_type, opts = {}) return_type = opts[:debug_return_type] # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"AuthConfigurationApi.delete_auth_page_layout", @@ -270,7 +270,7 @@ def delete_auth_page_theme_with_http_info(id, opts = {}) return_type = opts[:debug_return_type] # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"AuthConfigurationApi.delete_auth_page_theme", @@ -344,7 +344,7 @@ def delete_email_template_with_http_info(id, type, opts = {}) return_type = opts[:debug_return_type] # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"AuthConfigurationApi.delete_email_template", @@ -405,7 +405,7 @@ def get_auth_config_with_http_info(id, opts = {}) return_type = opts[:debug_return_type] || 'AuthConfig' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"AuthConfigurationApi.get_auth_config", @@ -474,7 +474,7 @@ def get_auth_hosted_page_with_http_info(id, page_type, opts = {}) return_type = opts[:debug_return_type] || 'AuthHostedPageResponse' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"AuthConfigurationApi.get_auth_hosted_page", @@ -537,7 +537,7 @@ def get_auth_methods_with_http_info(id, opts = {}) return_type = opts[:debug_return_type] || 'GetAuthMethods200Response' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"AuthConfigurationApi.get_auth_methods", @@ -598,7 +598,7 @@ def get_auth_page_appearance_with_http_info(id, opts = {}) return_type = opts[:debug_return_type] || 'AuthPageAppearanceResponse' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"AuthConfigurationApi.get_auth_page_appearance", @@ -793,7 +793,7 @@ def get_email_template_with_http_info(id, type, opts = {}) return_type = opts[:debug_return_type] || 'EmailTemplate' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"AuthConfigurationApi.get_email_template", @@ -1007,7 +1007,7 @@ def list_email_templates_with_http_info(id, opts = {}) return_type = opts[:debug_return_type] || 'ListEmailTemplates200Response' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"AuthConfigurationApi.list_email_templates", @@ -1085,7 +1085,7 @@ def preview_auth_page_with_http_info(id, page_type, preview_auth_page_request, o return_type = opts[:debug_return_type] || 'PreviewAuthPageResponse' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"AuthConfigurationApi.preview_auth_page", @@ -1391,7 +1391,7 @@ def test_email_config_with_http_info(id, test_email_request, opts = {}) return_type = opts[:debug_return_type] || 'TestEmailResponse' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"AuthConfigurationApi.test_email_config", @@ -1461,7 +1461,7 @@ def update_auth_config_with_http_info(id, opts = {}) return_type = opts[:debug_return_type] || 'AuthConfig' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"AuthConfigurationApi.update_auth_config", @@ -1541,7 +1541,7 @@ def update_auth_hosted_page_with_http_info(id, page_type, update_auth_hosted_pag return_type = opts[:debug_return_type] || 'AuthHostedPageResponse' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"AuthConfigurationApi.update_auth_hosted_page", @@ -1619,7 +1619,7 @@ def update_auth_page_layout_with_http_info(id, page_type, update_auth_page_layou return_type = opts[:debug_return_type] || 'UpdateAuthPageLayoutRequest' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"AuthConfigurationApi.update_auth_page_layout", @@ -1691,7 +1691,7 @@ def update_auth_page_theme_with_http_info(id, update_auth_page_theme_request, op return_type = opts[:debug_return_type] || 'UpdateAuthPageThemeRequest' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"AuthConfigurationApi.update_auth_page_theme", @@ -1776,7 +1776,7 @@ def update_email_template_with_http_info(id, type, update_email_template_request return_type = opts[:debug_return_type] || 'EmailTemplate' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"AuthConfigurationApi.update_email_template", diff --git a/lib/volcano/generated/lib/volcano-generated/api/authentication_api.rb b/lib/volcano/generated/lib/volcano-generated/api/authentication_api.rb index bf4d6123..756086d4 100644 --- a/lib/volcano/generated/lib/volcano-generated/api/authentication_api.rb +++ b/lib/volcano/generated/lib/volcano-generated/api/authentication_api.rb @@ -1194,7 +1194,7 @@ def auth_reset_password_with_http_info(auth_reset_password_request, opts = {}) end # Sign in an auth user - # Authenticate with email and password. Requires an anon key. Set `session_mode` to `cookie` to request HttpOnly refresh-token storage. Cookie mode is honored only for an exact, credentialed CORS origin on the same schemeful site as this API. Otherwise the response retains the refresh token in its body. + # Authenticate with email and password. Requires an anon key. Set `session_mode` to `cookie` to request HttpOnly refresh-token storage. Cookie mode is honored only for an exact, credentialed CORS origin on the same schemeful site as this API. Otherwise the response retains the refresh token in its body. A frontend on its default Volcano URL is cross-site with this API and so always gets the body token. # @param auth_signin_request [AuthSigninRequest] # @param [Hash] opts the optional parameters # @return [AuthTokenResponse] @@ -1204,7 +1204,7 @@ def auth_signin(auth_signin_request, opts = {}) end # Sign in an auth user - # Authenticate with email and password. Requires an anon key. Set `session_mode` to `cookie` to request HttpOnly refresh-token storage. Cookie mode is honored only for an exact, credentialed CORS origin on the same schemeful site as this API. Otherwise the response retains the refresh token in its body. + # Authenticate with email and password. Requires an anon key. Set `session_mode` to `cookie` to request HttpOnly refresh-token storage. Cookie mode is honored only for an exact, credentialed CORS origin on the same schemeful site as this API. Otherwise the response retains the refresh token in its body. A frontend on its default Volcano URL is cross-site with this API and so always gets the body token. # @param auth_signin_request [AuthSigninRequest] # @param [Hash] opts the optional parameters # @return [Array<(AuthTokenResponse, Integer, Hash)>] AuthTokenResponse data, response status code and response headers diff --git a/lib/volcano/generated/lib/volcano-generated/api/database_backups_api.rb b/lib/volcano/generated/lib/volcano-generated/api/database_backups_api.rb index b66ce73c..59351a1e 100644 --- a/lib/volcano/generated/lib/volcano-generated/api/database_backups_api.rb +++ b/lib/volcano/generated/lib/volcano-generated/api/database_backups_api.rb @@ -89,7 +89,7 @@ def create_database_backup_with_http_info(id, database_name, create_database_bac return_type = opts[:debug_return_type] || 'DatabaseBackup' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"DatabaseBackupsApi.create_database_backup", @@ -178,7 +178,7 @@ def create_database_restore_with_http_info(id, database_name, create_database_re return_type = opts[:debug_return_type] || 'DatabaseRestore' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"DatabaseBackupsApi.create_database_restore", @@ -270,7 +270,7 @@ def delete_database_backup_with_http_info(id, database_name, backup_name, opts = return_type = opts[:debug_return_type] || 'DeleteDatabaseBackup200Response' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"DatabaseBackupsApi.delete_database_backup", @@ -362,7 +362,7 @@ def get_database_backup_with_http_info(id, database_name, backup_name, opts = {} return_type = opts[:debug_return_type] || 'DatabaseBackup' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"DatabaseBackupsApi.get_database_backup", @@ -440,7 +440,7 @@ def get_database_backup_schedule_with_http_info(id, database_name, opts = {}) return_type = opts[:debug_return_type] || 'DatabaseBackupSchedule' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"DatabaseBackupsApi.get_database_backup_schedule", @@ -524,7 +524,7 @@ def get_database_restore_with_http_info(id, database_name, restore_id, opts = {} return_type = opts[:debug_return_type] || 'DatabaseRestore' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"DatabaseBackupsApi.get_database_restore", @@ -602,7 +602,7 @@ def list_database_backups_with_http_info(id, database_name, opts = {}) return_type = opts[:debug_return_type] || 'DatabaseBackupList' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"DatabaseBackupsApi.list_database_backups", @@ -680,7 +680,7 @@ def list_database_restores_with_http_info(id, database_name, opts = {}) return_type = opts[:debug_return_type] || 'DatabaseRestoreList' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"DatabaseBackupsApi.list_database_restores", @@ -769,7 +769,7 @@ def update_database_backup_schedule_with_http_info(id, database_name, database_b return_type = opts[:debug_return_type] || 'DatabaseBackupSchedule' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"DatabaseBackupsApi.update_database_backup_schedule", diff --git a/lib/volcano/generated/lib/volcano-generated/api/database_branches_api.rb b/lib/volcano/generated/lib/volcano-generated/api/database_branches_api.rb index a4b740da..bf0584ed 100644 --- a/lib/volcano/generated/lib/volcano-generated/api/database_branches_api.rb +++ b/lib/volcano/generated/lib/volcano-generated/api/database_branches_api.rb @@ -89,7 +89,7 @@ def create_database_branch_with_http_info(id, database_name, create_database_bra return_type = opts[:debug_return_type] || 'DatabaseBranch' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"DatabaseBranchesApi.create_database_branch", @@ -182,7 +182,7 @@ def delete_database_branch_with_http_info(id, database_name, branch_name, opts = return_type = opts[:debug_return_type] || 'DeleteDatabaseBranch202Response' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"DatabaseBranchesApi.delete_database_branch", @@ -275,7 +275,7 @@ def get_database_branch_with_http_info(id, database_name, branch_name, opts = {} return_type = opts[:debug_return_type] || 'DatabaseBranch' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"DatabaseBranchesApi.get_database_branch", @@ -353,7 +353,7 @@ def list_database_branches_with_http_info(id, database_name, opts = {}) return_type = opts[:debug_return_type] || 'DatabaseBranchList' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"DatabaseBranchesApi.list_database_branches", @@ -446,7 +446,7 @@ def reset_database_branch_with_http_info(id, database_name, branch_name, opts = return_type = opts[:debug_return_type] || 'DatabaseBranch' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"DatabaseBranchesApi.reset_database_branch", @@ -539,7 +539,7 @@ def reset_database_branch_password_with_http_info(id, database_name, branch_name return_type = opts[:debug_return_type] || 'DatabaseBranch' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"DatabaseBranchesApi.reset_database_branch_password", @@ -643,7 +643,7 @@ def update_database_branch_with_http_info(id, database_name, branch_name, update return_type = opts[:debug_return_type] || 'DatabaseBranch' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"DatabaseBranchesApi.update_database_branch", diff --git a/lib/volcano/generated/lib/volcano-generated/api/databases_api.rb b/lib/volcano/generated/lib/volcano-generated/api/databases_api.rb index 1b2a876d..d3399419 100644 --- a/lib/volcano/generated/lib/volcano-generated/api/databases_api.rb +++ b/lib/volcano/generated/lib/volcano-generated/api/databases_api.rb @@ -74,7 +74,7 @@ def create_database_with_http_info(id, create_database_request, opts = {}) return_type = opts[:debug_return_type] || 'Database' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"DatabasesApi.create_database", @@ -152,7 +152,7 @@ def delete_database_with_http_info(id, database_name, opts = {}) return_type = opts[:debug_return_type] || 'DeleteDatabase202Response' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"DatabasesApi.delete_database", @@ -228,7 +228,7 @@ def get_database_with_http_info(id, database_name, opts = {}) return_type = opts[:debug_return_type] || 'Database' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"DatabasesApi.get_database", @@ -319,7 +319,7 @@ def get_database_stats_with_http_info(id, database_name, opts = {}) return_type = opts[:debug_return_type] || 'DatabaseStats' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"DatabasesApi.get_database_stats", @@ -408,7 +408,7 @@ def get_project_database_queries_with_http_info(id, database_name, opts = {}) return_type = opts[:debug_return_type] || 'DatabaseQueryPerformanceResponse' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"DatabasesApi.get_project_database_queries", @@ -573,7 +573,7 @@ def list_databases_with_http_info(id, opts = {}) return_type = opts[:debug_return_type] || 'PaginatedDatabases' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"DatabasesApi.list_databases", @@ -708,7 +708,7 @@ def reset_database_password_with_http_info(id, database_name, opts = {}) return_type = opts[:debug_return_type] || 'ResetDatabasePassword200Response' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"DatabasesApi.reset_database_password", @@ -797,7 +797,7 @@ def update_database_type_with_http_info(id, database_name, update_database_type_ return_type = opts[:debug_return_type] || 'Database' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"DatabasesApi.update_database_type", diff --git a/lib/volcano/generated/lib/volcano-generated/api/durable_functions_api.rb b/lib/volcano/generated/lib/volcano-generated/api/durable_functions_api.rb index aa672edb..2d8b25dc 100644 --- a/lib/volcano/generated/lib/volcano-generated/api/durable_functions_api.rb +++ b/lib/volcano/generated/lib/volcano-generated/api/durable_functions_api.rb @@ -219,7 +219,7 @@ def create_durable_function_scheduler_with_http_info(id, function_id, create_fun end # Delete a durable function - # Accepted for asynchronous teardown; the work continues after the response. The function's executions go with it: history stops being readable whatever `retention_days` had left, and the executions still running stop counting against the project's concurrency cap. Stop an execution first if you need it to end before the function does. + # Accepted for asynchronous teardown; the work continues after the response. The function's executions go with it: executions still in flight are stopped, and history stops being readable whatever `retention_days` had left. Stopping is asynchronous at the platform, and it does not interrupt a step already running -- that step runs to its next checkpoint. So a delete ends an execution rather than halting it mid-step; stop the execution yourself first if you need to observe it ending. # @param id [String] Project ID # @param function_id [String] Durable function ID, or its name within the project # @param [Hash] opts the optional parameters @@ -230,7 +230,7 @@ def delete_durable_function(id, function_id, opts = {}) end # Delete a durable function - # Accepted for asynchronous teardown; the work continues after the response. The function's executions go with it: history stops being readable whatever `retention_days` had left, and the executions still running stop counting against the project's concurrency cap. Stop an execution first if you need it to end before the function does. + # Accepted for asynchronous teardown; the work continues after the response. The function's executions go with it: executions still in flight are stopped, and history stops being readable whatever `retention_days` had left. Stopping is asynchronous at the platform, and it does not interrupt a step already running -- that step runs to its next checkpoint. So a delete ends an execution rather than halting it mid-step; stop the execution yourself first if you need to observe it ending. # @param id [String] Project ID # @param function_id [String] Durable function ID, or its name within the project # @param [Hash] opts the optional parameters diff --git a/lib/volcano/generated/lib/volcano-generated/api/frontends_api.rb b/lib/volcano/generated/lib/volcano-generated/api/frontends_api.rb index f696de4c..b8e56324 100644 --- a/lib/volcano/generated/lib/volcano-generated/api/frontends_api.rb +++ b/lib/volcano/generated/lib/volcano-generated/api/frontends_api.rb @@ -27,6 +27,8 @@ def initialize(api_client = ApiClient.default) # @param [Hash] opts the optional parameters # @option opts [String] :framework Next.js frontend. Supported Next.js majors are 15.x and 16.x. (default to 'nextjs') # @option opts [String] :app_root Optional relative POSIX path from the uploaded archive root to the Next.js app to build, for example `apps/web`. + # @option opts [String] :variable_scope Variable selection for this deployment. New frontends default to `scoped`; omitting this field for an existing frontend preserves its current selection. + # @option opts [Array] :variables Project variable names selected when `variable_scope` is `scoped`. Submit each name as a repeated multipart field. # @return [Frontend] def create_frontend(id, name, archive, opts = {}) data, _status_code, _headers = create_frontend_with_http_info(id, name, archive, opts) @@ -41,6 +43,8 @@ def create_frontend(id, name, archive, opts = {}) # @param [Hash] opts the optional parameters # @option opts [String] :framework Next.js frontend. Supported Next.js majors are 15.x and 16.x. (default to 'nextjs') # @option opts [String] :app_root Optional relative POSIX path from the uploaded archive root to the Next.js app to build, for example `apps/web`. + # @option opts [String] :variable_scope Variable selection for this deployment. New frontends default to `scoped`; omitting this field for an existing frontend preserves its current selection. + # @option opts [Array] :variables Project variable names selected when `variable_scope` is `scoped`. Submit each name as a repeated multipart field. # @return [Array<(Frontend, Integer, Hash)>] Frontend data, response status code and response headers def create_frontend_with_http_info(id, name, archive, opts = {}) if @api_client.config.debugging @@ -75,6 +79,10 @@ def create_frontend_with_http_info(id, name, archive, opts = {}) fail ArgumentError, 'invalid value for "opts[:"app_root"]" when calling FrontendsApi.create_frontend, the character length must be smaller than or equal to 1024.' end + allowable_values = ["all", "scoped"] + if @api_client.config.client_side_validation && opts[:'variable_scope'] && !allowable_values.include?(opts[:'variable_scope']) + fail ArgumentError, "invalid value for \"variable_scope\", must be one of #{allowable_values}" + end # resource path local_var_path = '/projects/{id}/frontends'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) @@ -97,6 +105,8 @@ def create_frontend_with_http_info(id, name, archive, opts = {}) form_params['archive'] = archive form_params['framework'] = opts[:'framework'] if !opts[:'framework'].nil? form_params['app_root'] = opts[:'app_root'] if !opts[:'app_root'].nil? + form_params['variable_scope'] = opts[:'variable_scope'] if !opts[:'variable_scope'].nil? + form_params['variables'] = @api_client.build_collection_param(opts[:'variables'], :csv) if !opts[:'variables'].nil? # http body (model) post_body = opts[:debug_body] @@ -105,7 +115,7 @@ def create_frontend_with_http_info(id, name, archive, opts = {}) return_type = opts[:debug_return_type] || 'Frontend' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"FrontendsApi.create_frontend", @@ -185,7 +195,7 @@ def create_frontend_custom_domain_with_http_info(id, frontend_id, create_fronten return_type = opts[:debug_return_type] || 'FrontendCustomDomainResponse' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"FrontendsApi.create_frontend_custom_domain", @@ -254,7 +264,7 @@ def delete_frontend_with_http_info(id, frontend_id, opts = {}) return_type = opts[:debug_return_type] # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"FrontendsApi.delete_frontend", @@ -321,7 +331,7 @@ def delete_frontend_custom_domain_with_http_info(id, frontend_id, opts = {}) return_type = opts[:debug_return_type] # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"FrontendsApi.delete_frontend_custom_domain", @@ -388,7 +398,7 @@ def get_frontend_with_http_info(id, frontend_id, opts = {}) return_type = opts[:debug_return_type] || 'Frontend' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"FrontendsApi.get_frontend", @@ -455,7 +465,7 @@ def get_frontend_custom_domain_with_http_info(id, frontend_id, opts = {}) return_type = opts[:debug_return_type] || 'FrontendCustomDomainResponse' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"FrontendsApi.get_frontend_custom_domain", @@ -535,7 +545,7 @@ def get_frontend_usage_history_with_http_info(id, frontend_id, opts = {}) return_type = opts[:debug_return_type] || 'FrontendUsageHistoryResponse' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"FrontendsApi.get_frontend_usage_history", @@ -620,7 +630,7 @@ def list_frontend_deployments_with_http_info(id, frontend_id, opts = {}) return_type = opts[:debug_return_type] || 'PaginatedFrontendDeployments' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"FrontendsApi.list_frontend_deployments", @@ -721,7 +731,7 @@ def list_frontends_with_http_info(id, opts = {}) return_type = opts[:debug_return_type] || 'PaginatedFrontends' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"FrontendsApi.list_frontends", @@ -822,7 +832,7 @@ def list_project_custom_domains_with_http_info(id, opts = {}) return_type = opts[:debug_return_type] || 'PaginatedProjectCustomDomains' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"FrontendsApi.list_project_custom_domains", @@ -891,7 +901,7 @@ def redeploy_frontend_with_http_info(id, frontend_id, opts = {}) return_type = opts[:debug_return_type] || 'Frontend' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"FrontendsApi.redeploy_frontend", diff --git a/lib/volcano/generated/lib/volcano-generated/api/functions_api.rb b/lib/volcano/generated/lib/volcano-generated/api/functions_api.rb index 0885591f..9824fc69 100644 --- a/lib/volcano/generated/lib/volcano-generated/api/functions_api.rb +++ b/lib/volcano/generated/lib/volcano-generated/api/functions_api.rb @@ -128,7 +128,7 @@ def create_function_with_http_info(id, name, code, runtime, opts = {}) return_type = opts[:debug_return_type] || 'Function' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"FunctionsApi.create_function", @@ -208,7 +208,7 @@ def create_function_scheduler_with_http_info(id, function_id, create_function_sc return_type = opts[:debug_return_type] || 'FunctionScheduler' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"FunctionsApi.create_function_scheduler", @@ -286,7 +286,7 @@ def create_functions_batch_with_http_info(id, functions, opts = {}) return_type = opts[:debug_return_type] || 'BatchFunctionDeployResponse' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"FunctionsApi.create_functions_batch", @@ -355,7 +355,7 @@ def delete_function_with_http_info(id, function_id, opts = {}) return_type = opts[:debug_return_type] # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"FunctionsApi.delete_function", @@ -428,7 +428,7 @@ def delete_function_scheduler_with_http_info(id, function_id, scheduler_id, opts return_type = opts[:debug_return_type] # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"FunctionsApi.delete_function_scheduler", @@ -495,7 +495,7 @@ def get_function_with_http_info(id, function_id, opts = {}) return_type = opts[:debug_return_type] || 'Function' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"FunctionsApi.get_function", @@ -568,7 +568,7 @@ def get_function_scheduler_with_http_info(id, function_id, scheduler_id, opts = return_type = opts[:debug_return_type] || 'FunctionScheduler' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"FunctionsApi.get_function_scheduler", @@ -588,7 +588,7 @@ def get_function_scheduler_with_http_info(id, function_id, scheduler_id, opts = end # Invoke a function - # 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./`. - 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`. + # 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 the function's `invoke_url`. It is on a different domain from this API, so it cannot be derived from the API host. - 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`. # @param function_id [String] Function ID # @param function_invocation_request [FunctionInvocationRequest] # @param [Hash] opts the optional parameters @@ -599,7 +599,7 @@ def invoke_function(function_id, function_invocation_request, opts = {}) end # Invoke a function - # 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`. + # 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 the function's `invoke_url`. It is on a different domain from this API, so it cannot be derived from the API host. - 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`. # @param function_id [String] Function ID # @param function_invocation_request [FunctionInvocationRequest] # @param [Hash] opts the optional parameters @@ -727,7 +727,7 @@ def list_function_deployments_with_http_info(id, function_id, opts = {}) return_type = opts[:debug_return_type] || 'PaginatedFunctionDeployments' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"FunctionsApi.list_function_deployments", @@ -908,7 +908,7 @@ def list_function_schedulers_with_http_info(id, function_id, opts = {}) return_type = opts[:debug_return_type] || 'FunctionSchedulerListResponse' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"FunctionsApi.list_function_schedulers", @@ -1009,7 +1009,7 @@ def list_functions_with_http_info(id, opts = {}) return_type = opts[:debug_return_type] || 'PaginatedFunctions' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"FunctionsApi.list_functions", @@ -1110,7 +1110,7 @@ def list_project_schedulers_with_http_info(id, opts = {}) return_type = opts[:debug_return_type] || 'FunctionSchedulerListResponse' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"FunctionsApi.list_project_schedulers", @@ -1130,7 +1130,7 @@ def list_project_schedulers_with_http_info(id, opts = {}) end # Resolve function name for invocation - # Resolves a DNS-safe function name to its function ID within the caller's project. SDKs use this endpoint internally to invoke by function name while routing by function ID. **With Service Key**: - Allowed **With Auth User Token**: - Allowed **With Anon Key**: - Requires anon key permission: `functions.invoke` - Function must have `is_public: true` + # Resolves a DNS-safe function name to its function ID and invocation URL within the caller's project. SDKs use this endpoint internally to invoke by function name while routing by function ID. Invoke the returned `invoke_url` as-is. It does not share a domain with the API, so a host built from the API URL will not reach the function. When the deployment serves no public invocation domain, as in local development, `invoke_url` is omitted and callers invoke through `POST /functions/{functionId}/invoke`. **With Service Key**: - Allowed **With Auth User Token**: - Allowed **With Anon Key**: - Requires anon key permission: `functions.invoke` - Function must have `is_public: true` # @param name [String] DNS-safe function name (lowercase letters, numbers, hyphens; cannot start or end with hyphen) # @param [Hash] opts the optional parameters # @return [ResolveFunctionResponse] @@ -1140,7 +1140,7 @@ def resolve_function_for_invocation(name, opts = {}) end # Resolve function name for invocation - # Resolves a DNS-safe function name to its function ID within the caller's project. SDKs use this endpoint internally to invoke by function name while routing by function ID. **With Service Key**: - Allowed **With Auth User Token**: - Allowed **With Anon Key**: - Requires anon key permission: `functions.invoke` - Function must have `is_public: true` + # Resolves a DNS-safe function name to its function ID and invocation URL within the caller's project. SDKs use this endpoint internally to invoke by function name while routing by function ID. Invoke the returned `invoke_url` as-is. It does not share a domain with the API, so a host built from the API URL will not reach the function. When the deployment serves no public invocation domain, as in local development, `invoke_url` is omitted and callers invoke through `POST /functions/{functionId}/invoke`. **With Service Key**: - Allowed **With Auth User Token**: - Allowed **With Anon Key**: - Requires anon key permission: `functions.invoke` - Function must have `is_public: true` # @param name [String] DNS-safe function name (lowercase letters, numbers, hyphens; cannot start or end with hyphen) # @param [Hash] opts the optional parameters # @return [Array<(ResolveFunctionResponse, Integer, Hash)>] ResolveFunctionResponse data, response status code and response headers @@ -1261,7 +1261,7 @@ def update_function_with_http_info(id, function_id, update_function_request, opt return_type = opts[:debug_return_type] || 'Function' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"FunctionsApi.update_function", @@ -1345,7 +1345,7 @@ def update_function_scheduler_with_http_info(id, function_id, scheduler_id, upda return_type = opts[:debug_return_type] || 'FunctionScheduler' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"FunctionsApi.update_function_scheduler", diff --git a/lib/volcano/generated/lib/volcano-generated/api/git_connections_api.rb b/lib/volcano/generated/lib/volcano-generated/api/git_connections_api.rb index 96063c73..ff545303 100644 --- a/lib/volcano/generated/lib/volcano-generated/api/git_connections_api.rb +++ b/lib/volcano/generated/lib/volcano-generated/api/git_connections_api.rb @@ -63,7 +63,7 @@ def cancel_project_source_export_with_http_info(id, opts = {}) return_type = opts[:debug_return_type] # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"GitConnectionsApi.cancel_project_source_export", @@ -137,7 +137,7 @@ def connect_project_git_with_http_info(id, connect_project_git_request, opts = { return_type = opts[:debug_return_type] || 'ProjectGitConnection' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"GitConnectionsApi.connect_project_git", @@ -259,7 +259,7 @@ def disconnect_project_git_with_http_info(id, opts = {}) return_type = opts[:debug_return_type] # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"GitConnectionsApi.disconnect_project_git", @@ -333,7 +333,7 @@ def export_project_source_with_http_info(id, export_project_source_request, opts return_type = opts[:debug_return_type] || 'ProjectSourceExport' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"GitConnectionsApi.export_project_source", @@ -394,7 +394,7 @@ def get_project_git_connection_with_http_info(id, opts = {}) return_type = opts[:debug_return_type] || 'ProjectGitConnection' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"GitConnectionsApi.get_project_git_connection", @@ -455,7 +455,7 @@ def get_project_git_deploy_settings_with_http_info(id, opts = {}) return_type = opts[:debug_return_type] || 'ProjectGitDeploySettings' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"GitConnectionsApi.get_project_git_deploy_settings", @@ -518,7 +518,7 @@ def get_project_source_export_with_http_info(id, opts = {}) return_type = opts[:debug_return_type] || 'ProjectSourceExportState' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"GitConnectionsApi.get_project_source_export", @@ -849,7 +849,7 @@ def set_project_git_production_branch_with_http_info(id, set_project_git_product return_type = opts[:debug_return_type] || 'ProjectGitConnection' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"GitConnectionsApi.set_project_git_production_branch", @@ -990,7 +990,7 @@ def update_project_git_deploy_settings_with_http_info(id, update_project_git_dep return_type = opts[:debug_return_type] || 'ProjectGitDeploySettings' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"GitConnectionsApi.update_project_git_deploy_settings", diff --git a/lib/volcano/generated/lib/volcano-generated/api/logs_api.rb b/lib/volcano/generated/lib/volcano-generated/api/logs_api.rb index e3b54e43..c1d7faed 100644 --- a/lib/volcano/generated/lib/volcano-generated/api/logs_api.rb +++ b/lib/volcano/generated/lib/volcano-generated/api/logs_api.rb @@ -74,7 +74,7 @@ def get_project_log_activity_with_http_info(id, log_activity_request, opts = {}) return_type = opts[:debug_return_type] || 'LogActivityResponse' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"LogsApi.get_project_log_activity", @@ -148,7 +148,7 @@ def search_project_logs_with_http_info(id, log_search_request, opts = {}) return_type = opts[:debug_return_type] || 'LogSearchResponse' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"LogsApi.search_project_logs", @@ -228,7 +228,7 @@ def stream_project_logs_with_http_info(id, log_stream_request, opts = {}) return_type = opts[:debug_return_type] || 'String' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"LogsApi.stream_project_logs", diff --git a/lib/volcano/generated/lib/volcano-generated/api/o_auth_configuration_api.rb b/lib/volcano/generated/lib/volcano-generated/api/o_auth_configuration_api.rb index 2f8dfb13..77f5edf0 100644 --- a/lib/volcano/generated/lib/volcano-generated/api/o_auth_configuration_api.rb +++ b/lib/volcano/generated/lib/volcano-generated/api/o_auth_configuration_api.rb @@ -74,7 +74,7 @@ def create_o_auth_config_with_http_info(id, create_o_auth_config_request, opts = return_type = opts[:debug_return_type] || 'OAuthConfig' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"OAuthConfigurationApi.create_o_auth_config", @@ -147,7 +147,7 @@ def delete_o_auth_config_with_http_info(id, provider, opts = {}) return_type = opts[:debug_return_type] # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"OAuthConfigurationApi.delete_o_auth_config", @@ -222,7 +222,7 @@ def get_o_auth_config_with_http_info(id, provider, opts = {}) return_type = opts[:debug_return_type] || 'OAuthConfig' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"OAuthConfigurationApi.get_o_auth_config", @@ -285,7 +285,7 @@ def list_available_o_auth_providers_with_http_info(id, opts = {}) return_type = opts[:debug_return_type] || 'ListAvailableOAuthProviders200Response' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"OAuthConfigurationApi.list_available_o_auth_providers", @@ -348,7 +348,7 @@ def list_o_auth_configs_with_http_info(id, opts = {}) return_type = opts[:debug_return_type] || 'ListOAuthConfigs200Response' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"OAuthConfigurationApi.list_o_auth_configs", @@ -430,7 +430,7 @@ def update_o_auth_config_with_http_info(id, provider, opts = {}) return_type = opts[:debug_return_type] || 'OAuthConfig' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"OAuthConfigurationApi.update_o_auth_config", diff --git a/lib/volcano/generated/lib/volcano-generated/api/project_access_tokens_api.rb b/lib/volcano/generated/lib/volcano-generated/api/project_access_tokens_api.rb new file mode 100644 index 00000000..a0276cb4 --- /dev/null +++ b/lib/volcano/generated/lib/volcano-generated/api/project_access_tokens_api.rb @@ -0,0 +1,479 @@ +=begin +#Volcano Hosting API + +#Public API for Volcano Hosting clients, SDKs, and CLI tooling (Port 8000). This specification intentionally excludes first-party/internal APIs. See api/openapi-internal.yaml for non-public internal and Builder operations. + +The version of the OpenAPI document: 3.0.0 +Contact: support@volcano.dev +Generated by: https://openapi-generator.tech +Generator version: 7.17.0 + +=end + +require 'cgi' + +module Volcano::Generated + class ProjectAccessTokensApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # Create a project access token + # Creates a project access token and returns its secret. The secret is in this response and nowhere else. Only its hash is stored, so it cannot be retrieved, displayed, or recovered later — save it when you create it. The name must be unique within the project, so a retry cannot mint a second credential. It cannot recover the first one either. A retry that returns `409` with code `access_token_name_exists` means the original create committed and its secret is unrecoverable: list the project's tokens, revoke the one holding that name, and create it again. Requires a platform token. + # @param id [String] Project ID + # @param create_project_access_token_request [CreateProjectAccessTokenRequest] + # @param [Hash] opts the optional parameters + # @return [CreatedProjectAccessToken] + def create_project_access_token(id, create_project_access_token_request, opts = {}) + data, _status_code, _headers = create_project_access_token_with_http_info(id, create_project_access_token_request, opts) + data + end + + # Create a project access token + # Creates a project access token and returns its secret. The secret is in this response and nowhere else. Only its hash is stored, so it cannot be retrieved, displayed, or recovered later — save it when you create it. The name must be unique within the project, so a retry cannot mint a second credential. It cannot recover the first one either. A retry that returns `409` with code `access_token_name_exists` means the original create committed and its secret is unrecoverable: list the project's tokens, revoke the one holding that name, and create it again. Requires a platform token. + # @param id [String] Project ID + # @param create_project_access_token_request [CreateProjectAccessTokenRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(CreatedProjectAccessToken, Integer, Hash)>] CreatedProjectAccessToken data, response status code and response headers + def create_project_access_token_with_http_info(id, create_project_access_token_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ProjectAccessTokensApi.create_project_access_token ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling ProjectAccessTokensApi.create_project_access_token" + end + # verify the required parameter 'create_project_access_token_request' is set + if @api_client.config.client_side_validation && create_project_access_token_request.nil? + fail ArgumentError, "Missing the required parameter 'create_project_access_token_request' when calling ProjectAccessTokensApi.create_project_access_token" + end + # resource path + local_var_path = '/projects/{id}/access-tokens'.sub('{' + 'id' + '}', CGI.escape(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_project_access_token_request) + + # return_type + return_type = opts[:debug_return_type] || 'CreatedProjectAccessToken' + + # auth_names + auth_names = opts[:debug_auth_names] || ['UserToken'] + + new_options = opts.merge( + :operation => :"ProjectAccessTokensApi.create_project_access_token", + :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, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ProjectAccessTokensApi#create_project_access_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get a project access token + # Returns one token's metadata. Never its secret, which is not stored in a recoverable form. Requires a platform token. + # @param id [String] Project ID + # @param token_id [String] Project access token ID + # @param [Hash] opts the optional parameters + # @return [ProjectAccessToken] + def get_project_access_token(id, token_id, opts = {}) + data, _status_code, _headers = get_project_access_token_with_http_info(id, token_id, opts) + data + end + + # Get a project access token + # Returns one token's metadata. Never its secret, which is not stored in a recoverable form. Requires a platform token. + # @param id [String] Project ID + # @param token_id [String] Project access token ID + # @param [Hash] opts the optional parameters + # @return [Array<(ProjectAccessToken, Integer, Hash)>] ProjectAccessToken data, response status code and response headers + def get_project_access_token_with_http_info(id, token_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ProjectAccessTokensApi.get_project_access_token ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling ProjectAccessTokensApi.get_project_access_token" + end + # verify the required parameter 'token_id' is set + if @api_client.config.client_side_validation && token_id.nil? + fail ArgumentError, "Missing the required parameter 'token_id' when calling ProjectAccessTokensApi.get_project_access_token" + end + # resource path + local_var_path = '/projects/{id}/access-tokens/{tokenId}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)).sub('{' + 'tokenId' + '}', CGI.escape(token_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] || 'ProjectAccessToken' + + # auth_names + auth_names = opts[:debug_auth_names] || ['UserToken'] + + new_options = opts.merge( + :operation => :"ProjectAccessTokensApi.get_project_access_token", + :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, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ProjectAccessTokensApi#get_project_access_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Per-day request counts for one access token + # Returns a zero-filled daily series of request counts for a single token, oldest first, so the response always has exactly `days` entries. `days` defaults to 30 and is capped at 60, matching how long per-day counts are retained. A project access token may read only its own usage; asking for another token's returns `403`. A platform token may read any token in the project. + # @param id [String] Project ID + # @param token_id [String] Project access token ID + # @param [Hash] opts the optional parameters + # @option opts [Integer] :days Number of trailing days to return (1-60, default 30). (default to 30) + # @return [ProjectAccessTokenUsage] + def get_project_access_token_usage(id, token_id, opts = {}) + data, _status_code, _headers = get_project_access_token_usage_with_http_info(id, token_id, opts) + data + end + + # Per-day request counts for one access token + # Returns a zero-filled daily series of request counts for a single token, oldest first, so the response always has exactly `days` entries. `days` defaults to 30 and is capped at 60, matching how long per-day counts are retained. A project access token may read only its own usage; asking for another token's returns `403`. A platform token may read any token in the project. + # @param id [String] Project ID + # @param token_id [String] Project access token ID + # @param [Hash] opts the optional parameters + # @option opts [Integer] :days Number of trailing days to return (1-60, default 30). (default to 30) + # @return [Array<(ProjectAccessTokenUsage, Integer, Hash)>] ProjectAccessTokenUsage data, response status code and response headers + def get_project_access_token_usage_with_http_info(id, token_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ProjectAccessTokensApi.get_project_access_token_usage ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling ProjectAccessTokensApi.get_project_access_token_usage" + end + # verify the required parameter 'token_id' is set + if @api_client.config.client_side_validation && token_id.nil? + fail ArgumentError, "Missing the required parameter 'token_id' when calling ProjectAccessTokensApi.get_project_access_token_usage" + end + if @api_client.config.client_side_validation && !opts[:'days'].nil? && opts[:'days'] > 60 + fail ArgumentError, 'invalid value for "opts[:"days"]" when calling ProjectAccessTokensApi.get_project_access_token_usage, must be smaller than or equal to 60.' + end + + if @api_client.config.client_side_validation && !opts[:'days'].nil? && opts[:'days'] < 1 + fail ArgumentError, 'invalid value for "opts[:"days"]" when calling ProjectAccessTokensApi.get_project_access_token_usage, must be greater than or equal to 1.' + end + + # resource path + local_var_path = '/projects/{id}/access-tokens/{tokenId}/usage'.sub('{' + 'id' + '}', CGI.escape(id.to_s)).sub('{' + 'tokenId' + '}', CGI.escape(token_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'days'] = opts[:'days'] if !opts[:'days'].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] || 'ProjectAccessTokenUsage' + + # auth_names + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] + + new_options = opts.merge( + :operation => :"ProjectAccessTokensApi.get_project_access_token_usage", + :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, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ProjectAccessTokensApi#get_project_access_token_usage\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List a project's access tokens + # Lists the project's access tokens, newest first. Secrets are never returned: only a hash is stored, so a token's value exists solely in the response to the create call. Only tokens that can still authenticate are returned by default, so revoked and expired ones are hidden. Pass `include_revoked=true` to see them, which is how you find out what a key did before it stopped working. Requires a platform token. A project access token cannot manage project access tokens, so a leaked credential cannot enumerate or replace itself. + # @param id [String] Project ID + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number (1-indexed) for offset pagination. Declares no schema default so the request validator does not inject one: handlers that omit `page` see it unset (nil) and default to 1 in code, while cursor-first endpoints (e.g. the project deployments feed) can detect its absence to stay in keyset/search mode. Supplying `page` selects offset pagination. + # @option opts [Integer] :limit Number of items per page (max 100) (default to 10) + # @option opts [String] :search Case-insensitive substring match on the resource `name`. See the endpoint description for supported pagination modes. + # @option opts [Boolean] :include_revoked Include tokens that can no longer authenticate — both revoked and expired ones. (default to false) + # @return [PaginatedProjectAccessTokens] + def list_project_access_tokens(id, opts = {}) + data, _status_code, _headers = list_project_access_tokens_with_http_info(id, opts) + data + end + + # List a project's access tokens + # Lists the project's access tokens, newest first. Secrets are never returned: only a hash is stored, so a token's value exists solely in the response to the create call. Only tokens that can still authenticate are returned by default, so revoked and expired ones are hidden. Pass `include_revoked=true` to see them, which is how you find out what a key did before it stopped working. Requires a platform token. A project access token cannot manage project access tokens, so a leaked credential cannot enumerate or replace itself. + # @param id [String] Project ID + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Page number (1-indexed) for offset pagination. Declares no schema default so the request validator does not inject one: handlers that omit `page` see it unset (nil) and default to 1 in code, while cursor-first endpoints (e.g. the project deployments feed) can detect its absence to stay in keyset/search mode. Supplying `page` selects offset pagination. + # @option opts [Integer] :limit Number of items per page (max 100) (default to 10) + # @option opts [String] :search Case-insensitive substring match on the resource `name`. See the endpoint description for supported pagination modes. + # @option opts [Boolean] :include_revoked Include tokens that can no longer authenticate — both revoked and expired ones. (default to false) + # @return [Array<(PaginatedProjectAccessTokens, Integer, Hash)>] PaginatedProjectAccessTokens data, response status code and response headers + def list_project_access_tokens_with_http_info(id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ProjectAccessTokensApi.list_project_access_tokens ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling ProjectAccessTokensApi.list_project_access_tokens" + end + if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1 + fail ArgumentError, 'invalid value for "opts[:"page"]" when calling ProjectAccessTokensApi.list_project_access_tokens, must be greater than or equal to 1.' + end + + if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100 + fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ProjectAccessTokensApi.list_project_access_tokens, must be smaller than or equal to 100.' + end + + if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 + fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ProjectAccessTokensApi.list_project_access_tokens, must be greater than or equal to 1.' + end + + if @api_client.config.client_side_validation && !opts[:'search'].nil? && opts[:'search'].to_s.length > 256 + fail ArgumentError, 'invalid value for "opts[:"search"]" when calling ProjectAccessTokensApi.list_project_access_tokens, the character length must be smaller than or equal to 256.' + end + + # resource path + local_var_path = '/projects/{id}/access-tokens'.sub('{' + 'id' + '}', CGI.escape(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[:'include_revoked'] = opts[:'include_revoked'] if !opts[:'include_revoked'].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] || 'PaginatedProjectAccessTokens' + + # auth_names + auth_names = opts[:debug_auth_names] || ['UserToken'] + + new_options = opts.merge( + :operation => :"ProjectAccessTokensApi.list_project_access_tokens", + :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, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ProjectAccessTokensApi#list_project_access_tokens\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Per-day request counts for every access token in a project + # Returns a zero-filled daily series of request counts for each of the project's access tokens, oldest first. Every day in the window is present, so a gap reads as zero rather than missing. Revoked tokens are included, because the traffic they made before revocation is usually the reason you are looking. `days` defaults to 30 and is capped at 60, which is also how long per-day counts are retained — a longer window cannot be answered. A platform token sees every token in the project. A project access token sees only its own row, so it can watch its own traffic without being able to enumerate the project's other credentials by name. + # @param id [String] Project ID + # @param [Hash] opts the optional parameters + # @option opts [Integer] :days Number of trailing days to return (1-60, default 30). (default to 30) + # @return [Array] + def list_project_access_tokens_usage(id, opts = {}) + data, _status_code, _headers = list_project_access_tokens_usage_with_http_info(id, opts) + data + end + + # Per-day request counts for every access token in a project + # Returns a zero-filled daily series of request counts for each of the project's access tokens, oldest first. Every day in the window is present, so a gap reads as zero rather than missing. Revoked tokens are included, because the traffic they made before revocation is usually the reason you are looking. `days` defaults to 30 and is capped at 60, which is also how long per-day counts are retained — a longer window cannot be answered. A platform token sees every token in the project. A project access token sees only its own row, so it can watch its own traffic without being able to enumerate the project's other credentials by name. + # @param id [String] Project ID + # @param [Hash] opts the optional parameters + # @option opts [Integer] :days Number of trailing days to return (1-60, default 30). (default to 30) + # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers + def list_project_access_tokens_usage_with_http_info(id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ProjectAccessTokensApi.list_project_access_tokens_usage ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling ProjectAccessTokensApi.list_project_access_tokens_usage" + end + if @api_client.config.client_side_validation && !opts[:'days'].nil? && opts[:'days'] > 60 + fail ArgumentError, 'invalid value for "opts[:"days"]" when calling ProjectAccessTokensApi.list_project_access_tokens_usage, must be smaller than or equal to 60.' + end + + if @api_client.config.client_side_validation && !opts[:'days'].nil? && opts[:'days'] < 1 + fail ArgumentError, 'invalid value for "opts[:"days"]" when calling ProjectAccessTokensApi.list_project_access_tokens_usage, must be greater than or equal to 1.' + end + + # resource path + local_var_path = '/projects/{id}/access-tokens/usage'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'days'] = opts[:'days'] if !opts[:'days'].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] || 'Array' + + # auth_names + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] + + new_options = opts.merge( + :operation => :"ProjectAccessTokensApi.list_project_access_tokens_usage", + :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, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ProjectAccessTokensApi#list_project_access_tokens_usage\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Revoke a project access token + # Revokes the token. It stops authenticating immediately in the region handling this call and within seconds across Volcano's other regions. The record is kept rather than deleted, so the token's name, prefix, last use, and request history stay available — which is what you need if you are revoking because a secret leaked. Revoking an already-revoked token succeeds. Revoking does not undo anything the token already did. Treat whatever it could reach as exposed and rotate accordingly. Requires a platform token. + # @param id [String] Project ID + # @param token_id [String] Project access token ID + # @param [Hash] opts the optional parameters + # @return [nil] + def revoke_project_access_token(id, token_id, opts = {}) + revoke_project_access_token_with_http_info(id, token_id, opts) + nil + end + + # Revoke a project access token + # Revokes the token. It stops authenticating immediately in the region handling this call and within seconds across Volcano's other regions. The record is kept rather than deleted, so the token's name, prefix, last use, and request history stay available — which is what you need if you are revoking because a secret leaked. Revoking an already-revoked token succeeds. Revoking does not undo anything the token already did. Treat whatever it could reach as exposed and rotate accordingly. Requires a platform token. + # @param id [String] Project ID + # @param token_id [String] Project access token ID + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def revoke_project_access_token_with_http_info(id, token_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ProjectAccessTokensApi.revoke_project_access_token ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling ProjectAccessTokensApi.revoke_project_access_token" + end + # verify the required parameter 'token_id' is set + if @api_client.config.client_side_validation && token_id.nil? + fail ArgumentError, "Missing the required parameter 'token_id' when calling ProjectAccessTokensApi.revoke_project_access_token" + end + # resource path + local_var_path = '/projects/{id}/access-tokens/{tokenId}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)).sub('{' + 'tokenId' + '}', CGI.escape(token_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] + + # auth_names + auth_names = opts[:debug_auth_names] || ['UserToken'] + + new_options = opts.merge( + :operation => :"ProjectAccessTokensApi.revoke_project_access_token", + :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, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ProjectAccessTokensApi#revoke_project_access_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/volcano/generated/lib/volcano-generated/api/projects_api.rb b/lib/volcano/generated/lib/volcano-generated/api/projects_api.rb index 31a61717..66d6c7f0 100644 --- a/lib/volcano/generated/lib/volcano-generated/api/projects_api.rb +++ b/lib/volcano/generated/lib/volcano-generated/api/projects_api.rb @@ -77,7 +77,7 @@ def apply_project_config_with_http_info(id, project_config, opts = {}) return_type = opts[:debug_return_type] || 'ProjectConfigApplyResult' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"ProjectsApi.apply_project_config", @@ -140,7 +140,7 @@ def cancel_project_source_export_with_http_info(id, opts = {}) return_type = opts[:debug_return_type] # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"ProjectsApi.cancel_project_source_export", @@ -214,7 +214,7 @@ def connect_project_git_with_http_info(id, connect_project_git_request, opts = { return_type = opts[:debug_return_type] || 'ProjectGitConnection' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"ProjectsApi.connect_project_git", @@ -345,7 +345,7 @@ def delete_project_with_http_info(id, opts = {}) return_type = opts[:debug_return_type] # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"ProjectsApi.delete_project", @@ -408,7 +408,7 @@ def delete_project_logo_with_http_info(id, opts = {}) return_type = opts[:debug_return_type] || 'Project' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"ProjectsApi.delete_project_logo", @@ -469,7 +469,7 @@ def disconnect_project_git_with_http_info(id, opts = {}) return_type = opts[:debug_return_type] # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"ProjectsApi.disconnect_project_git", @@ -543,7 +543,7 @@ def export_project_source_with_http_info(id, export_project_source_request, opts return_type = opts[:debug_return_type] || 'ProjectSourceExport' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"ProjectsApi.export_project_source", @@ -604,7 +604,7 @@ def get_project_with_http_info(id, opts = {}) return_type = opts[:debug_return_type] || 'Project' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"ProjectsApi.get_project", @@ -624,7 +624,7 @@ def get_project_with_http_info(id, opts = {}) end # Export project configuration - # 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. + # 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 and frontend_shared_variables contain names only; the YAML rendering adds a header comment describing how to set them via CLI environment interpolation. # @param id [String] Project ID # @param [Hash] opts the optional parameters # @option opts [String] :format Response format override. Takes precedence over the Accept header. @@ -635,7 +635,7 @@ def get_project_config(id, opts = {}) end # Export project configuration - # 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. + # 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 and frontend_shared_variables contain names only; the YAML rendering adds a header comment describing how to set them via CLI environment interpolation. # @param id [String] Project ID # @param [Hash] opts the optional parameters # @option opts [String] :format Response format override. Takes precedence over the Accept header. @@ -674,7 +674,7 @@ def get_project_config_with_http_info(id, opts = {}) return_type = opts[:debug_return_type] || 'ProjectConfig' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"ProjectsApi.get_project_config", @@ -735,7 +735,7 @@ def get_project_git_connection_with_http_info(id, opts = {}) return_type = opts[:debug_return_type] || 'ProjectGitConnection' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"ProjectsApi.get_project_git_connection", @@ -796,7 +796,7 @@ def get_project_git_deploy_settings_with_http_info(id, opts = {}) return_type = opts[:debug_return_type] || 'ProjectGitDeploySettings' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"ProjectsApi.get_project_git_deploy_settings", @@ -859,7 +859,7 @@ def get_project_health_with_http_info(id, opts = {}) return_type = opts[:debug_return_type] || 'ProjectHealthResponse' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"ProjectsApi.get_project_health", @@ -985,7 +985,7 @@ def get_project_source_export_with_http_info(id, opts = {}) return_type = opts[:debug_return_type] || 'ProjectSourceExportState' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"ProjectsApi.get_project_source_export", @@ -1048,7 +1048,7 @@ def get_project_usage_with_http_info(id, opts = {}) return_type = opts[:debug_return_type] || 'ProjectUsageResponse' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"ProjectsApi.get_project_usage", @@ -1288,7 +1288,7 @@ def list_project_deployments_with_http_info(id, opts = {}) return_type = opts[:debug_return_type] || 'PaginatedProjectDeployments' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"ProjectsApi.list_project_deployments", @@ -1464,7 +1464,7 @@ def query_project_metrics_with_http_info(id, project_metrics_query_request, opts return_type = opts[:debug_return_type] || 'ProjectMetricsQueryResponse' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"ProjectsApi.query_project_metrics", @@ -1483,6 +1483,80 @@ def query_project_metrics_with_http_info(id, project_metrics_query_request, opts return data, status_code, headers end + # Replace frontend shared variable names + # Atomically replaces the complete shared frontend-variable list without changing values. Names must already exist. Validates final affected frontend environments before membership or propagation side effects. An empty list clears membership. Omitted names remain stored outside the frontend shared list. + # @param id [String] Project ID + # @param replace_frontend_shared_variables_request [ReplaceFrontendSharedVariablesRequest] + # @param [Hash] opts the optional parameters + # @return [nil] + def replace_frontend_shared_variables(id, replace_frontend_shared_variables_request, opts = {}) + replace_frontend_shared_variables_with_http_info(id, replace_frontend_shared_variables_request, opts) + nil + end + + # Replace frontend shared variable names + # Atomically replaces the complete shared frontend-variable list without changing values. Names must already exist. Validates final affected frontend environments before membership or propagation side effects. An empty list clears membership. Omitted names remain stored outside the frontend shared list. + # @param id [String] Project ID + # @param replace_frontend_shared_variables_request [ReplaceFrontendSharedVariablesRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def replace_frontend_shared_variables_with_http_info(id, replace_frontend_shared_variables_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ProjectsApi.replace_frontend_shared_variables ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling ProjectsApi.replace_frontend_shared_variables" + end + # verify the required parameter 'replace_frontend_shared_variables_request' is set + if @api_client.config.client_side_validation && replace_frontend_shared_variables_request.nil? + fail ArgumentError, "Missing the required parameter 'replace_frontend_shared_variables_request' when calling ProjectsApi.replace_frontend_shared_variables" + end + # resource path + local_var_path = '/projects/{id}/frontend-shared-variables'.sub('{' + 'id' + '}', CGI.escape(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(replace_frontend_shared_variables_request) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['UserToken'] + + new_options = opts.merge( + :operation => :"ProjectsApi.replace_frontend_shared_variables", + :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, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ProjectsApi#replace_frontend_shared_variables\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Replace shared variable names # 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. # @param id [String] Project ID @@ -1538,7 +1612,7 @@ def replace_shared_variables_with_http_info(id, replace_shared_variables_request return_type = opts[:debug_return_type] # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"ProjectsApi.replace_shared_variables", @@ -1612,7 +1686,7 @@ def set_project_git_production_branch_with_http_info(id, set_project_git_product return_type = opts[:debug_return_type] || 'ProjectGitConnection' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"ProjectsApi.set_project_git_production_branch", @@ -1693,7 +1767,7 @@ def summarize_project_deployments_with_http_info(id, resource_type, opts = {}) return_type = opts[:debug_return_type] || 'ProjectDeploymentSummary' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"ProjectsApi.summarize_project_deployments", @@ -1765,7 +1839,7 @@ def update_project_with_http_info(id, update_project_request, opts = {}) return_type = opts[:debug_return_type] || 'Project' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"ProjectsApi.update_project", @@ -1839,7 +1913,7 @@ def update_project_git_deploy_settings_with_http_info(id, update_project_git_dep return_type = opts[:debug_return_type] || 'ProjectGitDeploySettings' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"ProjectsApi.update_project_git_deploy_settings", @@ -1914,7 +1988,7 @@ def upload_project_logo_with_http_info(id, logo, opts = {}) return_type = opts[:debug_return_type] || 'Project' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"ProjectsApi.upload_project_logo", diff --git a/lib/volcano/generated/lib/volcano-generated/api/realtime_api.rb b/lib/volcano/generated/lib/volcano-generated/api/realtime_api.rb index dd7a821a..4d7cf802 100644 --- a/lib/volcano/generated/lib/volcano-generated/api/realtime_api.rb +++ b/lib/volcano/generated/lib/volcano-generated/api/realtime_api.rb @@ -63,7 +63,7 @@ def get_realtime_config_with_http_info(id, opts = {}) return_type = opts[:debug_return_type] || 'RealtimeConfig' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"RealtimeApi.get_realtime_config", @@ -126,7 +126,7 @@ def get_realtime_stats_with_http_info(id, opts = {}) return_type = opts[:debug_return_type] || 'RealtimeStats' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"RealtimeApi.get_realtime_stats", @@ -200,7 +200,7 @@ def update_realtime_config_with_http_info(id, update_realtime_config_request, op return_type = opts[:debug_return_type] || 'RealtimeConfig' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"RealtimeApi.update_realtime_config", diff --git a/lib/volcano/generated/lib/volcano-generated/api/service_keys_api.rb b/lib/volcano/generated/lib/volcano-generated/api/service_keys_api.rb index 8a816c56..7463f349 100644 --- a/lib/volcano/generated/lib/volcano-generated/api/service_keys_api.rb +++ b/lib/volcano/generated/lib/volcano-generated/api/service_keys_api.rb @@ -74,7 +74,7 @@ def create_service_key_with_http_info(id, create_service_key_request, opts = {}) return_type = opts[:debug_return_type] || 'ServiceKey' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"ServiceKeysApi.create_service_key", @@ -141,7 +141,7 @@ def delete_service_key_with_http_info(id, key_id, opts = {}) return_type = opts[:debug_return_type] # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"ServiceKeysApi.delete_service_key", @@ -210,7 +210,7 @@ def get_service_key_with_http_info(id, key_id, opts = {}) return_type = opts[:debug_return_type] || 'ServiceKey' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"ServiceKeysApi.get_service_key", @@ -311,7 +311,7 @@ def list_service_keys_with_http_info(id, opts = {}) return_type = opts[:debug_return_type] || 'PaginatedServiceKeys' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"ServiceKeysApi.list_service_keys", @@ -331,7 +331,7 @@ def list_service_keys_with_http_info(id, opts = {}) end # Regenerate service key - # Generate new JWT value for existing key. The old key is immediately invalidated. Update your backend services with the new key before regenerating in production. + # Generate new JWT value for existing key. The old key stops working within a few seconds. Update your backend services with the new key before regenerating in production. # @param id [String] Project ID # @param key_id [String] # @param [Hash] opts the optional parameters @@ -342,7 +342,7 @@ def regenerate_service_key(id, key_id, opts = {}) end # Regenerate service key - # Generate new JWT value for existing key. The old key is immediately invalidated. Update your backend services with the new key before regenerating in production. + # Generate new JWT value for existing key. The old key stops working within a few seconds. Update your backend services with the new key before regenerating in production. # @param id [String] Project ID # @param key_id [String] # @param [Hash] opts the optional parameters @@ -380,7 +380,7 @@ def regenerate_service_key_with_http_info(id, key_id, opts = {}) return_type = opts[:debug_return_type] || 'ServiceKey' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"ServiceKeysApi.regenerate_service_key", diff --git a/lib/volcano/generated/lib/volcano-generated/api/storage_admin_api.rb b/lib/volcano/generated/lib/volcano-generated/api/storage_admin_api.rb index 8dd6d4e1..5f5b8ceb 100644 --- a/lib/volcano/generated/lib/volcano-generated/api/storage_admin_api.rb +++ b/lib/volcano/generated/lib/volcano-generated/api/storage_admin_api.rb @@ -63,7 +63,7 @@ def get_storage_stats_with_http_info(id, opts = {}) return_type = opts[:debug_return_type] || 'StorageStats' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"StorageAdminApi.get_storage_stats", @@ -167,7 +167,7 @@ def list_storage_objects_admin_with_http_info(id, opts = {}) return_type = opts[:debug_return_type] || 'ListStorageObjectsAdmin200Response' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"StorageAdminApi.list_storage_objects_admin", diff --git a/lib/volcano/generated/lib/volcano-generated/api/storage_buckets_api.rb b/lib/volcano/generated/lib/volcano-generated/api/storage_buckets_api.rb index fcf44d8f..dba91207 100644 --- a/lib/volcano/generated/lib/volcano-generated/api/storage_buckets_api.rb +++ b/lib/volcano/generated/lib/volcano-generated/api/storage_buckets_api.rb @@ -72,7 +72,7 @@ def create_storage_bucket_with_http_info(id, create_storage_bucket_request, opts return_type = opts[:debug_return_type] || 'StorageBucket' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"StorageBucketsApi.create_storage_bucket", @@ -150,7 +150,7 @@ def delete_storage_bucket_with_http_info(id, bucket_name, opts = {}) return_type = opts[:debug_return_type] # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"StorageBucketsApi.delete_storage_bucket", @@ -230,7 +230,7 @@ def get_storage_bucket_with_http_info(id, bucket_name, opts = {}) return_type = opts[:debug_return_type] || 'StorageBucket' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"StorageBucketsApi.get_storage_bucket", @@ -324,7 +324,7 @@ def list_storage_buckets_with_http_info(id, opts = {}) return_type = opts[:debug_return_type] || 'ListStorageBuckets200Response' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"StorageBucketsApi.list_storage_buckets", @@ -415,7 +415,7 @@ def update_storage_bucket_with_http_info(id, bucket_name, update_storage_bucket_ return_type = opts[:debug_return_type] || 'StorageBucket' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"StorageBucketsApi.update_storage_bucket", diff --git a/lib/volcano/generated/lib/volcano-generated/api/storage_policies_api.rb b/lib/volcano/generated/lib/volcano-generated/api/storage_policies_api.rb index 014eb23a..5c53c752 100644 --- a/lib/volcano/generated/lib/volcano-generated/api/storage_policies_api.rb +++ b/lib/volcano/generated/lib/volcano-generated/api/storage_policies_api.rb @@ -91,7 +91,7 @@ def create_storage_policy_with_http_info(id, bucket_name, create_storage_policy_ return_type = opts[:debug_return_type] || 'StoragePolicy' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"StoragePoliciesApi.create_storage_policy", @@ -175,7 +175,7 @@ def delete_storage_policy_with_http_info(id, bucket_name, policy_id, opts = {}) return_type = opts[:debug_return_type] # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"StoragePoliciesApi.delete_storage_policy", @@ -255,7 +255,7 @@ def list_storage_policies_with_http_info(id, bucket_name, opts = {}) return_type = opts[:debug_return_type] || 'Array' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"StoragePoliciesApi.list_storage_policies", diff --git a/lib/volcano/generated/lib/volcano-generated/api/system_api.rb b/lib/volcano/generated/lib/volcano-generated/api/system_api.rb index 0f15388e..4c7cdcd1 100644 --- a/lib/volcano/generated/lib/volcano-generated/api/system_api.rb +++ b/lib/volcano/generated/lib/volcano-generated/api/system_api.rb @@ -19,6 +19,314 @@ class SystemApi def initialize(api_client = ApiClient.default) @api_client = api_client end + # Model Context Protocol endpoint + # Streamable-HTTP MCP endpoint: one JSON-RPC 2.0 object per request, one response per request. There is no server-to-client stream, so a `GET` returns `405`, and a batched array is rejected. Authenticated with a **project access token**. The endpoint takes its project from the credential, so a platform token is refused with `403` — it names no project, and letting a tool argument choose one would hand an agent its own blast radius. Scope carries over from the REST API. A `read_only` token is not offered mutating tools or credential-returning reads, and is refused if it calls one anyway. Revoking the token ends MCP access on the same path it ends API access. Methods: `initialize`, `notifications/initialized`, `ping`, `tools/list`, `tools/call`. See the [MCP guide](https://docs.volcano.dev/platform/interfaces/mcp) for the tool surface and client configuration. + # @param call_mcp_request [CallMCPRequest] + # @param [Hash] opts the optional parameters + # @return [CallMCP200Response] + def call_mcp(call_mcp_request, opts = {}) + data, _status_code, _headers = call_mcp_with_http_info(call_mcp_request, opts) + data + end + + # Model Context Protocol endpoint + # Streamable-HTTP MCP endpoint: one JSON-RPC 2.0 object per request, one response per request. There is no server-to-client stream, so a `GET` returns `405`, and a batched array is rejected. Authenticated with a **project access token**. The endpoint takes its project from the credential, so a platform token is refused with `403` — it names no project, and letting a tool argument choose one would hand an agent its own blast radius. Scope carries over from the REST API. A `read_only` token is not offered mutating tools or credential-returning reads, and is refused if it calls one anyway. Revoking the token ends MCP access on the same path it ends API access. Methods: `initialize`, `notifications/initialized`, `ping`, `tools/list`, `tools/call`. See the [MCP guide](https://docs.volcano.dev/platform/interfaces/mcp) for the tool surface and client configuration. + # @param call_mcp_request [CallMCPRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(CallMCP200Response, Integer, Hash)>] CallMCP200Response data, response status code and response headers + def call_mcp_with_http_info(call_mcp_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SystemApi.call_mcp ...' + end + # verify the required parameter 'call_mcp_request' is set + if @api_client.config.client_side_validation && call_mcp_request.nil? + fail ArgumentError, "Missing the required parameter 'call_mcp_request' when calling SystemApi.call_mcp" + end + # resource path + local_var_path = '/mcp' + + # 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(call_mcp_request) + + # return_type + return_type = opts[:debug_return_type] || 'CallMCP200Response' + + # auth_names + auth_names = opts[:debug_auth_names] || ['ProjectAccessToken'] + + new_options = opts.merge( + :operation => :"SystemApi.call_mcp", + :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, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SystemApi#call_mcp\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Fetch the OpenAPI specification as JSON + # Returns this specification as a self-contained JSON document, with every reference resolved. It is generated from the same document the server validates requests against, so a client generated from it cannot describe a different API than the one that answers. No credential is required: a client generator fetches this by URL before its user has a token, and every path here is already published in the API reference. The response carries a strong `ETag`; send it back as `If-None-Match` to get `304 Not Modified` instead of the whole document. + # @param [Hash] opts the optional parameters + # @option opts [String] :if_none_match Entity tag from an earlier response, returning `304 Not Modified` while it still matches. Accepts the full condition: `*`, a comma-separated list, and weak tags of the form `W/\"tag\"`. + # @return [Hash] + def get_open_api_spec_json(opts = {}) + data, _status_code, _headers = get_open_api_spec_json_with_http_info(opts) + data + end + + # Fetch the OpenAPI specification as JSON + # Returns this specification as a self-contained JSON document, with every reference resolved. It is generated from the same document the server validates requests against, so a client generated from it cannot describe a different API than the one that answers. No credential is required: a client generator fetches this by URL before its user has a token, and every path here is already published in the API reference. The response carries a strong `ETag`; send it back as `If-None-Match` to get `304 Not Modified` instead of the whole document. + # @param [Hash] opts the optional parameters + # @option opts [String] :if_none_match Entity tag from an earlier response, returning `304 Not Modified` while it still matches. Accepts the full condition: `*`, a comma-separated list, and weak tags of the form `W/\"tag\"`. + # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers + def get_open_api_spec_json_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SystemApi.get_open_api_spec_json ...' + end + # resource path + local_var_path = '/openapi.json' + + # 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'] + header_params[:'If-None-Match'] = opts[:'if_none_match'] if !opts[:'if_none_match'].nil? + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'Hash' + + # auth_names + auth_names = opts[:debug_auth_names] || [] + + new_options = opts.merge( + :operation => :"SystemApi.get_open_api_spec_json", + :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, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SystemApi#get_open_api_spec_json\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Fetch the OpenAPI specification as YAML + # The same document as `/openapi.json`, serialized as YAML for tools that prefer it. See that operation for caching and authentication notes. + # @param [Hash] opts the optional parameters + # @option opts [String] :if_none_match Entity tag from an earlier response, returning `304 Not Modified` while it still matches. Accepts the full condition: `*`, a comma-separated list, and weak tags of the form `W/\"tag\"`. + # @return [Hash] + def get_open_api_spec_yaml(opts = {}) + data, _status_code, _headers = get_open_api_spec_yaml_with_http_info(opts) + data + end + + # Fetch the OpenAPI specification as YAML + # The same document as `/openapi.json`, serialized as YAML for tools that prefer it. See that operation for caching and authentication notes. + # @param [Hash] opts the optional parameters + # @option opts [String] :if_none_match Entity tag from an earlier response, returning `304 Not Modified` while it still matches. Accepts the full condition: `*`, a comma-separated list, and weak tags of the form `W/\"tag\"`. + # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers + def get_open_api_spec_yaml_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SystemApi.get_open_api_spec_yaml ...' + end + # resource path + local_var_path = '/openapi.yaml' + + # 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/yaml', 'application/json']) unless header_params['Accept'] + header_params[:'If-None-Match'] = opts[:'if_none_match'] if !opts[:'if_none_match'].nil? + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'Hash' + + # auth_names + auth_names = opts[:debug_auth_names] || [] + + new_options = opts.merge( + :operation => :"SystemApi.get_open_api_spec_yaml", + :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, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SystemApi#get_open_api_spec_yaml\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Check the JSON OpenAPI specification + # The headers `GET /openapi.json` would return, so a cache can pick up the current `ETag` without transferring the document. + # @param [Hash] opts the optional parameters + # @option opts [String] :if_none_match Entity tag from an earlier response, returning `304 Not Modified` while it still matches. Accepts the full condition: `*`, a comma-separated list, and weak tags of the form `W/\"tag\"`. + # @return [nil] + def head_open_api_spec_json(opts = {}) + head_open_api_spec_json_with_http_info(opts) + nil + end + + # Check the JSON OpenAPI specification + # The headers `GET /openapi.json` would return, so a cache can pick up the current `ETag` without transferring the document. + # @param [Hash] opts the optional parameters + # @option opts [String] :if_none_match Entity tag from an earlier response, returning `304 Not Modified` while it still matches. Accepts the full condition: `*`, a comma-separated list, and weak tags of the form `W/\"tag\"`. + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def head_open_api_spec_json_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SystemApi.head_open_api_spec_json ...' + end + # resource path + local_var_path = '/openapi.json' + + # 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'] + header_params[:'If-None-Match'] = opts[:'if_none_match'] if !opts[:'if_none_match'].nil? + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [] + + new_options = opts.merge( + :operation => :"SystemApi.head_open_api_spec_json", + :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(:HEAD, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SystemApi#head_open_api_spec_json\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Check the YAML OpenAPI specification + # The headers `GET /openapi.yaml` would return, so a cache can pick up the current `ETag` without transferring the document. + # @param [Hash] opts the optional parameters + # @option opts [String] :if_none_match Entity tag from an earlier response, returning `304 Not Modified` while it still matches. Accepts the full condition: `*`, a comma-separated list, and weak tags of the form `W/\"tag\"`. + # @return [nil] + def head_open_api_spec_yaml(opts = {}) + head_open_api_spec_yaml_with_http_info(opts) + nil + end + + # Check the YAML OpenAPI specification + # The headers `GET /openapi.yaml` would return, so a cache can pick up the current `ETag` without transferring the document. + # @param [Hash] opts the optional parameters + # @option opts [String] :if_none_match Entity tag from an earlier response, returning `304 Not Modified` while it still matches. Accepts the full condition: `*`, a comma-separated list, and weak tags of the form `W/\"tag\"`. + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def head_open_api_spec_yaml_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SystemApi.head_open_api_spec_yaml ...' + end + # resource path + local_var_path = '/openapi.yaml' + + # 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'] + header_params[:'If-None-Match'] = opts[:'if_none_match'] if !opts[:'if_none_match'].nil? + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [] + + new_options = opts.merge( + :operation => :"SystemApi.head_open_api_spec_yaml", + :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(:HEAD, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SystemApi#head_open_api_spec_yaml\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Health check endpoint # Returns server health status. Used for load balancer and monitoring checks. # @param [Hash] opts the optional parameters diff --git a/lib/volcano/generated/lib/volcano-generated/api/variables_api.rb b/lib/volcano/generated/lib/volcano-generated/api/variables_api.rb index 82522d03..5cec09d2 100644 --- a/lib/volcano/generated/lib/volcano-generated/api/variables_api.rb +++ b/lib/volcano/generated/lib/volcano-generated/api/variables_api.rb @@ -74,7 +74,7 @@ def create_variable_with_http_info(id, create_variable_request, opts = {}) return_type = opts[:debug_return_type] || 'Variable' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"VariablesApi.create_variable", @@ -156,7 +156,7 @@ def delete_variable_with_http_info(id, name, opts = {}) return_type = opts[:debug_return_type] # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"VariablesApi.delete_variable", @@ -238,7 +238,7 @@ def get_variable_with_http_info(id, name, opts = {}) return_type = opts[:debug_return_type] || 'Variable' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"VariablesApi.get_variable", @@ -339,7 +339,7 @@ def list_variables_with_http_info(id, opts = {}) return_type = opts[:debug_return_type] || 'PaginatedVariables' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"VariablesApi.list_variables", @@ -432,7 +432,7 @@ def update_variable_with_http_info(id, name, update_variable_request, opts = {}) return_type = opts[:debug_return_type] || 'Variable' # auth_names - auth_names = opts[:debug_auth_names] || ['UserToken'] + auth_names = opts[:debug_auth_names] || ['UserToken', 'ProjectAccessToken'] new_options = opts.merge( :operation => :"VariablesApi.update_variable", diff --git a/lib/volcano/generated/lib/volcano-generated/configuration.rb b/lib/volcano/generated/lib/volcano-generated/configuration.rb index 0c605526..efb22e7b 100644 --- a/lib/volcano/generated/lib/volcano-generated/configuration.rb +++ b/lib/volcano/generated/lib/volcano-generated/configuration.rb @@ -272,7 +272,15 @@ def auth_settings { type: 'bearer', in: 'header', - format: 'JWT', + format: 'opaque', + key: 'Authorization', + value: "Bearer #{access_token_with_refresh}" + }, + 'ProjectAccessToken' => + { + type: 'bearer', + in: 'header', + format: 'opaque', key: 'Authorization', value: "Bearer #{access_token_with_refresh}" }, diff --git a/lib/volcano/generated/lib/volcano-generated/models/call_mcp200_response.rb b/lib/volcano/generated/lib/volcano-generated/models/call_mcp200_response.rb new file mode 100644 index 00000000..307ea872 --- /dev/null +++ b/lib/volcano/generated/lib/volcano-generated/models/call_mcp200_response.rb @@ -0,0 +1,220 @@ +=begin +#Volcano Hosting API + +#Public API for Volcano Hosting clients, SDKs, and CLI tooling (Port 8000). This specification intentionally excludes first-party/internal APIs. See api/openapi-internal.yaml for non-public internal and Builder operations. + +The version of the OpenAPI document: 3.0.0 +Contact: support@volcano.dev +Generated by: https://openapi-generator.tech +Generator version: 7.17.0 + +=end + +require 'date' +require 'time' + +module Volcano::Generated + class CallMCP200Response < ApiModelBase + attr_accessor :jsonrpc + + attr_accessor :id + + attr_accessor :result + + attr_accessor :error + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'jsonrpc' => :'jsonrpc', + :'id' => :'id', + :'result' => :'result', + :'error' => :'error' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'jsonrpc' => :'String', + :'id' => :'CallMCP200ResponseId', + :'result' => :'Hash', + :'error' => :'CallMCP200ResponseError' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'id', + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Volcano::Generated::CallMCP200Response` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Volcano::Generated::CallMCP200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'jsonrpc') + self.jsonrpc = attributes[:'jsonrpc'] + else + self.jsonrpc = nil + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + else + self.id = nil + end + + if attributes.key?(:'result') + if (value = attributes[:'result']).is_a?(Hash) + self.result = value + end + end + + if attributes.key?(:'error') + self.error = attributes[:'error'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @jsonrpc.nil? + invalid_properties.push('invalid value for "jsonrpc", jsonrpc cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @jsonrpc.nil? + jsonrpc_validator = EnumAttributeValidator.new('String', ["2.0"]) + return false unless jsonrpc_validator.valid?(@jsonrpc) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] jsonrpc Object to be assigned + def jsonrpc=(jsonrpc) + validator = EnumAttributeValidator.new('String', ["2.0"]) + unless validator.valid?(jsonrpc) + fail ArgumentError, "invalid value for \"jsonrpc\", must be one of #{validator.allowable_values}." + end + @jsonrpc = jsonrpc + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + jsonrpc == o.jsonrpc && + id == o.id && + result == o.result && + error == o.error + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [jsonrpc, id, result, error].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + end + +end diff --git a/lib/volcano/generated/lib/volcano-generated/models/call_mcp200_response_error.rb b/lib/volcano/generated/lib/volcano-generated/models/call_mcp200_response_error.rb new file mode 100644 index 00000000..cd5354b5 --- /dev/null +++ b/lib/volcano/generated/lib/volcano-generated/models/call_mcp200_response_error.rb @@ -0,0 +1,190 @@ +=begin +#Volcano Hosting API + +#Public API for Volcano Hosting clients, SDKs, and CLI tooling (Port 8000). This specification intentionally excludes first-party/internal APIs. See api/openapi-internal.yaml for non-public internal and Builder operations. + +The version of the OpenAPI document: 3.0.0 +Contact: support@volcano.dev +Generated by: https://openapi-generator.tech +Generator version: 7.17.0 + +=end + +require 'date' +require 'time' + +module Volcano::Generated + class CallMCP200ResponseError < ApiModelBase + attr_accessor :code + + attr_accessor :message + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'code' => :'code', + :'message' => :'message' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'code' => :'Integer', + :'message' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Volcano::Generated::CallMCP200ResponseError` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Volcano::Generated::CallMCP200ResponseError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'code') + self.code = attributes[:'code'] + else + self.code = nil + end + + if attributes.key?(:'message') + self.message = attributes[:'message'] + else + self.message = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @code.nil? + invalid_properties.push('invalid value for "code", code cannot be nil.') + end + + if @message.nil? + invalid_properties.push('invalid value for "message", message cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @code.nil? + return false if @message.nil? + true + end + + # Custom attribute writer method with validation + # @param [Object] code Value to be assigned + def code=(code) + if code.nil? + fail ArgumentError, 'code cannot be nil' + end + + @code = code + end + + # Custom attribute writer method with validation + # @param [Object] message Value to be assigned + def message=(message) + if message.nil? + fail ArgumentError, 'message cannot be nil' + end + + @message = message + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + code == o.code && + message == o.message + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [code, message].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + end + +end diff --git a/lib/volcano/generated/lib/volcano-generated/models/call_mcp200_response_id.rb b/lib/volcano/generated/lib/volcano-generated/models/call_mcp200_response_id.rb new file mode 100644 index 00000000..0a25658e --- /dev/null +++ b/lib/volcano/generated/lib/volcano-generated/models/call_mcp200_response_id.rb @@ -0,0 +1,105 @@ +=begin +#Volcano Hosting API + +#Public API for Volcano Hosting clients, SDKs, and CLI tooling (Port 8000). This specification intentionally excludes first-party/internal APIs. See api/openapi-internal.yaml for non-public internal and Builder operations. + +The version of the OpenAPI document: 3.0.0 +Contact: support@volcano.dev +Generated by: https://openapi-generator.tech +Generator version: 7.17.0 + +=end + +require 'date' +require 'time' + +module Volcano::Generated + # Echoes the request's id. Null when the request could not be read well enough to determine one. + module CallMCP200ResponseId + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'Integer', + :'String' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + return find_and_cast_into_type(klass, data) + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass, data) + return if data.nil? + + case klass.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.iso8601(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type, item) } + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) } + end + else # model + const = Volcano::Generated.const_get(klass) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end + end + + raise # if no match by now, raise + rescue + raise SchemaMismatchError, "#{data} doesn't match the #{klass} type" + end + end + end + +end diff --git a/lib/volcano/generated/lib/volcano-generated/models/call_mcp_request.rb b/lib/volcano/generated/lib/volcano-generated/models/call_mcp_request.rb new file mode 100644 index 00000000..77e264b7 --- /dev/null +++ b/lib/volcano/generated/lib/volcano-generated/models/call_mcp_request.rb @@ -0,0 +1,236 @@ +=begin +#Volcano Hosting API + +#Public API for Volcano Hosting clients, SDKs, and CLI tooling (Port 8000). This specification intentionally excludes first-party/internal APIs. See api/openapi-internal.yaml for non-public internal and Builder operations. + +The version of the OpenAPI document: 3.0.0 +Contact: support@volcano.dev +Generated by: https://openapi-generator.tech +Generator version: 7.17.0 + +=end + +require 'date' +require 'time' + +module Volcano::Generated + # A JSON-RPC 2.0 request object. + class CallMCPRequest < ApiModelBase + attr_accessor :jsonrpc + + # The MCP method to call. + attr_accessor :method + + attr_accessor :id + + attr_accessor :params + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'jsonrpc' => :'jsonrpc', + :'method' => :'method', + :'id' => :'id', + :'params' => :'params' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'jsonrpc' => :'String', + :'method' => :'String', + :'id' => :'CallMCPRequestId', + :'params' => :'Hash' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Volcano::Generated::CallMCPRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Volcano::Generated::CallMCPRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'jsonrpc') + self.jsonrpc = attributes[:'jsonrpc'] + else + self.jsonrpc = nil + end + + if attributes.key?(:'method') + self.method = attributes[:'method'] + else + self.method = nil + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'params') + if (value = attributes[:'params']).is_a?(Hash) + self.params = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @jsonrpc.nil? + invalid_properties.push('invalid value for "jsonrpc", jsonrpc cannot be nil.') + end + + if @method.nil? + invalid_properties.push('invalid value for "method", method cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @jsonrpc.nil? + jsonrpc_validator = EnumAttributeValidator.new('String', ["2.0"]) + return false unless jsonrpc_validator.valid?(@jsonrpc) + return false if @method.nil? + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] jsonrpc Object to be assigned + def jsonrpc=(jsonrpc) + validator = EnumAttributeValidator.new('String', ["2.0"]) + unless validator.valid?(jsonrpc) + fail ArgumentError, "invalid value for \"jsonrpc\", must be one of #{validator.allowable_values}." + end + @jsonrpc = jsonrpc + end + + # Custom attribute writer method with validation + # @param [Object] method Value to be assigned + def method=(method) + if method.nil? + fail ArgumentError, 'method cannot be nil' + end + + @method = method + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + jsonrpc == o.jsonrpc && + method == o.method && + id == o.id && + params == o.params + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [jsonrpc, method, id, params].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + end + +end diff --git a/lib/volcano/generated/lib/volcano-generated/models/call_mcp_request_id.rb b/lib/volcano/generated/lib/volcano-generated/models/call_mcp_request_id.rb new file mode 100644 index 00000000..883d3ece --- /dev/null +++ b/lib/volcano/generated/lib/volcano-generated/models/call_mcp_request_id.rb @@ -0,0 +1,105 @@ +=begin +#Volcano Hosting API + +#Public API for Volcano Hosting clients, SDKs, and CLI tooling (Port 8000). This specification intentionally excludes first-party/internal APIs. See api/openapi-internal.yaml for non-public internal and Builder operations. + +The version of the OpenAPI document: 3.0.0 +Contact: support@volcano.dev +Generated by: https://openapi-generator.tech +Generator version: 7.17.0 + +=end + +require 'date' +require 'time' + +module Volcano::Generated + # Request identifier, echoed verbatim. Omit it to send a notification, which is answered with `202` and no body. + module CallMCPRequestId + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'Integer', + :'String' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + return find_and_cast_into_type(klass, data) + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass, data) + return if data.nil? + + case klass.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.iso8601(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type, item) } + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) } + end + else # model + const = Volcano::Generated.const_get(klass) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end + end + + raise # if no match by now, raise + rescue + raise SchemaMismatchError, "#{data} doesn't match the #{klass} type" + end + end + end + +end diff --git a/lib/volcano/generated/lib/volcano-generated/models/create_project_access_token_request.rb b/lib/volcano/generated/lib/volcano-generated/models/create_project_access_token_request.rb new file mode 100644 index 00000000..677846df --- /dev/null +++ b/lib/volcano/generated/lib/volcano-generated/models/create_project_access_token_request.rb @@ -0,0 +1,241 @@ +=begin +#Volcano Hosting API + +#Public API for Volcano Hosting clients, SDKs, and CLI tooling (Port 8000). This specification intentionally excludes first-party/internal APIs. See api/openapi-internal.yaml for non-public internal and Builder operations. + +The version of the OpenAPI document: 3.0.0 +Contact: support@volcano.dev +Generated by: https://openapi-generator.tech +Generator version: 7.17.0 + +=end + +require 'date' +require 'time' + +module Volcano::Generated + class CreateProjectAccessTokenRequest < ApiModelBase + # Held by any of the project's tokens you have not revoked, including one that has expired. Creating a duplicate returns 409 with code `access_token_name_exists`; revoking the holder frees the name, so a rotation can keep the name its caller already references. + attr_accessor :name + + attr_accessor :scope + + # Omit for a token that does not expire. + attr_accessor :expires_at + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'name', + :'scope' => :'scope', + :'expires_at' => :'expires_at' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'name' => :'String', + :'scope' => :'ProjectAccessTokenScope', + :'expires_at' => :'Time' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Volcano::Generated::CreateProjectAccessTokenRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Volcano::Generated::CreateProjectAccessTokenRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + else + self.name = nil + end + + if attributes.key?(:'scope') + self.scope = attributes[:'scope'] + else + self.scope = nil + end + + if attributes.key?(:'expires_at') + self.expires_at = attributes[:'expires_at'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @name.nil? + invalid_properties.push('invalid value for "name", name cannot be nil.') + end + + if @name.to_s.length > 100 + invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 100.') + end + + if @name.to_s.length < 1 + invalid_properties.push('invalid value for "name", the character length must be greater than or equal to 1.') + end + + if @scope.nil? + invalid_properties.push('invalid value for "scope", scope cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @name.nil? + return false if @name.to_s.length > 100 + return false if @name.to_s.length < 1 + return false if @scope.nil? + true + end + + # Custom attribute writer method with validation + # @param [Object] name Value to be assigned + def name=(name) + if name.nil? + fail ArgumentError, 'name cannot be nil' + end + + if name.to_s.length > 100 + fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 100.' + end + + if name.to_s.length < 1 + fail ArgumentError, 'invalid value for "name", the character length must be greater than or equal to 1.' + end + + @name = name + end + + # Custom attribute writer method with validation + # @param [Object] scope Value to be assigned + def scope=(scope) + if scope.nil? + fail ArgumentError, 'scope cannot be nil' + end + + @scope = scope + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + scope == o.scope && + expires_at == o.expires_at + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [name, scope, expires_at].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + end + +end diff --git a/lib/volcano/generated/lib/volcano-generated/models/created_project_access_token.rb b/lib/volcano/generated/lib/volcano-generated/models/created_project_access_token.rb new file mode 100644 index 00000000..13e3cae1 --- /dev/null +++ b/lib/volcano/generated/lib/volcano-generated/models/created_project_access_token.rb @@ -0,0 +1,459 @@ +=begin +#Volcano Hosting API + +#Public API for Volcano Hosting clients, SDKs, and CLI tooling (Port 8000). This specification intentionally excludes first-party/internal APIs. See api/openapi-internal.yaml for non-public internal and Builder operations. + +The version of the OpenAPI document: 3.0.0 +Contact: support@volcano.dev +Generated by: https://openapi-generator.tech +Generator version: 7.17.0 + +=end + +require 'date' +require 'time' + +module Volcano::Generated + class CreatedProjectAccessToken < ApiModelBase + attr_accessor :id + + attr_accessor :project_id + + # Unique per project. + attr_accessor :name + + # First 12 characters of the secret, for recognising a token in a list. + attr_accessor :token_prefix + + attr_accessor :scope + + # `revoked` means the token was deliberately revoked, by you or by the deletion of its project. `expired` means it simply reached `expires_at`; nothing was taken away. Both are refused, and both keep their record so a token's name, prefix, last use, and request history remain available after a leak. A token revoked before its expiry passed stays `revoked`, because that is the fact worth keeping. + attr_accessor :status + + # What created the token. + attr_accessor :token_source + + # Absent for a token that does not expire. + attr_accessor :expires_at + + # Updated at most once every few minutes, so it may lag slightly. + attr_accessor :last_used_at + + attr_accessor :created_at + + # Requests authenticated with this token since it was created. + attr_accessor :all_time_requests + + # The secret. Returned only here, and not recoverable afterwards: the server stores a hash rather than the value. Save it now. + attr_accessor :token + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'project_id' => :'project_id', + :'name' => :'name', + :'token_prefix' => :'token_prefix', + :'scope' => :'scope', + :'status' => :'status', + :'token_source' => :'token_source', + :'expires_at' => :'expires_at', + :'last_used_at' => :'last_used_at', + :'created_at' => :'created_at', + :'all_time_requests' => :'all_time_requests', + :'token' => :'token' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String', + :'project_id' => :'String', + :'name' => :'String', + :'token_prefix' => :'String', + :'scope' => :'ProjectAccessTokenScope', + :'status' => :'String', + :'token_source' => :'String', + :'expires_at' => :'Time', + :'last_used_at' => :'Time', + :'created_at' => :'Time', + :'all_time_requests' => :'Integer', + :'token' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'expires_at', + :'last_used_at', + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'ProjectAccessToken' + ] + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Volcano::Generated::CreatedProjectAccessToken` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Volcano::Generated::CreatedProjectAccessToken`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + else + self.id = nil + end + + if attributes.key?(:'project_id') + self.project_id = attributes[:'project_id'] + else + self.project_id = nil + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + else + self.name = nil + end + + if attributes.key?(:'token_prefix') + self.token_prefix = attributes[:'token_prefix'] + else + self.token_prefix = nil + end + + if attributes.key?(:'scope') + self.scope = attributes[:'scope'] + else + self.scope = nil + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + else + self.status = nil + end + + if attributes.key?(:'token_source') + self.token_source = attributes[:'token_source'] + else + self.token_source = nil + end + + if attributes.key?(:'expires_at') + self.expires_at = attributes[:'expires_at'] + end + + if attributes.key?(:'last_used_at') + self.last_used_at = attributes[:'last_used_at'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + else + self.created_at = nil + end + + if attributes.key?(:'all_time_requests') + self.all_time_requests = attributes[:'all_time_requests'] + else + self.all_time_requests = nil + end + + if attributes.key?(:'token') + self.token = attributes[:'token'] + else + self.token = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @id.nil? + invalid_properties.push('invalid value for "id", id cannot be nil.') + end + + if @project_id.nil? + invalid_properties.push('invalid value for "project_id", project_id cannot be nil.') + end + + if @name.nil? + invalid_properties.push('invalid value for "name", name cannot be nil.') + end + + if @token_prefix.nil? + invalid_properties.push('invalid value for "token_prefix", token_prefix cannot be nil.') + end + + if @scope.nil? + invalid_properties.push('invalid value for "scope", scope cannot be nil.') + end + + if @status.nil? + invalid_properties.push('invalid value for "status", status cannot be nil.') + end + + if @token_source.nil? + invalid_properties.push('invalid value for "token_source", token_source cannot be nil.') + end + + if @created_at.nil? + invalid_properties.push('invalid value for "created_at", created_at cannot be nil.') + end + + if @all_time_requests.nil? + invalid_properties.push('invalid value for "all_time_requests", all_time_requests cannot be nil.') + end + + if @token.nil? + invalid_properties.push('invalid value for "token", token cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @id.nil? + return false if @project_id.nil? + return false if @name.nil? + return false if @token_prefix.nil? + return false if @scope.nil? + return false if @status.nil? + status_validator = EnumAttributeValidator.new('String', ["active", "revoked", "expired"]) + return false unless status_validator.valid?(@status) + return false if @token_source.nil? + token_source_validator = EnumAttributeValidator.new('String', ["api", "cli", "dashboard"]) + return false unless token_source_validator.valid?(@token_source) + return false if @created_at.nil? + return false if @all_time_requests.nil? + return false if @token.nil? + true + end + + # Custom attribute writer method with validation + # @param [Object] id Value to be assigned + def id=(id) + if id.nil? + fail ArgumentError, 'id cannot be nil' + end + + @id = id + end + + # Custom attribute writer method with validation + # @param [Object] project_id Value to be assigned + def project_id=(project_id) + if project_id.nil? + fail ArgumentError, 'project_id cannot be nil' + end + + @project_id = project_id + end + + # Custom attribute writer method with validation + # @param [Object] name Value to be assigned + def name=(name) + if name.nil? + fail ArgumentError, 'name cannot be nil' + end + + @name = name + end + + # Custom attribute writer method with validation + # @param [Object] token_prefix Value to be assigned + def token_prefix=(token_prefix) + if token_prefix.nil? + fail ArgumentError, 'token_prefix cannot be nil' + end + + @token_prefix = token_prefix + end + + # Custom attribute writer method with validation + # @param [Object] scope Value to be assigned + def scope=(scope) + if scope.nil? + fail ArgumentError, 'scope cannot be nil' + end + + @scope = scope + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] status Object to be assigned + def status=(status) + validator = EnumAttributeValidator.new('String', ["active", "revoked", "expired"]) + unless validator.valid?(status) + fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." + end + @status = status + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] token_source Object to be assigned + def token_source=(token_source) + validator = EnumAttributeValidator.new('String', ["api", "cli", "dashboard"]) + unless validator.valid?(token_source) + fail ArgumentError, "invalid value for \"token_source\", must be one of #{validator.allowable_values}." + end + @token_source = token_source + end + + # Custom attribute writer method with validation + # @param [Object] created_at Value to be assigned + def created_at=(created_at) + if created_at.nil? + fail ArgumentError, 'created_at cannot be nil' + end + + @created_at = created_at + end + + # Custom attribute writer method with validation + # @param [Object] all_time_requests Value to be assigned + def all_time_requests=(all_time_requests) + if all_time_requests.nil? + fail ArgumentError, 'all_time_requests cannot be nil' + end + + @all_time_requests = all_time_requests + end + + # Custom attribute writer method with validation + # @param [Object] token Value to be assigned + def token=(token) + if token.nil? + fail ArgumentError, 'token cannot be nil' + end + + @token = token + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + project_id == o.project_id && + name == o.name && + token_prefix == o.token_prefix && + scope == o.scope && + status == o.status && + token_source == o.token_source && + expires_at == o.expires_at && + last_used_at == o.last_used_at && + created_at == o.created_at && + all_time_requests == o.all_time_requests && + token == o.token + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, project_id, name, token_prefix, scope, status, token_source, expires_at, last_used_at, created_at, all_time_requests, token].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + end + +end diff --git a/lib/volcano/generated/lib/volcano-generated/models/frontend.rb b/lib/volcano/generated/lib/volcano-generated/models/frontend.rb index 69025e69..5e9b86c6 100644 --- a/lib/volcano/generated/lib/volcano-generated/models/frontend.rb +++ b/lib/volcano/generated/lib/volcano-generated/models/frontend.rb @@ -15,6 +15,12 @@ module Volcano::Generated class Frontend < ApiModelBase + # All preserves access to all project variables. Shared includes the project frontend shared-variable list. Scoped includes only explicitly declared variables in builds and runtime. Omission preserves the stored selection. + attr_accessor :variable_scope + + # Names selected when variable_scope is scoped. Missing declared values reject deployment. Omission preserves the stored list; an empty list clears it. + attr_accessor :declared_variables + attr_accessor :id attr_accessor :project_id @@ -79,6 +85,8 @@ def valid?(value) # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { + :'variable_scope' => :'variable_scope', + :'declared_variables' => :'declared_variables', :'id' => :'id', :'project_id' => :'project_id', :'name' => :'name', @@ -111,6 +119,8 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { + :'variable_scope' => :'String', + :'declared_variables' => :'Array', :'id' => :'String', :'project_id' => :'String', :'name' => :'String', @@ -152,6 +162,16 @@ def initialize(attributes = {}) h[k.to_sym] = v } + if attributes.key?(:'variable_scope') + self.variable_scope = attributes[:'variable_scope'] + end + + if attributes.key?(:'declared_variables') + if (value = attributes[:'declared_variables']).is_a?(Array) + self.declared_variables = value + end + end + if attributes.key?(:'id') self.id = attributes[:'id'] else @@ -292,6 +312,8 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' + variable_scope_validator = EnumAttributeValidator.new('String', ["all", "shared", "scoped"]) + return false unless variable_scope_validator.valid?(@variable_scope) return false if @id.nil? return false if @project_id.nil? return false if @name.nil? @@ -312,6 +334,26 @@ def valid? true end + # Custom attribute writer method checking allowed values (enum). + # @param [Object] variable_scope Object to be assigned + def variable_scope=(variable_scope) + validator = EnumAttributeValidator.new('String', ["all", "shared", "scoped"]) + unless validator.valid?(variable_scope) + fail ArgumentError, "invalid value for \"variable_scope\", must be one of #{validator.allowable_values}." + end + @variable_scope = variable_scope + end + + # Custom attribute writer method with validation + # @param [Object] declared_variables Value to be assigned + def declared_variables=(declared_variables) + if declared_variables.nil? + fail ArgumentError, 'declared_variables cannot be nil' + end + + @declared_variables = declared_variables + end + # Custom attribute writer method with validation # @param [Object] id Value to be assigned def id=(id) @@ -430,6 +472,8 @@ def updated_at=(updated_at) def ==(o) return true if self.equal?(o) self.class == o.class && + variable_scope == o.variable_scope && + declared_variables == o.declared_variables && id == o.id && project_id == o.project_id && name == o.name && @@ -457,7 +501,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, project_id, name, framework, app_root, status, provisioning_started_at, deployed_regions, current_deployment_id, pending_deployment_id, site_url, custom_domain, custom_domain_status, last_invoked_at, created_at, updated_at].hash + [variable_scope, declared_variables, id, project_id, name, framework, app_root, status, provisioning_started_at, deployed_regions, current_deployment_id, pending_deployment_id, site_url, custom_domain, custom_domain_status, last_invoked_at, created_at, updated_at].hash end # Builds the object from hash diff --git a/lib/volcano/generated/lib/volcano-generated/models/function.rb b/lib/volcano/generated/lib/volcano-generated/models/function.rb index cec760c9..ca6a0043 100644 --- a/lib/volcano/generated/lib/volcano-generated/models/function.rb +++ b/lib/volcano/generated/lib/volcano-generated/models/function.rb @@ -41,7 +41,7 @@ class Function < ApiModelBase attr_accessor :aws_function_arn - # Canonical GeoDNS endpoint URL for invoking this function (always HTTPS) + # Canonical geo-routed HTTPS endpoint for invoking this function. Use it as-is: it does not share a domain with the API, so a host derived from the API URL will not reach the function. Omitted when the deployment serves no public invocation domain, as in local development, so a client testing for an empty string never matches. attr_accessor :invoke_url # Regions where this function is currently deployed diff --git a/lib/volcano/generated/lib/volcano-generated/models/paginated_project_access_tokens.rb b/lib/volcano/generated/lib/volcano-generated/models/paginated_project_access_tokens.rb new file mode 100644 index 00000000..47ded4e8 --- /dev/null +++ b/lib/volcano/generated/lib/volcano-generated/models/paginated_project_access_tokens.rb @@ -0,0 +1,279 @@ +=begin +#Volcano Hosting API + +#Public API for Volcano Hosting clients, SDKs, and CLI tooling (Port 8000). This specification intentionally excludes first-party/internal APIs. See api/openapi-internal.yaml for non-public internal and Builder operations. + +The version of the OpenAPI document: 3.0.0 +Contact: support@volcano.dev +Generated by: https://openapi-generator.tech +Generator version: 7.17.0 + +=end + +require 'date' +require 'time' + +module Volcano::Generated + class PaginatedProjectAccessTokens < ApiModelBase + attr_accessor :data + + attr_accessor :page + + attr_accessor :limit + + attr_accessor :total + + attr_accessor :has_more + + attr_accessor :_next + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'data' => :'data', + :'page' => :'page', + :'limit' => :'limit', + :'total' => :'total', + :'has_more' => :'has_more', + :'_next' => :'next' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'data' => :'Array', + :'page' => :'Integer', + :'limit' => :'Integer', + :'total' => :'Integer', + :'has_more' => :'Boolean', + :'_next' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Volcano::Generated::PaginatedProjectAccessTokens` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Volcano::Generated::PaginatedProjectAccessTokens`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + else + self.data = nil + end + + if attributes.key?(:'page') + self.page = attributes[:'page'] + else + self.page = nil + end + + if attributes.key?(:'limit') + self.limit = attributes[:'limit'] + else + self.limit = nil + end + + if attributes.key?(:'total') + self.total = attributes[:'total'] + else + self.total = nil + end + + if attributes.key?(:'has_more') + self.has_more = attributes[:'has_more'] + else + self.has_more = nil + end + + if attributes.key?(:'_next') + self._next = attributes[:'_next'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @data.nil? + invalid_properties.push('invalid value for "data", data cannot be nil.') + end + + if @page.nil? + invalid_properties.push('invalid value for "page", page cannot be nil.') + end + + if @limit.nil? + invalid_properties.push('invalid value for "limit", limit cannot be nil.') + end + + if @total.nil? + invalid_properties.push('invalid value for "total", total cannot be nil.') + end + + if @has_more.nil? + invalid_properties.push('invalid value for "has_more", has_more cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @data.nil? + return false if @page.nil? + return false if @limit.nil? + return false if @total.nil? + return false if @has_more.nil? + true + end + + # Custom attribute writer method with validation + # @param [Object] data Value to be assigned + def data=(data) + if data.nil? + fail ArgumentError, 'data cannot be nil' + end + + @data = data + end + + # Custom attribute writer method with validation + # @param [Object] page Value to be assigned + def page=(page) + if page.nil? + fail ArgumentError, 'page cannot be nil' + end + + @page = page + end + + # Custom attribute writer method with validation + # @param [Object] limit Value to be assigned + def limit=(limit) + if limit.nil? + fail ArgumentError, 'limit cannot be nil' + end + + @limit = limit + end + + # Custom attribute writer method with validation + # @param [Object] total Value to be assigned + def total=(total) + if total.nil? + fail ArgumentError, 'total cannot be nil' + end + + @total = total + end + + # Custom attribute writer method with validation + # @param [Object] has_more Value to be assigned + def has_more=(has_more) + if has_more.nil? + fail ArgumentError, 'has_more cannot be nil' + end + + @has_more = has_more + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + page == o.page && + limit == o.limit && + total == o.total && + has_more == o.has_more && + _next == o._next + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [data, page, limit, total, has_more, _next].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + end + +end diff --git a/lib/volcano/generated/lib/volcano-generated/models/project_access_token.rb b/lib/volcano/generated/lib/volcano-generated/models/project_access_token.rb new file mode 100644 index 00000000..b665fe93 --- /dev/null +++ b/lib/volcano/generated/lib/volcano-generated/models/project_access_token.rb @@ -0,0 +1,426 @@ +=begin +#Volcano Hosting API + +#Public API for Volcano Hosting clients, SDKs, and CLI tooling (Port 8000). This specification intentionally excludes first-party/internal APIs. See api/openapi-internal.yaml for non-public internal and Builder operations. + +The version of the OpenAPI document: 3.0.0 +Contact: support@volcano.dev +Generated by: https://openapi-generator.tech +Generator version: 7.17.0 + +=end + +require 'date' +require 'time' + +module Volcano::Generated + # A project access token: a control-plane credential bound to a single project. Unlike a platform token, which acts on every project its owner has, this one is limited to the project it was created in. The secret itself is never returned here. Only its hash is stored, so the plaintext exists solely in the response to the create call. + class ProjectAccessToken < ApiModelBase + attr_accessor :id + + attr_accessor :project_id + + # Unique per project. + attr_accessor :name + + # First 12 characters of the secret, for recognising a token in a list. + attr_accessor :token_prefix + + attr_accessor :scope + + # `revoked` means the token was deliberately revoked, by you or by the deletion of its project. `expired` means it simply reached `expires_at`; nothing was taken away. Both are refused, and both keep their record so a token's name, prefix, last use, and request history remain available after a leak. A token revoked before its expiry passed stays `revoked`, because that is the fact worth keeping. + attr_accessor :status + + # What created the token. + attr_accessor :token_source + + # Absent for a token that does not expire. + attr_accessor :expires_at + + # Updated at most once every few minutes, so it may lag slightly. + attr_accessor :last_used_at + + attr_accessor :created_at + + # Requests authenticated with this token since it was created. + attr_accessor :all_time_requests + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'project_id' => :'project_id', + :'name' => :'name', + :'token_prefix' => :'token_prefix', + :'scope' => :'scope', + :'status' => :'status', + :'token_source' => :'token_source', + :'expires_at' => :'expires_at', + :'last_used_at' => :'last_used_at', + :'created_at' => :'created_at', + :'all_time_requests' => :'all_time_requests' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String', + :'project_id' => :'String', + :'name' => :'String', + :'token_prefix' => :'String', + :'scope' => :'ProjectAccessTokenScope', + :'status' => :'String', + :'token_source' => :'String', + :'expires_at' => :'Time', + :'last_used_at' => :'Time', + :'created_at' => :'Time', + :'all_time_requests' => :'Integer' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'expires_at', + :'last_used_at', + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Volcano::Generated::ProjectAccessToken` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Volcano::Generated::ProjectAccessToken`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + else + self.id = nil + end + + if attributes.key?(:'project_id') + self.project_id = attributes[:'project_id'] + else + self.project_id = nil + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + else + self.name = nil + end + + if attributes.key?(:'token_prefix') + self.token_prefix = attributes[:'token_prefix'] + else + self.token_prefix = nil + end + + if attributes.key?(:'scope') + self.scope = attributes[:'scope'] + else + self.scope = nil + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + else + self.status = nil + end + + if attributes.key?(:'token_source') + self.token_source = attributes[:'token_source'] + else + self.token_source = nil + end + + if attributes.key?(:'expires_at') + self.expires_at = attributes[:'expires_at'] + end + + if attributes.key?(:'last_used_at') + self.last_used_at = attributes[:'last_used_at'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + else + self.created_at = nil + end + + if attributes.key?(:'all_time_requests') + self.all_time_requests = attributes[:'all_time_requests'] + else + self.all_time_requests = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @id.nil? + invalid_properties.push('invalid value for "id", id cannot be nil.') + end + + if @project_id.nil? + invalid_properties.push('invalid value for "project_id", project_id cannot be nil.') + end + + if @name.nil? + invalid_properties.push('invalid value for "name", name cannot be nil.') + end + + if @token_prefix.nil? + invalid_properties.push('invalid value for "token_prefix", token_prefix cannot be nil.') + end + + if @scope.nil? + invalid_properties.push('invalid value for "scope", scope cannot be nil.') + end + + if @status.nil? + invalid_properties.push('invalid value for "status", status cannot be nil.') + end + + if @token_source.nil? + invalid_properties.push('invalid value for "token_source", token_source cannot be nil.') + end + + if @created_at.nil? + invalid_properties.push('invalid value for "created_at", created_at cannot be nil.') + end + + if @all_time_requests.nil? + invalid_properties.push('invalid value for "all_time_requests", all_time_requests cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @id.nil? + return false if @project_id.nil? + return false if @name.nil? + return false if @token_prefix.nil? + return false if @scope.nil? + return false if @status.nil? + status_validator = EnumAttributeValidator.new('String', ["active", "revoked", "expired"]) + return false unless status_validator.valid?(@status) + return false if @token_source.nil? + token_source_validator = EnumAttributeValidator.new('String', ["api", "cli", "dashboard"]) + return false unless token_source_validator.valid?(@token_source) + return false if @created_at.nil? + return false if @all_time_requests.nil? + true + end + + # Custom attribute writer method with validation + # @param [Object] id Value to be assigned + def id=(id) + if id.nil? + fail ArgumentError, 'id cannot be nil' + end + + @id = id + end + + # Custom attribute writer method with validation + # @param [Object] project_id Value to be assigned + def project_id=(project_id) + if project_id.nil? + fail ArgumentError, 'project_id cannot be nil' + end + + @project_id = project_id + end + + # Custom attribute writer method with validation + # @param [Object] name Value to be assigned + def name=(name) + if name.nil? + fail ArgumentError, 'name cannot be nil' + end + + @name = name + end + + # Custom attribute writer method with validation + # @param [Object] token_prefix Value to be assigned + def token_prefix=(token_prefix) + if token_prefix.nil? + fail ArgumentError, 'token_prefix cannot be nil' + end + + @token_prefix = token_prefix + end + + # Custom attribute writer method with validation + # @param [Object] scope Value to be assigned + def scope=(scope) + if scope.nil? + fail ArgumentError, 'scope cannot be nil' + end + + @scope = scope + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] status Object to be assigned + def status=(status) + validator = EnumAttributeValidator.new('String', ["active", "revoked", "expired"]) + unless validator.valid?(status) + fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." + end + @status = status + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] token_source Object to be assigned + def token_source=(token_source) + validator = EnumAttributeValidator.new('String', ["api", "cli", "dashboard"]) + unless validator.valid?(token_source) + fail ArgumentError, "invalid value for \"token_source\", must be one of #{validator.allowable_values}." + end + @token_source = token_source + end + + # Custom attribute writer method with validation + # @param [Object] created_at Value to be assigned + def created_at=(created_at) + if created_at.nil? + fail ArgumentError, 'created_at cannot be nil' + end + + @created_at = created_at + end + + # Custom attribute writer method with validation + # @param [Object] all_time_requests Value to be assigned + def all_time_requests=(all_time_requests) + if all_time_requests.nil? + fail ArgumentError, 'all_time_requests cannot be nil' + end + + @all_time_requests = all_time_requests + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + project_id == o.project_id && + name == o.name && + token_prefix == o.token_prefix && + scope == o.scope && + status == o.status && + token_source == o.token_source && + expires_at == o.expires_at && + last_used_at == o.last_used_at && + created_at == o.created_at && + all_time_requests == o.all_time_requests + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, project_id, name, token_prefix, scope, status, token_source, expires_at, last_used_at, created_at, all_time_requests].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + end + +end diff --git a/lib/volcano/generated/lib/volcano-generated/models/project_access_token_scope.rb b/lib/volcano/generated/lib/volcano-generated/models/project_access_token_scope.rb new file mode 100644 index 00000000..e0fb177f --- /dev/null +++ b/lib/volcano/generated/lib/volcano-generated/models/project_access_token_scope.rb @@ -0,0 +1,40 @@ +=begin +#Volcano Hosting API + +#Public API for Volcano Hosting clients, SDKs, and CLI tooling (Port 8000). This specification intentionally excludes first-party/internal APIs. See api/openapi-internal.yaml for non-public internal and Builder operations. + +The version of the OpenAPI document: 3.0.0 +Contact: support@volcano.dev +Generated by: https://openapi-generator.tech +Generator version: 7.17.0 + +=end + +require 'date' +require 'time' + +module Volcano::Generated + class ProjectAccessTokenScope + ProjectAccessTokenScopeFull = "full".freeze + ProjectAccessTokenScopeReadOnly = "read_only".freeze + + def self.all_vars + @all_vars ||= [ProjectAccessTokenScopeFull, ProjectAccessTokenScopeReadOnly].freeze + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + return value if ProjectAccessTokenScope.all_vars.include?(value) + raise "Invalid ENUM value #{value} for class #ProjectAccessTokenScope" + end + end +end diff --git a/lib/volcano/generated/lib/volcano-generated/models/project_access_token_usage.rb b/lib/volcano/generated/lib/volcano-generated/models/project_access_token_usage.rb new file mode 100644 index 00000000..4e06e73b --- /dev/null +++ b/lib/volcano/generated/lib/volcano-generated/models/project_access_token_usage.rb @@ -0,0 +1,299 @@ +=begin +#Volcano Hosting API + +#Public API for Volcano Hosting clients, SDKs, and CLI tooling (Port 8000). This specification intentionally excludes first-party/internal APIs. See api/openapi-internal.yaml for non-public internal and Builder operations. + +The version of the OpenAPI document: 3.0.0 +Contact: support@volcano.dev +Generated by: https://openapi-generator.tech +Generator version: 7.17.0 + +=end + +require 'date' +require 'time' + +module Volcano::Generated + # Zero-filled daily request counts for a single token, oldest first. Every day in the window is present, so a gap reads as zero rather than missing. Counts every request the token authenticated, including ones then refused — a read-only token attempting a write, or a token presented on another project's route. That is deliberate: after a leak, the probing is the part you want to see, and a counter that hid it would make a token look idle while it was being tried. + class ProjectAccessTokenUsage < ApiModelBase + attr_accessor :token_id + + attr_accessor :name + + # The token's display prefix, which identifies the credential when its name does not. Revoking frees a name, so a project that rotated `ci-deploy` has two entries here both called `ci-deploy`. Not usable as a credential. + attr_accessor :token_prefix + + # Number of daily entries returned, always equal to the requested window. + attr_accessor :days + + attr_accessor :daily + + attr_accessor :total_requests + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'token_id' => :'token_id', + :'name' => :'name', + :'token_prefix' => :'token_prefix', + :'days' => :'days', + :'daily' => :'daily', + :'total_requests' => :'total_requests' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'token_id' => :'String', + :'name' => :'String', + :'token_prefix' => :'String', + :'days' => :'Integer', + :'daily' => :'Array', + :'total_requests' => :'Integer' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Volcano::Generated::ProjectAccessTokenUsage` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Volcano::Generated::ProjectAccessTokenUsage`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'token_id') + self.token_id = attributes[:'token_id'] + else + self.token_id = nil + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + else + self.name = nil + end + + if attributes.key?(:'token_prefix') + self.token_prefix = attributes[:'token_prefix'] + else + self.token_prefix = nil + end + + if attributes.key?(:'days') + self.days = attributes[:'days'] + else + self.days = nil + end + + if attributes.key?(:'daily') + if (value = attributes[:'daily']).is_a?(Array) + self.daily = value + end + else + self.daily = nil + end + + if attributes.key?(:'total_requests') + self.total_requests = attributes[:'total_requests'] + else + self.total_requests = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @token_id.nil? + invalid_properties.push('invalid value for "token_id", token_id cannot be nil.') + end + + if @name.nil? + invalid_properties.push('invalid value for "name", name cannot be nil.') + end + + if @token_prefix.nil? + invalid_properties.push('invalid value for "token_prefix", token_prefix cannot be nil.') + end + + if @days.nil? + invalid_properties.push('invalid value for "days", days cannot be nil.') + end + + if @daily.nil? + invalid_properties.push('invalid value for "daily", daily cannot be nil.') + end + + if @total_requests.nil? + invalid_properties.push('invalid value for "total_requests", total_requests cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @token_id.nil? + return false if @name.nil? + return false if @token_prefix.nil? + return false if @days.nil? + return false if @daily.nil? + return false if @total_requests.nil? + true + end + + # Custom attribute writer method with validation + # @param [Object] token_id Value to be assigned + def token_id=(token_id) + if token_id.nil? + fail ArgumentError, 'token_id cannot be nil' + end + + @token_id = token_id + end + + # Custom attribute writer method with validation + # @param [Object] name Value to be assigned + def name=(name) + if name.nil? + fail ArgumentError, 'name cannot be nil' + end + + @name = name + end + + # Custom attribute writer method with validation + # @param [Object] token_prefix Value to be assigned + def token_prefix=(token_prefix) + if token_prefix.nil? + fail ArgumentError, 'token_prefix cannot be nil' + end + + @token_prefix = token_prefix + end + + # Custom attribute writer method with validation + # @param [Object] days Value to be assigned + def days=(days) + if days.nil? + fail ArgumentError, 'days cannot be nil' + end + + @days = days + end + + # Custom attribute writer method with validation + # @param [Object] daily Value to be assigned + def daily=(daily) + if daily.nil? + fail ArgumentError, 'daily cannot be nil' + end + + @daily = daily + end + + # Custom attribute writer method with validation + # @param [Object] total_requests Value to be assigned + def total_requests=(total_requests) + if total_requests.nil? + fail ArgumentError, 'total_requests cannot be nil' + end + + @total_requests = total_requests + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + token_id == o.token_id && + name == o.name && + token_prefix == o.token_prefix && + days == o.days && + daily == o.daily && + total_requests == o.total_requests + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [token_id, name, token_prefix, days, daily, total_requests].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + end + +end diff --git a/lib/volcano/generated/lib/volcano-generated/models/project_access_token_usage_daily_entry.rb b/lib/volcano/generated/lib/volcano-generated/models/project_access_token_usage_daily_entry.rb new file mode 100644 index 00000000..a5b9d82c --- /dev/null +++ b/lib/volcano/generated/lib/volcano-generated/models/project_access_token_usage_daily_entry.rb @@ -0,0 +1,191 @@ +=begin +#Volcano Hosting API + +#Public API for Volcano Hosting clients, SDKs, and CLI tooling (Port 8000). This specification intentionally excludes first-party/internal APIs. See api/openapi-internal.yaml for non-public internal and Builder operations. + +The version of the OpenAPI document: 3.0.0 +Contact: support@volcano.dev +Generated by: https://openapi-generator.tech +Generator version: 7.17.0 + +=end + +require 'date' +require 'time' + +module Volcano::Generated + class ProjectAccessTokenUsageDailyEntry < ApiModelBase + # UTC day. + attr_accessor :day + + attr_accessor :requests + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'day' => :'day', + :'requests' => :'requests' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'day' => :'Date', + :'requests' => :'Integer' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Volcano::Generated::ProjectAccessTokenUsageDailyEntry` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Volcano::Generated::ProjectAccessTokenUsageDailyEntry`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'day') + self.day = attributes[:'day'] + else + self.day = nil + end + + if attributes.key?(:'requests') + self.requests = attributes[:'requests'] + else + self.requests = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @day.nil? + invalid_properties.push('invalid value for "day", day cannot be nil.') + end + + if @requests.nil? + invalid_properties.push('invalid value for "requests", requests cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @day.nil? + return false if @requests.nil? + true + end + + # Custom attribute writer method with validation + # @param [Object] day Value to be assigned + def day=(day) + if day.nil? + fail ArgumentError, 'day cannot be nil' + end + + @day = day + end + + # Custom attribute writer method with validation + # @param [Object] requests Value to be assigned + def requests=(requests) + if requests.nil? + fail ArgumentError, 'requests cannot be nil' + end + + @requests = requests + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + day == o.day && + requests == o.requests + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [day, requests].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + end + +end diff --git a/lib/volcano/generated/lib/volcano-generated/models/project_config.rb b/lib/volcano/generated/lib/volcano-generated/models/project_config.rb index c95bfced..cc9f2e1e 100644 --- a/lib/volcano/generated/lib/volcano-generated/models/project_config.rb +++ b/lib/volcano/generated/lib/volcano-generated/models/project_config.rb @@ -26,6 +26,9 @@ class ProjectConfig < ApiModelBase # Replace the complete shared function-variable list with existing names, without changing variable values. Omission keeps membership unchanged; an empty list clears it. attr_accessor :shared_variables + # Replace the complete shared frontend-variable list with existing names. Frontends with variable_scope shared receive this list. Omission keeps membership unchanged; an empty list clears it. + attr_accessor :frontend_shared_variables + # Fully synced when declared - variables absent from this list are deleted. attr_accessor :variables @@ -68,6 +71,7 @@ def self.attribute_map :'project' => :'project', :'databases' => :'databases', :'shared_variables' => :'shared_variables', + :'frontend_shared_variables' => :'frontend_shared_variables', :'variables' => :'variables', :'buckets' => :'buckets', :'realtime' => :'realtime', @@ -94,6 +98,7 @@ def self.openapi_types :'project' => :'ProjectConfigProject', :'databases' => :'Array', :'shared_variables' => :'Array', + :'frontend_shared_variables' => :'Array', :'variables' => :'Array', :'buckets' => :'Array', :'realtime' => :'ProjectConfigRealtime', @@ -147,6 +152,12 @@ def initialize(attributes = {}) end end + if attributes.key?(:'frontend_shared_variables') + if (value = attributes[:'frontend_shared_variables']).is_a?(Array) + self.frontend_shared_variables = value + end + end + if attributes.key?(:'variables') if (value = attributes[:'variables']).is_a?(Array) self.variables = value @@ -222,6 +233,16 @@ def shared_variables=(shared_variables) @shared_variables = shared_variables end + # Custom attribute writer method with validation + # @param [Object] frontend_shared_variables Value to be assigned + def frontend_shared_variables=(frontend_shared_variables) + if frontend_shared_variables.nil? + fail ArgumentError, 'frontend_shared_variables cannot be nil' + end + + @frontend_shared_variables = frontend_shared_variables + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -231,6 +252,7 @@ def ==(o) project == o.project && databases == o.databases && shared_variables == o.shared_variables && + frontend_shared_variables == o.frontend_shared_variables && variables == o.variables && buckets == o.buckets && realtime == o.realtime && @@ -248,7 +270,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [version, project, databases, shared_variables, variables, buckets, realtime, auth, functions, frontends].hash + [version, project, databases, shared_variables, frontend_shared_variables, variables, buckets, realtime, auth, functions, frontends].hash end # Builds the object from hash diff --git a/lib/volcano/generated/lib/volcano-generated/models/project_config_frontend.rb b/lib/volcano/generated/lib/volcano-generated/models/project_config_frontend.rb index 740c301f..9a2658c1 100644 --- a/lib/volcano/generated/lib/volcano-generated/models/project_config_frontend.rb +++ b/lib/volcano/generated/lib/volcano-generated/models/project_config_frontend.rb @@ -16,13 +16,43 @@ module Volcano::Generated # Configuration for an existing (deployed) frontend. Frontends are never created or deleted through the manifest. A declared frontend entry without `custom_domain` deletes an existing custom domain. class ProjectConfigFrontend < ApiModelBase + # All preserves access to all project variables. Shared includes the project frontend_shared_variables list. Scoped includes only explicitly declared variables in builds and runtime. Omission preserves the stored selection. + attr_accessor :variable_scope + + # Names selected when variable_scope is scoped. Missing declared values reject deployment. Omission preserves the stored list; an empty list clears it. + attr_accessor :variables + attr_accessor :name attr_accessor :custom_domain + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { + :'variable_scope' => :'variable_scope', + :'variables' => :'variables', :'name' => :'name', :'custom_domain' => :'custom_domain' } @@ -41,6 +71,8 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { + :'variable_scope' => :'String', + :'variables' => :'Array', :'name' => :'String', :'custom_domain' => :'ProjectConfigCustomDomain' } @@ -68,6 +100,16 @@ def initialize(attributes = {}) h[k.to_sym] = v } + if attributes.key?(:'variable_scope') + self.variable_scope = attributes[:'variable_scope'] + end + + if attributes.key?(:'variables') + if (value = attributes[:'variables']).is_a?(Array) + self.variables = value + end + end + if attributes.key?(:'name') self.name = attributes[:'name'] else @@ -99,11 +141,33 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' + variable_scope_validator = EnumAttributeValidator.new('String', ["all", "shared", "scoped"]) + return false unless variable_scope_validator.valid?(@variable_scope) return false if @name.nil? return false if @name.to_s.length < 1 true end + # Custom attribute writer method checking allowed values (enum). + # @param [Object] variable_scope Object to be assigned + def variable_scope=(variable_scope) + validator = EnumAttributeValidator.new('String', ["all", "shared", "scoped"]) + unless validator.valid?(variable_scope) + fail ArgumentError, "invalid value for \"variable_scope\", must be one of #{validator.allowable_values}." + end + @variable_scope = variable_scope + end + + # Custom attribute writer method with validation + # @param [Object] variables Value to be assigned + def variables=(variables) + if variables.nil? + fail ArgumentError, 'variables cannot be nil' + end + + @variables = variables + end + # Custom attribute writer method with validation # @param [Object] name Value to be assigned def name=(name) @@ -123,6 +187,8 @@ def name=(name) def ==(o) return true if self.equal?(o) self.class == o.class && + variable_scope == o.variable_scope && + variables == o.variables && name == o.name && custom_domain == o.custom_domain end @@ -136,7 +202,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [name, custom_domain].hash + [variable_scope, variables, name, custom_domain].hash end # Builds the object from hash diff --git a/lib/volcano/generated/lib/volcano-generated/models/replace_frontend_shared_variables_request.rb b/lib/volcano/generated/lib/volcano-generated/models/replace_frontend_shared_variables_request.rb new file mode 100644 index 00000000..1ebe0ff2 --- /dev/null +++ b/lib/volcano/generated/lib/volcano-generated/models/replace_frontend_shared_variables_request.rb @@ -0,0 +1,237 @@ +=begin +#Volcano Hosting API + +#Public API for Volcano Hosting clients, SDKs, and CLI tooling (Port 8000). This specification intentionally excludes first-party/internal APIs. See api/openapi-internal.yaml for non-public internal and Builder operations. + +The version of the OpenAPI document: 3.0.0 +Contact: support@volcano.dev +Generated by: https://openapi-generator.tech +Generator version: 7.17.0 + +=end + +require 'date' +require 'time' + +module Volcano::Generated + class ReplaceFrontendSharedVariablesRequest < ApiModelBase + attr_accessor :frontend_shared_variables + + # When present, replace only if the current complete frontend shared list matches this list. + attr_accessor :expected_frontend_shared_variables + + # SHA-256 of the sorted unique current shared names joined by a newline. Use instead of expected_frontend_shared_variables for a compact conditional replacement. + attr_accessor :expected_frontend_shared_variables_digest + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'frontend_shared_variables' => :'frontend_shared_variables', + :'expected_frontend_shared_variables' => :'expected_frontend_shared_variables', + :'expected_frontend_shared_variables_digest' => :'expected_frontend_shared_variables_digest' + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'frontend_shared_variables' => :'Array', + :'expected_frontend_shared_variables' => :'Array', + :'expected_frontend_shared_variables_digest' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Volcano::Generated::ReplaceFrontendSharedVariablesRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Volcano::Generated::ReplaceFrontendSharedVariablesRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'frontend_shared_variables') + if (value = attributes[:'frontend_shared_variables']).is_a?(Array) + self.frontend_shared_variables = value + end + else + self.frontend_shared_variables = nil + end + + if attributes.key?(:'expected_frontend_shared_variables') + if (value = attributes[:'expected_frontend_shared_variables']).is_a?(Array) + self.expected_frontend_shared_variables = value + end + end + + if attributes.key?(:'expected_frontend_shared_variables_digest') + self.expected_frontend_shared_variables_digest = attributes[:'expected_frontend_shared_variables_digest'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @frontend_shared_variables.nil? + invalid_properties.push('invalid value for "frontend_shared_variables", frontend_shared_variables cannot be nil.') + end + + if !@expected_frontend_shared_variables_digest.nil? && @expected_frontend_shared_variables_digest.to_s.length > 64 + invalid_properties.push('invalid value for "expected_frontend_shared_variables_digest", the character length must be smaller than or equal to 64.') + end + + if !@expected_frontend_shared_variables_digest.nil? && @expected_frontend_shared_variables_digest.to_s.length < 64 + invalid_properties.push('invalid value for "expected_frontend_shared_variables_digest", the character length must be greater than or equal to 64.') + end + + pattern = Regexp.new(/^[a-f0-9]{64}$/) + if !@expected_frontend_shared_variables_digest.nil? && @expected_frontend_shared_variables_digest !~ pattern + invalid_properties.push("invalid value for \"expected_frontend_shared_variables_digest\", must conform to the pattern #{pattern}.") + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @frontend_shared_variables.nil? + return false if !@expected_frontend_shared_variables_digest.nil? && @expected_frontend_shared_variables_digest.to_s.length > 64 + return false if !@expected_frontend_shared_variables_digest.nil? && @expected_frontend_shared_variables_digest.to_s.length < 64 + return false if !@expected_frontend_shared_variables_digest.nil? && @expected_frontend_shared_variables_digest !~ Regexp.new(/^[a-f0-9]{64}$/) + true + end + + # Custom attribute writer method with validation + # @param [Object] frontend_shared_variables Value to be assigned + def frontend_shared_variables=(frontend_shared_variables) + if frontend_shared_variables.nil? + fail ArgumentError, 'frontend_shared_variables cannot be nil' + end + + @frontend_shared_variables = frontend_shared_variables + end + + # Custom attribute writer method with validation + # @param [Object] expected_frontend_shared_variables Value to be assigned + def expected_frontend_shared_variables=(expected_frontend_shared_variables) + if expected_frontend_shared_variables.nil? + fail ArgumentError, 'expected_frontend_shared_variables cannot be nil' + end + + @expected_frontend_shared_variables = expected_frontend_shared_variables + end + + # Custom attribute writer method with validation + # @param [Object] expected_frontend_shared_variables_digest Value to be assigned + def expected_frontend_shared_variables_digest=(expected_frontend_shared_variables_digest) + if expected_frontend_shared_variables_digest.nil? + fail ArgumentError, 'expected_frontend_shared_variables_digest cannot be nil' + end + + if expected_frontend_shared_variables_digest.to_s.length > 64 + fail ArgumentError, 'invalid value for "expected_frontend_shared_variables_digest", the character length must be smaller than or equal to 64.' + end + + if expected_frontend_shared_variables_digest.to_s.length < 64 + fail ArgumentError, 'invalid value for "expected_frontend_shared_variables_digest", the character length must be greater than or equal to 64.' + end + + pattern = Regexp.new(/^[a-f0-9]{64}$/) + if expected_frontend_shared_variables_digest !~ pattern + fail ArgumentError, "invalid value for \"expected_frontend_shared_variables_digest\", must conform to the pattern #{pattern}." + end + + @expected_frontend_shared_variables_digest = expected_frontend_shared_variables_digest + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + frontend_shared_variables == o.frontend_shared_variables && + expected_frontend_shared_variables == o.expected_frontend_shared_variables && + expected_frontend_shared_variables_digest == o.expected_frontend_shared_variables_digest + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [frontend_shared_variables, expected_frontend_shared_variables, expected_frontend_shared_variables_digest].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + end + +end diff --git a/lib/volcano/generated/lib/volcano-generated/models/resolve_function_response.rb b/lib/volcano/generated/lib/volcano-generated/models/resolve_function_response.rb index d231ecfa..d7107e95 100644 --- a/lib/volcano/generated/lib/volcano-generated/models/resolve_function_response.rb +++ b/lib/volcano/generated/lib/volcano-generated/models/resolve_function_response.rb @@ -21,6 +21,9 @@ class ResolveFunctionResponse < ApiModelBase # Canonical function ID used for invocation routing attr_accessor :function_id + # Canonical HTTPS endpoint for invoking this function. Use it as-is: it does not share a domain with the API, so a host derived from the API URL will not reach the function. Omitted when the deployment serves no public invocation domain, as in local development; invoke through POST /functions/{functionId}/invoke instead. + attr_accessor :invoke_url + # Suggested SDK cache TTL for this name-to-ID mapping attr_accessor :cache_ttl_seconds @@ -29,6 +32,7 @@ def self.attribute_map { :'name' => :'name', :'function_id' => :'function_id', + :'invoke_url' => :'invoke_url', :'cache_ttl_seconds' => :'cache_ttl_seconds' } end @@ -48,6 +52,7 @@ def self.openapi_types { :'name' => :'String', :'function_id' => :'String', + :'invoke_url' => :'String', :'cache_ttl_seconds' => :'Integer' } end @@ -86,6 +91,10 @@ def initialize(attributes = {}) self.function_id = nil end + if attributes.key?(:'invoke_url') + self.invoke_url = attributes[:'invoke_url'] + end + if attributes.key?(:'cache_ttl_seconds') self.cache_ttl_seconds = attributes[:'cache_ttl_seconds'] else @@ -189,6 +198,7 @@ def ==(o) self.class == o.class && name == o.name && function_id == o.function_id && + invoke_url == o.invoke_url && cache_ttl_seconds == o.cache_ttl_seconds end @@ -201,7 +211,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [name, function_id, cache_ttl_seconds].hash + [name, function_id, invoke_url, cache_ttl_seconds].hash end # Builds the object from hash diff --git a/lib/volcano/generated/lib/volcano-generated/models/variable.rb b/lib/volcano/generated/lib/volcano-generated/models/variable.rb index 15eaa70f..95e83126 100644 --- a/lib/volcano/generated/lib/volcano-generated/models/variable.rb +++ b/lib/volcano/generated/lib/volcano-generated/models/variable.rb @@ -18,6 +18,9 @@ class Variable < ApiModelBase # 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. attr_accessor :shared + # Whether this name is in the project's shared frontend-variable list. + attr_accessor :frontend_shared + attr_accessor :id attr_accessor :project_id @@ -68,6 +71,7 @@ def valid?(value) def self.attribute_map { :'shared' => :'shared', + :'frontend_shared' => :'frontend_shared', :'id' => :'id', :'project_id' => :'project_id', :'name' => :'name', @@ -95,6 +99,7 @@ def self.acceptable_attributes def self.openapi_types { :'shared' => :'Boolean', + :'frontend_shared' => :'Boolean', :'id' => :'String', :'project_id' => :'String', :'name' => :'String', @@ -134,6 +139,10 @@ def initialize(attributes = {}) self.shared = attributes[:'shared'] end + if attributes.key?(:'frontend_shared') + self.frontend_shared = attributes[:'frontend_shared'] + end + if attributes.key?(:'id') self.id = attributes[:'id'] else @@ -331,6 +340,7 @@ def ==(o) return true if self.equal?(o) self.class == o.class && shared == o.shared && + frontend_shared == o.frontend_shared && id == o.id && project_id == o.project_id && name == o.name && @@ -352,7 +362,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [shared, id, project_id, name, value, status, current_sync_id, provisioning_started_at, deploy_source, created_at, updated_at].hash + [shared, frontend_shared, id, project_id, name, value, status, current_sync_id, provisioning_started_at, deploy_source, created_at, updated_at].hash end # Builds the object from hash diff --git a/openapi/openapi.yaml b/openapi/openapi.yaml index 5025c12a..afc8684b 100644 --- a/openapi/openapi.yaml +++ b/openapi/openapi.yaml @@ -51,6 +51,8 @@ tags: description: Project-specific public keys for frontend auth - name: Service Keys description: Project-specific secret keys for admin operations (bypass RLS - backend only!) + - name: Project Access Tokens + description: Project-scoped credentials for calling the Volcano API from CI, scripts, and agents - name: OAuth Configuration description: OAuth provider configuration (Google, GitHub, Microsoft, Apple) - name: OAuth Authentication @@ -1041,6 +1043,7 @@ paths: operationId: getProject security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' responses: @@ -1063,6 +1066,7 @@ paths: operationId: updateProject security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' requestBody: @@ -1117,6 +1121,7 @@ paths: operationId: deleteProject security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' responses: @@ -1141,6 +1146,7 @@ paths: operationId: getProjectHealth security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' responses: @@ -1186,6 +1192,7 @@ paths: operationId: queryProjectMetrics security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' requestBody: @@ -1294,6 +1301,7 @@ paths: operationId: uploadProjectLogo security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' requestBody: @@ -1356,6 +1364,7 @@ paths: operationId: deleteProjectLogo security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' responses: @@ -1400,6 +1409,7 @@ paths: operationId: getProjectUsage security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' responses: @@ -1434,6 +1444,7 @@ paths: operationId: replaceSharedVariables security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' requestBody: @@ -1504,6 +1515,83 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + /projects/{id}/frontend-shared-variables: + put: + tags: + - Projects + summary: Replace frontend shared variable names + description: | + Atomically replaces the complete shared frontend-variable list without + changing values. Names must already exist. Validates final affected + frontend environments before membership or propagation side effects. + An empty list clears membership. Omitted names remain stored outside the frontend shared list. + operationId: replaceFrontendSharedVariables + security: + - UserToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - frontend_shared_variables + not: + required: + - expected_frontend_shared_variables + - expected_frontend_shared_variables_digest + properties: + frontend_shared_variables: + type: array + uniqueItems: true + items: + type: string + maxLength: 256 + pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$ + expected_frontend_shared_variables: + type: array + uniqueItems: true + description: When present, replace only if the current complete frontend shared list matches this list. + items: + type: string + maxLength: 256 + pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$ + expected_frontend_shared_variables_digest: + type: string + minLength: 64 + maxLength: 64 + pattern: ^[a-f0-9]{64}$ + description: SHA-256 of the sorted unique current shared names joined by a newline. Use instead of expected_frontend_shared_variables for a compact conditional replacement. + responses: + '204': + description: Frontend shared list replaced and affected frontend synchronization started. + '400': + description: Invalid names or final frontend environment. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Unauthorized + '404': + description: Project not found + '409': + description: Frontend shared list changed since it was read. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '413': + description: Request body exceeds 4,194,304 bytes + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: Persistence or synchronization failed /projects/{id}/config: get: tags: @@ -1516,11 +1604,12 @@ paths: `?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 + are omitted from the export; shared_variables and frontend_shared_variables contain names only; the YAML rendering adds a header comment describing how to set them via CLI environment interpolation. operationId: getProjectConfig security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - name: format @@ -1589,6 +1678,7 @@ paths: operationId: applyProjectConfig security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - name: dry_run @@ -1676,6 +1766,7 @@ paths: deploy without changing a platform-managed project's source ownership. security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' responses: @@ -1745,6 +1836,7 @@ paths: reached the repository. security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' requestBody: @@ -1840,6 +1932,7 @@ paths: connected repository and any commit already pushed to it are unchanged. security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' responses: @@ -1904,6 +1997,7 @@ paths: operationId: setProjectGitProductionBranch security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' requestBody: @@ -1969,6 +2063,7 @@ paths: operationId: getProjectGitConnection security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' responses: @@ -2019,6 +2114,7 @@ paths: operationId: connectProjectGit security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' requestBody: @@ -2094,6 +2190,7 @@ paths: operationId: disconnectProjectGit security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' responses: @@ -2140,6 +2237,7 @@ paths: operationId: getProjectGitDeploySettings security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' responses: @@ -2193,6 +2291,7 @@ paths: operationId: updateProjectGitDeploySettings security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' requestBody: @@ -2260,6 +2359,7 @@ paths: operationId: getProjectDatabaseQueries security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - $ref: '#/components/parameters/DatabaseName' @@ -2423,6 +2523,7 @@ paths: operationId: listProjectDeployments security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - $ref: '#/components/parameters/Page' @@ -2495,6 +2596,7 @@ paths: operationId: summarizeProjectDeployments security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - name: search @@ -2563,6 +2665,7 @@ paths: operationId: listProjectCustomDomains security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - $ref: '#/components/parameters/Page' @@ -2616,6 +2719,7 @@ paths: operationId: listFunctions security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - $ref: '#/components/parameters/Page' @@ -2667,6 +2771,7 @@ paths: operationId: createFunction security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' requestBody: @@ -2737,6 +2842,9 @@ paths: enum: - all - scoped + x-enum-varnames: + - CreateFunctionMultipartBodyVariableScopeAll + - CreateFunctionMultipartBodyVariableScopeScoped description: | 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. variables: @@ -2776,12 +2884,28 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + '429': + description: | + The owner's billing-cycle build-minutes allowance is spent. The + error names the allowance and carries a link to the usage page. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': description: Internal server error (function deployment failed) content: application/json: schema: $ref: '#/components/schemas/Error' + '503': + description: | + Build usage could not be read, so the allowance could not be + checked. The same request succeeds once it can be. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /projects/{id}/functions/{functionId}: get: tags: @@ -2790,6 +2914,7 @@ paths: operationId: getFunction security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - $ref: '#/components/parameters/FunctionId' @@ -2813,6 +2938,7 @@ paths: operationId: updateFunction security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - $ref: '#/components/parameters/FunctionId' @@ -2862,6 +2988,7 @@ paths: operationId: deleteFunction security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - $ref: '#/components/parameters/FunctionId' @@ -2909,7 +3036,8 @@ paths: - 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./`. + - The geo-routed DNS ingress is the function's `invoke_url`. It is on a + different domain from this API, so it cannot be derived from the API host. - 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 @@ -2967,6 +3095,21 @@ paths: description: Region the function ran in (for example `us-east-1`) schema: type: string + X-Volcano-Proxy-Ms: + description: Milliseconds Volcano spent preparing the invocation, counted from the request arriving until the function was dispatched. Present only when the function was invoked. Does not include function execution. + schema: + type: integer + minimum: 0 + X-Volcano-Proxy-Handler-Ms: + description: The part of `X-Volcano-Proxy-Ms` spent in the invoke endpoint itself. Subtract it from `X-Volcano-Proxy-Ms` to see what authentication and request validation cost. Present only when the function was invoked. + schema: + type: integer + minimum: 0 + X-Volcano-Compute-Ms: + description: Milliseconds spent running the function, from dispatch until it returned. Present only when the function was invoked. Does not include proxy preparation. + schema: + type: integer + minimum: 0 content: application/json: schema: @@ -3027,6 +3170,21 @@ paths: description: Region the function ran in (for example `us-east-1`) schema: type: string + X-Volcano-Proxy-Ms: + description: Milliseconds Volcano spent preparing the invocation, counted from the request arriving until the function was dispatched. Present only when the function was invoked. Does not include function execution. + schema: + type: integer + minimum: 0 + X-Volcano-Proxy-Handler-Ms: + description: The part of `X-Volcano-Proxy-Ms` spent in the invoke endpoint itself. Subtract it from `X-Volcano-Proxy-Ms` to see what authentication and request validation cost. Present only when the function was invoked. + schema: + type: integer + minimum: 0 + X-Volcano-Compute-Ms: + description: Milliseconds spent running the function, from dispatch until it returned. Present only when the function was invoked. Does not include proxy preparation. + schema: + type: integer + minimum: 0 content: application/json: schema: @@ -3165,9 +3323,9 @@ paths: description: | Durable execution is not available in this environment, or the usage limit service could not be reached to charge the start. The - first is returned by a deployment that has no durable execution - engine, such as a local one, and is not retryable there; the second - is transient. + first means the capability is paused or this deployment cannot + serve it, so it is not one to retry in a loop; the second is + transient. content: application/json: schema: @@ -3178,9 +3336,13 @@ paths: - Functions summary: Resolve function name for invocation description: | - Resolves a DNS-safe function name to its function ID within the caller's project. + Resolves a DNS-safe function name to its function ID and invocation URL within the caller's project. SDKs use this endpoint internally to invoke by function name while routing by function ID. + Invoke the returned `invoke_url` as-is. It does not share a domain with the API, so a host + built from the API URL will not reach the function. When the deployment serves no public + invocation domain, as in local development, `invoke_url` is omitted and callers invoke + through `POST /functions/{functionId}/invoke`. **With Service Key**: - Allowed @@ -3258,6 +3420,7 @@ paths: operationId: getProjectLogActivity security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' requestBody: @@ -3316,6 +3479,7 @@ paths: operationId: searchProjectLogs security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' requestBody: @@ -3383,6 +3547,7 @@ paths: operationId: streamProjectLogs security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - name: Last-Event-ID @@ -3469,6 +3634,7 @@ paths: operationId: createFunctionsBatch security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' requestBody: @@ -3524,10 +3690,18 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + '429': + description: | + The owner's billing-cycle build-minutes allowance is spent. The + error names the allowance and carries a link to the usage page. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '503': description: | - The batch carries a durable function and durable deploys are paused - platform-wide. The same request succeeds once they are re-enabled. + Build usage could not be read, so the allowance could not be + checked. The same request succeeds once it can be. content: application/json: schema: @@ -3545,6 +3719,7 @@ paths: operationId: listProjectSchedulers security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - $ref: '#/components/parameters/Page' @@ -3568,6 +3743,7 @@ paths: operationId: listFunctionSchedulers security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - $ref: '#/components/parameters/FunctionId' @@ -3592,6 +3768,7 @@ paths: operationId: createFunctionScheduler security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - $ref: '#/components/parameters/FunctionId' @@ -3639,6 +3816,7 @@ paths: operationId: getFunctionScheduler security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - $ref: '#/components/parameters/FunctionId' @@ -3663,6 +3841,7 @@ paths: operationId: updateFunctionScheduler security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - $ref: '#/components/parameters/FunctionId' @@ -3701,6 +3880,7 @@ paths: operationId: deleteFunctionScheduler security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - $ref: '#/components/parameters/FunctionId' @@ -3722,6 +3902,7 @@ paths: operationId: listFunctionDeployments security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - $ref: '#/components/parameters/FunctionId' @@ -3858,6 +4039,9 @@ paths: enum: - all - scoped + x-enum-varnames: + - CreateDurableFunctionMultipartBodyVariableScopeAll + - CreateDurableFunctionMultipartBodyVariableScopeScoped description: | Which project variables this function receives. `all` (the default) gives it every project variable; `scoped` gives it only the variables it selects. Omitting this leaves an existing function's scope unchanged. variables: @@ -3942,10 +4126,14 @@ paths: summary: Delete a durable function description: | Accepted for asynchronous teardown; the work continues after the - response. The function's executions go with it: history stops being - readable whatever `retention_days` had left, and the executions still - running stop counting against the project's concurrency cap. Stop an - execution first if you need it to end before the function does. + response. The function's executions go with it: executions still in + flight are stopped, and history stops being readable whatever + `retention_days` had left. + + Stopping is asynchronous at the platform, and it does not interrupt a + step already running -- that step runs to its next checkpoint. So a + delete ends an execution rather than halting it mid-step; stop the + execution yourself first if you need to observe it ending. operationId: deleteDurableFunction security: - UserToken: [] @@ -4252,9 +4440,9 @@ paths: description: | Durable execution is not available in this environment, or the usage limit service could not be reached to charge the start. The - first is returned by a deployment that has no durable execution - engine, such as a local one, and is not retryable there; the second - is transient. + first means the capability is paused or this deployment cannot + serve it, so it is not one to retry in a loop; the second is + transient. content: application/json: schema: @@ -4329,9 +4517,9 @@ paths: $ref: '#/components/schemas/Error' '503': description: | - Durable execution is not available in this environment. Returned by - a deployment that has no durable execution engine, such as a local - one; the request is not retryable there. + Durable execution is not available in this environment. Either the + capability is paused or this deployment cannot serve it, so the + request is not one to retry in a loop. content: application/json: schema: @@ -4383,9 +4571,9 @@ paths: $ref: '#/components/schemas/Error' '503': description: | - Durable execution is not available in this environment. Returned by - a deployment that has no durable execution engine, such as a local - one; the request is not retryable there. + Durable execution is not available in this environment. Either the + capability is paused or this deployment cannot serve it, so the + request is not one to retry in a loop. content: application/json: schema: @@ -4404,6 +4592,7 @@ paths: operationId: listFrontends security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - $ref: '#/components/parameters/Page' @@ -4483,6 +4672,7 @@ paths: operationId: createFrontend security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' requestBody: @@ -4511,6 +4701,18 @@ paths: maxLength: 1024 description: Optional relative POSIX path from the uploaded archive root to the Next.js app to build, for example `apps/web`. example: apps/web + variable_scope: + type: string + enum: + - all + - scoped + description: Variable selection for this deployment. New frontends default to `scoped`; omitting this field for an existing frontend preserves its current selection. + variables: + type: array + items: + type: string + pattern: ^[A-Za-z_][A-Za-z0-9_]*$ + description: Project variable names selected when `variable_scope` is `scoped`. Submit each name as a repeated multipart field. archive: type: string format: binary @@ -4578,6 +4780,7 @@ paths: operationId: getFrontend security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - $ref: '#/components/parameters/FrontendId' @@ -4630,6 +4833,7 @@ paths: operationId: deleteFrontend security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - $ref: '#/components/parameters/FrontendId' @@ -4688,6 +4892,7 @@ paths: operationId: redeployFrontend security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - $ref: '#/components/parameters/FrontendId' @@ -4748,6 +4953,7 @@ paths: operationId: getFrontendCustomDomain security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - $ref: '#/components/parameters/FrontendId' @@ -4803,6 +5009,7 @@ paths: operationId: createFrontendCustomDomain security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - $ref: '#/components/parameters/FrontendId' @@ -4874,6 +5081,7 @@ paths: operationId: deleteFrontendCustomDomain security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - $ref: '#/components/parameters/FrontendId' @@ -4918,6 +5126,7 @@ paths: operationId: listFrontendDeployments security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - $ref: '#/components/parameters/FrontendId' @@ -4978,6 +5187,7 @@ paths: operationId: getFrontendUsageHistory security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - $ref: '#/components/parameters/FrontendId' @@ -5037,6 +5247,7 @@ paths: operationId: listVariables security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - $ref: '#/components/parameters/Page' @@ -5068,6 +5279,7 @@ paths: operationId: createVariable security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' requestBody: @@ -5109,6 +5321,7 @@ paths: operationId: listDatabases security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - $ref: '#/components/parameters/Page' @@ -5147,6 +5360,7 @@ paths: operationId: createDatabase security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' requestBody: @@ -5176,6 +5390,7 @@ paths: operationId: getDatabase security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - $ref: '#/components/parameters/DatabaseName' @@ -5202,6 +5417,7 @@ paths: operationId: deleteDatabase security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - $ref: '#/components/parameters/DatabaseName' @@ -5261,6 +5477,7 @@ paths: operationId: listDatabaseBranches security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - $ref: '#/components/parameters/DatabaseName' @@ -5301,6 +5518,7 @@ paths: operationId: createDatabaseBranch security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - $ref: '#/components/parameters/DatabaseName' @@ -5363,6 +5581,7 @@ paths: operationId: getDatabaseBranch security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - $ref: '#/components/parameters/DatabaseName' @@ -5397,6 +5616,7 @@ paths: operationId: updateDatabaseBranch security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - $ref: '#/components/parameters/DatabaseName' @@ -5454,6 +5674,7 @@ paths: operationId: deleteDatabaseBranch security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - $ref: '#/components/parameters/DatabaseName' @@ -5507,6 +5728,7 @@ paths: operationId: resetDatabaseBranch security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - $ref: '#/components/parameters/DatabaseName' @@ -5556,6 +5778,7 @@ paths: operationId: resetDatabaseBranchPassword security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - $ref: '#/components/parameters/DatabaseName' @@ -5600,6 +5823,7 @@ paths: operationId: listDatabaseBackups security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - $ref: '#/components/parameters/DatabaseName' @@ -5649,6 +5873,7 @@ paths: operationId: createDatabaseBackup security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - $ref: '#/components/parameters/DatabaseName' @@ -5708,6 +5933,7 @@ paths: operationId: getDatabaseBackup security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - $ref: '#/components/parameters/DatabaseName' @@ -5757,6 +5983,7 @@ paths: operationId: deleteDatabaseBackup security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - $ref: '#/components/parameters/DatabaseName' @@ -5816,6 +6043,7 @@ paths: operationId: getDatabaseBackupSchedule security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - $ref: '#/components/parameters/DatabaseName' @@ -5865,6 +6093,7 @@ paths: operationId: updateDatabaseBackupSchedule security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - $ref: '#/components/parameters/DatabaseName' @@ -5929,6 +6158,7 @@ paths: operationId: listDatabaseRestores security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - $ref: '#/components/parameters/DatabaseName' @@ -5978,6 +6208,7 @@ paths: operationId: createDatabaseRestore security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - $ref: '#/components/parameters/DatabaseName' @@ -6042,6 +6273,7 @@ paths: operationId: getDatabaseRestore security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - $ref: '#/components/parameters/DatabaseName' @@ -6088,6 +6320,7 @@ paths: operationId: resetDatabasePassword security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - $ref: '#/components/parameters/DatabaseName' @@ -6157,6 +6390,7 @@ paths: operationId: updateDatabaseType security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - $ref: '#/components/parameters/DatabaseName' @@ -6206,6 +6440,7 @@ paths: operationId: getDatabaseStats security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - $ref: '#/components/parameters/DatabaseName' @@ -6282,6 +6517,13 @@ paths: responses: '200': description: Database is reachable + headers: + X-Volcano-Proxy-Ms: + $ref: '#/components/headers/DatabaseQueryProxyMs' + X-Volcano-Proxy-Handler-Ms: + $ref: '#/components/headers/DatabaseQueryProxyHandlerMs' + X-Volcano-Compute-Ms: + $ref: '#/components/headers/DatabaseQueryComputeMs' content: application/json: schema: @@ -6342,6 +6584,13 @@ paths: responses: '200': description: Query successful + headers: + X-Volcano-Proxy-Ms: + $ref: '#/components/headers/DatabaseQueryProxyMs' + X-Volcano-Proxy-Handler-Ms: + $ref: '#/components/headers/DatabaseQueryProxyHandlerMs' + X-Volcano-Compute-Ms: + $ref: '#/components/headers/DatabaseQueryComputeMs' content: application/json: schema: @@ -6409,6 +6658,13 @@ paths: responses: '200': description: Insert successful + headers: + X-Volcano-Proxy-Ms: + $ref: '#/components/headers/DatabaseQueryProxyMs' + X-Volcano-Proxy-Handler-Ms: + $ref: '#/components/headers/DatabaseQueryProxyHandlerMs' + X-Volcano-Compute-Ms: + $ref: '#/components/headers/DatabaseQueryComputeMs' content: application/json: schema: @@ -6477,6 +6733,13 @@ paths: responses: '200': description: Update successful + headers: + X-Volcano-Proxy-Ms: + $ref: '#/components/headers/DatabaseQueryProxyMs' + X-Volcano-Proxy-Handler-Ms: + $ref: '#/components/headers/DatabaseQueryProxyHandlerMs' + X-Volcano-Compute-Ms: + $ref: '#/components/headers/DatabaseQueryComputeMs' content: application/json: schema: @@ -6541,6 +6804,13 @@ paths: responses: '200': description: Delete successful + headers: + X-Volcano-Proxy-Ms: + $ref: '#/components/headers/DatabaseQueryProxyMs' + X-Volcano-Proxy-Handler-Ms: + $ref: '#/components/headers/DatabaseQueryProxyHandlerMs' + X-Volcano-Compute-Ms: + $ref: '#/components/headers/DatabaseQueryComputeMs' content: application/json: schema: @@ -6604,6 +6874,13 @@ paths: responses: '200': description: Database is reachable + headers: + X-Volcano-Proxy-Ms: + $ref: '#/components/headers/DatabaseQueryProxyMs' + X-Volcano-Proxy-Handler-Ms: + $ref: '#/components/headers/DatabaseQueryProxyHandlerMs' + X-Volcano-Compute-Ms: + $ref: '#/components/headers/DatabaseQueryComputeMs' content: application/json: schema: @@ -6671,6 +6948,13 @@ paths: responses: '200': description: Query successful + headers: + X-Volcano-Proxy-Ms: + $ref: '#/components/headers/DatabaseQueryProxyMs' + X-Volcano-Proxy-Handler-Ms: + $ref: '#/components/headers/DatabaseQueryProxyHandlerMs' + X-Volcano-Compute-Ms: + $ref: '#/components/headers/DatabaseQueryComputeMs' content: application/json: schema: @@ -6745,6 +7029,13 @@ paths: responses: '200': description: Insert successful + headers: + X-Volcano-Proxy-Ms: + $ref: '#/components/headers/DatabaseQueryProxyMs' + X-Volcano-Proxy-Handler-Ms: + $ref: '#/components/headers/DatabaseQueryProxyHandlerMs' + X-Volcano-Compute-Ms: + $ref: '#/components/headers/DatabaseQueryComputeMs' content: application/json: schema: @@ -6820,6 +7111,13 @@ paths: responses: '200': description: Update successful + headers: + X-Volcano-Proxy-Ms: + $ref: '#/components/headers/DatabaseQueryProxyMs' + X-Volcano-Proxy-Handler-Ms: + $ref: '#/components/headers/DatabaseQueryProxyHandlerMs' + X-Volcano-Compute-Ms: + $ref: '#/components/headers/DatabaseQueryComputeMs' content: application/json: schema: @@ -6891,6 +7189,13 @@ paths: responses: '200': description: Delete successful + headers: + X-Volcano-Proxy-Ms: + $ref: '#/components/headers/DatabaseQueryProxyMs' + X-Volcano-Proxy-Handler-Ms: + $ref: '#/components/headers/DatabaseQueryProxyHandlerMs' + X-Volcano-Compute-Ms: + $ref: '#/components/headers/DatabaseQueryComputeMs' content: application/json: schema: @@ -7038,6 +7343,7 @@ paths: operationId: getVariable security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - $ref: '#/components/parameters/VariableName' @@ -7064,6 +7370,7 @@ paths: operationId: updateVariable security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - $ref: '#/components/parameters/VariableName' @@ -7102,6 +7409,7 @@ paths: operationId: deleteVariable security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - $ref: '#/components/parameters/VariableName' @@ -7226,7 +7534,9 @@ paths: Set `session_mode` to `cookie` to request HttpOnly refresh-token storage. Cookie mode is honored only for an exact, credentialed CORS origin on the same schemeful site as this API. Otherwise the response - retains the refresh token in its body. + retains the refresh token in its body. A frontend on its default + Volcano URL is cross-site with this API and so always gets the body + token. operationId: authSignin security: - AnonKey: [] @@ -8225,6 +8535,7 @@ paths: operationId: getAuthInsights security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - name: from @@ -8305,6 +8616,7 @@ paths: operationId: listAuthUsers security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - $ref: '#/components/parameters/Page' @@ -8343,6 +8655,7 @@ paths: operationId: getAuthUser security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - name: userId @@ -8366,6 +8679,7 @@ paths: operationId: deleteAuthUser security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - name: userId @@ -8396,6 +8710,7 @@ paths: operationId: listUserSessions security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - name: userId @@ -8523,6 +8838,7 @@ paths: operationId: deleteAllUserSessions security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - name: userId @@ -8547,6 +8863,7 @@ paths: operationId: deleteUserSession security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - name: userId @@ -8580,6 +8897,7 @@ paths: operationId: banAuthUser security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - name: userId @@ -8623,6 +8941,7 @@ paths: operationId: unbanAuthUser security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - name: userId @@ -8653,6 +8972,7 @@ paths: operationId: listEmailTemplates security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' responses: @@ -8682,6 +9002,7 @@ paths: operationId: createEmailTemplate security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' requestBody: @@ -8723,6 +9044,7 @@ paths: operationId: getEmailTemplate security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - name: type @@ -8756,6 +9078,7 @@ paths: operationId: updateEmailTemplate security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - name: type @@ -8800,6 +9123,7 @@ paths: operationId: deleteEmailTemplate security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - name: type @@ -8876,6 +9200,7 @@ paths: operationId: getAuthConfig security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' responses: @@ -8895,6 +9220,7 @@ paths: operationId: updateAuthConfig security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' requestBody: @@ -8942,6 +9268,7 @@ paths: operationId: testEmailConfig security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' requestBody: @@ -8980,6 +9307,7 @@ paths: operationId: getAuthHostedPage security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - name: pageType @@ -9005,6 +9333,7 @@ paths: operationId: updateAuthHostedPage security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - name: pageType @@ -9041,6 +9370,7 @@ paths: operationId: getAuthPageAppearance security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' responses: @@ -9082,6 +9412,7 @@ paths: operationId: updateAuthPageTheme security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' requestBody: @@ -9134,6 +9465,7 @@ paths: operationId: deleteAuthPageTheme security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' responses: @@ -9178,6 +9510,7 @@ paths: operationId: updateAuthPageLayout security: - UserToken: [] + - ProjectAccessToken: [] requestBody: required: true content: @@ -9228,6 +9561,7 @@ paths: operationId: deleteAuthPageLayout security: - UserToken: [] + - ProjectAccessToken: [] responses: '204': description: Layout cleared @@ -9313,6 +9647,7 @@ paths: operationId: previewAuthPage security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - name: pageType @@ -9533,6 +9868,7 @@ paths: operationId: getAuthMethods security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' responses: @@ -9598,6 +9934,7 @@ paths: operationId: configureAuthMethods security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' requestBody: @@ -9633,6 +9970,7 @@ paths: operationId: listOAuthConfigs security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' responses: @@ -9655,6 +9993,7 @@ paths: operationId: createOAuthConfig security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' requestBody: @@ -9680,6 +10019,7 @@ paths: operationId: getOAuthConfig security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - name: provider @@ -9713,6 +10053,7 @@ paths: operationId: updateOAuthConfig security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - name: provider @@ -9751,6 +10092,7 @@ paths: operationId: deleteOAuthConfig security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - name: provider @@ -9782,6 +10124,7 @@ paths: operationId: listAvailableOAuthProviders security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' responses: @@ -10584,6 +10927,7 @@ paths: operationId: listAnonKeys security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - $ref: '#/components/parameters/Page' @@ -10623,6 +10967,7 @@ paths: operationId: createAnonKey security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' requestBody: @@ -10688,6 +11033,7 @@ paths: operationId: getAnonKey security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - name: keyId @@ -10713,6 +11059,7 @@ paths: operationId: revokeAnonKey security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - name: keyId @@ -10751,6 +11098,7 @@ paths: operationId: regenerateAnonKey security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - name: keyId @@ -10775,6 +11123,7 @@ paths: operationId: setDefaultAnonKey security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - name: keyId @@ -10802,43 +11151,83 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/service-keys: + /projects/{id}/access-tokens: get: tags: - - Service Keys - summary: List service keys (paginated) + - Project Access Tokens + summary: List a project's access tokens description: | - List all service role keys for a project with pagination. + Lists the project's access tokens, newest first. Secrets are never + returned: only a hash is stored, so a token's value exists solely in the + response to the create call. - **WARNING:** Service keys bypass RLS - for backend/admin use only! - operationId: listServiceKeys + Only tokens that can still authenticate are returned by default, so + revoked and expired ones are hidden. Pass `include_revoked=true` to see + them, which is how you find out what a key did before it stopped working. + + Requires a platform token. A project access token cannot manage project + access tokens, so a leaked credential cannot enumerate or replace itself. + operationId: listProjectAccessTokens security: - UserToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - $ref: '#/components/parameters/Page' - $ref: '#/components/parameters/Limit' - - $ref: '#/components/parameters/Cursor' - - $ref: '#/components/parameters/EndingBefore' - - $ref: '#/components/parameters/Offset' - $ref: '#/components/parameters/Search' + - name: include_revoked + in: query + required: false + description: | + Include tokens that can no longer authenticate — both revoked and + expired ones. + schema: + type: boolean + default: false responses: '200': - description: Paginated list of service keys + description: Successful response content: application/json: schema: - $ref: '#/components/schemas/PaginatedServiceKeys' + $ref: '#/components/schemas/PaginatedProjectAccessTokens' + '401': + description: Unauthorized - invalid or missing token + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: Forbidden - not the project owner, or a project access token was used + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Project not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' post: tags: - - Service Keys - summary: Create service key + - Project Access Tokens + summary: Create a project access token description: | - Create a new service role key for admin operations. + Creates a project access token and returns its secret. - **WARNING:** Service keys bypass all RLS policies! - Store securely and NEVER expose in frontend code. - operationId: createServiceKey + The secret is in this response and nowhere else. Only its hash is + stored, so it cannot be retrieved, displayed, or recovered later — save + it when you create it. + + The name must be unique within the project, so a retry cannot mint a + second credential. It cannot recover the first one either. A retry that + returns `409` with code `access_token_name_exists` means the original + create committed and its secret is unrecoverable: list the project's + tokens, revoke the one holding that name, and create it again. + + Requires a platform token. + operationId: createProjectAccessToken security: - UserToken: [] parameters: @@ -10848,71 +11237,382 @@ paths: content: application/json: schema: - type: object - required: - - name - properties: - name: - type: string - description: | - Descriptive name for the key (e.g., "admin-dashboard", "background-jobs"). - Can only contain letters, numbers, underscores, and hyphens. - pattern: ^[A-Za-z0-9_-]+$ - minLength: 1 - maxLength: 255 - example: admin-dashboard - permissions: - type: array - items: - type: string - description: | - Optional least-privilege scope for the key. When omitted, empty, or - containing only blank strings, the key is granted full access (["*"]) - for backward compatibility. Provide an explicit list (e.g. - ["functions.invoke", "locks.manage"]) to restrict the key; "*" - grants everything. Scope enforcement applies to function invocation, - storage object operations, and project locks. - example: - - functions.invoke - - locks.manage + $ref: '#/components/schemas/CreateProjectAccessTokenRequest' responses: '201': - description: Service key created - save the key_value immediately! + description: Token created - save the secret now, it cannot be retrieved again content: application/json: schema: - $ref: '#/components/schemas/ServiceKey' + $ref: '#/components/schemas/CreatedProjectAccessToken' + '400': + description: Bad request - invalid name, scope, or expiry + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Unauthorized - invalid or missing token + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: Forbidden - not the project owner, or a project access token was used + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Project not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '409': - description: Key with this name already exists - /projects/{id}/service-keys/{keyId}: + description: | + Duplicate name, token limit reached, or the project is being + deleted. Tell them apart with `code`, which is one of + `access_token_name_exists`, `access_token_limit_reached`, or + `project_deleting` — the message text is not a contract. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /projects/{id}/access-tokens/usage: get: tags: - - Service Keys - summary: Get service key - description: Get details of a specific service key - operationId: getServiceKey + - Project Access Tokens + summary: Per-day request counts for every access token in a project + description: | + Returns a zero-filled daily series of request counts for each of the + project's access tokens, oldest first. Every day in the window is + present, so a gap reads as zero rather than missing. + + Revoked tokens are included, because the traffic they made before + revocation is usually the reason you are looking. + + `days` defaults to 30 and is capped at 60, which is also how long per-day + counts are retained — a longer window cannot be answered. + + A platform token sees every token in the project. A project access token + sees only its own row, so it can watch its own traffic without being + able to enumerate the project's other credentials by name. + operationId: listProjectAccessTokensUsage security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - - name: keyId - in: path - required: true + - name: days + in: query + required: false + description: Number of trailing days to return (1-60, default 30). schema: - type: string - format: uuid + type: integer + minimum: 1 + maximum: 60 + default: 30 responses: '200': - description: Service key details + description: Successful response content: application/json: schema: - $ref: '#/components/schemas/ServiceKey' + type: array + items: + $ref: '#/components/schemas/ProjectAccessTokenUsage' + '400': + description: Bad request - invalid window + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Unauthorized - invalid or missing token + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: Forbidden - not the project owner + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '404': - description: Key not found - delete: - tags: - - Service Keys + description: Project not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /projects/{id}/access-tokens/{tokenId}: + get: + tags: + - Project Access Tokens + summary: Get a project access token + description: | + Returns one token's metadata. Never its secret, which is not stored in a + recoverable form. + + Requires a platform token. + operationId: getProjectAccessToken + security: + - UserToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/TokenId' + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/ProjectAccessToken' + '401': + description: Unauthorized - invalid or missing token + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: Forbidden - not the project owner, or a project access token was used + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Token not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + delete: + tags: + - Project Access Tokens + summary: Revoke a project access token + description: | + Revokes the token. It stops authenticating immediately in the region + handling this call and within seconds across Volcano's other regions. + + The record is kept rather than deleted, so the token's name, prefix, last + use, and request history stay available — which is what you need if you + are revoking because a secret leaked. Revoking an already-revoked token + succeeds. + + Revoking does not undo anything the token already did. Treat whatever it + could reach as exposed and rotate accordingly. + + Requires a platform token. + operationId: revokeProjectAccessToken + security: + - UserToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/TokenId' + responses: + '204': + description: Token revoked + '401': + description: Unauthorized - invalid or missing token + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: Forbidden - not the project owner, or a project access token was used + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Token not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '409': + description: Conflict - the project is being deleted + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /projects/{id}/access-tokens/{tokenId}/usage: + get: + tags: + - Project Access Tokens + summary: Per-day request counts for one access token + description: | + Returns a zero-filled daily series of request counts for a single token, + oldest first, so the response always has exactly `days` entries. + + `days` defaults to 30 and is capped at 60, matching how long per-day + counts are retained. + + A project access token may read only its own usage; asking for another + token's returns `403`. A platform token may read any token in the + project. + operationId: getProjectAccessTokenUsage + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/TokenId' + - name: days + in: query + required: false + description: Number of trailing days to return (1-60, default 30). + schema: + type: integer + minimum: 1 + maximum: 60 + default: 30 + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/ProjectAccessTokenUsage' + '400': + description: Bad request - invalid window + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Unauthorized - invalid or missing token + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: Forbidden - not the project owner + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Token not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /projects/{id}/service-keys: + get: + tags: + - Service Keys + summary: List service keys (paginated) + description: | + List all service role keys for a project with pagination. + + **WARNING:** Service keys bypass RLS - for backend/admin use only! + operationId: listServiceKeys + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/Limit' + - $ref: '#/components/parameters/Cursor' + - $ref: '#/components/parameters/EndingBefore' + - $ref: '#/components/parameters/Offset' + - $ref: '#/components/parameters/Search' + responses: + '200': + description: Paginated list of service keys + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedServiceKeys' + post: + tags: + - Service Keys + summary: Create service key + description: | + Create a new service role key for admin operations. + + **WARNING:** Service keys bypass all RLS policies! + Store securely and NEVER expose in frontend code. + operationId: createServiceKey + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - name + properties: + name: + type: string + description: | + Descriptive name for the key (e.g., "admin-dashboard", "background-jobs"). + Can only contain letters, numbers, underscores, and hyphens. + pattern: ^[A-Za-z0-9_-]+$ + minLength: 1 + maxLength: 255 + example: admin-dashboard + permissions: + type: array + items: + type: string + description: | + Optional least-privilege scope for the key. When omitted, empty, or + containing only blank strings, the key is granted full access (["*"]) + for backward compatibility. Provide an explicit list (e.g. + ["functions.invoke", "locks.manage"]) to restrict the key; "*" + grants everything. Scope enforcement applies to function invocation, + storage object operations, and project locks. + example: + - functions.invoke + - locks.manage + responses: + '201': + description: Service key created - save the key_value immediately! + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceKey' + '409': + description: Key with this name already exists + /projects/{id}/service-keys/{keyId}: + get: + tags: + - Service Keys + summary: Get service key + description: Get details of a specific service key + operationId: getServiceKey + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - name: keyId + in: path + required: true + schema: + type: string + format: uuid + responses: + '200': + description: Service key details + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceKey' + '404': + description: Key not found + delete: + tags: + - Service Keys summary: Delete service key description: | Permanently delete a service key. @@ -10920,6 +11620,7 @@ paths: operationId: deleteServiceKey security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - name: keyId @@ -10938,11 +11639,12 @@ paths: summary: Regenerate service key description: | Generate new JWT value for existing key. - The old key is immediately invalidated. + The old key stops working within a few seconds. Update your backend services with the new key before regenerating in production. operationId: regenerateServiceKey security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - name: keyId @@ -10971,6 +11673,7 @@ paths: operationId: listStorageBuckets security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - $ref: '#/components/parameters/Limit' @@ -10998,6 +11701,7 @@ paths: operationId: createStorageBucket security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' requestBody: @@ -11023,6 +11727,7 @@ paths: operationId: getStorageBucket security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - $ref: '#/components/parameters/BucketName' @@ -11042,6 +11747,7 @@ paths: operationId: updateStorageBucket security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - $ref: '#/components/parameters/BucketName' @@ -11065,6 +11771,7 @@ paths: operationId: deleteStorageBucket security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - $ref: '#/components/parameters/BucketName' @@ -11079,6 +11786,7 @@ paths: operationId: listStoragePolicies security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - $ref: '#/components/parameters/BucketName' @@ -11098,6 +11806,7 @@ paths: operationId: createStoragePolicy security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - $ref: '#/components/parameters/BucketName' @@ -11122,6 +11831,7 @@ paths: operationId: deleteStoragePolicy security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - $ref: '#/components/parameters/BucketName' @@ -11145,6 +11855,7 @@ paths: operationId: listStorageObjectsAdmin security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - name: owner_id @@ -11207,6 +11918,7 @@ paths: operationId: getStorageStats security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' responses: @@ -11225,6 +11937,7 @@ paths: operationId: getRealtimeConfig security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' responses: @@ -11254,6 +11967,7 @@ paths: operationId: updateRealtimeConfig security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' requestBody: @@ -11290,6 +12004,7 @@ paths: operationId: getRealtimeStats security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' responses: @@ -12094,18 +12809,256 @@ paths: get: tags: - System - summary: Health check endpoint - description: Returns server health status. Used for load balancer and monitoring checks. - operationId: healthCheck + summary: Health check endpoint + description: Returns server health status. Used for load balancer and monitoring checks. + operationId: healthCheck + responses: + '200': + description: Server is healthy + content: + text/plain: + schema: + type: string + example: OK + /openapi.json: + get: + tags: + - System + summary: Fetch the OpenAPI specification as JSON + description: | + Returns this specification as a self-contained JSON document, with every + reference resolved. It is generated from the same document the server + validates requests against, so a client generated from it cannot + describe a different API than the one that answers. + + No credential is required: a client generator fetches this by URL before + its user has a token, and every path here is already published in the + API reference. + + The response carries a strong `ETag`; send it back as `If-None-Match` to + get `304 Not Modified` instead of the whole document. + operationId: getOpenAPISpecJSON + security: [] + parameters: + - $ref: '#/components/parameters/IfNoneMatch' + responses: + '200': + description: The OpenAPI specification + headers: + ETag: + $ref: '#/components/headers/ETag' + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAPISpecDocument' + '304': + $ref: '#/components/responses/OpenAPISpecNotModified' + '429': + $ref: '#/components/responses/OpenAPISpecThrottled' + head: + tags: + - System + summary: Check the JSON OpenAPI specification + description: | + The headers `GET /openapi.json` would return, so a cache can pick up the + current `ETag` without transferring the document. + operationId: headOpenAPISpecJSON + security: [] + parameters: + - $ref: '#/components/parameters/IfNoneMatch' + responses: + '200': + $ref: '#/components/responses/OpenAPISpecHeaders' + '304': + $ref: '#/components/responses/OpenAPISpecNotModified' + '429': + $ref: '#/components/responses/OpenAPISpecThrottled' + /openapi.yaml: + get: + tags: + - System + summary: Fetch the OpenAPI specification as YAML + description: | + The same document as `/openapi.json`, serialized as YAML for tools that + prefer it. See that operation for caching and authentication notes. + operationId: getOpenAPISpecYAML + security: [] + parameters: + - $ref: '#/components/parameters/IfNoneMatch' + responses: + '200': + description: The OpenAPI specification + headers: + ETag: + $ref: '#/components/headers/ETag' + content: + application/yaml: + schema: + $ref: '#/components/schemas/OpenAPISpecDocument' + '304': + $ref: '#/components/responses/OpenAPISpecNotModified' + '429': + $ref: '#/components/responses/OpenAPISpecThrottled' + head: + tags: + - System + summary: Check the YAML OpenAPI specification + description: | + The headers `GET /openapi.yaml` would return, so a cache can pick up the + current `ETag` without transferring the document. + operationId: headOpenAPISpecYAML + security: [] + parameters: + - $ref: '#/components/parameters/IfNoneMatch' + responses: + '200': + $ref: '#/components/responses/OpenAPISpecHeaders' + '304': + $ref: '#/components/responses/OpenAPISpecNotModified' + '429': + $ref: '#/components/responses/OpenAPISpecThrottled' + /mcp: + post: + tags: + - System + summary: Model Context Protocol endpoint + description: | + Streamable-HTTP MCP endpoint: one JSON-RPC 2.0 object per request, one + response per request. There is no server-to-client stream, so a `GET` + returns `405`, and a batched array is rejected. + + Authenticated with a **project access token**. The endpoint takes its + project from the credential, so a platform token is refused with `403` — + it names no project, and letting a tool argument choose one would hand an + agent its own blast radius. + + Scope carries over from the REST API. A `read_only` token is not offered + mutating tools or credential-returning reads, and is refused if it calls + one anyway. Revoking the token ends MCP access on the same path it ends + API access. + + Methods: `initialize`, `notifications/initialized`, `ping`, + `tools/list`, `tools/call`. See the + [MCP guide](https://docs.volcano.dev/platform/interfaces/mcp) for the + tool surface and client configuration. + operationId: callMCP + security: + - ProjectAccessToken: [] + requestBody: + required: true + content: + application/json: + schema: + type: object + description: A JSON-RPC 2.0 request object. + required: + - jsonrpc + - method + properties: + jsonrpc: + type: string + enum: + - '2.0' + method: + type: string + description: The MCP method to call. + id: + description: | + Request identifier, echoed verbatim. Omit it to send a + notification, which is answered with `202` and no body. + oneOf: + - type: string + - type: integer + params: + type: object + additionalProperties: true responses: '200': - description: Server is healthy + description: A JSON-RPC response object content: - text/plain: + application/json: schema: - type: string - example: OK + type: object + required: + - jsonrpc + - id + properties: + jsonrpc: + type: string + enum: + - '2.0' + id: + description: Echoes the request's id. Null when the request could not be read well enough to determine one. + nullable: true + oneOf: + - type: string + - type: integer + result: + type: object + additionalProperties: true + error: + type: object + required: + - code + - message + properties: + code: + type: integer + message: + type: string + '202': + description: A notification was accepted; there is no body + '401': + description: Not authenticated + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: | + The credential is valid but may not use this endpoint — most often a + platform token, which names no project. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '413': + description: The JSON-RPC frame exceeds the 1 MiB limit components: + headers: + ETag: + description: | + Strong validator for the returned document. Send it back as `If-None-Match` + to revalidate without transferring the document again. + required: true + schema: + type: string + example: '"9f2c1e0b5a"' + DatabaseQueryProxyMs: + description: | + Milliseconds Volcano spent before running the query, counted from the + request arriving: authenticating the caller, validating the request, + resolving the database, and building the SQL. Does not include query + execution. Also present when the query itself failed. + schema: + type: integer + minimum: 0 + DatabaseQueryProxyHandlerMs: + description: | + The part of `X-Volcano-Proxy-Ms` spent in the query endpoint itself. + Subtract it from `X-Volcano-Proxy-Ms` to see what authentication and + request validation cost. Also present when the query itself failed. + schema: + type: integer + minimum: 0 + DatabaseQueryComputeMs: + description: | + Milliseconds the database took to run the query and return its rows. + Does not include Volcano's preparation. Also present when the query + itself failed. + schema: + type: integer + minimum: 0 securitySchemes: AnonKey: type: http @@ -12137,11 +13090,30 @@ components: UserToken: type: http scheme: bearer - bearerFormat: JWT + bearerFormat: opaque + description: | + Platform token, which acts on every project in your account. + Obtain one by running `volcano login`, or from the dashboard. + + For CI, scripts, and agents, prefer a project access token + (`pt-`) instead: it reaches only the project it was created in, + so a leak does not expose the rest of your account. See the + ProjectAccessToken scheme. + ProjectAccessToken: + type: http + scheme: bearer + bearerFormat: opaque description: | - Platform user token from the Management API. - Required for project management operations. - Obtain via POST /tokens in Management API (port 8001). + Project access token, scoped to a single project. Starts with `pt-`. + + Accepted on that project's control-plane routes and refused + everywhere else, including account-wide endpoints and any other + project. A `read_only` token additionally refuses mutations. + + Create one with POST /projects/{id}/access-tokens using a platform + token. The secret is returned once and is not recoverable, so a + project access token cannot create, list, read, or revoke project + access tokens. parameters: BackupName: name: backupName @@ -12387,6 +13359,14 @@ components: type: string format: uuid description: Project ID + TokenId: + name: tokenId + in: path + required: true + schema: + type: string + format: uuid + description: Project access token ID Search: name: search in: query @@ -12423,7 +13403,32 @@ components: maxLength: 256 pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$ description: Variable name + IfNoneMatch: + name: If-None-Match + in: header + required: false + description: | + Entity tag from an earlier response, returning `304 Not Modified` while it + still matches. Accepts the full condition: `*`, a comma-separated list, and + weak tags of the form `W/"tag"`. + schema: + type: string + example: '"9f2c1e0b5a"' responses: + OpenAPISpecThrottled: + description: | + Too many requests for the specification from one address. The document + carries an `ETag`; revalidate with `If-None-Match` rather than + re-fetching it. + headers: + Retry-After: + description: Seconds to wait before requesting the specification again. + schema: + type: integer + content: + application/json: + schema: + $ref: '#/components/schemas/Error' BandwidthCapExceeded: description: | The platform user exceeded their billing-cycle bandwidth allowance (aggregate @@ -12454,6 +13459,20 @@ components: application/json: schema: $ref: '#/components/schemas/Error' + OpenAPISpecNotModified: + description: | + The specification still matches the supplied `If-None-Match`, so no body + is returned. + headers: + ETag: + $ref: '#/components/headers/ETag' + OpenAPISpecHeaders: + description: | + The headers a `GET` would return, without the document. The declared + `ETag` is the one to revalidate against. + headers: + ETag: + $ref: '#/components/headers/ETag' schemas: AnonKey: type: object @@ -15146,6 +16165,20 @@ components: Frontend: type: object properties: + variable_scope: + type: string + enum: + - all + - shared + - scoped + description: All preserves access to all project variables. Shared includes the project frontend shared-variable list. Scoped includes only explicitly declared variables in builds and runtime. Omission preserves the stored selection. + declared_variables: + type: array + uniqueItems: true + items: + type: string + pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$ + description: Names selected when variable_scope is scoped. Missing declared values reject deployment. Omission preserves the stored list; an empty list clears it. id: type: string format: uuid @@ -15488,6 +16521,217 @@ components: - total_requests - total_errors - total_page_views + ProjectAccessToken: + type: object + description: | + A project access token: a control-plane credential bound to a single + project. Unlike a platform token, which acts on every project its owner + has, this one is limited to the project it was created in. + + The secret itself is never returned here. Only its hash is stored, so + the plaintext exists solely in the response to the create call. + properties: + id: + type: string + format: uuid + project_id: + type: string + format: uuid + name: + type: string + description: Unique per project. + token_prefix: + type: string + description: First 12 characters of the secret, for recognising a token in a list. + scope: + $ref: '#/components/schemas/ProjectAccessTokenScope' + status: + type: string + enum: + - active + - revoked + - expired + description: | + `revoked` means the token was deliberately revoked, by you or by the + deletion of its project. `expired` means it simply reached + `expires_at`; nothing was taken away. Both are refused, and both keep + their record so a token's name, prefix, last use, and request history + remain available after a leak. + + A token revoked before its expiry passed stays `revoked`, because + that is the fact worth keeping. + token_source: + type: string + enum: + - api + - cli + - dashboard + description: What created the token. + expires_at: + type: string + format: date-time + nullable: true + description: Absent for a token that does not expire. + last_used_at: + type: string + format: date-time + nullable: true + description: Updated at most once every few minutes, so it may lag slightly. + created_at: + type: string + format: date-time + all_time_requests: + type: integer + format: int64 + description: Requests authenticated with this token since it was created. + required: + - id + - project_id + - name + - token_prefix + - scope + - status + - token_source + - created_at + - all_time_requests + ProjectAccessTokenScope: + type: string + description: | + What a project access token may do within its project. + + `full` is everything you can do to that one project, up to and including + deleting it. It cannot manage access tokens, so a leaked token cannot + mint a replacement or erase the record of its own use, but for a CI or + agent credential that only deploys, prefer `read_only` where the job + allows it. + + `read_only` refuses mutations. It is enforced by route classification + rather than HTTP method, so the log and metrics query endpoints remain + available even though they are POST requests that carry body filters. + + `read_only` also refuses the reads that return a credential — service + keys, anon keys, variable values, and database connection strings. Those + grant write access over the project's data and keep working after the + token that fetched them is revoked, so returning one to a read-only + credential would make the scope a formality. An anon key is included + because its permissions are chosen per key and may include uploading, + deleting, and publishing. + enum: + - full + - read_only + x-enum-varnames: + - ProjectAccessTokenScopeFull + - ProjectAccessTokenScopeReadOnly + CreateProjectAccessTokenRequest: + type: object + properties: + name: + type: string + minLength: 1 + maxLength: 100 + description: | + Held by any of the project's tokens you have not revoked, including + one that has expired. Creating a duplicate returns 409 with code + `access_token_name_exists`; revoking the holder frees the name, so a + rotation can keep the name its caller already references. + scope: + $ref: '#/components/schemas/ProjectAccessTokenScope' + expires_at: + type: string + format: date-time + description: Omit for a token that does not expire. + required: + - name + - scope + CreatedProjectAccessToken: + allOf: + - $ref: '#/components/schemas/ProjectAccessToken' + - type: object + properties: + token: + type: string + description: | + The secret. Returned only here, and not recoverable afterwards: + the server stores a hash rather than the value. Save it now. + required: + - token + PaginatedProjectAccessTokens: + type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/ProjectAccessToken' + page: + type: integer + limit: + type: integer + total: + type: integer + has_more: + type: boolean + next: + type: string + required: + - data + - page + - limit + - total + - has_more + ProjectAccessTokenUsage: + type: object + description: | + Zero-filled daily request counts for a single token, oldest first. Every + day in the window is present, so a gap reads as zero rather than missing. + + Counts every request the token authenticated, including ones then + refused — a read-only token attempting a write, or a token presented on + another project's route. That is deliberate: after a leak, the probing + is the part you want to see, and a counter that hid it would make a + token look idle while it was being tried. + properties: + token_id: + type: string + format: uuid + name: + type: string + token_prefix: + type: string + description: | + The token's display prefix, which identifies the credential when its + name does not. Revoking frees a name, so a project that rotated + `ci-deploy` has two entries here both called `ci-deploy`. Not usable + as a credential. + days: + type: integer + description: Number of daily entries returned, always equal to the requested window. + daily: + type: array + items: + $ref: '#/components/schemas/ProjectAccessTokenUsageDailyEntry' + total_requests: + type: integer + format: int64 + required: + - token_id + - name + - token_prefix + - days + - daily + - total_requests + ProjectAccessTokenUsageDailyEntry: + type: object + properties: + day: + type: string + format: date + description: UTC day. + requests: + type: integer + format: int64 + required: + - day + - requests Function: type: object properties: @@ -15534,7 +16778,7 @@ components: type: string invoke_url: type: string - description: Canonical GeoDNS endpoint URL for invoking this function (always HTTPS) + description: 'Canonical geo-routed HTTPS endpoint for invoking this function. Use it as-is: it does not share a domain with the API, so a host derived from the API URL will not reach the function. Omitted when the deployment serves no public invocation domain, as in local development, so a client testing for an empty string never matches.' deployed_regions: type: array items: @@ -15761,12 +17005,18 @@ components: `succeeded`, `failed`, `timed_out`, `stopped` and `unknown` are terminal. - `unknown` means the platform lost track of the execution's outcome: it - was never seen to finish and is no longer reported, so no result or - error can be given for it. It is terminal because nothing can settle it - later, and it is rare — treat it as an outcome to retry under a new - name rather than a state to wait on. `completed_at` on an `unknown` - execution is when the platform gave up, not when the work ended. + `unknown` means the execution's outcome cannot be established, so no + result or error can be given for it. Either it was under way and was + never seen to finish, or its start failed with a `500` without the + platform establishing whether the execution began — which is why a + name whose start returned an error can later read as `unknown` rather + than not being found. It is terminal because nothing can settle it + later, and it is rare — treat it as an outcome to retry rather than a + state to wait on. A retry under the same name picks this execution back + up instead of starting a second one, and needs a free concurrency slot + because an `unknown` execution has given its own up. `completed_at` on + an `unknown` execution is when the platform gave up, not when the work + ended. DurableExecutionError: type: object description: Why a failed or timed-out execution ended. @@ -16967,6 +18217,14 @@ components: items: type: string pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$ + frontend_shared_variables: + type: array + uniqueItems: true + description: Replace the complete shared frontend-variable list with existing names. Frontends with variable_scope shared receive this list. Omission keeps membership unchanged; an empty list clears it. + items: + type: string + pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$ + maxLength: 256 variables: type: array description: Fully synced when declared - variables absent from this list are deleted. @@ -17455,6 +18713,20 @@ components: created or deleted through the manifest. A declared frontend entry without `custom_domain` deletes an existing custom domain. properties: + variable_scope: + type: string + enum: + - all + - shared + - scoped + description: All preserves access to all project variables. Shared includes the project frontend_shared_variables list. Scoped includes only explicitly declared variables in builds and runtime. Omission preserves the stored selection. + variables: + type: array + uniqueItems: true + items: + type: string + pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$ + description: Names selected when variable_scope is scoped. Missing declared values reject deployment. Omission preserves the stored list; an empty list clears it. name: type: string minLength: 1 @@ -17486,6 +18758,9 @@ components: enum: - all - scoped + x-enum-varnames: + - ProjectConfigFunctionVariableScopeAll + - ProjectConfigFunctionVariableScopeScoped description: | Which project variables this function receives. `all` (the default) gives it the project variables marked `shared: true`. `scoped` gives it only the variables @@ -18297,6 +19572,9 @@ components: type: string format: uuid description: Canonical function ID used for invocation routing + invoke_url: + type: string + description: 'Canonical HTTPS endpoint for invoking this function. Use it as-is: it does not share a domain with the API, so a host derived from the API URL will not reach the function. Omitted when the deployment serves no public invocation domain, as in local development; invoke through POST /functions/{functionId}/invoke instead.' cache_ttl_seconds: type: integer minimum: 1 @@ -19077,6 +20355,9 @@ components: shared: type: boolean description: 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. + frontend_shared: + type: boolean + description: Whether this name is in the project's shared frontend-variable list. id: type: string format: uuid @@ -19126,6 +20407,12 @@ components: - value - created_at - updated_at + OpenAPISpecDocument: + type: object + additionalProperties: true + description: | + This OpenAPI document, with every reference resolved. Shared by the JSON + and YAML operations, which differ only in serialization. ProjectGitConnectionSummary: type: object properties: