diff --git a/openapi/openapi.yaml b/openapi/openapi.yaml index 641fe9aa..d2adab52 100644 --- a/openapi/openapi.yaml +++ b/openapi/openapi.yaml @@ -4,7 +4,7 @@ info: description: |- Public API for Volcano 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. + This specification intentionally excludes first-party/internal APIs. See api/openapi-internal.yaml for non-public internal operations. version: 3.0.0 contact: name: Volcano @@ -22,9 +22,9 @@ tags: - name: Logs description: Project-scoped log search and activity APIs - name: Issues - description: 'Preview, not generally available: runtime errors grouped into issues. Where issues are not available, every endpoint answers `404` with code `feature_unavailable`.' - - name: Autofix - description: 'Preview, not generally available: AI diagnosis of a project''s issues and draft pull requests that fix them. Where autofix is not available, turning it on, or any request for a project that never saved settings, answers `404` with code `feature_unavailable`. Autofix is not available in local mode.' + description: 'Preview, not generally available: runtime errors grouped into issues, LavaFlow Code Quality findings, and problems reported for a project. Where issues are not available, every endpoint answers `404` with code `feature_unavailable`.' + - name: LavaFlow + description: 'Preview: LavaFlow diagnoses a project''s issues and opens pull requests that fix them. It merges a fix only under `autonomy: merge`, where the project''s `lavaflow.merge` capability is available, once the fix passes review and its required checks and nothing holds it. LavaFlow sends this project''s logs and source code to an AI service that Volcano operates. Every endpoint names one project with `project_id`. Where LavaFlow is not available, every endpoint refuses a project that has no LavaFlow records: `404` with code `feature_unavailable` while LavaFlow is not offered to the project, and `403` with code `plan_required` when it is but the owner''s plan does not include it. A project with records keeps reading them and can still turn LavaFlow off.' - name: Functions description: Function deployment and management - name: Durable Functions @@ -35,8 +35,10 @@ tags: a start returns is an execution to poll and stop, not a result. Durable work is metered on its own allowances: executions, and the operations each execution performs while it runs. + - name: Notifications + description: Where a project's alerts go, by email and by a signed webhook, and when a failing function scheduler is announced. - name: Frontends - description: Frontend deployment and management. Supports Next.js 15.x and 16.x with Node.js 22.x or 24.x inferred from package.json engines.node when the selected Node.js family satisfies the installed Next.js package engines.node constraint. + description: Frontend deployment and management. Supports Next.js 15.x and 16.x with Node.js 22.x, 24.x, or 26.x inferred from package.json engines.node when the selected Node.js family satisfies the installed Next.js package engines.node constraint. - name: Tokens description: Service keys for function invocation and database admin access - name: Variables @@ -47,6 +49,8 @@ tags: description: PostgreSQL database provisioning and management - name: Database Branches description: Short-lived forks of a database for development and testing + - name: Database Migrations + description: A database's migration history and the runs that apply migration files to it. Where migration runs are not available, starting a run or recording a baseline answers `404` with code `feature_unavailable`; history and runs stay readable. - name: Database Queries description: REST API for querying databases (SELECT, INSERT, UPDATE, DELETE) - name: Authentication @@ -67,10 +71,20 @@ tags: description: OAuth login flows and provider management for end users - name: Git Connections description: Platform-user git provider connections for deployment source integrations + - name: Shares + description: A project's owner shares it through a link that lets anyone fork a release the owner published into a project of their own + - name: Forks + description: A visitor's own project, created from a release a share offers + - name: Connectors + description: Links from Volcano to outside services, such as Slack workspaces the Volcano app is installed in + - name: Slack Connections + description: The Volcano Slack app's installations, and Slack identities connected to Volcano accounts, which LavaFlow takes reported problems through - name: Project Imports description: Read-only project source discovery and import readiness checks - name: Verified Domains description: Domains an account has proven it owns, so it can attach any custom domain below them + - name: Account Sessions + description: Your account's own sign-ins, so a CLI login can end itself without the dashboard - name: Storage Buckets description: Storage bucket management (platform admin) - name: Storage Policies @@ -101,7 +115,7 @@ paths: security: [] responses: '200': - description: List available sandbox presets + description: List available sandbox presets. Temporarily unavailable regions are omitted. content: application/json: schema: @@ -180,7 +194,7 @@ paths: schema: $ref: '#/components/schemas/SandboxTemplate' default: - description: Request refused or unavailable. Errors include invalid input (400), unauthenticated (401), forbidden (403), not found (404), conflicting retry (409), capacity exhausted (429), and temporarily unavailable (503). Code `feature_unavailable` with 404 means sandboxes are not available in this environment. + description: Request refused or unavailable. Errors include invalid input (400), unauthenticated (401), forbidden (403), not found (404), conflicting retry (409), a request body over its limit or with too many JSON objects, arrays or values (413), capacity exhausted (429), and temporarily unavailable (503). Code `feature_unavailable` with 404 means sandboxes are not available in this environment. content: application/json: schema: @@ -257,7 +271,7 @@ paths: schema: $ref: '#/components/schemas/SandboxTemplate' default: - description: Request refused or unavailable. Errors include invalid input (400), unauthenticated (401), forbidden (403), not found (404), conflicting retry (409), capacity exhausted (429), and temporarily unavailable (503). Code `feature_unavailable` with 404 means sandboxes are not available in this environment. + description: Request refused or unavailable. Errors include invalid input (400), unauthenticated (401), forbidden (403), not found (404), conflicting retry (409), a request body over its limit or with too many JSON objects, arrays or values (413), capacity exhausted (429), and temporarily unavailable (503). Code `feature_unavailable` with 404 means sandboxes are not available in this environment. content: application/json: schema: @@ -331,7 +345,6 @@ paths: type: object required: - name - - code properties: name: type: string @@ -339,7 +352,7 @@ paths: code: type: string format: binary - description: Source tar.gz archive, limited to 32 MiB compressed and expanded. + description: Source tar.gz archive, limited to 32 MiB compressed and expanded. Required for customer templates. Omit for the managed Builder template. memory_mb: type: integer enum: @@ -349,6 +362,9 @@ paths: ports: type: string description: JSON array of application ports that must become ready before activation, for example [8080]. + containers: + type: boolean + description: Run a rootless container engine (Docker Engine with Compose) in every session of this template. Commands reach it through `DOCKER_HOST` and keep the same privileges as in any other session. Disabled by default. Only the operator-authorized Builder caller in local mode can deploy its reserved platform template, with no code archive or ports. Disabled or unsupported opt-ins answer `400 feature_unavailable`. An unauthorized caller receives 403; incompatible form fields receive 400. responses: '202': description: Deployment queued or replayed @@ -357,7 +373,7 @@ paths: schema: $ref: '#/components/schemas/SandboxDeployment' default: - description: Invalid source (400), denied access (401, 403), conflicting retry (409), or a temporarily unavailable deployment service (503). Code `feature_unavailable` with 404 means sandboxes or custom templates are not available in this environment. + description: Invalid source (400), denied access (401, 403), conflicting retry (409), or a temporarily unavailable deployment service (503). Code `feature_unavailable` with 404 means sandboxes or custom templates are not available in this environment. A deployment builds no image in a temporarily unavailable region; code `sandbox_region_unavailable` (400) means every region is unavailable. content: application/json: schema: @@ -612,7 +628,7 @@ paths: schema: $ref: '#/components/schemas/SandboxSession' default: - description: Request refused or unavailable. Errors include invalid input (400), unauthenticated (401), forbidden (403), not found (404), conflicting retry (409), capacity exhausted (429), and temporarily unavailable (503). Code `feature_unavailable` with 404 means sandboxes are not available in this environment. Code `sandbox_plan_limit_exceeded` (403) means the requested resources exceed the plan. Code `sandbox_allowance_exhausted` (429) means the remaining allowance or credits cannot admit the operation. + description: Request refused or unavailable. Errors include invalid input (400), unauthenticated (401), forbidden (403), not found (404), conflicting retry (409), a request body over its limit or with too many JSON objects, arrays or values (413), capacity exhausted (429), and temporarily unavailable (503). Code `feature_unavailable` with 404 means sandboxes are not available in this environment. Code `sandbox_plan_limit_exceeded` (403) means the requested resources exceed the plan. Code `sandbox_allowance_exhausted` (429) means the remaining allowance or credits cannot admit the operation. Code `sandbox_region_unavailable` (400) means the region is temporarily unavailable for Sandboxes; choose another from `GET /sandboxes/presets`. Code `feature_unavailable` with 400 means `network.egress` `deny_all` is not available in this environment; `GET /capabilities` lists it as `sandboxes.network_isolation`. Code `feature_unavailable` with 400 means the request keeps no output while the `sandboxes.output_not_kept` capability is unavailable. Code `sandbox_limits_unsupported` (400) means the selected image predates `limits` or the local Builder session cannot enforce `disk_mib`. For Builder, omit the disk limit. For older images, redeploy the template or recreate the named Sandbox, or retry once the preset is updated. Code `sandbox_limits_exceed_session` (400) means `limits.vcpus` is more than the session has; use a larger preset size or template, or lower `limits.vcpus`. content: application/json: schema: @@ -654,12 +670,158 @@ paths: schema: $ref: '#/components/schemas/SandboxExecutionResult' default: - description: Request refused or unavailable. Errors include invalid input (400), unauthenticated (401), forbidden (403), not found (404), conflicting retry (409), capacity exhausted (429), and temporarily unavailable (503). Code `feature_unavailable` with 404 means sandboxes are not available in this environment. Code `sandbox_plan_limit_exceeded` (403) means the requested resources exceed the plan. Code `sandbox_allowance_exhausted` (429) means the remaining allowance or credits cannot admit the operation. + description: Request refused or unavailable. Errors include invalid input (400), unauthenticated (401), forbidden (403), not found (404), conflicting retry (409), startup hook timeout (422), a request body over its limit or with too many JSON objects, arrays or values (413), capacity exhausted (429), and temporarily unavailable (503). Code `feature_unavailable` with 404 means sandboxes are not available in this environment. Code `sandbox_plan_limit_exceeded` (403) means the requested resources exceed the plan. Code `sandbox_allowance_exhausted` (429) means the remaining allowance or credits cannot admit the operation. Code `sandbox_region_unavailable` (400) means the region is temporarily unavailable for Sandboxes; choose another from `GET /sandboxes/presets`. Code `feature_unavailable` with 400 means `network.egress` `deny_all` is not available in this environment; `GET /capabilities` lists it as `sandboxes.network_isolation`. Code `sandbox_image_outdated` (409) means the template's image predates what the request needs, such as `deny_all` on a template deployed to local mode before this version; redeploy the template. No command was sent. Code `feature_unavailable` with 400 means the request keeps no output while the `sandboxes.output_not_kept` capability is unavailable. Code `sandbox_start_failed` means startup failed or timed out before the command was sent. Its status is 422 for sandbox_run_hook_timeout on a custom deployment, 429 for sandbox_allowance_exhausted or sandbox_allowance_retention_expired, and 503 for managed-preset run-hook timeouts or other or unknown startup reasons. sandbox_start_timeout means the startup wait expired; sandbox_session_expired means the session lifetime ended before dispatch. For sandbox_launch_outcome_unknown, the session isn't billed. Its startup command may already have started and can run until the session would have expired; Volcano can't reach it. Start a new session with a new key. A session whose launch outcome was unknown when it ended for an earlier reason keeps that reason, with the same caveat. Its error message includes the recorded startup reason when known, including on replay. The message is diagnostic text, not a stable machine-readable retry classification; investigate the reason before starting another billed attempt. Admission refusals include response code `sandbox_capacity_unavailable` (429), `sandbox_allowance_exhausted` (429), and `sandbox_plan_limit_exceeded` (403); no command was sent. Reusing the same Idempotency-Key replays these refusals or startup failure even after recovery; use a new key for a new attempt. A 403 or 429 without an explicit admission-refusal code or sandbox_start_failed does not prove no dispatch. Other failures may have an unknown execution outcome; do not use a new key to repeat a command with side effects. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /sandbox-session-files: + get: + tags: + - Sandboxes + summary: List workspace files + description: 'Lists a directory in a Sandbox session''s workspace, one page at a time. The listing never follows a symlink and never leaves the workspace. It is not a snapshot: a file that changes while it runs can appear before or after the change. Sessions started on an image built before file listing answer 409 with code `sandbox_image_outdated`; start a new session, after redeploying a custom template.' + operationId: listSandboxSessionFiles + security: + - UserToken: [] + - ServiceRoleKey: [] + - ProjectAccessToken: [] + - AuthUserAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectIdQuery' + - name: session_id + in: query + required: true + description: The session to list. A session outside `project_id` answers like one that doesn't exist. + schema: + type: string + format: uuid + - name: path + in: query + required: false + description: Workspace directory to list, such as `src` or `/workspace/src`. Omit it, or pass `.` or `/workspace`, to list the workspace root. The path must be a directory; it is never reached through a symlink. + schema: + type: string + minLength: 1 + maxLength: 4096 + - name: recursive + in: query + required: false + description: List every entry below the directory. When false, list only its direct entries. + schema: + type: boolean + default: true + - name: include_sha256 + in: query + required: false + description: Add the SHA-256 digest of each regular file's content. A call reads at most 256 MiB to hash; a page ends early, with `next_cursor`, before a file that would pass that budget. A file without a digest says why in `sha256_skipped`. + schema: + type: boolean + default: false + - name: limit + in: query + required: false + description: Most entries to return. A page can hold fewer, so continue while `next_cursor` is present. + schema: + type: integer + minimum: 1 + maximum: 10000 + default: 10000 + - name: cursor + in: query + required: false + description: Opaque cursor from the previous page's `next_cursor`. It is valid only for the same project and session; send the same `path` and `recursive` with it. + schema: + type: string + minLength: 1 + maxLength: 8192 + responses: + '200': + description: One page of workspace entries + content: + application/json: + schema: + $ref: '#/components/schemas/SandboxFileListResult' + default: + description: Request refused or unavailable. Errors include invalid input (400), unauthenticated (401), forbidden (403), not found (404), conflict (409), capacity exhausted (429), and temporarily unavailable (503). A project the caller can't read answers 404 exactly like one that doesn't exist, and a session outside the project answers like an unknown session. A credential for the project that lacks the `sandboxes.files.read` permission answers 403. Code `sandbox_path_not_directory` with 400 means the path is missing, is not a directory, or passes through a symlink. Code `sandbox_path_unreadable` with 400 means the session user can't list the path or pass through a directory above it. Code `sandbox_image_outdated` with 409 means the session's image predates file listing. Code `feature_unavailable` with 404 means sandboxes are not available in this environment. content: application/json: schema: $ref: '#/components/schemas/Error' /sandbox-sessions/{sessionId}: + patch: + tags: + - Sandboxes + summary: Report sandbox session activity + operationId: updateSandboxSessionActivity + description: 'Updates the session activity with one complete, ordered report. Other session fields keep their values. A scoped service key needs the `sandboxes.sessions.activity` permission. Send new events while the session is running, using a strictly increasing sequence per session. For `idle: true`, send a positive `idle_timeout_seconds` to set or replace the deadline. For `idle: false`, omit `idle_timeout_seconds`. Accepting this active report clears any existing idle deadline. Before expiry, an exact retry of the latest event preserves its deadline. Reads leave the timer alone. Suspension preserves it, and the original session lifetime still applies. At the idle deadline, live access ends. When Volcano terminates the VM for idle expiry, its local files are lost and the session records `sandbox_idle_expired` in `last_error_code`.' + security: + - UserToken: [] + - ServiceRoleKey: [] + - ProjectAccessToken: [] + parameters: + - name: sessionId + in: path + required: true + schema: + type: string + format: uuid + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - activity + properties: + activity: + type: object + additionalProperties: false + required: + - sequence + - idle + properties: + sequence: + type: integer + format: int64 + minimum: 1 + idle: + type: boolean + idle_timeout_seconds: + type: integer + format: int32 + minimum: 1 + maximum: 2147483647 + x-go-type-skip-optional-pointer: true + description: Seconds from acceptance of an idle report to expiry. Required when idle is true and omitted when active. + not: + anyOf: + - properties: + idle: + type: boolean + enum: + - true + not: + required: + - idle_timeout_seconds + - properties: + idle: + type: boolean + enum: + - false + required: + - idle_timeout_seconds + responses: + '204': + description: Activity recorded or already applied + default: + description: Missing or invalid credentials return 401. A credential for the session's project that lacks `sandboxes.sessions.activity` returns 403. An unknown session or one outside the caller's project returns 404. An invalid activity payload returns 400. A stale sequence, a conflicting retry, or a new event that the session's current state cannot accept returns 409. After a session deadline passes, an activity update returns 409 with code `sandbox_session_expired`. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' get: tags: - Sandboxes @@ -774,7 +936,7 @@ paths: schema: $ref: '#/components/schemas/SandboxSession' default: - description: Request refused or unavailable. Errors include invalid input (400), unauthenticated (401), forbidden (403), not found (404), conflicting retry (409), capacity exhausted (429), and temporarily unavailable (503). Code `feature_unavailable` with 404 means sandboxes are not available in this environment. Code `sandbox_plan_limit_exceeded` (403) means the requested resources exceed the plan. Code `sandbox_allowance_exhausted` (429) means the remaining allowance or credits cannot admit the operation. + description: Request refused or unavailable. Errors include invalid input (400), unauthenticated (401), forbidden (403), not found (404), conflicting retry (409), capacity exhausted (429), and temporarily unavailable (503). Code `feature_unavailable` with 404 means sandboxes are not available in this environment. Code `sandbox_session_expired` (409) means the session passed its deadline and can no longer resume. Code `sandbox_plan_limit_exceeded` (403) means the requested resources exceed the plan. Code `sandbox_allowance_exhausted` (429) means the remaining allowance or credits cannot admit the operation. content: application/json: schema: @@ -817,7 +979,7 @@ paths: schema: $ref: '#/components/schemas/SandboxCommandResult' default: - description: Request refused or unavailable. Errors include invalid input (400), unauthenticated (401), forbidden (403), not found (404), conflicting retry (409), capacity exhausted (429), and temporarily unavailable (503). Code `feature_unavailable` with 404 means sandboxes are not available in this environment. + description: Request refused or unavailable. Errors include invalid input (400), unauthenticated (401), forbidden (403), not found (404), conflicting retry (409), a request body over its limit or with too many JSON objects, arrays or values (413), capacity exhausted (429), and temporarily unavailable (503). Code `feature_unavailable` with 404 means sandboxes are not available in this environment. Code `sandbox_session_not_running` (409) means the session cannot accept commands and the command was not sent. The same Idempotency-Key replays this refusal even after the session resumes; use a new key once the session is running. Other failures may have an unknown outcome; reuse the original key. Code `sandbox_command_capacity` with 429 means the session is already running its maximum number of commands and started nothing; retry with the same Idempotency-Key once one finishes. Code `sandbox_session_keeps_no_output` with 400 means the session keeps no command output and the request set `keep_output` to true. Code `feature_unavailable` with 400 means the command keeps no output, by its own `keep_output` or its session's, while the `sandboxes.output_not_kept` capability is unavailable. Code `sandbox_disk_full` (409) means the session's disk had no room to record the command and it started nothing; retry with the same Idempotency-Key once there is room. content: application/json: schema: @@ -854,7 +1016,7 @@ paths: schema: $ref: '#/components/schemas/SandboxFileResult' default: - description: Request refused or unavailable. Errors include invalid input (400), unauthenticated (401), forbidden (403), not found (404), conflicting retry (409), capacity exhausted (429), and temporarily unavailable (503). Code `feature_unavailable` with 404 means sandboxes are not available in this environment. + description: Request refused or unavailable. Errors include invalid input (400), unauthenticated (401), forbidden (403), not found or terminated session (404), conflicting retry (409), a request body over its limit or with too many JSON objects, arrays or values (413), capacity exhausted (429), and temporarily unavailable (503). Code `sandbox_file_not_found` with 404 means no file exists at `path`; `sandbox_file_unreadable` with 400 means `path` is a directory, symbolic link, socket or other special file, or a file the session user cannot read, and in a cloud session also a file another user owns or one with more than one hard link; `sandbox_file_too_large` with 413 means the file is larger than 8 MiB. Code `feature_unavailable` with 404 means sandboxes are not available in this environment. content: application/json: schema: @@ -887,7 +1049,127 @@ paths: '204': description: Write a workspace file default: - description: Request refused or unavailable. Errors include invalid input (400), unauthenticated (401), forbidden (403), not found (404), conflicting retry (409), capacity exhausted (429), and temporarily unavailable (503). Code `feature_unavailable` with 404 means sandboxes are not available in this environment. + description: Request refused or unavailable. Errors include invalid input (400), unauthenticated (401), forbidden (403), not found or terminated session (404), conflicting retry (409), a request body over its limit or with too many JSON objects, arrays or values (413), capacity exhausted (429), and temporarily unavailable (503). Code `feature_unavailable` with 404 means sandboxes are not available in this environment. Code `sandbox_disk_full` (409) means the write did not fit on the session's disk; delete files in the session, or, for a session started with `limits.disk_mib`, start one with a larger cap. Code `sandbox_path_conflict` (409) means a cloud session has `limits.disk_mib`, whose writes run as the session user, and that user cannot write the file's directory. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /sandbox-file-archives: + post: + tags: + - Sandboxes + summary: Extract a tar archive into a session's workspace + description: | + Extracts a tar archive into a directory of a session's workspace. Send `multipart/form-data` + with `project_id`, `session_id` and `path`, in any order, then the archive as the file part + `archive`. The archive may be gzip-compressed; Volcano detects compression from its first bytes. + The request streams to the session, so the archive is never held whole in memory. + + Each call accepts at most 32 MiB of archive, 10,000 files and directories, and 256 MiB of + uncompressed archive, counting tar headers, and has 2 minutes to send its archive; a slower + call fails and writes nothing. Split larger trees into several archives and create one after + another. For a single file larger than 8 MiB, use `POST /sandbox-file-parts`. + + `path` must name a directory below the workspace root; a path that resolves to the root or to + `/`, such as `.`, `./`, `/`, `/workspace` or `/workspace/.`, is refused with + `sandbox_archive_invalid`. The archive may contain only regular files and directories. Entry + names are relative to `path`, which is created when missing; an absolute name, a `..` + component, a symbolic link, a + hard link, a sparse file, or a device refuses the whole archive. File and directory modes keep their + permission bits; setuid, setgid and sticky bits are dropped. A file replaces an existing file or + symbolic link at its path. Existing directories keep their modes. A symbolic link in the + destination is never followed. + + The archive is checked and staged before the workspace changes, so a refused archive writes + nothing, and one that fails part way is undone. If a session process moves or removes a + directory while the archive is written, the call answers `409`, a file the archive replaced + there is kept in a `.sandbox-archive-*` directory at the workspace root, and files the + archive already placed can stay. Read-only directories the session user + owns still take new entries and keep their modes. Code `sandbox_archive_invalid` (400) means the archive or form is malformed or holds an + entry that is not allowed. Code `sandbox_archive_too_large` (413) means it exceeds a limit + above. Code `sandbox_path_conflict` (409) means the destination has a symbolic link or a file + where the archive needs a directory, a directory where it has a file, or a directory the + session user cannot write. Code + `sandbox_disk_full` (409) means the session's disk has no room for it; free space and retry. Code + `sandbox_image_outdated` (409) means the session started from an image that predates archive + writes; start a new session from a current preset, or redeploy the template. A session outside + `project_id`, or a project the caller cannot reach, answers 404 like an unknown session. + operationId: createSandboxFileArchive + security: + - UserToken: [] + - ServiceRoleKey: [] + - ProjectAccessToken: [] + - AuthUserAccessToken: [] + requestBody: + required: true + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/SandboxFileArchiveForm' + responses: + '201': + description: The archive was extracted + content: + application/json: + schema: + $ref: '#/components/schemas/SandboxFileArchive' + default: + description: Request refused or unavailable. Errors include an invalid form or archive (400), unauthenticated (401), forbidden (403), an unknown project or session (404), a conflicting destination, an outdated session image or a full disk (409), an archive over a limit (413), and temporarily unavailable (503). Code `feature_unavailable` with 404 means sandboxes are not available in this environment. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /sandbox-file-parts: + post: + tags: + - Sandboxes + summary: Write one part of a large workspace file + description: | + Writes a file of up to 1 GiB into a session's workspace in parts of at most 8 MiB. Each part + names its `offset` in the file, the whole file's `size`, and the whole file's lowercase hex + `sha256`. Parts collect in a hidden staging file beside `path`; nothing appears at `path` until + the part that ends at `size` arrives. That part checks the whole file's size and SHA-256, then + moves the file into place in one step, so a partial file is never visible at `path`. The + response's `complete` says which part finished the file. Missing parent directories are created, + and a symbolic link among them is never followed. The finished file is readable and writable + only by the session user. + + A part may start anywhere up to the bytes already received, so a failed part can be resent. A + part at offset 0 starts the file again. Resending the part that finished the file answers the + same completion while the file at `path` still matches `size` and `sha256`. Code `sandbox_file_part_out_of_order` (409) means the + part starts past the bytes received; resend from the last part that succeeded. Code + `sandbox_file_part_mismatch` (409) means the finished file differs from `size` or `sha256`; its + parts are discarded, so start again at offset 0. Code `sandbox_path_conflict` (409) means a + directory is at `path`, a file or symbolic link is where a parent directory belongs, or the + session user cannot write the parent directory, or, when parents are missing, the nearest + one that exists. Read-only directories the session user owns still take new entries and + keep their modes. Code + `sandbox_disk_full` (409) means the session's disk has no room; free space and retry. Code + `sandbox_image_outdated` (409) means the session started from an image that predates parted + writes. A staging file stays until its file completes, a part at offset 0 restarts it, or the + session ends. A session outside `project_id`, or a project the caller cannot reach, answers 404 + like an unknown session. + operationId: createSandboxFilePart + security: + - UserToken: [] + - ServiceRoleKey: [] + - ProjectAccessToken: [] + - AuthUserAccessToken: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SandboxFilePartRequest' + responses: + '201': + description: The part was written + content: + application/json: + schema: + $ref: '#/components/schemas/SandboxFilePart' + default: + description: Request refused or unavailable. Errors include invalid input (400), unauthenticated (401), forbidden (403), an unknown project or session (404), a part out of order, a mismatched file, a conflicting destination, an outdated session image or a full disk (409), a request body over its limit or with too many JSON objects, arrays or values (413), and temporarily unavailable (503). Code `feature_unavailable` with 404 means sandboxes are not available in this environment. content: application/json: schema: @@ -924,7 +1206,7 @@ paths: '204': description: Authorize an authenticated project user for this session default: - description: Request refused or unavailable. Errors include invalid input (400), unauthenticated (401), forbidden (403), not found (404), conflicting retry (409), capacity exhausted (429), and temporarily unavailable (503). Code `feature_unavailable` with 404 means sandboxes are not available in this environment. + description: Request refused or unavailable. Errors include invalid input (400), unauthenticated (401), forbidden (403), not found (404), conflicting retry (409), a request body over its limit or with too many JSON objects, arrays or values (413), capacity exhausted (429), and temporarily unavailable (503). Code `feature_unavailable` with 404 means sandboxes are not available in this environment. content: application/json: schema: @@ -990,7 +1272,7 @@ paths: schema: $ref: '#/components/schemas/SandboxAccess' default: - description: Request refused or unavailable. Errors include invalid input (400), unauthenticated (401), forbidden (403), not found (404), conflicting retry (409), capacity exhausted (429), and temporarily unavailable (503). Code `feature_unavailable` with 404 means sandboxes are not available in this environment. + description: Request refused or unavailable. Errors include invalid input (400), unauthenticated (401), forbidden (403), not found (404), conflicting retry (409), a request body over its limit or with too many JSON objects, arrays or values (413), capacity exhausted (429), and temporarily unavailable (503). Code `feature_unavailable` with 404 means sandboxes are not available in this environment. Code `sandbox_network_isolated` (400) means the session was created with `network.egress` `deny_all`, which accepts no port access. content: application/json: schema: @@ -1018,7 +1300,7 @@ paths: - name: redirect in: query required: false - description: Validated application URL used after the provider callback. + description: Application URL used after the provider callback. It must be on the Volcano dashboard's origin, or `http` to `127.0.0.1` or `[::1]` with a port. schema: type: string format: uri @@ -1026,7 +1308,7 @@ paths: - name: callback_url in: query required: false - description: Same-origin browser callback used to relay provider parameters before completing the connection. + description: Same-origin browser callback used to relay provider parameters before completing the connection. It must be on the Volcano dashboard's origin, or `http` to `127.0.0.1` or `[::1]` with a port. schema: type: string format: uri @@ -1241,7 +1523,7 @@ paths: tags: - Project Imports summary: List project sources available from a provider connection - description: Lists provider projects without changing provider or Volcano resources. + description: Lists provider projects without changing provider or Volcano resources. For `github`, lists every repository the GitHub connection reaches through each of its Volcano GitHub App installations, with its default branch and whether it is empty. operationId: listImportSources security: - UserToken: [] @@ -1255,7 +1537,7 @@ paths: - name: connection_id in: query required: true - description: Owned provider connection used for discovery. + description: Owned provider connection used for discovery. For `github`, the caller's GitHub connection ID from `GET /user/git/connections`. schema: type: string format: uuid @@ -1319,7 +1601,7 @@ paths: tags: - Project Imports summary: Check whether a provider project is ready to import - description: Produces a deterministic read-only readiness report for a proposed new Volcano project. + description: 'Produces a deterministic read-only readiness report for a proposed new Volcano project. For `github`, resolves the branch head, prepares that commit under `root_directory` the way a deployment does, and returns what it holds in `source_scan`, with `candidates` below the root directory that a preflight with other settings would deploy. Unsupported items are reported and left out, including a frontend `.volcano/source-layout.json` names that Volcano cannot build: the import deploys everything else. The report is `blocked` when nothing can be deployed, or when an unsupported item would still fail the first deployment: a function under `volcano/functions` that holds TypeScript with no entry the build compiles.' operationId: preflightProjectImport security: - UserToken: [] @@ -1373,6 +1655,12 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + '422': + description: 'The repository cannot be scanned: it is empty (`import_repository_empty`), the branch does not exist (`import_branch_not_found`), or a deployment would refuse the commit, such as a missing root directory (`import_source_invalid`, with the reason).' + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': description: Provider rate limit exceeded content: @@ -1395,8 +1683,8 @@ paths: post: tags: - Project Imports - summary: Start a Vercel project import - description: Creates a Volcano project from an importable production preflight report. Retrying the same request with the same Idempotency-Key returns the existing run. + summary: Start a project import + description: Creates a Volcano project from an importable production preflight report and queues its first deployment. Retrying the same request with the same Idempotency-Key returns the existing run. For `github`, the project is connected to the repository and branch, deploys functions and every supported frontend, stores the request's variables, and is refused with `import_source_not_importable` when nothing can be deployed. A push to the branch after preflight makes the request stale. operationId: startProjectImport security: - UserToken: [] @@ -1434,7 +1722,7 @@ paths: schema: $ref: '#/components/schemas/ProjectImportRun' '400': - description: Invalid request or idempotency key + description: Invalid request or idempotency key, a `variables` name that is not a valid variable name or is sent more than once (`import_variable_name_invalid`, with the name quoted in `error`), or `deploy_migrations` while database migrations are unavailable (`feature_unavailable`) content: application/json: schema: @@ -1463,8 +1751,14 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + '413': + description: Request body exceeds 1,048,576 bytes + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '422': - description: Source is not importable + description: Source is not importable (`import_source_not_importable`, with the reason), or a `github` repository is empty, has no such branch, or holds a commit a deployment would refuse content: application/json: schema: @@ -1546,9 +1840,14 @@ paths: summary: Start a git provider connection description: | Starts a first-party dashboard user's git provider connection flow and - returns the provider authorization URL. The response also sets a - short-lived HttpOnly callback binding cookie tied to the authenticated - user through the signed provider state. + returns the provider authorization URL. For a user with no GitHub + connection, or one whose expired token GitHub refuses to refresh, it is + GitHub's authorization page for the Volcano App; a connection whose + account reaches no installation of the App then continues to the App's + install page. For a user with a working connection, it is the App's + install page, where they change the App's access. The response also + sets a short-lived HttpOnly callback binding cookie tied to the + authenticated user through the signed provider state. operationId: startGitConnect security: - UserToken: [] @@ -1566,13 +1865,13 @@ paths: - name: redirect in: query required: false - description: URL to redirect the browser to after the provider callback completes. + description: URL to redirect the browser to after the provider callback completes. It must be on the Volcano dashboard's origin, or `http` to `127.0.0.1` or `[::1]` with a port. schema: type: string - name: callback_url in: query required: false - description: Same-origin browser callback used to relay provider parameters before completing the connection. + description: Same-origin browser callback used to relay provider parameters before completing the connection. It must be on the Volcano dashboard's origin, or `http` to `127.0.0.1` or `[::1]` with a port. schema: type: string format: uri @@ -1990,929 +2289,868 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - /github/callback: - get: + /user/tokens/current: + delete: tags: - - Git Connections - summary: Complete a GitHub App connection callback + - Account Sessions + summary: Revoke the calling platform token description: | - Public GitHub App callback. The signed state and callback binding cookie - bind the provider authorization to the browser that started the flow. - operationId: gitConnectCallback - security: [] - parameters: - - name: code - in: query - required: false - description: GitHub user authorization code. - schema: - type: string - - name: state - in: query - required: true - description: Signed connect state generated by startGitConnect. - schema: - type: string - - name: error - in: query - required: false - description: Provider error returned by GitHub. - schema: - type: string + Revokes the platform token that authenticates this request, and ends + the sign-in session it was created from, if any. Ending the session + also revokes every other token created from it. Every later request + with the token answers `401`. + + Only a platform token (`pk-`) can call it. A project access token is + refused with `403`. + operationId: revokeCurrentUserToken + security: + - UserToken: [] responses: - '303': - description: Redirect back to the app after a successful or failed connect attempt - headers: - Location: - description: Redirect target - schema: - type: string - '400': - description: Invalid callback request or state + '204': + description: Token revoked + '401': + description: Not authenticated, or not a platform token content: application/json: schema: $ref: '#/components/schemas/Error' - '429': - description: Too many callback attempts from this client + '403': + description: Forbidden - a project access token cannot revoke a platform token content: application/json: schema: $ref: '#/components/schemas/Error' '500': - description: Failed to complete the connection + description: Failed to revoke the token content: application/json: schema: $ref: '#/components/schemas/Error' - '503': - description: Git provider integration is not configured + '501': + description: Account sessions are unavailable in local mode content: application/json: schema: $ref: '#/components/schemas/Error' - /projects: + /user/sessions: get: tags: - - Projects - summary: List all projects for authenticated user + - Account Sessions + summary: List your account's sign-in sessions description: | - Returns projects that are not deleting or deleted, newest first. - Supports two mutually exclusive pagination modes. Offset mode uses - `page` and `limit`. Cursor mode uses `cursor` or `ending_before` with - `limit`, returns `next_cursor`/`prev_cursor`, and supports a bounded - `offset` past the cursor anchor. Supplying `limit` without `page` - selects cursor mode. `search` applies a case-insensitive project-name - filter in either mode. `include` optionally expands each returned - project with its Git connection and/or aggregate health summary using - `git_connection` and `health`. Sending `page` with `cursor` or `ending_before`, - or sending both cursor directions, returns 400. - operationId: listProjects + Lists the sign-in sessions of the account that owns the calling + platform token: dashboard sign-ins (`kind: browser`) and CLI logins + (`kind: cli`). The session the calling token was exchanged from is + marked `is_current: true`. A token created in the dashboard or through + the management API, rather than by signing in, has no session, so no + session is current. + + Ordering and pagination match `GET /auth/user/sessions`. + + Only a platform token (`pk-`) can call it. A project access token is + refused with `403`. + operationId: listAccountSessions security: - UserToken: [] parameters: - - $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 - in: query - required: false - description: Optional comma-separated project metadata expansions. - style: form - explode: false - schema: - type: array - uniqueItems: true - items: - type: string - enum: - - git_connection - - health + - $ref: '#/components/parameters/SessionListPage' + - $ref: '#/components/parameters/SessionListLimit' + - $ref: '#/components/parameters/SessionListSort' + - $ref: '#/components/parameters/SessionListStatus' + - $ref: '#/components/parameters/SessionListCursor' + - $ref: '#/components/parameters/SessionListEndingBefore' + - $ref: '#/components/parameters/SessionListOffset' responses: '200': - description: Successful response + description: A page of the account's sessions content: application/json: schema: - $ref: '#/components/schemas/PaginatedProjects' + $ref: '#/components/schemas/AccountSessionList' '400': description: Invalid or conflicting pagination parameters content: application/json: schema: $ref: '#/components/schemas/Error' - post: - tags: - - Projects - summary: Create a new project - description: | - Creates a project for the authenticated user. - Each user can create up to 1,000 projects. Requests over this cap return 403. - operationId: createProject - security: - - UserToken: [] - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/CreateProjectRequest' - responses: - '201': - description: Project created + '401': + description: Not authenticated, or not a platform token content: application/json: schema: - $ref: '#/components/schemas/Project' - '400': - description: Bad request + $ref: '#/components/schemas/Error' + '403': + description: Forbidden - a project access token cannot read account sessions content: application/json: schema: $ref: '#/components/schemas/Error' - '403': - description: Project limit exceeded for the user + '500': + description: Failed to list sessions content: application/json: schema: $ref: '#/components/schemas/Error' - '503': - description: The selected project template is not configured in this environment + '501': + description: Account sessions are unavailable in local mode content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}: - get: + delete: tags: - - Projects - summary: Get project by ID - operationId: getProject + - Account Sessions + summary: Sign out every other session + description: | + Ends every session of the account except the one the calling token + was exchanged from, and revokes the platform tokens exchanged from + them. When the calling token has no session, every session ends. + + Platform tokens that were never linked to a session, such as one + created in the dashboard or through the management API, keep working. + Revoke each with `DELETE /user/tokens/current`. + operationId: revokeOtherAccountSessions security: - UserToken: [] - - ProjectAccessToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' responses: - '200': - description: Successful response + '204': + description: Every other session ended + '401': + description: Not authenticated, or not a platform token content: application/json: schema: - $ref: '#/components/schemas/Project' - '404': - description: Project not found + $ref: '#/components/schemas/Error' + '403': + description: Forbidden - a project access token cannot end account sessions content: application/json: schema: $ref: '#/components/schemas/Error' - patch: + '500': + description: Failed to end sessions + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '501': + description: Account sessions are unavailable in local mode + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /user/sessions/{sessionId}: + delete: tags: - - Projects - summary: Update project metadata and region policy - operationId: updateProject + - Account Sessions + summary: Sign out one session + description: | + Ends one of the account's sessions and revokes the platform tokens + exchanged from it. A session that is not the account's, or does not + exist, answers `404`. + operationId: revokeAccountSession security: - UserToken: [] - - ProjectAccessToken: [] parameters: - - $ref: '#/components/parameters/ProjectId' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateProjectRequest' + - name: sessionId + in: path + required: true + description: The session ID, from `GET /user/sessions` + schema: + type: string responses: - '200': - description: Project updated - content: - application/json: - schema: - $ref: '#/components/schemas/Project' - '400': - description: | - Bad request (no region selected, an unknown region, or — for a - project holding durable functions — a region that does not offer - durable execution) + '204': + description: Session ended + '401': + description: Not authenticated, or not a platform token content: application/json: schema: $ref: '#/components/schemas/Error' '403': - description: Forbidden (for example, selecting subset regions on plan other than SUPERAGENT) + description: Forbidden - a project access token cannot end account sessions content: application/json: schema: $ref: '#/components/schemas/Error' '404': - description: Project not found + description: Session not found content: application/json: schema: $ref: '#/components/schemas/Error' - '409': - description: Conflict (project name already exists or a resource deployment blocks a region change) + '500': + description: Failed to end the session content: application/json: schema: $ref: '#/components/schemas/Error' - delete: - tags: - - Projects - summary: Delete a project - description: | - Starts asynchronous project deletion. The project remains available from - `GET /projects/{id}` with `status: deleting` until cleanup finishes, but is - removed from project lists as soon as deletion starts. After cleanup it - returns 404. - operationId: deleteProject - security: - - UserToken: [] - - ProjectAccessToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' - responses: - '202': - description: Project deletion started - '404': - description: Project not found + '501': + description: Account sessions are unavailable in local mode content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/health: + /github/callback: get: tags: - - Projects - summary: Get project health + - Git Connections + summary: Complete a GitHub App connection callback description: | - Returns a fast control-plane health snapshot for the project and its - deployed resources. The endpoint does not run live provider probes. - A successful request returns 200 even when the project status is - `degraded` or `critical`; transport and authorization failures use HTTP - errors. - operationId: getProjectHealth - security: - - UserToken: [] - - ProjectAccessToken: [] + Public GitHub App callback. The signed state and callback binding cookie + bind the provider authorization to the browser that started the flow. + + GitHub also sends a browser here without `state` when someone installs + the App, changes its repository access, or asks an organization owner + to install it, on GitHub itself, including from the install page a + completed connection sends an account with no installation to. That + request connects nothing: Volcano + ignores `code` and `installation_id`, and redirects to the dashboard's + Git settings page when `setup_action` is `install`, `update`, or + `request`. Any other request without `state` returns 400. An empty or + invalid `state` is refused as before and never redirects there. + operationId: gitConnectCallback + security: [] parameters: - - $ref: '#/components/parameters/ProjectId' + - name: code + in: query + required: false + description: GitHub user authorization code. Ignored when `state` is absent. + schema: + type: string + - name: state + in: query + required: false + description: | + Signed connect state generated by startGitConnect. Absent when the + install started on GitHub rather than in Volcano. + schema: + type: string + - name: error + in: query + required: false + description: Provider error returned by GitHub. + schema: + type: string + - name: installation_id + in: query + required: false + description: | + The GitHub App installation ID GitHub adds to the redirect. Volcano + does not read it; a repository is connected through startGitConnect. + schema: + type: string + - name: setup_action + in: query + required: false + description: | + What happened on GitHub: `install`, `update`, or `request`. Without + `state`, one of these values redirects to the dashboard; any other + value, or none, returns 400. With `state`, it is ignored. + schema: + type: string responses: - '200': - description: Project health snapshot retrieved + '302': + description: | + Sent only when `state` is absent and `setup_action` is `install`, + `update`, or `request`. Redirects to the dashboard's Git settings + page without connecting anything, setting a cookie, or echoing the + request's query. + headers: + Location: + required: true + description: | + The dashboard's Git settings page with the fixed query + `github_install=1`. + schema: + type: string + format: uri + Cache-Control: + required: true + description: Always `no-store`. + schema: + type: string + Referrer-Policy: + required: true + description: Always `no-referrer`, so the dashboard never receives the callback URL. + schema: + type: string + '303': + description: | + Redirect back to the app after a successful or failed connect + attempt, or, after a successful one whose GitHub account reaches no + installation of the App, on to the App's install page without + `state`. + headers: + Location: + description: Redirect target + schema: + type: string + '400': + description: | + Invalid callback request or state, including a request without + `state` whose `setup_action` is missing or not `install`, `update`, + or `request` content: application/json: schema: - $ref: '#/components/schemas/ProjectHealthResponse' - '401': - description: Unauthorized - invalid or missing token + $ref: '#/components/schemas/Error' + '429': + description: Too many callback attempts from this client content: application/json: schema: $ref: '#/components/schemas/Error' - '403': - description: Access denied + '500': + description: Failed to complete the connection content: application/json: schema: $ref: '#/components/schemas/Error' - '404': - description: Project not found + '503': + description: Git provider integration is not configured content: application/json: schema: $ref: '#/components/schemas/Error' - '500': - description: Internal server error + /connectors: + get: + tags: + - Connectors + summary: List connectors + description: | + Lists the connectors the caller can use. A connector links Volcano to + an outside service. A `slack` connector is a Slack workspace the + Volcano app is installed in: it is listed to the person who installed + it there, and to anyone with a Slack identity in that workspace + connected to their Volcano account. Add one with + `POST /user/slack/installations`. An `aikido` connector is an Aikido + workspace the caller connected with `POST /connectors`; it holds their + Aikido credentials, so it is listed to them alone. The list answers + whether or not reporting problems from either service is available in + this environment, so turning it off strands no connector. + operationId: listConnectors + security: + - UserToken: [] + - AuthUserAccessToken: [] + responses: + '200': + description: The caller's connectors + content: + application/json: + schema: + $ref: '#/components/schemas/ConnectorsResponse' + '401': + description: Not authenticated content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/metrics/query: post: tags: - - Projects - summary: Query project runtime metrics + - Connectors + summary: Connect a service description: | - Evaluates a batch of named, curated runtime metric queries over one - trailing time range. Query IDs correlate each request with its result; - raw backend query languages are intentionally not exposed. - operationId: queryProjectMetrics + Connects an outside service with credentials the caller created there, + and answers `201` with the connector. Today that is an `aikido` + workspace, so LavaFlow can fix the security issues Aikido finds on the + caller's projects. Install the Volcano Slack app with + `POST /user/slack/installations` instead: it needs the browser. + + For Aikido, create a REST API client in Aikido's settings with read + access to issues, repositories and the workspace, and a webhook + signing secret on its webhooks page. Volcano checks the client with + Aikido, reads which workspace it belongs to, and stores all three + values encrypted; it never returns them. Then point an Aikido webhook + for new issues at `https:///webhooks/aikido`, and bind + projects with `POST /lavaflow/connector-bindings`. Volcano writes + nothing back to Aikido. A workspace connects to one Volcano account at + a time. + + Connecting Aikido needs LavaFlow and Aikido reports to be available in + this environment, as the `lavaflow.aikido` capability reports; + otherwise this answers `404` with code `feature_unavailable`. + operationId: createConnector security: - UserToken: [] - - ProjectAccessToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' + - AuthUserAccessToken: [] requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/ProjectMetricsQueryRequest' + $ref: '#/components/schemas/ConnectorCreate' responses: - '200': - description: Project runtime metric queries evaluated + '201': + description: The service is connected content: application/json: schema: - $ref: '#/components/schemas/ProjectMetricsQueryResponse' + $ref: '#/components/schemas/Connector' '400': - description: Invalid metric query + description: The body is invalid content: application/json: schema: $ref: '#/components/schemas/Error' '401': - description: Unauthorized - invalid or missing token + description: Not authenticated content: application/json: schema: $ref: '#/components/schemas/Error' - '403': - description: Access denied + '404': + description: Code `feature_unavailable` means Aikido reports are not available in this environment. content: application/json: schema: $ref: '#/components/schemas/Error' - '404': - description: Project not found + '409': + description: The Aikido workspace is already connected, by the caller or another Volcano account. content: application/json: schema: $ref: '#/components/schemas/Error' - '500': - description: Internal server error + '422': + description: Aikido refused the client ID and secret, or the client cannot read the workspace. Check the region, the credentials and the client's read access. content: application/json: schema: $ref: '#/components/schemas/Error' - '503': - description: Runtime metrics backend unavailable + '502': + description: Aikido did not answer; nothing was saved, so try again content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/logo: + /connectors/{connector_id}: get: tags: - - Projects - summary: Get the project logo image + - Connectors + summary: Get a connector description: | - Returns the raw logo image stored in the project's storage folder. This - endpoint is unauthenticated so the asset can be rendered directly in an - `` tag; project IDs are unguessable UUIDs and logos are - non-sensitive branding. The `Project.logo_url` field exposes a versioned - path to this endpoint. - operationId: getProjectLogo - security: [] + Returns one connector the caller can use, as listing connectors shows + it. A connector the caller cannot see answers like one that doesn't + exist. + operationId: getConnector + security: + - UserToken: [] + - AuthUserAccessToken: [] parameters: - - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/ConnectorId' responses: '200': - description: Logo image + description: The connector content: - image/png: - schema: - type: string - format: binary - image/jpeg: + application/json: schema: - type: string - format: binary - image/gif: - schema: - type: string - format: binary - image/webp: + $ref: '#/components/schemas/Connector' + '400': + description: Malformed connector ID + content: + application/json: schema: - type: string - format: binary - image/svg+xml: + $ref: '#/components/schemas/Error' + '401': + description: Not authenticated + content: + application/json: schema: - type: string - format: binary + $ref: '#/components/schemas/Error' '404': - description: Project or logo not found + description: No such connector. One the caller cannot see answers the same way. content: application/json: schema: $ref: '#/components/schemas/Error' - post: + delete: tags: - - Projects - summary: Upload or replace the project logo + - Connectors + summary: Remove a connector description: | - Uploads an image as the project's logo, storing it in the project's - storage folder. Accepts PNG, JPEG, GIF, WebP, or SVG up to 2 MB. Replaces any - existing logo. Returns the updated project, whose `logo_url` reflects - the new logo. - operationId: uploadProjectLogo + Removes a connector. Removing a `slack` connector uninstalls the + Volcano app from the Slack workspace, for every Volcano account that + uses it. Only the person who installed the app there can remove it + (`removable` is `true` for them); anyone else can uninstall the app in + Slack. The workspace's channels stop reporting problems at their next + check, which also cancels reports still queued. The channel bindings + stay, and report again if the app is installed in the workspace again. + + Removing an `aikido` connector deletes its credentials and its project + bindings, and cancels its queued reports at their next check. Remove + the webhook in Aikido too: Volcano refuses its deliveries from then on. + + Removing works whether or not reporting problems from either service + is available in this environment. + operationId: deleteConnector security: - UserToken: [] - - ProjectAccessToken: [] + - AuthUserAccessToken: [] parameters: - - $ref: '#/components/parameters/ProjectId' - requestBody: - required: true - content: - multipart/form-data: - schema: - type: object - required: - - logo - properties: - logo: - type: string - format: binary - description: Logo image (PNG, JPEG, GIF, WebP, or SVG; max 2 MB) + - $ref: '#/components/parameters/ConnectorId' responses: - '200': - description: Logo uploaded - content: - application/json: - schema: - $ref: '#/components/schemas/Project' + '204': + description: Removed '400': - description: Bad request (missing file, unsupported type, or too large) + description: Malformed connector ID content: application/json: schema: $ref: '#/components/schemas/Error' - '403': - description: Access denied + '401': + description: Not authenticated content: application/json: schema: $ref: '#/components/schemas/Error' - '404': - description: Project not found + '403': + description: Someone else installed the Volcano app in this Slack workspace; only they can remove it. content: application/json: schema: $ref: '#/components/schemas/Error' - '409': - description: Project is being deleted + '404': + description: No such connector. One the caller cannot see answers the same way. content: application/json: schema: $ref: '#/components/schemas/Error' - '503': - description: Logo storage is not configured + '502': + description: Slack did not answer the uninstall; the connector is unchanged, so try again content: application/json: schema: $ref: '#/components/schemas/Error' - delete: + /user/slack/installations: + post: tags: - - Projects - summary: Remove the project logo + - Slack Connections + summary: Start installing the Volcano Slack app description: | - Deletes the project logo from the project's storage folder and clears its - record. Returns the updated project with no `logo_url`. - operationId: deleteProjectLogo + Starts an installation of the Volcano app in a Slack workspace, so + LavaFlow can take problems reported there, and returns its Add to Slack + URL. Send the browser to it; Slack returns it to `GET /slack/callback`, + which saves the installation as a `slack` connector (`GET /connectors`). + Installing again replaces the workspace's installation. Enterprise Grid org-wide installs are refused. The + callback finishes only in the browser that started the installation. + + The response also sets a short-lived HttpOnly cookie that binds the + callback to this browser. Installing and connecting each set their + own, so starting one leaves the other's callback working. + operationId: startSlackInstall security: - UserToken: [] - - ProjectAccessToken: [] + - AuthUserAccessToken: [] parameters: - - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/SlackRedirect' responses: '200': - description: Logo removed - content: - application/json: - schema: - $ref: '#/components/schemas/Project' - '403': - description: Access denied + description: Slack authorization URL content: application/json: schema: - $ref: '#/components/schemas/Error' - '404': - description: Project not found + $ref: '#/components/schemas/SlackAuthorizationResponse' + '400': + description: '`redirect` is not on the Volcano dashboard''s origin' content: application/json: schema: $ref: '#/components/schemas/Error' - '409': - description: Project is being deleted + '401': + description: Not authenticated content: application/json: schema: $ref: '#/components/schemas/Error' - '503': - description: Logo storage is not configured + '404': + description: Code `feature_unavailable`; reporting problems from Slack is not available in this environment content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/usage: + /user/slack/connections: get: tags: - - Projects - summary: Get usage metrics for a project + - Slack Connections + summary: List connected Slack identities description: | - Returns project usage totals for the current usage month plus - recent hourly and daily time series for each tracked metric. - operationId: getProjectUsage + Lists the caller's connected Slack identities. It answers whether or + not reporting problems from Slack is available in this environment, so + turning it off strands no connection. + operationId: listSlackConnections security: - UserToken: [] - - ProjectAccessToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' + - AuthUserAccessToken: [] responses: '200': - description: Usage metrics retrieved - content: - application/json: - schema: - $ref: '#/components/schemas/ProjectUsageResponse' - '403': - description: Access denied + description: The caller's connected Slack identities content: application/json: schema: - $ref: '#/components/schemas/Error' - '404': - description: Project not found + $ref: '#/components/schemas/SlackConnectionsResponse' + '401': + description: Not authenticated content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/shared-variables: - put: + post: tags: - - Projects - summary: Replace shared variable names - description: | - 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. - operationId: replaceSharedVariables + - Slack Connections + summary: Start connecting a Slack identity + description: | + Starts connecting the caller's Slack identity to their Volcano account + and returns its Sign in with Slack URL. LavaFlow acts on a person's + Slack mention only for projects owned by an account their identity is + connected to. The callback finishes only in the browser that started + the connection, so a link forwarded to anyone else connects no one. + One Slack identity may connect to several accounts, and one account may + have several identities connected. The identity is also tied to the + caller's sign-in session: the channel picker and binding act only as + the identities this session signed in as, so on an account several + people share, nobody picks or binds as another person's identity. An + API token has no session, so it can connect an identity that reports, + but not pick or bind channels with it. Volcano stores the workspace and + user IDs, and no Slack token. + + The response also sets a short-lived HttpOnly cookie that binds the + callback to this browser. Installing and connecting each set their + own, so starting one leaves the other's callback working. + operationId: startSlackConnect security: - UserToken: [] - - ProjectAccessToken: [] + - AuthUserAccessToken: [] parameters: - - $ref: '#/components/parameters/ProjectId' - requestBody: - required: true - content: - application/json: - schema: - type: object - additionalProperties: false - required: - - shared_variables - not: - required: - - expected_shared_variables - - expected_shared_variables_digest - properties: - shared_variables: - type: array - uniqueItems: true - items: - type: string - maxLength: 256 - pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$ - expected_shared_variables: - type: array - uniqueItems: true - description: When present, replace only if the current complete shared list matches this list. - items: - type: string - maxLength: 256 - pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$ - expected_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_shared_variables for a compact conditional replacement. + - $ref: '#/components/parameters/SlackRedirect' responses: - '204': - description: Shared list replaced and affected function synchronization started. - '400': - description: Invalid names or final function environment. + '200': + description: Slack authorization URL content: application/json: schema: - $ref: '#/components/schemas/Error' - '401': - description: Unauthorized - '404': - description: Project not found - '409': - description: Shared list changed since it was read. + $ref: '#/components/schemas/SlackAuthorizationResponse' + '400': + description: '`redirect` is not on the Volcano dashboard''s origin' content: application/json: schema: $ref: '#/components/schemas/Error' - '413': - description: Request body exceeds 4,194,304 bytes + '401': + description: Not authenticated content: application/json: schema: $ref: '#/components/schemas/Error' - '500': - description: Persistence or synchronization failed - '503': - description: Shared variable membership writes are disabled during rollout + '404': + description: Code `feature_unavailable`; reporting problems from Slack is not available in this environment content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/frontend-shared-variables: - put: + /user/slack/connections/{connectionId}: + delete: tags: - - Projects - summary: Replace frontend shared variable names + - Slack Connections + summary: Disconnect a Slack identity 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 + Disconnects one Slack identity from the caller's account. LavaFlow + stops acting on its mentions for the account's projects at its next + check, which also cancels reports still queued. It works whether or not + reporting problems from Slack is available in this environment. + operationId: deleteSlackConnection security: - UserToken: [] + - AuthUserAccessToken: [] 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. + - name: connectionId + in: path + required: true + description: The connection to remove + schema: + type: string + format: uuid responses: '204': - description: Frontend shared list replaced and affected frontend synchronization started. + description: Disconnected '400': - description: Invalid names or final frontend environment. + description: Malformed connection ID 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. + description: Not authenticated content: application/json: schema: $ref: '#/components/schemas/Error' - '413': - description: Request body exceeds 4,194,304 bytes + '404': + description: The caller has no such connection. content: application/json: schema: $ref: '#/components/schemas/Error' - '500': - description: Persistence or synchronization failed - /projects/{id}/config: + /user/slack/channels: get: tags: - - Projects - summary: Export project configuration + - Slack Connections + summary: List a workspace's channels for binding description: | - 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. - operationId: getProjectConfig + Lists the channels in a workspace that one of the Slack identities the + caller's sign-in session signed in as is in, to choose which ones + report problems to LavaFlow: their public channels, and the private + channels the Volcano app is in too. Binding a public channel the app is + not in makes it join. Invite the app to a private channel in Slack to + list it. Slack Connect, shared and archived channels are left out. + operationId: listSlackChannels security: - UserToken: [] - - ProjectAccessToken: [] + - AuthUserAccessToken: [] parameters: - - $ref: '#/components/parameters/ProjectId' - - name: format + - name: team_id in: query - required: false - description: Response format override. Takes precedence over the Accept header. + required: true + description: The Slack workspace. The app must be installed in it, and one of the caller's connected Slack identities must belong to it. schema: - type: string - enum: - - json - - yaml + $ref: '#/components/schemas/SlackTeamId' responses: '200': - description: | - Current project configuration. JSON by default; when YAML is - requested the body is the canonical volcano-config.yaml document - served verbatim with `Content-Type: application/yaml`. + description: Public channels one of the caller's connected Slack identities is in, and private channels it and the app are both in content: application/json: schema: - $ref: '#/components/schemas/ProjectConfig' - application/yaml: + $ref: '#/components/schemas/SlackChannelsResponse' + '400': + description: '`team_id` is missing or malformed' + content: + application/json: schema: - type: string - format: binary - description: | - Canonical volcano-config.yaml document returned verbatim, - ready to be saved as-is. The response body is limited to - 4,194,304 bytes, matching the configuration apply limit. + $ref: '#/components/schemas/Error' '401': - description: Unauthorized - invalid or missing token + description: Not authenticated content: application/json: schema: $ref: '#/components/schemas/Error' '404': - description: Project not found + description: The app is not installed in the workspace, or the caller's sign-in session signed in as no Slack identity there. Code `feature_unavailable` means reporting problems from Slack is not available in this environment. content: application/json: schema: $ref: '#/components/schemas/Error' - '413': - description: Canonical YAML export exceeds 4,194,304 bytes + '502': + description: 'Slack did not answer, or refused the call; try again. Code `slack_reinstall_required` means Slack refused the app''s token, or a permission its installation lacks, which no retry ends: add the app to the workspace again, after a workspace admin approves it if the workspace requires approval.' content: application/json: schema: $ref: '#/components/schemas/Error' - put: + /slack/callback: + get: tags: - - Projects - summary: Apply project configuration + - Slack Connections + summary: Complete a Slack install or connection description: | - Validates and applies a declarative configuration manifest to the - project, reconciling each declared section and returning a per-resource - report. Omitted sections are untouched. Declared collection keys - (`variables`, `buckets[].policies`, `auth.providers.oauth`, - `auth.email.templates`, `functions[].schedulers`) are fully synced: - resources absent from the manifest are deleted. Functions, frontends, - databases, and buckets are never created or deleted; manifest entries - for resources that do not exist are skipped and reported in `skipped`, - and existing resources missing from a declared section are reported in - `missing`. Validation failures (including plan-gate violations) return - 422 and nothing is applied. Set `dry_run=true` to get the projected - report without applying changes. Applies are serialized per project; - a concurrent apply returns 409. - operationId: applyProjectConfig - security: - - UserToken: [] - - ProjectAccessToken: [] + Public callback Slack sends the browser to after Add to Slack or Sign + in with Slack. The signed `state` names the flow and the Volcano user + who started it, and the callback cookie binds it to the browser that + started it. Redirects to the flow's `redirect`, or to the dashboard, + adding `slack_connect_error=1` when the flow failed. + operationId: slackCallback + security: [] parameters: - - $ref: '#/components/parameters/ProjectId' - - name: dry_run + - name: code in: query required: false - description: Validate and report projected actions without applying changes. + description: Slack's authorization code schema: - type: boolean - default: false - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/ProjectConfig' + type: string + - name: state + in: query + required: true + description: The signed state the flow's start returned + schema: + type: string + - name: error + in: query + required: false + description: Slack's error, such as `access_denied` + schema: + type: string responses: - '200': - description: | - Apply report. Individual entries may still carry `action: error` - for apply-phase failures (summary.errors > 0); already-applied - changes are not rolled back. - content: - application/json: + '303': + description: Redirect back to the dashboard after a successful or failed attempt + headers: + Location: + description: Redirect target schema: - $ref: '#/components/schemas/ProjectConfigApplyResult' + type: string '400': - description: Malformed request body - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '401': - description: Unauthorized - invalid or missing token + description: Invalid or expired state, or a browser that did not start the flow content: application/json: schema: $ref: '#/components/schemas/Error' '404': - description: Project not found - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '409': - description: Another apply is in progress for this project + description: Code `feature_unavailable`; reporting problems from Slack is not available in this environment content: application/json: schema: $ref: '#/components/schemas/Error' - '422': - description: Manifest validation failed; nothing was applied - content: - application/json: - schema: - $ref: '#/components/schemas/ProjectConfigValidationErrorResponse' - '503': - description: Shared variable membership writes are disabled during rollout + '429': + description: Too many callback attempts from this client content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/source-export: + /projects: get: tags: - Projects - - Git Connections - summary: Report the project's source-of-truth state - operationId: getProjectSourceExport + summary: List all projects for authenticated user description: | - Volcano stores the source of the functions and frontend it runs for a - project. This reports whether that source has been written to the - connected repository, and whether the repository has taken over as the - project's source of truth. - - `mode` is `platform`, `git_exporting`, `git_pending`, or `git`. Export - enters `git_exporting` before reading stored source. GitHub's signed - push event confirms that the initial commit reached the production - branch. That push or a newer production push changes the mode to - `git_pending` when it starts a deployment. `exported_at` records that - transition. - - A successful Git run completes the transition when it matches the - recorded repository, production branch, and root directory and actually - dispatches every recorded resource. Ordinary production-branch pushes - deploy without changing a platform-managed project's source ownership. + Returns projects that are not deleting or deleted, newest first. + Supports two mutually exclusive pagination modes. Offset mode uses + `page` and `limit`. Cursor mode uses `cursor` or `ending_before` with + `limit`, returns `next_cursor`/`prev_cursor`, and supports a bounded + `offset` past the cursor anchor. Supplying `limit` without `page` + selects cursor mode. `search` applies a case-insensitive project-name + filter in either mode. `include` optionally expands each returned + project with its Git connection and/or aggregate health summary using + `git_connection` and `health`. Sending `page` with `cursor` or `ending_before`, + or sending both cursor directions, returns 400. + operationId: listProjects 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' + - name: include + in: query + required: false + description: Optional comma-separated project metadata expansions. + style: form + explode: false + schema: + type: array + uniqueItems: true + items: + type: string + enum: + - git_connection + - health responses: '200': - description: The project's source-of-truth state - content: - application/json: - schema: - $ref: '#/components/schemas/ProjectSourceExportState' - '401': - description: Unauthorized - invalid or missing token - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '403': - description: Forbidden - project not owned by the caller - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '404': - description: Project not found - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '500': - description: Internal server error + description: Successful response content: application/json: schema: - $ref: '#/components/schemas/Error' - '501': - description: Source export is not available in this deployment mode + $ref: '#/components/schemas/PaginatedProjects' + '400': + description: Invalid or conflicting pagination parameters content: application/json: schema: @@ -2920,192 +3158,76 @@ paths: post: tags: - Projects - - Git Connections - summary: Initialize an empty repository with a project's stored source - operationId: exportProjectSource + summary: Create a new project description: | - Creates the first commit in the connected repository and pushes it - directly to the configured production branch. The push enters the - ordinary Git auto-deploy flow. Direct source writes remain frozen until - that deployment succeeds and the repository becomes the source of truth. - - The caller confirms the production branch shown before export. Starting - export pins that branch: later GitHub default-branch changes do not - repoint the project. If the configured branch changed after the caller - read it, the request fails without exporting so the caller can show and - confirm the new value. - - The response lists what the export could not carry: resources with no - successful deployment to take source from (`skipped`), and things no - export can hand back (`omitted`) — migrations, which Volcano stores no - copy of, and credential-shaped files, which are left for their owner to - add. - - Requires a connected repository with no commits or branches, and runs - once. Volcano never creates the repository. If GitHub did not confirm - the push, retrying creates the same commit and adopts it when it already - reached the repository. + Creates a project for the authenticated user. + Projects have no plan limit; usage allowances apply across all of a user's projects. + Accounts on an older paid pricing revision keep the project cap that revision set, and + requests over it return 403. + operationId: createProject security: - UserToken: [] - - ProjectAccessToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/ExportProjectSourceRequest' + $ref: '#/components/schemas/CreateProjectRequest' responses: '201': - description: The initial production-branch commit that was pushed + description: Project created content: application/json: schema: - $ref: '#/components/schemas/ProjectSourceExport' + $ref: '#/components/schemas/Project' '400': - description: Malformed request body + description: | + Bad request. A `template_source` other than `null` is refused: a project is created from a share with `POST /forks`. content: application/json: schema: $ref: '#/components/schemas/Error' - '401': - description: Unauthorized - invalid or missing token + '403': + description: Forbidden. The user reached a project cap (only on older paid pricing revisions that set one), the plan does not allow the requested region subset, or a template's frontend limit was reached content: application/json: schema: $ref: '#/components/schemas/Error' - '403': - description: Forbidden - project not owned by the caller + '503': + description: The selected project template is not configured in this environment content: application/json: schema: $ref: '#/components/schemas/Error' - '404': - description: Project not found, or it has no repository connected - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '409': - description: | - The source has already been exported, the repository has already - taken over as the source of truth, the confirmed production branch - is stale, a function or frontend deployment is still in progress, - or the project has no stored source to export - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '422': - description: | - The repository refused the branch, or its contents cannot be laid - out as a repository — a stored file that only ever carries - credentials, or a layout Git auto-deploy would not read back - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '429': - description: GitHub rate limited the request - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '500': - description: Internal server error - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '501': - description: Source export is not available in this deployment mode - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '503': - description: GitHub integration is not configured - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - delete: + /projects/{id}: + get: tags: - Projects - - Git Connections - summary: Cancel an incomplete source export - operationId: cancelProjectSourceExport - description: | - Restores platform source writes while the project is in - `git_exporting` or `git_pending`. If Volcano reserved or deployed the - root commit, export remains consumed and cannot be run again. The - connected repository and any commit already pushed to it are unchanged. + summary: Get project by ID + operationId: getProject security: - UserToken: [] - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' responses: - '204': - description: The incomplete source transition was canceled - '401': - description: Unauthorized - invalid or missing token - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '403': - description: Forbidden - project not owned by the caller + '200': + description: Successful response content: application/json: schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/schemas/Project' '404': description: Project not found content: application/json: schema: $ref: '#/components/schemas/Error' - '409': - description: No incomplete transition exists, or Git already took ownership - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '500': - description: Internal server error - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '501': - description: Source export is not available in this deployment mode - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /projects/{id}/git-connection/production-branch: - put: + patch: tags: - Projects - - Git Connections - summary: Set the branch a project deploys from - description: | - Changes only the production branch, leaving the repository binding - alone. PUT /projects/{id}/git-connection can also set it, but that is a - full rebind: it needs connection_id, installation_id and a repository - selector resent, and re-resolves the repository against GitHub for a - field that does not depend on it. - - The branch does not have to exist. It is validated as a Git branch name - and nothing more, so a project can be pointed at a branch that is about - to be pushed — the case a repository created empty depends on. - - Setting the branch here marks it as the project's own choice, so a later - default-branch rename on GitHub no longer moves it. Projects that never - set one keep following the repository's default branch. - operationId: setProjectGitProductionBranch + summary: Update project metadata and region policy + operationId: updateProject security: - UserToken: [] - ProjectAccessToken: [] @@ -3116,62 +3238,77 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/SetProjectGitProductionBranchRequest' + $ref: '#/components/schemas/UpdateProjectRequest' responses: '200': - description: The project's repo connection, with the new branch + description: Project updated content: application/json: schema: - $ref: '#/components/schemas/ProjectGitConnection' + $ref: '#/components/schemas/Project' '400': description: | - Malformed request body, or a production_branch that is not a valid - Git branch name - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '401': - description: Unauthorized - invalid or missing token + Bad request (no region selected, an unknown region, or — for a + project holding durable functions — a region that does not offer + durable execution) content: application/json: schema: $ref: '#/components/schemas/Error' '403': - description: Project not owned by the caller + description: Forbidden (for example, selecting subset regions on plan other than SUPERAGENT) content: application/json: schema: $ref: '#/components/schemas/Error' '404': - description: | - Project not found, or it has no repository connected. The branch is - part of the connection, so there is nothing to set it on until one - exists. + description: Project not found content: application/json: schema: $ref: '#/components/schemas/Error' '409': - description: A Git source transition is pending + description: Conflict (project name already exists or a resource deployment blocks a region change) content: application/json: schema: $ref: '#/components/schemas/Error' - '500': - description: Failed to set the production branch + delete: + tags: + - Projects + summary: Delete a project + description: | + Starts asynchronous project deletion. The project remains available from + `GET /projects/{id}` with `status: deleting` until cleanup finishes, but is + removed from project lists as soon as deletion starts. After cleanup it + returns 404. + operationId: deleteProject + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + responses: + '202': + description: Project deletion started + '404': + description: Project not found content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/git-connection: + /projects/{id}/health: get: tags: - Projects - - Git Connections - summary: Get a project's repo connection - operationId: getProjectGitConnection + summary: Get project health + description: | + Returns a fast control-plane health snapshot for the project and its + deployed resources. The endpoint does not run live provider probes. + A successful request returns 200 even when the project status is + `degraded` or `critical`; transport and authorization failures use HTTP + errors. + operationId: getProjectHealth security: - UserToken: [] - ProjectAccessToken: [] @@ -3179,11 +3316,11 @@ paths: - $ref: '#/components/parameters/ProjectId' responses: '200': - description: The project's current repo connection + description: Project health snapshot retrieved content: application/json: schema: - $ref: '#/components/schemas/ProjectGitConnection' + $ref: '#/components/schemas/ProjectHealthResponse' '401': description: Unauthorized - invalid or missing token content: @@ -3191,38 +3328,33 @@ paths: schema: $ref: '#/components/schemas/Error' '403': - description: Project not owned by the caller + description: Access denied content: application/json: schema: $ref: '#/components/schemas/Error' '404': - description: Project not found, or has no repo connection + description: Project not found content: application/json: schema: $ref: '#/components/schemas/Error' '500': - description: Failed to get project git connection + description: Internal server error content: application/json: schema: $ref: '#/components/schemas/Error' - put: + /projects/{id}/metrics/query: + post: tags: - Projects - - Git Connections - summary: Connect or update a project's repo connection + summary: Query project runtime metrics description: | - Full replace, following Vercel's model: many projects may point at the - same repo, so this only binds the project — it never creates or - deletes git-provider state. Used for both the initial connect and - later edits (repo change, root directory, production branch). - Resolves the repository_id or repo_full_name selector against the repos - accessible through installation_id via connection_id's stored GitHub - user token, then persists repository metadata only from that validated - GitHub response. - operationId: connectProjectGit + Evaluates a batch of named, curated runtime metric queries over one + trailing time range. Query IDs correlate each request with its result; + raw backend query languages are intentionally not exposed. + operationId: queryProjectMetrics security: - UserToken: [] - ProjectAccessToken: [] @@ -3233,22 +3365,16 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ConnectProjectGitRequest' + $ref: '#/components/schemas/ProjectMetricsQueryRequest' responses: '200': - description: The project's repo connection + description: Project runtime metric queries evaluated content: application/json: schema: - $ref: '#/components/schemas/ProjectGitConnection' + $ref: '#/components/schemas/ProjectMetricsQueryResponse' '400': - description: | - Malformed request body, no repository selector, selectors that - identify different repositories, a production_branch that is not a - valid Git branch name, no production_branch on a repository with no - default branch to follow (name one to connect a repository that has - no commits yet), or a production_branch other than the new - repository's default in a request that also changes repository. + description: Invalid metric query content: application/json: schema: @@ -3260,112 +3386,117 @@ paths: schema: $ref: '#/components/schemas/Error' '403': - description: | - Project not owned by the caller, or the selected repository is not - accessible through installation_id + description: Access denied content: application/json: schema: $ref: '#/components/schemas/Error' '404': - description: Project or connection not found - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '409': - description: | - A Git source transition is pending or complete, so the recorded - repository and root cannot be changed + description: Project not found content: application/json: schema: $ref: '#/components/schemas/Error' '500': - description: Failed to connect project git + description: Internal server error content: application/json: schema: $ref: '#/components/schemas/Error' '503': - description: Git provider integration is not configured + description: Runtime metrics backend unavailable content: application/json: schema: $ref: '#/components/schemas/Error' - delete: + /projects/{id}/logo: + get: tags: - Projects - - Git Connections - summary: Disconnect a project's repo connection - operationId: disconnectProjectGit - security: - - UserToken: [] - - ProjectAccessToken: [] + summary: Get the project logo image + description: | + Returns the raw logo image stored in the project's storage folder. This + endpoint is unauthenticated so the asset can be rendered directly in an + `` tag; project IDs are unguessable UUIDs and logos are + non-sensitive branding. The `Project.logo_url` field exposes a versioned + path to this endpoint. + operationId: getProjectLogo + security: [] parameters: - $ref: '#/components/parameters/ProjectId' responses: - '204': - description: Connection removed - '401': - description: Unauthorized - invalid or missing token + '200': + description: Logo image content: - application/json: + image/png: schema: - $ref: '#/components/schemas/Error' - '403': - description: Project not owned by the caller - content: - application/json: + type: string + format: binary + image/jpeg: schema: - $ref: '#/components/schemas/Error' - '404': - description: Project not found, or has no repo connection - content: - application/json: + type: string + format: binary + image/gif: schema: - $ref: '#/components/schemas/Error' - '409': - description: | - A Git source transition is pending or complete, so the recorded - repository cannot be disconnected - content: - application/json: + type: string + format: binary + image/webp: schema: - $ref: '#/components/schemas/Error' - '500': - description: Failed to disconnect project git + type: string + format: binary + image/svg+xml: + schema: + type: string + format: binary + '404': + description: Project or logo not found content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/git-deploy-settings: - get: + post: tags: - Projects - - Git Connections - summary: Get a project's Git auto-deploy settings - operationId: getProjectGitDeploySettings + summary: Upload or replace the project logo + description: | + Uploads an image as the project's logo, storing it in the project's + storage folder. Accepts PNG, JPEG, GIF, WebP, or SVG up to 2 MB. Replaces any + existing logo. Returns the updated project, whose `logo_url` reflects + the new logo. + operationId: uploadProjectLogo security: - UserToken: [] - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' + requestBody: + required: true + content: + multipart/form-data: + schema: + type: object + required: + - logo + properties: + logo: + type: string + format: binary + description: Logo image (PNG, JPEG, GIF, WebP, or SVG; max 2 MB) responses: '200': - description: The project's current Git auto-deploy settings + description: Logo uploaded content: application/json: schema: - $ref: '#/components/schemas/ProjectGitDeploySettings' - '401': - description: Unauthorized - invalid or missing token + $ref: '#/components/schemas/Project' + '400': + description: Bad request (missing file, unsupported type, or too large) content: application/json: schema: $ref: '#/components/schemas/Error' '403': - description: Project not owned by the caller + description: Access denied content: application/json: schema: @@ -3376,62 +3507,40 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - '500': - description: Failed to get project git deploy settings + '409': + description: Project is being deleted content: application/json: schema: $ref: '#/components/schemas/Error' - put: + '503': + description: Logo storage is not configured + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + delete: tags: - Projects - - Git Connections - summary: Update a project's Git auto-deploy settings + summary: Remove the project logo description: | - Full replace of the project's Git auto-deploy settings: what a push to - the connected repo's production branch deploys. - - Connecting a repository sets auto_deploy_enabled and deploy_functions - to true for a project that has never called this endpoint, so a push - deploys without any further setup. Once these settings have been saved - here they are the project's own: connecting, rebinding, disconnecting - and reconnecting all leave them untouched, including when they were - saved before any repository was connected. Frontend settings are off - until set here; the frontend need not exist when they are saved, since - frontend_name is resolved at deploy time. - operationId: updateProjectGitDeploySettings + Deletes the project logo from the project's storage folder and clears its + record. Returns the updated project with no `logo_url`. + operationId: deleteProjectLogo security: - UserToken: [] - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateProjectGitDeploySettingsRequest' responses: '200': - description: The project's updated Git auto-deploy settings - content: - application/json: - schema: - $ref: '#/components/schemas/ProjectGitDeploySettings' - '400': - description: Malformed request body, or frontend_app_root without frontend_name - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '401': - description: Unauthorized - invalid or missing token + description: Logo removed content: application/json: schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/schemas/Project' '403': - description: Project not owned by the caller + description: Access denied content: application/json: schema: @@ -3443,316 +3552,338 @@ paths: schema: $ref: '#/components/schemas/Error' '409': - description: | - A Git source transition is pending, or this change would remove - deploy coverage after Git has taken over + description: Project is being deleted content: application/json: schema: $ref: '#/components/schemas/Error' - '500': - description: Failed to update project git deploy settings + '503': + description: Logo storage is not configured content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/databases/{databaseName}/queries: + /projects/{id}/usage: get: tags: - - Databases - summary: Get database queries + - Projects + summary: Get usage metrics for a project description: | - Returns the database's current top queries from pg_stat_statements - ranked by total execution time. Only data statements (SELECT, INSERT, - UPDATE, DELETE, MERGE) are listed; statements Volcano runs to operate - the database are left out. - - **SUPERAGENT plan required.** This endpoint is only available to projects owned - by users on the SUPERAGENT billing plan. - operationId: getProjectDatabaseQueries + Returns project usage totals for the current usage month plus + recent hourly and daily time series for each tracked metric. + operationId: getProjectUsage security: - UserToken: [] - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/DatabaseName' - - name: limit - in: query - description: Maximum number of queries to return. - schema: - type: integer - minimum: 1 - maximum: 100 - default: 10 responses: '200': - description: Database query performance retrieved + description: Usage metrics retrieved content: application/json: schema: - $ref: '#/components/schemas/DatabaseQueryPerformanceResponse' - '400': - description: Bad request - invalid query parameters + $ref: '#/components/schemas/ProjectUsageResponse' + '403': + description: Access denied content: application/json: schema: $ref: '#/components/schemas/Error' - '401': - description: Unauthorized - invalid or missing token + '404': + description: Project not found content: application/json: schema: $ref: '#/components/schemas/Error' - '403': - description: Access denied + /projects/{id}/shared-variables: + put: + tags: + - Projects + summary: Replace shared variable names + description: | + 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. + operationId: replaceSharedVariables + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - shared_variables + not: + required: + - expected_shared_variables + - expected_shared_variables_digest + properties: + shared_variables: + type: array + uniqueItems: true + items: + type: string + maxLength: 256 + pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$ + expected_shared_variables: + type: array + uniqueItems: true + description: When present, replace only if the current complete shared list matches this list. + items: + type: string + maxLength: 256 + pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$ + expected_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_shared_variables for a compact conditional replacement. + responses: + '200': + description: 'Shared list replaced and synchronization started for every affected function except the ones listed, which a promoted preview serves (`code: function_served_by_candidate`). The preview keeps the variables it was built with, so their variables were not synchronized; a rollback of a listed function to production synchronizes its own build, and so does deploying it.' + content: + application/json: + schema: + $ref: '#/components/schemas/SharedVariablesReplaceResult' + '204': + description: Shared list replaced and affected function synchronization started. + '400': + description: Invalid names or final function environment. content: application/json: schema: $ref: '#/components/schemas/Error' + '401': + description: Unauthorized '404': - description: Project or database not found + description: Project not found + '409': + description: Shared list changed since it was read. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '413': + description: Request body exceeds 4,194,304 bytes, or its JSON has too many objects, arrays or values content: application/json: schema: $ref: '#/components/schemas/Error' '500': - description: Internal server error + description: Persistence or synchronization failed + '503': + description: Shared variable membership writes are disabled during rollout content: application/json: schema: $ref: '#/components/schemas/Error' - /deployments: - get: + /projects/{id}/frontend-shared-variables: + put: tags: - Projects - summary: List deployments across a user's projects + summary: Replace frontend shared variable names description: | - Lists Function and Frontend deployment attempts across every project the - user owns, newest first. Pass `project_id` to narrow the feed to a single - project. - - Scope is project **ownership** (`projects.user_id`). `owner_id` names - whose deployments to return, not who started them — the actor is - `initiated_by_user_id`, which this endpoint does not filter on. - - With a user token the scope is always the authenticated user: `owner_id` - may be omitted, or set to that same user, but naming anyone else is - refused with 403. Service callers on the management API must pass it, - since they have no authenticated user. - - The owner is not checked for existence: an id with no projects returns an - empty page rather than `404`. Unlike `/users/{id}/usage`, this endpoint is - polled to detect an event, so a caller needs `404` to keep meaning "this - route is not served here" — which is how a consumer notices it is running - against an older release. A mistyped owner therefore reads as "nothing - deployed"; callers that need to tell those apart should verify the user - through `GET /users/{id}` first. - - Ordering is selectable. The default is the feed order — most recent - attempt first. `completed_at.asc` orders by completion, oldest first, and - considers only attempts that finished; combined with `limit=1` and a - `status` filter it answers "when did this user first succeed" in one - bounded query. - - Both pagination modes are supported, selected exactly as - `/projects/{id}/deployments` selects them: `cursor`/`ending_before` (or a - `limit` with no `page`) uses keyset pagination; otherwise `page`/`limit` - offset pagination. `page` with a cursor, and `cursor` with - `ending_before`, are rejected. - - A cursor is bound to every filter *and* to `order`, so changing any of - them mid-pagination rejects the cursor rather than silently skipping or - repeating rows. The keyset position is `(created_at, id)` for - `created_at.desc` and `(completed_at, id)` for `completed_at.asc`. - operationId: listDeployments + 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/Page' - - $ref: '#/components/parameters/Limit' - - $ref: '#/components/parameters/Cursor' - - $ref: '#/components/parameters/EndingBefore' - - $ref: '#/components/parameters/Offset' - - $ref: '#/components/parameters/DeploymentOwnerId' - - name: project_id - in: query - required: false - description: Restrict the feed to a single project owned by the user. - schema: - type: string - format: uuid - - name: created_after - in: query - required: false - description: Restrict results to attempts created at or after this timestamp. - schema: - type: string - format: date-time - - $ref: '#/components/parameters/DeploymentResourceType' - - $ref: '#/components/parameters/DeploymentStatus' - - $ref: '#/components/parameters/DeploymentOperation' - - $ref: '#/components/parameters/DeploymentOrder' + - $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: - '200': - description: Successful response - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedProjectDeployments' + '204': + description: Frontend shared list replaced and affected frontend synchronization started. '400': - description: Bad request - invalid filter or pagination + description: Invalid names or final frontend environment. content: application/json: schema: $ref: '#/components/schemas/Error' '401': - description: Unauthorized - invalid or missing token + 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' - '403': - description: Forbidden - owner_id names a different user + '413': + description: Request body exceeds 4,194,304 bytes, or its JSON has too many objects, arrays or values content: application/json: schema: $ref: '#/components/schemas/Error' '500': - description: Internal server error - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /projects/{id}/deployments: + description: Persistence or synchronization failed + /projects/{id}/config: get: tags: - Projects - summary: List deployments in a project + summary: Export project configuration description: | - Lists Function and Frontend deployment attempts across the project, - ordered most-recent first. Each item includes a normalized resource - reference so clients can render both resource types without extra - fetches. - - Standard and durable function deployments both appear under - `resource.type: function`, and `resource.kind` tells them apart. Pass - `function_kind` to list one kind only; frontends are then excluded. - Combining `function_kind` with `resource_type=frontend` is rejected. - operationId: listProjectDeployments + 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. + operationId: getProjectConfig 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' - - name: created_after - in: query - required: false - description: Restrict results to attempts created at or after this timestamp. - schema: - type: string - format: date-time - - name: resource_type + - name: format in: query required: false - description: | - Restrict the feed to a single resource type. Omit to return both - Function and Frontend deployments. + description: Response format override. Takes precedence over the Accept header. schema: type: string enum: - - function - - frontend - - $ref: '#/components/parameters/FunctionKindFilter' + - json + - yaml responses: '200': - description: Successful response + description: | + Current project configuration. JSON by default; when YAML is + requested the body is the canonical volcano-config.yaml document + served verbatim with `Content-Type: application/yaml`. content: application/json: schema: - $ref: '#/components/schemas/PaginatedProjectDeployments' - '400': - description: Bad request - invalid identifier or filter, or `function_kind` combined with `resource_type=frontend` - content: - application/json: + $ref: '#/components/schemas/ProjectConfig' + application/yaml: schema: - $ref: '#/components/schemas/Error' + type: string + format: binary + description: | + Canonical volcano-config.yaml document returned verbatim, + ready to be saved as-is. The response body is limited to + 4,194,304 bytes, matching the configuration apply limit. '401': description: Unauthorized - invalid or missing token content: application/json: schema: $ref: '#/components/schemas/Error' - '403': - description: Forbidden - project ownership required + '404': + description: Project not found content: application/json: schema: $ref: '#/components/schemas/Error' - '500': - description: Internal server error + '413': + description: Canonical YAML export exceeds 4,194,304 bytes content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/deployments/summary: - get: + put: tags: - Projects - summary: Summarize deployments in a project + summary: Apply project configuration description: | - Summarizes deployment attempts for one comparable resource pipeline. - Success rate uses conclusive outcomes only: active and deleted attempts - are successful; failed and degraded attempts are failures; in-progress - and superseded attempts are excluded. Median build duration includes - completed, non-superseded attempts with recorded build work, - including failed builds. - - With `resource_type=function`, pass `function_kind` to summarize one - kind of function only. It is rejected with `resource_type=frontend`. - operationId: summarizeProjectDeployments + Validates and applies a declarative configuration manifest to the + project, reconciling each declared section and returning a per-resource + report. Omitted sections are untouched. Declared collection keys + (`variables`, `buckets[].policies`, `auth.providers.oauth`, + `auth.email.templates`, `functions[].schedulers`) are fully synced: + resources absent from the manifest are deleted. Functions, frontends, + databases, and buckets are never created or deleted; manifest entries + for resources that do not exist are skipped and reported in `skipped`, + and existing resources missing from a declared section are reported in + `missing`. Validation failures (including plan-gate violations) return + 422 and nothing is applied. Set `dry_run=true` to get the projected + report without applying changes. Applies are serialized per project: + an apply that overlaps another apply, a variable write or a deploy + waits up to about 20 seconds for it to finish and then runs against the + project as it stands, and returns 409 only if the project is still busy + after that wait. A function a promoted preview serves + keeps the variables the preview was built with: when the apply's + variable changes would reach it, it is reported as `unchanged` with + `code: function_served_by_candidate` and a `notice`, while every other + resource is applied and synchronized. That entry is not an error. + operationId: applyProjectConfig security: - UserToken: [] - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - - name: search - in: query - required: false - description: Restrict the summary to resource names containing this value. - schema: - type: string - - name: resource_type - in: query - required: true - description: Restrict the summary to one comparable deployment pipeline. - schema: - type: string - enum: - - function - - frontend - - $ref: '#/components/parameters/FunctionKindFilter' - - name: created_after + - name: dry_run in: query required: false - description: Restrict results to attempts created at or after this timestamp. + description: Validate and report projected actions without applying changes. schema: - type: string - format: date-time + type: boolean + default: false + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ProjectConfig' responses: '200': - description: Successful response - content: + description: | + Apply report. Individual entries may still carry `action: error` + for apply-phase failures (summary.errors > 0); already-applied + changes are not rolled back. + content: application/json: schema: - $ref: '#/components/schemas/ProjectDeploymentSummary' + $ref: '#/components/schemas/ProjectConfigApplyResult' '400': - description: Bad request - invalid identifier or filter, or `function_kind` combined with `resource_type=frontend` + description: Malformed request body, or, with code `feature_unavailable`, the manifest creates or changes something whose capability is unavailable in this environment, such as `frontends[].frontend_routes` while `frontend_routes` is unavailable in `GET /capabilities`. Nothing was applied. content: application/json: schema: @@ -3763,53 +3894,72 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - '403': - description: Forbidden - project ownership required + '404': + description: Project not found content: application/json: schema: $ref: '#/components/schemas/Error' - '500': - description: Internal server error + '409': + description: The project was still busy with another apply, variable write or deploy after a bounded wait of about 20 seconds content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/domains: + '413': + description: Request body exceeds 4,194,304 bytes, or its JSON has too many objects, arrays or values + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '422': + description: Manifest validation failed; nothing was applied + content: + application/json: + schema: + $ref: '#/components/schemas/ProjectConfigValidationErrorResponse' + '503': + description: Shared variable membership writes are disabled during rollout + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /projects/{id}/source-export: get: tags: - - Frontends - summary: List all custom domains in a project + - Projects + - Git Connections + summary: Report the project's source-of-truth state + operationId: getProjectSourceExport description: | - Project-scoped custom-domain list. Returns every active custom - domain across every frontend in the project (excludes soft-deleted - rows). Each item inlines the linked frontend's id and name so the - UI does not need a second fetch to render the "Linked to" column. - operationId: listProjectCustomDomains + Volcano stores the source of the functions and frontend it runs for a + project. This reports whether that source has been written to the + connected repository, and whether the repository has taken over as the + project's source of truth. + + `mode` is `platform`, `git_exporting`, `git_pending`, or `git`. Export + enters `git_exporting` before reading stored source. GitHub's signed + push event confirms that the initial commit reached the production + branch. That push or a newer production push changes the mode to + `git_pending` when it starts a deployment. `exported_at` records that + transition. + + A successful Git run completes the transition when it matches the + recorded repository, production branch, and root directory and actually + dispatches every recorded resource. Ordinary production-branch pushes + deploy without changing a platform-managed project's source ownership. 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: Successful response - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedProjectCustomDomains' - '400': - description: Bad request - invalid identifier + description: The project's source-of-truth state content: application/json: schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/schemas/ProjectSourceExportState' '401': description: Unauthorized - invalid or missing token content: @@ -3817,81 +3967,58 @@ paths: schema: $ref: '#/components/schemas/Error' '403': - description: Forbidden - project ownership required + description: Forbidden - project not owned by the caller content: application/json: schema: $ref: '#/components/schemas/Error' - '500': - description: Internal server error + '404': + description: Project not found content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/functions: - get: - tags: - - Functions - summary: List all functions in a project - description: | - Supports two mutually exclusive pagination modes. Offset mode uses `page` - and `limit` and returns `next` (URL). Cursor mode uses `cursor` and - `limit`, supports `search` (case-insensitive name match), and returns - `next_cursor`/`prev_cursor`. Sending both `page` and `cursor` (or `page` - and `search`) returns 400. - operationId: listFunctions - 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: Successful response + '500': + description: Internal server error content: application/json: schema: - $ref: '#/components/schemas/PaginatedFunctions' - '404': - description: Project not found + $ref: '#/components/schemas/Error' + '501': + description: Source export is not available in this deployment mode content: application/json: schema: $ref: '#/components/schemas/Error' post: tags: - - Functions - summary: Create or update function code + - Projects + - Git Connections + summary: Initialize an empty repository with a project's stored source + operationId: exportProjectSource description: | - Upload a function source bundle. Direct API clients may send the function code - as a ZIP or tar.gz archive via multipart/form-data. The API stores a normalized tar.gz - source archive. - Cloud deploys should include source files and dependency manifests/lockfiles, not installed - dependency directories. Volcano installs Node.js, Python, and Ruby dependencies during the - function compile build. - Source archive size is enforced by the API with `SOURCE_ARCHIVE_SIZE_LIMIT_MB`; the CLI - does not apply its own source archive size limit. After the final container image is - built, the publish build enforces `LAMBDA_TARGET_CONTAINER_SIZE_LIMIT_MB` before pushing. - Uploaded source archives cannot contain symlink entries. Safe symlinks created during - the cloud build are materialized before publish. - Volcano builds and deploys the function asynchronously after upload. A deployment that starts - immediately returns a Function resource with `status: provisioning`, then transitions to - `active` or `failed`. If another deployment is running, the response preserves the resource's - current status and exposes the queued deployment through `pending_deployment_id`. - Existing function traffic continues to use the last known-good runtime during an update. A failed - update keeps that runtime available and records the attempted deployment as failed. - Only one deployment runs for a given function. A newer request supersedes any queued request - and starts after the running deployment. Different functions and projects deploy concurrently. - If a function with the same name already exists in the project, this operation updates that - function's runtime, handler, and source bundle and returns `200 OK`. - Each project can contain up to 10,000 functions. Creating a new function over this cap returns 403. - operationId: createFunction + Creates the first commit in the connected repository and pushes it + directly to the configured production branch. The push enters the + ordinary Git auto-deploy flow. Direct source writes remain frozen until + that deployment succeeds and the repository becomes the source of truth. + + The caller confirms the production branch shown before export, and + optionally the repository by its `repo_id`. Starting export pins that + branch: later GitHub default-branch changes do not repoint the project. + If the connected repository or the configured branch changed after the + caller read it, the request fails without exporting so the caller can + show and confirm the new value. + + The response lists what the export could not carry: resources with no + successful deployment to take source from (`skipped`), and things no + export can hand back (`omitted`) — migrations, which Volcano stores no + copy of, and credential-shaped files, which are left for their owner to + add. + + Requires a connected repository with no commits or branches, and runs + once. Volcano never creates the repository. If GitHub did not confirm + the push, retrying creates the same commit and adopts it when it already + reached the repository. security: - UserToken: [] - ProjectAccessToken: [] @@ -3900,385 +4027,437 @@ paths: requestBody: required: true content: - multipart/form-data: + application/json: schema: - type: object - required: - - name - - code - - runtime - properties: - name: - type: string - description: DNS-safe function name (lowercase letters, numbers, hyphens; cannot start or end with hyphen) - maxLength: 63 - pattern: ^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$ - example: my-api-function - code: - type: string - format: binary - description: ZIP or tar.gz archive containing function source code plus dependency manifests/lockfiles. The API enforces SOURCE_ARCHIVE_SIZE_LIMIT_MB and stores a normalized tar.gz source archive. - runtime: - type: string - enum: - - nodejs22.x - - nodejs24.x - - python3.10 - - python3.11 - - python3.12 - - python3.13 - - python3.14 - - ruby3.3 - - ruby3.4 - - ruby4.0 - description: | - Runtime environment. Required. - - Node.js: nodejs22.x, nodejs24.x - - Python: python3.10, python3.11, python3.12, python3.13, python3.14 - - Ruby: ruby3.3, ruby3.4, ruby4.0 - example: nodejs24.x - handler: - type: string - description: | - The name of the function to invoke. Defaults to "handler" if not specified. - Your code must export/define a function with this name: - - Node.js: exports.handler (in index.js) - - Python: def handler() (in main.py) - - Ruby: def handler() (in main.rb) - default: handler - example: handler - visibility: - allOf: - - $ref: '#/components/schemas/FunctionVisibility' - description: | - Who can invoke the function. Omit it to keep the function's - current visibility; a new function starts `private`. - is_public: - type: boolean - deprecated: true - description: | - Deprecated alias for `visibility`: `true` means `public` and - `false` means `authenticated`. Sending both with different - meanings returns 400. - invocation_mode: - $ref: '#/components/schemas/FunctionInvocationMode' - http_auth_mode: - $ref: '#/components/schemas/FunctionHTTPAuthMode' - openapi_spec: - type: string - description: JSON-encoded OpenAPI 3.0 or 3.1 metadata for an HTTP-mode function. - variable_scope: - type: string - 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: - type: string - description: | - JSON-encoded array of project variable names this function requires, on top of the ones detected in its source. A declared name the project does not define is rejected with 400; a detected name it does not define is ignored. Only used when `variable_scope` is `scoped`. Omitting this leaves an existing function's declared names unchanged. + $ref: '#/components/schemas/ExportProjectSourceRequest' responses: - '200': - description: Existing function updated; its deployment was started or queued - content: - application/json: - schema: - $ref: '#/components/schemas/Function' '201': - description: Function created and deployment workflow started + description: The initial production-branch commit that was pushed content: application/json: schema: - $ref: '#/components/schemas/Function' + $ref: '#/components/schemas/ProjectSourceExport' '400': - description: | - Bad request (invalid file, too large, etc.), an unknown - `visibility`, or `visibility` and `is_public` disagree + description: Malformed request body content: application/json: schema: $ref: '#/components/schemas/Error' - '403': - description: Function limit exceeded for the project + '401': + description: Unauthorized - invalid or missing token + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: Forbidden - project not owned by the caller + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Project not found, or it has no repository connected content: application/json: schema: $ref: '#/components/schemas/Error' '409': description: | - Function deletion is queued or running, the name is already held - by a durable function — a function cannot change kind — or the - redeploy would take a function with Frontend Function routes out - of `public` or out of HTTP invocation mode. The request is refused - before the deploy starts, so nothing is deployed. + The source has already been exported, the repository has already + taken over as the source of truth, the confirmed production branch + or repository is stale, a function or frontend deployment is still in progress, + a promoted preview is serving one of the project's functions or frontends, or the project + has no stored source to export content: application/json: schema: $ref: '#/components/schemas/Error' - '429': + '422': description: | - The owner's billing-cycle build-minutes allowance is spent. The - error names the allowance and carries a link to the usage page. + The repository refused the branch, or its contents cannot be laid + out as a repository — a stored file that only ever carries + credentials, or a layout Git auto-deploy would not read back + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: GitHub rate limited the request content: application/json: schema: $ref: '#/components/schemas/Error' '500': - description: Internal server error (function deployment failed) + description: Internal server error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '501': + description: Source export is not available in this deployment mode 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. + description: GitHub integration is not configured content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/functions/{functionId}: - get: + delete: tags: - - Functions - summary: Get function by ID - operationId: getFunction + - Projects + - Git Connections + summary: Cancel an incomplete source export + operationId: cancelProjectSourceExport + description: | + Restores platform source writes while the project is in + `git_exporting` or `git_pending`. If Volcano reserved or deployed the + root commit, export remains consumed and cannot be run again. The + connected repository and any commit already pushed to it are unchanged. security: - UserToken: [] - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/FunctionId' + responses: + '204': + description: The incomplete source transition was canceled + '401': + description: Unauthorized - invalid or missing token + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: Forbidden - project not owned by the caller + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Project not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '409': + description: No incomplete transition exists, or Git already took ownership + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: Internal server error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '501': + description: Source export is not available in this deployment mode + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /share-previews/{share_id}: + get: + tags: + - Shares + summary: Preview what a deploy link deploys + description: | + Public: needs no credential, because the link id is the credential. Answers + the link's current release: when it was published, its digest, the functions + and frontends installing it creates, the variables the visitor supplies, and + the functions that receive the new project's service key. Show it to a + visitor before they confirm, and send its `release.id` when creating the + project. + + Counts the visit for the link's owner, unless the request comes from a + crawler or link preview. A link that does not exist, was switched off, or has + not been published yet all answer the same `404`. + operationId: getSharePreview + security: [] + parameters: + - $ref: '#/components/parameters/ShareId' responses: '200': - description: Successful response + description: The link's current release content: application/json: schema: - $ref: '#/components/schemas/Function' + $ref: '#/components/schemas/SharePreview' + '400': + description: The link id is malformed + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: | + The request carried the dashboard proxy's visitor headers without a valid proof + from the proxy (code `proxy_credential_rejected`, the same for every kind of + failed proof). It is never about the caller's session. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '404': - description: Function not found + description: The link is not available, or deploy links are not available in this environment (code `feature_unavailable`; see `GET /capabilities`). A link of a project copied from a link that no longer allows re-sharing answers the same. content: application/json: schema: $ref: '#/components/schemas/Error' - patch: + '429': + description: Too many previews from this address; try again after `Retry-After` + headers: + Retry-After: + description: Seconds until the clock hour the limit counts in ends. + schema: + type: integer + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '451': + description: Volcano cannot serve requests from the visitor's location under US sanctions + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: Failed to preview the deploy link + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '503': + description: The dashboard proxy's own project is not being served right now (code `service_unavailable`); try again shortly. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /shares: + get: tags: - - Functions - summary: Update function settings - operationId: updateFunction + - Shares + summary: List a project's deploy links + description: | + Deploy links let anyone deploy a release the project's owner published as + their own new project. A link's public address is + `https://volcano.dev/deploy/`; the address carries no release, so it + cannot be edited to point at other code. + operationId: listShares security: - UserToken: [] - ProjectAccessToken: [] parameters: - - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/FunctionId' + - $ref: '#/components/parameters/ProjectIdQuery' + responses: + '200': + description: The project's deploy links, newest first + content: + application/json: + schema: + $ref: '#/components/schemas/SharesResponse' + '400': + description: The `project_id` query parameter is missing or is not a project UUID + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Unauthorized - invalid or missing token + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Project not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: Failed to list deploy links + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + post: + tags: + - Shares + summary: Create a deploy link + description: | + Creates a draft link for the project. It offers nothing to visitors, and its + preview answers `404`, until its owner publishes a release to it with + `POST /share-releases`. Any project can have + links, whether it deploys from the CLI, the dashboard or Git. + operationId: createShare + security: + - UserToken: [] requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/UpdateFunctionRequest' - examples: - makePublic: - summary: Let anon keys invoke the function - value: - visibility: public - allowSignedInUsers: - summary: Let signed-in users of the project invoke the function - value: - visibility: authenticated - makePrivate: - summary: Allow only service keys and schedulers (the default) - value: - visibility: private + $ref: '#/components/schemas/ShareCreateRequest' responses: - '200': - description: Function updated + '201': + description: The new deploy link content: application/json: schema: - $ref: '#/components/schemas/Function' + $ref: '#/components/schemas/Share' '400': + description: Malformed request body or an invalid suggested name + 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: | - Invalid settings: an unknown `visibility`, `visibility` and - `is_public` disagree, or `http_auth_mode: none` on a function that - is not `public` + A project access token was used. + A person creates, changes, publishes and deletes deploy links. Code + `reshare_not_allowed` means the project is a copy made from someone else's + deploy link, and that link, or a link it was made from in turn, does not + allow re-sharing or no longer exists. Code `source_unavailable` means the + project is a copy, and a link it was made from is not available to share + from right now. Code `operator_disabled` means + Volcano took one of the project's links down (`disabled_reason` + `operator`), so the project cannot be shared until that is lifted. content: application/json: schema: $ref: '#/components/schemas/Error' '404': - description: Function not found + description: | + Project not found or not the caller's, or deploy links are not available + in this environment + (code `feature_unavailable`; see `GET /capabilities`) content: application/json: schema: $ref: '#/components/schemas/Error' '409': - description: | - Function settings conflict with attached Frontend Function routes: - a routed function must stay `public` and in HTTP invocation mode. + description: The project has reached its deploy link limit content: application/json: schema: $ref: '#/components/schemas/Error' - delete: + '500': + description: Failed to create the deploy link + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /shares/{share_id}: + get: tags: - - Functions - summary: Delete a function - description: | - Schedules asynchronous function deletion. If another deployment is running, the function - preserves its current status and exposes the queued deletion through `pending_deployment_id`. - Its status changes to `deleting` when cleanup starts. After cleanup, it returns 404 and no - longer appears in function lists. - operationId: deleteFunction + - Shares + summary: Get a deploy link + operationId: getShare security: - UserToken: [] - ProjectAccessToken: [] parameters: - - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/FunctionId' + - $ref: '#/components/parameters/ShareId' + - $ref: '#/components/parameters/ItemProjectIdQuery' responses: - '202': - description: Function deletion started or queued - '404': - description: Function not found + '200': + description: The deploy link + content: + application/json: + schema: + $ref: '#/components/schemas/Share' + '400': + description: | + `project_id` is malformed, or `project_id` is given and the link id is + malformed. Without `project_id`, a malformed link id answers 404, as an + unknown link does. content: application/json: schema: $ref: '#/components/schemas/Error' - /functions/{functionId}/invoke: - post: - tags: - - Functions - summary: Invoke a function - description: | - Invoke a function. The function's `visibility` decides which credentials - may call it, and the function does not run for any other. A `private` - function answers every credential but a service key exactly as a - missing one, with 404, so its name and id cannot be discovered; an anon - key on an `authenticated` function gets 403. An SDK calling by name - resolves it first through `GET /functions/resolve`, which answers that - anon key with 404 instead. - - **With Service Key** (admin/background operations, every visibility): - - 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, `authenticated` or `public` functions): - - Use for user-initiated actions - - Includes users from anonymous sign-ins - - 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` functions only): - - Requires anon key permission: `functions.invoke` - - Function must have `visibility: public` - - Function receives payload only (no `__volcano_auth`) + '401': + description: Unauthorized - invalid or missing token + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Project or deploy link not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: Failed to get the deploy link + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + patch: + tags: + - Shares + summary: Edit or switch a deploy link on or off + description: | + Changes the suggested name, the status, or both. An owner can always switch a + link off: it works even while deploy links are not available in this + environment, and while the owner's account is read-only. Setting + `allow_reshare` to false also works in both cases, alone or with a + switch-off, since like a switch-off it only shares less; for a read-only + account these are the only changes allowed. While deploy links are not + available, a request that sends back the values the link already has, + including `status` `active` on an active link, changes nothing and answers + `200`. - **Reserved payload keys:** the top-level `__volcano_auth` and - `__volcano_http` keys are reserved. Volcano removes caller-supplied - values for both before the function runs; only an auth user token adds - a server-built `__volcano_auth`, and only HTTP-mode ingress sets - `__volcano_http: true`. + Switching a link off also stops the installs it started that have not + finished, including ones still queued: each fails at its next step. The + visitor keeps the project, with its installation failed. Switching the link + back on lets only installs that have not failed yet go ahead. - **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. + A link Volcano took down (`disabled_reason` `operator`) cannot be switched + back on; other edits still work, and it stays down. While any of the + project's links is taken down, no link of the project can be switched on or + allowed to be re-shared. - **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`. - operationId: invokeFunction + A request that switches the link off together with an edit while deploy links + are not available, or that also allows re-sharing on a copy whose source does + not allow it, still switches the link off, but answers `400` with code + `edit_dropped`: the link is off and the edit was not applied. While the + account is read-only, a request that switches the link off or sets + `allow_reshare` to false together with another edit is answered the same way: + the switch-off and the re-sharing change are saved, and the other edit is not. + A `status` the link already has is no edit, so sending the fetched link back + with `allow_reshare` false answers `200`; a switch-on is such another edit. + operationId: updateShare security: - - AnonKey: [] - - ServiceRoleKey: [] - - AuthUserAccessToken: [] + - UserToken: [] parameters: - - $ref: '#/components/parameters/FunctionId' + - $ref: '#/components/parameters/ShareId' + - $ref: '#/components/parameters/ItemProjectIdQuery' requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/FunctionInvocationRequest' - examples: - serviceCall: - summary: Admin/background operation (service key) - value: - payload: - action: process_batch - items: - - 1 - - 2 - - 3 - userCall: - summary: User-initiated call (auth token) - value: - payload: - action: get_profile - anonCall: - summary: Public function call (anon key) - value: - payload: - action: ping_public_endpoint + $ref: '#/components/schemas/ShareUpdateRequest' responses: '200': - description: Function response (passthrough from function runtime) - headers: - X-Volcano-Version: - description: Volcano API/runtime version that served this invocation (`` in production, `-` in non-production) - schema: - type: string - X-Volcano-Region: - 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 + description: The updated deploy link content: application/json: schema: - $ref: '#/components/schemas/FunctionInvocationResponse' + $ref: '#/components/schemas/Share' '400': - description: Bad request - invalid payload or function in failed state + description: Malformed request body or an invalid suggested name. Code `feature_unavailable` means deploy links are not available in this environment, so an edit or enabling the link is refused while switching it off still works; code `edit_dropped` means the link was switched off, or for a read-only account its re-sharing turned off, and the other edit sent with it was not saved, including a re-sharing change refused because the project is a copy whose source does not allow re-sharing, or because Volcano took one of the project's links down. content: application/json: schema: @@ -4291,467 +4470,303 @@ paths: $ref: '#/components/schemas/Error' '403': description: | - Forbidden - CORS blocked, missing `functions.invoke`, or an anon key - on an `authenticated` function + A project access token was used. + A person creates, changes, publishes and deletes deploy links. Also + answered when the account is read-only and the request neither switches + the link off nor sets `allow_reshare` to false. Code `reshare_not_allowed` means the request switches the + link on or sets `allow_reshare` to true, and the project is a copy made from + someone else's deploy link that, or a link it was made from in turn, does + not allow re-sharing or no longer exists. Code `source_unavailable` means + it does so on a copy, and a link the copy was made from is not available + to share from right now. Code `operator_disabled` means + the request switches on a link Volcano took down + (`disabled_reason` `operator`), which only Volcano can lift, or switches + on a link or sets `allow_reshare` to true while Volcano has taken any of + the project's links down. Switching a link off is always allowed. content: application/json: schema: $ref: '#/components/schemas/Error' '404': - description: | - Function not found. Also returned for a `private` function to any - credential but a service key. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '429': - description: | - Rate limit exceeded (per-function or project-wide limit), or the - owning platform user's billing-cycle bandwidth allowance (aggregate ingress + - egress) was exceeded. + description: Project or deploy link not found, or the project is not the caller's content: application/json: schema: $ref: '#/components/schemas/Error' - '503': - description: | - Function still provisioning or rate limiting service unavailable. - A freshly deployed (or updated) function may briefly report - `provisioning` and reject invocations until the background status - reconciler observes its deployment workflow completing and transitions - it to `active`. This is expected for a few seconds after deploy; clients - should retry. + '500': + description: Failed to update the deploy link content: application/json: schema: $ref: '#/components/schemas/Error' - default: - description: Function response (passthrough; status code/body/headers come from the function) - headers: - X-Volcano-Version: - description: Volcano API/runtime version that served this invocation (`` in production, `-` in non-production) - schema: - type: string - X-Volcano-Region: - 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: - $ref: '#/components/schemas/FunctionInvocationResponse' - /durable-functions/{functionId}/executions: - post: + delete: tags: - - Durable Functions - summary: Start a durable execution from an application + - Shares + summary: Delete a deploy link description: | - Starts an execution of a durable function using an application - credential, and returns its handle. - - This is the durable counterpart of `POST /functions/{functionId}/invoke`, - and it is the endpoint an application calls. Like that one, it is not - project-scoped: an anon key, a service key and an auth user token each - carry their own project. The project-scoped collection under - `/projects/{id}/durable-functions/...` remains the owner's management - surface. - - **With a service key:** any durable function in the project. - - **With an auth user token:** a durable function whose `visibility` is - `authenticated` or `public`. - - **With an anon key:** requires the `functions.invoke` permission, and - the function must have `visibility: public`. - - A `private` durable function answers every credential but a service key - exactly as a missing one, with 404. - - Starting is all this endpoint does. Reading a result or stopping an - execution requires the project owner's token, because an anon key is - shared by everyone who loads the page and an execution is addressed by - id alone. - - Send `X-Volcano-Execution-Name` to make the start idempotent: repeating - a start with the same name returns the existing execution instead of - beginning a second one. - - Each execution counts once against the project's durable execution - allowance, however many times the start is retried under the same - execution name, and the number in flight at once is capped by the plan. - The operations the execution performs are counted against the durable - operations allowance when it finishes. - operationId: startDurableExecutionFromApplication + Deletes the link, its releases and its recorded events. The address stops + working. Installs the link started that have not finished, including ones + still queued, fail at their next step. The visitor keeps the project, with + its installation failed. A link Volcano took down (`disabled_reason` + `operator`) cannot be deleted until that is lifted; deleting its project + still removes it. + operationId: deleteShare security: - - AnonKey: [] - - ServiceRoleKey: [] - - AuthUserAccessToken: [] + - UserToken: [] parameters: - - $ref: '#/components/parameters/DurableFunctionId' - - name: X-Volcano-Execution-Name - in: header - required: false - description: | - Idempotency key for this execution. Generated when omitted. A repeat - under a name that already names a running execution returns that - execution and is not charged again. - - Letters, digits, `-`, `_` and `.`, up to 255 characters. Anything - else is rejected with `400`. - schema: - type: string - maxLength: 255 - pattern: ^[A-Za-z0-9._-]+$ - requestBody: - required: false - content: - application/json: - schema: - description: Input passed to the function, up to 256 KiB. + - $ref: '#/components/parameters/ShareId' + - $ref: '#/components/parameters/ItemProjectIdQuery' responses: - '202': - description: Execution accepted and started - content: - application/json: - schema: - $ref: '#/components/schemas/DurableExecution' + '204': + description: The deploy link was deleted '400': - description: Payload is not valid JSON, or the execution name is invalid + description: | + `project_id` is malformed, or `project_id` is given and the link id is + malformed. Without `project_id`, a malformed link id answers 404, as an + unknown link does. content: application/json: schema: $ref: '#/components/schemas/Error' '401': - description: | - Missing or invalid credential. Also returned for a platform user - token, which is not an application credential; project owners start - executions through the project-scoped collection. + description: Unauthorized - invalid or missing token content: application/json: schema: $ref: '#/components/schemas/Error' '403': description: | - The anon key lacks `functions.invoke` or the function is - `authenticated`, or the request's origin is refused by the project's - CORS policy. + A project access token was used. + A person creates, changes, publishes and deletes deploy links. Code + `operator_disabled` means Volcano took the link down (`disabled_reason` + `operator`), so it is kept until Volcano lifts that. content: application/json: schema: $ref: '#/components/schemas/Error' '404': - description: | - Durable function not found. Also returned for a standard function's - id, for a durable function in another project, and for a `private` - one to any credential but a service key, so the response cannot be - used to tell those apart. + description: Project or deploy link not found, or the project is not the caller's content: application/json: schema: $ref: '#/components/schemas/Error' - '409': - description: | - Function is not deployed yet, or has no deployed region. Also - returned when two starts under the same execution name raced and - both released it, which is retryable as it stands, and with `code` - `execution_name_held` when an unfinished start this caller may not - resume holds the execution name, which needs a name of its own. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '413': - description: Payload is larger than 256 KiB - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '429': - description: | - The project has too many executions in flight for its plan, the - function invocation rate limit was exceeded, the project is over - its bandwidth cap, or the account is out of one of its - billing-cycle durable allowances: executions, operations, or - compute. Operations and compute are counted once an execution - finishes, so a refusal on either never interrupts an execution - already running — it declines the next start. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '503': - description: | - Durable execution is not available in this environment, or the - plan terms for the start could not be read. The 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. + '500': + description: Failed to delete the deploy link content: application/json: schema: $ref: '#/components/schemas/Error' - /durable-functions/{functionId}/executions/{executionId}/messages: - post: + /share-release-drafts: + get: tags: - - Durable Functions - summary: Send a message to a durable execution from an application - description: | - Sends a named message to a running execution. The workflow receives it - from `ctx.waitForMessage` with the same name. A message sent before - anything waits for its name is kept, and each wait takes the oldest - one, so messages arrive in the order they were sent. - - Messages never decide an approval: a workflow waiting in - `ctx.waitForApproval` is not resumed by one. - - **With a service key:** any execution in the project. - - **With an auth user token:** an execution the user started, or one - whose `X-Volcano-Client-Token` the request carries, of a durable - function whose `visibility` is `authenticated` or `public`. - - **With an anon key:** an execution whose `X-Volcano-Client-Token` the - request carries, of a function with `visibility: public`. - - Any other execution answers `404`, as a missing one does. + - Shares + summary: Show what publishing a deploy link would release + description: | + Builds the project's deployed functions and frontends the way a release + would, without storing anything, and reports what it would carry: the + functions and frontends, the project variables every project created from + the release gets (empty unless the visitor gives a value), the functions + whose code reads `VOLCANO_SERVICE_KEY`, and what is left out (resources with + no stored source, databases, sandboxes, dotenv and key files). Review it, + then publish with its `draft_id`, and its variables and service key + functions confirmed. - Send `Idempotency-Key` to make a retry safe: a repeat with a key the - same sender has used on the execution returns the first message with - `200` and sends nothing. - operationId: sendDurableMessageFromApplication + Every call runs a full build and counts against the account's hourly + release build budget, which drafts and publishes share. Fetch it when the + owner opens the publish step, not on every focus or poll. + operationId: getShareReleaseDraft security: - - AnonKey: [] - - ServiceRoleKey: [] - - AuthUserAccessToken: [] + - UserToken: [] parameters: - - $ref: '#/components/parameters/DurableFunctionId' - - $ref: '#/components/parameters/DurableExecutionId' - - $ref: '#/components/parameters/DurableMessageIdempotencyKey' - - $ref: '#/components/parameters/DurableClientToken' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/SendDurableMessageRequest' + - $ref: '#/components/parameters/ShareIdQuery' + - $ref: '#/components/parameters/ItemProjectIdQuery' responses: '200': - description: A message with this `Idempotency-Key` was already sent; it is returned - content: - application/json: - schema: - $ref: '#/components/schemas/DurableMessage' - '201': - description: | - Message sent. `status` is `delivered` when a wait took it at once, - `delivering` when a wait took it and the handover is still being - confirmed, and `queued` when it is kept for the next wait. + description: What a release would carry content: application/json: schema: - $ref: '#/components/schemas/DurableMessage' + $ref: '#/components/schemas/ShareReleaseDraft' '400': - description: The name, data or idempotency key is invalid + description: | + `project_id` is malformed, or `project_id` is given and the link id is + malformed. Without `project_id`, a malformed link id answers 404, as an + unknown link does. content: application/json: schema: $ref: '#/components/schemas/Error' '401': - description: Missing or invalid credential + description: Unauthorized - invalid or missing token content: application/json: schema: $ref: '#/components/schemas/Error' '403': description: | - The anon key lacks `functions.invoke`, the service key is scoped - without it, or the function is `authenticated` and the request - carries an anon key. Also returned when the request's origin is - refused by the project's CORS policy. + A project access token was used. + A person creates, changes, publishes and deletes deploy links. Code + `reshare_not_allowed` means the project is a copy made from someone else's + deploy link, and that link, or a link it was made from in turn, does not + allow re-sharing or no longer exists. Code `source_unavailable` means the + project is a copy, and a link it was made from is not available to share + from right now. Code `operator_disabled` means + Volcano took one of the project's links down (`disabled_reason` + `operator`), so the project cannot be shared until that is lifted. content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: | - Durable function or execution not found, or the credential cannot - reach the execution. A `private` function answers every credential - but a service key this way. + Project or deploy link not found, or the project is not the caller's, or + publishing is not available in this environment (code + `feature_unavailable`). A local server without stored + source archives cannot publish, even where `GET /capabilities` lists + `shares` as available for managing links. content: application/json: schema: $ref: '#/components/schemas/Error' - '409': + '422': description: | - The message cannot be sent. `code` says why: - - - `execution_not_running`: the execution has finished. - - `too_many_queued_messages`: the execution already holds the - maximum number of messages nothing has taken. + The project cannot be released as it is: it has no deployed function or + frontend with stored source, a function's settings would be refused, it + has more than 100 variables a release would carry or more than 100 + functions reading `VOLCANO_SERVICE_KEY`, or the release would be larger + than an install reads. content: application/json: schema: $ref: '#/components/schemas/Error' - '413': - description: The request body is larger than 72 KiB + '429': + description: | + This account started too many release builds this hour (30, drafts and + publishes together; code `release_builds_limited`). Try again after + `Retry-After`. + headers: + Retry-After: + description: Seconds until the clock hour the budget counts in ends. + schema: + type: integer content: application/json: schema: $ref: '#/components/schemas/Error' - '429': - description: | - Too many messages sent to this execution, the function's or the - project's function rate limit, which sends share with invocations - and starts, or the project is over its bandwidth cap. + '500': + description: Failed to build the release draft content: application/json: schema: $ref: '#/components/schemas/Error' '503': - description: The plan terms for the request could not be read. Retry with backoff. + description: | + Release builds on this server are busy (code `builds_busy`); try again after + `Retry-After`. + headers: + Retry-After: + description: Seconds to wait before trying again. + schema: + type: integer content: application/json: schema: $ref: '#/components/schemas/Error' + /share-releases: get: tags: - - Durable Functions - summary: List a durable execution's messages from an application + - Shares + summary: List a deploy link's releases description: | - Lists the messages sent to and published by an execution, oldest - first. Pass the last `seq` you read as `after` to read only what came - next; that is how a client catches up after a live subscription - reconnects. - - Access follows the same rules as sending. - operationId: listDurableMessagesFromApplication + Pages the link's releases, newest first. Follow `next_cursor` while + `has_more` is true. + operationId: listShareReleases security: - - AnonKey: [] - - ServiceRoleKey: [] - - AuthUserAccessToken: [] + - UserToken: [] + - ProjectAccessToken: [] parameters: - - $ref: '#/components/parameters/DurableFunctionId' - - $ref: '#/components/parameters/DurableExecutionId' - - $ref: '#/components/parameters/DurableClientToken' - - $ref: '#/components/parameters/DurableMessageDirectionFilter' - - $ref: '#/components/parameters/DurableMessageNameFilter' - - $ref: '#/components/parameters/DurableMessageAfter' - - $ref: '#/components/parameters/DurableMessageLimit' + - $ref: '#/components/parameters/ShareIdQuery' + - $ref: '#/components/parameters/ItemProjectIdQuery' + - $ref: '#/components/parameters/Limit' + - $ref: '#/components/parameters/ShareReleaseCursor' responses: '200': - description: Successful response + description: A page of the link's releases content: application/json: schema: - $ref: '#/components/schemas/DurableMessageList' + $ref: '#/components/schemas/PaginatedShareReleases' '400': - description: A filter is invalid + description: | + `project_id` is malformed, or `project_id` is given and the link id is + malformed, or `limit` or `cursor` is invalid, such as a cursor issued for + another share or page size. Without `project_id`, a malformed link id + answers 404, as an unknown link does. content: application/json: schema: $ref: '#/components/schemas/Error' '401': - description: Missing or invalid credential - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '403': - description: | - The anon key lacks `functions.invoke`, the service key is scoped - without it, or the function is `authenticated` and the request - carries an anon key. Also returned when the request's origin is - refused by the project's CORS policy. + description: Unauthorized - invalid or missing token content: application/json: schema: $ref: '#/components/schemas/Error' '404': - description: | - Durable function or execution not found, or the credential cannot - reach the execution. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '429': - description: | - The function's or the project's function rate limit, which lists - share with invocations and starts, or the project is over its - bandwidth cap. + description: Project or deploy link not found content: application/json: schema: $ref: '#/components/schemas/Error' - '503': - description: The plan terms for the request could not be read. Retry with backoff. + '500': + description: Failed to list the deploy link's releases content: application/json: schema: $ref: '#/components/schemas/Error' - /functions/resolve: - get: + post: tags: - - Functions - summary: Resolve function name for invocation + - Shares + summary: Publish a deploy link release description: | - 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 for `authenticated` and `public` functions - - A `private` function answers 404, exactly as a missing one + Snapshots the project's deployed functions and frontends into an immutable + release and makes it the link's current release in one step, so visitors see + either the previous release or this one. Visitors install exactly the stored + release; later deploys to the project change nothing until the owner + publishes again. - **With Anon Key**: - - Requires anon key permission: `functions.invoke` - - Function must have `visibility: public`; any other answers 404 - operationId: resolveFunctionForInvocation + Send the reviewed draft's `draft_id`, its variables and the functions that + receive the new project's `VOLCANO_SERVICE_KEY`, as confirmed from the + draft. Both lists must be exactly the draft's: a release carries every + variable, since leaving one out would only break the code that reads it. If + a fresh build is not the reviewed draft, because the project was redeployed + or changed since, or the lists differ from it, nothing is published and the + answer is `409` with code `draft_changed` and the new draft. A + release carries variable names, never values, and no database. A publish is + a full build and counts against the account's hourly release build budget, + which it shares with the draft. + operationId: publishShareRelease security: - - AnonKey: [] - - ServiceRoleKey: [] - - AuthUserAccessToken: [] - parameters: - - name: name - in: query - required: true - schema: - type: string - maxLength: 63 - pattern: ^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$ - description: DNS-safe function name (lowercase letters, numbers, hyphens; cannot start or end with hyphen) - example: my-function + - UserToken: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ShareReleaseCreateRequest' responses: - '200': - description: Function resolved successfully + '201': + description: The published release, now the link's current release content: application/json: schema: - $ref: '#/components/schemas/ResolveFunctionResponse' + $ref: '#/components/schemas/ShareRelease' '400': - description: Bad request - missing or invalid function name + description: | + The body names an existing link but is otherwise malformed, such as an + unknown field or a `variables` entry of the wrong type. A body that is not + JSON, or whose `share_id` is missing or malformed, answers 404, as an + unknown link does. content: application/json: schema: @@ -4764,119 +4779,126 @@ paths: $ref: '#/components/schemas/Error' '403': description: | - Forbidden - CORS blocked, or missing `functions.invoke` permission - for anon key + A project access token was used. + A person creates, changes, publishes and deletes deploy links. Code + `reshare_not_allowed` means the project is a copy made from someone else's + deploy link, and that link, or a link it was made from in turn, does not + allow re-sharing or no longer exists. Code `source_unavailable` means the + project is a copy, and a link it was made from is not available to share + from right now. Code `operator_disabled` means + Volcano took one of the project's links down (`disabled_reason` + `operator`), so the project cannot be shared until that is lifted. content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: | - Function not found. Also returned for a `private` function with an - auth user token, and a non-public one with an anon key. A durable - function is never resolvable here: it is started through - `POST /durable-functions/{functionId}/executions`, not invoked. + Project or deploy link not found, including a body that names no + well-formed `share_id`, or the project is not the caller's, or publishing + is not available in this environment (code `feature_unavailable`). A local server without stored + source archives cannot publish, even where `GET /capabilities` lists + `shares` as available for managing links. content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/logs/activity: - post: - tags: - - Logs - summary: Get project log activity - description: | - Retrieve bucketed log counts for one resource type in the project. Set - `resource.type` to `function`, `frontend`, or `database`. Add - `resource.ids` to filter to one or more resources, and add - `resource.deployments.ids` to count deployment logs instead of runtime - logs for functions and frontends. Deployment logs are not supported for - databases. Database logs are a SUPERAGENT feature; `resource.type=database` - from a HOBBY project owner returns 403. The activity window is limited - to the plan's retention window (HOBBY: 1 day, SUPERAGENT: 30 days); older start - times are clamped to that window. Buckets are aligned to UTC clock - intervals and count events in the half-open window - `[start_time, end_time)`. - operationId: getProjectLogActivity - security: - - UserToken: [] - - ProjectAccessToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/LogActivityRequest' - responses: - '200': - description: Successful response + '409': + description: | + What was confirmed does not match a fresh build of the project (code + `draft_changed`). The body carries the fresh draft in `draft`; review it + and publish again. `error` names the confirmed variables the draft does + not have, the draft variables left out, or the service key functions the + draft expects. It says the + project changed when the confirmation matches the fresh draft but its + `draft_id` is not the one sent: the project changed since the draft was + reviewed, or while the release was being built. content: application/json: schema: - $ref: '#/components/schemas/LogActivityResponse' - '400': - description: Bad request - invalid query parameter + $ref: '#/components/schemas/ShareDraftChangedError' + '422': + description: | + The project cannot be released as it is: it has no deployed function or + frontend with stored source, a function's settings would be refused, it + has more than 100 variables a release would carry or more than 100 + functions reading `VOLCANO_SERVICE_KEY`, or the release would be larger + than an install reads. content: application/json: schema: $ref: '#/components/schemas/Error' - '401': - description: Unauthorized - invalid or missing token + '429': + description: | + This account started too many release builds this hour (30, drafts and + publishes together; code `release_builds_limited`). Try again after + `Retry-After`. + headers: + Retry-After: + description: Seconds until the clock hour the budget counts in ends. + schema: + type: integer content: application/json: schema: $ref: '#/components/schemas/Error' - '403': - description: Forbidden - project ownership required + '500': + description: Failed to publish the release content: application/json: schema: $ref: '#/components/schemas/Error' - '404': - description: Project or resource not found + '503': + description: | + Release builds on this server are busy (code `builds_busy`); try again after + `Retry-After`. + headers: + Retry-After: + description: Seconds to wait before trying again. + schema: + type: integer content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/logs/search: - post: + /share-stats: + get: tags: - - Logs - summary: Search project logs + - Shares + summary: Get a deploy link's click and deploy counts description: | - Search or filter logs for one resource type in the project. Set - `resource.type` to `function`, `frontend`, or `database`. Add - `resource.ids` to filter to one or more resources, and add - `resource.deployments.ids` to read deployment logs instead of runtime - logs for functions and frontends. Deployment logs are not supported for - databases. Database logs are a SUPERAGENT feature; requests for - `resource.type=database` from a HOBBY project owner return 403. - Log history (runtime and deployment) is limited to the plan's retention - window (HOBBY: 1 day, SUPERAGENT: 30 days); older time ranges are clamped to that - window. - operationId: searchProjectLogs + Counts what happened at the link: clicks, previews, confirmations, projects + created, and how many became ready or failed. Informational only. Visitors + are counted from a salted hash and no address is stored. Events are kept + for 90 days, so a `days` above 90 is rejected with `400`. + operationId: getShareStats security: - UserToken: [] - ProjectAccessToken: [] parameters: - - $ref: '#/components/parameters/ProjectId' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/LogSearchRequest' + - $ref: '#/components/parameters/ShareIdQuery' + - $ref: '#/components/parameters/ItemProjectIdQuery' + - name: days + in: query + required: false + description: How many days back to count. Defaults to 30. + schema: + type: integer + minimum: 1 + maximum: 90 + default: 30 responses: '200': - description: Successful response + description: The link's event counts content: application/json: schema: - $ref: '#/components/schemas/LogSearchResponse' + $ref: '#/components/schemas/ShareStats' '400': - description: Bad request - invalid query parameter + description: | + `days` is outside 1 to 90, `project_id` is malformed, or `project_id` is + given and the link id is malformed. Without `project_id`, a malformed link + id answers 404, as an unknown link does. content: application/json: schema: @@ -4887,131 +4909,203 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - '403': - description: Forbidden - project ownership required + '404': + description: Project or deploy link not found content: application/json: schema: $ref: '#/components/schemas/Error' - '404': - description: Project or resource not found + '500': + description: Failed to get the deploy link stats content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/logs/stream: + /forks: post: tags: - - Logs - summary: Stream project logs + - Forks + summary: Fork a share into a project of your own description: | - Live-tail project logs as Server-Sent Events. The request body uses the - resource selector plus `q`, `start_time`, and `limit`, - including runtime logs and function/frontend deployment logs selected - with `resource.deployments`. Deployment logs are not supported for - databases. Database logs are a SUPERAGENT feature; `resource.type=database` - from a HOBBY project owner returns 403. The `q` field uses the same - syntax as search and activity requests. Do not send `cursor` or - `end_time`; use `/logs/search` for range backfills. - Explicit historical `start_time` values are limited to the plan's - retention window (HOBBY: 1 day, SUPERAGENT: 30 days). Resume with - `Last-Event-ID` or the `last_event_id` query parameter. The cursor is - bound to the request body: the resource selector and every filter must - match the original request when reconnecting, otherwise the request is - rejected with `400`. + Creates a project in the caller's account from the release a share offers, + and queues its install: the release's functions and frontends, never the + owner's data, variable values, keys or sign-in settings. Every variable the + release declares is created; one the visitor gives no value for is created + empty. Installation is asynchronous: poll the project until + `template_installation.status` is `ready`. A `201` without + `template_installation` means nothing is being installed. - This is a live tail, not a gap-free backfill. On connect or reconnect the - server delivers at most `limit` of the most recent matching events from - the cursor position and then follows new events; events older than that - window are not replayed. Use `/logs/search` to backfill a time range. - operationId: streamProjectLogs + The fork is checked against what the release recorded when it was published + (its functions, frontends and variables, and the plan's room for them); the + release's archive is read and checked by the install. A stored archive that + fails those checks fails the install with `failure_code` `source_invalid` + rather than refusing the request. + + Send the `release_id` that `GET /share-previews/{share_id}` returned. If the + share moved to a new release since, nothing is created and the answer is + `409` with code `release_changed`. + operationId: createFork security: - UserToken: [] - - ProjectAccessToken: [] parameters: - - $ref: '#/components/parameters/ProjectId' - - name: Last-Event-ID + - name: Idempotency-Key in: header required: false + description: | + Makes a fork safe to retry. A repeat with the same key from the same + account answers `201` with the project the first request created, without + confirming, counting or creating anything again. Reusing a key for a + different request (another name, share, release or set of variable names + with a value) answers `409` with code `idempotency_key_reused`. Variable + values are not compared. The key is kept as long as the project exists. schema: type: string - description: Opaque stream cursor from the most recent SSE `id` field. - - name: last_event_id - in: query - required: false - schema: - type: string - description: Opaque stream cursor fallback when setting `Last-Event-ID` is not practical. + minLength: 1 + maxLength: 255 + pattern: ^[!-~]+$ requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/LogStreamRequest' + $ref: '#/components/schemas/ForkCreateRequest' responses: - '200': - description: Server-Sent Events stream. `log` events contain a JSON `LogSearchEvent`; `warning` events contain a JSON object with an `error` field. + '201': + description: The project was created and its install queued content: - text/event-stream: + application/json: schema: - type: string - examples: - log: - summary: Log event - value: | - : connected - - id: STREAM_CURSOR - event: log - data: {"id":"LOG_EVENT_ID","timestamp":"2024-01-01T12:00:00Z","level":"info","message":"User logged in","resource":{"type":"function","id":"550e8400-e29b-41d4-a716-446655440000","name":"login"},"region":"us-east-1"} + $ref: '#/components/schemas/Project' '400': - description: Bad request - invalid selector, stream cursor, or unsupported stream field + description: The request body is malformed. content: application/json: schema: $ref: '#/components/schemas/Error' '401': - description: Unauthorized - invalid or missing token + description: Not authenticated content: application/json: schema: $ref: '#/components/schemas/Error' '403': - description: Forbidden - project ownership required + description: | + The release would exceed the plan's limits for frontends and functions, or the + account may not create projects. Code `proxy_credential_rejected` means the + request carried the dashboard proxy's visitor headers without a valid proof + from the proxy; it is never about the caller's session. content: application/json: schema: $ref: '#/components/schemas/Error' '404': - description: Project or resource not found + description: | + The share is not available. It does not exist, was switched off, has not + been published, or is a copy whose source no longer allows re-sharing. Code + `feature_unavailable` means forks are not available in this environment (see + `GET /capabilities`). + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '409': + description: | + The share has a new release since the preview (code `release_changed`): fetch + the preview again and confirm the new release. Code `idempotency_key_reused`: + the `Idempotency-Key` was already used for a different request. Code + `request_in_progress`: the first request with this `Idempotency-Key` has made + its project but not yet queued the install; retry after `Retry-After`, and the + retry answers that project once it is settled. A project name you already use + is not a conflict: the project is created under that name with a short random + suffix added. Only when no free suffixed name is found after a few tries does + the request answer `409`. + headers: + Retry-After: + description: Seconds to wait before retrying (code `request_in_progress`). Absent otherwise. + schema: + type: integer + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '422': + description: | + The release cannot be installed as it is, or `variables` names a variable the + release does not declare (code `variable_not_declared`). A variable left out, + or sent empty, is created empty. The message names the variables, never their + values. Code `variables_required` means the release declares variables Volcano + could not set up; ask the person who shared it to share it again. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: Too many forks (20 an hour) from this account; try again after `Retry-After` + headers: + Retry-After: + description: Seconds until the clock hour the limit counts in ends. + schema: + type: integer + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '451': + description: Volcano cannot serve requests from the visitor's location under US sanctions (a fork confirmed through the dashboard) content: application/json: schema: $ref: '#/components/schemas/Error' '500': - description: Internal server error - log streaming setup failed + description: Failed to create the project from the deploy link content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/functions/batch: - post: + '503': + description: | + Durable functions are paused (code `feature_paused`, with a `Retry-After` + header) and the release has a durable function. Code `service_unavailable` + means the dashboard proxy's own project is not being served right now. Code + `rate_limit_unavailable` means Volcano cannot count forks right now; retry + after `Retry-After`. + headers: + Retry-After: + description: Seconds until durable functions may be back (code `feature_paused`), or a short wait while forks cannot be counted (code `rate_limit_unavailable`). Absent otherwise. + schema: + type: integer + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /projects/{id}/git-connection/production-branch: + put: tags: - - Functions - summary: Deploy multiple functions in one request + - Projects + - Git Connections + summary: Set the branch a project deploys from description: | - Upload multiple function source archives in one multipart request. Each archive should contain source files - plus dependency manifests/lockfiles, not installed dependency directories. ZIP and tar.gz uploads are - accepted and normalized to tar.gz before storage. The API enforces `SOURCE_ARCHIVE_SIZE_LIMIT_MB` - for each uploaded and normalized source archive. The server records a shared - deployment batch ID for the resulting function deployments. Each function deployment runs its own - compile/publish workflow concurrently, and each publish build enforces `LAMBDA_TARGET_CONTAINER_SIZE_LIMIT_MB` - for the final container image. - One batch request can include up to 100 functions. Submit multiple batch requests for larger projects. - If one function fails before its workflow starts, already-started function deployments are left - running and the failed function is reported in the `failed` array. Failed new functions are deleted; - failed updates are rolled back to their previous metadata/status where possible. - operationId: createFunctionsBatch + Changes only the production branch, leaving the repository binding + alone. PUT /projects/{id}/git-connection can also set it, but that is a + full rebind: it needs connection_id, installation_id and a repository + selector resent, and re-resolves the repository against GitHub for a + field that does not depend on it. + + The branch does not have to exist. It is validated as a Git branch name + and nothing more, so a project can be pointed at a branch that is about + to be pushed — the case a repository created empty depends on. + + Setting the branch here marks it as the project's own choice, so a later + default-branch rename on GitHub no longer moves it, and the response + reports `production_branch_follows_default: false`. Projects that never + set one keep following the repository's default branch. + + An empty string undoes that choice: the project deploys from the + repository's default branch again and follows later renames. Volcano + reads the default branch from GitHub through the project owner's + connection, and the response carries it with + `production_branch_follows_default: true`. + operationId: setProjectGitProductionBranch security: - UserToken: [] - ProjectAccessToken: [] @@ -5020,323 +5114,464 @@ paths: requestBody: required: true content: - multipart/form-data: + application/json: schema: - type: object - properties: - functions: - type: string - description: | - JSON array of functions with `name`, `runtime`, optional `handler`, and `file_field`. Each `file_field` must name a multipart file field containing that function's ZIP or tar.gz source bundle. - - Each entry may also declare `variable_scope` (`all` or `scoped`) and `variables` (an array of project variable names). Omitting them leaves the function's stored declaration unchanged. Volcano detects direct environment references in the uploaded source code and keeps them separate from the declared names: detected names are not written back to the declaration and do not appear in a config export. A scoped function receives its declared names plus the detected ones the project defines; a detected name the project does not define is ignored, since such a reference is often optional. Detection reads code only, so a name appearing solely in a comment or in an unrelated string is not a reference. Declare a name when the function reads it through a computed key, or when it must not deploy without the variable. The request is rejected with 400 before anything is deployed if a scoped function declares a variable the project does not define, or if the resulting environment exceeds 4096 bytes. - code_0: - type: string - format: binary - description: Function ZIP or tar.gz archive referenced by the first manifest entry's `file_field`; additional code_N file fields may be included. Each archive is subject to SOURCE_ARCHIVE_SIZE_LIMIT_MB. - required: - - functions + $ref: '#/components/schemas/SetProjectGitProductionBranchRequest' responses: - '202': - description: Batch deployment accepted + '200': + description: The project's repo connection, with the new branch content: application/json: schema: - $ref: '#/components/schemas/BatchFunctionDeployResponse' - '207': - description: Batch deployment partially accepted; successful functions started deployment and failed functions were compensated where possible + $ref: '#/components/schemas/ProjectGitConnection' + '400': + description: | + Malformed request body, a production_branch that is not a valid + Git branch name, or an empty one for a repository with no commits + yet. Code `feature_unavailable` means this Volcano deployment has + no GitHub integration, so an empty production_branch cannot read + the default branch. content: application/json: schema: - $ref: '#/components/schemas/BatchFunctionDeployResponse' - '400': - description: Bad request + $ref: '#/components/schemas/Error' + '401': + description: Unauthorized - invalid or missing token content: application/json: schema: $ref: '#/components/schemas/Error' '403': - description: Function limit exceeded for the project + description: Project not owned by the caller + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: | + Project not found, or it has no repository connected. The branch is + part of the connection, so there is nothing to set it on until one + exists. content: application/json: schema: $ref: '#/components/schemas/Error' '409': description: | - A name in the batch is held by a function of the other kind — a - function cannot change kind — or the project's source is managed by - Git, where deploys come from a push to the production branch. + A Git source transition is pending, or an empty production_branch + could not read the default branch because the project owner's + GitHub connection needs reconnecting or lost access to the + repository content: 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. + description: GitHub rate limited reading the default branch for an empty production_branch. Try again shortly. 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. + '500': + description: Failed to set the production branch content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/schedulers: - get: + /projects/{id}/git-connection/root-directory: + put: tags: - - Functions - summary: List every function scheduler in a project + - Projects + - Git Connections + summary: Set the directory a project builds from description: | - Project-scoped counterpart to `/projects/{id}/functions/{functionId}/schedulers`. - Returns schedulers across all functions in the project, ordered by - creation time descending, with standard page/limit pagination so - clients don't have to fan out one request per function. + Changes only the root directory, leaving the repository, the production + branch and `production_branch_follows_default` alone. Unlike PUT /projects/{id}/git-connection, this accepts a + project access token, so CI or an agent can move a project within its + repository without being able to change the repository. - Schedulers of standard and durable functions are listed together, and - each carries `function_kind`. Pass `function_kind` to list one kind - only. - operationId: listProjectSchedulers + The directory is a path relative to the repository root. An empty + string, `.` or `/` means the repository root. The response carries it in + the form a deploy reads it: `./apps/web/` comes back as `apps/web`. + operationId: setProjectGitRootDirectory 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' - - $ref: '#/components/parameters/FunctionKindFilter' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SetProjectGitRootDirectoryRequest' responses: '200': - description: Project schedulers + description: The project's repo connection, with the new root directory content: application/json: schema: - $ref: '#/components/schemas/FunctionSchedulerListResponse' + $ref: '#/components/schemas/ProjectGitConnection' '400': - description: Bad request - invalid pagination or filter + description: | + Malformed request body, or a root_directory that is absolute or + leaves the repository content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/functions/{functionId}/schedulers: + '401': + description: Unauthorized - invalid or missing token + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: Project not owned by the caller + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: | + Project not found, or it has no repository connected. The root + directory is part of the connection, so there is nothing to set it + on until one exists. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '409': + description: | + A Git source transition is pending or complete, so the recorded + root cannot be changed + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: Failed to set the root directory + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /projects/{id}/git-connection/owner-push: get: tags: - - Functions - summary: List schedulers for a function - operationId: listFunctionSchedulers + - Projects + - Git Connections + summary: Check whether the project owner can push to the connected repository + description: | + Answers whether the project owner's GitHub account can push to the + repository the project is connected to. Volcano makes the same check + before it writes to that repository for the project. The repository is + always the project's connected one; the route takes no repository. + + When `can_push` is false, `reason` says why. The answer can be a few + seconds old: repeated checks within that time are answered without + asking GitHub again. + + Checks that ask GitHub draw on an hourly budget for the project and + another for its owner, shared by all of the owner's projects. Over + either, the route answers `429` with `Retry-After`. + operationId: getProjectGitOwnerPush security: - UserToken: [] - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/FunctionId' responses: '200': - description: Function schedulers + description: Whether the project owner can push to the connected repository content: application/json: schema: - $ref: '#/components/schemas/FunctionSchedulerListResponse' - '404': - description: Function not found + $ref: '#/components/schemas/ProjectGitOwnerPush' + '401': + description: Unauthorized - invalid or missing token content: application/json: schema: $ref: '#/components/schemas/Error' - post: - tags: - - Functions - summary: Create a scheduler for a function - description: Creates regional scheduled invocation jobs. Requested regions must be a subset of the function's deployed regions. - operationId: createFunctionScheduler - security: - - UserToken: [] - - ProjectAccessToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/FunctionId' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/CreateFunctionSchedulerRequest' - responses: - '201': - description: Scheduler created + '403': + description: Project not owned by the caller content: application/json: schema: - $ref: '#/components/schemas/FunctionScheduler' - '400': + $ref: '#/components/schemas/Error' + '404': description: | - Invalid schedule, geofenced region, a scheduler of this name - already exists on the function, or the function is not active. + Project not found, or has no repo connection. Code + `feature_unavailable` when this deployment has no Git provider + integration. content: application/json: schema: $ref: '#/components/schemas/Error' - '403': + '429': description: | - Schedulers are not available on this plan, or the project already - holds as many as the plan allows. The cap counts standard and - durable function schedulers together. + The project, or its owner across their projects, used up the + hour's checks that ask GitHub. Try again after `Retry-After`. + headers: + Retry-After: + description: Seconds until the budget's hour ends. + schema: + type: integer content: application/json: schema: $ref: '#/components/schemas/Error' - '404': - description: Function not found + '500': + description: Failed to check the project owner's access content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/functions/{functionId}/schedulers/{schedulerId}: + '503': + description: | + The check could not be answered now: GitHub did not answer or is + rate limiting the owner's account, or Volcano could not read the + budget. Try again after `Retry-After`. + headers: + Retry-After: + description: Seconds to wait before checking again. + schema: + type: integer + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /projects/{id}/git-connection: get: tags: - - Functions - summary: Get a function scheduler - operationId: getFunctionScheduler + - Projects + - Git Connections + summary: Get a project's repo connection + description: | + Returns the repository binding. `production_branch_follows_default` + tells a branch that tracks the repository's default from one the + project pinned: a client rebinding the same repository sends a pinned + branch back to keep it. + operationId: getProjectGitConnection security: - UserToken: [] - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/FunctionId' - - $ref: '#/components/parameters/SchedulerId' responses: '200': - description: Function scheduler + description: The project's current repo connection content: application/json: schema: - $ref: '#/components/schemas/FunctionScheduler' + $ref: '#/components/schemas/ProjectGitConnection' + '401': + description: Unauthorized - invalid or missing token + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: Project not owned by the caller + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '404': - description: Function or scheduler not found + description: Project not found, or has no repo connection content: application/json: schema: $ref: '#/components/schemas/Error' - patch: + '500': + description: Failed to get project git connection + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + put: tags: - - Functions - summary: Update a function scheduler - operationId: updateFunctionScheduler + - Projects + - Git Connections + summary: Connect or update a project's repo connection + description: | + Full replace, following Vercel's model: many projects may point at the + same repo, so this only binds the project — it never creates or + deletes git-provider state. Used for both the initial connect and + later edits (repo change, root directory, production branch). + Resolves the repository_id or repo_full_name selector against the repos + accessible through installation_id via connection_id's stored GitHub + user token, then persists repository metadata only from that validated + GitHub response. + + Omitting production_branch follows the repository's default and + discards a pinned branch. To keep a pin when rebinding the same + repository, read the connection first and send production_branch back + when `production_branch_follows_default` is false. The response reports + the result in the same field. + + Project access tokens are refused. Which repository a project deploys + from is a person's decision, made with a platform token or in the + dashboard. A project access token can still change the root directory + and production branch through PUT + /projects/{id}/git-connection/root-directory and PUT + /projects/{id}/git-connection/production-branch. + + Connecting a repository to a project with none, while LavaFlow is on + and was turned on with no repository, makes it the one LavaFlow works + in, unless the LavaFlow settings' `fix_blocker` asks to turn it on + again after the link. Any later change of repository pauses LavaFlow until the owner + turns it on again; binding the repository LavaFlow works in again + resumes it with no new turn-on. + operationId: connectProjectGit security: - UserToken: [] - - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/FunctionId' - - $ref: '#/components/parameters/SchedulerId' requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/UpdateFunctionSchedulerRequest' + $ref: '#/components/schemas/ConnectProjectGitRequest' responses: '200': - description: Scheduler updated + description: The project's repo connection content: application/json: schema: - $ref: '#/components/schemas/FunctionScheduler' + $ref: '#/components/schemas/ProjectGitConnection' '400': description: | - Invalid schedule, geofenced region, or a scheduler of this name - already exists on the function. + Malformed request body, no repository selector, selectors that + identify different repositories, a production_branch that is not a + valid Git branch name, no production_branch on a repository with no + default branch to follow (name one to connect a repository that has + no commits yet), or a production_branch other than the new + repository's default in a request that also changes repository + (a repository that reports no default branch accepts any branch), + or a root_directory that is absolute or leaves the repository. + 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: | + Project not owned by the caller, the selected repository is not + accessible through installation_id, or the request used a project + access token or came through MCP. A full-scope token, and MCP, get + `project access tokens cannot change a project's repository; a + person changes it in the dashboard or with a platform token`, and a + read-only token gets `project access token is read-only`. content: application/json: schema: $ref: '#/components/schemas/Error' '404': - description: Function or scheduler not found + description: Project or connection not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '409': + description: | + A Git source transition is pending or complete, so the recorded + repository and root cannot be changed + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: Failed to connect project git + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '503': + description: Git provider integration is not configured content: application/json: schema: $ref: '#/components/schemas/Error' delete: tags: - - Functions - summary: Delete a function scheduler - operationId: deleteFunctionScheduler + - Projects + - Git Connections + summary: Disconnect a project's repo connection + operationId: disconnectProjectGit security: - UserToken: [] - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/FunctionId' - - $ref: '#/components/parameters/SchedulerId' responses: '204': - description: Scheduler deleted - '404': - description: Function or scheduler not found - content: - application/json: + description: Connection removed + '401': + description: Unauthorized - invalid or missing token + content: + application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/functions/{functionId}/deployments: - get: - tags: - - Functions - summary: List function deployments - operationId: listFunctionDeployments - security: - - UserToken: [] - - ProjectAccessToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/FunctionId' - - $ref: '#/components/parameters/Page' - - $ref: '#/components/parameters/Limit' - responses: - '200': - description: Successful response + '403': + description: Project not owned by the caller content: application/json: schema: - $ref: '#/components/schemas/PaginatedFunctionDeployments' + $ref: '#/components/schemas/Error' '404': - description: Function not found + description: Project not found, or has no repo connection content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/durable-functions: + '409': + description: | + A Git source transition is pending or complete, so the recorded + repository cannot be disconnected + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: Failed to disconnect project git + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /projects/{id}/git-deploy-settings: get: tags: - - Durable Functions - summary: List all durable functions in a project - description: | - Standard functions never appear here, and durable functions never appear - under `/projects/{id}/functions`. The two are separate collections. - operationId: listDurableFunctions + - Projects + - Git Connections + summary: Get a project's Git auto-deploy settings + operationId: getProjectGitDeploySettings security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/Page' - - $ref: '#/components/parameters/Limit' - - $ref: '#/components/parameters/Search' responses: '200': - description: Successful response + description: The project's current Git auto-deploy settings content: application/json: schema: - $ref: '#/components/schemas/PaginatedDurableFunctions' - '400': - description: Bad request - invalid pagination parameters + $ref: '#/components/schemas/ProjectGitDeploySettings' + '401': + description: Unauthorized - invalid or missing token + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: Project not owned by the caller content: application/json: schema: @@ -5347,1689 +5582,1910 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - post: + '500': + description: Failed to get project git deploy settings + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + put: tags: - - Durable Functions - summary: Create or update a durable function + - Projects + - Git Connections + summary: Update a project's Git auto-deploy settings description: | - Upload a durable function source bundle. Creates the function on the - first call for a name and redeploys it on every call after that, the - same create-or-update contract `POST /projects/{id}/functions` has. + Full replace of the project's Git auto-deploy settings: what a push to + the connected repo's production branch deploys. - Volcano builds and deploys asynchronously. A deployment that starts - immediately returns `status: provisioning`, then transitions to `active` - or `failed`; a deployment that has to wait for a running one is exposed - through `pending_deployment_id`. Existing executions keep running - against the runtime they started on. + Connecting a repository sets auto_deploy_enabled and deploy_functions + to true for a project that has never called this endpoint, so a push + deploys without any further setup. Once these settings have been saved + here they are the project's own: connecting, rebinding, disconnecting + and reconnecting all leave them untouched, including when they were + saved before any repository was connected. Frontend settings are off + until set here; the frontend need not exist when they are saved, since + frontend_name is resolved at deploy time. - The `durable` configuration is derived from the project's plan rather - than supplied here, and is fixed once the function exists. A name - already held by a standard function is rejected with 409: a function - cannot change kind. - operationId: createDurableFunction + apply_migrations and skip_unchanged are the exceptions to the full + replace: omitting either leaves its saved value unchanged. + apply_migrations is off until set here; skip_unchanged is on. + operationId: updateProjectGitDeploySettings security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' requestBody: required: true content: - multipart/form-data: + application/json: schema: - type: object - required: - - name - - code - - runtime - properties: - name: - type: string - description: DNS-safe function name (lowercase letters, numbers, hyphens; cannot start or end with hyphen) - maxLength: 63 - pattern: ^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$ - example: order-pipeline - code: - type: string - format: binary - description: ZIP or tar.gz archive containing function source code plus dependency manifests/lockfiles. - runtime: - type: string - enum: - - nodejs22.x - - nodejs24.x - - python3.13 - - python3.14 - description: | - Runtime environment. Required. Durable execution needs the - durable authoring API, which ships for these runtimes only; - any other runtime is rejected with 400 and the response - names the ones that work. Note that a durable Python - function needs a newer runtime than a standard one defaults - to. `GET /functions/runtimes` reports `durable_capable` per - runtime. - example: nodejs24.x - handler: - type: string - description: The name of the function to invoke. Defaults to "handler" if not specified. - default: handler - example: handler - visibility: - allOf: - - $ref: '#/components/schemas/FunctionVisibility' - description: | - Who may start an execution. Redeploying is the only way to - change it, since the collection has no update endpoint; omit - it to keep the current visibility, and a new function starts - `private`. - - The standard collection's synchronous invocation fields — - `invocation_mode`, `http_auth_mode`, `openapi_spec` — - configure a request path no durable route serves, and are - rejected with 400 rather than ignored. - is_public: - type: boolean - deprecated: true - description: | - Deprecated alias for `visibility`: `true` means `public` and - `false` means `authenticated`. Sending both with different - meanings returns 400. - variable_scope: - type: string - 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: - type: string - description: | - JSON-encoded array of project variable names this function requires, on top of the ones detected in its source. A declared name the project does not define is rejected with 400; a detected name it does not define is ignored. Only used when `variable_scope` is `scoped`. Omitting this leaves an existing function's declared names unchanged. + $ref: '#/components/schemas/UpdateProjectGitDeploySettingsRequest' responses: '200': - description: Existing durable function updated; its deployment was started or queued + description: The project's updated Git auto-deploy settings content: application/json: schema: - $ref: '#/components/schemas/DurableFunction' - '201': - description: Durable function created and deployment workflow started + $ref: '#/components/schemas/ProjectGitDeploySettings' + '400': + description: | + Malformed request body, frontend_app_root without frontend_name, or + apply_migrations set to true where database migrations are not + available (code `feature_unavailable`) content: application/json: schema: - $ref: '#/components/schemas/DurableFunction' - '400': - description: | - Bad request (invalid archive, unsupported runtime, invalid name, an - unknown `visibility`, `visibility` and `is_public` disagree, or a - project region that does not offer durable execution — a durable - function deploys to every region of its project) + $ref: '#/components/schemas/Error' + '401': + description: Unauthorized - invalid or missing token content: application/json: schema: $ref: '#/components/schemas/Error' '403': - description: Durable function limit exceeded for the project + description: Project not owned by the caller content: application/json: schema: $ref: '#/components/schemas/Error' - '409': - description: | - Name is held by a standard function, or a deletion is queued or - running. The request is refused before the deploy starts, so - nothing is deployed. + '404': + description: Project not found content: application/json: schema: $ref: '#/components/schemas/Error' - '500': - description: Internal server error (function deployment failed) + '409': + description: | + A Git source transition is pending, or this change would remove + deploy coverage after Git has taken over content: application/json: schema: $ref: '#/components/schemas/Error' - '503': - description: | - Durable deploys are paused platform-wide. The same request succeeds - once they are re-enabled; executions already running are unaffected. + '500': + description: Failed to update project git deploy settings content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/durable-functions/{functionId}: + /projects/{id}/git-deployment-runs: get: tags: - - Durable Functions - summary: Get durable function by ID or name - operationId: getDurableFunction + - Projects + - Git Connections + summary: List a project's Git deployment runs + description: | + Lists the deployment runs Git auto deploy recorded for the project, + newest push first. Each push to the production branch records one run, + as does each `POST /projects/{id}/git-deployment-runs`, and each says + whether the commit deployed and, when it failed or was skipped, why. + + A run that applied migrations names the migration run it started on + each database. Get one at + `GET /projects/{id}/databases/{databaseName}/migration-runs/{runId}` + for its files. + + Project access tokens can list runs, including read-only ones. + operationId: listGitDeploymentRuns security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/DurableFunctionId' + - $ref: '#/components/parameters/Limit' + - $ref: '#/components/parameters/IssueCursor' + - name: status + in: query + required: false + description: Return only runs in this status. + schema: + $ref: '#/components/schemas/GitDeploymentRunStatus' + - name: branch + in: query + required: false + description: Return only runs for pushes to this branch. + schema: + type: string + minLength: 1 + maxLength: 255 responses: '200': description: Successful response content: application/json: schema: - $ref: '#/components/schemas/DurableFunction' - '404': - description: Durable function not found + $ref: '#/components/schemas/PaginatedGitDeploymentRuns' + '400': + description: A filter or the cursor is invalid content: application/json: schema: $ref: '#/components/schemas/Error' - delete: - tags: - - Durable Functions - summary: Delete a durable function - description: | - 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. - operationId: deleteDurableFunction - security: - - UserToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/DurableFunctionId' - responses: - '202': - description: Deletion accepted and teardown started - '404': - description: | - Durable function not found. Also returned for an id that names a - durable function in another project, so the response cannot be used - to tell the two apart. + '401': + description: Unauthorized - invalid or missing token content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/durable-functions/{functionId}/deployments: - get: - tags: - - Durable Functions - summary: List durable function deployments - operationId: listDurableFunctionDeployments - security: - - UserToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/DurableFunctionId' - - $ref: '#/components/parameters/Page' - - $ref: '#/components/parameters/Limit' - responses: - '200': - description: Successful response - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedFunctionDeployments' - '404': - description: Durable function not found + '403': + description: Project not owned by the caller content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/durable-functions/{functionId}/schedulers: - get: - tags: - - Durable Functions - summary: List schedulers for a durable function - description: | - The durable collection's counterpart to - `/projects/{id}/functions/{functionId}/schedulers`. A standard - function's id is not accepted here, and a durable function's id is not - accepted there. - operationId: listDurableFunctionSchedulers - security: - - UserToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/DurableFunctionId' - responses: - '200': - description: Durable function schedulers - content: - application/json: - schema: - $ref: '#/components/schemas/FunctionSchedulerListResponse' '404': - description: Durable function not found + description: Project not found content: application/json: schema: $ref: '#/components/schemas/Error' post: tags: - - Durable Functions - summary: Create a scheduler for a durable function + - Projects + - Git Connections + summary: Deploy the production branch now description: | - Each tick starts an execution rather than invoking the function, under - an execution name derived from the run, so a retried tick resolves to - the execution it already started. Requested regions must be a subset of - the function's deployed regions. + Queues a deployment run of the current head of the project's + production branch, exactly as a push of that commit would: the run + snapshots the project's Git deploy settings, supersedes a queued older + run, and is deployed by the same worker. Volcano reads the head + through the project owner's GitHub connection. - A tick draws on the same durable allowances and concurrency cap a - manual start does, and a tick that would exceed the cap fails that run. - operationId: createDurableFunctionScheduler + The run is queued even when `auto_deploy_enabled` is off: that setting + decides whether a push deploys on its own, and this is an explicit + request. + + `force: true` deploys every configured function and frontend, even one + the `skip_unchanged` setting would leave on its current deployment; the + returned run then reports `skip_unchanged: false`. + + Each request reads GitHub with the project owner's token and counts + against the owner-token budget described under `429`. + + Safe to retry. While a run for the same commit is queued or running, + the request queues nothing and returns that run, as a redelivered push + would. A forced request is refused with `git_deployment_run_in_progress` + instead when that run skips unchanged resources; retry once it ends. + operationId: createGitDeploymentRun security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/DurableFunctionId' requestBody: - required: true + required: false content: application/json: schema: - $ref: '#/components/schemas/CreateFunctionSchedulerRequest' + $ref: '#/components/schemas/CreateGitDeploymentRunRequest' responses: - '201': - description: Scheduler created + '202': + description: The queued run, or the queued or running run for the same commit content: application/json: schema: - $ref: '#/components/schemas/FunctionScheduler' + $ref: '#/components/schemas/GitDeploymentRun' '400': description: | - Invalid schedule, geofenced region, a scheduler of this name - already exists on the function, or the function is not active. + Malformed request body. Code `feature_unavailable` means this + Volcano deployment does not deploy from Git. content: application/json: schema: $ref: '#/components/schemas/Error' - '403': - description: | - Schedulers are not available on this plan, or the project already - holds as many as the plan allows. The cap counts standard and - durable function schedulers together. + '401': + description: Unauthorized - invalid or missing token content: application/json: schema: $ref: '#/components/schemas/Error' - '404': - description: Durable function not found + '403': + description: | + Project not owned by the caller, or a read-only project access + token. Code `git_repository_access_lost` means the project owner's + GitHub connection or the Volcano GitHub App installation no longer + reaches the connected repository; reconnect it or grant access, + then retry. content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/durable-functions/{functionId}/schedulers/{schedulerId}: - get: - tags: - - Durable Functions - summary: Get a durable function scheduler - operationId: getDurableFunctionScheduler - security: - - UserToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/DurableFunctionId' - - $ref: '#/components/parameters/SchedulerId' - responses: - '200': - description: Durable function scheduler - content: - application/json: - schema: - $ref: '#/components/schemas/FunctionScheduler' '404': - description: Durable function or scheduler not found + description: | + Project not found. Code `git_connection_not_found` means the + project has no repository connected. content: application/json: schema: $ref: '#/components/schemas/Error' - patch: - tags: - - Durable Functions - summary: Update a durable function scheduler - operationId: updateDurableFunctionScheduler - security: - - UserToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/DurableFunctionId' - - $ref: '#/components/parameters/SchedulerId' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateFunctionSchedulerRequest' - responses: - '200': - description: Scheduler updated + '409': + description: | + Code `git_reconnect_required`: the project owner's GitHub + connection is missing or expired, and the owner must reconnect + GitHub. Code `git_deployment_run_in_progress`: a forced request + met a queued or running run for the same commit that skips + unchanged resources. Code `git_connection_changed`: the repository + binding changed while the run was being queued; retry. content: application/json: schema: - $ref: '#/components/schemas/FunctionScheduler' - '400': + $ref: '#/components/schemas/Error' + '422': description: | - Invalid schedule, geofenced region, or a scheduler of this name - already exists on the function. + Code `git_branch_not_found`: the production branch does not exist + in the repository, or the repository has no commits. content: application/json: schema: $ref: '#/components/schemas/Error' - '404': - description: Durable function or scheduler not found + '429': + description: | + Code `git_rate_limited`. Reading the branch head spends the project + owner's GitHub rate limit, so these requests share the hourly budget + of `GET /projects/{id}/git-connection/owner-push`: 120 per project + and 600 per owner across their projects. Over it, the request is + refused before GitHub is asked. GitHub's own rate limit answers the + same way. Try again after `Retry-After`. + headers: + Retry-After: + description: Seconds until the budget's hour ends, or GitHub's limit resets. + schema: + type: integer content: application/json: schema: $ref: '#/components/schemas/Error' - delete: - tags: - - Durable Functions - summary: Delete a durable function scheduler - operationId: deleteDurableFunctionScheduler - security: - - UserToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/DurableFunctionId' - - $ref: '#/components/parameters/SchedulerId' - responses: - '204': - description: Scheduler deleted - '404': - description: Durable function or scheduler not found + '503': + description: | + The budget could not be read, so GitHub was not asked. Try again + after `Retry-After`. + headers: + Retry-After: + description: Seconds to wait before trying again. + schema: + type: integer content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/durable-functions/{functionId}/executions: - post: + /projects/{id}/git-deployment-runs/{runId}: + get: tags: - - Durable Functions - summary: Start a durable execution + - Projects + - Git Connections + summary: Get a Git deployment run description: | - Starts an execution and returns its handle. Never returns a result: an - execution can outlive any request a client could hold open, so the - result is read back from - `GET /projects/{id}/durable-functions/{functionId}/executions/{executionId}`. - - The request body is the execution's input and must be valid JSON if - present. An empty body starts the execution with no input. - - Send `X-Volcano-Execution-Name` to make the start idempotent: repeating a - start with the same name returns the existing execution instead of - beginning a second one. + Returns one deployment run: the commit it deployed, its status, the + migration runs it started, and why it failed or was skipped. - Each execution counts against the project's durable execution - allowance, the operations it performs count against the durable - operations allowance when it finishes, and the number of executions in - flight at once is capped by the plan. - operationId: startDurableExecution + Project access tokens can read runs, including read-only ones. + operationId: getGitDeploymentRun security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/DurableFunctionId' - - name: X-Volcano-Execution-Name - in: header - required: false - description: | - Idempotency key for this execution. Generated when omitted. A repeat - under a name that already names a running execution returns that - execution and is not charged again. - - Letters, digits, `-`, `_` and `.`, up to 255 characters. Anything - else is rejected with `400`. + - name: runId + in: path + required: true + description: Deployment run ID schema: type: string - maxLength: 255 - pattern: ^[A-Za-z0-9._-]+$ - requestBody: - required: false - content: - application/json: - schema: - description: Input passed to the function, up to 256 KiB. + format: uuid responses: - '202': - description: Execution accepted and started + '200': + description: Successful response content: application/json: schema: - $ref: '#/components/schemas/DurableExecution' - '400': - description: Payload is not valid JSON, or the execution name is invalid + $ref: '#/components/schemas/GitDeploymentRun' + '401': + description: Unauthorized - invalid or missing token content: application/json: schema: $ref: '#/components/schemas/Error' - '404': - description: Durable function not found + '403': + description: Project not owned by the caller content: application/json: schema: $ref: '#/components/schemas/Error' - '409': - description: | - Function is not deployed yet, or has no deployed region. Also - returned when two starts under the same execution name raced and - both released it, which is retryable as it stands. + '404': + description: Project or run not found content: application/json: schema: $ref: '#/components/schemas/Error' - '413': - description: Payload exceeds the maximum execution input size + /projects/{id}/databases/{databaseName}/queries: + get: + tags: + - Databases + summary: Get database queries + description: | + Returns the database's current top queries from pg_stat_statements + ranked by total execution time. Only data statements (SELECT, INSERT, + UPDATE, DELETE, MERGE) are listed; statements Volcano runs to operate + the database are left out. + + **SUPERAGENT plan required.** This endpoint is only available to projects owned + by users on the SUPERAGENT billing plan. + operationId: getProjectDatabaseQueries + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/DatabaseName' + - name: limit + in: query + description: Maximum number of queries to return. + schema: + type: integer + minimum: 1 + maximum: 100 + default: 10 + responses: + '200': + description: Database query performance retrieved + content: + application/json: + schema: + $ref: '#/components/schemas/DatabaseQueryPerformanceResponse' + '400': + description: Bad request - invalid query parameters content: application/json: schema: $ref: '#/components/schemas/Error' - '429': - description: | - Too many executions already in flight for this project, or the - account is out of one of its billing-cycle durable allowances: - executions, operations, or compute. An owner-started execution is - metered exactly like an application-started one. + '401': + description: Unauthorized - invalid or missing token content: application/json: schema: $ref: '#/components/schemas/Error' - '503': - description: | - Durable execution is not available in this environment, or the - plan terms for the start could not be read. The 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. + '403': + description: Access denied + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Project or database not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: Internal server error content: application/json: schema: $ref: '#/components/schemas/Error' + /deployments: get: tags: - - Durable Functions - summary: List a durable function's executions + - Projects + summary: List deployments across a user's projects description: | - Returns the platform's last observed status for each execution; listing - does not poll each one. Fetch a single execution for its live state. - operationId: listDurableExecutions + Lists Function and Frontend deployment attempts across every project the + user owns, newest first. Pass `project_id` to narrow the feed to a single + project. + + Scope is project **ownership** (`projects.user_id`). `owner_id` names + whose deployments to return, not who started them — the actor is + `initiated_by_user_id`, which this endpoint does not filter on. + + With a user token the scope is always the authenticated user: `owner_id` + may be omitted, or set to that same user, but naming anyone else is + refused with 403. Service callers on the management API must pass it, + since they have no authenticated user. + + The owner is not checked for existence: an id with no projects returns an + empty page rather than `404`. Unlike `/users/{id}/usage`, this endpoint is + polled to detect an event, so a caller needs `404` to keep meaning "this + route is not served here" — which is how a consumer notices it is running + against an older release. A mistyped owner therefore reads as "nothing + deployed"; callers that need to tell those apart should verify the user + through `GET /users/{id}` first. + + Ordering is selectable. The default is the feed order — most recent + attempt first. `completed_at.asc` orders by completion, oldest first, and + considers only attempts that finished; combined with `limit=1` and a + `status` filter it answers "when did this user first succeed" in one + bounded query. + + Both pagination modes are supported, selected exactly as + `/projects/{id}/deployments` selects them: `cursor`/`ending_before` (or a + `limit` with no `page`) uses keyset pagination; otherwise `page`/`limit` + offset pagination. `page` with a cursor, and `cursor` with + `ending_before`, are rejected. + + A cursor is bound to every filter *and* to `order`, so changing any of + them mid-pagination rejects the cursor rather than silently skipping or + repeating rows. The keyset position is `(created_at, id)` for + `created_at.desc` and `(completed_at, id)` for `completed_at.asc`. + operationId: listDeployments security: - UserToken: [] parameters: - - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/DurableFunctionId' - $ref: '#/components/parameters/Page' - $ref: '#/components/parameters/Limit' - - name: status + - $ref: '#/components/parameters/Cursor' + - $ref: '#/components/parameters/EndingBefore' + - $ref: '#/components/parameters/Offset' + - $ref: '#/components/parameters/DeploymentOwnerId' + - name: project_id in: query required: false - description: Return only executions in this status. + description: Restrict the feed to a single project owned by the user. schema: - $ref: '#/components/schemas/DurableExecutionStatus' + type: string + format: uuid + - name: created_after + in: query + required: false + description: Restrict results to attempts created at or after this timestamp. + schema: + type: string + format: date-time + - $ref: '#/components/parameters/DeploymentResourceType' + - $ref: '#/components/parameters/DeploymentStatus' + - $ref: '#/components/parameters/DeploymentOperation' + - $ref: '#/components/parameters/DeploymentOrder' responses: '200': description: Successful response content: application/json: schema: - $ref: '#/components/schemas/PaginatedDurableExecutions' + $ref: '#/components/schemas/PaginatedProjectDeployments' '400': - description: Unsupported status filter + description: Bad request - invalid filter or pagination content: application/json: schema: $ref: '#/components/schemas/Error' - '404': - description: Durable function not found + '401': + description: Unauthorized - invalid or missing token content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/durable-functions/{functionId}/executions/{executionId}: - get: - tags: - - Durable Functions - summary: Get a durable execution - description: | - Returns the execution's current state, including its `result` once it has - succeeded. Poll this to wait for an execution to finish. - operationId: getDurableExecution - security: - - UserToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/DurableFunctionId' - - $ref: '#/components/parameters/DurableExecutionId' - responses: - '200': - description: Successful response - content: - application/json: - schema: - $ref: '#/components/schemas/DurableExecution' - '404': - description: Durable function or execution not found + '403': + description: Forbidden - owner_id names a different user content: application/json: schema: $ref: '#/components/schemas/Error' - '503': - description: | - 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. + '500': + description: Internal server error content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/durable-functions/{functionId}/executions/{executionId}/operations: + /projects/{id}/deployments: get: tags: - - Durable Functions - summary: List a durable execution's operations + - Projects + summary: List deployments in a project description: | - Returns the execution's trace: every operation it began — each step, - wait, poll, child context, map item and parallel branch — with when it - started and ended, how it ended, and each attempt of a retried step. - `invocations` are the windows the function's code was actually running; - the gaps between them are time the execution spent suspended, which is - not charged. - - A finished execution's trace is final and `complete` is `true`. A - running one is refreshed when it is read, and can be up to about ten - seconds behind; `synced_at` says when it was last refreshed. Inputs, - results and other payloads are never included. + Lists Function and Frontend deployment attempts across the project, + ordered most-recent first. Each item includes a normalized resource + reference so clients can render both resource types without extra + fetches. - The list is not paginated: an execution is limited to 3,000 - operations, and a trace is read whole. - operationId: listDurableExecutionOperations + Standard and durable function deployments both appear under + `resource.type: function`, and `resource.kind` tells them apart. Pass + `function_kind` to list one kind only; frontends are then excluded. + Combining `function_kind` with `resource_type=frontend` is rejected. + operationId: listProjectDeployments security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/DurableFunctionId' - - $ref: '#/components/parameters/DurableExecutionId' + - $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: created_after + in: query + required: false + description: Restrict results to attempts created at or after this timestamp. + schema: + type: string + format: date-time + - name: resource_type + in: query + required: false + description: | + Restrict the feed to a single resource type. Omit to return both + Function and Frontend deployments. + schema: + type: string + enum: + - function + - frontend + - $ref: '#/components/parameters/FunctionKindFilter' responses: '200': description: Successful response content: application/json: schema: - $ref: '#/components/schemas/DurableExecutionOperationList' - '404': - description: Durable function or execution not found + $ref: '#/components/schemas/PaginatedProjectDeployments' + '400': + description: Bad request - invalid identifier or filter, or `function_kind` combined with `resource_type=frontend` content: application/json: schema: $ref: '#/components/schemas/Error' - '500': - description: The trace could not be read + '401': + description: Unauthorized - invalid or missing token content: application/json: schema: $ref: '#/components/schemas/Error' - '503': - description: | - 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. + '403': + description: Forbidden - project ownership required content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/durable-functions/{functionId}/executions/{executionId}/stop: - post: - tags: - - Durable Functions - summary: Stop a durable execution - description: | - Cancels a running execution. Its completed steps are not undone. - - The call is accepted rather than awaited: cancellation happens behind - it, so the response reports the execution as it was read back and may - still say `running`. Do not branch on that status — the execution - settles into `stopped` shortly after, and polling - `GET /projects/{id}/durable-functions/{functionId}/executions/{executionId}` - is how you see it get there. - - Stopping an execution that already finished is not an error: the - response carries the state it settled in. - operationId: stopDurableExecution - security: - - UserToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/DurableFunctionId' - - $ref: '#/components/parameters/DurableExecutionId' - responses: - '200': - description: | - Stop accepted. The body is the execution as it was read back, which - may still report `running`. - content: - application/json: - schema: - $ref: '#/components/schemas/DurableExecution' - '404': - description: Durable function or execution not found - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '409': - description: Execution has not started yet - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '503': - description: | - 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. + '500': + description: Internal server error content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/durable-functions/{functionId}/executions/{executionId}/messages: - post: + /projects/{id}/deployments/summary: + get: tags: - - Durable Functions - summary: Send a message to a durable execution + - Projects + summary: Summarize deployments in a project description: | - Sends a named message to a running execution, as - `POST /durable-functions/{functionId}/executions/{executionId}/messages` - does for an application. The workflow receives it from - `ctx.waitForMessage` with the same name; until then it is kept, and - waits take messages oldest first. + Summarizes deployment attempts for one comparable resource pipeline. + Success rate uses conclusive outcomes only: active and deleted attempts + are successful; failed and degraded attempts are failures; in-progress + and superseded attempts are excluded. Median build duration includes + completed, non-superseded attempts with recorded build work, + including failed builds. - Project access tokens can send messages, but read-only ones cannot. - A message never decides an approval. - operationId: sendDurableMessage + With `resource_type=function`, pass `function_kind` to summarize one + kind of function only. It is rejected with `resource_type=frontend`. + operationId: summarizeProjectDeployments security: - UserToken: [] - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/DurableFunctionId' - - $ref: '#/components/parameters/DurableExecutionId' - - $ref: '#/components/parameters/DurableMessageIdempotencyKey' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/SendDurableMessageRequest' + - name: search + in: query + required: false + description: Restrict the summary to resource names containing this value. + schema: + type: string + - name: resource_type + in: query + required: true + description: Restrict the summary to one comparable deployment pipeline. + schema: + type: string + enum: + - function + - frontend + - $ref: '#/components/parameters/FunctionKindFilter' + - name: created_after + in: query + required: false + description: Restrict results to attempts created at or after this timestamp. + schema: + type: string + format: date-time responses: '200': - description: A message with this `Idempotency-Key` was already sent; it is returned - content: - application/json: - schema: - $ref: '#/components/schemas/DurableMessage' - '201': - description: | - Message sent. `status` is `delivered`, `delivering`, or `queued`, - as on the application route. + description: Successful response content: application/json: schema: - $ref: '#/components/schemas/DurableMessage' + $ref: '#/components/schemas/ProjectDeploymentSummary' '400': - description: The name, data or idempotency key is invalid - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '403': - description: The request used a `read_only` project access token - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '404': - description: Durable function or execution not found + description: Bad request - invalid identifier or filter, or `function_kind` combined with `resource_type=frontend` content: application/json: schema: $ref: '#/components/schemas/Error' - '409': - description: | - The message cannot be sent. `code` is `execution_not_running` or - `too_many_queued_messages`. + '401': + description: Unauthorized - invalid or missing token content: application/json: schema: $ref: '#/components/schemas/Error' - '413': - description: The request body is larger than 72 KiB + '403': + description: Forbidden - project ownership required content: application/json: schema: $ref: '#/components/schemas/Error' - '429': - description: Too many messages sent to this execution + '500': + description: Internal server error content: application/json: schema: $ref: '#/components/schemas/Error' + /projects/{id}/domains: get: tags: - - Durable Functions - summary: List a durable execution's messages + - Frontends + summary: List all custom domains in a project description: | - Lists the messages sent to and published by an execution, oldest - first. Pass the last `seq` you read as `after` to read only what came - next. - - Project access tokens can list messages, including read-only ones. - operationId: listDurableMessages + Project-scoped custom-domain list. Returns every active custom + domain across every frontend in the project (excludes soft-deleted + rows). Each item inlines the linked frontend's id and name so the + UI does not need a second fetch to render the "Linked to" column. + operationId: listProjectCustomDomains security: - UserToken: [] - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/DurableFunctionId' - - $ref: '#/components/parameters/DurableExecutionId' - - $ref: '#/components/parameters/DurableMessageDirectionFilter' - - $ref: '#/components/parameters/DurableMessageNameFilter' - - $ref: '#/components/parameters/DurableMessageAfter' - - $ref: '#/components/parameters/DurableMessageLimit' + - $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: Successful response content: application/json: schema: - $ref: '#/components/schemas/DurableMessageList' + $ref: '#/components/schemas/PaginatedProjectCustomDomains' '400': - description: A filter is invalid + description: Bad request - invalid identifier content: application/json: schema: $ref: '#/components/schemas/Error' - '404': - description: Durable function or execution not found + '401': + description: Unauthorized - invalid or missing token content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/durable-functions/{functionId}/executions/{executionId}/message-waits: + '403': + description: Forbidden - project ownership required + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: Internal server error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /projects/{id}/functions: get: tags: - - Durable Functions - summary: List a durable execution's open message waits + - Functions + summary: List all functions in a project description: | - Lists the waits an execution has open in `ctx.waitForMessage`, oldest - first, so you can see which message names it is waiting for. - - Project access tokens can list waits, including read-only ones. - operationId: listDurableMessageWaits + Supports two mutually exclusive pagination modes. Offset mode uses `page` + and `limit` and returns `next` (URL). Cursor mode uses `cursor` and + `limit`, supports `search` (case-insensitive name match), and returns + `next_cursor`/`prev_cursor`. Sending both `page` and `cursor` (or `page` + and `search`) returns 400. + operationId: listFunctions security: - UserToken: [] - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/DurableFunctionId' - - $ref: '#/components/parameters/DurableExecutionId' + - $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: Successful response content: application/json: schema: - $ref: '#/components/schemas/DurableMessageWaitList' + $ref: '#/components/schemas/PaginatedFunctions' '404': - description: Durable function or execution not found + description: Project not found content: application/json: schema: $ref: '#/components/schemas/Error' - /durable-messages/waits: post: tags: - - Durable Functions - summary: Wait for a message from inside a workflow + - Functions + summary: Create or update function code description: | - Registers a wait for a named message. The Volcano SDK calls this from - `ctx.waitForMessage`; applications do not call it directly. - - `execution_ref` and `callback_id` are opaque values the SDK reads from - the running workflow. Together they are the request's credential, so - the operation takes no other authentication. When a message for the - name is already queued, the wait takes the oldest one at once. - - Retrying is safe: a request for a wait that is already registered - returns it with `200`. - operationId: registerDurableMessageWait - security: [] - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/RegisterDurableMessageWaitRequest' - responses: - '200': - description: The wait was already registered - content: - application/json: - schema: - $ref: '#/components/schemas/DurableMessageWaitRegistration' - '201': - description: Wait registered - content: - application/json: - schema: - $ref: '#/components/schemas/DurableMessageWaitRegistration' + Upload a function source bundle. Direct API clients may send the function code + as a ZIP or tar.gz archive via multipart/form-data. The API stores a normalized tar.gz + source archive. + Cloud deploys should include source files and dependency manifests/lockfiles, not installed + dependency directories. Volcano installs Node.js, Python, and Ruby dependencies during the + function compile build. + Source archive size is enforced by the API with `SOURCE_ARCHIVE_SIZE_LIMIT_MB`; the CLI + does not apply its own source archive size limit. After the final container image is + built, the publish build enforces `LAMBDA_TARGET_CONTAINER_SIZE_LIMIT_MB` before pushing. + Uploaded source archives cannot contain symlink entries. Safe symlinks created during + the cloud build are materialized before publish. + Volcano builds and deploys the function asynchronously after upload. A deployment that starts + immediately returns a Function resource with `status: provisioning`, then transitions to + `active` or `failed`. If another deployment is running, the response preserves the resource's + current status and exposes the queued deployment through `pending_deployment_id`. + Existing function traffic continues to use the last known-good runtime during an update. A failed + update keeps that runtime available and records the attempted deployment as failed. + Only one deployment runs for a given function. A newer request supersedes any queued request + and starts after the running deployment. Different functions and projects deploy concurrently. + If a function with the same name already exists in the project, this operation updates that + function's runtime, handler, and source bundle and returns `200 OK`. + Each project can contain up to 10,000 functions. Creating a new function over this cap returns 403. + operationId: createFunction + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + requestBody: + required: true + content: + multipart/form-data: + schema: + type: object + required: + - name + - code + - runtime + properties: + name: + type: string + description: DNS-safe function name (lowercase letters, numbers, hyphens; cannot start or end with hyphen) + maxLength: 63 + pattern: ^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$ + example: my-api-function + code: + type: string + format: binary + description: ZIP or tar.gz archive containing function source code plus dependency manifests/lockfiles. The API enforces SOURCE_ARCHIVE_SIZE_LIMIT_MB and stores a normalized tar.gz source archive. + runtime: + type: string + enum: + - nodejs22.x + - nodejs24.x + - nodejs26.x + - python3.10 + - python3.11 + - python3.12 + - python3.13 + - python3.14 + - python3.15 + - ruby3.3 + - ruby3.4 + - ruby4.0 + description: | + Runtime environment. Required. + - Node.js: nodejs22.x, nodejs24.x, nodejs26.x + - Python: python3.10, python3.11, python3.12, python3.13, python3.14, python3.15 + - Ruby: ruby3.3, ruby3.4, ruby4.0 + + python3.10 is deprecated: it still deploys, and Volcano will remove it before 2027-08-31. + example: nodejs24.x + handler: + type: string + description: | + The name of the function to invoke. Defaults to "handler" if not specified. + Your code must export/define a function with this name: + - Node.js: exports.handler (in index.js, index.mjs or index.cjs, or in TypeScript in index.ts, index.mts, index.cts or index.tsx, which the build compiles without type-checking) + - Python: def handler() (in main.py) + - Ruby: def handler() (in main.rb) + default: handler + example: handler + visibility: + allOf: + - $ref: '#/components/schemas/FunctionVisibility' + description: | + Who can invoke the function. Omit it to keep the function's + current visibility; a new function starts `private`. + is_public: + type: boolean + deprecated: true + description: | + Deprecated alias for `visibility`: `true` means `public` and + `false` means `authenticated`. Sending both with different + meanings returns 400. + invocation_mode: + $ref: '#/components/schemas/FunctionInvocationMode' + http_auth_mode: + $ref: '#/components/schemas/FunctionHTTPAuthMode' + openapi_spec: + type: string + description: JSON-encoded OpenAPI 3.0 or 3.1 metadata for an HTTP-mode function. + variable_scope: + type: string + 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: + type: string + description: | + JSON-encoded array of project variable names this function requires, on top of the ones detected in its source. A declared name the project does not define is rejected with 400; a detected name it does not define is ignored. Only used when `variable_scope` is `scoped`. Omitting this leaves an existing function's declared names unchanged. + commit: + type: string + description: | + JSON-encoded commit the uploaded source came from: `{"repository": "acme/app", "sha": "<40-character commit ID>", "dirty": false}`. `repository` is `owner/name` or a github.com remote URL (`https://github.com/acme/app.git`, `git@github.com:acme/app.git`, or `ssh://git@github.com/acme/app.git`); Volcano drops any credentials in the URL and records `owner/name`. `dirty` is `true` when the uploaded files differ from the commit. All three fields are required, and fields Volcano does not know are ignored. An empty value, `null`, or `""` reports no commit. A malformed commit, or a repository not on GitHub, returns 400 before anything is deployed. Volcano records a function's commit with `commit.verified: false`; a clean commit of the project's connected repository that its production branch holds gets `commit.verification: repository`. + responses: + '200': + description: Existing function updated; its deployment was started or queued + content: + application/json: + schema: + $ref: '#/components/schemas/Function' + '201': + description: Function created and deployment workflow started + content: + application/json: + schema: + $ref: '#/components/schemas/Function' '400': - description: The request body is invalid + description: | + Bad request (invalid file, too large, etc.), an unknown + `visibility`, `visibility` and `is_public` disagree, or a + malformed `commit` content: application/json: schema: $ref: '#/components/schemas/Error' - '404': - description: No running durable execution matches `execution_ref` + '403': + description: Function limit exceeded for the project content: application/json: schema: $ref: '#/components/schemas/Error' '409': description: | - The wait cannot be registered now. `code` says why: - - - `callback_not_ready`: the workflow has not finished opening the - wait yet. Retry with a short backoff; the SDK does. - - `callback_closed`: the workflow is no longer waiting on it. - - `callback_taken`: the callback is already registered as an - approval or a messages session. - - `execution_ended`: the execution has finished. - - `too_many_message_waits`: the execution already has the maximum - number of open waits. + Function deletion is queued or running, the name is already held + by a durable function — a function cannot change kind — or the + redeploy would take a function with Frontend Function routes out + of `public` or out of HTTP invocation mode. The request is refused + before the deploy starts, so nothing is deployed. The message + `project variables changed during the upload; retry` means + `NODE_PATH` was created, changed or deleted while the upload was + processed; send the same request again. content: application/json: schema: $ref: '#/components/schemas/Error' - '413': - description: The request body is larger than 8 KiB + '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' - '429': - description: Too many requests from this execution + '500': + description: Internal server error (function deployment failed) content: application/json: schema: $ref: '#/components/schemas/Error' '503': description: | - The wait could not be confirmed with the workflow right now. Retry - with backoff. + 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' - /durable-messages/sessions: - post: + /projects/{id}/functions/{functionId}: + get: tags: - - Durable Functions - summary: Open a messages session from inside a workflow - description: | - Opens the session a workflow publishes messages with. The Volcano SDK - calls this once per workflow context, on its first `ctx.publish`; - applications do not call it directly. - - As for a wait, `execution_ref` and `callback_id` are the credential. - The session's token is delivered to the workflow itself and never - appears in a response. - - Retrying is safe: a request for a session that is already registered - returns it with `200`. - operationId: openDurableMessageSession - security: [] + - Functions + summary: Get function by ID + operationId: getFunction + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/FunctionId' + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/Function' + '404': + description: Function not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + patch: + tags: + - Functions + summary: Update function settings + operationId: updateFunction + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/FunctionId' requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/OpenDurableMessageSessionRequest' + $ref: '#/components/schemas/UpdateFunctionRequest' + examples: + makePublic: + summary: Let anon keys invoke the function + value: + visibility: public + allowSignedInUsers: + summary: Let signed-in users of the project invoke the function + value: + visibility: authenticated + makePrivate: + summary: Allow only service keys and schedulers (the default) + value: + visibility: private responses: '200': - description: The session was already registered - content: - application/json: - schema: - $ref: '#/components/schemas/DurableMessageSessionRegistration' - '201': - description: Session opened + description: Function updated content: application/json: schema: - $ref: '#/components/schemas/DurableMessageSessionRegistration' + $ref: '#/components/schemas/Function' '400': - description: The request body is invalid + description: | + Invalid settings: an unknown `visibility`, `visibility` and + `is_public` disagree, or `http_auth_mode: none` on a function that + is not `public` content: application/json: schema: $ref: '#/components/schemas/Error' '404': - description: No running durable execution matches `execution_ref` + description: Function not found content: application/json: schema: $ref: '#/components/schemas/Error' '409': description: | - The session cannot be opened now. `code` is `callback_not_ready`, - `callback_closed`, `callback_taken` (the callback is already - registered as an approval or a message wait), `execution_ended`, - or `too_many_message_sessions`. + Function settings conflict with attached Frontend Function routes: + a routed function must stay `public` and in HTTP invocation mode. content: application/json: schema: $ref: '#/components/schemas/Error' - '413': - description: The request body is larger than 8 KiB - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '429': - description: Too many requests from this execution - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '503': - description: | - The session could not be confirmed with the workflow right now. - Retry with backoff. + delete: + tags: + - Functions + summary: Delete a function + description: | + Schedules asynchronous function deletion. If another deployment is running, the function + preserves its current status and exposes the queued deletion through `pending_deployment_id`. + Its status changes to `deleting` when cleanup starts. After cleanup, it returns 404 and no + longer appears in function lists. + operationId: deleteFunction + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/FunctionId' + responses: + '202': + description: Function deletion started or queued + '404': + description: Function not found content: application/json: schema: $ref: '#/components/schemas/Error' - /durable-messages/publish: + /functions/{functionId}/invoke: post: tags: - - Durable Functions - summary: Publish a message from inside a workflow + - Functions + summary: Invoke a function description: | - Publishes a named message from a running workflow. The Volcano SDK - calls this from `ctx.publish`; applications do not call it directly. + Invoke a function. The function's `visibility` decides which credentials + may call it, and the function does not run for any other. A `private` + function answers every credential but a service key exactly as a + missing one, with 404, so its name and id cannot be discovered; an anon + key on an `authenticated` function gets 403. An SDK calling by name + resolves it first through `GET /functions/resolve`, which answers that + anon key with 404 instead. - The message is stored, listed with the execution's messages, and - delivered live to clients subscribed to the execution. Live delivery - counts against the project's Realtime messages. + **With Service Key** (admin/background operations, every visibility): + - Use for background jobs, webhooks, cron, admin operations + - Function receives payload only (no user context) + - Database queries bypass RLS (admin access) - The SDK sends an `Idempotency-Key` that a rerun of the publishing step - repeats, so a step that runs again returns the first message with - `200` and stores nothing new. That message is delivered live again, - and counts again, because the first run may have stopped before - subscribers got it. The SDKs deliver it to a subscriber once. - operationId: publishDurableMessage - security: [] + **With Auth User Token** (user-facing, `authenticated` or `public` functions): + - Use for user-initiated actions + - Includes users from anonymous sign-ins + - 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` functions only): + - Requires anon key permission: `functions.invoke` + - Function must have `visibility: public` + - Function receives payload only (no `__volcano_auth`) + + **Reserved payload keys:** the top-level `__volcano_auth`, + `__volcano_http` and `__volcano_mount` keys are reserved. Volcano + removes caller-supplied values for all three before the function runs; + only an auth user token adds a server-built `__volcano_auth`, and only + HTTP-mode ingress sets `__volcano_http: true`. `__volcano_mount` is set + only by Volcano's first-party app mounts. + + **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`. + operationId: invokeFunction + security: + - AnonKey: [] + - ServiceRoleKey: [] + - AuthUserAccessToken: [] parameters: - - name: X-Volcano-Durable-Session - in: header - required: true - description: The session token the workflow received when its session opened. - schema: - type: string - minLength: 1 - maxLength: 128 - - $ref: '#/components/parameters/DurableMessageIdempotencyKey' + - $ref: '#/components/parameters/FunctionId' requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/PublishDurableMessageRequest' + $ref: '#/components/schemas/FunctionInvocationRequest' + examples: + serviceCall: + summary: Admin/background operation (service key) + value: + payload: + action: process_batch + items: + - 1 + - 2 + - 3 + userCall: + summary: User-initiated call (auth token) + value: + payload: + action: get_profile + anonCall: + summary: Public function call (anon key) + value: + payload: + action: ping_public_endpoint responses: '200': - description: A message with this `Idempotency-Key` was already published; it is returned - content: - application/json: + description: Function response (passthrough from function runtime) + headers: + X-Volcano-Version: + description: Volcano API/runtime version that served this invocation (`` in production, `-` in non-production) schema: - $ref: '#/components/schemas/DurableMessage' - '201': - description: Message published + type: string + X-Volcano-Region: + 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: - $ref: '#/components/schemas/DurableMessage' + $ref: '#/components/schemas/FunctionInvocationResponse' '400': - description: The session token header is missing, or the name, data or idempotency key is invalid + description: Bad request - invalid payload or function in failed state content: application/json: schema: $ref: '#/components/schemas/Error' '401': - description: The session token is not valid + description: Unauthorized - invalid or missing token content: application/json: schema: $ref: '#/components/schemas/Error' - '409': + '403': description: | - The message cannot be published. `code` is - `execution_not_running` or `too_many_published_messages`. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '413': - description: The request body is larger than 72 KiB - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /durable-callbacks: - post: - tags: - - Durable Functions - summary: Get a callback token from inside a workflow - description: | - Registers a waiting step and returns its callback token. The Volcano - SDK calls this from `ctx.waitForCallback`; applications do not call it - directly. - - `execution_ref` and `callback_id` are opaque values the SDK reads from - the running workflow. Together they are the request's credential, so - the operation takes no other authentication. The token works until - the step's own timeout, and only for that step. - - Retrying is safe: a request for a step that is already registered - returns the same token with `200`. - operationId: registerDurableCallback - security: [] - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/RegisterDurableCallbackRequest' - responses: - '200': - description: The step was already registered; its token is returned - content: - application/json: - schema: - $ref: '#/components/schemas/DurableCallbackRegistration' - '201': - description: Token issued - content: - application/json: - schema: - $ref: '#/components/schemas/DurableCallbackRegistration' - '400': - description: The request body is invalid + Forbidden - CORS blocked, missing `functions.invoke`, or an anon key + on an `authenticated` function content: application/json: schema: $ref: '#/components/schemas/Error' '404': - description: No running durable execution matches `execution_ref` - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '409': description: | - The token cannot be issued now. `code` says why: - - - `callback_not_ready`: the workflow has not finished opening the - step yet. Retry with a short backoff; the SDK does. - - `callback_closed`: the workflow is no longer waiting on it. - - `callback_taken`: the step is already registered as an approval - or a message wait. - - `execution_ended`: the execution has finished. - - `too_many_callback_tokens`: the execution already holds the - maximum number of open tokens. + Function not found. Also returned for a `private` function to any + credential but a service key. content: application/json: schema: $ref: '#/components/schemas/Error' '413': - description: The request body is larger than 8 KiB + description: The invocation event, the payload with the auth context Volcano adds, is larger than 6 MiB content: application/json: schema: $ref: '#/components/schemas/Error' '429': - description: Too many requests from this execution + description: | + Rate limit exceeded (per-function or project-wide limit), or the + owning platform user's billing-cycle bandwidth allowance (aggregate ingress + + egress) was exceeded. content: application/json: schema: $ref: '#/components/schemas/Error' '503': description: | - The step could not be confirmed with the workflow right now. Retry - with backoff. - content: - application/json: - schema: + Function still provisioning or rate limiting service unavailable. + A freshly deployed (or updated) function may briefly report + `provisioning` and reject invocations until the background status + reconciler observes its deployment workflow completing and transitions + it to `active`. This is expected for a few seconds after deploy; clients + should retry. + content: + application/json: + schema: $ref: '#/components/schemas/Error' - /durable-callbacks/succeed: + default: + description: Function response (passthrough; status code/body/headers come from the function) + headers: + X-Volcano-Version: + description: Volcano API/runtime version that served this invocation (`` in production, `-` in non-production) + schema: + type: string + X-Volcano-Region: + 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: + $ref: '#/components/schemas/FunctionInvocationResponse' + /durable-functions/{functionId}/executions: post: tags: - Durable Functions - summary: Complete a waiting step with a result + summary: Start a durable execution from an application description: | - Resumes the workflow step waiting on the token with `result`. Call it - from the system the workflow handed the token to. + Starts an execution of a durable function using an application + credential, and returns its handle. - The token is the only credential. A token takes one outcome: once it - has succeeded or failed, every later request is refused with - `409 callback_completed`, including a retry of the request that - succeeded it. - operationId: succeedDurableCallback - security: [] + This is the durable counterpart of `POST /functions/{functionId}/invoke`, + and it is the endpoint an application calls. Like that one, it is not + project-scoped: an anon key, a service key and an auth user token each + carry their own project. The project-scoped collection under + `/projects/{id}/durable-functions/...` remains the owner's management + surface. + + **With a service key:** any durable function in the project. + + **With an auth user token:** a durable function whose `visibility` is + `authenticated` or `public`. + + **With an anon key:** requires the `functions.invoke` permission, and + the function must have `visibility: public`. + + A `private` durable function answers every credential but a service key + exactly as a missing one, with 404. + + The start returns a `client_token`. An anon key, a service key scoped + to a list without `*`, or a user who did not start the execution, + sends it as `X-Volcano-Client-Token` to read the execution, stop it, + and reach its messages. An anon key is shared by everyone who loads + the page, so the id alone never reaches an + execution. Listing executions takes the project owner's token or a + project access token. + + Send `X-Volcano-Execution-Name` to make the start idempotent: repeating + a start with the same name returns the existing execution instead of + beginning a second one. + + Each execution counts once against the project's durable execution + allowance, however many times the start is retried under the same + execution name, and the number in flight at once is capped by the plan. + The operations the execution performs are counted against the durable + operations allowance when it finishes. + operationId: startDurableExecutionFromApplication + security: + - AnonKey: [] + - ServiceRoleKey: [] + - AuthUserAccessToken: [] + parameters: + - $ref: '#/components/parameters/DurableFunctionId' + - name: X-Volcano-Execution-Name + in: header + required: false + description: | + Idempotency key for this execution. Generated when omitted. A repeat + under a name that already names a running execution returns that + execution and is not charged again. + + Letters, digits, `-`, `_` and `.`, up to 255 characters. Anything + else is rejected with `400`. + schema: + type: string + maxLength: 255 + pattern: ^[A-Za-z0-9._-]+$ requestBody: - required: true + required: false content: application/json: schema: - $ref: '#/components/schemas/SucceedDurableCallbackRequest' + description: Input passed to the function, up to 256 KiB. responses: - '200': - description: The workflow has the result + '202': + description: Execution accepted and started content: application/json: schema: - $ref: '#/components/schemas/DurableCallbackOutcome' - '202': - description: | - The result is recorded and on its way to the workflow, which takes - longer than this request waits. Volcano finishes the delivery; do - not send it again. + $ref: '#/components/schemas/DurableExecution' + '400': + description: Payload is not valid JSON, or the execution name is invalid content: application/json: schema: - $ref: '#/components/schemas/DurableCallbackOutcome' - '400': - description: The token is missing, or `result` is missing, null, not JSON, or larger than 64 KiB + $ref: '#/components/schemas/Error' + '401': + description: | + Missing or invalid credential. Also returned for a platform user + token, which is not an application credential; project owners start + executions through the project-scoped collection. content: application/json: schema: $ref: '#/components/schemas/Error' - '404': + '403': description: | - No callback has this token. `code` is `callback_not_found`. + The anon key lacks `functions.invoke` or the function is + `authenticated`, or the request's origin is refused by the project's + CORS policy. content: application/json: schema: $ref: '#/components/schemas/Error' - '409': + '404': description: | - The token already has an outcome. `code` is `callback_completed`. + Durable function not found. Also returned for a standard function's + id, for a durable function in another project, and for a `private` + one to any credential but a service key, so the response cannot be + used to tell those apart. content: application/json: schema: $ref: '#/components/schemas/Error' - '410': + '409': description: | - The workflow no longer waits on the token. `code` says why: - - - `callback_expired`: the step timed out, on its own timeout or - its heartbeat timeout. - - `execution_ended`: the execution finished or stopped. + Function is not deployed yet, or has no deployed region. Also + returned when two starts under the same execution name raced and + both released it, which is retryable as it stands, and with `code` + `execution_name_held` when an unfinished start this caller may not + resume holds the execution name, which needs a name of its own. content: application/json: schema: $ref: '#/components/schemas/Error' '413': - description: The request body is larger than 72 KiB + description: Payload is larger than 256 KiB content: application/json: schema: $ref: '#/components/schemas/Error' '429': - description: Too many callback requests for the token or its project. Retry later. + description: | + The project has too many executions in flight for its plan, the + function invocation rate limit was exceeded, the project is over + its bandwidth cap, or the account is out of one of its + billing-cycle durable allowances: executions, operations, or + compute. Operations and compute are counted once an execution + finishes, so a refusal on either never interrupts an execution + already running — it declines the next start. content: application/json: schema: $ref: '#/components/schemas/Error' - /durable-callbacks/fail: - post: + '503': + description: | + Durable execution is not available in this environment, or the + plan terms for the start could not be read. The 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: + $ref: '#/components/schemas/Error' + /durable-functions/{functionId}/executions/{executionId}: + get: tags: - Durable Functions - summary: Fail a waiting step + summary: Get a durable execution from an application description: | - Resumes the workflow step waiting on the token by raising `error`. The - SDKs raise it as `CallbackFailedError`, carrying its `type` and - `message`. + Returns the execution's current state with the credential that started + it, including its `result` once it has succeeded. Poll this to wait for + an execution to finish. - The token is the only credential, and takes one outcome, as for - succeeding it. - operationId: failDurableCallback - security: [] - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/FailDurableCallbackRequest' + **With a service key:** any execution in the project when the key holds + `*`, the default. A key scoped to a list without `*` reaches an + execution whose `X-Volcano-Client-Token` the request carries, as an + anon key does; the start returns that token. + + **With an auth user token:** an execution the user started, or one + whose `X-Volcano-Client-Token` the request carries, of a durable + function whose `visibility` is `authenticated` or `public`. + + **With an anon key:** an execution whose `X-Volcano-Client-Token` the + request carries, of a function with `visibility: public`. + + Only a service key holding `*` reaches an execution that is still + `pending`. Any other execution answers `404`, as a missing one does. + + The response is the one `GET + /projects/{id}/durable-functions/{functionId}/executions/{executionId}` + returns. It never carries `client_token`. + operationId: getDurableExecutionFromApplication + security: + - AnonKey: [] + - ServiceRoleKey: [] + - AuthUserAccessToken: [] + parameters: + - $ref: '#/components/parameters/DurableFunctionId' + - $ref: '#/components/parameters/DurableExecutionId' + - $ref: '#/components/parameters/DurableClientToken' responses: '200': - description: The workflow has the error - content: - application/json: - schema: - $ref: '#/components/schemas/DurableCallbackOutcome' - '202': - description: | - The error is recorded and on its way to the workflow. Volcano - finishes the delivery; do not send it again. + description: Successful response content: application/json: schema: - $ref: '#/components/schemas/DurableCallbackOutcome' - '400': - description: The token is missing, or the error's `type` or `message` is invalid + $ref: '#/components/schemas/DurableExecution' + '401': + description: Missing or invalid credential content: application/json: schema: $ref: '#/components/schemas/Error' - '404': + '403': description: | - No callback has this token. `code` is `callback_not_found`. + The anon key lacks `functions.invoke`, the service key is scoped + without it, or the function is `authenticated` and the request + carries an anon key. Also returned when the request's origin is + refused by the project's CORS policy. content: application/json: schema: $ref: '#/components/schemas/Error' - '409': + '404': description: | - The token already has an outcome. `code` is `callback_completed`. + Durable function or execution not found, or the credential cannot + reach the execution. A `private` function answers every credential + but a service key this way. content: application/json: schema: $ref: '#/components/schemas/Error' - '410': + '429': description: | - The workflow no longer waits on the token. `code` is - `callback_expired` or `execution_ended`. + The function's or the project's function rate limit, which reads + share with invocations and starts, or the project is over its + bandwidth cap. content: application/json: schema: $ref: '#/components/schemas/Error' - '413': - description: The request body is larger than 72 KiB - content: - application/json: + '503': + description: | + Durable execution is not available in this environment, the plan + terms for the request could not be read, or reads of the + execution's state in its region are throttled. The first is not one + to retry in a loop; the others are transient, and a throttled read + carries `Retry-After`. + headers: + Retry-After: + description: | + Seconds to wait before reading again. Sent only when reads in + the execution's region are throttled. schema: - $ref: '#/components/schemas/Error' - '429': - description: Too many callback requests for the token or its project. Retry later. + type: integer content: application/json: schema: $ref: '#/components/schemas/Error' - /durable-callbacks/heartbeat: + /durable-functions/{functionId}/executions/{executionId}/stop: post: tags: - Durable Functions - summary: Keep a waiting step alive + summary: Stop a durable execution from an application description: | - Tells the workflow step waiting on the token that the work is still - going on, restarting its heartbeat timeout. A heartbeat never extends - the step's own timeout, and a step without a heartbeat timeout needs - none. - operationId: heartbeatDurableCallback - security: [] - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/HeartbeatDurableCallbackRequest' + Cancels a running execution with the credential that started it. Its + completed steps are not undone. + + Access follows the same rules as reading the execution. + + The call is accepted rather than awaited: the response reports the + execution as it was read back and may still say `running`. Poll + `GET /durable-functions/{functionId}/executions/{executionId}` to see + it settle into `stopped`. + + Stopping an execution that already finished is not an error: the + response carries the state it settled in. + operationId: stopDurableExecutionFromApplication + security: + - AnonKey: [] + - ServiceRoleKey: [] + - AuthUserAccessToken: [] + parameters: + - $ref: '#/components/parameters/DurableFunctionId' + - $ref: '#/components/parameters/DurableExecutionId' + - $ref: '#/components/parameters/DurableClientToken' responses: '200': - description: The step is still waiting + description: | + Stop accepted. The body is the execution as it was read back, which + may still report `running`. content: application/json: schema: - $ref: '#/components/schemas/DurableCallbackOutcome' - '400': - description: The token is missing + $ref: '#/components/schemas/DurableExecution' + '401': + description: Missing or invalid credential content: application/json: schema: $ref: '#/components/schemas/Error' - '404': + '403': description: | - No callback has this token. `code` is `callback_not_found`. + The anon key lacks `functions.invoke`, the service key is scoped + without it, or the function is `authenticated` and the request + carries an anon key. Also returned when the request's origin is + refused by the project's CORS policy. content: application/json: schema: $ref: '#/components/schemas/Error' - '409': + '404': description: | - The token already has an outcome. `code` is `callback_completed`. + Durable function or execution not found, or the credential cannot + reach the execution. A `private` function answers every credential + but a service key this way. content: application/json: schema: $ref: '#/components/schemas/Error' - '410': + '409': description: | - The workflow no longer waits on the token. `code` is - `callback_expired` or `execution_ended`. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '413': - description: The request body is larger than 8 KiB + The execution has not started yet. Only a service key holding `*` + can reach an execution in that state. content: application/json: schema: $ref: '#/components/schemas/Error' '429': - description: Too many callback requests for the token or its project. Retry later. + description: | + The function's or the project's function rate limit, which stops + share with invocations and starts, or the project is over its + bandwidth cap. content: application/json: schema: $ref: '#/components/schemas/Error' '503': - description: The heartbeat could not reach the workflow right now. Retry with backoff. + description: | + Durable execution is not available in this environment, the plan + terms for the request could not be read, or stops or reads of + executions in its region are throttled. The first is not one to + retry in a loop; the others are transient, and a throttle carries + `Retry-After`. A stop throttled while reading the execution back may + already have been sent; repeating it is safe, because a stop of an + execution that has ended answers the state it ended in. + headers: + Retry-After: + description: | + Seconds to wait before trying again. Sent only when stops or + reads of executions in the region are throttled. + schema: + type: integer content: application/json: schema: $ref: '#/components/schemas/Error' - /durable-approvals: + /durable-functions/{functionId}/executions/{executionId}/messages: post: tags: - Durable Functions - summary: Request an approval from inside a workflow + summary: Send a message to a durable execution from an application description: | - Registers an approval request for a running durable execution. The - Volcano SDK calls this from `ctx.waitForApproval`; applications do not - call it directly. + Sends a named message to a running execution. The workflow receives it + from `ctx.waitForMessage` with the same name. A message sent before + anything waits for its name is kept, and each wait takes the oldest + one, so messages arrive in the order they were sent. - `execution_ref` and `callback_id` are opaque values the SDK reads from - the running workflow. Together they are the request's credential, so - the operation takes no other authentication. The approval belongs to - the project that owns the execution, and expires when the workflow's - own approval timeout does. + Messages never decide an approval: a workflow waiting in + `ctx.waitForApproval` is not resumed by one. - Retrying is safe: a request for an approval that is already registered - returns it with `200`. - operationId: requestDurableApproval - security: [] + **With a service key:** any execution in the project when the key holds + `*`, the default. A key scoped to a list without `*`, such as + `["functions.invoke"]`, reaches an execution whose + `X-Volcano-Client-Token` the request carries, as an anon key does; the + start returns that token. + + **With an auth user token:** an execution the user started, or one + whose `X-Volcano-Client-Token` the request carries, of a durable + function whose `visibility` is `authenticated` or `public`. + + **With an anon key:** an execution whose `X-Volcano-Client-Token` the + request carries, of a function with `visibility: public`. + + Any other execution answers `404`, as a missing one does. + + Send `Idempotency-Key` to make a retry safe: a repeat with a key the + same sender has used on the execution returns the first message with + `200` and sends nothing. + operationId: sendDurableMessageFromApplication + security: + - AnonKey: [] + - ServiceRoleKey: [] + - AuthUserAccessToken: [] + parameters: + - $ref: '#/components/parameters/DurableFunctionId' + - $ref: '#/components/parameters/DurableExecutionId' + - $ref: '#/components/parameters/DurableMessageIdempotencyKey' + - $ref: '#/components/parameters/DurableClientToken' requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/RequestDurableApprovalRequest' + $ref: '#/components/schemas/SendDurableMessageRequest' responses: '200': - description: The approval was already registered + description: A message with this `Idempotency-Key` was already sent; it is returned content: application/json: schema: - $ref: '#/components/schemas/DurableApprovalRegistration' + $ref: '#/components/schemas/DurableMessage' '201': - description: Approval registered + description: | + Message sent. `status` is `delivered` when a wait took it at once, + `delivering` when a wait took it and the handover is still being + confirmed, and `queued` when it is kept for the next wait. content: application/json: schema: - $ref: '#/components/schemas/DurableApprovalRegistration' + $ref: '#/components/schemas/DurableMessage' '400': - description: The request body is invalid + description: The name, data or idempotency key is invalid + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Missing or invalid credential + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: | + The anon key lacks `functions.invoke`, the service key is scoped + without it, or the function is `authenticated` and the request + carries an anon key. Also returned when the request's origin is + refused by the project's CORS policy. content: application/json: schema: $ref: '#/components/schemas/Error' '404': - description: No running durable execution matches `execution_ref` + description: | + Durable function or execution not found, or the credential cannot + reach the execution. A `private` function answers every credential + but a service key this way. content: application/json: schema: $ref: '#/components/schemas/Error' '409': description: | - The approval cannot be registered now. `code` says why: + The message cannot be sent. `code` says why: - - `approval_not_ready`: the workflow has not finished opening the - approval yet. Retry with a short backoff; the SDK does. - - `approval_closed`: the workflow is no longer waiting on it. - - `callback_taken`: the callback is already registered as a - message wait or a messages session. - - `execution_ended`: the execution has finished. - - `too_many_pending_approvals`: the execution already has the - maximum number of pending approvals. + - `execution_not_running`: the execution has finished. + - `too_many_queued_messages`: the execution already holds the + maximum number of messages nothing has taken. content: application/json: schema: $ref: '#/components/schemas/Error' '413': - description: The request body is larger than 64 KiB + description: The request body is larger than 72 KiB content: application/json: schema: $ref: '#/components/schemas/Error' '429': - description: Too many approval requests from this execution or address + description: | + Too many messages sent to this execution, the function's or the + project's function rate limit, which sends share with invocations + and starts, or the project is over its bandwidth cap. content: application/json: schema: $ref: '#/components/schemas/Error' '503': - description: | - The approval could not be confirmed with the workflow right now. - Retry with backoff. + description: The plan terms for the request could not be read. Retry with backoff. content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/issues: get: tags: - - Issues - summary: List issues + - Durable Functions + summary: List a durable execution's messages from an application description: | - Lists the project's issues, most recently seen first. An issue groups - the runtime errors one function or frontend raised with the same error - type and stack, or the same message when there is no stack. + Lists the messages sent to and published by an execution, oldest + first. Pass the last `seq` you read as `after` to read only what came + next; that is how a client catches up after a live subscription + reconnects. - Project access tokens can list issues, including read-only ones. - operationId: listIssues + Access follows the same rules as sending. + operationId: listDurableMessagesFromApplication security: - - UserToken: [] - - ProjectAccessToken: [] + - AnonKey: [] + - ServiceRoleKey: [] + - AuthUserAccessToken: [] parameters: - - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/Limit' - - $ref: '#/components/parameters/IssueCursor' - - name: status - in: query - required: false - description: Return only issues in this status. - schema: - $ref: '#/components/schemas/IssueStatus' - - name: resource_id - in: query - required: false - description: Return only issues raised by this function or frontend. - schema: - type: string - format: uuid + - $ref: '#/components/parameters/DurableFunctionId' + - $ref: '#/components/parameters/DurableExecutionId' + - $ref: '#/components/parameters/DurableClientToken' + - $ref: '#/components/parameters/DurableMessageDirectionFilter' + - $ref: '#/components/parameters/DurableMessageNameFilter' + - $ref: '#/components/parameters/DurableMessageAfter' + - $ref: '#/components/parameters/DurableMessageLimit' responses: '200': description: Successful response content: application/json: schema: - $ref: '#/components/schemas/PaginatedIssues' + $ref: '#/components/schemas/DurableMessageList' '400': - description: A filter or the cursor is invalid + description: A filter is invalid content: application/json: schema: $ref: '#/components/schemas/Error' - '404': - description: Project not found. Code `feature_unavailable` means issues are not available in this environment. + '401': + description: Missing or invalid credential content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/issues/{issueId}: - get: - tags: - - Issues - summary: Get an issue - description: | - Returns one issue: the resource that raised it, how often and when it - was seen, and its status. - - Project access tokens can read issues, including read-only ones. - operationId: getIssue - security: - - UserToken: [] - - ProjectAccessToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/IssueId' - responses: - '200': - description: Successful response + '403': + description: | + The anon key lacks `functions.invoke`, the service key is scoped + without it, or the function is `authenticated` and the request + carries an anon key. Also returned when the request's origin is + refused by the project's CORS policy. content: application/json: schema: - $ref: '#/components/schemas/Issue' + $ref: '#/components/schemas/Error' '404': - description: Issue not found. Code `feature_unavailable` means issues are not available in this environment. + description: | + Durable function or execution not found, or the credential cannot + reach the execution. content: application/json: schema: $ref: '#/components/schemas/Error' - patch: - tags: - - Issues - summary: Update an issue - description: | - Sets an issue's status. A resolved issue that is seen again after it - was resolved reopens, and `regressed_at` records when. An ignored issue - stays ignored while it keeps being counted. - - Setting the status an issue already has is safe to repeat. - operationId: updateIssue - security: - - UserToken: [] - - ProjectAccessToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/IssueId' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateIssueRequest' - responses: - '200': - description: Updated - content: - application/json: - schema: - $ref: '#/components/schemas/Issue' - '400': - description: The request body is invalid + '429': + description: | + The function's or the project's function rate limit, which lists + share with invocations and starts, or the project is over its + bandwidth cap. content: application/json: schema: $ref: '#/components/schemas/Error' - '404': - description: Issue not found. Code `feature_unavailable` means issues are not available in this environment. + '503': + description: The plan terms for the request could not be read. Retry with backoff. content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/autofix: + /functions/resolve: get: tags: - - Autofix - summary: Get autofix settings + - Functions + summary: Resolve function name for invocation description: | - Returns whether Volcano diagnoses the project's issues with AI, how far - a run may go, and which model it uses. A project that never saved - settings returns the defaults, with autofix off. + 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. In local development, and when the + deployment serves no public invocation domain, `invoke_url` is omitted and callers invoke + through `POST /functions/{functionId}/invoke`. A local function's own `invoke_url`, for + webhook testing, is on the function resource. - Your API key is never returned. `api_key_configured`, - `api_key_provider`, and `api_key_last4` show whether one is set and - which provider it belongs to. + **With Service Key**: + - Allowed + + **With Auth User Token**: + - Allowed for `authenticated` and `public` functions + - A `private` function answers 404, exactly as a missing one - Where autofix is not available, saved settings stay readable. A project - that never saved any answers `404` with code `feature_unavailable`. - operationId: getAutofixSettings + **With Anon Key**: + - Requires anon key permission: `functions.invoke` + - Function must have `visibility: public`; any other answers 404 + operationId: resolveFunctionForInvocation security: - - UserToken: [] - - ProjectAccessToken: [] + - AnonKey: [] + - ServiceRoleKey: [] + - AuthUserAccessToken: [] parameters: - - $ref: '#/components/parameters/ProjectId' + - name: name + in: query + required: true + schema: + type: string + maxLength: 63 + pattern: ^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$ + description: DNS-safe function name (lowercase letters, numbers, hyphens; cannot start or end with hyphen) + example: my-function responses: '200': - description: Successful response + description: Function resolved successfully content: application/json: schema: - $ref: '#/components/schemas/AutofixSettings' - '404': - description: Project not found. Code `feature_unavailable` means autofix is not available in this environment and the project never saved settings. + $ref: '#/components/schemas/ResolveFunctionResponse' + '400': + description: Bad request - missing or invalid function name content: application/json: schema: $ref: '#/components/schemas/Error' - '501': - description: Autofix is not available in local mode. + '401': + description: Unauthorized - invalid or missing token content: application/json: schema: $ref: '#/components/schemas/Error' - '503': - description: The owner's plan could not be resolved. Retry later. + '403': + description: | + Forbidden - CORS blocked, or missing `functions.invoke` permission + for anon key content: application/json: schema: $ref: '#/components/schemas/Error' - put: + '404': + description: | + Function not found. Also returned for a `private` function with an + auth user token, and a non-public one with an anon key. A durable + function is never resolvable here: it is started through + `POST /durable-functions/{functionId}/executions`, not invoked. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /projects/{id}/logs/activity: + post: tags: - - Autofix - summary: Replace autofix settings + - Logs + summary: Get project log activity description: | - Replaces the project's autofix settings. Omitted fields take their - defaults, except three: an omitted `provider` or `model` keeps its saved - value, and an omitted `api_key` keeps the stored key. So - `{"enabled": false}` turns autofix off and keeps the key. - - Project access tokens are refused. Autofix opens pull requests in the - project's repository, so a person turns it on with a platform token or - in the dashboard. - - Turning autofix on needs a plan that includes it. Settings that are - already on stay stored after a downgrade, and saving them again is not - refused, but no run starts until the plan includes autofix again. Other - saves need no plan. - - Provider `anthropic` runs on your own API key. A key belongs to the - provider it was saved with, and turning autofix on with a provider that - runs on your own key needs one for it. Turning autofix off or switching - providers keeps the stored key; only - `DELETE /projects/{id}/autofix/api-key` removes it. Turning autofix on - with provider `volcano` needs the `autofix.managed_models` capability; - without it the request answers `400` with code `feature_unavailable`. - - Where autofix is not available, a project with saved settings can - still change them with `enabled: false`. Turning autofix on answers - `404` with code `feature_unavailable`. - operationId: updateAutofixSettings + Retrieve bucketed log counts for one resource type in the project. Set + `resource.type` to `function`, `frontend`, `database`, or `app`. Add + `resource.ids` to filter to one or more resources, and add + `resource.deployments.ids` to count deployment logs instead of runtime + logs for functions and frontends. Deployment logs are not supported for + databases or apps. `app` counts the entries a first-party app, such as + the Builder, wrote into the project; an app's ID is UUIDv5 of its slug + (see `LogResource.id`). With no entries it answers 200 with none; an unknown app in `resource.ids` answers 404 `app not found`. The `app_logs` release gate controls new writes only: entries already written stay readable when it closes. Database logs are a SUPERAGENT feature; `resource.type=database` + from a HOBBY project owner returns 403. The activity window is limited + to the plan's retention window (HOBBY: 1 day, SUPERAGENT: 30 days); older start + times are clamped to that window. Buckets are aligned to UTC clock + intervals and count events in the half-open window + `[start_time, end_time)`. + operationId: getProjectLogActivity security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' requestBody: @@ -7037,268 +7493,324 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UpdateAutofixSettingsRequest' + $ref: '#/components/schemas/LogActivityRequest' responses: '200': - description: Saved + description: Successful response content: application/json: schema: - $ref: '#/components/schemas/AutofixSettings' + $ref: '#/components/schemas/LogActivityResponse' '400': - description: The request body is invalid, the key does not fit the provider, or turning autofix on with a provider that runs on your own key has no key for it. Code `feature_unavailable` means Volcano-managed models are not available in this environment. + description: Bad request - invalid query parameter content: application/json: schema: $ref: '#/components/schemas/Error' - '403': - description: The owner's plan does not include autofix, or the request used a project access token. Only a person changes autofix settings. + '401': + description: Unauthorized - invalid or missing token content: application/json: schema: $ref: '#/components/schemas/Error' - '404': - description: Project not found. Code `feature_unavailable` means autofix is not available in this environment, which refuses turning it on and a project's first save. + '403': + description: Forbidden - project ownership required content: application/json: schema: $ref: '#/components/schemas/Error' - '501': - description: Autofix is not available in local mode. + '404': + description: Project or resource not found content: application/json: schema: $ref: '#/components/schemas/Error' - '503': - description: Turning autofix on needs the owner's plan, which could not be resolved. Nothing was saved. Retry later. + '413': + description: Request body JSON has too many objects, arrays or values content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/autofix/api-key: - delete: + /projects/{id}/logs/search: + post: tags: - - Autofix - summary: Delete the API key + - Logs + summary: Search project logs description: | - Deletes the project's stored API key and returns the settings. Autofix - on the key's provider runs on that key, so it turns off; on another - provider it stays as it is. Deleting when no key is stored succeeds. - - Turning autofix off or switching providers never deletes the key, and - neither does applying a project configuration. This works where - autofix is not available, for a project that saved settings. - - Project access tokens are refused. - operationId: deleteAutofixAPIKey + Search or filter logs for one resource type in the project. Set + `resource.type` to `function`, `frontend`, `database`, or `app`. Add + `resource.ids` to filter to one or more resources, and add + `resource.deployments.ids` to read deployment logs instead of runtime + logs for functions and frontends. Deployment logs are not supported for + databases or apps. `app` reads the entries a first-party app, such as + the Builder, wrote into the project; an app's ID is UUIDv5 of its slug + (see `LogResource.id`). With no entries it answers 200 with none; an unknown app in `resource.ids` answers 404 `app not found`. The `app_logs` release gate controls new writes only: entries already written stay readable when it closes. Database logs are a SUPERAGENT feature; requests for + `resource.type=database` from a HOBBY project owner return 403. + Log history (runtime and deployment) is limited to the plan's retention + window (HOBBY: 1 day, SUPERAGENT: 30 days); older time ranges are clamped to that + window. + operationId: searchProjectLogs security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/LogSearchRequest' responses: '200': - description: Deleted + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/LogSearchResponse' + '400': + description: Bad request - invalid query parameter + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Unauthorized - invalid or missing token content: application/json: schema: - $ref: '#/components/schemas/AutofixSettings' + $ref: '#/components/schemas/Error' '403': - description: The request used a project access token. Only a person deletes the key. + description: Forbidden - project ownership required content: application/json: schema: $ref: '#/components/schemas/Error' '404': - description: Project not found. Code `feature_unavailable` means autofix is not available in this environment and the project never saved settings. + description: Project or resource not found content: application/json: schema: $ref: '#/components/schemas/Error' - '501': - description: Autofix is not available in local mode. + '413': + description: Request body JSON has too many objects, arrays or values content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/issues/{issueId}/autofix-runs: + /projects/{id}/logs/stream: post: tags: - - Autofix - summary: Diagnose an issue + - Logs + summary: Stream project logs description: | - Queues a run that diagnoses the issue with AI. The run reads the - issue's runtime logs and, when a push to the project's connected - repository built the deployment that was live when the issue was - last seen, its source at that commit. Poll the run until its status is - `succeeded`, `failed`, or `canceled`. - - Autofix must be on for the project. An issue has at most one queued or - running run, a project runs one at a time, and a project starts at most - 25 runs, manual and automatic, in any 24 hours. + Live-tail project logs as Server-Sent Events. The request body uses the + resource selector plus `q`, `start_time`, and `limit`, + including runtime logs and function/frontend deployment logs selected + with `resource.deployments`. Deployment logs are not supported for + databases. Database logs are a SUPERAGENT feature; `resource.type=database` + from a HOBBY project owner returns 403. The `q` field uses the same + syntax as search and activity requests. Do not send `cursor` or + `end_time`; use `/logs/search` for range backfills. + Explicit historical `start_time` values are limited to the plan's + retention window (HOBBY: 1 day, SUPERAGENT: 30 days). Resume with + `Last-Event-ID` or the `last_event_id` query parameter. The cursor is + bound to the request body: the resource selector and every filter must + match the original request when reconnecting, otherwise the request is + rejected with `400`. - Project access tokens are refused. A run spends model tokens on the - project's provider, so a person starts it with a platform token or in - the dashboard. - operationId: startAutofixRun + This is a live tail, not a gap-free backfill. On connect or reconnect the + server delivers at most `limit` of the most recent matching events from + the cursor position and then follows new events; events older than that + window are not replayed. Use `/logs/search` to backfill a time range. + operationId: streamProjectLogs security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/IssueId' + - name: Last-Event-ID + in: header + required: false + schema: + type: string + description: Opaque stream cursor from the most recent SSE `id` field. + - name: last_event_id + in: query + required: false + schema: + type: string + description: Opaque stream cursor fallback when setting `Last-Event-ID` is not practical. + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/LogStreamRequest' responses: - '202': - description: Queued + '200': + description: Server-Sent Events stream. `log` events contain a JSON `LogSearchEvent`; `warning` events contain a JSON object with an `error` field. content: - application/json: + text/event-stream: schema: - $ref: '#/components/schemas/AutofixRun' + type: string + examples: + log: + summary: Log event + value: | + : connected + + id: STREAM_CURSOR + event: log + data: {"id":"LOG_EVENT_ID","timestamp":"2024-01-01T12:00:00Z","level":"info","message":"User logged in","resource":{"type":"function","id":"550e8400-e29b-41d4-a716-446655440000","name":"login"},"region":"us-east-1"} '400': - description: Code `feature_unavailable` means the project's provider is `volcano` and Volcano-managed models are not available in this environment. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '403': - description: The owner's plan does not include autofix, or the request used a project access token. + description: Bad request - invalid selector, stream cursor, or unsupported stream field content: application/json: schema: $ref: '#/components/schemas/Error' - '404': - description: Project or issue not found. Code `feature_unavailable` means autofix is not available in this environment. + '401': + description: Unauthorized - invalid or missing token content: application/json: schema: $ref: '#/components/schemas/Error' - '409': - description: Autofix is off for the project, or the issue already has a queued or running run. + '403': + description: Forbidden - project ownership required content: application/json: schema: $ref: '#/components/schemas/Error' - '429': - description: The project started its limit of runs in the last 24 hours. + '404': + description: Project or resource not found content: application/json: schema: $ref: '#/components/schemas/Error' - '501': - description: Autofix is not available in local mode. + '413': + description: Request body JSON has too many objects, arrays or values content: application/json: schema: $ref: '#/components/schemas/Error' - '503': - description: The owner's plan could not be resolved. Retry later. + '500': + description: Internal server error - log streaming setup failed content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/autofix-runs: - get: + /projects/{id}/functions/batch: + post: tags: - - Autofix - summary: List autofix runs - description: | - Lists the project's autofix runs, newest first. Runs stay readable after - autofix is turned off, and where autofix is not available. - - Project access tokens can list runs, including read-only ones. - operationId: listAutofixRuns + - Functions + summary: Deploy multiple functions in one request + description: | + Upload multiple function source archives in one multipart request. Each archive should contain source files + plus dependency manifests/lockfiles, not installed dependency directories. ZIP and tar.gz uploads are + accepted and normalized to tar.gz before storage. The API enforces `SOURCE_ARCHIVE_SIZE_LIMIT_MB` + for each uploaded and normalized source archive. The server records a shared + deployment batch ID for the resulting function deployments. Each function deployment runs its own + compile/publish workflow concurrently, and each publish build enforces `LAMBDA_TARGET_CONTAINER_SIZE_LIMIT_MB` + for the final container image. + One batch request can include up to 100 functions. Submit multiple batch requests for larger projects. + If one function fails before its workflow starts, already-started function deployments are left + running and the failed function is reported in the `failed` array. Failed new functions are deleted; + failed updates are rolled back to their previous metadata/status where possible. + operationId: createFunctionsBatch security: - UserToken: [] - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/Limit' - - $ref: '#/components/parameters/IssueCursor' - - name: issue_id - in: query - required: false - description: Return only runs for this issue. - schema: - type: string - format: uuid - - name: status - in: query - required: false - description: Return only runs in this status. - schema: - $ref: '#/components/schemas/AutofixRunStatus' + requestBody: + required: true + content: + multipart/form-data: + schema: + type: object + properties: + functions: + type: string + description: | + JSON array of functions with `name`, `runtime`, optional `handler`, and `file_field`. Each `file_field` must name a multipart file field containing that function's ZIP or tar.gz source bundle. + + Each entry may also declare `variable_scope` (`all` or `scoped`) and `variables` (an array of project variable names). Omitting them leaves the function's stored declaration unchanged. Volcano detects direct environment references in the uploaded source code and keeps them separate from the declared names: detected names are not written back to the declaration and do not appear in a config export. A scoped function receives its declared names plus the detected ones the project defines; a detected name the project does not define is ignored, since such a reference is often optional. Detection reads code only, so a name appearing solely in a comment or in an unrelated string is not a reference. Declare a name when the function reads it through a computed key, or when it must not deploy without the variable. The request is rejected with 400 before anything is deployed if a scoped function declares a variable the project does not define, or if the resulting environment exceeds 4096 bytes. + + Each entry may also carry `commit`, the commit its source came from, as an object: `{"repository": "acme/app", "sha": "<40-character commit ID>", "dirty": false}`. It takes the same values as the `commit` field of a single function upload; `null` or `""` reports no commit. The request is rejected with 400 before anything is deployed if an entry's commit is malformed or names a repository not on GitHub. + code_0: + type: string + format: binary + description: Function ZIP or tar.gz archive referenced by the first manifest entry's `file_field`; additional code_N file fields may be included. Each archive is subject to SOURCE_ARCHIVE_SIZE_LIMIT_MB. + required: + - functions responses: - '200': - description: Successful response + '202': + description: Batch deployment accepted content: application/json: schema: - $ref: '#/components/schemas/PaginatedAutofixRuns' - '400': - description: A filter or the cursor is invalid + $ref: '#/components/schemas/BatchFunctionDeployResponse' + '207': + description: Batch deployment partially accepted; successful functions started deployment and failed functions were compensated where possible content: application/json: schema: - $ref: '#/components/schemas/Error' - '404': - description: Project not found. + $ref: '#/components/schemas/BatchFunctionDeployResponse' + '400': + description: Bad request content: application/json: schema: $ref: '#/components/schemas/Error' - '501': - description: Autofix is not available in local mode. + '403': + description: Function limit exceeded for the project content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/autofix-runs/{runId}: - get: - tags: - - Autofix - summary: Get an autofix run - description: | - Returns one run: its status, the diagnosis once it succeeds, why it - failed or was canceled, and the model tokens it used. Runs stay readable - where autofix is not available. - - Project access tokens can read runs, including read-only ones. - operationId: getAutofixRun - security: - - UserToken: [] - - ProjectAccessToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/AutofixRunId' - responses: - '200': - description: Successful response + '409': + description: | + A name in the batch is held by a function of the other kind — a + function cannot change kind — or the project's source is managed by + Git, where deploys come from a push to the production branch. The + message `project variables changed during the upload; retry` means + `NODE_PATH` was created, changed or deleted while the upload was + processed; nothing was deployed, so send the same request again. content: application/json: schema: - $ref: '#/components/schemas/AutofixRun' - '404': - description: Project or run not found. + $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' - '501': - description: Autofix is not available in local mode. + '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}/durable-approvals: + /projects/{id}/schedulers: get: tags: - - Durable Functions - summary: List durable approvals + - Functions + summary: List every function scheduler in a project description: | - Lists the approvals durable workflows in the project have requested, - newest first. Pending approvals are the ones a workflow is waiting on; - decided, expired, and cancelled ones are kept for a year. + Project-scoped counterpart to `/projects/{id}/functions/{functionId}/schedulers`. + Returns schedulers across all functions in the project, ordered by + creation time descending, with standard page/limit pagination so + clients don't have to fan out one request per function. - Project access tokens can list approvals, including read-only ones. - operationId: listDurableApprovals + Schedulers of standard and durable functions are listed together, and + each carries `function_kind`. Pass `function_kind` to list one kind + only. + operationId: listProjectSchedulers security: - UserToken: [] - ProjectAccessToken: [] @@ -7306,519 +7818,418 @@ paths: - $ref: '#/components/parameters/ProjectId' - $ref: '#/components/parameters/Page' - $ref: '#/components/parameters/Limit' - - name: status - in: query - required: false - description: Return only approvals in this status. - schema: - $ref: '#/components/schemas/DurableApprovalStatus' - - $ref: '#/components/parameters/DurableApprovalFunctionFilter' - - name: execution_id - in: query - required: false - description: Return only approvals requested by this durable execution. - schema: - type: string - format: uuid - - name: from - in: query - required: false - description: Return only approvals requested at or after this time. - schema: - type: string - format: date-time - - name: to - in: query - required: false - description: Return only approvals requested before this time. - schema: - type: string - format: date-time + - $ref: '#/components/parameters/Cursor' + - $ref: '#/components/parameters/EndingBefore' + - $ref: '#/components/parameters/Offset' + - $ref: '#/components/parameters/Search' + - $ref: '#/components/parameters/FunctionKindFilter' responses: '200': - description: Successful response + description: Project schedulers content: application/json: schema: - $ref: '#/components/schemas/PaginatedDurableApprovals' + $ref: '#/components/schemas/FunctionSchedulerListResponse' '400': - description: A filter is invalid, or `from` is after `to` + description: Bad request - invalid pagination or filter content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/durable-approvals/stats: + /projects/{id}/notifications: get: tags: - - Durable Functions - summary: Get durable approval statistics + - Notifications + summary: Get notification settings description: | - Counts the project's approvals by outcome over a time window, overall, - per workflow, and per day. The window defaults to the last 30 days and - can cover up to a year. An approval is counted on the day it was - requested. + Returns where the project's alerts go and when a failing scheduler is + announced. A project that never saved settings returns the defaults: + email to the project owner, no webhook, and an alert after 3 failed + runs in a row, followed by one when the scheduler recovers. - Project access tokens can read statistics, including read-only ones. - operationId: getDurableApprovalStats + The webhook signing secret is never returned here; `secret_configured` + shows whether one is set. A read-only project access token is refused + with `403`, because the webhook URL can carry the receiver's token. + operationId: getNotificationSettings security: - UserToken: [] - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/DurableApprovalFunctionFilter' - - name: from - in: query - required: false - description: Start of the window. Defaults to 30 days before `to`. - schema: - type: string - format: date-time - - name: to - in: query - required: false - description: End of the window. Defaults to now. - schema: - type: string - format: date-time responses: '200': - description: Successful response + description: Notification settings content: application/json: schema: - $ref: '#/components/schemas/DurableApprovalStats' - '400': - description: The window is invalid or longer than 366 days + $ref: '#/components/schemas/NotificationSettings' + '403': + description: The request used a `read_only` project access token content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/durable-approvals/{approvalId}: - get: - tags: - - Durable Functions - summary: Get a durable approval - description: | - Returns one approval: what the workflow asked, the durable function - and execution that asked it, its deadline, and the decision once one - is made. - - Project access tokens can read approvals, including read-only ones. - operationId: getDurableApproval - security: - - UserToken: [] - - ProjectAccessToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/DurableApprovalId' - responses: - '200': - description: Successful response - content: - application/json: - schema: - $ref: '#/components/schemas/DurableApproval' '404': - description: Approval not found + description: Project not found content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/durable-approvals/{approvalId}/approve: - post: + put: tags: - - Durable Functions - summary: Approve a durable approval + - Notifications + summary: Update notification settings description: | - Approves a pending approval. The workflow resumes with the decision. + Changes the project's notification settings. Omitted fields keep their + current values, so `{"email": {"enabled": false}}` only turns email off. - Only a person can decide: use the dashboard or a platform token from - `volcano login`. Project access tokens are refused with `403`. + Alert emails go only to the project owner's verified account email + address. `email.recipients` may be empty or name that address; any + other list is refused with `400`, and so is any non-empty list while + the owner has no verified address. `email.status` in the response + says whether alerts are being emailed. - Approving an approval that is already approved returns it unchanged. - If the workflow cannot be reached right away, the decision still - stands and Volcano keeps delivering it. - operationId: approveDurableApproval + Setting `webhook.url` on a project without a webhook generates its + signing secret, returned in `webhook.secret` in this response only. + Changing the URL keeps the secret. An empty `webhook.url` removes the + webhook and its secret. + + Outside local mode the webhook must be reachable on the public + internet; a URL naming a private or loopback address is refused, and + so is a delivery to a host name that resolves to one. + operationId: updateNotificationSettings security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/DurableApprovalId' requestBody: - required: false + required: true content: application/json: schema: - $ref: '#/components/schemas/DurableApprovalDecisionRequest' + $ref: '#/components/schemas/UpdateNotificationSettingsRequest' responses: '200': - description: Approved + description: Saved content: application/json: schema: - $ref: '#/components/schemas/DurableApproval' + $ref: '#/components/schemas/NotificationSettings' '400': - description: The request body is invalid + description: The request body is invalid, for example a recipient other than the project owner's verified account email address. content: application/json: schema: $ref: '#/components/schemas/Error' '403': - description: The credential is not a person's + description: The request used a `read_only` project access token content: application/json: schema: $ref: '#/components/schemas/Error' '404': - description: Approval not found + description: Project not found content: application/json: schema: $ref: '#/components/schemas/Error' - '409': - description: | - The approval was already denied, or has expired or been cancelled. - `code` is `approval_decided`, `approval_expired`, or - `approval_cancelled`. + /projects/{id}/notifications/webhook-secret: + post: + tags: + - Notifications + summary: Rotate the webhook signing secret + description: | + Replaces the webhook signing secret and returns the settings with the + new one in `webhook.secret`, this once. Every delivery from now on is + signed with the new secret, including retries of earlier alerts. + operationId: rotateNotificationWebhookSecret + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + responses: + '200': + description: Rotated content: application/json: schema: - $ref: '#/components/schemas/Error' - '413': - description: The request body is larger than 16 KiB + $ref: '#/components/schemas/NotificationSettings' + '403': + description: The request used a `read_only` project access token content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/durable-approvals/{approvalId}/deny: + '404': + description: Project not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '409': + description: No webhook is configured. Set `webhook.url` first. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /projects/{id}/notifications/test: post: tags: - - Durable Functions - summary: Deny a durable approval + - Notifications + summary: Send a test notification description: | - Denies a pending approval. The workflow resumes with the decision; a - denial is a value the workflow branches on, not an error. - - Only a person can decide: use the dashboard or a platform token from - `volcano login`. Project access tokens are refused with `403`. - - Denying an approval that is already denied returns it unchanged. - If the workflow cannot be reached right away, the decision still - stands and Volcano keeps delivering it. - operationId: denyDurableApproval + Sends a `notification.test` event on every channel that delivers + right away and reports how each delivery went. A webhook delivery is + signed like an alert. Enabled email is reported undelivered, without + sending, while the project owner has no verified account email + address. One test per project per minute. + operationId: sendTestNotification security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/DurableApprovalId' - requestBody: - required: false - content: - application/json: - schema: - $ref: '#/components/schemas/DurableApprovalDecisionRequest' responses: '200': - description: Denied + description: The test was attempted. Each delivery reports whether it arrived; a failed one is not retried. content: application/json: schema: - $ref: '#/components/schemas/DurableApproval' - '400': - description: The request body is invalid - content: - application/json: - schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/schemas/NotificationTestResult' '403': - description: The credential is not a person's + description: The request used a `read_only` project access token content: application/json: schema: $ref: '#/components/schemas/Error' '404': - description: Approval not found + description: Project not found content: application/json: schema: $ref: '#/components/schemas/Error' '409': - description: | - The approval was already approved, or has expired or been - cancelled. `code` is `approval_decided`, `approval_expired`, or - `approval_cancelled`. + description: No webhook is configured, and email is disabled or the project owner has no verified account email address, so there is nowhere to send. content: application/json: schema: $ref: '#/components/schemas/Error' - '413': - description: The request body is larger than 16 KiB + '429': + description: A test was sent less than a minute ago. content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/frontends: + /projects/{id}/functions/{functionId}/schedulers: get: tags: - - Frontends - summary: List all frontends in a project - description: | - Supports two mutually exclusive pagination modes. Offset mode uses `page` - and `limit` and returns `next` (URL). Cursor mode uses `cursor` and - `limit`, supports `search` (case-insensitive name match), and returns - `next_cursor`. Sending both `page` and `cursor` (or `page` and `search`) - returns 400. - operationId: listFrontends + - Functions + summary: List schedulers for a function + operationId: listFunctionSchedulers 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' + - $ref: '#/components/parameters/FunctionId' responses: '200': - description: Successful response - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedFrontends' - '400': - description: Bad request - invalid project identifier - 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 - project ownership required + description: Function schedulers content: application/json: schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/schemas/FunctionSchedulerListResponse' '404': - description: Project not found - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '500': - description: Internal server error + description: Function not found content: application/json: schema: $ref: '#/components/schemas/Error' post: tags: - - Frontends - summary: Create a new frontend deployment - description: | - Creates and deploys a frontend for the project. - If a frontend with the same name already exists in the project, this operation updates that - frontend using the uploaded archive and starts a new deployment. A deployment that starts - immediately returns `status: provisioning`, then transitions to `active`, `degraded`, or - `failed`. If another deployment is running, the response preserves the frontend's current status - and exposes the queued deployment through `pending_deployment_id`. - Existing frontend traffic continues to use an available runtime while the new deployment builds - and provisions. Each deployment publishes its own static assets before the runtimes switch to its - build, and the live build's assets keep serving until the new deployment is live, so a page loaded - mid-deployment resolves its assets whichever build served it. A failed redeploy puts the runtimes - back on the build they were running, leaves the frontend `active` on the previous deployment, and - records the attempted deployment as failed. `degraded` means the runtime remains available but - edge synchronization requires recovery; Volcano retries the edge step without rebuilding. Only one deployment may run for a - given frontend, while independent frontends and projects can deploy concurrently. - For monorepos, provide `app_root` as a relative path from the uploaded archive root - to the Next.js app that should be built. Omit it for single-app archives. - Supported frontend environments are Next.js 15.x and 16.x with Node.js - 22.x or 24.x. The Node.js runtime is inferred from - `package.json` `engines.node`; if omitted, Volcano uses Node.js 22.x. - The selected Node.js family must also satisfy the installed Next.js package's - `engines.node` constraint. Volcano tests Next 15.5.28 (`^18.18.0 || ^19.8.0 || >=20.0.0`) and Next 16.4.2 (`>=20.9.0`). - Source archive size is enforced by the API with `SOURCE_ARCHIVE_SIZE_LIMIT_MB`; the CLI - does not apply its own source archive size limit. After the final container images are - built, the publish build enforces `LAMBDA_TARGET_CONTAINER_SIZE_LIMIT_MB` before pushing. - This operation is limited by plan-based frontend deployment quotas (`FREE_FRONTEND_DEPLOYMENTS`, `PRO_FRONTEND_DEPLOYMENTS`). - Each project can contain up to 10,000 frontends regardless of plan. - operationId: createFrontend + - Functions + summary: Create a scheduler for a function + description: Creates regional scheduled invocation jobs. Requested regions must be a subset of the function's deployed regions. + operationId: createFunctionScheduler security: - UserToken: [] - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/FunctionId' requestBody: required: true content: - multipart/form-data: + application/json: schema: - type: object - required: - - name - - archive - properties: - name: - type: string - maxLength: 63 - pattern: ^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$ - description: DNS-safe frontend name - framework: - type: string - enum: - - nextjs - default: nextjs - description: Next.js frontend. Supported Next.js majors are 15.x and 16.x. - app_root: - type: string - 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 - description: ZIP or tar.gz archive of the frontend project directory or monorepo workspace root. The API enforces SOURCE_ARCHIVE_SIZE_LIMIT_MB and stores a normalized tar.gz archive. + $ref: '#/components/schemas/CreateFunctionSchedulerRequest' responses: - '200': - description: Existing frontend updated; its deployment was started or queued - content: - application/json: - schema: - $ref: '#/components/schemas/Frontend' '201': - description: Frontend created and deployment workflow started + description: Scheduler created content: application/json: schema: - $ref: '#/components/schemas/Frontend' + $ref: '#/components/schemas/FunctionScheduler' '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '401': - description: Unauthorized - invalid or missing token + description: | + Invalid schedule, geofenced region, a scheduler of this name + already exists on the function, or the function is not active. content: application/json: schema: $ref: '#/components/schemas/Error' '403': - description: Frontend deployment limit exceeded for the current plan or project hard cap + description: | + Schedulers are not available on this plan, or the project already + holds as many as the plan allows. The cap counts standard and + durable function schedulers together. content: application/json: schema: $ref: '#/components/schemas/Error' '404': - description: Project not found - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '409': - description: Conflict - frontend deletion is queued or running + description: Function not found content: application/json: schema: $ref: '#/components/schemas/Error' - '500': - description: Internal server error + /projects/{id}/functions/{functionId}/schedulers/{schedulerId}: + get: + tags: + - Functions + summary: Get a function scheduler + operationId: getFunctionScheduler + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/FunctionId' + - $ref: '#/components/parameters/SchedulerId' + responses: + '200': + description: Function scheduler content: application/json: schema: - $ref: '#/components/schemas/Error' - '503': - description: Service unavailable - frontend workflow or archive limit configuration missing + $ref: '#/components/schemas/FunctionScheduler' + '404': + description: Function or scheduler not found content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/frontends/{frontendId}: - get: + patch: tags: - - Frontends - summary: Get frontend details - operationId: getFrontend + - Functions + summary: Update a function scheduler + operationId: updateFunctionScheduler security: - UserToken: [] - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/FrontendId' + - $ref: '#/components/parameters/FunctionId' + - $ref: '#/components/parameters/SchedulerId' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateFunctionSchedulerRequest' responses: '200': - description: Successful response + description: Scheduler updated content: application/json: schema: - $ref: '#/components/schemas/Frontend' + $ref: '#/components/schemas/FunctionScheduler' '400': - description: Bad request - invalid identifier + description: | + Invalid schedule, geofenced region, or a scheduler of this name + already exists on the function. content: application/json: schema: $ref: '#/components/schemas/Error' - '401': - description: Unauthorized - invalid or missing token + '404': + description: Function or scheduler not found content: application/json: schema: $ref: '#/components/schemas/Error' - '403': - description: Forbidden - project ownership required + delete: + tags: + - Functions + summary: Delete a function scheduler + operationId: deleteFunctionScheduler + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/FunctionId' + - $ref: '#/components/parameters/SchedulerId' + responses: + '204': + description: Scheduler deleted + '404': + description: Function or scheduler not found content: application/json: schema: $ref: '#/components/schemas/Error' - '404': - description: Frontend not found + /projects/{id}/functions/{functionId}/deployments: + get: + tags: + - Functions + summary: List function deployments + operationId: listFunctionDeployments + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/FunctionId' + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/Limit' + responses: + '200': + description: Successful response content: application/json: schema: - $ref: '#/components/schemas/Error' - '500': - description: Internal server error + $ref: '#/components/schemas/PaginatedFunctionDeployments' + '404': + description: Function not found content: application/json: schema: $ref: '#/components/schemas/Error' - delete: + /projects/{id}/functions/{functionId}/candidates: + get: tags: - - Frontends - summary: Delete a frontend + - Functions + summary: List a function's previews description: | - Schedules asynchronous frontend deletion. If another deployment is running, the frontend - preserves its current status and exposes the queued deletion through `pending_deployment_id`. - Its status changes to `deleting` when cleanup starts. After cleanup, it returns 404 and no - longer appears in frontend lists. - operationId: deleteFrontend + Returns the function's previews, oldest first, each with its latest deployment. A function has at most + 20 live previews. Reading never depends on the `functions.candidates` capability. A durable function has no previews: reading its previews answers an empty list, and reading its serving state answers its own build. + operationId: listFunctionCandidates security: - UserToken: [] - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/FrontendId' + - $ref: '#/components/parameters/FunctionId' responses: - '202': - description: Frontend deletion started or queued + '200': + description: The function's previews + content: + application/json: + schema: + $ref: '#/components/schemas/FunctionCandidateList' '400': description: Bad request - invalid identifier content: @@ -7838,7 +8249,7 @@ paths: schema: $ref: '#/components/schemas/Error' '404': - description: Frontend not found + description: Function not found content: application/json: schema: @@ -7849,41 +8260,64 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - '503': - description: Service unavailable - frontend workflow configuration missing - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /projects/{id}/frontends/{frontendId}/redeploy: post: tags: - - Frontends - summary: Redeploy frontend using latest uploaded artifact - description: | - Starts a new frontend workflow using the latest stored artifact. A deployment that starts - immediately returns `status: provisioning`, then transitions to `active`, `degraded`, or - `failed`. An overlapping deployment preserves the frontend's current status, is exposed through - `pending_deployment_id`, and supersedes any older queued deployment. The previous runtime and its - published static assets remain available during provisioning, and a failed redeploy restores the - regional runtimes to that build and keeps it serving while the attempted deployment is recorded as - failed. - operationId: redeployFrontend + - Functions + summary: Create a function preview + description: | + Builds the uploaded source with the function's runtime, handler and variables, and deploys it to a + runtime of its own in every region the function deploys to. The preview is invoked at + `https://.` and is always private, whatever the function's own + visibility: only the project's service key, with `functions.invoke`, can invoke it, and signed-in + users, anon keys and access tokens are refused. It gets none of the function's schedules or warmers. + The response is `202` while the first deployment runs; read the preview for its `status` and `url`. + + While the `functions.candidates` capability is unavailable, including on the local development server, it answers `404` with code `feature_unavailable`. Reading and deleting existing previews, and rolling the function back to its own build, keep + working. + + A preview builds like any deploy and spends the project's build minutes. A function has at most 20 + live previews, and each name is unique within the function. Without `ttl_seconds` a preview is kept + until it is deleted. Durable functions have no previews. + operationId: createFunctionCandidate security: - UserToken: [] - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/FrontendId' + - $ref: '#/components/parameters/FunctionId' + requestBody: + required: true + content: + multipart/form-data: + schema: + type: object + required: + - name + - code + properties: + name: + type: string + minLength: 1 + maxLength: 128 + description: Names the preview within the function. Cannot be `production`. + ttl_seconds: + type: integer + minimum: 1 + maximum: 2592000 + description: Deletes the preview this many seconds after it is created, at most 30 days. Omit to keep it until deleted. + code: + type: string + format: binary + description: The function's source archive, as for deploying the function. Built with the function's runtime and handler. responses: - '200': - description: Frontend redeploy started or queued + '202': + description: Preview created; its first deployment is running content: application/json: schema: - $ref: '#/components/schemas/Frontend' + $ref: '#/components/schemas/FunctionCandidate' '400': - description: Bad request - invalid identifier + description: Bad request - invalid name, expiry, identifier or source archive, or a variable the source reads has no value the function can give it content: application/json: schema: @@ -7901,13 +8335,25 @@ paths: schema: $ref: '#/components/schemas/Error' '404': - description: Frontend not found + description: Function not found, or the capability is unavailable (code `feature_unavailable`) content: application/json: schema: $ref: '#/components/schemas/Error' '409': - description: Conflict - frontend deletion is queued or running + description: 'Conflict. `code: durable_function_unsupported` - the function is durable. `code: candidate_name_taken` - the function has a preview with this name. `code: candidate_limit_reached` - the function has the maximum previews. `code: function_deleting` or `code: project_deleting` - the function or project is being deleted.' + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '413': + description: Request body exceeds the function source archive limit + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: Too many requests - the project's build minutes for the billing cycle are used up (code `build_minutes_exceeded`) content: application/json: schema: @@ -7919,34 +8365,33 @@ paths: schema: $ref: '#/components/schemas/Error' '503': - description: Service unavailable - frontend workflow configuration missing + description: Service unavailable - function deployments are not configured content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/frontends/{frontendId}/domain: + /projects/{id}/functions/{functionId}/candidates/{candidateId}: get: tags: - - Frontends - summary: Get frontend custom domain status - operationId: getFrontendCustomDomain + - Functions + summary: Get a function preview + description: | + Returns the preview with its latest deployment. Never depends on the `functions.candidates` capability. + operationId: getFunctionCandidate security: - UserToken: [] - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/FrontendId' + - $ref: '#/components/parameters/FunctionId' + - $ref: '#/components/parameters/FunctionCandidateId' responses: '200': - description: | - Frontend custom domain status, or null when the frontend has no - custom domain configured (the common empty state). + description: The preview content: application/json: schema: - nullable: true - allOf: - - $ref: '#/components/schemas/FrontendCustomDomainResponse' + $ref: '#/components/schemas/FunctionCandidate' '400': description: Bad request - invalid identifier content: @@ -7966,7 +8411,7 @@ paths: schema: $ref: '#/components/schemas/Error' '404': - description: Frontend not found + description: Function or preview not found content: application/json: schema: @@ -7977,48 +8422,31 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - post: + delete: tags: - - Frontends - summary: Configure frontend custom domain + - Functions + summary: Delete a function preview description: | - Configures one custom domain for a frontend. - The default Volcano-generated frontend URL remains active. - Wildcard Volcano frontend TLS remains valid and isolated from custom-domain certificate changes. - The account must own the hostname: it must have verified the hostname or a domain above it (see `POST /user/domains`). A certificate does not prove ownership. - When the account owns no domain covering the hostname, Volcano asks for a TXT record at `_volcano.`, such as `_volcano.example.com`. Publishing it verifies the whole domain, so later subdomains need no record. A managed TLS request reserves the hostname and returns that record in `verification_records`; the reservation expires after 72 hours unless the record is published. A BYOC request gets `409` with `code: ownership_verification_required` and the record in `required_record`; publish it and send the same request again. - Managed TLS then returns the CNAME that authorizes certificate issuance and renewal. - To move an active BYOC domain to managed TLS without downtime, send `tls.mode: managed` for the same hostname. The response is `200` with the CNAME to publish; the uploaded certificate keeps serving until Volcano issues the managed one, and `serving_certificate` changes from `uploaded` to `managed`. - To move an active managed domain to BYOC without downtime, send `tls.mode: byoc` with the certificate for the same hostname. The response is `200`; the uploaded certificate replaces the managed one at once, and Volcano stops renewing the managed certificate. - An unverified reservation does not block an account that proves ownership. When another account holds one, a request gets `409` with `code: ownership_verification_required` and the caller's own `required_record`; after publishing it, the same request takes over the reservation. When another account verified the domain, the same `409` names the record that moves the domain to the caller once the other account's record is no longer published. A hostname below a domain another account owns otherwise returns `409` without `code`. - operationId: createFrontendCustomDomain + Starts removing the preview's runtime, URL, builds and stored source once any running deployment + finishes; the preview reads `deleting` until that is done, and answers `404` once it is gone. Asking + again for a preview that is already being deleted is the same request. + + A preview the function runs cannot be deleted: roll back first. Deleting one the function only keeps + for a rollback gives that rollback up; the function's own build stays one `to_production` rollback + away. Never depends on the `functions.candidates` capability. + operationId: deleteFunctionCandidate security: - UserToken: [] - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/FrontendId' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/CreateFrontendCustomDomainRequest' + - $ref: '#/components/parameters/FunctionId' + - $ref: '#/components/parameters/FunctionCandidateId' responses: - '200': - description: 'Custom domain already configured with the same hostname. A request with the other TLS mode for the frontend''s active domain switches it in place. To managed TLS, the uploaded certificate keeps serving, with `serving_certificate: uploaded`, until Volcano issues the managed certificate. To BYOC, the uploaded certificate replaces the managed one at once.' - content: - application/json: - schema: - $ref: '#/components/schemas/FrontendCustomDomainResponse' - '201': - description: Custom domain provisioning started - content: - application/json: - schema: - $ref: '#/components/schemas/FrontendCustomDomainResponse' + '202': + description: Deletion started '400': - description: Bad request - invalid domain + description: Bad request - invalid identifier content: application/json: schema: @@ -8030,54 +8458,52 @@ paths: schema: $ref: '#/components/schemas/Error' '403': - description: Forbidden - the plan does not include custom domains, or a managed TLS request would exceed the account's managed TLS certificate limit + description: Forbidden - project ownership required content: application/json: schema: $ref: '#/components/schemas/Error' '404': - description: Frontend not found + description: Function or preview not found content: application/json: schema: $ref: '#/components/schemas/Error' '409': - description: 'Conflict - ownership not verified, custom domain owned or reserved by another account, already in use, still detaching, or frontend already has a custom domain. While a removed domain detaches and Volcano releases it (about a minute for BYOC, a few minutes for managed TLS), adding its hostname to any frontend, or any domain to its frontend, returns `code: custom_domain_releasing` and a `Retry-After` header; send the same request again after that many seconds. A release that will not finish within a few minutes returns the conflict without `code`.' - headers: - Retry-After: - description: Seconds to wait before sending the same request again. Sent only with code `custom_domain_releasing`. - schema: - type: integer + description: '`code: candidate_in_use` - the function runs this preview; roll it back first.' content: application/json: schema: - $ref: '#/components/schemas/FrontendCustomDomainConflictError' + $ref: '#/components/schemas/Error' '500': description: Internal server error content: application/json: schema: $ref: '#/components/schemas/Error' - '503': - description: Service unavailable - custom domain provisioning is temporarily unavailable - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - delete: + /projects/{id}/functions/{functionId}/candidates/{candidateId}/deployments: + get: tags: - - Frontends - summary: Delete frontend custom domain - operationId: deleteFrontendCustomDomain + - Functions + summary: List a function preview's deployments + description: | + Returns the preview's deployments, newest first, at most 100. Never depends on the + `functions.candidates` capability. + operationId: listFunctionCandidateDeployments security: - UserToken: [] - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/FrontendId' + - $ref: '#/components/parameters/FunctionId' + - $ref: '#/components/parameters/FunctionCandidateId' responses: - '204': - description: Custom domain detach scheduled + '200': + description: The preview's deployments + content: + application/json: + schema: + $ref: '#/components/schemas/FunctionCandidateDeploymentList' '400': description: Bad request - invalid identifier content: @@ -8097,13 +8523,7 @@ paths: schema: $ref: '#/components/schemas/Error' '404': - description: Frontend or custom domain not found - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '409': - description: The custom domain switched TLS mode while the request ran. Send it again. + description: Function or preview not found content: application/json: schema: @@ -8114,29 +8534,46 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/frontends/{frontendId}/deployments: - get: + post: tags: - - Frontends - summary: List frontend deployments - operationId: listFrontendDeployments + - Functions + summary: Deploy new source to a function preview + description: | + Builds the uploaded source and deploys it to the preview, which keeps serving its previous + deployment until this one succeeds. A preview takes one deployment at a time, and one the function + runs, or keeps for a rollback, takes none. While the `functions.candidates` capability is unavailable, including on the local development server, it answers `404` with code `feature_unavailable`. + + A deployment builds like any deploy and spends the project's build minutes. + operationId: redeployFunctionCandidate security: - UserToken: [] - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/FrontendId' - - $ref: '#/components/parameters/Page' - - $ref: '#/components/parameters/Limit' + - $ref: '#/components/parameters/FunctionId' + - $ref: '#/components/parameters/FunctionCandidateId' + requestBody: + required: true + content: + multipart/form-data: + schema: + type: object + required: + - code + properties: + code: + type: string + format: binary + description: The function's source archive, as for deploying the function. Built with the function's runtime and handler. responses: - '200': - description: Successful response + '202': + description: The deployment is running content: application/json: schema: - $ref: '#/components/schemas/PaginatedFrontendDeployments' + $ref: '#/components/schemas/FunctionCandidateDeployment' '400': - description: Bad request - invalid identifier + description: Bad request - invalid identifier or source archive, or a variable the source reads has no value the function can give it content: application/json: schema: @@ -8154,57 +8591,83 @@ paths: schema: $ref: '#/components/schemas/Error' '404': - description: Frontend not found + description: Function or preview not found, or the capability is unavailable (code `feature_unavailable`) content: application/json: schema: $ref: '#/components/schemas/Error' - '500': - description: Internal server error + '409': + description: 'Conflict. `code: durable_function_unsupported` - the function is durable. `code: deployment_in_progress` - a deployment of the preview is running; retry once it finishes. `code: candidate_not_deployable` - the preview is being deleted. `code: candidate_in_use` - the function runs this preview or keeps it for a rollback. `code: function_deleting` - the function is being deleted.' content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/frontends/{frontendId}/usage: - get: - tags: - - Frontends - summary: Per-day request and error counts for a single frontend - description: | - Returns a zero-filled daily series of request counts and 5xx - error counts for one frontend, oldest first. Each entry is one - UTC day; missing days (no traffic recorded) come back as - `requests: 0, errors: 0` so the response always has exactly - `days` entries. + '413': + description: Request body exceeds the function source archive limit + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: Too many requests - the project's build minutes for the billing cycle are used up (code `build_minutes_exceeded`) + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: Internal server error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '503': + description: Service unavailable - function deployments are not configured + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /projects/{id}/functions/{functionId}/candidates/{candidateId}/promote: + post: + tags: + - Functions + summary: Promote a function preview + description: | + Points the function's traffic at the preview's runtime. Nothing is deployed or rebuilt, so it + takes effect at once: every call to the function, through its own URL, the invoke route, a + schedule or a frontend route, runs the preview's code, while the function keeps its ID, URL, + visibility, schedules, metering and logs. The function's own build is kept as it is for a + rollback, and what the function ran becomes what a rollback returns to. - Backs the Monitoring section on the frontend detail page in - the Volcano dashboard. `days` defaults to 30 and is capped at 90 to keep - the (frontend_id, day) index scan bounded. - operationId: getFrontendUsageHistory + The preview must be serving a successful deployment built with the variables, runtime and handler + the function has now, in every region the function deploys to, and the function must have a + successful deployment of its own. It is refused while a deployment of the function, or a + synchronization of its variables, runs. Promotion names the `revision` the caller read from + `serving`; a competing promotion or rollback makes it fail with `409`. Once the project's + repository is the source of truth, promotion is refused with `409`, as a direct deploy is. + While the `functions.candidates` capability is unavailable, including on the local development server, it answers `404` with code `feature_unavailable`. + operationId: promoteFunctionCandidate security: - UserToken: [] - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/FrontendId' - - name: days - in: query - description: Number of trailing days to return (1–90, default 30). - required: false - schema: - type: integer - minimum: 1 - maximum: 90 - default: 30 + - $ref: '#/components/parameters/FunctionId' + - $ref: '#/components/parameters/FunctionCandidateId' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/FunctionPromotionRequest' responses: '200': - description: Successful response + description: The function's traffic now runs on the preview content: application/json: schema: - $ref: '#/components/schemas/FrontendUsageHistoryResponse' + $ref: '#/components/schemas/FunctionServing' '400': - description: Bad request - invalid identifier + description: Bad request - invalid identifier or body content: application/json: schema: @@ -8222,258 +8685,215 @@ paths: schema: $ref: '#/components/schemas/Error' '404': - description: Frontend not found - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '500': - description: Internal server error + description: Function or preview not found, or the capability is unavailable (code `feature_unavailable`) content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/frontends/{frontendId}/function-routes: - parameters: - - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/FrontendId' - get: - tags: - - Frontends - summary: List a Frontend's Function routes - operationId: listFrontendFunctionRoutes - security: - - UserToken: [] - - ProjectAccessToken: [] - responses: - '200': - description: Function routes ordered from most to least specific - content: - application/json: - schema: - $ref: '#/components/schemas/FrontendFunctionRouteList' - '401': - description: Unauthorized + '409': + description: 'Conflict. `code: durable_function_unsupported` - the function is durable. `code: stale_revision` - the revision is stale; read `serving` again. `code: already_serving` - the function already runs this preview. `code: candidate_not_ready` - the preview serves no successful deployment, or its latest redeploy failed; redeploy it successfully first. `code: configuration_changed` - the preview was built with other variables, runtime or handler than the function has now; redeploy it. `code: candidate_regions_changed` - the function deploys to a region the preview was not built in; redeploy it. `code: deployment_in_progress` - a deployment of the preview or of the function, or a synchronization of the function''s variables, is running; retry once it finishes. `code: function_not_deployed` - the function has no successful deployment of its own to roll back to. `code: function_deleting` - the function is being deleted. `code: source_managed_by_git` - the project''s repository is the source of truth; deploy from it.' content: application/json: schema: $ref: '#/components/schemas/Error' - '403': - description: Project not owned by the caller + '413': + description: The request body is larger than 4 KiB content: application/json: schema: $ref: '#/components/schemas/Error' '500': - description: Failed to list Function routes + description: Internal server error content: application/json: schema: $ref: '#/components/schemas/Error' - post: + /projects/{id}/functions/{functionId}/serving: + get: tags: - - Frontends - summary: Route a Frontend path to an HTTP Function - operationId: createFrontendFunctionRoute + - Functions + summary: Get what a function runs description: | - The Frontend and Function must belong to this Project. The Function must be a standard - Function with `visibility: public` and HTTP invocation mode, because requests through the - route carry no credential: Volcano does not check a token sent to a route path or add - `__volcano_auth`, so the Function authenticates its callers itself. A Function cannot leave `public` - while a route targets it. The route applies to every hostname that resolves to the - Frontend, including generated, custom-domain, preview, and local hostnames. + Returns whether the function runs its own build or a promoted preview's, what a rollback returns + to, and its latest promotion or rollback. Never depends on the `functions.candidates` capability. + A durable function always runs its own build. + operationId: getFunctionServing security: - UserToken: [] - ProjectAccessToken: [] - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/CreateFrontendFunctionRouteRequest' + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/FunctionId' responses: - '201': - description: Function route created + '200': + description: What the function runs content: application/json: schema: - $ref: '#/components/schemas/FrontendFunctionRoute' + $ref: '#/components/schemas/FunctionServing' '400': - description: Invalid path or non-HTTP Function + description: Bad request - invalid identifier content: application/json: schema: $ref: '#/components/schemas/Error' '401': - description: Unauthorized + description: Unauthorized - invalid or missing token content: application/json: schema: $ref: '#/components/schemas/Error' '403': - description: Project not owned by the caller + description: Forbidden - project ownership required content: application/json: schema: $ref: '#/components/schemas/Error' '404': - description: Frontend or Function not found in the Project - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '409': - description: Path is already routed, the Frontend has reached its 64-route limit, or the Function is not public + description: Function not found content: application/json: schema: $ref: '#/components/schemas/Error' '500': - description: Failed to create Function route + description: Internal server error content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/frontends/{frontendId}/function-routes/{routeId}: - parameters: - - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/FrontendId' - - $ref: '#/components/parameters/FrontendFunctionRouteId' - put: + /projects/{id}/functions/{functionId}/serving/rollback: + post: tags: - - Frontends - summary: Replace a Frontend Function route - description: 'Replaces the route''s target, path, and prefix handling. The new target must meet the same rules as on create, including `visibility: public`.' - operationId: updateFrontendFunctionRoute + - Functions + summary: Roll back what a function runs + description: | + Points the function's traffic back at what served it before its last promotion or rollback, or at + its own build with `to_production`. A rollback is a new activation, so what it leaves becomes what + a further rollback returns to, and it can itself be undone. Nothing is deployed, so it takes effect + at once. It names the `revision` the caller read; a competing activation makes it fail with `409`. + + Rolling back to a preview promotes it again and is refused with `409` when promoting it would be, + and with `404` code `feature_unavailable` while the capability is unavailable. Rolling back to the + function's own build is not: it never depends on the capability, the project's source mode, or a + running deployment of the function. + operationId: rollbackFunctionServing security: - UserToken: [] - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/FunctionId' requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/CreateFrontendFunctionRouteRequest' + $ref: '#/components/schemas/FunctionRollbackRequest' responses: '200': - description: Function route replaced + description: The function's traffic now runs on what it was rolled back to content: application/json: schema: - $ref: '#/components/schemas/FrontendFunctionRoute' + $ref: '#/components/schemas/FunctionServing' '400': - description: Invalid path or non-HTTP Function + description: Bad request - invalid identifier or body content: application/json: schema: $ref: '#/components/schemas/Error' '401': - description: Unauthorized + description: Unauthorized - invalid or missing token content: application/json: schema: $ref: '#/components/schemas/Error' '403': - description: Project not owned by the caller + description: Forbidden - project ownership required content: application/json: schema: $ref: '#/components/schemas/Error' '404': - description: Function route, Frontend, or Function not found + description: 'Function not found, or `code: feature_unavailable` while the `functions.candidates` capability is unavailable and the rollback would make a preview serve again' content: application/json: schema: $ref: '#/components/schemas/Error' '409': - description: Path is already routed, the Frontend has reached its 64-route limit, or the Function is not public - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '500': - description: Failed to replace Function route - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - delete: - tags: - - Frontends - summary: Delete a Frontend Function route - operationId: deleteFrontendFunctionRoute - security: - - UserToken: [] - - ProjectAccessToken: [] - responses: - '204': - description: Function route deleted - '401': - description: Unauthorized - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '403': - description: Project not owned by the caller + description: 'Conflict. `code: durable_function_unsupported` - the function is durable. `code: stale_revision` - the revision is stale; read `serving` again. `code: nothing_to_roll_back` - the function runs its own build and keeps no preview to return to. `code: rollback_unavailable` - the preview to roll back to is gone or serves no successful deployment. `code: function_not_deployed` - the function has no successful deployment of its own. `code: function_deleting` - the function is being deleted. A rollback to a preview is also refused like a promotion: `code: candidate_not_ready`, `code: configuration_changed`, `code: candidate_regions_changed`, `code: deployment_in_progress` and `code: source_managed_by_git`.' content: application/json: schema: $ref: '#/components/schemas/Error' - '404': - description: Function route not found on the Frontend + '413': + description: The request body is larger than 4 KiB content: application/json: schema: $ref: '#/components/schemas/Error' '500': - description: Failed to delete Function route + description: Internal server error content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/variable-environments: + /projects/{id}/durable-functions: get: tags: - - Variable Environments - summary: List variable Environments - operationId: listVariableEnvironments + - Durable Functions + summary: List all durable functions in a project + description: | + Standard functions never appear here, and durable functions never appear + under `/projects/{id}/functions`. The two are separate collections. + operationId: listDurableFunctions security: - UserToken: [] - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/Limit' + - $ref: '#/components/parameters/Search' responses: '200': - description: Variable Environments, with Global first and custom Environments ordered by name - content: - application/json: - schema: - $ref: '#/components/schemas/VariableEnvironmentList' - '401': - description: Unauthorized + description: Successful response content: application/json: schema: - $ref: '#/components/schemas/Error' - '403': - description: Project not owned by the caller + $ref: '#/components/schemas/PaginatedDurableFunctions' + '400': + description: Bad request - invalid pagination parameters content: application/json: schema: $ref: '#/components/schemas/Error' - '500': - description: Failed to list variable Environments + '404': + description: Project not found content: application/json: schema: $ref: '#/components/schemas/Error' post: tags: - - Variable Environments - summary: Create a variable Environment - operationId: createVariableEnvironment - description: Creates a custom variable Environment. Global is reserved and already exists. A Project may have at most 100 custom Environments. + - Durable Functions + summary: Create or update a durable function + description: | + Upload a durable function source bundle. Creates the function on the + first call for a name and redeploys it on every call after that, the + same create-or-update contract `POST /projects/{id}/functions` has. + + Volcano builds and deploys asynchronously. A deployment that starts + immediately returns `status: provisioning`, then transitions to `active` + or `failed`; a deployment that has to wait for a running one is exposed + through `pending_deployment_id`. Existing executions keep running + against the runtime they started on. + + The `durable` configuration is derived from the project's plan rather + than supplied here, and is fixed once the function exists. A name + already held by a standard function is rejected with 409: a function + cannot change kind. + operationId: createDurableFunction security: - UserToken: [] - ProjectAccessToken: [] @@ -8482,1507 +8902,2046 @@ paths: requestBody: required: true content: - application/json: + multipart/form-data: schema: - $ref: '#/components/schemas/CreateVariableEnvironmentRequest' - responses: - '201': - description: Variable Environment created - content: - application/json: - schema: - $ref: '#/components/schemas/VariableEnvironment' - '400': - description: | - Invalid name, or the reserved Global name. Schema-invalid names - return the generic invalid-request error; a reserved name returns - `invalid_variable_environment`. - content: + type: object + required: + - name + - code + - runtime + properties: + name: + type: string + description: DNS-safe function name (lowercase letters, numbers, hyphens; cannot start or end with hyphen) + maxLength: 63 + pattern: ^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$ + example: order-pipeline + code: + type: string + format: binary + description: ZIP or tar.gz archive containing function source code plus dependency manifests/lockfiles. + runtime: + type: string + enum: + - nodejs22.x + - nodejs24.x + - python3.13 + - python3.14 + description: | + Runtime environment. Required. Durable execution needs the + durable authoring API, which ships for these runtimes only; + any other runtime is rejected with 400 and the response + names the ones that work. Note that a durable Python + function needs a newer runtime than a standard one defaults + to. `GET /functions/runtimes` reports `durable_capable` per + runtime. + example: nodejs24.x + handler: + type: string + description: The name of the function to invoke. Defaults to "handler" if not specified. + default: handler + example: handler + visibility: + allOf: + - $ref: '#/components/schemas/FunctionVisibility' + description: | + Who may start an execution. Redeploying is the only way to + change it, since the collection has no update endpoint; omit + it to keep the current visibility, and a new function starts + `private`. + + The standard collection's synchronous invocation fields — + `invocation_mode`, `http_auth_mode`, `openapi_spec` — + configure a request path no durable route serves, and are + rejected with 400 rather than ignored. + is_public: + type: boolean + deprecated: true + description: | + Deprecated alias for `visibility`: `true` means `public` and + `false` means `authenticated`. Sending both with different + meanings returns 400. + variable_scope: + type: string + 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: + type: string + description: | + JSON-encoded array of project variable names this function requires, on top of the ones detected in its source. A declared name the project does not define is rejected with 400; a detected name it does not define is ignored. Only used when `variable_scope` is `scoped`. Omitting this leaves an existing function's declared names unchanged. + commit: + type: string + description: | + JSON-encoded commit the uploaded source came from: `{"repository": "acme/app", "sha": "<40-character commit ID>", "dirty": false}`. `repository` is `owner/name` or a github.com remote URL (`https://github.com/acme/app.git`, `git@github.com:acme/app.git`, or `ssh://git@github.com/acme/app.git`); Volcano drops any credentials in the URL and records `owner/name`. `dirty` is `true` when the uploaded files differ from the commit. All three fields are required, and fields Volcano does not know are ignored. An empty value, `null`, or `""` reports no commit. A malformed commit, or a repository not on GitHub, returns 400 before anything is deployed. Volcano records a function's commit with `commit.verified: false`; a clean commit of the project's connected repository that its production branch holds gets `commit.verification: repository`. + responses: + '200': + description: Existing durable function updated; its deployment was started or queued + content: application/json: schema: - $ref: '#/components/schemas/Error' - '401': - description: Unauthorized + $ref: '#/components/schemas/DurableFunction' + '201': + description: Durable function created and deployment workflow started content: application/json: schema: - $ref: '#/components/schemas/Error' - '403': - description: Project not owned by the caller + $ref: '#/components/schemas/DurableFunction' + '400': + description: | + Bad request (invalid archive, unsupported runtime, invalid name, an + unknown `visibility`, `visibility` and `is_public` disagree, a + malformed `commit`, or a project region that does not offer durable + execution — a durable + function deploys to every region of its project) content: application/json: schema: $ref: '#/components/schemas/Error' - '404': - description: Project no longer exists + '403': + description: Durable function limit exceeded for the project content: application/json: schema: $ref: '#/components/schemas/Error' '409': description: | - A case-insensitive name conflict or the 100-custom-Environment - limit has been reached, or the Project is being deleted. Tell them - apart with `code`, which is `variable_environment_conflict`, - `variable_environment_limit_reached`, or `project_deleting`. + Name is held by a standard function, or a deletion is queued or + running. The request is refused before the deploy starts, so + nothing is deployed. The message `project variables changed during + the upload; retry` means `NODE_PATH` was created, changed or + deleted while the upload was processed; send the same request + again. content: application/json: schema: $ref: '#/components/schemas/Error' '500': - description: Failed to create the variable Environment + description: Internal server error (function deployment failed) content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/variable-environments/{environmentId}: - parameters: - - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/VariableEnvironmentId' + '503': + description: | + Durable deploys are paused platform-wide. The same request succeeds + once they are re-enabled; executions already running are unaffected. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /projects/{id}/durable-functions/{functionId}: get: tags: - - Variable Environments - summary: Get a variable Environment - operationId: getVariableEnvironment + - Durable Functions + summary: Get durable function by ID or name + operationId: getDurableFunction security: - UserToken: [] - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/DurableFunctionId' responses: '200': - description: Variable Environment details + description: Successful response content: application/json: schema: - $ref: '#/components/schemas/VariableEnvironment' - '401': - description: Unauthorized + $ref: '#/components/schemas/DurableFunction' + '404': + description: Durable function not found content: application/json: schema: $ref: '#/components/schemas/Error' - '403': - description: Project not owned by the caller + delete: + tags: + - Durable Functions + summary: Delete a durable function + description: | + 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. + operationId: deleteDurableFunction + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/DurableFunctionId' + responses: + '202': + description: Deletion accepted and teardown started + '404': + description: | + Durable function not found. Also returned for an id that names a + durable function in another project, so the response cannot be used + to tell the two apart. content: application/json: schema: $ref: '#/components/schemas/Error' + /projects/{id}/durable-functions/{functionId}/deployments: + get: + tags: + - Durable Functions + summary: List durable function deployments + operationId: listDurableFunctionDeployments + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/DurableFunctionId' + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/Limit' + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedFunctionDeployments' '404': - description: Variable Environment not found in this Project + description: Durable function not found content: application/json: schema: $ref: '#/components/schemas/Error' - '500': - description: Failed to get the variable Environment + /projects/{id}/durable-functions/{functionId}/schedulers: + get: + tags: + - Durable Functions + summary: List schedulers for a durable function + description: | + The durable collection's counterpart to + `/projects/{id}/functions/{functionId}/schedulers`. A standard + function's id is not accepted here, and a durable function's id is not + accepted there. + operationId: listDurableFunctionSchedulers + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/DurableFunctionId' + responses: + '200': + description: Durable function schedulers + content: + application/json: + schema: + $ref: '#/components/schemas/FunctionSchedulerListResponse' + '404': + description: Durable function not found content: application/json: schema: $ref: '#/components/schemas/Error' - patch: + post: tags: - - Variable Environments - summary: Rename a variable Environment - operationId: renameVariableEnvironment - description: Renames a custom Environment without changing its stable ID. Global cannot be renamed. + - Durable Functions + summary: Create a scheduler for a durable function + description: | + Each tick starts an execution rather than invoking the function, under + an execution name derived from the run, so a retried tick resolves to + the execution it already started. Requested regions must be a subset of + the function's deployed regions. + + A tick draws on the same durable allowances and concurrency cap a + manual start does, and a tick that would exceed the cap fails that run. + operationId: createDurableFunctionScheduler security: - UserToken: [] - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/DurableFunctionId' requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/RenameVariableEnvironmentRequest' + $ref: '#/components/schemas/CreateFunctionSchedulerRequest' responses: - '200': - description: Variable Environment renamed + '201': + description: Scheduler created content: application/json: schema: - $ref: '#/components/schemas/VariableEnvironment' + $ref: '#/components/schemas/FunctionScheduler' '400': description: | - Invalid name, or the reserved Global name. Schema-invalid names - return the generic invalid-request error; a reserved name returns - `invalid_variable_environment`. + Invalid schedule, geofenced region, a scheduler of this name + already exists on the function, or the function is not active. content: application/json: schema: $ref: '#/components/schemas/Error' - '401': - description: Unauthorized + '403': + description: | + Schedulers are not available on this plan, or the project already + holds as many as the plan allows. The cap counts standard and + durable function schedulers together. content: application/json: schema: $ref: '#/components/schemas/Error' - '403': - description: Project not owned by the caller + '404': + description: Durable function not found content: application/json: schema: $ref: '#/components/schemas/Error' + /projects/{id}/durable-functions/{functionId}/schedulers/{schedulerId}: + get: + tags: + - Durable Functions + summary: Get a durable function scheduler + operationId: getDurableFunctionScheduler + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/DurableFunctionId' + - $ref: '#/components/parameters/SchedulerId' + responses: + '200': + description: Durable function scheduler + content: + application/json: + schema: + $ref: '#/components/schemas/FunctionScheduler' '404': - description: Variable Environment not found in this Project + description: Durable function or scheduler not found content: application/json: schema: $ref: '#/components/schemas/Error' - '409': + patch: + tags: + - Durable Functions + summary: Update a durable function scheduler + operationId: updateDurableFunctionScheduler + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/DurableFunctionId' + - $ref: '#/components/parameters/SchedulerId' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateFunctionSchedulerRequest' + responses: + '200': + description: Scheduler updated + content: + application/json: + schema: + $ref: '#/components/schemas/FunctionScheduler' + '400': description: | - A case-insensitive name conflict, an attempt to rename Global, or - a Project being deleted. Tell them apart with `code`, which is - `variable_environment_conflict`, - `variable_environment_immutable`, or `project_deleting`. + Invalid schedule, geofenced region, or a scheduler of this name + already exists on the function. content: application/json: schema: $ref: '#/components/schemas/Error' - '500': - description: Failed to rename the variable Environment + '404': + description: Durable function or scheduler not found content: application/json: schema: $ref: '#/components/schemas/Error' delete: tags: - - Variable Environments - summary: Delete a variable Environment - operationId: deleteVariableEnvironment - description: Deletes a custom Environment. Global cannot be deleted. + - Durable Functions + summary: Delete a durable function scheduler + operationId: deleteDurableFunctionScheduler security: - UserToken: [] - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/DurableFunctionId' + - $ref: '#/components/parameters/SchedulerId' responses: '204': - description: Variable Environment deleted - '401': - description: Unauthorized + description: Scheduler deleted + '404': + description: Durable function or scheduler not found content: application/json: schema: $ref: '#/components/schemas/Error' - '403': - description: Project not owned by the caller + /projects/{id}/durable-functions/{functionId}/executions: + post: + tags: + - Durable Functions + summary: Start a durable execution + description: | + Starts an execution and returns its handle. Never returns a result: an + execution can outlive any request a client could hold open, so the + result is read back from + `GET /projects/{id}/durable-functions/{functionId}/executions/{executionId}`. + + The request body is the execution's input and must be valid JSON if + present. An empty body starts the execution with no input. + + Send `X-Volcano-Execution-Name` to make the start idempotent: repeating a + start with the same name returns the existing execution instead of + beginning a second one. + + Each execution counts against the project's durable execution + allowance, the operations it performs count against the durable + operations allowance when it finishes, and the number of executions in + flight at once is capped by the plan. + operationId: startDurableExecution + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/DurableFunctionId' + - name: X-Volcano-Execution-Name + in: header + required: false + description: | + Idempotency key for this execution. Generated when omitted. A repeat + under a name that already names a running execution returns that + execution and is not charged again. + + Letters, digits, `-`, `_` and `.`, up to 255 characters. Anything + else is rejected with `400`. + schema: + type: string + maxLength: 255 + pattern: ^[A-Za-z0-9._-]+$ + requestBody: + required: false + content: + application/json: + schema: + description: Input passed to the function, up to 256 KiB. + responses: + '202': + description: Execution accepted and started + content: + application/json: + schema: + $ref: '#/components/schemas/DurableExecution' + '400': + description: Payload is not valid JSON, or the execution name is invalid content: application/json: schema: $ref: '#/components/schemas/Error' '404': - description: Variable Environment not found in this Project + description: Durable function not found content: application/json: schema: $ref: '#/components/schemas/Error' '409': description: | - Global is protected, or the Project is being deleted. Tell them - apart with `code`, which is `variable_environment_immutable` or - `project_deleting`. + Function is not deployed yet, or has no deployed region. Also + returned when two starts under the same execution name raced and + both released it, which is retryable as it stands. content: application/json: schema: $ref: '#/components/schemas/Error' - '500': - description: Failed to delete the variable Environment + '413': + description: Payload exceeds the maximum execution input size + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: | + Too many executions already in flight for this project, or the + account is out of one of its billing-cycle durable allowances: + executions, operations, or compute. An owner-started execution is + metered exactly like an application-started one. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '503': + description: | + Durable execution is not available in this environment, or the + plan terms for the start could not be read. The 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: $ref: '#/components/schemas/Error' - /projects/{id}/variables: get: tags: - - Variables - summary: List all variables for a project + - Durable Functions + summary: List a durable function's executions description: | - Returns project-level environment variables used by deployed functions and frontends. - operationId: listVariables + Returns the platform's last observed status for each execution; listing + does not poll each one. Fetch a single execution for its live state. + operationId: listDurableExecutions security: - UserToken: [] - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/DurableFunctionId' - $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: status + in: query + required: false + description: Return only executions in this status. + schema: + $ref: '#/components/schemas/DurableExecutionStatus' responses: '200': description: Successful response content: application/json: schema: - $ref: '#/components/schemas/PaginatedVariables' + $ref: '#/components/schemas/PaginatedDurableExecutions' + '400': + description: Unsupported status filter + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '404': - description: Project not found + description: Durable function not found content: application/json: schema: $ref: '#/components/schemas/Error' - post: + /projects/{id}/durable-functions/{functionId}/executions/{executionId}: + get: tags: - - Variables - summary: Create or update a variable + - Durable Functions + summary: Get a durable execution description: | - Creates a project-level environment variable and triggers asynchronous propagation - to deployed functions and frontends in the project's configured regions. - operationId: createVariable + Returns the execution's current state, including its `result` once it has + succeeded. Poll this to wait for an execution to finish. + operationId: getDurableExecution security: - UserToken: [] - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/CreateVariableRequest' + - $ref: '#/components/parameters/DurableFunctionId' + - $ref: '#/components/parameters/DurableExecutionId' responses: - '201': - description: Variable created + '200': + description: Successful response content: application/json: schema: - $ref: '#/components/schemas/Variable' - '400': - description: Bad request + $ref: '#/components/schemas/DurableExecution' + '404': + description: Durable function or execution not found content: application/json: schema: $ref: '#/components/schemas/Error' '503': - description: Private variable membership writes are disabled during rollout + description: | + Durable execution is not available in this environment, or reads of + the execution's state in its region are throttled. The first means + the capability is paused or this deployment cannot serve it, so the + request is not one to retry in a loop. A throttled read is transient + and carries `Retry-After`. + headers: + Retry-After: + description: | + Seconds to wait before reading again. Sent only when reads in + the execution's region are throttled. + schema: + type: integer content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/databases: + /projects/{id}/durable-functions/{functionId}/executions/{executionId}/operations: get: tags: - - Databases - summary: List all databases for a project + - Durable Functions + summary: List a durable execution's operations description: | - Supports two mutually exclusive pagination modes. Offset mode uses `page` - and `limit`. Cursor mode uses `cursor` and `limit`, supports `search` - (case-insensitive name match), and returns `next_cursor`/`prev_cursor`. - The optional `status` filter applies in both modes and is bound to the - cursor. Sending both `page` and `cursor` (or `page` and `search`) returns 400. - operationId: listDatabases - 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' - - name: status - in: query - required: false - schema: - type: string - enum: - - provisioning - - active - - restoring - - failed - - deleting - description: Return only the databases in this status. - responses: - '200': - description: Successful response - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedDatabases' - post: - tags: - - Databases - summary: Create a new PostgreSQL database - description: | - Creates a PostgreSQL database in the project. - Each project can hold 1 database on HOBBY and up to 10,000 on SUPERAGENT. - Requests over the plan's cap return 403. - operationId: createDatabase - security: - - UserToken: [] - - ProjectAccessToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/CreateDatabaseRequest' - responses: - '201': - description: Database created (provisioning) - content: - application/json: - schema: - $ref: '#/components/schemas/Database' - '403': - description: Database limit exceeded for the project - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /projects/{id}/databases/{databaseName}: - get: - tags: - - Databases - summary: Get database details - operationId: getDatabase + Returns the execution's trace: every operation it began — each step, + wait, poll, child context, map item and parallel branch — with when it + started and ended, how it ended, and each attempt of a retried step. + `invocations` are the windows the function's code was actually running; + the gaps between them are time the execution spent suspended, which is + not charged. + + A finished execution's trace is final and `complete` is `true`. A + running one is refreshed when it is read, and can be up to about ten + seconds behind; `synced_at` says when it was last refreshed. Inputs, + results and other payloads are never included. + + The list is not paginated: an execution is limited to 3,000 + operations, and a trace is read whole. + operationId: listDurableExecutionOperations security: - UserToken: [] - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/DatabaseName' + - $ref: '#/components/parameters/DurableFunctionId' + - $ref: '#/components/parameters/DurableExecutionId' responses: '200': description: Successful response content: application/json: schema: - $ref: '#/components/schemas/Database' - delete: - tags: - - Databases - summary: Delete a database - description: | - Deletes a database and the instance backing it. When the instance is - removed synchronously the database row is deleted and the response is - `204`. If the instance cannot be deleted right away, the database row - is retained (status `deleting`) and its teardown is handed to the - background reconciler, which retries the deletion and removes the row - once the instance is gone; in that case the response is `202`. The database row is - never dropped while its instance still exists, so an instance is - never orphaned without a record to retry from. - operationId: deleteDatabase - security: - - UserToken: [] - - ProjectAccessToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/DatabaseName' - responses: - '202': - description: | - Deletion accepted and in progress. The backing instance could not be - removed synchronously, so the database is marked `deleting` and torn - down asynchronously by the reconciler. - content: - application/json: - schema: - type: object - properties: - status: - type: string - example: deleting - message: - type: string - example: database deletion in progress - '204': - description: Database deleted (backing instance removed synchronously) + $ref: '#/components/schemas/DurableExecutionOperationList' '404': - description: Project or database not found + description: Durable function or execution not found content: application/json: schema: $ref: '#/components/schemas/Error' - '409': - description: | - A restore is running on the database. Deleting it while a worker is - replacing its data would race that worker, so wait for the restore - to finish. + '500': + description: The trace could not be read content: application/json: schema: $ref: '#/components/schemas/Error' '503': description: | - Volcano could not check whether a restore is running, and will not - delete a database that might be mid-restore. Retry. + 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: $ref: '#/components/schemas/Error' - /projects/{id}/databases/{databaseName}/branches: - get: + /projects/{id}/durable-functions/{functionId}/executions/{executionId}/stop: + post: tags: - - Database Branches - summary: List a database's branches + - Durable Functions + summary: Stop a durable execution description: | - Returns every branch of the database, including those still provisioning - and those that failed, since each still holds a name. + Cancels a running execution. Its completed steps are not undone. - Connection strings are omitted. Fetch a single branch to get its - connection string. - operationId: listDatabaseBranches + The call is accepted rather than awaited: cancellation happens behind + it, so the response reports the execution as it was read back and may + still say `running`. Do not branch on that status — the execution + settles into `stopped` shortly after, and polling + `GET /projects/{id}/durable-functions/{functionId}/executions/{executionId}` + is how you see it get there. + + Stopping an execution that already finished is not an error: the + response carries the state it settled in. + operationId: stopDurableExecution security: - UserToken: [] - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/DatabaseName' + - $ref: '#/components/parameters/DurableFunctionId' + - $ref: '#/components/parameters/DurableExecutionId' responses: '200': - description: Successful response + description: | + Stop accepted. The body is the execution as it was read back, which + may still report `running`. content: application/json: schema: - $ref: '#/components/schemas/DatabaseBranchList' + $ref: '#/components/schemas/DurableExecution' '404': - description: Project or database not found + description: Durable function or execution not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '409': + description: Execution has not started yet content: application/json: schema: $ref: '#/components/schemas/Error' '503': - description: Branching is temporarily unavailable + description: | + Durable execution is not available in this environment, or stops or + reads of executions in its region are throttled. The first means the + capability is paused or this deployment cannot serve it, so the + request is not one to retry in a loop. A throttle is transient and + carries `Retry-After`. A stop throttled while reading the execution + back may already have been sent; repeating it is safe, because a + stop of an execution that has ended answers the state it ended in. + headers: + Retry-After: + description: | + Seconds to wait before trying again. Sent only when stops or + reads of executions in the region are throttled. + schema: + type: integer content: application/json: schema: $ref: '#/components/schemas/Error' + /projects/{id}/durable-functions/{functionId}/executions/{executionId}/messages: post: tags: - - Database Branches - summary: Create a branch of a database + - Durable Functions + summary: Send a message to a durable execution description: | - Forks the database into a new branch. The branch starts as an exact copy - of the parent's data and diverges from there. - - Provisioning is asynchronous: the response is `202` with the branch in - `provisioning` and no connection string. Poll the branch until it reports - `active`, at which point it carries its own connection string. + Sends a named message to a running execution, as + `POST /durable-functions/{functionId}/executions/{executionId}/messages` + does for an application. The workflow receives it from + `ctx.waitForMessage` with the same name; until then it is kept, and + waits take messages oldest first. - Retrying a create with a name that already exists returns `409` rather - than a second branch, so a retried request cannot silently consume two - slots of the branch allowance. - operationId: createDatabaseBranch + Project access tokens can send messages, but read-only ones cannot. + A message never decides an approval. + operationId: sendDurableMessage security: - UserToken: [] - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/DatabaseName' + - $ref: '#/components/parameters/DurableFunctionId' + - $ref: '#/components/parameters/DurableExecutionId' + - $ref: '#/components/parameters/DurableMessageIdempotencyKey' requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/CreateDatabaseBranchRequest' + $ref: '#/components/schemas/SendDurableMessageRequest' responses: - '202': - description: Branch accepted and provisioning + '200': + description: A message with this `Idempotency-Key` was already sent; it is returned content: application/json: schema: - $ref: '#/components/schemas/DatabaseBranch' + $ref: '#/components/schemas/DurableMessage' + '201': + description: | + Message sent. `status` is `delivered`, `delivering`, or `queued`, + as on the application route. + content: + application/json: + schema: + $ref: '#/components/schemas/DurableMessage' '400': - description: Invalid branch name or lifetime + description: The name, data or idempotency key is invalid content: application/json: schema: $ref: '#/components/schemas/Error' '403': - description: | - The database has reached its branch allowance, or the owner's plan - does not include branching. + description: The request used a `read_only` project access token content: application/json: schema: $ref: '#/components/schemas/Error' '404': - description: Project or database not found + description: Durable function or execution not found content: application/json: schema: $ref: '#/components/schemas/Error' '409': description: | - A branch of that name already exists on this database, or the - database cannot be branched right now because it is still - provisioning, being restored, failed, or being deleted. + The message cannot be sent. `code` is `execution_not_running` or + `too_many_queued_messages`. content: application/json: schema: $ref: '#/components/schemas/Error' - '503': - description: Branching is temporarily unavailable + '413': + description: The request body is larger than 72 KiB + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: Too many messages sent to this execution content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/databases/{databaseName}/branches/{branchName}: get: tags: - - Database Branches - summary: Get a branch + - Durable Functions + summary: List a durable execution's messages description: | - Returns the branch, including its connection string once it is `active`. - Poll this after creating a branch to learn when it is connectable. - operationId: getDatabaseBranch + Lists the messages sent to and published by an execution, oldest + first. Pass the last `seq` you read as `after` to read only what came + next. + + Project access tokens can list messages, including read-only ones. + operationId: listDurableMessages security: - UserToken: [] - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/DatabaseName' - - $ref: '#/components/parameters/BranchName' + - $ref: '#/components/parameters/DurableFunctionId' + - $ref: '#/components/parameters/DurableExecutionId' + - $ref: '#/components/parameters/DurableMessageDirectionFilter' + - $ref: '#/components/parameters/DurableMessageNameFilter' + - $ref: '#/components/parameters/DurableMessageAfter' + - $ref: '#/components/parameters/DurableMessageLimit' responses: '200': description: Successful response content: application/json: schema: - $ref: '#/components/schemas/DatabaseBranch' - '404': - description: Project, database, or branch not found + $ref: '#/components/schemas/DurableMessageList' + '400': + description: A filter is invalid content: application/json: schema: $ref: '#/components/schemas/Error' - '503': - description: Branching is temporarily unavailable + '404': + description: Durable function or execution not found content: application/json: schema: $ref: '#/components/schemas/Error' - patch: + /projects/{id}/durable-functions/{functionId}/executions/{executionId}/message-waits: + get: tags: - - Database Branches - summary: Extend a branch's lifetime + - Durable Functions + summary: List a durable execution's open message waits description: | - Replaces the branch's lifetime and restarts the countdown from now, so a - branch you are still working on is not swept mid-session. The new - duration is remembered, so a later reset re-arms the same lifetime. - operationId: updateDatabaseBranch + Lists the waits an execution has open in `ctx.waitForMessage`, oldest + first, so you can see which message names it is waiting for. + + Project access tokens can list waits, including read-only ones. + operationId: listDurableMessageWaits security: - UserToken: [] - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/DatabaseName' - - $ref: '#/components/parameters/BranchName' + - $ref: '#/components/parameters/DurableFunctionId' + - $ref: '#/components/parameters/DurableExecutionId' + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/DurableMessageWaitList' + '404': + description: Durable function or execution not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /durable-messages/waits: + post: + tags: + - Durable Functions + summary: Wait for a message from inside a workflow + description: | + Registers a wait for a named message. The Volcano SDK calls this from + `ctx.waitForMessage`; applications do not call it directly. + + `execution_ref` and `callback_id` are opaque values the SDK reads from + the running workflow. Together they are the request's credential, so + the operation takes no other authentication. When a message for the + name is already queued, the wait takes the oldest one at once. + + Retrying is safe: a request for a wait that is already registered + returns it with `200`. + operationId: registerDurableMessageWait + security: [] requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/UpdateDatabaseBranchRequest' + $ref: '#/components/schemas/RegisterDurableMessageWaitRequest' responses: '200': - description: Lifetime updated + description: The wait was already registered content: application/json: schema: - $ref: '#/components/schemas/DatabaseBranch' + $ref: '#/components/schemas/DurableMessageWaitRegistration' + '201': + description: Wait registered + content: + application/json: + schema: + $ref: '#/components/schemas/DurableMessageWaitRegistration' '400': - description: Requested lifetime is outside the allowed range + description: The request body is invalid content: application/json: schema: $ref: '#/components/schemas/Error' '404': - description: Project, database, or branch not found + description: No running durable execution matches `execution_ref` content: application/json: schema: $ref: '#/components/schemas/Error' '409': - description: The branch is being deleted + description: | + The wait cannot be registered now. `code` says why: + + - `callback_not_ready`: the workflow has not finished opening the + wait yet. Retry with a short backoff; the SDK does. + - `callback_closed`: the workflow is no longer waiting on it. + - `callback_taken`: the callback is already registered as an + approval or a messages session. + - `execution_ended`: the execution has finished. + - `too_many_message_waits`: the execution already has the maximum + number of open waits. content: application/json: schema: $ref: '#/components/schemas/Error' - '503': - description: Branching is temporarily unavailable + '413': + description: The request body is larger than 8 KiB content: application/json: schema: $ref: '#/components/schemas/Error' - delete: - tags: - - Database Branches - summary: Delete a branch - description: | - Marks the branch for teardown and returns immediately. The branch stops - accepting connections at once; its fork and its row are removed by a - background job, so a provider outage cannot leave the call hanging or the - branch half-deleted. - - Deleting a branch that is still provisioning is allowed and stops the - build, and repeating the call while teardown is in progress is accepted - again. Once the branch is gone the call returns `404`. - operationId: deleteDatabaseBranch - security: - - UserToken: [] - - ProjectAccessToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/DatabaseName' - - $ref: '#/components/parameters/BranchName' - responses: - '202': - description: Deletion accepted and in progress - content: - application/json: - schema: - type: object - properties: - status: - type: string - example: deleting - message: - type: string - example: branch deletion in progress - required: - - status - - message - '404': - description: Project, database, or branch not found + '429': + description: Too many requests from this execution content: application/json: schema: $ref: '#/components/schemas/Error' '503': - description: Branching is temporarily unavailable + description: | + The wait could not be confirmed with the workflow right now. Retry + with backoff. content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/databases/{databaseName}/branches/{branchName}/reset: + /durable-messages/sessions: post: tags: - - Database Branches - summary: Reset a branch to its parent's current state + - Durable Functions + summary: Open a messages session from inside a workflow description: | - Discards everything written on the branch and re-forks it from the - parent as it is now. + Opens the session a workflow publishes messages with. The Volcano SDK + calls this once per workflow context, on its first `ctx.publish`; + applications do not call it directly. - Returns immediately with the branch in `provisioning`. The rewind runs in - the background; poll the branch until it reports `active` before - connecting again. + As for a wait, `execution_ref` and `callback_id` are the credential. + The session's token is delivered to the workflow itself and never + appears in a response. - The branch keeps its name and its connection string, so anything holding - that string keeps working once it is active again, and its lifetime is - re-armed to the duration it was created with. The branch does not serve - connections for the duration of the reset. - operationId: resetDatabaseBranch - security: - - UserToken: [] - - ProjectAccessToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/DatabaseName' - - $ref: '#/components/parameters/BranchName' + Retrying is safe: a request for a session that is already registered + returns it with `200`. + operationId: openDurableMessageSession + security: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/OpenDurableMessageSessionRequest' responses: - '202': - description: Branch reset accepted; the branch is provisioning + '200': + description: The session was already registered content: application/json: schema: - $ref: '#/components/schemas/DatabaseBranch' + $ref: '#/components/schemas/DurableMessageSessionRegistration' + '201': + description: Session opened + content: + application/json: + schema: + $ref: '#/components/schemas/DurableMessageSessionRegistration' + '400': + description: The request body is invalid + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '404': - description: Project, database, or branch not found + description: No running durable execution matches `execution_ref` content: application/json: schema: $ref: '#/components/schemas/Error' '409': description: | - The branch is not active, a reset is already in progress, the parent - database is being restored, or the parent was restored within the - last 24 hours — a reset re-forks from the parent, and the provider - holds a child's reset shut for that long afterwards. + The session cannot be opened now. `code` is `callback_not_ready`, + `callback_closed`, `callback_taken` (the callback is already + registered as an approval or a message wait), `execution_ended`, + or `too_many_message_sessions`. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '413': + description: The request body is larger than 8 KiB + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: Too many requests from this execution content: application/json: schema: $ref: '#/components/schemas/Error' '503': - description: Branching is temporarily unavailable + description: | + The session could not be confirmed with the workflow right now. + Retry with backoff. content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/databases/{databaseName}/branches/{branchName}/reset-password: + /durable-messages/publish: post: tags: - - Database Branches - summary: Rotate a branch's password + - Durable Functions + summary: Publish a message from inside a workflow description: | - Issues a new password for the branch and invalidates the previous - connection string. Existing connections are not interrupted; new ones - must use the returned string. Proxies pick the rotation up within a few - seconds, so the previous password can still open new connections until - then. + Publishes a named message from a running workflow. The Volcano SDK + calls this from `ctx.publish`; applications do not call it directly. - The parent database's credentials are untouched. - operationId: resetDatabaseBranchPassword - security: - - UserToken: [] - - ProjectAccessToken: [] + The message is stored, listed with the execution's messages, and + delivered live to clients subscribed to the execution. Live delivery + counts against the project's Realtime messages. + + The SDK sends an `Idempotency-Key` that a rerun of the publishing step + repeats, so a step that runs again returns the first message with + `200` and stores nothing new. That message is delivered live again, + and counts again, because the first run may have stopped before + subscribers got it. The SDKs deliver it to a subscriber once. + operationId: publishDurableMessage + security: [] parameters: - - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/DatabaseName' - - $ref: '#/components/parameters/BranchName' + - name: X-Volcano-Durable-Session + in: header + required: true + description: The session token the workflow received when its session opened. + schema: + type: string + minLength: 1 + maxLength: 128 + - $ref: '#/components/parameters/DurableMessageIdempotencyKey' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PublishDurableMessageRequest' responses: '200': - description: Password rotated + description: A message with this `Idempotency-Key` was already published; it is returned content: application/json: schema: - $ref: '#/components/schemas/DatabaseBranch' - '404': - description: Project, database, or branch not found + $ref: '#/components/schemas/DurableMessage' + '201': + description: Message published + content: + application/json: + schema: + $ref: '#/components/schemas/DurableMessage' + '400': + description: The session token header is missing, or the name, data or idempotency key is invalid + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: The session token is not valid content: application/json: schema: $ref: '#/components/schemas/Error' '409': - description: The branch is not active + description: | + The message cannot be published. `code` is + `execution_not_running` or `too_many_published_messages`. content: application/json: schema: $ref: '#/components/schemas/Error' - '503': - description: Branching is temporarily unavailable + '413': + description: The request body is larger than 72 KiB content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/databases/{databaseName}/backups: - get: + /durable-callbacks: + post: tags: - - Database Backups - summary: List a database's backups + - Durable Functions + summary: Get a callback token from inside a workflow description: | - Returns every backup of the database, newest first, together with the - window a point-in-time restore may target. + Registers a waiting step and returns its callback token. The Volcano + SDK calls this from `ctx.waitForCallback`; applications do not call it + directly. - Both backups you took and backups the schedule produced are listed; - `source` tells them apart. Only manual backups count against the plan's - backup allowance. - operationId: listDatabaseBackups - security: - - UserToken: [] - - ProjectAccessToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/DatabaseName' + `execution_ref` and `callback_id` are opaque values the SDK reads from + the running workflow. Together they are the request's credential, so + the operation takes no other authentication. The token works until + the step's own timeout, and only for that step. + + Retrying is safe: a request for a step that is already registered + returns the same token with `200` while the step still waits. Once + the token is answered, or the step times out or ends, a retry answers + `409` with `callback_closed`. + operationId: registerDurableCallback + security: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/RegisterDurableCallbackRequest' responses: '200': - description: Successful response + description: The step was already registered; its token is returned content: application/json: schema: - $ref: '#/components/schemas/DatabaseBackupList' - '403': - description: Backups require SUPERAGENT + $ref: '#/components/schemas/DurableCallbackRegistration' + '201': + description: Token issued + content: + application/json: + schema: + $ref: '#/components/schemas/DurableCallbackRegistration' + '400': + description: The request body is invalid content: application/json: schema: $ref: '#/components/schemas/Error' '404': - description: Project or database not found + description: No running durable execution matches `execution_ref` content: application/json: schema: $ref: '#/components/schemas/Error' '409': description: | - The database has no storage project yet, so there is nothing to - list. A database reports this while it is still provisioning. + The token cannot be issued now. `code` says why: + + - `callback_not_ready`: the workflow has not finished opening the + step yet. Retry with a short backoff; the SDK does. + - `callback_closed`: the workflow is no longer waiting on it. + - `callback_taken`: the step is already registered as an approval + or a message wait. + - `execution_ended`: the execution has finished. + - `too_many_callback_tokens`: the execution already holds the + maximum number of open tokens. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '413': + description: The request body is larger than 8 KiB + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: Too many requests from this execution content: application/json: schema: $ref: '#/components/schemas/Error' '503': - description: Backups are temporarily unavailable + description: | + The step could not be confirmed with the workflow right now. Retry + with backoff. content: application/json: schema: $ref: '#/components/schemas/Error' + /durable-callbacks/succeed: post: tags: - - Database Backups - summary: Back up a database + - Durable Functions + summary: Complete a waiting step with a result description: | - Captures the database as it is now. The backup is available immediately; - its `size_bytes` appears once the storage provider has costed it. + Resumes the workflow step waiting on the token with `result`. Call it + from the system the workflow handed the token to. - Backups are rate-limited to one per minute per database, and capped by - the owner's plan. - operationId: createDatabaseBackup - security: - - UserToken: [] - - ProjectAccessToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/DatabaseName' + The token is the only credential. A token takes one outcome: once it + has succeeded or failed, every later request is refused with + `409 callback_completed`, including a retry of the request that + succeeded it. + operationId: succeedDurableCallback + security: [] requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/CreateDatabaseBackupRequest' + $ref: '#/components/schemas/SucceedDurableCallbackRequest' responses: - '201': - description: Backup created + '200': + description: The workflow has the result content: application/json: schema: - $ref: '#/components/schemas/DatabaseBackup' - '400': - description: Invalid backup name + $ref: '#/components/schemas/DurableCallbackOutcome' + '202': + description: | + The result is recorded and on its way to the workflow, which takes + longer than this request waits. Volcano finishes the delivery; do + not send it again. content: application/json: schema: - $ref: '#/components/schemas/Error' - '403': - description: | - The database has reached its backup allowance, or the owner's plan - does not include backups, which are available only on SUPERAGENT. + $ref: '#/components/schemas/DurableCallbackOutcome' + '400': + description: The token is missing or malformed, or `result` is missing, null, not JSON, or larger than 64 KiB content: application/json: schema: $ref: '#/components/schemas/Error' '404': - description: Project or database not found + description: | + No callback has this token. `code` is `callback_not_found`. content: application/json: schema: $ref: '#/components/schemas/Error' '409': description: | - A backup of that name already exists, the database is not active, a - restore is running on it, or a backup was taken too recently. + The token already has an outcome. `code` is `callback_completed`. content: application/json: schema: $ref: '#/components/schemas/Error' - '503': - description: Backups are temporarily unavailable + '410': + description: | + The workflow no longer waits on the token. `code` says why: + + - `callback_expired`: the step timed out, on its own timeout or + its heartbeat timeout. + - `execution_ended`: the execution finished or stopped. content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/databases/{databaseName}/backups/{backupName}: - get: - tags: - - Database Backups - summary: Get a backup - description: Returns one backup of the database. - operationId: getDatabaseBackup - security: - - UserToken: [] - - ProjectAccessToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/DatabaseName' - - $ref: '#/components/parameters/BackupName' - responses: - '200': - description: Successful response + '413': + description: The request body is larger than 72 KiB content: application/json: schema: - $ref: '#/components/schemas/DatabaseBackup' - '403': - description: Backups require SUPERAGENT + $ref: '#/components/schemas/Error' + '429': + description: Too many callback requests for the token or its project. Retry later. content: application/json: schema: $ref: '#/components/schemas/Error' - '404': - description: Project, database, or backup not found + /durable-callbacks/fail: + post: + tags: + - Durable Functions + summary: Fail a waiting step + description: | + Resumes the workflow step waiting on the token by raising `error`. The + SDKs raise it as `CallbackFailedError`, carrying its `type` and + `message`. + + The token is the only credential, and takes one outcome, as for + succeeding it. + operationId: failDurableCallback + security: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/FailDurableCallbackRequest' + responses: + '200': + description: The workflow has the error content: application/json: schema: - $ref: '#/components/schemas/Error' - '409': + $ref: '#/components/schemas/DurableCallbackOutcome' + '202': description: | - The database has no storage project yet, so it holds no backups. A - database reports this while it is still provisioning. + The error is recorded and on its way to the workflow. Volcano + finishes the delivery; do not send it again. content: application/json: schema: - $ref: '#/components/schemas/Error' - '503': - description: Backups are temporarily unavailable + $ref: '#/components/schemas/DurableCallbackOutcome' + '400': + description: The token is missing or malformed, or the error's `type` or `message` is invalid content: application/json: schema: $ref: '#/components/schemas/Error' - delete: - tags: - - Database Backups - summary: Delete a backup - description: | - Deletes the backup and frees its storage. Scheduled backups can be - deleted too. A backup that is already gone reports `404`, so a name - that never existed and a name that no longer does read the same. - Refused with `409` while the database is being restored. - operationId: deleteDatabaseBackup - security: - - UserToken: [] - - ProjectAccessToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/DatabaseName' - - $ref: '#/components/parameters/BackupName' - responses: - '200': - description: Backup deleted + '404': + description: | + No callback has this token. `code` is `callback_not_found`. content: application/json: schema: - type: object - properties: - status: - type: string - example: deleted - message: - type: string - example: backup deleted - required: - - status - - message - '403': - description: Backups require SUPERAGENT + $ref: '#/components/schemas/Error' + '409': + description: | + The token already has an outcome. `code` is `callback_completed`. content: application/json: schema: $ref: '#/components/schemas/Error' - '404': - description: Project, database, or backup not found + '410': + description: | + The workflow no longer waits on the token. `code` is + `callback_expired` or `execution_ended`. content: application/json: schema: $ref: '#/components/schemas/Error' - '409': - description: | - The database is being restored. A restore is pinned to a backup it - may not have restored yet, so deleting one is refused until the - restore finishes. + '413': + description: The request body is larger than 200 KiB, or its JSON has too many objects, arrays or values content: application/json: schema: $ref: '#/components/schemas/Error' - '503': - description: Backups are temporarily unavailable + '429': + description: Too many callback requests for the token or its project. Retry later. content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/databases/{databaseName}/backup-schedule: - get: + /durable-callbacks/heartbeat: + post: tags: - - Database Backups - summary: Get the automated backup schedule + - Durable Functions + summary: Keep a waiting step alive description: | - Returns the database's backup schedule. An empty list means no scheduled - backups. - operationId: getDatabaseBackupSchedule - security: - - UserToken: [] - - ProjectAccessToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/DatabaseName' + Tells the workflow step waiting on the token that the work is still + going on, restarting its heartbeat timeout. A heartbeat never extends + the step's own timeout, and a step without a heartbeat timeout needs + none. + operationId: heartbeatDurableCallback + security: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/HeartbeatDurableCallbackRequest' responses: '200': - description: Successful response + description: The step is still waiting content: application/json: schema: - $ref: '#/components/schemas/DatabaseBackupSchedule' - '403': - description: Backups require SUPERAGENT + $ref: '#/components/schemas/DurableCallbackOutcome' + '400': + description: The token is missing or malformed content: application/json: schema: $ref: '#/components/schemas/Error' '404': - description: Project or database not found + description: | + No callback has this token. `code` is `callback_not_found`. content: application/json: schema: $ref: '#/components/schemas/Error' '409': description: | - The database has no storage project yet, so it has no schedule. A - database reports this while it is still provisioning. + The token already has an outcome. `code` is `callback_completed`. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '410': + description: | + The workflow no longer waits on the token. `code` is + `callback_expired` or `execution_ended`. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '413': + description: The request body is larger than 8 KiB + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: Too many callback requests for the token or its project. Retry later. content: application/json: schema: $ref: '#/components/schemas/Error' '503': - description: Backups are temporarily unavailable + description: The heartbeat could not reach the workflow right now. Retry with backoff. content: application/json: schema: $ref: '#/components/schemas/Error' - put: + /durable-approvals: + post: tags: - - Database Backups - summary: Replace the automated backup schedule + - Durable Functions + summary: Request an approval from inside a workflow description: | - Replaces the schedule wholesale. Send an empty `entries` list to stop - scheduled backups. + Registers an approval request for a running durable execution. The + Volcano SDK calls this from `ctx.waitForApproval`; applications do not + call it directly. - Scheduled backups do not count against the plan's backup allowance, but - their retention is clamped to the plan's. - operationId: updateDatabaseBackupSchedule - security: - - UserToken: [] - - ProjectAccessToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/DatabaseName' + `execution_ref` and `callback_id` are opaque values the SDK reads from + the running workflow. Together they are the request's credential, so + the operation takes no other authentication. The approval belongs to + the project that owns the execution, and expires when the workflow's + own approval timeout does. + + Retrying is safe: a request for an approval that is already registered + returns it with `200`. + operationId: requestDurableApproval + security: [] requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/DatabaseBackupSchedule' + $ref: '#/components/schemas/RequestDurableApprovalRequest' responses: '200': - description: Schedule replaced + description: The approval was already registered content: application/json: schema: - $ref: '#/components/schemas/DatabaseBackupSchedule' - '400': - description: | - The schedule names a recurrence that cannot fire: a weekly or - monthly one with no `day`, or a `day` outside its frequency's range - (1-7 for weekly, 1-28 for monthly). The response says which. + $ref: '#/components/schemas/DurableApprovalRegistration' + '201': + description: Approval registered content: application/json: schema: - $ref: '#/components/schemas/Error' - '403': - description: Backups require SUPERAGENT + $ref: '#/components/schemas/DurableApprovalRegistration' + '400': + description: The request body is invalid content: application/json: schema: $ref: '#/components/schemas/Error' '404': - description: Project or database not found + description: No running durable execution matches `execution_ref` content: application/json: schema: $ref: '#/components/schemas/Error' '409': description: | - The database is not active, or a restore is running on it — a restore - moves the data to a new branch, and the provider keeps the schedule - per branch. + The approval cannot be registered now. `code` says why: + + - `approval_not_ready`: the workflow has not finished opening the + approval yet. Retry with a short backoff; the SDK does. + - `approval_closed`: the workflow is no longer waiting on it. + - `callback_taken`: the callback is already registered as a + message wait or a messages session. + - `execution_ended`: the execution has finished. + - `too_many_pending_approvals`: the execution already has the + maximum number of pending approvals. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '413': + description: The request body is larger than 64 KiB + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: Too many approval requests from this execution or address content: application/json: schema: $ref: '#/components/schemas/Error' '503': - description: Backups are temporarily unavailable + description: | + The approval could not be confirmed with the workflow right now. + Retry with backoff. content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/databases/{databaseName}/restores: + /projects/{id}/capabilities: get: tags: - - Database Backups - summary: List a database's restores + - Projects + summary: List a project's capabilities description: | - Returns the database's restore history, newest first, capped at the 50 - most recent. There is no pagination: a database that has been restored - more than 50 times keeps the older records but does not return them. - operationId: listDatabaseRestores + Lists which product capabilities accept new work for this project. It + has the same entries as `GET /capabilities`, and answers each one as it + does, except for capabilities a project can have when another can't: + + | ID | Available for this project when | + | --- | --- | + | `lavaflow` | LavaFlow is released, offered to the project's owner, and included in the owner's plan | + | `lavaflow.merge` | `lavaflow` is, and LavaFlow's merging is released in this environment | + | `lavaflow.lineage` | `lavaflow` is, and fix lineage is released in this environment | + | `lavaflow.open_pr_ci_start` | `lavaflow` is, and CI for fixes a person merges is released in this environment | + | `lavaflow.repository_ci` | `lavaflow` is, and normal repository CI is released; the owner must separately grant `allow_ungated_workflows` | + | `lavaflow.code_quality` | `lavaflow` is, Code Quality is released in this environment, and the owner's plan allows Code Quality findings; with an allowance of 0 it is `unavailable` with `code` `plan_required` | + | `lavaflow.slack` | `lavaflow` is, the Volcano Slack app is set up in this environment, and Slack reports have launched in it | + | `lavaflow.aikido` | `lavaflow` is, and Aikido reports have launched in this environment | + + Where `lavaflow` isn't available, a project with LavaFlow settings, runs, + or bound Slack channels lists it `read_only`: its LavaFlow reads answer, + and its owner can turn LavaFlow off or remove channel bindings. A project without them lists it `unavailable`, with + `code` `plan_required` when the owner's plan leaves LavaFlow out. + + Check it to decide what to offer for a project, instead of calling a + route to see whether it fails. Project access tokens can read it, + including read-only ones. + operationId: listProjectCapabilities security: - UserToken: [] - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/DatabaseName' responses: '200': - description: Successful response + description: Capabilities for this project content: application/json: schema: - $ref: '#/components/schemas/DatabaseRestoreList' - '403': - description: Backups require SUPERAGENT + $ref: '#/components/schemas/CapabilityList' + '401': + description: Not authenticated content: application/json: schema: $ref: '#/components/schemas/Error' '404': - description: Project or database not found - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '503': - description: Backups are temporarily unavailable + description: Project not found content: application/json: schema: $ref: '#/components/schemas/Error' - post: + /lavaflow/settings: + get: tags: - - Database Backups - summary: Restore a database + - LavaFlow + summary: Get LavaFlow settings description: | - Replaces the database's data, either with a named backup or with its - state at a point in time. This is destructive: everything written after - that point is discarded. - - Asynchronous: the response is `202` with the restore `pending` and the - database `restoring`. The database does not accept connections until the - restore reports `completed`; its connection string is unchanged - throughout, so nothing holding it needs updating. + Returns whether LavaFlow works on the project's issues and how far it + goes on its own. LavaFlow takes project guidance from the repository's + AGENTS.md and CLAUDE.md, not from a setting. A project + that never saved settings returns the defaults, with LavaFlow off. + LavaFlow sends this project's logs and source code to an AI service + that Volcano operates. - Restores are in place. There is no way to restore into a second - database, and a database's branches are never restored — they keep - serving their own data, but resetting a branch from its parent is - refused by the storage provider for up to 24 hours afterwards. - operationId: createDatabaseRestore + `can_update` says whether the caller can save the settings: only the + project's owner can, with a platform token. Project access tokens can + read the settings, including read-only ones. + operationId: getLavaflowSettings security: - UserToken: [] - ProjectAccessToken: [] parameters: - - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/DatabaseName' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/CreateDatabaseRestoreRequest' + - $ref: '#/components/parameters/ProjectIdQuery' responses: - '202': - description: Restore accepted and in progress + '200': + description: The project's LavaFlow settings content: application/json: schema: - $ref: '#/components/schemas/DatabaseRestore' + $ref: '#/components/schemas/LavaflowSettings' '400': - description: | - Neither or both restore targets were named, or the requested time is - outside the available window. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '403': - description: | - The owner's plan does not include backups or point-in-time restore. - Both are available only on SUPERAGENT. + description: '`project_id` is missing or not a UUID.' content: application/json: schema: $ref: '#/components/schemas/Error' - '404': - description: Project, database, or backup not found + '401': + description: Not authenticated content: application/json: schema: $ref: '#/components/schemas/Error' - '409': - description: | - A restore is already in progress, the database is not active, - another database operation is still running, or the database is - holding as many pre-restore branches as it may. + '403': + description: Code `plan_required` means the owner's plan does not include LavaFlow and the project has no LavaFlow records. Without a code, the owner's plan could not be read; retry later. content: application/json: schema: $ref: '#/components/schemas/Error' - '503': - description: Backups are temporarily unavailable + '404': + description: Not found. A project the caller can't read answers exactly like one that doesn't exist, and so does one being deleted. Code `feature_unavailable` means LavaFlow is not available for this project and it has no LavaFlow records. content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/databases/{databaseName}/restores/{restoreId}: - get: + patch: tags: - - Database Backups - summary: Get a restore - description: | - Returns the restore. Poll this after starting one; the database is - connectable again once it reports `completed`. - operationId: getDatabaseRestore + - LavaFlow + summary: Update LavaFlow settings + description: | + Changes the fields the request names for the project `project_id` + names; an omitted field keeps its saved value, or its default when + nothing is saved. `{"project_id": "…", "enabled": true}` turns LavaFlow + on for every function, frontend and durable function in the project, + and records the repository the project points at as the one LavaFlow + works in. A request carrying `"enabled": true` is a turn-on, even while + LavaFlow is on. When the project points at no repository at a turn-on, + the first repository it connects afterwards is recorded. A request + that omits `enabled` never changes which repository is recorded. + LavaFlow sends this project's logs and source code to an AI service + that Volcano operates. + + Turning LavaFlow on, from off, also starts runs for up to 5 open issues + with `exception: true` and an `event_count` of at least 2, last seen in + the past 7 days, most recently seen first, leaving out any issue + LavaFlow already ran; runs LavaFlow queued on its own and hasn't + started count toward the 5. They start like any run LavaFlow starts on + its own, up to 3 at once per project. Only the owner's save with a + `volcano login` token whose sign-in is live, a live Volcano dashboard + sign-in, or a platform token that expires, starts them; any other save turns LavaFlow on without them. A save while LavaFlow is on starts none, and neither + does LavaFlow becoming available to the project. + + Only the project's owner can save, with a platform token or a live + Volcano dashboard sign-in, while their account is active. A full-scope project access token can only turn + settings off: a body with `project_id` and + `"code_quality": {"enabled": false}`, each field spelled exactly and + sent once, and nothing else. Any other + body from a project access token, including one that turns a setting + on, adds a field, sends `null`, or names a field the schema doesn't + have, gets `403` with code `person_required`, as does a request made + through MCP. A read-only project access token is refused as read-only + first, without a code, + and so is the owner of a read-only account. + + `code_quality.enabled: true` turns on LavaFlow Code Quality, which + reviews the lines each production deploy of a frontend changes and + turns what it confirms into issues and pull requests. Function deploys + ask for no scan yet. It needs the project's `lavaflow.code_quality` + capability: while Code Quality isn't released here the save answers + `400` with code `feature_unavailable`, and while the owner's plan + allows no Code Quality findings it answers `403` with code + `plan_required`. Only the owner can turn it on, with the check below. + Turning it off always works, and drops the deploys waiting to be + scanned. + + Under `autonomy: open_pr`, when `lavaflow.repository_ci` is available + and the owner has granted `allow_ungated_workflows` for the connected + repository, LavaFlow opens reviewed fixes ready for review without a CI-skip marker + or checking workflows for approval. The repository controls which CI + runs and which credentials it uses. A person still merges the fix. + A review that did not pass opens a draft without suppressing CI. + Without this permission, LavaFlow retains its guarded publication + policy, including workflow checks and CI-skip markers, and may hold + a fix instead of opening a pull request where CI could run it with + credentials before review. Capability availability alone never grants + repository permission. Changing the repository or GitHub App + installation clears the permission. Revocation affects later writes; + it does not cancel existing pull requests or CI runs. + For consent tied to the repository shown to the owner, send + `expected_repository` with its `repo_id` and `repo_installation_id`. + The save checks both under its transaction lock, including an + idempotent grant. A mismatch returns `409 repository_changed` without + changing settings or audit history. Refresh the connection and ask the + owner again; never automatically retry with the new connection. + The same normal CI policy applies when LavaFlow leaves merging to a + person. In Merge mode, fixes from connected reports can use normal + repository CI after LavaFlow verifies the repository revision and + current source authorization. Without the CI grant, they follow + guarded workflow checks. All fixes must satisfy the project's merge + policy and the repository's required checks and approvals. + Code Quality follows the project's autonomy and opens a pull request + only after its review passes. + + `autonomy: merge` needs the project's `lavaflow.merge` capability. + Without it, a save that sets `autonomy` to `merge`, or changes + `merge_policy`, answers `400` with code `feature_unavailable`. A save + that sends the saved values again passes this check, though it can + still need the owner's check below, and a project at `merge` can + still change to another autonomy. The save doesn't read the + repository's branch rules: LavaFlow merges only into a base branch + that requires at least one status check, and holds every fix with + `no_required_checks` on any other. + + Changing `autonomy` to `merge` lets LavaFlow merge with no one else + looking. So does turning `enabled` on while `autonomy` stays `merge`, + and changing `merge_policy`, to any value, while `autonomy` is, or + becomes, `merge`. Turning `allow_ungated_workflows` on lets LavaFlow + open a fix where a workflow could run it with the repository's + secrets before a person approves it. Turning `code_quality` on starts + work on every frontend production deploy with no incident behind it. + Only the owner can make these changes, with a credential of + their own that expires: a `volcano login` token + whose sign-in is live, a live Volcano dashboard sign-in, or a + platform token with an expiry. The owner's + GitHub account must also be able to push to the project's repository. + A project access token, MCP, a platform token that never expires, a + sign-in that ended, an owner who can't push, and a project with no + repository get `403` with code `person_required`, and nothing is + saved. Turning LavaFlow, `allow_ungated_workflows` or `code_quality` + off needs no check. + Nothing is saved either when the push check can't be answered (`429` + or `503`, with `Retry-After`). When the project points at another + repository, reaches its repository through another Volcano GitHub App + installation, or points at none, `autonomy` changes from `merge` to + `open_pr`; pointing back doesn't change it back. Reconnecting after a + reinstall of the App counts as another installation. + + Turning LavaFlow on needs a plan that includes it (`403`, code + `plan_required`). LavaFlow is available where the project's + `lavaflow` capability is, which includes the owner's plan. Where it is + not, a project with LavaFlow records can still turn LavaFlow, Code + Quality or both off: a save that sends `enabled: false`, + `code_quality: {enabled: false}` or both, and otherwise only + `allow_ungated_workflows: false` sent with `enabled`. Any other save, + and any save for a project without records, answers `404` with code + `feature_unavailable` while LavaFlow is not offered to the project, and + `403` with code `plan_required` when it is but the owner's plan does + not include it. + operationId: patchLavaflowSettings security: - UserToken: [] + - AuthUserAccessToken: [] - ProjectAccessToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/DatabaseName' - - $ref: '#/components/parameters/RestoreId' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/LavaflowSettingsUpdate' responses: '200': - description: Successful response + description: Saved content: application/json: schema: - $ref: '#/components/schemas/DatabaseRestore' + $ref: '#/components/schemas/LavaflowSettings' + '400': + description: 'The body is invalid: `project_id` missing or not a UUID, no field to change, an unknown field or autonomy, a `human_review_paths` pattern that is not relative to the repository root or holds a NUL character. Code `feature_unavailable` means the save sets `autonomy: merge` or changes `merge_policy` without the project''s `lavaflow.merge` capability, or turns `code_quality` on while Code Quality isn''t released.' + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Not authenticated + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '403': - description: Backups require SUPERAGENT + description: 'Code `person_required` means a full-scope project access token made any save but turning Code Quality off, MCP made the request, or the save turns on a setting only the project''s owner may turn on, and the owner did not make it with a credential of their own that expires: a `volcano login` token whose sign-in is live, a live Volcano dashboard sign-in, or a platform token with an expiry, never a project access token or a platform token that never expires. Those settings are `code_quality`, `allow_ungated_workflows`, `autonomy: merge`, `enabled` turned on while `autonomy` stays `merge`, and a change to `merge_policy` while `autonomy` is or becomes `merge`. It also means the owner''s GitHub account can''t push to the project''s repository, or the project has none. Code `plan_required` means the owner''s plan does not include LavaFlow, or allows no Code Quality findings for a save that turns `code_quality` on. Without a code: a read-only project access token made the request, the owner''s account is read-only, or the owner''s plan could not be read and nothing was saved; retry later.' content: application/json: schema: $ref: '#/components/schemas/Error' '404': - description: Project, database, or restore not found + description: Not found. A project the caller can't read answers exactly like one that doesn't exist, and so does one being deleted. Code `feature_unavailable` means LavaFlow is not available for this project and the save does more than turn LavaFlow or Code Quality off on a project with LavaFlow records. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '409': + description: Another save, or a change of the project's repository, changed the settings while this save checked them, and kept changing them when it tried again. Nothing was saved. Send the request again. Code `repository_changed` means the supplied `expected_repository` does not match the connected repository and installation. Nothing was saved; review the new connection before sending a new request. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '413': + description: Request body exceeds 131,072 bytes, or its JSON has too many objects, arrays or values + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: | + The save turns on `code_quality`, `allow_ungated_workflows` or + `autonomy: merge`, turns `enabled` on under `merge`, changes + `merge_policy` under `merge`, or + lets the runs LavaFlow starts on its own merge again, and the project, or its owner across their + projects, used up the hour's checks of the owner's GitHub push access. + Nothing was saved. Try again after `Retry-After`. + headers: + Retry-After: + description: Seconds until the budget's hour ends. + schema: + type: integer content: application/json: schema: $ref: '#/components/schemas/Error' '503': - description: Backups are temporarily unavailable + description: | + The save turns on `code_quality`, `allow_ungated_workflows` or + `autonomy: merge`, turns `enabled` on under `merge`, changes + `merge_policy` under `merge`, or + lets the runs LavaFlow starts on its own merge again, and the owner's GitHub push access could not be + checked now. + Nothing was saved. Try again after `Retry-After`. + headers: + Retry-After: + description: Seconds to wait before saving again. + schema: + type: integer content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/databases/{databaseName}/reset-password: - post: + /lavaflow/connector-bindings: + get: tags: - - Databases - summary: Reset database password + - LavaFlow + summary: List the project's connector bindings description: | - Rotates the Volcano-managed PostgreSQL password used by clients when connecting - through pgproxy. This does not rotate or expose the internal owner password. - The returned password and connection string are the only client credentials that - will authenticate through pgproxy after reset. - - Existing connections are not interrupted; new ones must use the returned - string. Proxies pick the rotation up within a few seconds, so the previous - password can still open new connections until then. - operationId: resetDatabasePassword + Lists where problems are reported to LavaFlow from for the project, + such as Slack channels. In a bound Slack channel, someone whose Slack + identity is connected to the project owner's account can mention the + Volcano app to report a problem. Project access tokens can read the + list, including read-only ones, and so can MCP, as + `get_lavaflow_connector_bindings`. The list answers whether or not the + project's `lavaflow.slack` capability is available. + operationId: listLavaflowConnectorBindings security: - UserToken: [] - ProjectAccessToken: [] parameters: - - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/DatabaseName' + - $ref: '#/components/parameters/ProjectIdQuery' responses: '200': - description: Password reset successful + description: The project's connector bindings content: application/json: schema: - type: object - properties: - message: - type: string - role_name: - type: string - description: Volcano-managed per-database client login (also the pgproxy routing username) - example: volcano_client_11111111-1111-1111-1111-111111111111 - new_password: - type: string - description: New Volcano-managed client password. Always starts with `vpg_`. - connection_string: - type: string - description: Updated pgproxy connection string using Volcano-managed credentials. + $ref: '#/components/schemas/LavaflowConnectorBindingsResponse' '400': - description: Database is not active - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '404': - description: Database not found + description: '`project_id` is missing or not a UUID.' content: application/json: schema: $ref: '#/components/schemas/Error' - '409': - description: | - A restore is running on the database. A restore replaces the - credentials as it finishes, so wait for it and rotate afterwards. + '401': + description: Not authenticated content: application/json: schema: $ref: '#/components/schemas/Error' - '503': - description: | - Volcano could not check whether a restore is running, and will not - rotate a credential a restore might be about to replace. Retry. + '404': + description: Not found. A project the caller can't read answers exactly like one that doesn't exist, and so does one being deleted. content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/databases/{databaseName}/type: - patch: + post: tags: - - Databases - summary: Update database size - description: | - Change the size tier of a database. This may briefly interrupt active connections. + - LavaFlow + summary: Bind a connector to the project + description: | + Binds a place in a connector to the project, so problems reported + there reach LavaFlow for it, and answers `201`. Send `slack` for a + `slack` connector and `aikido` for an `aikido` one. For a `slack` + connector the place is a channel. Binding a channel that is already + bound answers `200` with that binding, and makes the current owner the + one who bound it, so a retry is safe. One of the Slack identities the + caller's sign-in session signed in as must belong to the connector's + workspace and be a member of the channel, so on an account several + people share, each binds only channels they are in. The channel must + be one the picker (`GET /user/slack/channels`) lists: not archived, a + Slack Connect channel, or shared across an organization. The Volcano + app joins a public channel it is not in yet, and stays in it if the + binding then fails; a private channel needs the app invited first. - **Available sizes:** - - `volcano-db-xs`: Up to ~1GB RAM - Development, small apps - - `volcano-db-s`: Up to ~4GB RAM - Production-ready, light traffic - - `volcano-db-m`: Up to ~8GB RAM - Medium traffic applications - - `volcano-db-l`: Up to ~16GB RAM - High traffic, larger datasets - - `volcano-db-xl`: Up to ~32GB RAM - Heavy workloads - - `volcano-db-2xl`: Up to ~64GB RAM - Enterprise-scale - operationId: updateDatabaseType + For an `aikido` connector the place is the workspace's new code + (SAST) issues on the project's GitHub repository, at or above + `min_severity`. The caller must have + connected the workspace. Binding it again answers `200` and sets the + new minimum. Each issue starts a LavaFlow run that stops at a pull + request for review. + + Only the project's owner can bind, with a platform token or a live + dashboard sign-in session. A session must come from the dashboard's + own configured project; another project's session gets `403`. A project + access token, or a request made through MCP, gets `403` with code + `person_required`. Binding a Slack channel needs the project's + `lavaflow.slack` capability, and binding Aikido its + `lavaflow.aikido` capability: where it is unavailable, this answers + `404` with code `feature_unavailable`, or `403` with code + `plan_required` when the owner's plan does not include LavaFlow. + operationId: createLavaflowConnectorBinding security: - UserToken: [] - - ProjectAccessToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/DatabaseName' + - AuthUserAccessToken: [] requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/UpdateDatabaseTypeRequest' + $ref: '#/components/schemas/LavaflowConnectorBindingCreate' responses: '200': - description: Database type updated + description: The channel, or the Aikido workspace, was already bound for the project content: application/json: schema: - $ref: '#/components/schemas/Database' + $ref: '#/components/schemas/LavaflowConnectorBinding' + '201': + description: The connector is bound + content: + application/json: + schema: + $ref: '#/components/schemas/LavaflowConnectorBinding' '400': - description: Invalid database type + description: 'The body is invalid or names the wrong connector type, the connector is not one the caller can use or connected, the caller''s sign-in session signed in as no Slack identity in its workspace, the channel cannot report problems (it is archived, a Slack Connect channel, or shared across an organization), or the Volcano app is not in the channel and cannot join it on its own: invite it, or add it to the workspace again so it can join channels, then bind again.' + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Not authenticated + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: Code `person_required` means a project access token or MCP made the request. Code `plan_required` means the owner's plan does not include LavaFlow. Without a code, the session belongs to a project other than the dashboard's configured project, the owner's account is read-only, or the owner's plan could not be read. Retry later only when the plan could not be read. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '404': - description: Database not found - '409': - description: | - The database is not active — being provisioned, deleted, or - restored. Compute can only be changed while it is active. + description: Not found. A project the caller can't read answers exactly like one that doesn't exist, and so does a channel that no Slack identity the caller's sign-in session signed in as is a member of, and a private channel the Volcano app is not in, which the app cannot see. Code `feature_unavailable` means the project's `lavaflow.slack`, or for Aikido its `lavaflow.aikido`, capability is unavailable. content: application/json: schema: $ref: '#/components/schemas/Error' - '503': - description: | - Volcano could not check whether a restore is running, and will not - reconfigure compute a restore might be moving. Retry. + '502': + description: 'Slack did not answer while checking or joining the channel; try again. Code `slack_reinstall_required` means Slack refused the app''s token, or a permission its installation lacks, which no retry ends: add the app to the workspace again, after a workspace admin approves it if the workspace requires approval.' content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/databases/{databaseName}/stats: - get: + /lavaflow/connector-bindings/{binding_id}: + delete: tags: - - Databases - summary: Get database consumption metrics + - LavaFlow + summary: Remove a connector binding description: | - Retrieve consumption metrics including storage, compute time, and data transfer. - Metrics are aggregated at the project level. Defaults to last 24 hours. - - **Note:** Advanced metrics require an upgraded plan. - operationId: getDatabaseStats + Stops a bound place, such as a Slack channel or an Aikido workspace, + reporting problems for its project. Reports from it still queued are canceled at their next + check. The binding's own project authorizes the request. Only the + project's owner can remove one, with a platform token. A project + access token or MCP gets `403` with code `person_required` for a + binding of its own project, and `404` for another project's, as for an + unknown one. Removing works whether or not the project's + `lavaflow.slack` capability is available. + operationId: deleteLavaflowConnectorBinding security: - UserToken: [] - - ProjectAccessToken: [] parameters: - - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/DatabaseName' - - name: from - in: query - required: false - schema: - type: string - format: date-time - description: Start time in RFC3339 format (e.g., "2024-01-01T00:00:00Z"). Defaults to 24 hours ago. - - name: to - in: query - required: false - schema: - type: string - format: date-time - description: End time in RFC3339 format (e.g., "2024-01-02T00:00:00Z"). Defaults to now. - - name: granularity - in: query - required: false + - name: binding_id + in: path + required: true + description: The binding's ID, from listing the project's connector bindings schema: type: string - enum: - - hourly - - daily - - monthly - default: hourly - description: Level of detail for metrics aggregation + format: uuid + - $ref: '#/components/parameters/ItemProjectIdQuery' responses: - '200': - description: Successful response + '204': + description: The place no longer reports for the project + '400': + description: '`project_id` is given, and it or the binding ID is not a UUID.' content: application/json: schema: - $ref: '#/components/schemas/DatabaseStats' - '400': - description: Invalid parameters + $ref: '#/components/schemas/Error' + '401': + description: Not authenticated content: application/json: schema: $ref: '#/components/schemas/Error' - '404': - description: Database not found + '403': + description: Code `person_required` means a project access token or MCP made the request. Without a code, the owner's account is read-only. content: application/json: schema: $ref: '#/components/schemas/Error' - '503': - description: Database metrics not available or requires upgraded plan + '404': + description: No such binding. A binding of a project the caller can't read, or of another project than a given `project_id`, answers exactly like one that doesn't exist. Without `project_id`, so does a binding ID that is not a UUID. content: application/json: schema: $ref: '#/components/schemas/Error' - /databases/{databaseName}/query/ping: - post: + /lavaflow/scans: + get: tags: - - Database Queries - summary: Database connectivity probe (REST API) - description: | - Connectivity probe that runs a fixed `SELECT 1` through pgproxy, using the - same authentication, status/bandwidth gating, and metering as the other - `/query/*` endpoints. + - LavaFlow + summary: List LavaFlow Code Quality scans + description: | + Pages the project's Code Quality scans, newest first. The first page + starts with the project's waiting scan, if it has one: the deploys + that went live since the last scan, with `status: waiting` and the + bound it waits at in `waiting_reason`. A bound never drops a deploy: + the waiting scan covers every commit since the last one when it + starts. A platform publication pause is reported as `feature_paused` + and does not spend the scan's retry allowance. With publication enabled, + a separate pause on starting runs is reported as `feature_unavailable`. - Unlike those endpoints, ping takes **no request body** and performs **no - table-name validation**, so it works on any database — including a freshly - provisioned, empty one. It is a real committed round-trip through pgproxy, - so a `200` means the database is reachable and queryable. Used by the - dashboard's database connection test. - operationId: queryDatabasePing + Each scan shows the commits it compared, the resources whose deploys + it covers, what it did with what it found, and the findings whose + runs were billed. Scans stay readable while LavaFlow or Code Quality + is off. Project access tokens can read them, including read-only + ones. + operationId: listLavaflowScans security: - - AuthUserAccessToken: [] + - UserToken: [] + - ProjectAccessToken: [] parameters: - - $ref: '#/components/parameters/DatabaseName' + - $ref: '#/components/parameters/ProjectIdQuery' + - $ref: '#/components/parameters/LavaflowScanLimit' + - $ref: '#/components/parameters/LavaflowRunCursor' 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' + description: A page of scans content: application/json: schema: - $ref: '#/components/schemas/DatabaseQueryResult' - example: - data: - - ?column?: 1 - count: 1 + $ref: '#/components/schemas/PaginatedLavaflowScans' + '400': + description: '`project_id` is missing or not a UUID, or the cursor or limit is invalid.' + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '401': description: Not authenticated content: @@ -9990,73 +10949,60 @@ paths: schema: $ref: '#/components/schemas/Error' '403': - description: Access denied + description: Code `plan_required` means the owner's plan does not include LavaFlow and the project has no LavaFlow records. Without a code, the owner's plan could not be read; retry later. content: application/json: schema: $ref: '#/components/schemas/Error' '404': - description: Database not found + description: Not found. A project the caller can't read answers exactly like one that doesn't exist, and so does one being deleted. Code `feature_unavailable` means LavaFlow is not available for this project and it has no LavaFlow records. content: application/json: schema: $ref: '#/components/schemas/Error' - '429': - $ref: '#/components/responses/DatabaseQueryCapExceeded' - /databases/{databaseName}/query/select: - post: + /lavaflow/stats: + get: tags: - - Database Queries - summary: Query database with SELECT (REST API) + - LavaFlow + summary: Get LavaFlow stats description: | - Query your database using a simple REST API - no SQL required! - - **Authentication:** Requires auth user access token (from signup/signin) - - **Row-Level Security:** Automatically enforced - you see only data you have access to + The activity counts report issues LavaFlow took on and pull requests it + opened per UTC day, oldest first, with every day in the window present. + Merges do not count toward these activity fields. The window ends + today, which is partial. The activity `totals` equal the sum of the + activity `days` and of the per-resource counts from + `GET /lavaflow/resources` for the same project, `days` and `category`. - **Use Cases:** - - Query from browser/mobile apps - - Simple data retrieval - - Filtered searches with sorting and pagination + `category` filters these activity counts to runs in that category. + Activity counts measure issues taken on and pull requests opened, + while `GET /lavaflow/runs` counts runs, so the two need not match. - **Note:** For complex queries (JOINs, CTEs), use functions with direct SQL - operationId: queryDatabaseSelect + The optional `outcomes` object separately reports confirmed merges, + improvements observed live and actual automatic issue-resolution + episodes. `category` filters its merge and live counts; its primary + issue-resolution count includes every category. Outcome counts use + their own event dates and do not contribute to the activity totals. + Older servers omit `outcomes`; its absence means unavailable, not + zero. Null outcome counts mean unknown, not zero. Read the per-metric + coverage alongside the counts: partial coverage and retained + confirmations do not establish a complete total. + operationId: getLavaflowStats security: - - AuthUserAccessToken: [] + - UserToken: [] + - ProjectAccessToken: [] parameters: - - $ref: '#/components/parameters/DatabaseName' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/DatabaseSelectRequest' + - $ref: '#/components/parameters/ProjectIdQuery' + - $ref: '#/components/parameters/LavaflowDays' + - $ref: '#/components/parameters/LavaflowCategoryFilter' 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' + description: The project's LavaFlow activity per day content: application/json: schema: - $ref: '#/components/schemas/DatabaseQueryResult' - example: - data: - - id: uuid-123 - title: My Post - content: Post content - status: published - views: 150 - created_at: '2026-01-13T10:00:00Z' - count: 1 + $ref: '#/components/schemas/LavaflowStats' '400': - description: Invalid query + description: '`project_id` is missing or not a UUID, `days` is outside 1 to 217, or `category` is not a category.' content: application/json: schema: @@ -10068,69 +11014,53 @@ paths: schema: $ref: '#/components/schemas/Error' '403': - description: Access denied + description: Code `plan_required` means the owner's plan does not include LavaFlow and the project has no LavaFlow records. Without a code, the owner's plan could not be read; retry later. content: application/json: schema: $ref: '#/components/schemas/Error' '404': - description: Database not found + description: Not found. A project the caller can't read answers exactly like one that doesn't exist, and so does one being deleted. Code `feature_unavailable` means LavaFlow is not available for this project and it has no LavaFlow records. content: application/json: schema: $ref: '#/components/schemas/Error' - '429': - $ref: '#/components/responses/DatabaseQueryCapExceeded' - /databases/{databaseName}/query/insert: - post: + /lavaflow/resources: + get: tags: - - Database Queries - summary: Insert data into database (REST API) + - LavaFlow + summary: List LavaFlow's resources description: | - Insert new rows into your database using REST API. - - **Authentication:** Requires auth user access token + Lists every function, durable function and frontend in the project with + LavaFlow's activity in the window, zeros included, sorted by name. A + removed resource is listed when it has activity in the window (in that + category, with `category` set), so the counts add up to + `GET /lavaflow/stats`. - **Auto-set user_id:** If your table has a trigger using `auth.uid()`, - user_id will be automatically set to the authenticated user + `anomaly.flagged` is true when the last 24 hours have at least 3 + issues opened for the resource and at least 3 times its daily average + over the 29 days before, counting that average as at least 1. - **Security:** Row-Level Security policies are enforced - operationId: queryDatabaseInsert + `category` counts, and flags anomalies from, only runs in that + category; every current resource is still listed, and + `last_analyzed_at` counts every run. + operationId: listLavaflowResources security: - - AuthUserAccessToken: [] + - UserToken: [] + - ProjectAccessToken: [] parameters: - - $ref: '#/components/parameters/DatabaseName' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/DatabaseInsertRequest' + - $ref: '#/components/parameters/ProjectIdQuery' + - $ref: '#/components/parameters/LavaflowDays' + - $ref: '#/components/parameters/LavaflowCategoryFilter' 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' + description: The project's resources with LavaFlow's activity content: application/json: schema: - $ref: '#/components/schemas/DatabaseQueryResult' - example: - data: - - id: uuid-123 - title: My New Post - content: This is the content - status: draft - user_id: user-uuid - created_at: '2026-01-13T10:00:00Z' - count: 1 + $ref: '#/components/schemas/LavaflowResourceList' '400': - description: Invalid request + description: '`project_id` is missing or not a UUID, `days` is outside 1 to 217, or `category` is not a category.' content: application/json: schema: @@ -10142,68 +11072,73 @@ paths: schema: $ref: '#/components/schemas/Error' '403': - description: Access denied + description: Code `plan_required` means the owner's plan does not include LavaFlow and the project has no LavaFlow records. Without a code, the owner's plan could not be read; retry later. content: application/json: schema: $ref: '#/components/schemas/Error' '404': - description: Database not found + description: Not found. A project the caller can't read answers exactly like one that doesn't exist, and so does one being deleted. Code `feature_unavailable` means LavaFlow is not available for this project and it has no LavaFlow records. content: application/json: schema: $ref: '#/components/schemas/Error' - '429': - $ref: '#/components/responses/DatabaseQueryCapExceeded' - /databases/{databaseName}/query/update: - post: + /lavaflow/issues: + get: tags: - - Database Queries - summary: Update data in database (REST API) + - LavaFlow + summary: List LavaFlow issues description: | - Update existing rows in your database using REST API. - - **Security:** Row-Level Security ensures you can only update data you have access to - - **Safety:** Requires at least one filter to prevent accidental mass updates. A - request with no `filters` is rejected with `400` (mirrors delete). This matters - for service-key queries, which run with full access and bypass RLS. - - **Note:** If RLS blocks the update, an empty result is returned (not an error) - operationId: queryDatabaseUpdate + Lists a project's issues that LavaFlow has taken on, including written + requests awaiting their first run. Results are ordered by recent workflow + activity. An issue appears once, with its current state and latest run. + Set finished to include only finished issues, or use issue_id to read one + matching issue regardless of state. An authorized user can request a + Realtime grant for issue-change notices with live=true where supported. + operationId: listLavaflowIssues security: - - AuthUserAccessToken: [] + - UserToken: [] + - ProjectAccessToken: [] parameters: - - $ref: '#/components/parameters/DatabaseName' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/DatabaseUpdateRequest' + - $ref: '#/components/parameters/ProjectIdQuery' + - in: query + name: limit + description: Number of issues per page. + schema: + type: integer + minimum: 1 + maximum: 100 + - in: query + name: cursor + description: The next cursor from a page of this project and finished filter. + schema: + type: string + maxLength: 512 + - in: query + name: issue_id + description: Only show this issue when it belongs to the project and LavaFlow has taken it on. + schema: + type: string + format: uuid + - in: query + name: finished + description: List finished issues instead of active issues. + schema: + type: boolean + - in: query + name: live + description: Include a subscribe-only Realtime grant when available to the user. + schema: + type: boolean 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' + description: A page of LavaFlow issues content: application/json: schema: - $ref: '#/components/schemas/DatabaseQueryResult' - example: - data: - - id: post-uuid - title: Updated Title - status: published - updated_at: '2026-01-13T10:05:00Z' - count: 1 + $ref: '#/components/schemas/PaginatedLavaflowProjectIssues' '400': - description: Invalid request + description: Invalid query parameters or cursor content: application/json: schema: @@ -10215,131 +11150,168 @@ paths: schema: $ref: '#/components/schemas/Error' '403': - description: Access denied + description: The project does not have access to LavaFlow content: application/json: schema: $ref: '#/components/schemas/Error' '404': - description: Database not found + description: The project or LavaFlow is unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /lavaflow/issue-prompts: + get: + tags: + - LavaFlow + summary: Read a written issue's prompt history + description: Reads prompts for a written issue, oldest first, with secrets masked. + operationId: listLavaflowIssuePrompts + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectIdQuery' + - in: query + name: issue_id + required: true + schema: + type: string + format: uuid + - in: query + name: after_sequence + description: Return the next page of agent activity after this sequence in this issue. + schema: + type: integer + format: int64 + minimum: 0 + responses: + '200': + description: The prompt history + content: + application/json: + schema: + $ref: '#/components/schemas/LavaflowIssuePrompts' + '403': + description: LavaFlow is unavailable to this project + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: The written issue was not found content: application/json: schema: $ref: '#/components/schemas/Error' - '429': - $ref: '#/components/responses/DatabaseQueryCapExceeded' - /databases/{databaseName}/query/delete: post: tags: - - Database Queries - summary: Delete data from database (REST API) + - LavaFlow + summary: Send a follow-up on a written issue description: | - Delete rows from your database using REST API. - - **Safety:** Requires at least one filter to prevent accidental mass deletions - - **Security:** Row-Level Security ensures you can only delete data you have access to - - **Note:** If RLS blocks the delete, an empty result is returned (not an error) - operationId: queryDatabaseDelete + Adds a message to the issue. LavaFlow picks it up while working, uses it + to update an open pull request, or starts work again. The conversation + closes when the pull request merges. Use the version you read to guard + against submitting the same message twice. + operationId: createLavaflowIssuePrompt security: - - AuthUserAccessToken: [] - parameters: - - $ref: '#/components/parameters/DatabaseName' + - UserToken: [] requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/DatabaseDeleteRequest' + $ref: '#/components/schemas/LavaflowIssuePromptCreate' 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' + '201': + description: The updated prompt history content: application/json: schema: - $ref: '#/components/schemas/DatabaseQueryResult' - example: - data: - - id: post-uuid - title: Deleted Post - count: 1 + $ref: '#/components/schemas/LavaflowIssuePrompts' '400': - description: Invalid request or missing filters + description: Invalid prompt content: application/json: schema: $ref: '#/components/schemas/Error' - '401': - description: Not authenticated + '403': + description: A live project owner sign-in is required or LavaFlow is unavailable content: application/json: schema: $ref: '#/components/schemas/Error' - '403': - description: Access denied + '404': + description: The written issue was not found content: application/json: schema: $ref: '#/components/schemas/Error' - '404': - description: Database not found + '409': + description: The conversation advanced, is closed, or LavaFlow cannot start work content: application/json: schema: $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/DatabaseQueryCapExceeded' - /databases/{databaseName}/branches/{branchName}/query/ping: - post: + description: The project or issue reached its LavaFlow run limit + headers: + Retry-After: + schema: + type: integer + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /lavaflow/runs: + get: tags: - - Database Queries - summary: Database connectivity probe (REST API) + - LavaFlow + summary: List LavaFlow runs description: | - Connectivity probe that runs a fixed `SELECT 1` through pgproxy, using the - same authentication, status/bandwidth gating, and metering as the other - `/query/*` endpoints. - - Unlike those endpoints, ping takes **no request body** and performs **no - table-name validation**, so it works on any database — including a freshly - provisioned, empty one. It is a real committed round-trip through pgproxy, - so a `200` means the database is reachable and queryable. Used by the - dashboard's database connection test. + Pages the project's LavaFlow runs, newest first unless `order` says + otherwise. A page carries bounded display text, including the saved + proposed fix's optional `fix_summary`; read a run for its diagnosis, + log lines and diff. Each run names its category, the resources it + involves and its issue. A confirmed Code Quality finding can supply + `issue.severity`, and a recorded pull request can supply `branch`. + Unknown or withheld optional fields are omitted. - **Branch-targeted.** Runs against the named branch instead of the parent - database, using the branch's own credentials. The branch must be `active` - and unexpired. Nothing about this request can reach the parent's data. - operationId: queryDatabaseBranchPing + Every filter narrows the list, and filters combine. `include=counts` + adds `counts`, computed from the same filters: ask for them on the + first page, since they don't depend on the cursor. Keep the filters + and `order` while paging. + operationId: listLavaflowRuns security: - - AuthUserAccessToken: [] + - UserToken: [] + - ProjectAccessToken: [] parameters: - - $ref: '#/components/parameters/DatabaseName' - - $ref: '#/components/parameters/BranchName' + - $ref: '#/components/parameters/ProjectIdQuery' + - $ref: '#/components/parameters/LavaflowRunLimit' + - $ref: '#/components/parameters/LavaflowRunCursor' + - $ref: '#/components/parameters/LavaflowRunStatusFilter' + - $ref: '#/components/parameters/LavaflowResourceIdFilter' + - $ref: '#/components/parameters/LavaflowCategoryFilter' + - $ref: '#/components/parameters/LavaflowInvolvedResourceFilter' + - $ref: '#/components/parameters/LavaflowIssueIdFilter' + - $ref: '#/components/parameters/LavaflowPullRequestStateFilter' + - $ref: '#/components/parameters/LavaflowRunDays' + - $ref: '#/components/parameters/LavaflowRunOrder' + - $ref: '#/components/parameters/LavaflowRunInclude' 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' + description: A page of runs content: application/json: schema: - $ref: '#/components/schemas/DatabaseQueryResult' - example: - data: - - ?column?: 1 - count: 1 + $ref: '#/components/schemas/PaginatedLavaflowRuns' + '400': + description: '`project_id` is missing or not a UUID, a filter, `order`, `days`, `include` or `limit` is invalid, or the cursor is invalid or was issued for another `order`.' + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '401': description: Not authenticated content: @@ -10347,80 +11319,65 @@ paths: schema: $ref: '#/components/schemas/Error' '403': - description: Access denied + description: Code `plan_required` means the owner's plan does not include LavaFlow and the project has no LavaFlow records. Without a code, the owner's plan could not be read; retry later. content: application/json: schema: $ref: '#/components/schemas/Error' '404': - description: Database or branch not found + description: Not found. A project the caller can't read answers exactly like one that doesn't exist, and so does one being deleted. An `issue_id` from another project answers `issue not found`, as an unknown one does. Code `feature_unavailable` means LavaFlow is not available for this project and it has no LavaFlow records. content: application/json: schema: $ref: '#/components/schemas/Error' - '429': - $ref: '#/components/responses/DatabaseQueryCapExceeded' - '503': - $ref: '#/components/responses/DatabaseBranchQueryUnavailable' - /databases/{databaseName}/branches/{branchName}/query/select: post: tags: - - Database Queries - summary: Query database with SELECT (REST API) + - LavaFlow + summary: Start a LavaFlow run description: | - Query your database using a simple REST API - no SQL required! + Starts a run on one of the project's issues. LavaFlow starts runs on + its own only for issues with `exception: true`, and only while it is + on. Start one here for any other issue, or for one recorded before + LavaFlow was turned on. The run follows the project's settings, as + one LavaFlow starts on its own does, and answers `202` while it is + `queued`; read it with `GET /lavaflow/runs/{run_id}`. - **Authentication:** Requires auth user access token (from signup/signin) - - **Row-Level Security:** Automatically enforced - you see only data you have access to - - **Use Cases:** - - Query from browser/mobile apps - - Simple data retrieval - - Filtered searches with sorting and pagination + Only the project's owner can start a run, as a person, while their + account is active: with a platform token that expires, `volcano + login`, or a live Volcano dashboard sign-in. A platform token that + never expires, a `volcano login` token + whose sign-in ended, a full-scope project access token, and a request + made through MCP get `403` with code `person_required`; a read-only + project access token is refused as read-only first, without a code, + and so is the owner of a read-only account. - **Note:** For complex queries (JOINs, CTEs), use a function with direct SQL + Every start counts toward the run limits: 5 runs per issue and 200 per + project in any 24 hours. An issue has one run in progress at a time, + so sending the request again while the first run is in progress + answers `409` with code `lavaflow_run_in_progress`. - **Branch-targeted.** Runs against the named branch instead of the parent - database, using the branch's own credentials. The branch must be `active` - and unexpired. Nothing about this request can reach the parent's data. - operationId: queryDatabaseBranchSelect + A run on a Code Quality issue is a Code Quality run. It starts only + while Code Quality is available to the project, as + `lavaflow.code_quality` in `GET /capabilities` reports, and on for it. + operationId: createLavaflowRun security: + - UserToken: [] - AuthUserAccessToken: [] - parameters: - - $ref: '#/components/parameters/DatabaseName' - - $ref: '#/components/parameters/BranchName' requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/DatabaseSelectRequest' + $ref: '#/components/schemas/LavaflowRunCreate' 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' + '202': + description: The run, queued content: application/json: schema: - $ref: '#/components/schemas/DatabaseQueryResult' - example: - data: - - id: uuid-123 - title: My Post - content: Post content - status: published - views: 150 - created_at: '2026-01-13T10:00:00Z' - count: 1 + $ref: '#/components/schemas/LavaflowRun' '400': - description: Invalid query + description: 'The body is invalid: `project_id` or `issue_id` missing or not a UUID, or an unknown field. Code `feature_unavailable` means the issue is a Code Quality issue and Code Quality is not available.' content: application/json: schema: @@ -10432,76 +11389,74 @@ paths: schema: $ref: '#/components/schemas/Error' '403': - description: Access denied + description: 'Code `person_required` means the request didn''t come from the owner''s live person credential: a platform token that never expires, a `volcano login` token whose sign-in ended, a full-scope project access token, or MCP made it. Start a run with a platform token that expires, `volcano login`, or the dashboard. Code `plan_required` means the owner''s plan does not include LavaFlow, or, for a Code Quality issue, Code Quality. Without a code: a read-only project access token made the request, the owner''s account is read-only or inactive, or the owner''s plan could not be read; retry later.' content: application/json: schema: $ref: '#/components/schemas/Error' '404': - description: Database or branch not found + description: Not found. A project the caller can't read answers exactly like one that doesn't exist, and so does one being deleted. Code `issue_not_found` means the project has no issue `issue_id`; an issue of another project answers the same. Code `feature_unavailable` means LavaFlow is not available for this project. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '409': + description: The run did not start. Code `lavaflow_disabled` means LavaFlow is off for the project, or, for a Code Quality issue, Code Quality is; turn it on. Code `repository_required` means LavaFlow was turned on for a repository the project no longer links, and `repository_changed` that the project links another repository than LavaFlow was turned on for; turn LavaFlow on again. Code `lavaflow_run_in_progress` means the issue has a run in progress. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '413': + description: Request body exceeds 4,096 bytes content: application/json: schema: $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/DatabaseQueryCapExceeded' - '503': - $ref: '#/components/responses/DatabaseBranchQueryUnavailable' - /databases/{databaseName}/branches/{branchName}/query/insert: - post: + description: A run limit is reached. Code `issue_run_limit_reached` means the issue started 5 runs in the last 24 hours, and `project_run_limit_reached` that the project started 200. Code `lavaflow_allowance_exhausted` means the project owner's plan stops at its allowance of LavaFlow runs, and the owner has used it this billing cycle; upgrade the plan, or start the run once the allowance renews. Try again after `Retry-After`. + headers: + Retry-After: + description: Seconds until the limit has room for the run, or until the allowance renews. + schema: + type: integer + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /lavaflow/runs/{run_id}: + get: tags: - - Database Queries - summary: Insert data into database (REST API) + - LavaFlow + summary: Get a LavaFlow run description: | - Insert new rows into your database using REST API. - - **Authentication:** Requires auth user access token - - **Auto-set user_id:** If your table has a trigger using `auth.uid()`, - user_id will be automatically set to the authenticated user + Returns a run, with its diagnosis, the log lines it cites, its diff, + its review, including the findings the review left open and what it + asks a person to decide, and whether the repository's own checks + passed when LavaFlow ran them on the fix, with the commands they ran. + The run's project authorizes the read, so `project_id` is optional. + The text holds the project's logs and source code, so this endpoint + takes the same access as the project's log endpoints. - **Security:** Row-Level Security policies are enforced - - **Branch-targeted.** Runs against the named branch instead of the parent - database, using the branch's own credentials. The branch must be `active` - and unexpired. Nothing about this request can reach the parent's data. - operationId: queryDatabaseBranchInsert + A run held because the repository's workflows could run its fix with + the repository's secrets before a person approves it + (`pull_request_skipped: ungated_workflows`) lists every such job in + `held_workflows`, beside the fix's `diff` and `diff_sha256`. + operationId: getLavaflowRun security: - - AuthUserAccessToken: [] + - UserToken: [] + - ProjectAccessToken: [] parameters: - - $ref: '#/components/parameters/DatabaseName' - - $ref: '#/components/parameters/BranchName' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/DatabaseInsertRequest' + - $ref: '#/components/parameters/LavaflowRunId' + - $ref: '#/components/parameters/ItemProjectIdQuery' 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' + description: The run content: application/json: schema: - $ref: '#/components/schemas/DatabaseQueryResult' - example: - data: - - id: uuid-123 - title: My New Post - content: This is the content - status: draft - user_id: user-uuid - created_at: '2026-01-13T10:00:00Z' - count: 1 + $ref: '#/components/schemas/LavaflowRun' '400': - description: Invalid request + description: '`project_id` is given and not a UUID.' content: application/json: schema: @@ -10513,75 +11468,81 @@ paths: schema: $ref: '#/components/schemas/Error' '403': - description: Access denied + description: Code `plan_required` means the owner's plan does not include LavaFlow and the project has no LavaFlow records. Without a code, the owner's plan could not be read; retry later. content: application/json: schema: $ref: '#/components/schemas/Error' '404': - description: Database or branch not found + description: Not found. A run of a project the caller can't read, or of a project being deleted, answers exactly like one that doesn't exist, and so does a run of another project than a given `project_id`. Code `feature_unavailable` means LavaFlow is not available for the project and it has no LavaFlow records. content: application/json: schema: $ref: '#/components/schemas/Error' - '429': - $ref: '#/components/responses/DatabaseQueryCapExceeded' - '503': - $ref: '#/components/responses/DatabaseBranchQueryUnavailable' - /databases/{databaseName}/branches/{branchName}/query/update: + /lavaflow/held-fix-opens: post: tags: - - Database Queries - summary: Update data in database (REST API) - description: | - Update existing rows in your database using REST API. - - **Security:** Row-Level Security ensures you can only update data you have access to + - LavaFlow + summary: Open a held LavaFlow fix + description: | + Opens the pull request for a fix LavaFlow held because the + repository's workflows could run it with the repository's secrets + before a person approves it (`pull_request_skipped: + ungated_workflows`). Read the run first: send its `id` as `run_id`, + with the `diff_sha256` and `held_workflows.jobs_sha256` it served, to + say you read that diff and that list of jobs. LavaFlow opens the fix it + saved, exactly as reviewed, past those jobs only. It writes no new + fix. - **Safety:** Requires at least one filter to prevent accidental mass updates. A - request with no `filters` is rejected with `400` (mirrors delete). This matters - for service-key queries, which run with full access and bypass RLS. + Right before it queues the run, LavaFlow serves the diff again and + reads the workflows again. A diff served differently since you read + it, or a job list or a commit the workflows were read at that changed, + answers `409` with code `run_changed`; read the run again, which lists + what LavaFlow found. The response is the run, `202` while it is + `queued`. LavaFlow reads the workflows again before it opens the pull + request, and once more as it pushes the fix: a job you didn't read, a + new commit on a branch the workflows were read on, even one that + changes no job, or a production branch other than the one you read + them on holds the fix again with a new list. - **Note:** If RLS blocks the update, an empty result is returned (not an error) + Opening a fix lets its pull request open, nothing more. LavaFlow + starts no CI on it and never merges it, as for every fix opened past + ungated workflows; a person pushes to the branch or merges it. The + pull request's description names who opened it and lists the jobs. + One exception: when LavaFlow's read before the pull request opens + finds no job that runs the fix before a person approves it, because + the workflows were gated since you read them, the fix opens as any + other fix and follows the project's merge settings. A run whose + `held_workflows` lists no job opens the same way. - **Branch-targeted.** Runs against the named branch instead of the parent - database, using the branch's own credentials. The branch must be `active` - and unexpired. Nothing about this request can reach the parent's data. - operationId: queryDatabaseBranchUpdate + Only the project's owner can open a fix, as a person, while their + account is active: with a `volcano login` token + whose sign-in is live, or a platform token that expires. Their GitHub + account must be able to push to the project's repository. A project + access token, a request made through MCP, a platform token that never + expires, and a sign-in that ended get `403` with code + `person_required`. Opening a fix uses one of the run's attempts: the + attempt that opens it is one of the run's, so a run held again on its + last attempt can't be opened again. It starts no new run and counts + toward no run limit. + operationId: createLavaflowHeldFixOpen security: - - AuthUserAccessToken: [] - parameters: - - $ref: '#/components/parameters/DatabaseName' - - $ref: '#/components/parameters/BranchName' + - UserToken: [] requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/DatabaseUpdateRequest' + $ref: '#/components/schemas/LavaflowHeldFixOpen' 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' + '202': + description: The run, queued to open its fix content: application/json: schema: - $ref: '#/components/schemas/DatabaseQueryResult' - example: - data: - - id: post-uuid - title: Updated Title - status: published - updated_at: '2026-01-13T10:05:00Z' - count: 1 + $ref: '#/components/schemas/LavaflowRun' '400': - description: Invalid request + description: 'The body is invalid: `project_id` or `run_id` missing or not a UUID, `diff_sha256` or `jobs_sha256` missing or not 64 lowercase hex characters, or an unknown field.' content: application/json: schema: @@ -10593,3073 +11554,2677 @@ paths: schema: $ref: '#/components/schemas/Error' '403': - description: Access denied + description: 'Code `person_required` means the request didn''t come from the owner''s live person credential: a full-scope project access token, MCP, a platform token that never expires, or a `volcano login` token whose sign-in ended made it, or the owner''s GitHub account can''t push to the project''s repository, or the project has none. Open the fix with a platform token that expires, or `volcano login`. Code `plan_required` means the owner''s plan does not include LavaFlow. Without a code: a read-only project access token made the request, the owner''s account is read-only or inactive, or the owner''s plan could not be read; retry later.' content: application/json: schema: $ref: '#/components/schemas/Error' '404': - description: Database or branch not found + description: Not found. A project the caller can't read answers exactly like one that doesn't exist, and so does one being deleted. A run of another project than `project_id` answers as one that doesn't exist. Code `feature_unavailable` means LavaFlow is not available for this project. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '409': + description: 'Nothing was queued. Code `run_not_held` means the run holds no fix you can open: it was not held for ungated workflows, its pull request opened or is queued to, its diff is cut short or withholds a file, or LavaFlow could not list every job that held it (`held_workflows` is `null`). Code `run_changed` means the diff or the jobs are not the ones you named: read the run again. Code `run_attempts_exhausted` means the run used all its retries, so LavaFlow can''t open its fix any more; apply the fix yourself from the run''s `diff`, and where the diff is cut short or withholds a file, from its `diagnosis`. Code `lavaflow_disabled` means LavaFlow is off for the project; turn it on. Code `repository_required` means LavaFlow was turned on for a repository the project no longer links, `repository_changed` that the project links another repository than LavaFlow was turned on for, or than the fix was written for, and `repository_unreadable` that LavaFlow can no longer read the repository''s workflows. Code `lavaflow_run_in_progress` means another run of the issue is in progress.' + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '413': + description: Request body exceeds 4,096 bytes content: application/json: schema: $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/DatabaseQueryCapExceeded' + description: The project, or its owner across their projects, used up the hour's checks of the owner's GitHub push access. Nothing was queued. Try again after `Retry-After`. + headers: + Retry-After: + description: Seconds until the budget's hour ends. + schema: + type: integer + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '503': - $ref: '#/components/responses/DatabaseBranchQueryUnavailable' - /databases/{databaseName}/branches/{branchName}/query/delete: + description: GitHub didn't answer the owner's push check or the read of the workflows. Nothing was queued. Try again after `Retry-After`. + headers: + Retry-After: + description: Seconds to wait before trying again. + schema: + type: integer + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /issues: post: tags: - - Database Queries - summary: Delete data from database (REST API) - description: | - Delete rows from your database using REST API. + - Issues + summary: Create an issue + description: | + Records an issue you write on the project `project_id` names: a + description of what to fix, in your words, and optionally a title. The + issue has `source` `request`, the + project as its resource, and status `open`. With LavaFlow on, LavaFlow + starts a run on it by itself, as on a new error: the run follows the + project's LavaFlow settings and counts toward the run limits. Follow + it with `GET /lavaflow/runs?project_id=…&issue_id=…`. Where none + starts, as with LavaFlow off, start one with `POST /lavaflow/runs`. - **Safety:** Requires at least one filter to prevent accidental mass deletions + Supply `start_run_idempotency_key` to queue the run and save the original + prompt in the same operation. A successful response includes + `initial_run_id`. Retrying with the same key and prompt returns the same + issue and run. Reusing the key for another prompt returns 409. If + admission refuses the run, the operation creates neither issue nor run. - **Security:** Row-Level Security ensures you can only delete data you have access to + The issue counts toward the project's 1,000 open issues, with runtime, + build and reported issues; at that limit it is refused with code + `open_issue_limit_reached`. Resolve or ignore issues to make room. - **Note:** If RLS blocks the delete, an empty result is returned (not an error) - - **Branch-targeted.** Runs against the named branch instead of the parent - database, using the branch's own credentials. The branch must be `active` - and unexpired. Nothing about this request can reach the parent's data. - operationId: queryDatabaseBranchDelete + Only the project's owner can create an issue, as a person: with + `volcano login`, a live Volcano dashboard sign-in, or a platform token + that expires. A full-scope project access + token, MCP and a never-expiring platform token are refused with code + `person_required`, as starting a run is, and a read-only project access + token or account with an uncoded `403`, because creating one starts a + run, which sends the description to an AI service with the project's + source. A project access token is refused before its `project_id` is + looked up. List, read and update the issue under + `/projects/{id}/issues`. + operationId: createIssue security: + - UserToken: [] - AuthUserAccessToken: [] - parameters: - - $ref: '#/components/parameters/DatabaseName' - - $ref: '#/components/parameters/BranchName' requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/DatabaseDeleteRequest' + $ref: '#/components/schemas/CreateIssueRequest' 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' + '201': + description: Created content: application/json: schema: - $ref: '#/components/schemas/DatabaseQueryResult' - example: - data: - - id: post-uuid - title: Deleted Post - count: 1 + $ref: '#/components/schemas/Issue' '400': - description: Invalid request or missing filters + description: The request body is invalid, or its description or title is blank. content: application/json: schema: $ref: '#/components/schemas/Error' - '401': - description: Not authenticated + '403': + description: 'Code `person_required`: only the project''s owner, as a person, can create an issue. A project access token or MCP is refused so even where writing issues isn''t available. A read-only account is refused too. In local mode, which runs no LavaFlow, its own token can create one. For a keyed LavaFlow task, code `plan_required` means the owner''s plan does not include LavaFlow or its entitlement could not be verified.' content: application/json: schema: $ref: '#/components/schemas/Error' - '403': - description: Access denied + '404': + description: The project `project_id` names was not found, or you can't use it. Code `feature_unavailable` means writing issues is not available in this environment, as the `issues.create` capability reports. For a keyed task it can also mean LavaFlow is unavailable in this environment or for this project. content: application/json: schema: $ref: '#/components/schemas/Error' - '404': - description: Database or branch not found + '409': + description: 'Code `open_issue_limit_reached`: the project has 1,000 open issues. Resolve or ignore some, then try again. For a keyed task, `submission_key_conflict` means the key belongs to another prompt, `lavaflow_disabled` means LavaFlow is off, and `repository_required` or `repository_changed` means the repository that LavaFlow was enabled for is disconnected or has changed.' + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '413': + description: The request body is larger than 64 KiB. content: application/json: schema: $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/DatabaseQueryCapExceeded' - '503': - $ref: '#/components/responses/DatabaseBranchQueryUnavailable' - /databases/regions: - get: - tags: - - Databases - summary: List platform-supported regions for database provisioning - operationId: listDatabaseRegions - description: | - Returns the regions enabled for database provisioning in this platform environment. - These are the same regions offered for function deployment, and the only values - the `region` field of a database accepts. - This is a public endpoint that doesn't require authentication. - responses: - '200': - description: List of platform-supported regions + description: A keyed task exceeds the run allowance. Codes include `issue_run_limit_reached`, `project_run_limit_reached`, and `lavaflow_allowance_exhausted`. + headers: + Retry-After: + schema: + type: integer content: application/json: schema: - type: array - items: - type: object - properties: - id: - type: string - example: us-east-1 - description: Region identifier for API usage - name: - type: string - example: US East (N. Virginia) - description: Human-readable region location - /databases/postgres-versions: + $ref: '#/components/schemas/Error' + /projects/{id}/issues: get: tags: - - Databases - summary: List available PostgreSQL versions - operationId: listPostgresVersions + - Issues + summary: List issues description: | - Returns the PostgreSQL major versions a database can be created on, - newest first. Local mode lists only the version its server runs. - This is a public endpoint that doesn't require authentication. + Lists the project's issues, most recently seen first. An issue groups + the runtime errors one function or frontend raised with the same error + type and stack, or the same message when there is no stack; the + deploys of one function or frontend whose own build failed with the + same first error (`source` `build`); or one Code Quality finding or + reported problem, or one issue a person wrote (`source` `request`). + + Project access tokens can list issues, including read-only ones. + operationId: listIssues + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/Limit' + - $ref: '#/components/parameters/IssueCursor' + - name: status + in: query + required: false + description: Return only issues in this status. + schema: + $ref: '#/components/schemas/IssueStatus' + - name: resource_id + in: query + required: false + description: Return only issues raised by this function or frontend. + schema: + type: string + format: uuid + - name: source + in: query + required: false + description: Return only issues from this source, such as `build` for failed builds. + schema: + $ref: '#/components/schemas/IssueSource' responses: '200': - description: List of available PostgreSQL versions + description: Successful response content: application/json: schema: - type: array - items: - type: object - properties: - version: - type: string - example: '18' - description: PostgreSQL major version number - name: - type: string - example: PostgreSQL 18 - description: Human-readable version name - default: - type: boolean - description: True on the version to preselect for a new database; absent on the others - recommended: - type: boolean - description: True on the version recommended for new databases; absent on the others - deprecated: - type: boolean - description: Whether this version is deprecated (approaching EOL) - /functions/runtimes: - get: - tags: - - Functions - summary: List supported function runtimes - operationId: listFunctionRuntimes - security: [] - description: | - Returns the public function runtime catalog: every runtime a deploy accepts, its display - label for runtime pickers, language defaults, durable capability, and local source packaging - metadata for deployments. - This is a public endpoint that doesn't require authentication. - responses: - '200': - description: Supported function runtimes + $ref: '#/components/schemas/PaginatedIssues' + '400': + description: A filter or the cursor is invalid content: application/json: schema: - $ref: '#/components/schemas/FunctionRuntimesResponse' - /functions/regions: - get: - tags: - - Functions - summary: List available regions for function deployment - operationId: listFunctionRegions - security: [] - description: | - Returns the configured regions where functions can be deployed, each annotated - with a human-readable label and country flag emoji for use in UI pickers. - This is a public endpoint that doesn't require authentication. - responses: - '200': - description: Available function deployment regions + $ref: '#/components/schemas/Error' + '404': + description: Project not found. Code `feature_unavailable` means issues are not available in this environment. content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/FunctionRegion' - /projects/{id}/variables/{name}: + $ref: '#/components/schemas/Error' + /projects/{id}/issues/{issueId}: get: tags: - - Variables - summary: Get variable by name + - Issues + summary: Get an issue description: | - Returns a project-level environment variable used by deployed functions and frontends. - operationId: getVariable + Returns one issue: the resource that raised it, how often and when it + was seen, and its status. + + Project access tokens can read issues, including read-only ones. + operationId: getIssue security: - UserToken: [] - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/VariableName' + - $ref: '#/components/parameters/IssueId' responses: '200': description: Successful response content: application/json: schema: - $ref: '#/components/schemas/Variable' + $ref: '#/components/schemas/Issue' '404': - description: Variable not found + description: Issue not found. Code `feature_unavailable` means issues are not available in this environment. content: application/json: schema: $ref: '#/components/schemas/Error' - put: + patch: tags: - - Variables - summary: Update a variable + - Issues + summary: Update an issue description: | - Updates a project-level environment variable and triggers asynchronous propagation - to deployed functions and frontends in the project's configured regions. - operationId: updateVariable + Sets an issue's status. A resolved issue that is seen again after it + was resolved reopens, and `regressed_at` records when. An ignored issue + stays ignored while it keeps being counted. + + Setting the status an issue already has is safe to repeat. + operationId: updateIssue security: - UserToken: [] - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/VariableName' + - $ref: '#/components/parameters/IssueId' requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/UpdateVariableRequest' + $ref: '#/components/schemas/UpdateIssueRequest' responses: '200': - description: Variable updated + description: Updated content: application/json: schema: - $ref: '#/components/schemas/Variable' + $ref: '#/components/schemas/Issue' '400': - description: Invalid or reserved variable name + description: The request body is invalid content: application/json: schema: $ref: '#/components/schemas/Error' '404': - description: Variable not found - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '503': - description: Private variable membership writes are disabled during rollout + description: Issue not found. Code `feature_unavailable` means issues are not available in this environment. content: application/json: schema: $ref: '#/components/schemas/Error' - delete: + /projects/{id}/durable-approvals: + get: tags: - - Variables - summary: Delete a variable + - Durable Functions + summary: List durable approvals description: | - Deletes a project-level environment variable and triggers asynchronous propagation - of the removal to deployed functions and frontends in the project's configured regions. - operationId: deleteVariable + Lists the approvals durable workflows in the project have requested, + newest first. Pending approvals are the ones a workflow is waiting on; + decided, expired, and cancelled ones are kept for a year. + + Project access tokens can list approvals, including read-only ones. + operationId: listDurableApprovals security: - UserToken: [] - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/VariableName' - responses: - '204': - description: Variable deleted - '404': - description: Variable not found - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /auth/password-policy: + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/Limit' + - name: status + in: query + required: false + description: Return only approvals in this status. + schema: + $ref: '#/components/schemas/DurableApprovalStatus' + - $ref: '#/components/parameters/DurableApprovalFunctionFilter' + - name: execution_id + in: query + required: false + description: Return only approvals requested by this durable execution. + schema: + type: string + format: uuid + - name: from + in: query + required: false + description: Return only approvals requested at or after this time. + schema: + type: string + format: date-time + - name: to + in: query + required: false + description: Return only approvals requested before this time. + schema: + type: string + format: date-time + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedDurableApprovals' + '400': + description: A filter is invalid, or `from` is after `to` + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /projects/{id}/durable-approvals/stats: get: tags: - - Authentication - summary: Get the effective password policy + - Durable Functions + summary: Get durable approval statistics description: | - Returns the backend-enforced password bounds and compromised-password - screening status for the project identified by the anon key. A valid - anon key is required, but no route-specific auth permission is needed. - operationId: authGetPasswordPolicy + Counts the project's approvals by outcome over a time window, overall, + per workflow, and per day. The window defaults to the last 30 days and + can cover up to a year. An approval is counted on the day it was + requested. + + Project access tokens can read statistics, including read-only ones. + operationId: getDurableApprovalStats security: - - AnonKey: [] + - UserToken: [] + - ProjectAccessToken: [] parameters: - - $ref: '#/components/parameters/AuthProxyAuthorization' - - $ref: '#/components/parameters/AuthProxyClientIP' + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/DurableApprovalFunctionFilter' + - name: from + in: query + required: false + description: Start of the window. Defaults to 30 days before `to`. + schema: + type: string + format: date-time + - name: to + in: query + required: false + description: End of the window. Defaults to now. + schema: + type: string + format: date-time responses: '200': - description: Effective password policy + description: Successful response content: application/json: schema: - $ref: '#/components/schemas/AuthPasswordPolicy' - '401': - description: Invalid, missing, or revoked anon key; or invalid auth proxy metadata + $ref: '#/components/schemas/DurableApprovalStats' + '400': + description: The window is invalid or longer than 366 days content: application/json: schema: $ref: '#/components/schemas/Error' + /projects/{id}/durable-approvals/{approvalId}: + get: + tags: + - Durable Functions + summary: Get a durable approval + description: | + Returns one approval: what the workflow asked, the durable function + and execution that asked it, its deadline, and the decision once one + is made. + + Project access tokens can read approvals, including read-only ones. + operationId: getDurableApproval + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/DurableApprovalId' + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/DurableApproval' '404': - description: Project or auth configuration not found + description: Approval not found content: application/json: schema: $ref: '#/components/schemas/Error' - /auth/signup: + /projects/{id}/durable-approvals/{approvalId}/approve: post: tags: - - Authentication - summary: Sign up a new auth user + - Durable Functions + summary: Approve a durable approval description: | - Create a new end-user account. The project is determined from the anon key. - Requires project-specific anon key in Authorization header. + Approves a pending approval. The workflow resumes with the decision. - **Session-less**: signup never issues a session. On success it returns a - uniform acknowledgement (`AuthSignupResponse`) with no tokens; the client - obtains a session with a subsequent `POST /auth/signin`. If email confirmation - is enabled for the project, a confirmation email is sent and - `confirmation_required` is `true`. + Only a person can decide: use the dashboard or a platform token from + `volcano login`. Project access tokens are refused with `403`. - **Anti-enumeration**: a signup for an already-registered email returns the - exact same `201` response as a fresh signup — it never returns `409` — so the - response cannot be used to discover which emails are registered. - operationId: authSignup + Approving an approval that is already approved returns it unchanged. + If the workflow cannot be reached right away, the decision still + stands and Volcano keeps delivering it. + operationId: approveDurableApproval security: - - AnonKey: [] + - UserToken: [] parameters: - - $ref: '#/components/parameters/AuthProxyAuthorization' - - $ref: '#/components/parameters/AuthProxyClientIP' + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/DurableApprovalId' requestBody: - required: true + required: false content: application/json: schema: - type: object - required: - - email - - password - properties: - email: - type: string - format: email - password: - type: string - description: | - Password validated after NFC normalization against the - policy returned by GET /auth/password-policy. - user_metadata: - type: object - additionalProperties: true + $ref: '#/components/schemas/DurableApprovalDecisionRequest' responses: - '201': - description: | - Signup acknowledged (session-less). Returned identically for a new - account and for an already-registered email (anti-enumeration). + '200': + description: Approved content: application/json: schema: - $ref: '#/components/schemas/AuthSignupResponse' + $ref: '#/components/schemas/DurableApproval' '400': - description: Invalid input (bad email/password format) - '401': - description: | - Unauthorized - Invalid, tampered, revoked, or wrong-project anon key. - Also returned for invalid, repeated, or under-scoped auth proxy metadata - (`invalid auth proxy metadata`). + description: The request body is invalid + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '403': + description: The credential is not a person's + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Approval not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '409': description: | - Forbidden - Signups disabled, anon key lacks signup permission, or the - email domain is not in `allowed_email_domains`. The internal - `anonymous.volcano.internal` domain is reserved for anonymous - accounts and is refused whatever the project allows. - '429': - description: Rate limit exceeded - '503': - description: Compromised-password screening is temporarily unavailable + The approval was already denied, or has expired or been cancelled. + `code` is `approval_decided`, `approval_expired`, or + `approval_cancelled`. content: application/json: schema: $ref: '#/components/schemas/Error' - /auth/signin: + '413': + description: The request body is larger than 16 KiB + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /projects/{id}/durable-approvals/{approvalId}/deny: post: tags: - - Authentication - summary: Sign in an auth user + - Durable Functions + summary: Deny a durable approval description: | - Authenticate with email and password. Requires an anon key. + Denies a pending approval. The workflow resumes with the decision; a + denial is a value the workflow branches on, not an error. - 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. - operationId: authSignin + Only a person can decide: use the dashboard or a platform token from + `volcano login`. Project access tokens are refused with `403`. + + Denying an approval that is already denied returns it unchanged. + If the workflow cannot be reached right away, the decision still + stands and Volcano keeps delivering it. + operationId: denyDurableApproval security: - - AnonKey: [] + - UserToken: [] parameters: - - $ref: '#/components/parameters/AuthProxyAuthorization' - - $ref: '#/components/parameters/AuthProxyClientIP' + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/DurableApprovalId' requestBody: - required: true + required: false content: application/json: schema: - type: object - required: - - email - - password - properties: - email: - type: string - password: - type: string - session_mode: - type: string - enum: - - cookie + $ref: '#/components/schemas/DurableApprovalDecisionRequest' responses: '200': - description: Signin successful + description: Denied content: application/json: schema: - $ref: '#/components/schemas/AuthTokenResponse' + $ref: '#/components/schemas/DurableApproval' '400': - description: Invalid input (missing email/password) - '401': - description: | - Unauthorized - Invalid credentials, invalid/tampered/revoked anon key, - or account banned/deleted; or invalid auth proxy metadata - '403': - description: | - Forbidden - Anon key lacks signin permission, or the email domain is - not in `allowed_email_domains` while `allowed_email_domains_mode` is - `signup_and_signin`. The domain is taken from the account's canonical - email (its primary identity), which is not necessarily the address in - the request. - '429': - description: Rate limit exceeded - /auth/refresh: - post: - tags: - - Authentication - summary: Refresh access token - description: | - Get a new access token using a refresh token. Requires an anon key. - - Send `refresh_token` in the body for the default flow. An eligible - cookie-mode browser request may instead send `session_mode: cookie` - with an empty token or omit the request body; the API reads and resets - the project's HttpOnly cookie and omits `refresh_token` from the - response. - operationId: authRefresh - security: - - AnonKey: [] - parameters: - - $ref: '#/components/parameters/AuthProxyAuthorization' - - $ref: '#/components/parameters/AuthProxyClientIP' - requestBody: - required: false - content: - application/json: - schema: - type: object - properties: - refresh_token: - type: string - session_mode: - type: string - enum: - - cookie - responses: - '200': - description: Token refreshed + description: The request body is invalid content: application/json: schema: - $ref: '#/components/schemas/AuthTokenResponse' - '401': - description: Invalid or expired refresh token; or invalid auth proxy metadata + $ref: '#/components/schemas/Error' + '403': + description: The credential is not a person's content: application/json: schema: $ref: '#/components/schemas/Error' - '403': - description: | - The account's email domain is not in `allowed_email_domains` while - `allowed_email_domains_mode` is `signup_and_signin`, so the session - cannot be extended + '404': + description: Approval not found content: application/json: schema: $ref: '#/components/schemas/Error' - '429': - description: Rate limit exceeded + '409': + description: | + The approval was already approved, or has expired or been + cancelled. `code` is `approval_decided`, `approval_expired`, or + `approval_cancelled`. content: application/json: schema: $ref: '#/components/schemas/Error' - /auth/logout: - post: - tags: - - Authentication - summary: Logout (revoke refresh token) - description: | - Invalidate a refresh token. Requires an anon key. - - Send `refresh_token` for the default flow. An eligible cookie-mode - browser request may instead send `session_mode: cookie` with an empty - token; logout remains idempotent when the cookie is missing or expired. - operationId: authLogout - security: - - AnonKey: [] - parameters: - - $ref: '#/components/parameters/AuthProxyAuthorization' - - $ref: '#/components/parameters/AuthProxyClientIP' - requestBody: - required: false - content: - application/json: - schema: - type: object - properties: - refresh_token: - type: string - session_mode: - type: string - enum: - - cookie - responses: - '204': - description: Logged out successfully - '401': - description: Missing, invalid, or revoked anon key; or invalid, repeated, or under-scoped auth proxy metadata + '413': + description: The request body is larger than 16 KiB content: application/json: schema: $ref: '#/components/schemas/Error' - /auth/forgot-password: - post: + /projects/{id}/frontends: + get: tags: - - Authentication - summary: Request password reset + - Frontends + summary: List all frontends in a project description: | - Generates recovery token and stores it (email sending pending). - Returns generic message to prevent email enumeration. - Project is identified via the anon key. - operationId: authForgotPassword + Supports two mutually exclusive pagination modes. Offset mode uses `page` + and `limit` and returns `next` (URL). Cursor mode uses `cursor` and + `limit`, supports `search` (case-insensitive name match), and returns + `next_cursor`. Sending both `page` and `cursor` (or `page` and `search`) + returns 400. + operationId: listFrontends security: - - AnonKey: [] + - UserToken: [] + - ProjectAccessToken: [] parameters: - - $ref: '#/components/parameters/AuthProxyAuthorization' - - $ref: '#/components/parameters/AuthProxyClientIP' - requestBody: - required: true - content: - application/json: - schema: - type: object - required: - - email - properties: - email: - type: string - format: email + - $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: Generic success message (doesn't reveal if email exists) + description: Successful response content: application/json: schema: - type: object - properties: - message: - type: string - example: If the email exists, a password reset link has been sent + $ref: '#/components/schemas/PaginatedFrontends' + '400': + description: Bad request - invalid project identifier + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '401': - description: Missing, invalid, or revoked anon key; or invalid, repeated, or under-scoped auth proxy metadata + description: Unauthorized - invalid or missing token content: application/json: schema: $ref: '#/components/schemas/Error' '403': - description: Password reset is disabled for this project + description: Forbidden - project ownership required content: application/json: schema: $ref: '#/components/schemas/Error' - '429': - description: Rate limit exceeded (10 requests per hour per IP) + '404': + description: Project not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: Internal server error content: application/json: schema: $ref: '#/components/schemas/Error' - /auth/reset-password: post: tags: - - Authentication - summary: Reset password with recovery token + - Frontends + summary: Create a new frontend deployment description: | - Reset password using recovery token from forgot-password. - Revokes all existing sessions for security. - operationId: authResetPassword + Creates and deploys a frontend for the project. + If a frontend with the same name already exists in the project, this operation updates that + frontend using the uploaded archive and starts a new deployment. A deployment that starts + immediately returns `status: provisioning`, then transitions to `active`, `degraded`, or + `failed`. If another deployment is running, the response preserves the frontend's current status + and exposes the queued deployment through `pending_deployment_id`. + Existing frontend traffic continues to use an available runtime while the new deployment builds + and provisions. Each deployment publishes its own static assets before the runtimes switch to its + build, and the live build's assets keep serving until the new deployment is live, so a page loaded + mid-deployment resolves its assets whichever build served it. A failed redeploy puts the runtimes + back on the build they were running, leaves the frontend `active` on the previous deployment, and + records the attempted deployment as failed. `degraded` means the runtime remains available but + edge synchronization requires recovery; Volcano retries the edge step without rebuilding. Only one deployment may run for a + given frontend, while independent frontends and projects can deploy concurrently. + For monorepos, provide `app_root` as a relative path from the uploaded archive root + to the Next.js app that should be built. Omit it for single-app archives. + Supported frontend environments are Next.js 15.x and 16.x with Node.js + 22.x, 24.x, or 26.x. The Node.js runtime is inferred from + `package.json` `engines.node`; if omitted, Volcano uses Node.js 22.x. + The selected Node.js family must also satisfy the installed Next.js package's + `engines.node` constraint. Volcano tests Next 15.5.29 (`^18.18.0 || ^19.8.0 || >=20.0.0`) and Next 16.5.0 (`>=20.9.0`). + Source archive size is enforced by the API with `SOURCE_ARCHIVE_SIZE_LIMIT_MB`; the CLI + does not apply its own source archive size limit. After the final container images are + built, the publish build enforces `LAMBDA_TARGET_CONTAINER_SIZE_LIMIT_MB` before pushing. + Plans do not limit how many frontends a project has; usage allowances apply across all of a user's frontends. + Each project can contain up to 10,000 frontends regardless of plan. + operationId: createFrontend security: - - AnonKey: [] + - UserToken: [] + - ProjectAccessToken: [] parameters: - - $ref: '#/components/parameters/AuthProxyAuthorization' - - $ref: '#/components/parameters/AuthProxyClientIP' + - $ref: '#/components/parameters/ProjectId' requestBody: required: true content: - application/json: + multipart/form-data: schema: type: object required: - - token - - new_password + - name + - archive properties: - token: + name: type: string - description: Recovery token from forgot-password - new_password: + maxLength: 63 + pattern: ^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$ + description: DNS-safe frontend name + framework: + type: string + enum: + - nextjs + default: nextjs + description: Next.js frontend. Supported Next.js majors are 15.x and 16.x. + app_root: + type: string + 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 + description: ZIP or tar.gz archive of the frontend project directory or monorepo workspace root. The API enforces SOURCE_ARCHIVE_SIZE_LIMIT_MB and stores a normalized tar.gz archive. + commit: type: string description: | - Password validated after NFC normalization against the - policy returned by GET /auth/password-policy. + JSON-encoded commit the uploaded source came from: `{"repository": "acme/app", "sha": "<40-character commit ID>", "dirty": false, "root": "apps/web"}`. `repository` is `owner/name` or a github.com remote URL (`https://github.com/acme/app.git`, `git@github.com:acme/app.git`, or `ssh://git@github.com/acme/app.git`); Volcano drops any credentials in the URL and records `owner/name`. `dirty` is `true` when the uploaded files differ from the commit. `root` is the uploaded directory's path from the repository root, `""` for the root itself. `repository`, `sha`, and `dirty` are required, and fields Volcano does not know are ignored. An empty value, `null`, or `""` reports no commit. A malformed commit, or a repository not on GitHub, returns 400 before anything is deployed. Volcano checks the commit against the project's connected repository and each uploaded file against the commit's file at `root`, and returns the result in the deployment's `commit.verified`; an uploaded file in the project's root directory that the commit does not hold sets `commit.dirty`, and one outside it leaves the commit unverified. A commit it cannot verify is still recorded and never fails the deploy. responses: '200': - description: Password reset successful + description: Existing frontend updated; its deployment was started or queued content: application/json: schema: - type: object - properties: - message: - type: string - '400': - description: Password doesn't meet requirements - '401': - description: Invalid or expired token; or invalid auth proxy metadata - '503': - description: Compromised-password screening is temporarily unavailable + $ref: '#/components/schemas/Frontend' + '201': + description: Frontend created and deployment workflow started content: application/json: schema: - $ref: '#/components/schemas/Error' - /auth/confirm: - post: - tags: - - Authentication - summary: Confirm email address - description: | - Confirm email address using token sent via email. - Required if require_email_confirmation is enabled. - operationId: authConfirmEmail - security: - - AnonKey: [] - requestBody: - required: true - content: - application/json: - schema: - type: object - required: - - token - properties: - token: - type: string - description: Confirmation token from email - responses: - '200': - description: Email confirmed or already confirmed + $ref: '#/components/schemas/Frontend' + '400': + description: Bad request content: application/json: schema: - type: object - properties: - message: - type: string - enum: - - Email confirmed successfully - - Email already confirmed - examples: - confirmed: - summary: Fresh confirmation - value: - message: Email confirmed successfully - alreadyConfirmed: - summary: Token belongs to already-confirmed user - value: - message: Email already confirmed - '400': - description: Missing confirmation token in request body + $ref: '#/components/schemas/Error' '401': - description: Invalid or expired token - /auth/resend-confirmation: - post: - tags: - - Authentication - summary: Resend confirmation email - description: | - Resend email confirmation link. - Returns generic message to prevent email enumeration. - No email is sent when the account does not exist or is already confirmed. - If the account exists and is unconfirmed, a new token is generated and - any previous confirmation token is invalidated. - operationId: authResendConfirmation - security: - - AnonKey: [] - requestBody: - required: true - content: - application/json: - schema: - type: object - required: - - email - properties: - email: - type: string - format: email - responses: - '200': - description: Generic success message + description: Unauthorized - invalid or missing token content: application/json: schema: - type: object - properties: - message: - type: string - '429': - description: Rate limit exceeded + $ref: '#/components/schemas/Error' + '403': + description: Project frontend hard cap exceeded content: application/json: schema: $ref: '#/components/schemas/Error' - /auth/signup-anonymous: - post: - tags: - - Authentication - summary: Create anonymous user - description: | - Create guest user without email/password. - - User metadata (like display_name) can be included and will appear in realtime presence events. - Requires enable_anonymous_signins to be true. - operationId: authSignupAnonymous - security: - - AnonKey: [] - parameters: - - $ref: '#/components/parameters/AuthProxyAuthorization' - - $ref: '#/components/parameters/AuthProxyClientIP' - requestBody: - description: Optional user metadata - content: - application/json: - schema: - type: object - properties: - user_metadata: - type: object - additionalProperties: true - description: Custom user metadata (e.g., display_name, avatar_url) - example: - display_name: Alice - avatar_url: https://example.com/alice.jpg - responses: - '201': - description: Anonymous user created + '404': + description: Project not found content: application/json: schema: - $ref: '#/components/schemas/AuthTokenResponse' - '401': - description: Missing, invalid, or revoked anon key; or invalid, repeated, or under-scoped auth proxy metadata + $ref: '#/components/schemas/Error' + '409': + description: 'Conflict. `code: frontend_served_by_candidate` - a promoted Candidate serves the existing frontend; roll back to the frontend''s own runtime before deploying it. Without a code, the frontend''s deletion is queued or running.' content: application/json: schema: $ref: '#/components/schemas/Error' - '403': - description: Anonymous signins disabled - /auth/user/convert-anonymous: - post: - tags: - - Authentication - summary: Convert anonymous user to authenticated - description: | - Add email and password to anonymous user. - Requires auth user access token. - If require_email_confirmation is enabled for the project, the converted - user remains unconfirmed until /auth/confirm succeeds. When email - sending is enabled, a confirmation email is sent during conversion. - operationId: authConvertAnonymous - security: - - AuthUserAccessToken: [] - requestBody: - required: true - content: - application/json: - schema: - type: object - required: - - email - - password - properties: - email: - type: string - format: email - password: - type: string - description: | - Password validated after NFC normalization against the - policy returned by GET /auth/password-policy. - user_metadata: - type: object - additionalProperties: true - responses: - '200': - description: User converted successfully + '500': + description: Internal server error content: application/json: schema: - type: object - properties: - user: - $ref: '#/components/schemas/AuthUser' - '400': - description: Not an anonymous user - '403': - description: | - The chosen email domain is not in `allowed_email_domains` - '409': - description: Email already in use + $ref: '#/components/schemas/Error' '503': - description: Compromised-password screening is temporarily unavailable + description: Service unavailable - frontend workflow or archive limit configuration missing content: application/json: schema: $ref: '#/components/schemas/Error' - /auth/user/change-email: - post: + /projects/{id}/frontends/{frontendId}: + get: tags: - - Authentication - summary: Request email change - description: | - Request to change user's email address. - Sends confirmation token to new email address. - operationId: authRequestEmailChange + - Frontends + summary: Get frontend details + operationId: getFrontend security: - - AuthUserAccessToken: [] - requestBody: - required: true - content: - application/json: - schema: - type: object - required: - - new_email - properties: - new_email: - type: string - format: email + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/FrontendId' responses: '200': - description: Confirmation email sent + description: Successful response content: application/json: schema: - type: object - properties: - message: - type: string - new_email: - type: string + $ref: '#/components/schemas/Frontend' '400': - description: Invalid email format or same as current email + description: Bad request - invalid identifier content: application/json: schema: $ref: '#/components/schemas/Error' '401': - description: Not authenticated + description: Unauthorized - invalid or missing token content: application/json: schema: $ref: '#/components/schemas/Error' '403': - description: | - The requested email domain is not in `allowed_email_domains` + description: Forbidden - project ownership required content: application/json: schema: $ref: '#/components/schemas/Error' - '409': - description: Email already in use + '404': + description: Frontend not found content: application/json: schema: $ref: '#/components/schemas/Error' - '429': - description: Rate limit exceeded (10 requests per hour per IP) + '500': + description: Internal server error content: application/json: schema: $ref: '#/components/schemas/Error' - /auth/user/confirm-email-change: - post: + delete: tags: - - Authentication - summary: Confirm email change - description: Confirm email change with token sent to new address - operationId: authConfirmEmailChange + - Frontends + summary: Delete a frontend + description: | + Schedules asynchronous frontend deletion. If another deployment is running, the frontend + preserves its current status and exposes the queued deletion through `pending_deployment_id`. + Its status changes to `deleting` when cleanup starts. After cleanup, it returns 404 and no + longer appears in frontend lists. + operationId: deleteFrontend security: - - AuthUserAccessToken: [] - requestBody: - required: true - content: - application/json: - schema: - type: object - required: - - email_change_token - properties: - email_change_token: - type: string + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/FrontendId' responses: - '200': - description: Email changed successfully - content: - application/json: - schema: - type: object - properties: - message: - type: string - user: - $ref: '#/components/schemas/AuthUser' + '202': + description: Frontend deletion started or queued '400': - description: Invalid or expired token, or no pending email change + description: Bad request - invalid identifier content: application/json: schema: $ref: '#/components/schemas/Error' '401': - description: Not authenticated + description: Unauthorized - invalid or missing token content: application/json: schema: $ref: '#/components/schemas/Error' '403': - description: | - The pending email domain is no longer in `allowed_email_domains`. - Re-checked here because the allowlist can narrow between the request - and the confirmation. + description: Forbidden - project ownership required + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Frontend not found content: application/json: schema: $ref: '#/components/schemas/Error' '409': - description: Email is now in use by another user + description: Another Frontend's route mounts this Frontend. Remove those routes first; the error names the mounting Frontends. content: application/json: schema: $ref: '#/components/schemas/Error' - /auth/user/cancel-email-change: - delete: - tags: - - Authentication - summary: Cancel pending email change - operationId: authCancelEmailChange - security: - - AuthUserAccessToken: [] - responses: - '200': - description: Email change cancelled + '500': + description: Internal server error content: application/json: schema: - type: object - properties: - message: - type: string - '401': - description: Not authenticated + $ref: '#/components/schemas/Error' + '503': + description: Service unavailable - frontend workflow configuration missing content: application/json: schema: $ref: '#/components/schemas/Error' - /auth/user/sessions: - get: + /projects/{id}/frontends/{frontendId}/redeploy: + post: tags: - - Authentication - summary: Get current user's sessions + - Frontends + summary: Redeploy frontend using latest uploaded artifact description: | - Returns paginated sessions for the currently authenticated user. - Each session includes device info, IP addresses, and activity timestamps. - The current session is marked with `is_current: true`. - - **Ordering and pagination.** Without `sort`, results are ordered by most - recent activity and paged with `page`/`limit`, returning the - `sessions`/`total`/`page`/`limit`/`total_pages` body below. This is the - legacy default and is preserved for existing clients. - - Send `sort=created_at` to opt into the standard list contract: results are - ordered by session start (newest first) and may be paged either with - `page`/`limit` or by cursor with `cursor`/`ending_before` plus a bounded - `offset` past the cursor anchor. Cursor responses use the shared - `data` envelope with `next_cursor`/`prev_cursor`. - - Unlike other list endpoints, sending `limit` without `page` does **not** - select cursor mode here; `sort=created_at` is the only opt-in. Cursor - pagination is rejected with 400 for the activity order, because - `last_activity_at` changes whenever a session refreshes its token: a row - that crosses the cursor anchor between two requests would be skipped and - never shown. The `status=expired` filter is also offset-only because a - session can expire above the cursor anchor during a walk. Sending that - filter in cursor mode, `page` with `cursor` or `ending_before`, or both - cursor directions returns 400. - operationId: authGetMySessions + Starts a new frontend workflow using the latest stored artifact. A deployment that starts + immediately returns `status: provisioning`, then transitions to `active`, `degraded`, or + `failed`. An overlapping deployment preserves the frontend's current status, is exposed through + `pending_deployment_id`, and supersedes any older queued deployment. The previous runtime and its + published static assets remain available during provisioning, and a failed redeploy restores the + regional runtimes to that build and keeps it serving while the attempted deployment is recorded as + failed. + operationId: redeployFrontend security: - - AuthUserAccessToken: [] + - UserToken: [] + - ProjectAccessToken: [] parameters: - - name: page - in: query - description: Page number (1-indexed) - schema: - type: integer - minimum: 1 - default: 1 - - name: limit - in: query - description: Number of sessions per page (max 100) - schema: - type: integer - minimum: 1 - maximum: 100 - default: 20 - - name: sort - in: query - description: | - Sort key. `last_activity` (default) orders by most recent activity and - supports offset pagination only. `created_at` orders by session start - and supports both offset and cursor pagination. - schema: - type: string - enum: - - last_activity - - created_at - default: last_activity - - name: status - in: query - description: | - Filter by whether the session can still be refreshed. Omit for every - stored session, including expired ones. `expired` is not supported - with cursor pagination. - schema: - type: string - enum: - - active - - expired - - name: cursor - in: query - description: | - Opaque keyset cursor from a previous response's `next_cursor`. Requires - `sort=created_at`; mutually exclusive with `page` and `ending_before`. - schema: - type: string - - name: ending_before - in: query - description: | - Opaque keyset cursor from a previous response's `prev_cursor`, paging - backward. Requires `sort=created_at`; mutually exclusive with `page` - and `cursor`. - schema: - type: string - - name: offset - in: query - description: | - Bounded number of rows to skip past the cursor anchor (the hybrid - jump, maximum 100000). Ignored unless `cursor` or `ending_before` is - supplied. - schema: - type: integer - minimum: 0 - maximum: 100000 + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/FrontendId' responses: '200': - description: Paginated list of user sessions + description: Frontend redeploy started or queued content: application/json: schema: - type: object - properties: - sessions: - type: array - items: - $ref: '#/components/schemas/AuthSession' - total: - type: integer - description: Total number of sessions - page: - type: integer - description: Current page number - limit: - type: integer - description: Number of sessions per page - total_pages: - type: integer - description: Total number of pages - data: - type: array - description: Sessions for this page (cursor pagination only) - items: - $ref: '#/components/schemas/AuthSession' - has_more: - type: boolean - description: Whether a further page exists (cursor pagination only) - next_cursor: - type: string - description: Opaque cursor for the next page (cursor pagination only) - prev_cursor: - type: string - description: Opaque cursor for the previous page (cursor pagination only). Send as `ending_before`. + $ref: '#/components/schemas/Frontend' '400': - description: Invalid or conflicting pagination parameters + description: Bad request - invalid identifier content: application/json: schema: $ref: '#/components/schemas/Error' '401': - description: Not authenticated + description: Unauthorized - invalid or missing token content: application/json: schema: $ref: '#/components/schemas/Error' - delete: - tags: - - Authentication - summary: Sign out from all other devices - description: | - Deletes all sessions except the current one. - Use this to log out from all other devices while keeping the current session active. - operationId: authDeleteAllMySessions - security: - - AuthUserAccessToken: [] - responses: - '204': - description: All other sessions deleted - '401': - description: Not authenticated + '403': + description: Forbidden - project ownership required content: application/json: schema: $ref: '#/components/schemas/Error' - /auth/user/sessions/{sessionId}: - delete: - tags: - - Authentication - summary: Sign out from specific device - description: | - Deletes a specific session, logging out that device. - You can get session IDs from the list sessions endpoint. - operationId: authDeleteMySession - security: - - AuthUserAccessToken: [] - parameters: - - name: sessionId - in: path - required: true - description: The session ID to delete - schema: - type: string - format: uuid - responses: - '204': - description: Session deleted - '401': - description: Not authenticated + '404': + description: Frontend not found content: application/json: schema: $ref: '#/components/schemas/Error' - '404': - description: Session not found + '409': + description: 'Conflict. `code: frontend_served_by_candidate` - a promoted Candidate serves the frontend; roll back to the frontend''s own runtime before redeploying it. Without a code, the frontend''s deletion is queued or running.' content: application/json: schema: $ref: '#/components/schemas/Error' - /auth/user: - get: - tags: - - Authentication - summary: Get current user profile - description: Returns authenticated user's profile. Requires access token. - operationId: authGetUser - security: - - AuthUserAccessToken: [] - responses: - '200': - description: User profile + '500': + description: Internal server error content: application/json: schema: - type: object - properties: - user: - $ref: '#/components/schemas/AuthUser' - '401': - description: Not authenticated - access token missing or invalid + $ref: '#/components/schemas/Error' + '503': + description: Service unavailable - frontend workflow configuration missing content: application/json: schema: $ref: '#/components/schemas/Error' - put: + /projects/{id}/frontends/{frontendId}/domain: + get: tags: - - Authentication - summary: Update user profile - description: Update password or metadata. Requires access token. - operationId: authUpdateUser + - Frontends + summary: Get frontend custom domain status + description: | + Deprecated: use `GET /projects/{id}/frontends/{frontendId}/domains`. + Returns the frontend's oldest domain that serves it rather than redirecting. + deprecated: true + operationId: getFrontendCustomDomain security: - - AuthUserAccessToken: [] - requestBody: - content: - application/json: - schema: - type: object - properties: - password: - type: string - description: | - Password validated after NFC normalization against the - policy returned by GET /auth/password-policy. - user_metadata: - type: object - additionalProperties: true - description: | - Metadata keys to merge into the current user metadata. - Omitted keys remain unchanged; set a key to null to remove it. - Merging is shallow; nested objects replace the stored value for that top-level key. + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/FrontendId' responses: '200': - description: Profile updated + description: | + Frontend custom domain status, or null when the frontend has no + custom domain configured (the common empty state). content: application/json: schema: - type: object - properties: - user: - $ref: '#/components/schemas/AuthUser' + nullable: true + allOf: + - $ref: '#/components/schemas/FrontendCustomDomainResponse' '400': - description: Bad request - invalid password or metadata format + description: Bad request - invalid identifier content: application/json: schema: $ref: '#/components/schemas/Error' '401': - description: Not authenticated - access token missing or invalid + description: Unauthorized - invalid or missing token content: application/json: schema: $ref: '#/components/schemas/Error' - '503': - description: Compromised-password screening is temporarily unavailable + '403': + description: Forbidden - project ownership required content: application/json: schema: $ref: '#/components/schemas/Error' - /auth/user/identities: - get: - tags: - - Authentication - summary: List the current user's identities - description: | - Returns every real email identity the account owns. An account can own - multiple identities (for example a password identity plus one or more - OAuth identities on different emails). Anonymous accounts have no real - identity and return an empty list. - operationId: authListIdentities - security: - - AuthUserAccessToken: [] - responses: - '200': - description: List of identities + '404': + description: Frontend not found content: application/json: schema: - $ref: '#/components/schemas/AuthIdentitiesResponse' - '401': - description: Not authenticated + $ref: '#/components/schemas/Error' + '500': + description: Internal server error content: application/json: schema: $ref: '#/components/schemas/Error' - /auth/user/identities/{identityId}: - delete: + post: tags: - - Authentication - summary: Unlink an identity from the current user + - Frontends + summary: Configure frontend custom domain + deprecated: true description: | - Removes a non-primary identity and its attached sign-in methods. Refused - when the identity is the account's primary, its only identity, or when - removing it would leave the account with no way to sign in. - operationId: authUnlinkIdentity + Deprecated: use `POST /projects/{id}/frontends/{frontendId}/domains`, which adds a domain beside the frontend's others. + Configures one custom domain for a frontend. When the frontend already has a domain, a request for another hostname returns `409`. + The default Volcano-generated frontend URL remains active. + Wildcard Volcano frontend TLS remains valid and isolated from custom-domain certificate changes. + The account must own the hostname: it must have verified the hostname or a domain above it (see `POST /user/domains`). A certificate does not prove ownership. + When the account owns no domain covering the hostname, Volcano asks for a TXT record at `_volcano.`, such as `_volcano.example.com`. Publishing it verifies the whole domain, so later subdomains need no record. A managed TLS request reserves the hostname and returns that record in `verification_records`; the reservation expires after 72 hours unless the record is published. A BYOC request gets `409` with `code: ownership_verification_required` and the record in `required_record`; publish it and send the same request again. + Managed TLS then returns the CNAME that authorizes certificate issuance and renewal. + To move an active BYOC domain to managed TLS without downtime, send `tls.mode: managed` for the same hostname. The response is `200` with the CNAME to publish; the uploaded certificate keeps serving until Volcano issues the managed one, and `serving_certificate` changes from `uploaded` to `managed`. + To move an active managed domain to BYOC without downtime, send `tls.mode: byoc` with the certificate for the same hostname. The response is `200`; the uploaded certificate replaces the managed one at once, and Volcano stops renewing the managed certificate. + An unverified reservation does not block an account that proves ownership. When another account holds one, a request gets `409` with `code: ownership_verification_required` and the caller's own `required_record`; after publishing it, the same request takes over the reservation. When another account verified the domain, the same `409` names the record that moves the domain to the caller once the other account's record is no longer published. A hostname below a domain another account owns otherwise returns `409` without `code`. + operationId: createFrontendCustomDomain security: - - AuthUserAccessToken: [] + - UserToken: [] + - ProjectAccessToken: [] parameters: - - name: identityId - in: path - required: true - description: The identity ID to unlink - schema: - type: string - format: uuid + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/FrontendId' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateFrontendCustomDomainRequest' responses: - '204': - description: Identity unlinked + '200': + description: 'Custom domain already configured with the same hostname. A request with the other TLS mode for the frontend''s active domain switches it in place. To managed TLS, the uploaded certificate keeps serving, with `serving_certificate: uploaded`, until Volcano issues the managed certificate. To BYOC, the uploaded certificate replaces the managed one at once.' + content: + application/json: + schema: + $ref: '#/components/schemas/FrontendCustomDomainResponse' + '201': + description: Custom domain provisioning started + content: + application/json: + schema: + $ref: '#/components/schemas/FrontendCustomDomainResponse' '400': - description: Identity cannot be unlinked (primary, last, or would remove last sign-in method), or the identity id is malformed + description: Bad request - invalid domain content: application/json: schema: $ref: '#/components/schemas/Error' '401': - description: Not authenticated + description: Unauthorized - invalid or missing token + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: Forbidden - the plan does not include custom domains, the frontend has as many custom domains as the plan allows, or a managed TLS request would exceed the account's managed TLS certificate limit content: application/json: schema: $ref: '#/components/schemas/Error' '404': - description: Identity not found + description: Frontend not found content: application/json: schema: $ref: '#/components/schemas/Error' - /auth/user/methods: - get: - tags: - - Authentication - summary: List the current user's sign-in methods - description: | - Returns a flat list of every sign-in method the account owns (password, - each OAuth provider, and any active anonymous method), with the primary - method flagged. Password stubs and converted anonymous methods are excluded. - operationId: authListMethods - security: - - AuthUserAccessToken: [] - responses: - '200': - description: List of sign-in methods + '409': + description: 'Conflict - ownership not verified, custom domain owned or reserved by another account, already in use, still detaching, or frontend already has a custom domain. While a removed domain detaches and Volcano releases it (about a minute for BYOC, a few minutes for managed TLS), adding its hostname to any frontend, or any domain to its frontend, returns `code: custom_domain_releasing` and a `Retry-After` header; send the same request again after that many seconds. A release that will not finish within a few minutes returns the conflict without `code`.' + headers: + Retry-After: + description: Seconds to wait before sending the same request again. Sent only with code `custom_domain_releasing`. + schema: + type: integer content: application/json: schema: - $ref: '#/components/schemas/AuthMethodsResponse' - '401': - description: Not authenticated + $ref: '#/components/schemas/FrontendCustomDomainConflictError' + '413': + description: Request body exceeds 262,144 bytes, or its JSON has too many objects, arrays or values content: application/json: schema: $ref: '#/components/schemas/Error' - /auth/user/methods/{methodId}/promote: - post: + '500': + description: Internal server error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '503': + description: Service unavailable - custom domain provisioning is temporarily unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + delete: tags: - - Authentication - summary: Set a method as the account's primary + - Frontends + summary: Delete frontend custom domain description: | - Promotes the given method to the account's primary sign-in method. The - account's canonical email is re-derived from the promoted method's identity. - Refused for password stubs and converted anonymous methods, and for an - identity whose domain is outside the project's `allowed_email_domains`. - operationId: authPromoteMethod + Deprecated: use `DELETE /projects/{id}/frontends/{frontendId}/domains/{domain}`. + Deletes the frontend's custom domain. A frontend with several domains + returns `409`; name the one to delete on the collection route. + deprecated: true + operationId: deleteFrontendCustomDomain security: - - AuthUserAccessToken: [] + - UserToken: [] + - ProjectAccessToken: [] parameters: - - name: methodId - in: path - required: true - description: The method ID to promote - schema: - type: string - format: uuid + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/FrontendId' responses: - '200': - description: The promoted method - content: - application/json: - schema: - $ref: '#/components/schemas/AuthMethodSummary' + '204': + description: Custom domain detach scheduled '400': - description: This method cannot be set as primary (password stub, converted anonymous method, or unverified email), or the method id is malformed + description: Bad request - invalid identifier content: application/json: schema: $ref: '#/components/schemas/Error' '401': - description: Not authenticated + description: Unauthorized - invalid or missing token content: application/json: schema: $ref: '#/components/schemas/Error' '403': - description: The promoted identity's email domain is not in the project's allowed_email_domains + description: Forbidden - project ownership required content: application/json: schema: $ref: '#/components/schemas/Error' '404': - description: Method not found + description: Frontend or custom domain not found content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/auth/insights: + '409': + description: The custom domain switched TLS mode while the request ran, so send it again, another domain of the frontend redirects to it, or the frontend has several domains. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: Internal server error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /projects/{id}/frontends/{frontendId}/domains: + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/FrontendId' get: tags: - - Auth Admin - summary: Get auth user insights + - Frontends + summary: List a frontend's custom domains description: | - Returns current and deleted auth-user totals, rolling 24-hour and 30-day - active users, and zero-filled daily activity and account-retention counts - for an inclusive UTC date range. Weeks start on Monday. - The existing deletions series counts accounts by deletion date; net_growth - remains signups minus deletions and is not affected by bans. - The banned_users, deleted_users, and available_users fields describe the - current state of users registered in each bucket. Banned users exclude - deleted users and expired bans. Available users are signups minus - banned_users minus deleted_users. Unban and expiry restore availability in - the original signup bucket. These current-state cohorts can change after - the requested dates have passed, without rewriting activity counts. - Sign-in counts remain grouped by session creation date. Deleted users - contribute to active counts until their last activity leaves the rolling - window. Token refreshes affect active users but not the sign-in series. - Signup history is backfilled from accounts present when collection was - deployed. Accounts hard-deleted before deletion-history collection cannot - be recovered. Current bans require no separate event-history collection. - operationId: getAuthInsights + Lists the frontend's custom domains, oldest first. Each domain either + serves the frontend or, with `redirect` set, redirects every request to + another domain of the frontend. + operationId: listFrontendDomains security: - UserToken: [] - ProjectAccessToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' - - name: from - in: query - description: Inclusive UTC start date. Defaults to 29 days before `to`. - schema: - type: string - format: date - - name: to - in: query - description: Inclusive UTC end date. Defaults to today. - schema: - type: string - format: date - - name: interval - in: query - description: Chart bucket size. Defaults to `day`. - schema: - $ref: '#/components/schemas/AuthInsightsInterval' responses: '200': - description: Auth insights retrieved - content: - application/json: - schema: - $ref: '#/components/schemas/AuthInsightsResponse' - example: - project_id: 4f165080-a931-4e03-b3bd-41c45c3f0058 - observed_at: '2026-07-20T18:00:00Z' - window: - from: '2026-06-21' - to: '2026-07-20' - interval: day - summary: - total_users: 1234 - deleted_users: 42 - active_users_1d: 83 - active_users_30d: 418 - series: - - bucket_start: '2026-07-20' - signups: 12 - signins: 97 - deletions: 3 - banned_users: 2 - deleted_users: 3 - available_users: 7 - net_growth: 9 - is_partial: true - '400': - description: Invalid date range or interval + description: The frontend's custom domains content: application/json: schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/schemas/FrontendCustomDomainList' '401': - description: Unauthorized - invalid or missing token + description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/Error' '403': - description: Access denied + description: Project not owned by the caller content: application/json: schema: $ref: '#/components/schemas/Error' '404': - description: Project not found + description: Frontend not found content: application/json: schema: $ref: '#/components/schemas/Error' '500': - description: Internal server error + description: Failed to list custom domains content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/auth/users: - get: + post: tags: - - Auth Admin - summary: List all auth users (admin) - description: List auth users in project. Requires platform token. - operationId: listAuthUsers + - Frontends + summary: Add a custom domain to a frontend + description: | + Adds a custom domain beside the frontend's others, up to the plan's + custom domains per frontend. The domain serves the frontend, or, with + `redirect`, redirects every request to `redirect.to`, another active + domain of the same frontend that serves it, keeping the path and query + string. + A redirecting domain still needs TLS, so it takes `tls` like any other. + + Ownership, verification records, TLS mode switches, and the `409` codes + work as on `POST /projects/{id}/frontends/{frontendId}/domain`. A + request for a hostname the frontend already has returns it with `200`, + or switches its TLS mode in place. When the request's redirect differs + from the domain's, it returns `409`; change a redirect with `PATCH`. + operationId: createFrontendDomain 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' - - name: status - in: query - required: false - description: Filter by effective status. `banned` returns only currently-banned users; an expired temporary ban lists as `active`. - schema: - type: string - enum: - - active - - banned + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateFrontendDomainRequest' responses: '200': - description: Successful response + description: The frontend already has this hostname, or its TLS mode was switched in place content: application/json: schema: - $ref: '#/components/schemas/PaginatedAuthUsers' + $ref: '#/components/schemas/FrontendCustomDomainResponse' + '201': + description: Custom domain provisioning started + content: + application/json: + schema: + $ref: '#/components/schemas/FrontendCustomDomainResponse' '400': - description: Invalid status or pagination parameters + description: Invalid domain, TLS, or redirect, such as a redirect to a hostname the frontend does not serve or that is not active yet content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/auth/users/{userId}: + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: The plan does not include custom domains, the frontend has as many as the plan allows, or a managed TLS request would exceed the managed TLS certificate limit + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Frontend not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '409': + description: 'Ownership not verified, the hostname is owned, reserved, or used elsewhere, the frontend already has the hostname with a different redirect, or a removed domain is still releasing it (`code: custom_domain_releasing` with `Retry-After`).' + headers: + Retry-After: + description: Seconds to wait before sending the same request again. Sent only with code `custom_domain_releasing`. + schema: + type: integer + content: + application/json: + schema: + $ref: '#/components/schemas/FrontendCustomDomainConflictError' + '413': + description: Request body exceeds 262,144 bytes, or its JSON has too many objects, arrays or values + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: Failed to add the custom domain + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '503': + description: Custom domain provisioning is temporarily unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /projects/{id}/frontends/{frontendId}/domains/{domain}: + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/FrontendId' + - $ref: '#/components/parameters/FrontendCustomDomainHostname' get: tags: - - Auth Admin - summary: Get specific auth user (admin) - operationId: getAuthUser + - Frontends + summary: Get a frontend custom domain + operationId: getFrontendDomain security: - UserToken: [] - ProjectAccessToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' - - name: userId - in: path - required: true - schema: - type: string - format: uuid responses: '200': - description: Auth user details + description: The custom domain content: application/json: schema: - $ref: '#/components/schemas/AuthUser' - delete: - tags: - - Auth Admin - summary: Delete auth user (admin) - description: Soft-deletes user and revokes all sessions - operationId: deleteAuthUser - security: - - UserToken: [] - - ProjectAccessToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' - - name: userId - in: path - required: true - schema: - type: string - format: uuid - responses: - '204': - description: User deleted - /projects/{id}/auth/users/{userId}/sessions: - get: + $ref: '#/components/schemas/FrontendCustomDomainResponse' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: Project not owned by the caller + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Frontend or custom domain not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: Failed to get the custom domain + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + patch: tags: - - Auth Admin - summary: List user sessions + - Frontends + summary: Set or clear a custom domain's redirect description: | - List paginated sessions for a specific auth user. - Returns session details including device info, IP address, and activity timestamps. - - Ordering and pagination match `GET /auth/user/sessions`: the default is - activity order with `page`/`limit` and the legacy `sessions` body, and - `sort=created_at` opts into the standard cursor/offset hybrid with the - shared `data` envelope. Cursor pagination is only available for - `sort=created_at`, because the activity timestamp changes under paging. - The `status=expired` filter is offset-only because sessions can expire - above a cursor anchor during a walk. - operationId: listUserSessions + `{"redirect": {"to": "www.example.com", "status": 308}}` makes the + domain redirect to another active domain of the frontend that serves it. + `{"redirect": null}` makes it serve the frontend again. A domain other + domains redirect to cannot become a redirect itself. `status` defaults + to `308`. Proxies apply the change within seconds. + operationId: updateFrontendDomain security: - UserToken: [] - ProjectAccessToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' - - name: userId - in: path - required: true - schema: - type: string - format: uuid - - name: page - in: query - description: Page number (1-indexed) - schema: - type: integer - minimum: 1 - default: 1 - - name: limit - in: query - description: Number of sessions per page (max 100) - schema: - type: integer - minimum: 1 - maximum: 100 - default: 20 - - name: sort - in: query - description: | - Sort key. `last_activity` (default) orders by most recent activity and - supports offset pagination only. `created_at` orders by session start - and supports both offset and cursor pagination. - schema: - type: string - enum: - - last_activity - - created_at - default: last_activity - - name: status - in: query - description: | - Filter by whether the session can still be refreshed. Omit for every - stored session, including expired ones. `expired` is not supported - with cursor pagination. - schema: - type: string - enum: - - active - - expired - - name: cursor - in: query - description: | - Opaque keyset cursor from a previous response's `next_cursor`. Requires - `sort=created_at`; mutually exclusive with `page` and `ending_before`. - schema: - type: string - - name: ending_before - in: query - description: | - Opaque keyset cursor from a previous response's `prev_cursor`, paging - backward. Requires `sort=created_at`; mutually exclusive with `page` - and `cursor`. - schema: - type: string - - name: offset - in: query - description: | - Bounded number of rows to skip past the cursor anchor (the hybrid - jump, maximum 100000). Ignored unless `cursor` or `ending_before` is - supplied. - schema: - type: integer - minimum: 0 - maximum: 100000 + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateFrontendCustomDomainRequest' responses: '200': - description: Paginated list of user sessions + description: The updated custom domain content: application/json: schema: - type: object - properties: - sessions: - type: array - items: - $ref: '#/components/schemas/AuthSession' - total: - type: integer - description: Total number of sessions - page: - type: integer - description: Current page number - limit: - type: integer - description: Number of sessions per page - total_pages: - type: integer - description: Total number of pages - data: - type: array - description: Sessions for this page (cursor pagination only) - items: - $ref: '#/components/schemas/AuthSession' - has_more: - type: boolean - description: Whether a further page exists (cursor pagination only) - next_cursor: - type: string - description: Opaque cursor for the next page (cursor pagination only) - prev_cursor: - type: string - description: Opaque cursor for the previous page (cursor pagination only). Send as `ending_before`. + $ref: '#/components/schemas/FrontendCustomDomainResponse' '400': - description: Invalid or conflicting pagination parameters + description: 'Invalid redirect: the target is this domain, is not an active domain of the frontend, or redirects itself' content: application/json: schema: $ref: '#/components/schemas/Error' - '404': - description: User not found - delete: - tags: - - Auth Admin - summary: Delete all user sessions - description: | - Revokes all sessions for a user, forcing them to re-authenticate on all devices. - Use this to log out a user from everywhere. - operationId: deleteAllUserSessions - security: - - UserToken: [] - - ProjectAccessToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' - - name: userId - in: path - required: true - schema: - type: string - format: uuid - responses: - '204': - description: All sessions deleted - '404': - description: User not found - /projects/{id}/auth/users/{userId}/sessions/{sessionId}: - delete: - tags: - - Auth Admin - summary: Delete specific session - description: | - Revokes a specific session for a user. - Use this to log out a user from a single device. - operationId: deleteUserSession - security: - - UserToken: [] - - ProjectAccessToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' - - name: userId - in: path - required: true - schema: - type: string - format: uuid - - name: sessionId - in: path - required: true - schema: - type: string - format: uuid - responses: - '204': - description: Session deleted - '404': - description: Session or user not found - /projects/{id}/auth/users/{userId}/ban: - post: - tags: - - Auth Admin - summary: Ban a user - description: | - Bans a user temporarily or permanently. Banned users cannot sign in - and all their active sessions are immediately revoked. - Omitting banned_until clears any previous expiry. Deleted accounts cannot be banned. - - - Omit `banned_until` for a permanent ban - - Provide `banned_until` ISO timestamp for a temporary ban - operationId: banAuthUser - security: - - UserToken: [] - - ProjectAccessToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' - - name: userId - in: path - required: true - schema: - type: string - format: uuid - requestBody: - content: - application/json: - schema: - type: object - properties: - banned_until: - type: string - format: date-time - description: When the ban expires (omit for permanent ban) - example: '2026-12-31T23:59:59Z' - responses: - '200': - description: User banned successfully + '401': + description: Unauthorized content: application/json: schema: - $ref: '#/components/schemas/BanUserResponse' - '404': - description: User not found + $ref: '#/components/schemas/Error' + '403': + description: Project not owned by the caller content: application/json: schema: $ref: '#/components/schemas/Error' - '409': - description: Deleted accounts cannot be banned or restored + '404': + description: 'Frontend or custom domain not found, or the domain is being removed (`domain_status: detaching`)' content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/auth/users/{userId}/unban: - post: - tags: - - Auth Admin - summary: Unban a user - description: | - Removes a ban from a user, restoring their ability to sign in. - The user's status is set back to 'active'. Deleted accounts cannot be restored. - operationId: unbanAuthUser - security: - - UserToken: [] - - ProjectAccessToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' - - name: userId - in: path - required: true - schema: - type: string - format: uuid - responses: - '200': - description: User unbanned successfully + '409': + description: Other domains of the frontend redirect to this one; the message names them content: application/json: schema: - $ref: '#/components/schemas/UnbanUserResponse' - '404': - description: User not found + $ref: '#/components/schemas/Error' + '413': + description: Request body exceeds 262,144 bytes, or its JSON has too many objects, arrays or values content: application/json: schema: $ref: '#/components/schemas/Error' - '409': - description: Deleted accounts cannot be banned or restored + '500': + description: Failed to update the custom domain content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/email-templates: - get: + delete: tags: - - Auth Configuration - summary: List email templates - description: Returns all custom email templates for this project. - operationId: listEmailTemplates + - Frontends + summary: Remove a custom domain from a frontend + description: | + Detaches the domain. A domain other domains redirect to cannot be + removed until those redirects are removed or retargeted. + operationId: deleteFrontendDomain security: - UserToken: [] - ProjectAccessToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' responses: - '200': - description: Email templates list + '204': + description: Custom domain detach scheduled + '401': + description: Unauthorized content: application/json: schema: - type: object - properties: - data: - type: array - items: - $ref: '#/components/schemas/EmailTemplate' - post: - tags: - - Auth Configuration - summary: Create email template - description: | - Creates a custom email template for the project. Custom email templates - are a SUPERAGENT feature: requests from a HOBBY project owner are - rejected with 403, and HOBBY projects always send the built-in default - templates regardless of any previously saved custom rows. - Every project is created with one template per type, so customizing one - is usually a PUT; creating a type the project already has returns 409. - Valid template types: welcome, confirmation, password_reset, password_changed - operationId: createEmailTemplate - security: - - UserToken: [] - - ProjectAccessToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/CreateEmailTemplateRequest' - responses: - '201': - description: Template created + $ref: '#/components/schemas/Error' + '403': + description: Project not owned by the caller content: application/json: schema: - $ref: '#/components/schemas/EmailTemplate' - '400': - description: Invalid template type + $ref: '#/components/schemas/Error' + '404': + description: Frontend or custom domain not found content: application/json: schema: $ref: '#/components/schemas/Error' - '403': - description: Custom email templates require the SUPERAGENT plan + '409': + description: Other domains of the frontend redirect to this one, and the message names them, or the domain switched TLS mode while the request ran content: application/json: schema: $ref: '#/components/schemas/Error' - '409': - description: The project already has a template of this type + '500': + description: Failed to remove the custom domain content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/email-templates/{type}: + /projects/{id}/frontends/{frontendId}/deployments: get: tags: - - Auth Configuration - summary: Get email template - operationId: getEmailTemplate + - Frontends + summary: List frontend deployments + operationId: listFrontendDeployments security: - UserToken: [] - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - - name: type - in: path - required: true - schema: - type: string - enum: - - welcome - - confirmation - - password_reset - - password_changed + - $ref: '#/components/parameters/FrontendId' + - $ref: '#/components/parameters/Page' + - $ref: '#/components/parameters/Limit' responses: '200': - description: Email template + description: Successful response content: application/json: schema: - $ref: '#/components/schemas/EmailTemplate' + $ref: '#/components/schemas/PaginatedFrontendDeployments' + '400': + description: Bad request - invalid identifier + 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 - project ownership required + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '404': - description: Template not found - put: + description: Frontend not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: Internal server error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + post: tags: - - Auth Configuration - summary: Update email template + - Frontends + summary: Deploy an existing build to a frontend description: | - Updates a custom email template. Custom email templates are a SUPERAGENT - feature: requests from a HOBBY project owner are rejected with 403 - (including after a downgrade), so a HOBBY project cannot modify - templates and always sends the built-in defaults. - operationId: updateEmailTemplate + Deploys the build of another frontend's deployment in the same project to this frontend, without + compiling it again. Use it to serve one build from several frontends, such as one per region or + brand. This frontend gets its own copy of the source archive and the build, so later changes to the + source frontend do not reach it, and a later redeploy of this frontend compiles that copied source. + + The build-time variables this frontend would build with must equal those the source build read, + compared by name and value. Volcano records a keyed digest of each value, unique to the build, and + never stores the values. A mismatch returns `409` with `code: build_variables_differ` and the differing + names in `error`. The source deployment must be `active` or `degraded`, and both frontends must use + the same framework and app root. + + Admission is the redeploy's: the deployment starts with `status: provisioning`, or, while another + deployment is in progress, is exposed through `pending_deployment_id` and supersedes any older + queued deployment. Nothing is compiled: the deployment's build minutes cover publishing the build + alone. The checks run again when a queued deployment starts. A refusal then fails the deployment + without a retry, its `error_message` starting with the refusal's code. + operationId: createFrontendDeployment security: - UserToken: [] - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - - name: type - in: path - required: true - schema: - type: string - enum: - - welcome - - confirmation - - password_reset - - password_changed + - $ref: '#/components/parameters/FrontendId' requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/UpdateEmailTemplateRequest' + $ref: '#/components/schemas/CreateFrontendDeploymentRequest' responses: '200': - description: Template updated + description: Deployment started or queued content: application/json: schema: - $ref: '#/components/schemas/EmailTemplate' - '403': - description: Custom email templates require the SUPERAGENT plan + $ref: '#/components/schemas/Frontend' + '400': + description: 'Bad request - invalid identifier or body, or `code: source_deployment_same_frontend` when the source deployment belongs to this frontend; redeploy the frontend instead.' + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Unauthorized - invalid or missing token content: application/json: schema: $ref: '#/components/schemas/Error' - '404': - description: Template not found - delete: - tags: - - Auth Configuration - summary: Delete email template - description: | - Deletes a custom template, reverting to the default. Custom email - templates are a SUPERAGENT feature: requests from a HOBBY project owner - are rejected with 403. - operationId: deleteEmailTemplate - security: - - UserToken: [] - - ProjectAccessToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' - - name: type - in: path - required: true - schema: - type: string - enum: - - welcome - - confirmation - - password_reset - - password_changed - responses: - '204': - description: Template deleted '403': - description: Custom email templates require the SUPERAGENT plan + description: Forbidden - project ownership required content: application/json: schema: $ref: '#/components/schemas/Error' '404': - description: Template not found - /email-templates/defaults: - get: - tags: - - Auth Configuration - summary: Get default email templates - description: Returns the default email templates used when no custom template is configured. - operationId: getDefaultEmailTemplates - responses: - '200': - description: Default templates + description: 'Frontend not found, or `code: source_deployment_not_found` when the source deployment is not in this project.' content: application/json: schema: - type: object - properties: - data: - type: array - items: - $ref: '#/components/schemas/EmailTemplate' - /email-templates/defaults/{type}: - get: - tags: - - Auth Configuration - summary: Get default email template by type - operationId: getDefaultEmailTemplate - parameters: - - name: type - in: path - required: true - schema: - type: string - enum: - - welcome - - confirmation - - password_reset - - password_changed - responses: - '200': - description: Default template + $ref: '#/components/schemas/Error' + '409': + description: 'Conflict. `code: build_variables_differ` names the build-time variables whose values differ. `code: source_deployment_not_active` refuses a deployment that is not `active` or `degraded`. `code: source_deployment_is_preview` refuses a preview''s deployment; deploy from a frontend''s own deployment. `code: source_served_by_candidate` refuses a deployment of a frontend a promoted Candidate serves, since that frontend does not serve its own build; roll the source frontend back to its own build first. `code: source_build_unavailable` refuses a deployment made before Volcano kept builds, or whose build is no longer kept; redeploy the source frontend once and deploy from that deployment. `code: frontend_incompatible` refuses a different framework or app root. `code: frontend_served_by_candidate` refuses a frontend a promoted Candidate serves; roll back to the frontend''s own runtime first. Without a code, the frontend''s deletion is queued or running, or the project''s source is managed by Git, where deploys come from a push to the production branch.' content: application/json: schema: - $ref: '#/components/schemas/EmailTemplate' - '404': - description: Template type not found - /projects/{id}/auth/config: + $ref: '#/components/schemas/Error' + '413': + description: Request body exceeds 4,194,304 bytes, or its JSON has too many objects, arrays or values + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: Monthly build-minutes allowance exceeded + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: Internal server error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '501': + description: '`code: build_reuse_unavailable` - this server cannot deploy an existing build. Local mode answers this; deploy the frontend from source instead.' + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '503': + description: Service unavailable - frontend workflow configuration missing, or the build-minutes check is temporarily unavailable; retry later. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /projects/{id}/frontends/{frontendId}/candidates: get: tags: - - Auth Configuration - summary: Get auth configuration - operationId: getAuthConfig + - Frontends + summary: List a frontend's Candidates + description: | + Returns the frontend's Candidates, oldest first, each with its latest deployment. A frontend + holds at most 100 live Candidates, so the list is never longer. An account holds at most its + plan's live Candidates across all of its projects and frontends: 1000 on HOBBY, 10000 on + SUPERAGENT. Reading never depends on the `frontends.candidates` capability. + operationId: listFrontendCandidates security: - UserToken: [] - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/FrontendId' responses: '200': - description: Auth configuration + description: The frontend's Candidates content: application/json: schema: - $ref: '#/components/schemas/AuthConfig' - put: - tags: - - Auth Configuration - summary: Update auth configuration - description: | - Updates the project's auth configuration. Only the fields present in - the body are changed. - operationId: updateAuthConfig - security: - - UserToken: [] - - ProjectAccessToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateAuthConfigRequest' - responses: - '200': - description: Configuration updated + $ref: '#/components/schemas/FrontendCandidateList' + '400': + description: Bad request - invalid identifier content: application/json: schema: - $ref: '#/components/schemas/AuthConfig' - '403': - description: | - The update would turn on, widen, or otherwise edit the email domain - allowlist (`allowed_email_domains`, `allowed_email_domains_mode`) - for a project that is not on the SUPERAGENT plan. A HOBBY project keeps - whatever allowlist it already has — parked, enforcing nothing until - it upgrades — and may still remove it, so a downgrade never leaves a - project locked out of its own signups. + $ref: '#/components/schemas/Error' + '401': + description: Unauthorized - invalid or missing token content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/auth/config/test-email: - post: - tags: - - Auth Configuration - summary: Send a test email using the project's saved SMTP config - description: | - Sends a diagnostic email to `to_email` using the project's - persisted `auth_config` SMTP credentials. If `html_body` or - `text_body` is supplied, the override path is taken: those - values (plus optional `subject`) are rendered through - html/text templates against the project's `Data` and - used as the body — used by the template editor's "Send Test" - affordance to preview an unsaved template. With both bodies - omitted, a hardcoded diagnostic message is sent and any - `subject` field is ignored. Sending `subject` alone (no - bodies) is rejected with 400 to avoid a silently-dropped - subject or a blank message. Also rejects with 400 if - `email_enabled=false`, `smtp_host` is empty, or the saved - `smtp_password` can't be read and must be set again. - operationId: testEmailConfig - security: - - UserToken: [] - - ProjectAccessToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/TestEmailRequest' - responses: - '200': - description: Test email sent + '403': + description: Forbidden - project ownership required content: application/json: schema: - $ref: '#/components/schemas/TestEmailResponse' - '400': - description: Invalid request or email delivery not configured - '401': - description: Unauthorized - '403': - description: Forbidden + $ref: '#/components/schemas/Error' '404': - description: Project not found - '502': - description: Template render failure or SMTP delivery failed - /projects/{id}/auth/hosted-pages/{pageType}: - get: - tags: - - Auth Configuration - summary: Get hosted auth page - description: | - Returns the saved HTML/CSS for the page type, or `page: null` when the - project has not customized it yet. Always returns `defaults` (the theme - shell to seed an editor with, which is valid input to the update endpoint) - and `runtime` (the script the rendered page runs, plus a preview harness). - operationId: getAuthHostedPage - security: - - UserToken: [] - - ProjectAccessToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' - - name: pageType - in: path - required: true - schema: - $ref: '#/components/schemas/HostedAuthPageType' - responses: - '200': - description: Hosted page loaded + description: Frontend not found content: application/json: schema: - $ref: '#/components/schemas/AuthHostedPageResponse' - put: + $ref: '#/components/schemas/Error' + '500': + description: Internal server error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + post: tags: - - Auth Configuration - summary: Update hosted auth page - description: | - Saves the current HTML/CSS for this page type. - Security validation rejects script tags, javascript: URLs, inline event handlers, iframe/object/embed/meta/link tags in HTML, - and closing style/head tags in CSS. - operationId: updateAuthHostedPage + - Frontends + summary: Create a frontend Candidate + description: | + Builds a copy of the frontend from the uploaded archive, with the frontend's own variable + selection, and deploys it to one region: the first region the frontend deploys to, or the + project's first region by name if it has not deployed yet. The Candidate is served at its own + URL, so it can be checked without changing what the frontend serves. The URL is reachable by + anyone who holds it and is not indexed; a Candidate is never public and does not claim to be + private. The response is `202` while the first deployment runs; read the Candidate for its + `status` and `url`. + + Creating a Candidate is available while the `frontends.candidates` capability is. While it is + not, this operation, redeploying, promoting and rolling back to a Candidate answer `404` with + code `feature_unavailable`; reading and deleting existing Candidates, and rolling back to the + frontend's own runtime, keep working. + + A Candidate builds like any deploy and spends the project's build minutes. The project owner's + account holds at most its plan's live Candidates across all of its projects and frontends: 1000 + on HOBBY, 10000 on SUPERAGENT, and one frontend at most 100 whatever the plan. A Candidate counts + until its deletion completes. Each name is unique within + the frontend. Without `ttl_seconds` a Candidate is kept until it is deleted. + operationId: createFrontendCandidate security: - UserToken: [] - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - - name: pageType - in: path - required: true - schema: - $ref: '#/components/schemas/HostedAuthPageType' + - $ref: '#/components/parameters/FrontendId' requestBody: required: true content: - application/json: + multipart/form-data: schema: - $ref: '#/components/schemas/UpdateAuthHostedPageRequest' + type: object + required: + - name + - archive + properties: + name: + type: string + minLength: 1 + maxLength: 128 + description: Names the Candidate within the frontend. Cannot be `production`. + ttl_seconds: + type: integer + minimum: 1 + maximum: 2592000 + description: Deletes the Candidate this many seconds after it is created, at most 30 days. Omit to keep it until deleted. + archive: + type: string + format: binary + description: ZIP or tar.gz archive of the frontend project, as for creating a frontend. The API enforces SOURCE_ARCHIVE_SIZE_LIMIT_MB. responses: - '200': - description: Hosted page updated + '202': + description: Candidate created; its first deployment is running content: application/json: schema: - $ref: '#/components/schemas/AuthHostedPageResponse' + $ref: '#/components/schemas/FrontendCandidate' '400': - description: Invalid input or unsafe markup - '401': - description: Unauthorized - '403': - description: Forbidden - '404': - description: Project not found - /projects/{id}/auth/pages/appearance: - get: - tags: - - Auth Configuration - summary: Get managed auth page appearance - operationId: getAuthPageAppearance - security: - - UserToken: [] - - ProjectAccessToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' - responses: - '200': - description: Saved appearance and effective plan state + description: Bad request - invalid name, expiry, identifier or archive, a variable the frontend declares has no value, or the resolved variables are too large content: application/json: schema: - $ref: '#/components/schemas/AuthPageAppearanceResponse' + $ref: '#/components/schemas/Error' '401': - description: Unauthorized + description: Unauthorized - invalid or missing token content: application/json: schema: $ref: '#/components/schemas/Error' '403': - description: Access denied + description: Forbidden - project ownership required content: application/json: schema: $ref: '#/components/schemas/Error' '404': - description: Project not found + description: Frontend not found, or the `frontends.candidates` capability is unavailable (code `feature_unavailable`) + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '409': + description: 'Conflict. `code: candidate_name_taken` - the name is taken. `code: candidate_limit_reached` - the project owner''s account already holds the live Candidates its plan allows, across all of its projects and frontends, or the frontend already holds 100 live Candidates, whatever the plan. Delete a Candidate and wait for its deletion to finish: one being deleted counts until then, and the Candidate a frontend serves cannot be deleted until the frontend is rolled back. On HOBBY, upgrading raises the account''s allowance, not a frontend''s 100. `code: configuration_changed` - the frontend''s configuration changed during the deploy; retry. `code: frontend_deleting` or `code: project_deleting` - the frontend or project is being deleted.' + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '413': + description: The request body is larger than the archive limit, SOURCE_ARCHIVE_SIZE_LIMIT_MB + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: Too many requests - the project's build minutes for the billing cycle are used up content: application/json: schema: $ref: '#/components/schemas/Error' '500': - description: Appearance could not be read + description: Internal server error content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/auth/pages/theme: - put: + '503': + description: Service unavailable - frontend deployments are not configured, or the project owner's plan cannot be read right now ("subscription pricing temporarily unavailable"); retry. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /projects/{id}/frontends/{frontendId}/candidates/{candidateId}: + get: tags: - - Auth Configuration - summary: Save the managed auth page theme - operationId: updateAuthPageTheme + - Frontends + summary: Get a frontend Candidate + operationId: getFrontendCandidate security: - UserToken: [] - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateAuthPageThemeRequest' + - $ref: '#/components/parameters/FrontendId' + - $ref: '#/components/parameters/FrontendCandidateId' responses: '200': - description: Theme saved + description: The Candidate with its latest deployment content: application/json: schema: - $ref: '#/components/schemas/UpdateAuthPageThemeRequest' + $ref: '#/components/schemas/FrontendCandidate' '400': - description: Invalid or unreadable theme + description: Bad request - invalid identifier content: application/json: schema: $ref: '#/components/schemas/Error' '401': - description: Unauthorized + description: Unauthorized - invalid or missing token content: application/json: schema: $ref: '#/components/schemas/Error' '403': - description: Plan does not permit customisation + description: Forbidden - project ownership required content: application/json: schema: $ref: '#/components/schemas/Error' '404': - description: Project not found + description: Frontend or Candidate not found content: application/json: schema: $ref: '#/components/schemas/Error' '500': - description: Theme could not be saved + description: Internal server error content: application/json: schema: $ref: '#/components/schemas/Error' delete: tags: - - Auth Configuration - summary: Clear the managed auth page theme - operationId: deleteAuthPageTheme + - Frontends + summary: Delete a frontend Candidate + description: | + Starts deleting the Candidate: its regional runtime, images, edge state and stored source are + removed once any running deployment finishes. Asking again for a Candidate that is already being + deleted is the same request. The Candidate answers `404` once it is gone. + + A Candidate the frontend serves cannot be deleted: roll back first. A Candidate the frontend only + keeps as the runtime a rollback returns to can be deleted, and doing so gives up that rollback; + rolling back to the frontend's own runtime stays possible. + operationId: deleteFrontendCandidate security: - UserToken: [] - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/FrontendId' + - $ref: '#/components/parameters/FrontendCandidateId' responses: - '204': - description: Theme cleared + '202': + description: Deletion started + '400': + description: Bad request - invalid identifier + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '401': - description: Unauthorized + description: Unauthorized - invalid or missing token content: application/json: schema: $ref: '#/components/schemas/Error' '403': - description: Plan does not permit customisation + description: Forbidden - project ownership required content: application/json: schema: $ref: '#/components/schemas/Error' '404': - description: Project not found + description: Frontend or Candidate not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '409': + description: '`code: candidate_in_use` - the frontend serves this Candidate.' content: application/json: schema: $ref: '#/components/schemas/Error' '500': - description: Theme could not be cleared + description: Internal server error content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/auth/pages/{pageType}/layout: - parameters: - - $ref: '#/components/parameters/ProjectId' - - name: pageType - in: path - required: true - schema: - $ref: '#/components/schemas/HostedAuthPageType' - put: + /projects/{id}/frontends/{frontendId}/candidates/{candidateId}/deployments: + post: tags: - - Auth Configuration - summary: Save one managed auth page layout - operationId: updateAuthPageLayout + - Frontends + summary: Deploy a new archive to a frontend Candidate + description: | + Builds the uploaded archive with the frontend's own variable selection and deploys it to the + Candidate. The Candidate keeps serving its previous deployment until this one succeeds, and a + failed deployment leaves it on the previous one. A Candidate takes one deployment at a time. + While the `frontends.candidates` capability is unavailable, it answers `404` with code + `feature_unavailable`. + operationId: redeployFrontendCandidate security: - UserToken: [] - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/FrontendId' + - $ref: '#/components/parameters/FrontendCandidateId' requestBody: required: true content: - application/json: + multipart/form-data: schema: - $ref: '#/components/schemas/UpdateAuthPageLayoutRequest' + type: object + required: + - archive + properties: + archive: + type: string + format: binary + description: ZIP or tar.gz archive of the frontend project, as for creating a frontend. responses: - '200': - description: Layout saved + '202': + description: The deployment is running content: application/json: schema: - $ref: '#/components/schemas/UpdateAuthPageLayoutRequest' + $ref: '#/components/schemas/FrontendCandidateDeployment' '400': - description: Invalid page type or layout + description: Bad request - invalid identifier or archive, a variable the frontend declares has no value, or the resolved variables are too large content: application/json: schema: $ref: '#/components/schemas/Error' '401': - description: Unauthorized + description: Unauthorized - invalid or missing token content: application/json: schema: $ref: '#/components/schemas/Error' '403': - description: Plan does not permit customisation + description: Forbidden - project ownership required content: application/json: schema: $ref: '#/components/schemas/Error' '404': - description: Project not found + description: Frontend or Candidate not found, or the `frontends.candidates` capability is unavailable (code `feature_unavailable`) + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '409': + description: 'Conflict. `code: deployment_in_progress` - a deployment is already running; retry once it finishes. `code: candidate_not_deployable` - the Candidate is being deleted or is not ready to deploy to. `code: candidate_in_use` - the frontend serves it or keeps it for a rollback. `code: configuration_changed` - the frontend''s configuration changed during the deploy; retry. `code: frontend_deleting` or `code: project_deleting` - the frontend or project is being deleted.' + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '413': + description: The request body is larger than the archive limit, SOURCE_ARCHIVE_SIZE_LIMIT_MB + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: Too many requests - the project's build minutes for the billing cycle are used up content: application/json: schema: $ref: '#/components/schemas/Error' '500': - description: Layout could not be saved + description: Internal server error content: application/json: schema: $ref: '#/components/schemas/Error' - delete: + '503': + description: Service unavailable - frontend deployments are not configured + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /projects/{id}/frontends/{frontendId}/serving: + get: tags: - - Auth Configuration - summary: Clear one managed auth page layout - operationId: deleteAuthPageLayout + - Frontends + summary: Get what a frontend serves + description: | + Reports whether the frontend serves its own runtime or a promoted Candidate's, and the + revision a promotion or rollback must name. + operationId: getFrontendServing security: - UserToken: [] - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/FrontendId' responses: - '204': - description: Layout cleared + '200': + description: What the frontend serves + content: + application/json: + schema: + $ref: '#/components/schemas/FrontendServing' '400': - description: Invalid page type + description: Bad request - invalid identifier content: application/json: schema: $ref: '#/components/schemas/Error' '401': - description: Unauthorized + description: Unauthorized - invalid or missing token content: application/json: schema: $ref: '#/components/schemas/Error' '403': - description: Plan does not permit customisation + description: Forbidden - project ownership required content: application/json: schema: $ref: '#/components/schemas/Error' '404': - description: Project not found + description: Frontend not found content: application/json: schema: $ref: '#/components/schemas/Error' '500': - description: Layout could not be cleared + description: Internal server error content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/auth/pages/{pageType}/preview: - get: + /projects/{id}/frontends/{frontendId}/serving/rollback: + post: tags: - - Auth Configuration - summary: Render a short-lived managed auth page preview + - Frontends + summary: Roll a frontend back to the runtime it served before description: | - Public HTML endpoint for a preview URL returned by the POST operation. - The signed ticket contains the unsaved appearance, expires shortly, and - runs the production page runtime against mocked authentication responses. - operationId: renderAuthPagePreview - security: [] + Returns the frontend's traffic to the runtime it served before the last activation, or to its + own runtime with `to_production`. A rollback is a new activation, so what it leaves becomes the + runtime a further rollback returns to, and it can itself be undone. It names the revision the + caller read; a competing activation makes it fail with `409`. + + Rolling back to a Candidate promotes it again and is refused with `409` when promoting it would + be. Rolling back to the frontend's own runtime is not. + operationId: rollbackFrontendServing + security: + - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - - name: pageType - in: path - required: true - schema: - $ref: '#/components/schemas/HostedAuthPageType' - - name: ticket - in: query - required: true - schema: - type: string - minLength: 1 - maxLength: 4096 - description: Short-lived signed preview ticket returned by the POST operation. + - $ref: '#/components/parameters/FrontendId' + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - expected_revision + properties: + expected_revision: + type: integer + format: int64 + minimum: 0 + to_production: + type: boolean + default: false + description: Return to the frontend's own runtime whatever it served before. responses: '200': - description: Rendered preview document + description: The frontend serves the runtime it was rolled back to content: - text/html: + application/json: schema: - type: string + $ref: '#/components/schemas/FrontendServing' + '400': + description: Bad request - invalid identifier or body + 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 - project ownership required + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '404': - description: Ticket is invalid or expired, its path does not match, or managed authentication is disabled + description: Frontend not found, or `feature_unavailable` when the release gate is off and the rollback would make a candidate serve again content: - text/plain: + application/json: schema: - type: string + $ref: '#/components/schemas/Error' + '409': + description: 'Conflict. `code: stale_revision` - the revision is stale; read `serving` again. `code: nothing_to_roll_back` - there is no earlier runtime to return to. `code: rollback_unavailable` - the runtime to roll back to is gone. `code: configuration_changed` - the Candidate to roll back to was built with a different configuration. `code: deployment_in_progress` - a deployment of the Candidate or of the frontend itself is still running; retry once it finishes. `code: source_managed_by_git` - the project''s repository is the source of truth; roll back to the frontend''s own runtime.' + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '413': + description: The request body is larger than 4 KiB + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Preview could not be rendered + description: Internal server error content: - text/plain: + application/json: schema: - type: string + $ref: '#/components/schemas/Error' + /projects/{id}/frontends/{frontendId}/candidates/{candidateId}/promote: post: tags: - - Auth Configuration - summary: Preview an unsaved managed auth page appearance - operationId: previewAuthPage + - Frontends + summary: Promote a frontend Candidate + description: | + Makes the Candidate what the frontend serves. Nothing is rebuilt or copied: the frontend's + traffic is routed to the Candidate's runtime, its own custom domains and metering are + unchanged, and what it served becomes the runtime a rollback returns to. + + The Candidate must be ready and serving an active deployment, and that deployment must have + been built with the variables the frontend selects now. A Candidate that serves stops expiring and cannot be deleted. While one + serves, deploying the frontend itself answers `409`; roll back to the frontend's own runtime + first. Promotion names the revision the caller read from `serving`; a competing activation + makes it fail with `409`. Once the project's repository is the source of truth, promotion + is refused with `409`, as a direct deploy is, and so is rolling back to a Candidate; rolling + back to the frontend's own runtime is not. While the `frontends.candidates` capability is + unavailable, promotion and rolling back to a Candidate answer `404` with code + `feature_unavailable`; rolling back to the frontend's own runtime does not. + operationId: promoteFrontendCandidate security: - UserToken: [] - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - - name: pageType - in: path - required: true - schema: - $ref: '#/components/schemas/HostedAuthPageType' + - $ref: '#/components/parameters/FrontendId' + - $ref: '#/components/parameters/FrontendCandidateId' requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/PreviewAuthPageRequest' + type: object + additionalProperties: false + required: + - expected_revision + properties: + expected_revision: + type: integer + format: int64 + minimum: 0 responses: '200': - description: Short-lived URL for the rendered preview document + description: The frontend serves the Candidate content: application/json: schema: - $ref: '#/components/schemas/PreviewAuthPageResponse' + $ref: '#/components/schemas/FrontendServing' '400': - description: Invalid page type or draft + description: Bad request - invalid identifier or body content: application/json: schema: $ref: '#/components/schemas/Error' '401': - description: Unauthorized + description: Unauthorized - invalid or missing token content: application/json: schema: $ref: '#/components/schemas/Error' '403': - description: Access denied + description: Forbidden - project ownership required content: application/json: schema: $ref: '#/components/schemas/Error' '404': - description: Project not found or managed authentication is disabled + description: Frontend or Candidate not found, or the `frontends.candidates` capability is unavailable (code `feature_unavailable`) + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '409': + description: 'Conflict. `code: stale_revision` - the revision is stale; read `serving` again. `code: candidate_not_ready` - the Candidate is not ready. `code: configuration_changed` - it was built with a different configuration; redeploy it. `code: already_serving` - it already serves. `code: deployment_in_progress` - a deployment of the Candidate or of the frontend itself is still running; retry once it finishes. `code: source_managed_by_git` - the project''s repository is the source of truth. `code: frontend_not_deployed` - the frontend has no deployment of its own to roll back to; deploy it first.' + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '413': + description: The request body is larger than 4 KiB content: application/json: schema: $ref: '#/components/schemas/Error' '500': - description: Preview could not be rendered + description: Internal server error content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/auth/hosted/{pageType}: + /projects/{id}/frontends/{frontendId}/usage: get: tags: - - Auth Configuration - summary: Render a managed auth page + - Frontends + summary: Per-day request and error counts for a single frontend description: | - Public HTML endpoint for signup, forgot-password, device approval, - verify-email, and reset-password pages. Login uses the path without a - page type. - Requires `Accept: text/html`. - Returns 404 when managed hosted pages are disabled for the project. - security: [] - operationId: renderManagedAuthPage + Returns a zero-filled daily series of request counts and 5xx + error counts for one frontend, oldest first. Each entry is one + UTC day; missing days (no traffic recorded) come back as + `requests: 0, errors: 0` so the response always has exactly + `days` entries. + + Backs the Monitoring section on the frontend detail page in + the Volcano dashboard. `days` defaults to 30 and is capped at 90 to keep + the (frontend_id, day) index scan bounded. + operationId: getFrontendUsageHistory + security: + - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - - name: pageType - in: path - required: true + - $ref: '#/components/parameters/FrontendId' + - name: days + in: query + description: Number of trailing days to return (1–90, default 30). + required: false schema: - $ref: '#/components/schemas/HostedRenderablePageType' + type: integer + minimum: 1 + maximum: 90 + default: 30 responses: '200': - description: Hosted auth page HTML + description: Successful response content: - text/html: + application/json: schema: - type: string + $ref: '#/components/schemas/FrontendUsageHistoryResponse' '400': - description: Invalid project id or unsupported Accept header - '404': - description: Managed pages disabled or page type not found - /projects/{id}/auth/hosted: - get: - tags: - - Auth Configuration - summary: Render default managed auth page - description: | - Public HTML endpoint for the managed login page. - Requires `Accept: text/html`. - security: [] - operationId: renderDefaultManagedAuthPage - parameters: - - $ref: '#/components/parameters/ProjectId' - - name: action - in: query - required: false - schema: - type: string - enum: - - login - - signup - - forgot-password - - device - description: | - Optional deep-link action for the unified hosted page. Ignored when a - custom login page is configured. `action=device` renders the device - authorization approval UI inline (no redirect to any external app); - it signs the user in and calls `POST /auth/device/verify`. - - name: user_code - in: query - required: false - schema: - type: string - description: Device user code (from `POST /auth/device/authorize`) used with `action=device`. - - name: anon_key - in: query - required: false - schema: - type: string - description: Project anon key used by built-in managed auth flows (required for login/signup/device actions). - - name: state - in: query - required: false - schema: - type: string - description: | - Opaque one-time nonce generated by the client SDK before redirecting - here. On successful login/signup it is echoed back in the post-auth - redirect fragment as `state`, so the SDK can bind the returned session - to the flow it initiated (login-CSRF / session-fixation defense). The - SDK rejects a returned session whose `state` does not match. - responses: - '200': - description: Hosted auth page HTML + description: Bad request - invalid identifier content: - text/html: + application/json: schema: - type: string - '400': - description: Invalid project id or unsupported Accept header + $ref: '#/components/schemas/Error' + '401': + description: Unauthorized - invalid or missing token + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: Forbidden - project ownership required + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '404': - description: Managed pages disabled - /projects/{id}/auth/hosted/login/options: + description: Frontend not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: Internal server error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /projects/{id}/frontends/{frontendId}/function-routes: + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/FrontendId' get: tags: - - Auth Configuration - summary: Get hosted login runtime options - description: | - Returns runtime options for the built-in managed login flow. - Requires `anon_key` query parameter. - Rate limited per project and client IP. Excess requests return `429` and `Retry-After`. - security: [] - operationId: getHostedLoginOptions - parameters: - - $ref: '#/components/parameters/ProjectId' - - name: anon_key - in: query - required: true - schema: - type: string + - Frontends + summary: List a Frontend's Function routes + operationId: listFrontendFunctionRoutes + security: + - UserToken: [] + - ProjectAccessToken: [] responses: '200': - description: Hosted login options returned + description: Function routes ordered from most to least specific content: application/json: schema: - $ref: '#/components/schemas/HostedLoginOptionsResponse' + $ref: '#/components/schemas/FrontendFunctionRouteList' '401': - description: Invalid or missing anon key - '404': - description: Managed pages disabled - '429': - description: Rate limit exceeded - /projects/{id}/auth/hosted/login/check-email: + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: Project not owned by the caller + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: Failed to list Function routes + content: + application/json: + schema: + $ref: '#/components/schemas/Error' post: tags: - - Auth Configuration - summary: Check whether email exists for hosted login flow + - Frontends + summary: Route a Frontend path to an HTTP Function + operationId: createFrontendFunctionRoute description: | - Used by the built-in managed login page to branch UI between signin and signup. - Requires anon key in Authorization header. - Rate limited per project and client IP. Excess requests return `429` and `Retry-After`. - security: [] - operationId: hostedLoginCheckEmail - parameters: - - $ref: '#/components/parameters/ProjectId' - - name: Authorization - in: header - required: true - schema: - type: string - description: Bearer anon key (`Bearer `) + The Frontend and Function must belong to this Project. The Function must be a standard + Function with `visibility: public` and HTTP invocation mode, because requests through the + route carry no credential: Volcano does not check a token sent to a route path or add + `__volcano_auth`, so the Function authenticates its callers itself. A Function cannot leave `public` + while a route targets it. The route applies to every hostname that resolves to the + Frontend, including generated, custom-domain, preview, and local hostnames. + security: + - UserToken: [] + - ProjectAccessToken: [] requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/HostedLoginEmailCheckRequest' + $ref: '#/components/schemas/CreateFrontendFunctionRouteRequest' responses: - '200': - description: Email existence evaluated + '201': + description: Function route created content: application/json: schema: - $ref: '#/components/schemas/HostedLoginEmailCheckResponse' + $ref: '#/components/schemas/FrontendFunctionRoute' + '400': + description: Invalid path or non-HTTP Function + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '401': - description: Invalid or missing anon key - '429': - description: Rate limit exceeded - /projects/{id}/auth/methods: - get: + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: Project not owned by the caller + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Frontend or Function not found in the Project + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '409': + description: Path is already routed, the Frontend has reached its 64-route limit, or the Function is not public + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '413': + description: Request body exceeds 4,194,304 bytes, or its JSON has too many objects, arrays or values + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: Failed to create Function route + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /projects/{id}/frontends/{frontendId}/function-routes/{routeId}: + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/FrontendId' + - $ref: '#/components/parameters/FrontendFunctionRouteId' + put: tags: - - Auth Configuration - summary: Get all authentication methods - description: | - Returns all configured authentication methods for this project, - including email/password, anonymous, device authorization, and OAuth providers. - operationId: getAuthMethods + - Frontends + summary: Replace a Frontend Function route + description: 'Replaces the route''s target, path, and prefix handling. The new target must meet the same rules as on create, including `visibility: public`.' + operationId: updateFrontendFunctionRoute security: - UserToken: [] - ProjectAccessToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateFrontendFunctionRouteRequest' responses: '200': - description: Authentication methods configuration + description: Function route replaced content: application/json: schema: - type: object - properties: - email_password: - type: object - properties: - enabled: - type: boolean - method: - type: string - name: - type: string - anonymous: - type: object - properties: - enabled: - type: boolean - method: - type: string - name: - type: string - oauth_providers: - type: array - items: - type: object - properties: - enabled: - type: boolean - method: - type: string - provider: - type: string - name: - type: string - redirect_url: - type: string - scopes: - type: array - items: - type: string - available_methods: - type: array - items: - type: string - example: - - email_password - - oauth_google - - oauth_github - put: + $ref: '#/components/schemas/FrontendFunctionRoute' + '400': + description: Invalid path or non-HTTP Function + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: Project not owned by the caller + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Function route, Frontend, or Function not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '409': + description: Path is already routed, the Frontend has reached its 64-route limit, or the Function is not public + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '413': + description: Request body exceeds 4,194,304 bytes, or its JSON has too many objects, arrays or values + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: Failed to replace Function route + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + delete: tags: - - Auth Configuration - summary: Configure authentication methods (unified) - description: | - Configure all authentication methods in a single request. - At least one method must remain enabled. - operationId: configureAuthMethods + - Frontends + summary: Delete a Frontend Function route + operationId: deleteFrontendFunctionRoute security: - UserToken: [] - ProjectAccessToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' - requestBody: - content: - application/json: - schema: - type: object - properties: - enable_email_password: - type: boolean - enable_anonymous: - type: boolean - oauth_providers: - type: array - items: - type: object - properties: - provider: - type: string - enabled: - type: boolean responses: - '200': - description: Methods configured - '400': - description: At least one method must be enabled - /projects/{id}/oauth/configs: + '204': + description: Function route deleted + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: Project not owned by the caller + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Function route not found on the Frontend + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: Failed to delete Function route + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /projects/{id}/frontends/{frontendId}/frontend-routes: + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/FrontendId' get: tags: - - OAuth Configuration - summary: List OAuth configurations - description: List all OAuth provider configurations for this project - operationId: listOAuthConfigs + - Frontends + summary: List a Frontend's Frontend routes + operationId: listFrontendRoutes security: - UserToken: [] - ProjectAccessToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' responses: '200': - description: List of OAuth configurations + description: Frontend routes ordered from most to least specific content: application/json: schema: - type: object - properties: - configs: - type: array - items: - $ref: '#/components/schemas/OAuthConfig' + $ref: '#/components/schemas/FrontendRouteList' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: Project not owned by the caller + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: Failed to list Frontend routes + content: + application/json: + schema: + $ref: '#/components/schemas/Error' post: tags: - - OAuth Configuration - summary: Create OAuth configuration - description: Configure OAuth provider (Google, GitHub, Microsoft, Apple, Device) - operationId: createOAuthConfig + - Frontends + summary: Mount another Frontend at a path + operationId: createFrontendRoute + description: | + Serves `path_prefix` and everything under it on this Frontend's hostnames from another + Frontend in the same Project. The path is forwarded unchanged, so the mounted Frontend must + serve its pages under the prefix (page directories or a matching `basePath`). Its root + `/_next/static` files and `/_next/image` requests are sent to it too. A Frontend may be + mounted at several prefixes. Function and Frontend routes share one path namespace and the + 64-route limit; the most specific prefix wins. A mounted Frontend's own routes do not apply + to requests it receives through a route. The route applies to every hostname that resolves + to this Frontend, including generated, custom-domain, and local hostnames. While the mounted + Frontend has no active deployment, its paths answer 502, as its own hostname does. security: - UserToken: [] - ProjectAccessToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/CreateOAuthConfigRequest' + $ref: '#/components/schemas/CreateFrontendRouteRequest' responses: '201': - description: OAuth config created + description: Frontend route created content: application/json: schema: - $ref: '#/components/schemas/OAuthConfig' + $ref: '#/components/schemas/FrontendRoute' + '400': + description: Invalid path, or the Frontend would mount itself + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: Project not owned by the caller + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Frontend or mounted Frontend not found in the Project, or, with code `feature_unavailable`, Frontend routes are not available in this environment (see `GET /capabilities`) + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '409': - description: Provider already configured - /projects/{id}/oauth/configs/{provider}: - get: + description: Path is already routed, the Frontend has reached its 64-route limit, or this Frontend or the mounted Frontend is being deleted + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '413': + description: Request body exceeds 4,194,304 bytes, or its JSON has too many objects, arrays or values + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: Failed to create Frontend route + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /projects/{id}/frontends/{frontendId}/frontend-routes/{routeId}: + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/FrontendId' + - $ref: '#/components/parameters/FrontendRouteId' + put: tags: - - OAuth Configuration - summary: Get OAuth configuration - operationId: getOAuthConfig + - Frontends + summary: Replace a Frontend route + description: Replaces the route's mounted Frontend and path. The new values must meet the same rules as on create. + operationId: updateFrontendRoute security: - UserToken: [] - ProjectAccessToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' - - name: provider - in: path - required: true - schema: - type: string - enum: - - google - - github - - microsoft - - apple - - device - - name: client_id - in: query - required: false - schema: - type: string - description: Required when `provider=device` to select a specific device client. + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateFrontendRouteRequest' responses: '200': - description: OAuth configuration + description: Frontend route replaced content: application/json: schema: - $ref: '#/components/schemas/OAuthConfig' - put: - tags: - - OAuth Configuration - summary: Update OAuth configuration - operationId: updateOAuthConfig - security: - - UserToken: [] - - ProjectAccessToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' - - name: provider - in: path - required: true - schema: - type: string - enum: - - google - - github - - microsoft - - apple - - device - - name: client_id - in: query - required: false - schema: - type: string - description: Required when `provider=device` to select a specific device client. - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateOAuthConfigRequest' - responses: - '200': - description: OAuth config updated + $ref: '#/components/schemas/FrontendRoute' + '400': + description: Invalid path, or the Frontend would mount itself content: application/json: schema: - $ref: '#/components/schemas/OAuthConfig' + $ref: '#/components/schemas/Error' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: Project not owned by the caller + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Frontend route, Frontend, or mounted Frontend not found, or, with code `feature_unavailable`, Frontend routes are not available in this environment (see `GET /capabilities`) + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '409': + description: Path is already routed, or this Frontend or the mounted Frontend is being deleted + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '413': + description: Request body exceeds 4,194,304 bytes, or its JSON has too many objects, arrays or values + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: Failed to replace Frontend route + content: + application/json: + schema: + $ref: '#/components/schemas/Error' delete: tags: - - OAuth Configuration - summary: Delete OAuth configuration - operationId: deleteOAuthConfig + - Frontends + summary: Delete a Frontend route + operationId: deleteFrontendRoute security: - UserToken: [] - ProjectAccessToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' - - name: provider - in: path - required: true - schema: - type: string - enum: - - google - - github - - microsoft - - apple - - device - - name: client_id - in: query - required: false - schema: - type: string - description: Required when `provider=device` to select a specific device client. responses: '204': - description: OAuth config deleted - /projects/{id}/oauth/providers: + description: Frontend route deleted + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: Project not owned by the caller + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Frontend route not found on the Frontend + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: Failed to delete Frontend route + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /projects/{id}/variable-environments: get: tags: - - OAuth Configuration - summary: List available OAuth providers - description: Get list of supported OAuth providers and their default scopes - operationId: listAvailableOAuthProviders + - Variable Environments + summary: List variable Environments + operationId: listVariableEnvironments security: - UserToken: [] - ProjectAccessToken: [] @@ -13667,2946 +14232,2629 @@ paths: - $ref: '#/components/parameters/ProjectId' responses: '200': - description: Available providers + description: Variable Environments, with Global first and custom Environments ordered by name content: application/json: schema: - type: object - properties: - providers: - type: array - items: - type: object - properties: - id: - type: string - name: - type: string - default_scopes: - type: array - items: - type: string - /auth/oauth/{provider}/authorize: - get: - tags: - - OAuth Authentication - summary: Start OAuth authorization - description: | - Redirects user to OAuth provider for authorization. - Handles CSRF protection with state parameter. - Project is identified via the anon_key query parameter. - operationId: authOAuthAuthorize - parameters: - - name: provider - in: path - required: true - schema: - type: string - enum: - - google - - github - - microsoft - - apple - - name: anon_key - in: query - required: true - schema: - type: string - description: Project anon key (required - identifies the project) - - name: redirect_url - in: query - schema: - type: string - description: | - URL to redirect to after the OAuth flow (optional). Must exactly - match an entry in the project's `allowed_redirect_urls`, including - its query string, or be the project's own managed hosted-auth page - URL. - - name: client_state - in: query - schema: - type: string - maxLength: 255 - description: | - Optional application nonce. It is stored with the server-generated - provider state and echoed to redirect_url as `state`. - - name: response_mode - in: query - schema: - type: string - enum: - - code - description: | - Set to `code` to receive a short-lived authorization code at - redirect_url, then use POST /auth/oauth/exchange to obtain the - session. `redirect_url` is required in this mode. When omitted, the - established session-fragment response is retained for compatibility - with existing clients. - responses: - '307': - description: Redirect to OAuth provider - '400': - description: | - OAuth provider is disabled for this project, or `redirect_url` is - not registered in `allowed_redirect_urls` - '404': - description: OAuth provider not configured - /auth/oauth/{provider}/callback: - get: - tags: - - OAuth Authentication - summary: OAuth callback handler - description: | - Handles OAuth provider callback with authorization code. - Exchanges code for tokens and creates/signs in user. - operationId: authOAuthCallback - parameters: - - name: provider - in: path - required: true - schema: - type: string - enum: - - google - - github - - microsoft - - apple - - name: code - in: query - required: true - schema: - type: string - - name: state - in: query - required: true - schema: - type: string - - name: error - in: query - schema: - type: string - responses: - '200': - description: Existing user signed in (when redirect_url was omitted) + $ref: '#/components/schemas/VariableEnvironmentList' + '401': + description: Unauthorized content: application/json: schema: - $ref: '#/components/schemas/AuthTokenResponse' - '201': - description: New user created and signed in (when redirect_url was omitted) + $ref: '#/components/schemas/Error' + '403': + description: Project not owned by the caller content: application/json: schema: - $ref: '#/components/schemas/AuthTokenResponse' - '303': - description: | - Redirect to the exact registered redirect_url. Flows that requested - response_mode=code receive a short-lived, single-use `code` and - optional application `state`; compatibility flows receive the - established session fragment. - '400': - description: | - Missing/invalid code or state, the state parameter expired, or the - flow's stored redirect_url is no longer registered in - allowed_redirect_urls (re-checked at callback time) - '403': - description: | - The provider's email domain is not in `allowed_email_domains`. Creating - an account is refused under `signup` and `signup_and_signin`; signing in - an already-linked account is refused under `signup_and_signin`. - '409': - description: Email already exists (requires linking) - /auth/oauth/exchange: + $ref: '#/components/schemas/Error' + '500': + description: Failed to list variable Environments + content: + application/json: + schema: + $ref: '#/components/schemas/Error' post: tags: - - OAuth Authentication - summary: Exchange OAuth authorization code - description: | - Atomically consumes a short-lived callback code and returns the user's - session. The request must use the same project anon key and exact - redirect_url that initiated the flow. - operationId: authOAuthExchange + - Variable Environments + summary: Create a variable Environment + operationId: createVariableEnvironment + description: Creates a custom variable Environment. Global is reserved and already exists. A Project may have at most 100 custom Environments. security: - - AnonKey: [] + - UserToken: [] + - ProjectAccessToken: [] parameters: - - $ref: '#/components/parameters/AuthProxyAuthorization' - - $ref: '#/components/parameters/AuthProxyClientIP' + - $ref: '#/components/parameters/ProjectId' requestBody: required: true content: application/json: schema: - type: object - required: - - code - - redirect_url - properties: - code: - type: string - redirect_url: - type: string - format: uri + $ref: '#/components/schemas/CreateVariableEnvironmentRequest' responses: - '200': - description: Authorization code consumed and session created + '201': + description: Variable Environment created content: application/json: schema: - $ref: '#/components/schemas/AuthTokenResponse' + $ref: '#/components/schemas/VariableEnvironment' '400': - description: Invalid, expired, consumed, or redirect-mismatched code + description: | + Invalid name, or the reserved Global name. Schema-invalid names + return the generic invalid-request error; a reserved name returns + `invalid_variable_environment`. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '401': - description: Missing or invalid project anon key; or invalid auth proxy metadata + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '403': + description: Project not owned by the caller + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Project no longer exists + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '409': description: | - Email confirmation is now required, or the account's email domain is not - in `allowed_email_domains` while `allowed_email_domains_mode` is - `signup_and_signin`. Both are re-checked here because the code outlives - the callback that issued it. - '429': - description: Too many exchange attempts from this client - /auth/device/authorize: - post: - tags: - - OAuth Authentication - summary: Start RFC8628 device authorization - description: | - Starts OAuth 2.0 Device Authorization Grant (RFC 8628). - Returns `device_code` for the CLI and `user_code` for browser verification. - - By default the returned `verification_uri` / `verification_uri_complete` - point at the project's managed device-approval page served by this API - (`/projects/{projectId}/auth/hosted?action=device&user_code=...&anon_key=...`), - which requires managed auth enabled and a default anon key for the - project. - - Projects can override this by setting `device_verification_url` on the - auth config (`PATCH /auth/config`). When set, that URL is returned as-is - with the `user_code` appended (no `action=device` hint and no embedded - anon key — the page brings its own), so a CLI's `login` command surfaces - the project's own RFC 8628 approval page. With a custom URL, device login - does **not** require managed auth to be enabled; the custom page's origin - must be in the project's auth CORS allowlist to call - `POST /auth/device/verify`. Either way the verification page must - authenticate the end user and call `POST /auth/device/verify` with the - `user_code`. See the device-auth guide for both approaches. - operationId: authDeviceAuthorize - requestBody: - required: true - content: - application/json: - schema: - type: object - required: - - client_id - properties: - client_id: - type: string - description: Enabled `device` OAuth client ID for the target project - responses: - '200': - description: Device authorization started + A case-insensitive name conflict or the 100-custom-Environment + limit has been reached, or the Project is being deleted. Tell them + apart with `code`, which is `variable_environment_conflict`, + `variable_environment_limit_reached`, or `project_deleting`. content: application/json: schema: - $ref: '#/components/schemas/DeviceAuthorizationResponse' - '400': - description: Invalid request or unauthorized client + $ref: '#/components/schemas/Error' + '500': + description: Failed to create the variable Environment content: application/json: schema: - $ref: '#/components/schemas/OAuthErrorResponse' - /auth/device/token: - post: + $ref: '#/components/schemas/Error' + /projects/{id}/variable-environments/{environmentId}: + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/VariableEnvironmentId' + get: tags: - - OAuth Authentication - summary: Poll device token endpoint - description: | - RFC8628 token polling endpoint. - Returns OAuth errors such as `authorization_pending`, `slow_down`, `access_denied`, and `expired_token`. - operationId: authDeviceToken - requestBody: - required: true - content: - application/json: - schema: - type: object - required: - - grant_type - - device_code - - client_id - properties: - grant_type: - type: string - enum: - - urn:ietf:params:oauth:grant-type:device_code - device_code: - type: string - client_id: - type: string + - Variable Environments + summary: Get a variable Environment + operationId: getVariableEnvironment + security: + - UserToken: [] + - ProjectAccessToken: [] responses: '200': - description: Device flow completed, auth-user session minted + description: Variable Environment details content: application/json: schema: - $ref: '#/components/schemas/AuthTokenResponse' - '400': - description: Polling state/error response + $ref: '#/components/schemas/VariableEnvironment' + '401': + description: Unauthorized content: application/json: schema: - $ref: '#/components/schemas/OAuthErrorResponse' + $ref: '#/components/schemas/Error' '403': - description: | - `access_denied` - the approving account's email domain is not in - `allowed_email_domains` while `allowed_email_domains_mode` is - `signup_and_signin`. Re-checked here because approval and redemption - are separate requests. + description: Project not owned by the caller content: application/json: schema: - $ref: '#/components/schemas/OAuthErrorResponse' - /auth/device/verify: - post: + $ref: '#/components/schemas/Error' + '404': + description: Variable Environment not found in this Project + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: Failed to get the variable Environment + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + patch: tags: - - OAuth Authentication - summary: Approve or deny a device code - description: | - Browser-side endpoint for authenticated auth-users to approve (`approve`) or deny (`deny`) a `user_code`. - - Called by the verification page after the end user signs in. The grant is - scoped to the project the auth-user token belongs to: approving a - `user_code` issued for a different project returns `403`. This endpoint - does not require managed auth to be enabled, so a custom verification page - (hosted anywhere) can drive approval — it just needs an authenticated - project auth-user access token and, for cross-origin browser calls, the - page origin allowed in the project's auth CORS settings. - operationId: authDeviceVerify + - Variable Environments + summary: Rename a variable Environment + operationId: renameVariableEnvironment + description: Renames a custom Environment without changing its stable ID. Global cannot be renamed. security: - - AuthUserAccessToken: [] + - UserToken: [] + - ProjectAccessToken: [] requestBody: required: true content: application/json: schema: - type: object - required: - - user_code - properties: - user_code: - type: string - action: - type: string - enum: - - approve - - deny - default: approve + $ref: '#/components/schemas/RenameVariableEnvironmentRequest' responses: '200': - description: Verification action accepted + description: Variable Environment renamed content: application/json: schema: - type: object - properties: - success: - type: boolean - status: - type: string + $ref: '#/components/schemas/VariableEnvironment' + '400': + description: | + Invalid name, or the reserved Global name. Schema-invalid names + return the generic invalid-request error; a reserved name returns + `invalid_variable_environment`. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '401': - description: Not authenticated + description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/Error' - /auth/platform/exchange: - post: - tags: - - OAuth Authentication - summary: Exchange auth-user device session for platform token - description: | - Exchanges a verified auth-user device-flow session into a platform token for CLI usage. - The target platform user is derived from authenticated auth-user mapping; client cannot select another user. - operationId: authPlatformExchange - security: - - AuthUserAccessToken: [] - requestBody: - required: true - content: - application/json: - schema: - type: object - required: - - client_id - properties: - client_id: - type: string - responses: - '200': - description: Platform token minted + '403': + description: Project not owned by the caller content: application/json: schema: - $ref: '#/components/schemas/PlatformExchangeResponse' - '403': - description: | - Exchange not allowed for this session/client/project, or the - account's email domain is not in `allowed_email_domains` while - `allowed_email_domains_mode` is `signup_and_signin`. The domain is - re-checked here because the minted platform token outlives the - session it is exchanged from. + $ref: '#/components/schemas/Error' + '404': + description: Variable Environment not found in this Project content: application/json: schema: $ref: '#/components/schemas/Error' - /auth/oauth/providers: - get: - tags: - - OAuth Authentication - summary: List user's linked providers - description: Get list of OAuth providers linked to current user - operationId: authListOAuthProviders - security: - - AuthUserAccessToken: [] - responses: - '200': - description: Linked providers + '409': + description: | + A case-insensitive name conflict, an attempt to rename Global, or + a Project being deleted. Tell them apart with `code`, which is + `variable_environment_conflict`, + `variable_environment_immutable`, or `project_deleting`. content: application/json: schema: - type: object - properties: - providers: - type: array - items: - type: object - properties: - provider: - type: string - linked_at: - type: string - format: date-time - updated_at: - type: string - format: date-time - '401': - description: Not authenticated + $ref: '#/components/schemas/Error' + '500': + description: Failed to rename the variable Environment content: application/json: schema: $ref: '#/components/schemas/Error' - /auth/oauth/{provider}/link: - post: + delete: tags: - - OAuth Authentication - summary: Link OAuth provider to current user - description: | - Generates authorization URL to link OAuth provider to existing account. - User must be authenticated. - operationId: authLinkOAuthProvider + - Variable Environments + summary: Delete a variable Environment + operationId: deleteVariableEnvironment + description: Deletes a custom Environment. Global cannot be deleted. security: - - AuthUserAccessToken: [] - parameters: - - name: provider - in: path - required: true - schema: - type: string - enum: - - google - - github - - microsoft - - apple - - name: redirect_url - in: query - schema: - type: string - description: | - URL to redirect to after linking completes (optional). Same - allowed_redirect_urls requirement as GET /auth/oauth/{provider}/authorize. - - name: client_state - in: query - schema: - type: string - maxLength: 255 - description: | - Optional application nonce echoed to redirect_url as `state`. - - name: response_mode - in: query - schema: - type: string - enum: - - code - description: | - Set to `code` to receive a short-lived authorization code at - redirect_url. `redirect_url` is required in this mode. When - omitted, the established session-fragment response is retained for - compatibility with existing clients. + - UserToken: [] + - ProjectAccessToken: [] responses: - '200': - description: Authorization URL generated + '204': + description: Variable Environment deleted + '401': + description: Unauthorized content: application/json: schema: - type: object - properties: - authorization_url: - type: string - '400': - description: redirect_url is not registered in allowed_redirect_urls + $ref: '#/components/schemas/Error' + '403': + description: Project not owned by the caller content: application/json: schema: $ref: '#/components/schemas/Error' - '401': - description: Not authenticated + '404': + description: Variable Environment not found in this Project content: application/json: schema: $ref: '#/components/schemas/Error' - '404': - description: OAuth provider not configured + '409': + description: | + Global is protected, or the Project is being deleted. Tell them + apart with `code`, which is `variable_environment_immutable` or + `project_deleting`. content: application/json: schema: $ref: '#/components/schemas/Error' - '409': - description: Provider already linked + '500': + description: Failed to delete the variable Environment content: application/json: schema: $ref: '#/components/schemas/Error' - /auth/oauth/{provider}/unlink: - delete: + /projects/{id}/variables: + get: tags: - - OAuth Authentication - summary: Unlink OAuth provider + - Variables + summary: List all variables for a project description: | - Remove OAuth provider from user's account. - Cannot unlink if it's the only authentication method. - operationId: authUnlinkOAuthProvider + Returns project-level environment variables used by deployed functions and frontends. + operationId: listVariables security: - - AuthUserAccessToken: [] + - UserToken: [] + - ProjectAccessToken: [] parameters: - - name: provider - in: path - required: true - schema: - type: string - enum: - - google - - github - - microsoft - - apple + - $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: - '204': - description: Provider unlinked - '400': - description: Cannot unlink last authentication method - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '401': - description: Not authenticated + '200': + description: Successful response content: application/json: schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/schemas/PaginatedVariables' '404': - description: Provider not linked + description: Project not found content: application/json: schema: $ref: '#/components/schemas/Error' - /auth/oauth/{provider}/refresh-token: post: tags: - - OAuth Authentication - summary: Refresh OAuth provider token + - Variables + summary: Create or update a variable description: | - Refresh the access token for an OAuth provider using its refresh token. - Allows calling provider APIs on user's behalf (e.g., Google Drive, GitHub repos). - operationId: refreshOAuthProviderToken + Creates a project-level environment variable and triggers asynchronous propagation + to deployed functions and frontends in the project's configured regions. + operationId: createVariable security: - - AuthUserAccessToken: [] + - UserToken: [] + - ProjectAccessToken: [] parameters: - - name: provider - in: path - required: true - schema: - type: string - enum: - - google - - github - - microsoft - - apple + - $ref: '#/components/parameters/ProjectId' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateVariableRequest' responses: - '200': - description: Token refreshed successfully + '201': + description: Variable created content: application/json: schema: - type: object - properties: - message: - type: string - provider: - type: string - expires_in: - type: integer + $ref: '#/components/schemas/Variable' '400': - description: No refresh token available or refresh failed + description: Bad request content: application/json: schema: $ref: '#/components/schemas/Error' - '401': - description: Not authenticated + '409': + description: '`code: function_served_by_candidate` - a promoted preview serves a function whose environment this write changes; the preview keeps the variables it was built with and the write would reach only the function''s own build, so roll the function back to its own build, or deploy it, first.' content: application/json: schema: $ref: '#/components/schemas/Error' - '404': - description: Provider not linked + '503': + description: Private variable membership writes are disabled during rollout content: application/json: schema: $ref: '#/components/schemas/Error' - /auth/oauth/{provider}/token: + /projects/{id}/databases: get: tags: - - OAuth Authentication - summary: Get current provider access token + - Databases + summary: List all databases for a project description: | - Get valid access token for OAuth provider. - Automatically refreshes if expired. - operationId: getOAuthProviderToken + Supports two mutually exclusive pagination modes. Offset mode uses `page` + and `limit`. Cursor mode uses `cursor` and `limit`, supports `search` + (case-insensitive name match), and returns `next_cursor`/`prev_cursor`. + The optional `status` filter applies in both modes and is bound to the + cursor. Sending both `page` and `cursor` (or `page` and `search`) returns 400. + operationId: listDatabases security: - - AuthUserAccessToken: [] + - UserToken: [] + - ProjectAccessToken: [] parameters: - - name: provider - in: path - required: true + - $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: status + in: query + required: false schema: type: string enum: - - google - - github - - microsoft - - apple + - provisioning + - active + - restoring + - failed + - deleting + description: Return only the databases in this status. responses: '200': - description: Current access token - content: - application/json: - schema: - type: object - properties: - message: - type: string - provider: - type: string - expires_in: - type: integer - '401': - description: Not authenticated - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '404': - description: Provider not linked + description: Successful response content: application/json: schema: - $ref: '#/components/schemas/Error' - /auth/oauth/{provider}/call-api: + $ref: '#/components/schemas/PaginatedDatabases' post: tags: - - OAuth Authentication - summary: Call OAuth provider API + - Databases + summary: Create a new PostgreSQL database description: | - Make an authenticated request to an OAuth provider's API on behalf of the user. - The user's stored access token is automatically used and refreshed if needed. - - The request is always sent to the provider's fixed API base URL joined with - the caller-supplied `endpoint`. `endpoint` must be a relative path beginning - with `/` (optionally with a query string); it cannot change the target host. - Absolute URLs, protocol-relative `//host` values, or userinfo (`@host`) are - rejected with `400` so the request can never be redirected to another host. - - Examples of `endpoint`: - - Google userinfo: `/oauth2/v1/userinfo` - - GitHub repositories: `/user/repos` - - Microsoft Graph profile: `/me` - - The response wraps the provider's raw JSON value with request metadata. - An empty provider body is represented as `data: null`; the envelope - preserves the provider's HTTP status in `status_code`, including errors. - Provider response bodies are limited to 8 MiB after decompression. - Transport failures, invalid JSON (including invalid UTF-8), and oversized - bodies return `502`. Provider redirects to another origin are blocked and - return `400`. - operationId: callOAuthProviderAPI + Creates a PostgreSQL database in the project. + Each project can hold 1 database on HOBBY and up to 10,000 on SUPERAGENT. + Requests over the plan's cap return 403. + operationId: createDatabase security: - - AuthUserAccessToken: [] + - UserToken: [] + - ProjectAccessToken: [] parameters: - - name: provider - in: path - required: true - schema: - type: string - enum: - - google - - github - - microsoft - - apple + - $ref: '#/components/parameters/ProjectId' requestBody: required: true content: application/json: schema: - type: object - required: - - endpoint - properties: - endpoint: - type: string - description: | - Relative path on the provider's API, beginning with `/`. It is - joined with the provider's fixed base URL; it must not contain a - scheme, host, userinfo, or a leading `//`. - example: /user/repos - method: - type: string - enum: - - GET - - POST - default: GET - description: HTTP method to use - body: - type: object - additionalProperties: true - description: Request body for POST requests + $ref: '#/components/schemas/CreateDatabaseRequest' responses: - '200': - description: Provider API response + '201': + description: Database created (provisioning) content: application/json: schema: - type: object - description: OAuth provider API response envelope - required: - - provider - - endpoint - - status_code - - data - properties: - provider: - type: string - enum: - - google - - github - - microsoft - - apple - endpoint: - type: string - status_code: - type: integer - minimum: 100 - maximum: 599 - data: - description: Raw provider JSON value, or null when the provider returns no body - nullable: true - '400': - description: | - Invalid request (for example: missing `endpoint`, an `endpoint` that is - not a relative path, or an unsupported HTTP method), or a provider - redirect to another origin. + $ref: '#/components/schemas/Database' + '403': + description: Database limit exceeded for the project content: application/json: schema: $ref: '#/components/schemas/Error' - '401': - description: Not authenticated + /projects/{id}/databases/{databaseName}: + get: + tags: + - Databases + summary: Get database details + operationId: getDatabase + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/DatabaseName' + responses: + '200': + description: Successful response content: application/json: schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/schemas/Database' + delete: + tags: + - Databases + summary: Delete a database + description: | + Deletes a database and the instance backing it. When the instance is + removed synchronously the database row is deleted and the response is + `204`. If the instance cannot be deleted right away, the database row + is retained (status `deleting`) and its teardown is handed to the + background reconciler, which retries the deletion and removes the row + once the instance is gone; in that case the response is `202`. The database row is + never dropped while its instance still exists, so an instance is + never orphaned without a record to retry from. + operationId: deleteDatabase + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/DatabaseName' + responses: + '202': + description: | + Deletion accepted and in progress. The backing instance could not be + removed synchronously, so the database is marked `deleting` and torn + down asynchronously by the reconciler. + content: + application/json: + schema: + type: object + properties: + status: + type: string + example: deleting + message: + type: string + example: database deletion in progress + '204': + description: Database deleted (backing instance removed synchronously) '404': - description: OAuth provider configuration not found + description: Project or database not found content: application/json: schema: $ref: '#/components/schemas/Error' - '500': - description: Failed to create the provider API request + '409': + description: | + A restore is running on the database. Deleting it while a worker is + replacing its data would race that worker, so wait for the restore + to finish. content: application/json: schema: $ref: '#/components/schemas/Error' - '502': - description: Provider transport failure, invalid JSON, or response body larger than 8 MiB + '503': + description: | + Volcano could not check whether a restore is running, and will not + delete a database that might be mid-restore. Retry. content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/anon-keys: + /projects/{id}/databases/{databaseName}/branches: get: tags: - - Anon Keys - summary: List anon keys + - Database Branches + summary: List a database's branches description: | - Supports two mutually exclusive pagination modes. Offset mode uses `page` - and `limit` and is the default when neither `cursor` nor `search` is - supplied (first page, default `limit`). Cursor mode uses `cursor` and - `limit`, supports `search` (case-insensitive name match), and returns - `next_cursor`. Sending both `page` and `cursor` (or `page` and `search`) - returns 400. - operationId: listAnonKeys - 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' + Returns every branch of the database, including those still provisioning + and those that failed, since each still holds a name. + + Connection strings are omitted. Fetch a single branch to get its + connection string. + operationId: listDatabaseBranches + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/DatabaseName' responses: '200': - description: List of anon keys + description: Successful response content: application/json: schema: - type: object - properties: - data: - type: array - items: - $ref: '#/components/schemas/AnonKey' - total: - type: integer - description: Total number of items matching the query (so the UI can render numbered pages). - has_more: - type: boolean - description: Whether a next page exists. - next_cursor: - type: string - description: Opaque cursor for the next page (cursor pagination only) - prev_cursor: - type: string - description: Opaque cursor for the previous page (cursor pagination only). Send as `ending_before`. + $ref: '#/components/schemas/DatabaseBranchList' + '404': + description: Project or database not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '503': + description: Branching is temporarily unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Error' post: tags: - - Anon Keys - summary: Create anon key - operationId: createAnonKey + - Database Branches + summary: Create a branch of a database + description: | + Forks the database into a new branch. The branch starts as an exact copy + of the parent's data and diverges from there. + + Provisioning is asynchronous: the response is `202` with the branch in + `provisioning` and no connection string. Poll the branch until it reports + `active`, at which point it carries its own connection string. + + Retrying a create with a name that already exists returns `409` rather + than a second branch, so a retried request cannot silently consume two + slots of the branch allowance. + operationId: createDatabaseBranch security: - UserToken: [] - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/DatabaseName' requestBody: required: true content: application/json: schema: - type: object - required: - - name - properties: - name: - type: string - description: | - Key name for identification. - Can only contain letters, numbers, underscores, and hyphens. - pattern: ^[A-Za-z0-9_-]+$ - minLength: 1 - maxLength: 255 - example: frontend-app - permissions: - type: array - items: - type: string - enum: - - auth.signup - - auth.signin - - auth.refresh - - auth.logout - - auth.password_reset - - auth.confirm_email - - auth.resend_confirmation - - storage.upload - - storage.download - - storage.list - - storage.delete - - realtime.connect - - realtime.subscribe - - realtime.publish - - functions.invoke - description: | - Optional list of permissions for this key. - If not provided, defaults to auth-only permissions: auth.signup, auth.signin, auth.refresh, auth.logout, auth.password_reset, auth.confirm_email, auth.resend_confirmation. - Storage, realtime, and functions permissions must be explicitly added if needed. - example: - - auth.signup - - auth.signin - - auth.refresh - - auth.logout + $ref: '#/components/schemas/CreateDatabaseBranchRequest' responses: - '201': - description: Anon key created + '202': + description: Branch accepted and provisioning content: application/json: schema: - $ref: '#/components/schemas/AnonKey' - /projects/{id}/anon-keys/{keyId}: - get: - tags: - - Anon Keys - summary: Get anon key - description: Get details of a specific anon key - operationId: getAnonKey - security: - - UserToken: [] - - ProjectAccessToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' - - name: keyId - in: path - required: true - schema: - type: string - format: uuid - responses: - '200': - description: Anon key details + $ref: '#/components/schemas/DatabaseBranch' + '400': + description: Invalid branch name or lifetime content: application/json: schema: - $ref: '#/components/schemas/AnonKey' - '404': - description: Key not found - delete: - tags: - - Anon Keys - summary: Revoke anon key - description: Revokes key - it will immediately stop working - operationId: revokeAnonKey - security: - - UserToken: [] - - ProjectAccessToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' - - name: keyId - in: path - required: true - schema: - type: string - format: uuid - responses: - '204': - description: Key revoked - '401': - description: Unauthorized + $ref: '#/components/schemas/Error' '403': - description: Forbidden + description: | + The database has reached its branch allowance, or the owner's plan + does not include branching. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '404': - description: Key not found - '409': - description: Cannot delete the project's default anon key + description: Project or database not found content: application/json: schema: $ref: '#/components/schemas/Error' - '500': - description: Internal server error + '409': + description: | + A branch of that name already exists on this database, or the + database cannot be branched right now because it is still + provisioning, being restored, failed, or being deleted. content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/anon-keys/{keyId}/regenerate: - post: - tags: - - Anon Keys - summary: Regenerate anon key - description: Generate new JWT value for existing key - operationId: regenerateAnonKey - security: - - UserToken: [] - - ProjectAccessToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' - - name: keyId - in: path - required: true - schema: - type: string - format: uuid - responses: - '200': - description: Key regenerated + '503': + description: Branching is temporarily unavailable content: application/json: schema: - $ref: '#/components/schemas/AnonKey' - /projects/{id}/anon-keys/{keyId}/set-default: - post: + $ref: '#/components/schemas/Error' + /projects/{id}/databases/{databaseName}/branches/{branchName}: + get: tags: - - Anon Keys - summary: Set default anon key - description: Promotes the given key to the project's configured default. At most one key per project can be default. - operationId: setDefaultAnonKey + - Database Branches + summary: Get a branch + description: | + Returns the branch, including its connection string once it is `active`. + Poll this after creating a branch to learn when it is connectable. + operationId: getDatabaseBranch security: - UserToken: [] - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - - name: keyId - in: path - required: true - schema: - type: string - format: uuid + - $ref: '#/components/parameters/DatabaseName' + - $ref: '#/components/parameters/BranchName' responses: '200': - description: Key set as default + description: Successful response content: application/json: schema: - $ref: '#/components/schemas/AnonKey' - '401': - description: Unauthorized - '403': - description: Forbidden + $ref: '#/components/schemas/DatabaseBranch' '404': - description: Anon key not found - '500': - description: Internal server error + description: Project, database, or branch not found content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/access-tokens: - get: + '503': + description: Branching is temporarily unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + patch: tags: - - Project Access Tokens - summary: List a project's access tokens + - Database Branches + summary: Extend a branch's lifetime description: | - 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. - operationId: listProjectAccessTokens + Replaces the branch's lifetime and restarts the countdown from now, so a + branch you are still working on is not swept mid-session. The new + duration is remembered, so a later reset re-arms the same lifetime. + operationId: updateDatabaseBranch security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/Page' - - $ref: '#/components/parameters/Limit' - - $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 + - $ref: '#/components/parameters/DatabaseName' + - $ref: '#/components/parameters/BranchName' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateDatabaseBranchRequest' responses: '200': - description: Successful response + description: Lifetime updated content: application/json: schema: - $ref: '#/components/schemas/PaginatedProjectAccessTokens' - '401': - description: Unauthorized - invalid or missing token + $ref: '#/components/schemas/DatabaseBranch' + '400': + description: Requested lifetime is outside the allowed range content: application/json: schema: $ref: '#/components/schemas/Error' - '403': - description: Forbidden - not the project owner, or a project access token was used + '404': + description: Project, database, or branch not found content: application/json: schema: $ref: '#/components/schemas/Error' - '404': - description: Project not found + '409': + description: The branch is being deleted content: application/json: schema: $ref: '#/components/schemas/Error' - post: + '503': + description: Branching is temporarily unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + delete: tags: - - Project Access Tokens - summary: Create a project access token + - Database Branches + summary: Delete a branch description: | - 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. + Marks the branch for teardown and returns immediately. The branch stops + accepting connections at once; its fork and its row are removed by a + background job, so a provider outage cannot leave the call hanging or the + branch half-deleted. - Requires a platform token. - operationId: createProjectAccessToken + Deleting a branch that is still provisioning is allowed and stops the + build, and repeating the call while teardown is in progress is accepted + again. Once the branch is gone the call returns `404`. + operationId: deleteDatabaseBranch security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/CreateProjectAccessTokenRequest' + - $ref: '#/components/parameters/DatabaseName' + - $ref: '#/components/parameters/BranchName' responses: - '201': - description: Token created - save the secret now, it cannot be retrieved again + '202': + description: Deletion accepted and in progress content: application/json: schema: - $ref: '#/components/schemas/CreatedProjectAccessToken' - '400': - description: Bad request - invalid name, scope, or expiry + type: object + properties: + status: + type: string + example: deleting + message: + type: string + example: branch deletion in progress + required: + - status + - message + '404': + description: Project, database, or branch not found content: application/json: schema: $ref: '#/components/schemas/Error' - '401': - description: Unauthorized - invalid or missing token + '503': + description: Branching is temporarily unavailable content: application/json: schema: $ref: '#/components/schemas/Error' - '403': - description: Forbidden - not the project owner, or a project access token was used + /projects/{id}/databases/{databaseName}/branches/{branchName}/reset: + post: + tags: + - Database Branches + summary: Reset a branch to its parent's current state + description: | + Discards everything written on the branch and re-forks it from the + parent as it is now. + + Returns immediately with the branch in `provisioning`. The rewind runs in + the background; poll the branch until it reports `active` before + connecting again. + + The branch keeps its name and its connection string, so anything holding + that string keeps working once it is active again, and its lifetime is + re-armed to the duration it was created with. The branch does not serve + connections for the duration of the reset. + operationId: resetDatabaseBranch + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/DatabaseName' + - $ref: '#/components/parameters/BranchName' + responses: + '202': + description: Branch reset accepted; the branch is provisioning content: application/json: schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/schemas/DatabaseBranch' '404': - description: Project not found + description: Project, database, or branch not found content: application/json: schema: $ref: '#/components/schemas/Error' '409': 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. + The branch is not active, a reset is already in progress, the parent + database is being restored, or the parent was restored within the + last 24 hours — a reset re-forks from the parent, and the provider + holds a child's reset shut for that long afterwards. content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/access-tokens/usage: - get: + '503': + description: Branching is temporarily unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /projects/{id}/databases/{databaseName}/branches/{branchName}/reset-password: + post: tags: - - Project Access Tokens - summary: Per-day request counts for every access token in a project + - Database Branches + summary: Rotate a branch's password 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. + Issues a new password for the branch and invalidates the previous + connection string. Existing connections are not interrupted; new ones + must use the returned string. Proxies pick the rotation up within a few + seconds, so the previous password can still open new connections until + then. - 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 + The parent database's credentials are untouched. + operationId: resetDatabaseBranchPassword security: - UserToken: [] - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - - 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 + - $ref: '#/components/parameters/DatabaseName' + - $ref: '#/components/parameters/BranchName' responses: '200': - description: Successful response - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/ProjectAccessTokenUsage' - '400': - description: Bad request - invalid window + description: Password rotated content: application/json: schema: - $ref: '#/components/schemas/Error' - '401': - description: Unauthorized - invalid or missing token + $ref: '#/components/schemas/DatabaseBranch' + '404': + description: Project, database, or branch not found content: application/json: schema: $ref: '#/components/schemas/Error' - '403': - description: Forbidden - not the project owner + '409': + description: The branch is not active content: application/json: schema: $ref: '#/components/schemas/Error' - '404': - description: Project not found + '503': + description: Branching is temporarily unavailable content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/access-tokens/{tokenId}: + /projects/{id}/databases/{databaseName}/backups: get: tags: - - Project Access Tokens - summary: Get a project access token + - Database Backups + summary: List a database's backups description: | - Returns one token's metadata. Never its secret, which is not stored in a - recoverable form. + Returns every backup of the database, newest first, together with the + window a point-in-time restore may target. - Requires a platform token. - operationId: getProjectAccessToken + Backups you took, backups the schedule produced, and backups taken + before migrations are all listed; `source` tells them apart. Only manual + backups count against the plan's backup allowance. + operationId: listDatabaseBackups security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/TokenId' + - $ref: '#/components/parameters/DatabaseName' responses: '200': description: Successful response content: application/json: schema: - $ref: '#/components/schemas/ProjectAccessToken' - '401': - description: Unauthorized - invalid or missing token + $ref: '#/components/schemas/DatabaseBackupList' + '403': + description: Backups require SUPERAGENT content: application/json: schema: $ref: '#/components/schemas/Error' - '403': - description: Forbidden - not the project owner, or a project access token was used + '404': + description: Project or database not found content: application/json: schema: $ref: '#/components/schemas/Error' - '404': - description: Token not found + '409': + description: | + The database has no storage project yet, so there is nothing to + list. A database reports this while it is still provisioning. content: application/json: schema: $ref: '#/components/schemas/Error' - delete: + '503': + description: Backups are temporarily unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + post: tags: - - Project Access Tokens - summary: Revoke a project access token + - Database Backups + summary: Back up a database 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. + Captures the database as it is now. The backup is available immediately; + its `size_bytes` appears once the storage provider has costed it. - Requires a platform token. - operationId: revokeProjectAccessToken + Backups are rate-limited to one per minute per database, and capped by + the owner's plan. + operationId: createDatabaseBackup security: - UserToken: [] + - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/TokenId' + - $ref: '#/components/parameters/DatabaseName' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateDatabaseBackupRequest' responses: - '204': - description: Token revoked - '401': - description: Unauthorized - invalid or missing token + '201': + description: Backup created + content: + application/json: + schema: + $ref: '#/components/schemas/DatabaseBackup' + '400': + description: Invalid backup name, or one with a reserved prefix content: application/json: schema: $ref: '#/components/schemas/Error' '403': - description: Forbidden - not the project owner, or a project access token was used + description: | + The database has reached its backup allowance, or the owner's plan + does not include backups, which are available only on SUPERAGENT. content: application/json: schema: $ref: '#/components/schemas/Error' '404': - description: Token not found + description: Project or database not found content: application/json: schema: $ref: '#/components/schemas/Error' '409': - description: Conflict - the project is being deleted + description: | + A backup of that name already exists, the database is not active, a + restore is running on it, or a backup was taken too recently. content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/access-tokens/{tokenId}/usage: + '503': + description: Backups are temporarily unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /projects/{id}/databases/{databaseName}/backups/{backupName}: 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 + - Database Backups + summary: Get a backup + description: Returns one backup of the database. + operationId: getDatabaseBackup 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 + - $ref: '#/components/parameters/DatabaseName' + - $ref: '#/components/parameters/BackupName' responses: '200': description: Successful response content: application/json: schema: - $ref: '#/components/schemas/ProjectAccessTokenUsage' - '400': - description: Bad request - invalid window + $ref: '#/components/schemas/DatabaseBackup' + '403': + description: Backups require SUPERAGENT content: application/json: schema: $ref: '#/components/schemas/Error' - '401': - description: Unauthorized - invalid or missing token + '404': + description: Project, database, or backup not found content: application/json: schema: $ref: '#/components/schemas/Error' - '403': - description: Forbidden - not the project owner + '409': + description: | + The database has no storage project yet, so it holds no backups. A + database reports this while it is still provisioning. content: application/json: schema: $ref: '#/components/schemas/Error' - '404': - description: Token not found + '503': + description: Backups are temporarily unavailable content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/service-keys: - get: + delete: tags: - - Service Keys - summary: List service keys (paginated) + - Database Backups + summary: Delete a backup description: | - List all service role keys for a project with pagination. - - **WARNING:** Service keys bypass RLS - for backend/admin use only! - operationId: listServiceKeys + Deletes the backup and frees its storage. Scheduled backups can be + deleted too. A backup that is already gone reports `404`, so a name + that never existed and a name that no longer does read the same. + Refused with `409` while the database is being restored. + operationId: deleteDatabaseBackup 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' + - $ref: '#/components/parameters/DatabaseName' + - $ref: '#/components/parameters/BackupName' responses: '200': - description: Paginated list of service keys + description: Backup deleted 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: object + properties: + status: 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, project locks, and server-side auth proxy - metadata (auth.signin, auth.signup, auth.refresh, auth.logout, - auth.password_reset). - example: - - functions.invoke - - locks.manage - responses: - '201': - description: Service key created - save the key_value immediately! + example: deleted + message: + type: string + example: backup deleted + required: + - status + - message + '403': + description: Backups require SUPERAGENT content: application/json: schema: - $ref: '#/components/schemas/ServiceKey' + $ref: '#/components/schemas/Error' + '404': + description: Project, database, or backup not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '409': - description: Key with this name already exists - /projects/{id}/service-keys/{keyId}: + description: | + The database is being restored. A restore is pinned to a backup it + may not have restored yet, so deleting one is refused until the + restore finishes. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '503': + description: Backups are temporarily unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /projects/{id}/databases/{databaseName}/backup-schedule: get: tags: - - Service Keys - summary: Get service key - description: Get details of a specific service key - operationId: getServiceKey + - Database Backups + summary: Get the automated backup schedule + description: | + Returns the database's backup schedule. An empty list means no scheduled + backups. + operationId: getDatabaseBackupSchedule security: - UserToken: [] - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - - name: keyId - in: path - required: true - schema: - type: string - format: uuid + - $ref: '#/components/parameters/DatabaseName' responses: '200': - description: Service key details + description: Successful response 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. - Any services using this key will immediately lose access. - operationId: deleteServiceKey - security: - - UserToken: [] - - ProjectAccessToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' - - name: keyId - in: path - required: true - schema: - type: string - format: uuid - responses: - '204': - description: Key deleted - /projects/{id}/service-keys/{keyId}/regenerate: - post: + $ref: '#/components/schemas/DatabaseBackupSchedule' + '403': + description: Backups require SUPERAGENT + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Project or database not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '409': + description: | + The database has no storage project yet, so it has no schedule. A + database reports this while it is still provisioning. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '503': + description: Backups are temporarily unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + put: tags: - - Service Keys - summary: Regenerate service key + - Database Backups + summary: Replace the automated backup schedule description: | - 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. - operationId: regenerateServiceKey + Replaces the schedule wholesale. Send an empty `entries` list to stop + scheduled backups. + + Scheduled backups do not count against the plan's backup allowance, but + their retention is clamped to the plan's. + operationId: updateDatabaseBackupSchedule security: - UserToken: [] - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - - name: keyId - in: path - required: true - schema: - type: string - format: uuid + - $ref: '#/components/parameters/DatabaseName' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DatabaseBackupSchedule' responses: '200': - description: Key regenerated - save the new key_value immediately! + description: Schedule replaced content: application/json: schema: - $ref: '#/components/schemas/ServiceKey' - /projects/{id}/storage/buckets: + $ref: '#/components/schemas/DatabaseBackupSchedule' + '400': + description: | + The schedule names a recurrence that cannot fire: a weekly or + monthly one with no `day`, or a `day` outside its frequency's range + (1-7 for weekly, 1-28 for monthly). The response says which. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: Backups require SUPERAGENT + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Project or database not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '409': + description: | + The database is not active, or a restore is running on it — a restore + moves the data to a new branch, and the provider keeps the schedule + per branch. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '503': + description: Backups are temporarily unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /projects/{id}/databases/{databaseName}/restores: get: tags: - - Storage Buckets - summary: List all storage buckets in a project + - Database Backups + summary: List a database's restores description: | - With no pagination params, returns the full bucket list as a bare array - (legacy). Supplying `cursor`, `ending_before`, `search`, or `limit` - switches to keyset (cursor) pagination and returns a paginated envelope - with `next_cursor`/`prev_cursor` and a filtered `total`. - operationId: listStorageBuckets + Returns the database's restore history, newest first, capped at the 50 + most recent. There is no pagination: a database that has been restored + more than 50 times keeps the older records but does not return them. + operationId: listDatabaseRestores security: - UserToken: [] - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/Limit' - - $ref: '#/components/parameters/Cursor' - - $ref: '#/components/parameters/EndingBefore' - - $ref: '#/components/parameters/Offset' - - $ref: '#/components/parameters/Search' + - $ref: '#/components/parameters/DatabaseName' responses: '200': - description: | - Either the full bucket list (bare array, legacy) or a paginated - envelope when cursor pagination is requested. + description: Successful response content: application/json: schema: - oneOf: - - type: array - items: - $ref: '#/components/schemas/StorageBucket' - - $ref: '#/components/schemas/PaginatedStorageBuckets' + $ref: '#/components/schemas/DatabaseRestoreList' + '403': + description: Backups require SUPERAGENT + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Project or database not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '503': + description: Backups are temporarily unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Error' post: tags: - - Storage Buckets - summary: Create a new storage bucket - operationId: createStorageBucket + - Database Backups + summary: Restore a database + description: | + Replaces the database's data, either with a named backup or with its + state at a point in time. This is destructive: everything written after + that point is discarded. + + Asynchronous: the response is `202` with the restore `pending` and the + database `restoring`. The database does not accept connections until the + restore reports `completed`; its connection string is unchanged + throughout, so nothing holding it needs updating. + + Restores are in place. There is no way to restore into a second + database, and a database's branches are never restored — they keep + serving their own data, but resetting a branch from its parent is + refused by the storage provider for up to 24 hours afterwards. + operationId: createDatabaseRestore security: - UserToken: [] - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/DatabaseName' requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/CreateStorageBucketRequest' + $ref: '#/components/schemas/CreateDatabaseRestoreRequest' responses: - '201': - description: Bucket created + '202': + description: Restore accepted and in progress content: application/json: schema: - $ref: '#/components/schemas/StorageBucket' + $ref: '#/components/schemas/DatabaseRestore' + '400': + description: | + Neither or both restore targets were named, or the requested time is + outside the available window. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: | + The owner's plan does not include backups or point-in-time restore + (code `plan_required`). Both are available only on SUPERAGENT. Also + answers 403 without a code, with `restore history is not available + yet for the requested time`, when the plan includes restore history + but the database has not built any up yet; waiting fixes it, not + upgrading. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Project, database, or backup not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '409': - description: Bucket already exists - /projects/{id}/storage/buckets/{bucketName}: + description: | + Code `migration_run_in_progress`: a migration run is backing up or + applying to the database, named by `run_id`. Wait for it to end, + then send the request again. Without a code: a restore is already + in progress, the database is not active, another database operation + is still running, or the database is holding as many pre-restore + branches as it may. + content: + application/json: + schema: + $ref: '#/components/schemas/DatabaseRestoreConflictError' + '503': + description: Backups are temporarily unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /projects/{id}/databases/{databaseName}/restores/{restoreId}: get: tags: - - Storage Buckets - summary: Get storage bucket by name - operationId: getStorageBucket + - Database Backups + summary: Get a restore + description: | + Returns the restore. Poll this after starting one; the database is + connectable again once it reports `completed`. + operationId: getDatabaseRestore security: - UserToken: [] - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/BucketName' + - $ref: '#/components/parameters/DatabaseName' + - $ref: '#/components/parameters/RestoreId' responses: '200': - description: Bucket details + description: Successful response content: application/json: schema: - $ref: '#/components/schemas/StorageBucket' + $ref: '#/components/schemas/DatabaseRestore' + '403': + description: Backups require SUPERAGENT + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '404': - description: Bucket not found - patch: - tags: - - Storage Buckets - summary: Update storage bucket settings - operationId: updateStorageBucket - security: - - UserToken: [] - - ProjectAccessToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/BucketName' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateStorageBucketRequest' - responses: - '200': - description: Bucket updated + description: Project, database, or restore not found content: application/json: schema: - $ref: '#/components/schemas/StorageBucket' - delete: - tags: - - Storage Buckets - summary: Delete storage bucket and all objects - operationId: deleteStorageBucket - security: - - UserToken: [] - - ProjectAccessToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/BucketName' - responses: - '200': - description: Bucket deleted - /projects/{id}/storage/buckets/{bucketName}/policies: + $ref: '#/components/schemas/Error' + '503': + description: Backups are temporarily unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /projects/{id}/databases/{databaseName}/migrations: get: tags: - - Storage Policies - summary: List storage policies for a bucket - operationId: listStoragePolicies + - Database Migrations + summary: Get a database's migration history + description: | + Returns the migrations the database has recorded, in name order, read + from the database's own `_volcano_migrations.history` table. The history + is empty until a migration run or a baseline first records a file. + + `active_run_id` is the run that is queued or running, if any. + + If the history table is gone from a database where migrations ran, + answers `409` with code `history_missing`, and every run fails with + that code, rather than running files again. Record a baseline of the + files that were already applied to rebuild it. Dropping the whole + `_volcano_migrations` schema is not supported: the database then reads + as new, and the next run applies every file again. + + Volcano reads at most 1,000 history entries, as many files as one run + may carry. A history with more answers `409` with code + `history_too_large`. A baseline is refused with that code, and a run + fails with it. Deleting the entries of files no longer among your + migrations brings the history back under the bound. + + Available whether or not migration runs are. + operationId: getDatabaseMigrations security: - UserToken: [] - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/BucketName' + - $ref: '#/components/parameters/DatabaseName' responses: '200': - description: List of policies + description: Successful response content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/StoragePolicy' + $ref: '#/components/schemas/DatabaseMigrations' + '404': + description: Project or database not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '409': + description: | + Code `history_missing`: the history table is gone from a database + where migrations ran; record a baseline of the files that were + already applied. Code `history_too_large`: the history has more + than 1,000 entries. Without a code: the database is not active, so + its history cannot be read. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '503': + description: Volcano could not reach the database + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /projects/{id}/databases/{databaseName}/migrations/baseline: post: tags: - - Storage Policies - summary: Create a storage policy - operationId: createStoragePolicy + - Database Migrations + summary: Record migrations as applied without running them + description: | + Records each file in the database's migration history as applied, + without running it. Use it once for a database whose schema already + reflects the files, such as one migrated before Volcano tracked its + migrations, so later runs apply only newer files. It is refused while + a run is queued or running, and no run starts while it records. It + does not queue: while another request is changing the database, or the + database holds it up, such as with a lock on the migration history, it + answers `409` with code `database_busy`. + + Files the history already records with the same checksum are skipped, so + repeating the request changes nothing. A file recorded with a different + checksum is refused, and nothing is recorded. + + It also rebuilds a history that was lost (`history_missing`): send + exactly the files that were already applied, and later runs apply only + the rest. + + Where migration runs are not available, answers `404` with code + `feature_unavailable`. + operationId: baselineDatabaseMigrations security: - UserToken: [] - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/BucketName' + - $ref: '#/components/parameters/DatabaseName' requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/CreateStoragePolicyRequest' + $ref: '#/components/schemas/DatabaseMigrationFilesRequest' responses: - '201': - description: Policy created + '200': + description: The files are recorded content: application/json: schema: - $ref: '#/components/schemas/StoragePolicy' - /projects/{id}/storage/buckets/{bucketName}/policies/{policyId}: - delete: - tags: - - Storage Policies - summary: Delete a storage policy - operationId: deleteStoragePolicy - security: - - UserToken: [] - - ProjectAccessToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' - - $ref: '#/components/parameters/BucketName' - - name: policyId - in: path - required: true - schema: - type: string - format: uuid - responses: - '200': - description: Policy deleted + $ref: '#/components/schemas/DatabaseMigrationBaseline' + '400': + description: | + A file breaks a rule: too many files, a file over 1 MiB, a name that + is not a `.sql` file, a name repeated, or a directory other than + this database's. Nothing is recorded or queued. Code + `invalid_layout`: a path does not map to this database. Code + `invalid_file`: a name is repeated or too long. A request the + schema refuses carries no code. Without a code, the message + starting `storage limit reached`: the database is over its storage + allowance, so its writes are blocked, as they are over a + connection. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '404': - description: Project, bucket, or policy not found. Also returned when the policy ID is malformed or belongs to another bucket. + description: | + Project or database not found, or migration runs are not available + here (code `feature_unavailable`). content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/storage/objects: - get: - tags: - - Storage Admin - summary: List all storage objects in a project - description: | - Returns a paginated list of all storage objects across all buckets in the project. - Supports filtering by owner and pagination. - operationId: listStorageObjectsAdmin - security: - - UserToken: [] - - ProjectAccessToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' - - name: owner_id - in: query - description: Filter by owner user ID - schema: - type: string - format: uuid - - name: page - in: query - description: Page number (1-based) - schema: - type: integer - default: 1 - minimum: 1 - - name: limit - in: query - description: Items per page - schema: - type: integer - default: 50 - minimum: 1 - maximum: 100 - - $ref: '#/components/parameters/Cursor' - - $ref: '#/components/parameters/EndingBefore' - - $ref: '#/components/parameters/Offset' - - $ref: '#/components/parameters/Search' - responses: - '200': - description: Paginated list of storage objects + '409': + description: | + Nothing was recorded. Code `checksum_mismatch`: a file is already + recorded with a different checksum. Code + `migration_run_in_progress`: a run is queued or running, named by + `run_id`. Code `history_too_large`: the history has more than 1,000 + entries. Code `database_busy`: another request is changing the + database, or the database held the baseline up, such as with a lock + on its migration history; try again. Without a code: the database is not active or changed + while the request ran, or another session holds its migration + lock. content: application/json: schema: - type: object - properties: - data: - type: array - items: - $ref: '#/components/schemas/StorageObjectWithBucket' - page: - type: integer - limit: - type: integer - total: - type: integer - has_more: - type: boolean - next_cursor: - type: string - description: Opaque cursor for the next page (cursor pagination only) - prev_cursor: - type: string - description: Opaque cursor for the previous page (cursor pagination only). Send as `ending_before`. - /projects/{id}/storage/stats: - get: - tags: - - Storage Admin - summary: Get storage statistics for a project - description: Returns aggregate storage statistics including bucket count, object count, and total size. - operationId: getStorageStats - security: - - UserToken: [] - - ProjectAccessToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' - responses: - '200': - description: Storage statistics + $ref: '#/components/schemas/DatabaseMigrationConflictError' + '413': + description: The request body is larger than 4 MiB, or its JSON has too many objects, arrays or values content: application/json: schema: - $ref: '#/components/schemas/StorageStats' - /projects/{id}/realtime/config: + $ref: '#/components/schemas/Error' + '503': + description: Volcano could not reach the database + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /projects/{id}/databases/{databaseName}/migration-runs: get: tags: - - Realtime - summary: Get realtime configuration for a project - description: Returns the realtime configuration including enabled features and limits. - operationId: getRealtimeConfig + - Database Migrations + summary: List a database's migration runs + description: | + Returns the database's 50 most recent migration runs, newest first, + without their files; get a run for its files. There is no pagination. + + Available whether or not migration runs are. + operationId: listDatabaseMigrationRuns security: - UserToken: [] - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/DatabaseName' responses: '200': - description: Realtime configuration - content: - application/json: - schema: - $ref: '#/components/schemas/RealtimeConfig' - '401': - description: Unauthorized + description: Successful response content: application/json: schema: - $ref: '#/components/schemas/Error' + $ref: '#/components/schemas/DatabaseMigrationRunList' '404': - description: Project not found + description: Project or database not found content: application/json: schema: $ref: '#/components/schemas/Error' - put: + post: tags: - - Realtime - summary: Update realtime configuration for a project - description: Updates realtime settings including feature toggles and limits. - operationId: updateRealtimeConfig + - Database Migrations + summary: Apply migrations to a database + description: | + Starts a migration run: Volcano compares the files with the database's + history, rehearses the pending ones on a short-lived branch of the + database, takes a backup, and applies them in name order. Files the + history already records with the same checksum are skipped. + + Asynchronous: the response is `202` with the run `queued`. Poll the run + until its `status` is `succeeded` or `failed`. + + Send `Idempotency-Key` to make a retry safe: a repeat with a key this + database has seen returns that run with `200` and starts nothing. A + database runs one migration run at a time. + + Where migration runs are not available, answers `404` with code + `feature_unavailable`. + operationId: createDatabaseMigrationRun security: - UserToken: [] - ProjectAccessToken: [] parameters: - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/DatabaseName' + - name: Idempotency-Key + in: header + required: false + description: | + Makes the request safe to retry. A repeat with a key this database + has seen returns the run it started. Reusing a key for different + files answers `409`. Up to 255 printable ASCII characters. + schema: + type: string + minLength: 1 + maxLength: 255 + pattern: ^[!-~]+$ requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/UpdateRealtimeConfigRequest' + $ref: '#/components/schemas/DatabaseMigrationFilesRequest' responses: '200': - description: Updated realtime configuration + description: A run with this `Idempotency-Key` already exists; it is returned content: application/json: schema: - $ref: '#/components/schemas/RealtimeConfig' + $ref: '#/components/schemas/DatabaseMigrationRun' + '202': + description: Run accepted and queued + content: + application/json: + schema: + $ref: '#/components/schemas/DatabaseMigrationRun' '400': - description: Invalid configuration values + description: | + A file breaks a rule: too many files, a file over 1 MiB, a name that + is not a `.sql` file, a name repeated, or a directory other than + this database's. Nothing is recorded or queued. Code + `invalid_layout`: a path does not map to this database. Code + `invalid_file`: a name is repeated or too long. A request the + schema refuses carries no code. Without a code, the message + starting `storage limit reached`: the database is over its storage + allowance, so its writes are blocked, as they are over a + connection. content: application/json: schema: $ref: '#/components/schemas/Error' - '401': - description: Unauthorized + '404': + description: | + Project or database not found, or migration runs are not available + here (code `feature_unavailable`). content: application/json: schema: $ref: '#/components/schemas/Error' - /projects/{id}/realtime/stats: - get: - tags: - - Realtime - summary: Get realtime statistics for a project - description: Returns realtime usage statistics including connection counts and subscribed tables. - operationId: getRealtimeStats - security: - - UserToken: [] - - ProjectAccessToken: [] - parameters: - - $ref: '#/components/parameters/ProjectId' - responses: - '200': - description: Realtime statistics + '409': + description: | + Code `migration_run_in_progress`: a run is already queued or running + for this database, named by `run_id`. Wait for it to end, then send + the request again. Without a code: the `Idempotency-Key` already + started a run of different files. content: application/json: schema: - $ref: '#/components/schemas/RealtimeStats' - '401': - description: Unauthorized + $ref: '#/components/schemas/DatabaseMigrationConflictError' + '413': + description: The request body is larger than 4 MiB, or its JSON has too many objects, arrays or values content: application/json: schema: $ref: '#/components/schemas/Error' - /storage/{bucketName}: + /projects/{id}/databases/{databaseName}/migration-runs/{runId}: get: tags: - - Storage Objects - summary: List objects in a bucket - operationId: listStorageObjects + - Database Migrations + summary: Get a migration run + description: | + Returns the run with each file's outcome. Poll this after starting a + run. + + Available whether or not migration runs are. + operationId: getDatabaseMigrationRun security: - - AnonKey: [] - - ServiceRoleKey: [] - - AuthUserAccessToken: [] + - UserToken: [] + - ProjectAccessToken: [] parameters: - - $ref: '#/components/parameters/BucketName' - - name: prefix - in: query - description: Filter objects by path prefix - schema: - type: string - - name: limit - in: query - description: Maximum objects to return - schema: - type: integer - default: 50 - maximum: 1000 - - name: cursor - in: query - description: Pagination cursor - schema: - type: string + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/DatabaseName' + - $ref: '#/components/parameters/MigrationRunId' responses: '200': - description: List of objects + description: Successful response content: application/json: schema: - $ref: '#/components/schemas/StorageListResponse' - '403': - description: Access denied by storage policy - '429': - $ref: '#/components/responses/BandwidthCapExceeded' - /locks/{key}/lease: + $ref: '#/components/schemas/DatabaseMigrationRun' + '404': + description: Project, database, or run not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /projects/{id}/databases/{databaseName}/reset-password: post: tags: - - Locks - summary: Acquire a project lock + - Databases + summary: Reset database password description: | - Acquires a project-scoped lease using the project embedded in the service-role key. - The caller must hold the `locks.manage` permission. Repeating the request with the - same lock token is idempotent and resets that lease to the requested TTL. A different - live owner receives `409 lock_held`; a caller whose own lease already lapsed receives - `409 lock_ownership_lost`. - operationId: acquireProjectLock + Rotates the Volcano-managed PostgreSQL password used by clients when connecting + through pgproxy. This does not rotate or expose the internal owner password. + The returned password and connection string are the only client credentials that + will authenticate through pgproxy after reset. + + Existing connections are not interrupted; new ones must use the returned + string. Proxies pick the rotation up within a few seconds, so the previous + password can still open new connections until then. + operationId: resetDatabasePassword security: - - ServiceRoleKey: [] + - UserToken: [] + - ProjectAccessToken: [] parameters: - - $ref: '#/components/parameters/LockKey' - - $ref: '#/components/parameters/LockToken' - - $ref: '#/components/parameters/LockRequestId' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/ProjectLockLeaseRequest' + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/DatabaseName' responses: - '201': - description: Lease acquired + '200': + description: Password reset successful content: application/json: schema: - $ref: '#/components/schemas/ProjectLockLease' + type: object + properties: + message: + type: string + role_name: + type: string + description: Volcano-managed per-database client login (also the pgproxy routing username) + example: volcano_client_11111111-1111-1111-1111-111111111111 + new_password: + type: string + description: New Volcano-managed client password. Always starts with `vpg_`. + connection_string: + type: string + description: Updated pgproxy connection string using Volcano-managed credentials. '400': - description: Invalid lock key, token, or TTL - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '401': - description: Missing or invalid credentials + description: Database is not active content: application/json: schema: $ref: '#/components/schemas/Error' - '403': - description: A non-service credential was supplied or the service key lacks `locks.manage` + '404': + description: Database not found content: application/json: schema: $ref: '#/components/schemas/Error' '409': description: | - The lock is held by another live lease (`lock_held`), or the caller's own lease - lapsed and is not yet reclaimable (`lock_ownership_lost`). - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '429': - description: Project lock request limit exceeded - headers: - Retry-After: - description: Seconds until the current fixed-minute window ends. - schema: - type: integer + A restore is running on the database. A restore replaces the + credentials as it finishes, so wait for it and rotate afterwards. content: application/json: schema: $ref: '#/components/schemas/Error' '503': - description: Lock service unavailable + description: | + Volcano could not check whether a restore is running, and will not + rotate a credential a restore might be about to replace. Retry. content: application/json: schema: $ref: '#/components/schemas/Error' + /projects/{id}/databases/{databaseName}/type: patch: tags: - - Locks - summary: Renew a project lock + - Databases + summary: Update database size description: | - Renews a lease owned by the supplied lock token. The request must arrive - more than one second before `expires_at`; this safety margin prevents - clock skew between regional API instances from resurrecting an expired - lease. - operationId: renewProjectLock + Change the size tier of a database. This may briefly interrupt active connections. + + **Available sizes:** + - `volcano-db-xs`: Up to ~1GB RAM - Development, small apps + - `volcano-db-s`: Up to ~4GB RAM - Production-ready, light traffic + - `volcano-db-m`: Up to ~8GB RAM - Medium traffic applications + - `volcano-db-l`: Up to ~16GB RAM - High traffic, larger datasets + - `volcano-db-xl`: Up to ~32GB RAM - Heavy workloads + - `volcano-db-2xl`: Up to ~64GB RAM - Enterprise-scale + operationId: updateDatabaseType security: - - ServiceRoleKey: [] + - UserToken: [] + - ProjectAccessToken: [] parameters: - - $ref: '#/components/parameters/LockKey' - - $ref: '#/components/parameters/LockToken' - - $ref: '#/components/parameters/LockRequestId' + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/DatabaseName' requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/ProjectLockLeaseRequest' + $ref: '#/components/schemas/UpdateDatabaseTypeRequest' responses: '200': - description: Lease renewed + description: Database type updated content: application/json: schema: - $ref: '#/components/schemas/ProjectLockLease' + $ref: '#/components/schemas/Database' '400': - description: Invalid lock key, token, or TTL + description: Invalid database type content: application/json: schema: $ref: '#/components/schemas/Error' '401': - description: Missing or invalid credentials + description: Not authenticated content: application/json: schema: $ref: '#/components/schemas/Error' '403': - description: A non-service credential was supplied or the service key lacks `locks.manage` + description: Access denied or the requested size exceeds the plan allowance (code plan_required) content: application/json: schema: $ref: '#/components/schemas/Error' - '409': - description: The lease expired or is owned by another token + '404': + description: Database not found content: application/json: schema: $ref: '#/components/schemas/Error' - '429': - description: Project lock request limit exceeded - headers: - Retry-After: - description: Seconds until the current fixed-minute window ends. + '409': + description: | + The database is not active — being provisioned, deleted, or + restored. Compute can only be changed while it is active. + content: + application/json: schema: - type: integer + $ref: '#/components/schemas/Error' + '500': + description: Internal server error content: application/json: schema: $ref: '#/components/schemas/Error' '503': - description: Lock service unavailable + description: | + Volcano could not check whether a restore is running, and will not + reconfigure compute a restore might be moving. Retry. content: application/json: schema: $ref: '#/components/schemas/Error' - delete: + /projects/{id}/databases/{databaseName}/stats: + get: tags: - - Locks - summary: Release a project lock - description: Releases a lease only when the supplied lock token still owns it. - operationId: releaseProjectLock + - Databases + summary: Get database consumption metrics + description: | + Retrieve consumption metrics including storage, compute time, and data transfer. + Metrics are aggregated at the project level. Defaults to last 24 hours. + + **Note:** Advanced metrics require an upgraded plan. + operationId: getDatabaseStats security: - - ServiceRoleKey: [] + - UserToken: [] + - ProjectAccessToken: [] parameters: - - $ref: '#/components/parameters/LockKey' - - $ref: '#/components/parameters/LockToken' - - $ref: '#/components/parameters/LockRequestId' - responses: - '204': - description: Lease released - '400': - description: Invalid lock key or token - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '401': - description: Missing or invalid credentials - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '403': - description: A non-service credential was supplied or the service key lacks `locks.manage` - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - '409': - description: The lease is owned by another token - content: - application/json: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/DatabaseName' + - name: from + in: query + required: false + schema: + type: string + format: date-time + description: Start time in RFC3339 format (e.g., "2024-01-01T00:00:00Z"). Defaults to 24 hours ago. + - name: to + in: query + required: false + schema: + type: string + format: date-time + description: End time in RFC3339 format (e.g., "2024-01-02T00:00:00Z"). Defaults to now. + - name: granularity + in: query + required: false + schema: + type: string + enum: + - hourly + - daily + - monthly + default: hourly + description: Level of detail for metrics aggregation + responses: + '200': + description: Successful response + content: + application/json: schema: - $ref: '#/components/schemas/Error' - '429': - description: Project lock request limit exceeded - headers: - Retry-After: - description: Seconds until the current fixed-minute window ends. + $ref: '#/components/schemas/DatabaseStats' + '400': + description: Invalid parameters + content: + application/json: schema: - type: integer + $ref: '#/components/schemas/Error' + '404': + description: Database not found content: application/json: schema: $ref: '#/components/schemas/Error' '503': - description: Lock service unavailable + description: Database metrics not available or requires upgraded plan content: application/json: schema: $ref: '#/components/schemas/Error' - /locks/{key}: - get: + /databases/{databaseName}/query/ping: + post: tags: - - Locks - summary: Read a project lock + - Database Queries + summary: Database connectivity probe (REST API) description: | - Reports whether the lock is currently held, when its lease expires, and the - holder's fencing token. `held` follows takeover eligibility rather than raw - expiry, so `held: false` means an acquire would succeed now. No lock token is - required, making this usable for monitoring and recovery. - operationId: getProjectLock + Connectivity probe that runs a fixed `SELECT 1` through pgproxy, using the + same authentication, status/bandwidth gating, and metering as the other + `/query/*` endpoints. + + Unlike those endpoints, ping takes **no request body** and performs **no + table-name validation**, so it works on any database — including a freshly + provisioned, empty one. It is a real committed round-trip through pgproxy, + so a `200` means the database is reachable and queryable. Used by the + dashboard's database connection test. + operationId: queryDatabasePing security: - - ServiceRoleKey: [] + - AuthUserAccessToken: [] parameters: - - $ref: '#/components/parameters/LockKey' - - $ref: '#/components/parameters/LockRequestId' + - $ref: '#/components/parameters/DatabaseName' responses: '200': - description: Current lock state - content: - application/json: - schema: - $ref: '#/components/schemas/ProjectLockState' - '400': - description: Invalid lock key + 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: - $ref: '#/components/schemas/Error' + $ref: '#/components/schemas/DatabaseQueryResult' + example: + data: + - ?column?: 1 + count: 1 '401': - description: Missing or invalid credentials + description: Not authenticated content: application/json: schema: $ref: '#/components/schemas/Error' '403': - description: A non-service credential was supplied or the service key lacks `locks.manage` + description: Access denied. A service key whose `permissions` leave out `*` is refused with `service key scope does not include database access` once Volcano applies service key scopes to the database API. content: application/json: schema: $ref: '#/components/schemas/Error' - '429': - description: Project lock request limit exceeded - headers: - Retry-After: - description: Seconds until the current fixed-minute window ends. - schema: - type: integer + '404': + description: Database not found content: application/json: schema: $ref: '#/components/schemas/Error' + '429': + $ref: '#/components/responses/DatabaseQueryCapExceeded' '503': - description: Lock service unavailable - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - delete: + $ref: '#/components/responses/DatabaseBranchQueryUnavailable' + /databases/{databaseName}/query/select: + post: tags: - - Locks - summary: Force release a project lock + - Database Queries + summary: Query database with SELECT (REST API) description: | - Drops the lease whatever token holds it, for recovering a lock whose holder - died without releasing. Use `DELETE /locks/{key}/lease` for normal release. + Query your database using a simple REST API - no SQL required! - This breaks mutual exclusion by itself: the previous holder keeps working - until its own renewal fails. Guard the protected resource with the lease's - `fencing_token`, which the next acquisition raises, so a write from the - displaced holder can be rejected. Succeeds when the lock is already absent. - operationId: forceReleaseProjectLock + **Authentication:** Requires auth user access token (from signup/signin) + + **Row-Level Security:** Applied on tables with RLS enabled. A table without RLS returns every row your role is granted + + **Use Cases:** + - Query from browser/mobile apps + - Simple data retrieval + - Filtered searches with sorting and pagination + + **Note:** For complex queries (JOINs, CTEs), use functions with direct SQL + operationId: queryDatabaseSelect security: - - ServiceRoleKey: [] + - AuthUserAccessToken: [] parameters: - - $ref: '#/components/parameters/LockKey' - - $ref: '#/components/parameters/LockRequestId' + - $ref: '#/components/parameters/DatabaseName' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DatabaseSelectRequest' responses: - '204': - description: Lock released + '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: + $ref: '#/components/schemas/DatabaseQueryResult' + example: + data: + - id: uuid-123 + title: My Post + content: Post content + status: published + views: 150 + created_at: '2026-01-13T10:00:00Z' + count: 1 '400': - description: Invalid lock key + description: Invalid query content: application/json: schema: $ref: '#/components/schemas/Error' '401': - description: Missing or invalid credentials + description: Not authenticated content: application/json: schema: $ref: '#/components/schemas/Error' '403': - description: A non-service credential was supplied or the service key lacks `locks.manage` + description: Access denied. A service key whose `permissions` leave out `*` is refused with `service key scope does not include database access` once Volcano applies service key scopes to the database API. content: application/json: schema: $ref: '#/components/schemas/Error' - '429': - description: Project lock request limit exceeded - headers: - Retry-After: - description: Seconds until the current fixed-minute window ends. - schema: - type: integer + '404': + description: Database not found content: application/json: schema: $ref: '#/components/schemas/Error' - '503': - description: Lock service unavailable + '413': + description: Request body exceeds 4,194,304 bytes, or its JSON has too many objects, arrays or values content: application/json: schema: $ref: '#/components/schemas/Error' - /storage/{bucketName}/move: + '429': + $ref: '#/components/responses/DatabaseQueryCapExceeded' + '503': + $ref: '#/components/responses/DatabaseBranchQueryUnavailable' + /databases/{databaseName}/query/insert: post: tags: - - Storage Objects - summary: Move/rename an object - operationId: moveStorageObject + - Database Queries + summary: Insert data into database (REST API) + description: | + Insert new rows into your database using REST API. + + **Authentication:** Requires auth user access token + + **Auto-set user_id:** If your table has a trigger using `auth.uid()`, + user_id will be automatically set to the authenticated user + + **Security:** Row-Level Security policies are enforced + operationId: queryDatabaseInsert security: - - ServiceRoleKey: [] - AuthUserAccessToken: [] parameters: - - $ref: '#/components/parameters/BucketName' + - $ref: '#/components/parameters/DatabaseName' requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/StorageMoveRequest' + $ref: '#/components/schemas/DatabaseInsertRequest' responses: '200': - description: Object moved + 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: - $ref: '#/components/schemas/StorageObject' + $ref: '#/components/schemas/DatabaseQueryResult' + example: + data: + - id: uuid-123 + title: My New Post + content: This is the content + status: draft + user_id: user-uuid + created_at: '2026-01-13T10:00:00Z' + count: 1 + '400': + description: Invalid request + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Not authenticated + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '403': - description: Access denied by storage policy - '429': - $ref: '#/components/responses/BandwidthCapExceeded' - /storage/{bucketName}/copy: - post: - tags: - - Storage Objects - summary: Copy an object - operationId: copyStorageObject - security: - - ServiceRoleKey: [] - - AuthUserAccessToken: [] - parameters: - - $ref: '#/components/parameters/BucketName' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/StorageCopyRequest' - responses: - '201': - description: Object copied + description: Access denied. A service key whose `permissions` leave out `*` is refused with `service key scope does not include database access` once Volcano applies service key scopes to the database API. content: application/json: schema: - $ref: '#/components/schemas/StorageObject' - '403': - description: Access denied by storage policy + $ref: '#/components/schemas/Error' + '404': + description: Database not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '413': + description: Request body exceeds 4,194,304 bytes, or its JSON has too many objects, arrays or values + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/BandwidthCapExceeded' - /storage/{bucketName}/{path}: + $ref: '#/components/responses/DatabaseQueryCapExceeded' + '503': + $ref: '#/components/responses/DatabaseBranchQueryUnavailable' + /databases/{databaseName}/query/update: post: tags: - - Storage Objects - summary: Upload a file or create resumable session + - Database Queries + summary: Update data in database (REST API) description: | - Unified endpoint for file uploads. Behavior depends on Content-Type and headers: - - **Simple Upload (multipart/form-data):** - Upload a complete file in a single request. Best for files under 100MB. + Update existing rows in your database using REST API. - **Create Resumable Session (application/json):** - Create a session for chunked uploads. Best for large files or unreliable networks. - Requires: `Content-Type: application/json` with body `{"filename": "...", "content_type": "...", "total_size": ...}` + **Security:** Row-Level Security ensures you can only update data you have access to - **Complete Resumable Session:** - Complete a session after all parts are uploaded. - Requires: `X-Upload-Session` header with session ID and `X-Upload-Complete: true` header. + **Safety:** Requires at least one filter to prevent accidental mass updates. A + request with no `filters` is rejected with `400` (mirrors delete). This matters + for service-key queries, which run with full access and bypass RLS. - **Resumable Session Ownership:** - A session created with a user access token remains bound to that user. A session - created with an anon key remains bound to that exact anon key. Reuse the same - identity or anon key for part uploads, status, completion, and abort requests; - an ownership mismatch returns `404`. - operationId: uploadStorageObject + **Note:** If RLS blocks the update, an empty result is returned (not an error) + operationId: queryDatabaseUpdate security: - - AnonKey: [] - - ServiceRoleKey: [] - AuthUserAccessToken: [] parameters: - - $ref: '#/components/parameters/BucketName' - - name: path - in: path - required: true - description: Object path within bucket - schema: - type: string - - name: X-Upload-Session - in: header - required: false - description: Upload session ID (for completing resumable uploads) - schema: - type: string - - name: X-Upload-Complete - in: header - required: false - description: Set to "true" to complete a resumable upload session - schema: - type: string - enum: - - 'true' + - $ref: '#/components/parameters/DatabaseName' requestBody: required: true content: - multipart/form-data: - schema: - type: object - required: - - file - properties: - file: - type: string - format: binary - description: File to upload (simple upload) application/json: schema: - $ref: '#/components/schemas/CreateUploadSessionRequest' + $ref: '#/components/schemas/DatabaseUpdateRequest' responses: '200': - description: Resumable upload completed (when X-Upload-Complete=true) + 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: - $ref: '#/components/schemas/CompleteUploadSessionResponse' - '201': - description: File uploaded or session created + $ref: '#/components/schemas/DatabaseQueryResult' + example: + data: + - id: post-uuid + title: Updated Title + status: published + updated_at: '2026-01-13T10:05:00Z' + count: 1 + '400': + description: Invalid request content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/StorageObject' - - $ref: '#/components/schemas/CreateUploadSessionResponse' - '400': - description: | - Bad request. This can occur when: - - MIME type is not in the bucket's allowed_mime_types list - - File exceeds the bucket's configured file_size_limit - - File exceeds the global maximum upload size (5GB) - - Invalid request body or missing required fields + $ref: '#/components/schemas/Error' + '401': + description: Not authenticated + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '403': - description: Access denied by storage policy + description: Access denied. A service key whose `permissions` leave out `*` is refused with `service key scope does not include database access` once Volcano applies service key scopes to the database API. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '404': - description: Resumable upload session not found or not owned by this credential + description: Database not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '413': - description: | - File size exceeds plan-based limits. This occurs when: - - File exceeds the plan-based maximum file size (HOBBY or SUPERAGENT tier) - - The account on the HOBBY plan holds its file-storage allowance. - Enforcement is eventual: uploads are accepted until Volcano's - next allowance check sees the account at its allowance + description: Request body exceeds 4,194,304 bytes, or its JSON has too many objects, arrays or values + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/BandwidthCapExceeded' - put: + $ref: '#/components/responses/DatabaseQueryCapExceeded' + '503': + $ref: '#/components/responses/DatabaseBranchQueryUnavailable' + /databases/{databaseName}/query/delete: + post: tags: - - Storage Objects - summary: Upload a part of a resumable upload + - Database Queries + summary: Delete data from database (REST API) description: | - Upload a single part of a resumable upload session. + Delete rows from your database using REST API. - **Requirements:** - - Part numbers start at 1 - - All parts except the last must be at least 5MB - - Maximum part size is 25MB - - Parts can be uploaded in any order - - Re-uploading a part overwrites the previous upload - - Anonymous sessions must reuse the exact anon key that created the session - operationId: uploadPart + **Safety:** Requires at least one filter to prevent accidental mass deletions + + **Security:** Row-Level Security ensures you can only delete data you have access to + + **Note:** If RLS blocks the delete, an empty result is returned (not an error) + operationId: queryDatabaseDelete security: - - AnonKey: [] - - ServiceRoleKey: [] - AuthUserAccessToken: [] parameters: - - $ref: '#/components/parameters/BucketName' - - name: path - in: path - required: true - description: Object path within bucket - schema: - type: string - - name: X-Upload-Session - in: header - required: true - description: Upload session ID - schema: - type: string - - name: X-Part-Number - in: header - required: true - description: Part number (1 to 10000) - schema: - type: integer - minimum: 1 - maximum: 10000 + - $ref: '#/components/parameters/DatabaseName' requestBody: required: true content: - application/octet-stream: + application/json: schema: - type: string - format: binary + $ref: '#/components/schemas/DatabaseDeleteRequest' responses: '200': - description: Part uploaded + 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: - $ref: '#/components/schemas/UploadSessionPart' + $ref: '#/components/schemas/DatabaseQueryResult' + example: + data: + - id: post-uuid + title: Deleted Post + count: 1 '400': - description: Invalid part number or part data + description: Invalid request or missing filters + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Not authenticated + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '403': - description: Access denied + description: Access denied. A service key whose `permissions` leave out `*` is refused with `service key scope does not include database access` once Volcano applies service key scopes to the database API. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '404': - description: Session not found or not owned by this credential - get: - tags: - - Storage Objects - summary: Download a file or get upload session status + description: Database not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '413': + description: Request body exceeds 4,194,304 bytes, or its JSON has too many objects, arrays or values + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + $ref: '#/components/responses/DatabaseQueryCapExceeded' + '503': + $ref: '#/components/responses/DatabaseBranchQueryUnavailable' + /databases/{databaseName}/branches/{branchName}/query/ping: + post: + tags: + - Database Queries + summary: Database connectivity probe (REST API) description: | - Download a file, or get the status of a resumable upload session. + Connectivity probe that runs a fixed `SELECT 1` through pgproxy, using the + same authentication, status/bandwidth gating, and metering as the other + `/query/*` endpoints. - **File Download (default):** - Downloads the file at the specified path. + Unlike those endpoints, ping takes **no request body** and performs **no + table-name validation**, so it works on any database — including a freshly + provisioned, empty one. It is a real committed round-trip through pgproxy, + so a `200` means the database is reachable and queryable. Used by the + dashboard's database connection test. - **Session Status (with X-Upload-Session header):** - Returns the status of a resumable upload session, including which parts have been uploaded. - Anonymous sessions must reuse the exact anon key that created the session. - operationId: downloadStorageObject + **Branch-targeted.** Runs against the named branch instead of the parent + database, using the branch's own credentials. The branch must be `active` + and unexpired. Nothing about this request can reach the parent's data. + operationId: queryDatabaseBranchPing security: - - AnonKey: [] - - ServiceRoleKey: [] - AuthUserAccessToken: [] parameters: - - $ref: '#/components/parameters/BucketName' - - name: path - in: path - required: true - description: Object path within bucket - schema: - type: string - - name: Range - in: header - required: false - description: | - HTTP Range header for partial downloads. - Format: bytes=start-end or bytes=start- - Examples: bytes=0-1023, bytes=1000- - schema: - type: string - pattern: ^bytes=\d+-\d*$ - - name: X-Upload-Session - in: header - required: false - description: Upload session ID (to get session status instead of downloading) - schema: - type: string + - $ref: '#/components/parameters/DatabaseName' + - $ref: '#/components/parameters/BranchName' responses: '200': - description: File content or session status + description: Database is reachable headers: - Content-Type: - schema: - type: string - Content-Length: - schema: - type: integer - ETag: - schema: - type: string + 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/octet-stream: + application/json: schema: - type: string - format: binary + $ref: '#/components/schemas/DatabaseQueryResult' + example: + data: + - ?column?: 1 + count: 1 + '401': + description: Not authenticated + content: application/json: schema: - $ref: '#/components/schemas/UploadSessionStatusResponse' - '206': - description: Partial content (range request) - '400': - description: Invalid Range header format + $ref: '#/components/schemas/Error' '403': - description: Access denied by storage policy + description: Access denied. A service key whose `permissions` leave out `*` is refused with `service key scope does not include database access` once Volcano applies service key scopes to the database API. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '404': - description: Object or session not found, or session not owned by this credential + description: Database or branch not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/BandwidthCapExceeded' - delete: + $ref: '#/components/responses/DatabaseQueryCapExceeded' + '503': + $ref: '#/components/responses/DatabaseBranchQueryUnavailable' + /databases/{databaseName}/branches/{branchName}/query/select: + post: tags: - - Storage Objects - summary: Delete a file or abort upload session + - Database Queries + summary: Query database with SELECT (REST API) description: | - Delete a file, or abort a resumable upload session. + Query your database using a simple REST API - no SQL required! - **File Delete (default):** - Deletes the file at the specified path. + **Authentication:** Requires auth user access token (from signup/signin) - **Abort Session (with X-Upload-Session header):** - Aborts a resumable upload session and cleans up any uploaded parts. - Anonymous sessions must reuse the exact anon key that created the session. - operationId: deleteStorageObject - security: - - AnonKey: [] - - ServiceRoleKey: [] - - AuthUserAccessToken: [] - parameters: - - $ref: '#/components/parameters/BucketName' - - name: path - in: path - required: true - description: Object path within bucket - schema: - type: string - - name: X-Upload-Session - in: header - required: false - description: Upload session ID (to abort session instead of deleting file) - schema: - type: string - responses: - '200': - description: Object deleted or session aborted - '403': - description: Access denied by storage policy - '404': - description: Object or session not found, or session not owned by this credential - '429': - $ref: '#/components/responses/BandwidthCapExceeded' - /storage/{bucketName}/{path}/visibility: - patch: - tags: - - Storage Objects - summary: Update file visibility (public/private) - description: | - Change whether a file is publicly accessible. Only the file owner or a service key can change visibility. - If the bucket defines UPDATE policies, the owner must also satisfy one of them. + **Row-Level Security:** Applied on tables with RLS enabled. A table without RLS returns every row your role is granted - - Public files can be downloaded with just an anon key (no user authentication required) - - Private files (default) require authentication and must pass policy checks - - All downloads go through the Volcano API - there is no direct access to the underlying store - operationId: updateStorageObjectVisibility + **Use Cases:** + - Query from browser/mobile apps + - Simple data retrieval + - Filtered searches with sorting and pagination + + **Note:** For complex queries (JOINs, CTEs), use a function with direct SQL + + **Branch-targeted.** Runs against the named branch instead of the parent + database, using the branch's own credentials. The branch must be `active` + and unexpired. Nothing about this request can reach the parent's data. + operationId: queryDatabaseBranchSelect security: - - ServiceRoleKey: [] - AuthUserAccessToken: [] parameters: - - $ref: '#/components/parameters/BucketName' - - name: path - in: path - required: true - description: Object path within bucket - schema: - type: string + - $ref: '#/components/parameters/DatabaseName' + - $ref: '#/components/parameters/BranchName' requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/StorageVisibilityRequest' + $ref: '#/components/schemas/DatabaseSelectRequest' responses: '200': - description: Visibility updated + 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: - $ref: '#/components/schemas/StorageObject' + $ref: '#/components/schemas/DatabaseQueryResult' + example: + data: + - id: uuid-123 + title: My Post + content: Post content + status: published + views: 150 + created_at: '2026-01-13T10:00:00Z' + count: 1 + '400': + description: Invalid query + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Not authenticated + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '403': - description: Not the file owner or denied by the bucket's UPDATE policies + description: Access denied. A service key whose `permissions` leave out `*` is refused with `service key scope does not include database access` once Volcano applies service key scopes to the database API. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '404': - description: Object not found - /public/{projectId}/{bucketName}/{path}: - get: + description: Database or branch not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '413': + description: Request body exceeds 4,194,304 bytes, or its JSON has too many objects, arrays or values + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + $ref: '#/components/responses/DatabaseQueryCapExceeded' + '503': + $ref: '#/components/responses/DatabaseBranchQueryUnavailable' + /databases/{databaseName}/branches/{branchName}/query/insert: + post: tags: - - Storage Objects - summary: Download a public file (no authentication required) + - Database Queries + summary: Insert data into database (REST API) description: | - Download a file that has been marked as public. This endpoint requires NO authentication. + Insert new rows into your database using REST API. - **Access Requirements:** - - The file must have `is_public: true` set via the visibility endpoint - - Private files will return 403 Forbidden - - **Use Cases:** - - Shareable public URLs for profile pictures, public documents, etc. - - Embedding public files on external websites - - Direct linking without requiring SDK or authentication + **Authentication:** Requires auth user access token - **URL Format:** - ``` - GET /public/{projectId}/{bucketName}/{path} - ``` + **Auto-set user_id:** If your table has a trigger using `auth.uid()`, + user_id will be automatically set to the authenticated user - **Example:** - ``` - https://api.volcano.dev/public/abc123/avatars/user-photo.jpg - ``` + **Security:** Row-Level Security policies are enforced - **CORS:** - This endpoint allows all origins since the file is already public. - operationId: downloadPublicFile + **Branch-targeted.** Runs against the named branch instead of the parent + database, using the branch's own credentials. The branch must be `active` + and unexpired. Nothing about this request can reach the parent's data. + operationId: queryDatabaseBranchInsert + security: + - AuthUserAccessToken: [] parameters: - - name: projectId - in: path - required: true - description: Project ID - schema: - type: string - format: uuid - - $ref: '#/components/parameters/BucketName' - - name: path - in: path - required: true - description: Object path within bucket - schema: - type: string + - $ref: '#/components/parameters/DatabaseName' + - $ref: '#/components/parameters/BranchName' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DatabaseInsertRequest' responses: '200': - description: File content + 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: - type: string - format: binary - '206': - description: Partial content (range request) + $ref: '#/components/schemas/DatabaseQueryResult' + example: + data: + - id: uuid-123 + title: My New Post + content: This is the content + status: draft + user_id: user-uuid + created_at: '2026-01-13T10:00:00Z' + count: 1 + '400': + description: Invalid request + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Not authenticated + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: Access denied. A service key whose `permissions` leave out `*` is refused with `service key scope does not include database access` once Volcano applies service key scopes to the database API. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '404': - description: Not found (file doesn't exist or is not public) - '429': - $ref: '#/components/responses/BandwidthCapExceeded' - /health: - get: - tags: - - System - summary: Health check endpoint - description: Returns server health status. Used for load balancer and monitoring checks. - operationId: healthCheck - responses: - '200': - description: Server is healthy + description: Database or branch not found content: - text/plain: + application/json: schema: - type: string - example: OK - /capabilities: - get: - tags: - - System - summary: List capabilities - description: | - Lists which product capabilities accept new work in this environment. Check it - to decide what to offer, instead of calling a route to see whether it fails. - - | ID | Covers | - | --- | --- | - | `sandboxes` | The Sandbox API: presets, templates, sessions, and executions | - | `sandboxes.sessions` | Starting and resuming sessions, and one-shot executions | - | `sandboxes.custom_templates` | Deploying a custom template; its validation waits while `sandboxes.sessions` is unavailable | - | `issues` | The Issues API: listing, reading, and updating grouped runtime errors | - | `autofix` | The Autofix API: a project's AI diagnosis and fix settings | - | `autofix.managed_models` | Turning autofix on with Volcano-managed models instead of your own API key | - - A capability missing from the list is unavailable, and a capability under - another, such as `sandboxes.sessions`, is unavailable whenever its parent is. - While a capability is unavailable, requests that start new work answer `404` - or `400` with code `feature_unavailable`; refresh this list when you receive - that code. Reading, deleting, and terminating what already exists keep - working unless the whole feature is absent from the environment. Every caller - in an environment gets the same answer. - operationId: listCapabilities - security: [] - responses: - '200': - description: Capabilities in this environment + $ref: '#/components/schemas/Error' + '413': + description: Request body exceeds 4,194,304 bytes, or its JSON has too many objects, arrays or values content: application/json: schema: - $ref: '#/components/schemas/CapabilityList' - example: - data: - - id: sandboxes - status: available - - id: sandboxes.sessions - status: available - - id: sandboxes.custom_templates - status: unavailable - - id: issues - status: available - - id: autofix - status: available - - id: autofix.managed_models - status: unavailable - /openapi.json: - get: + $ref: '#/components/schemas/Error' + '429': + $ref: '#/components/responses/DatabaseQueryCapExceeded' + '503': + $ref: '#/components/responses/DatabaseBranchQueryUnavailable' + /databases/{databaseName}/branches/{branchName}/query/update: + post: tags: - - System - summary: Fetch the OpenAPI specification as JSON + - Database Queries + summary: Update data in database (REST API) 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. + Update existing rows in your database using REST API. - 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. + **Security:** Row-Level Security ensures you can only update data you have access to - 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: [] + **Safety:** Requires at least one filter to prevent accidental mass updates. A + request with no `filters` is rejected with `400` (mirrors delete). This matters + for service-key queries, which run with full access and bypass RLS. + + **Note:** If RLS blocks the update, an empty result is returned (not an error) + + **Branch-targeted.** Runs against the named branch instead of the parent + database, using the branch's own credentials. The branch must be `active` + and unexpired. Nothing about this request can reach the parent's data. + operationId: queryDatabaseBranchUpdate + security: + - AuthUserAccessToken: [] parameters: - - $ref: '#/components/parameters/IfNoneMatch' + - $ref: '#/components/parameters/DatabaseName' + - $ref: '#/components/parameters/BranchName' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DatabaseUpdateRequest' responses: '200': - description: The OpenAPI specification + description: Update successful headers: - ETag: - $ref: '#/components/headers/ETag' + 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: - $ref: '#/components/schemas/OpenAPISpecDocument' - '304': - $ref: '#/components/responses/OpenAPISpecNotModified' + $ref: '#/components/schemas/DatabaseQueryResult' + example: + data: + - id: post-uuid + title: Updated Title + status: published + updated_at: '2026-01-13T10:05:00Z' + count: 1 + '400': + description: Invalid request + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Not authenticated + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: Access denied. A service key whose `permissions` leave out `*` is refused with `service key scope does not include database access` once Volcano applies service key scopes to the database API. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Database or branch not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '413': + description: Request body exceeds 4,194,304 bytes, or its JSON has too many objects, arrays or values + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/OpenAPISpecThrottled' - head: + $ref: '#/components/responses/DatabaseQueryCapExceeded' + '503': + $ref: '#/components/responses/DatabaseBranchQueryUnavailable' + /databases/{databaseName}/branches/{branchName}/query/delete: + post: 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 + - Database Queries + summary: Delete data from database (REST API) 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. + Delete rows from your database using REST API. - 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. + **Safety:** Requires at least one filter to prevent accidental mass deletions - 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. + **Security:** Row-Level Security ensures you can only delete data you have access to - 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 + **Note:** If RLS blocks the delete, an empty result is returned (not an error) + + **Branch-targeted.** Runs against the named branch instead of the parent + database, using the branch's own credentials. The branch must be `active` + and unexpired. Nothing about this request can reach the parent's data. + operationId: queryDatabaseBranchDelete security: - - ProjectAccessToken: [] + - AuthUserAccessToken: [] + parameters: + - $ref: '#/components/parameters/DatabaseName' + - $ref: '#/components/parameters/BranchName' 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 + $ref: '#/components/schemas/DatabaseDeleteRequest' responses: '200': - description: A JSON-RPC response object + 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: - 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 + $ref: '#/components/schemas/DatabaseQueryResult' + example: + data: + - id: post-uuid + title: Deleted Post + count: 1 + '400': + description: Invalid request or missing filters + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '401': description: Not authenticated content: @@ -16614,1982 +16862,13165 @@ paths: 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. + description: Access denied. A service key whose `permissions` leave out `*` is refused with `service key scope does not include database access` once Volcano applies service key scopes to the database API. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Database or branch not found 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: Request body exceeds 4,194,304 bytes, or its JSON has too many objects, arrays or values + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + $ref: '#/components/responses/DatabaseQueryCapExceeded' + '503': + $ref: '#/components/responses/DatabaseBranchQueryUnavailable' + /databases/regions: + get: + tags: + - Databases + summary: List platform-supported regions for database provisioning + operationId: listDatabaseRegions 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: + Returns the regions enabled for database provisioning in this platform environment. + In cloud environments, these are the same regions offered for function deployment, + and the only values the `region` field of a database accepts. + Local mode returns one region, `local` (Local), for its bundled Postgres server; + database creation uses that region regardless of the requested value. + This is a public endpoint that doesn't require authentication. + responses: + '200': + description: List of platform-supported regions + content: + application/json: + schema: + type: array + items: + type: object + properties: + id: + type: string + example: us-east-1 + description: Region identifier for API usage + name: + type: string + example: US East (N. Virginia) + description: Human-readable region location + /databases/postgres-versions: + get: + tags: + - Databases + summary: List available PostgreSQL versions + operationId: listPostgresVersions 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 - scheme: bearer - bearerFormat: JWT - description: | - Project-specific public key for frontend authentication. - Required for signup, signin, refresh, and logout endpoints. - Get from Project Settings → Authentication → Anon Keys. - Safe to expose in frontend code (scoped to project, limited permissions). - AuthUserAccessToken: - type: http - scheme: bearer - bearerFormat: JWT + Returns the PostgreSQL major versions a database can be created on, + newest first. Local mode lists only the version its server runs. + This is a public endpoint that doesn't require authentication. + responses: + '200': + description: List of available PostgreSQL versions + content: + application/json: + schema: + type: array + items: + type: object + properties: + version: + type: string + example: '18' + description: PostgreSQL major version number + name: + type: string + example: PostgreSQL 18 + description: Human-readable version name + default: + type: boolean + description: True on the version to preselect for a new database; absent on the others + recommended: + type: boolean + description: True on the version recommended for new databases; absent on the others + deprecated: + type: boolean + description: Whether this version is deprecated (approaching EOL) + /functions/runtimes: + get: + tags: + - Functions + summary: List supported function runtimes + operationId: listFunctionRuntimes + security: [] description: | - Auth user access token obtained from signup/signin. - Used for authenticated function invocation and user profile access. - Functions invoked with access tokens receive user context in event.__volcano_auth. - Expires after configured lifetime (default: 1 hour). - ServiceRoleKey: - type: http - scheme: bearer - bearerFormat: JWT + Returns the public function runtime catalog: every runtime a deploy accepts, its display + label for runtime pickers, language defaults, durable capability, and local source packaging + metadata for deployments. + This is a public endpoint that doesn't require authentication. + responses: + '200': + description: Supported function runtimes + content: + application/json: + schema: + $ref: '#/components/schemas/FunctionRuntimesResponse' + /functions/regions: + get: + tags: + - Functions + summary: List available regions for function deployment + operationId: listFunctionRegions + security: [] description: | - Service role key for admin operations. - **WARNING:** Bypasses Row-Level Security - backend use only! - Create via POST /projects/{id}/service-keys. - Used for function invocation with full database access. - UserToken: - type: http - scheme: bearer - bearerFormat: opaque + Returns the configured regions where functions can be deployed, each annotated + with a human-readable label and country flag emoji for use in UI pickers. + This is a public endpoint that doesn't require authentication. + responses: + '200': + description: Available function deployment regions + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/FunctionRegion' + /projects/{id}/variables/{name}: + get: + tags: + - Variables + summary: Get variable by name 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 + Returns a project-level environment variable used by deployed functions and frontends. + operationId: getVariable + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/VariableName' + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/Variable' + '404': + description: Variable not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + put: + tags: + - Variables + summary: Update a variable description: | - 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: - AuthProxyAuthorization: - name: X-Volcano-Proxy-Authorization - in: header - required: false + Updates a project-level environment variable and triggers asynchronous propagation + to deployed functions and frontends in the project's configured regions. + operationId: updateVariable + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/VariableName' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateVariableRequest' + responses: + '200': + description: Variable updated + content: + application/json: + schema: + $ref: '#/components/schemas/Variable' + '400': + description: Invalid or reserved variable name + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Variable not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '409': + description: '`code: function_served_by_candidate` - a promoted preview serves a function whose environment this write changes; the preview keeps the variables it was built with and the write would reach only the function''s own build, so roll the function back to its own build, or deploy it, first.' + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '503': + description: Private variable membership writes are disabled during rollout + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + delete: + tags: + - Variables + summary: Delete a variable description: | - Trusted server-side auth proxy credential in `Bearer SERVICE_KEY` - form. When supplied, `X-Volcano-Client-IP` is also required. The service - key must belong to the anon key's project and hold this operation's scope: - `auth.signup` for signup and anonymous signup, `auth.signin` for signin - and OAuth code exchange, `auth.refresh` for refresh, `auth.logout` for - logout, and `auth.password_reset` for forgot-password and reset-password. - The password policy accepts any service key for the project. Never expose - a service key to browser code. - schema: - type: string - AuthProxyClientIP: - name: X-Volcano-Client-IP - in: header - required: false + Deletes a project-level environment variable and triggers asynchronous propagation + of the removal to deployed functions and frontends in the project's configured regions. + operationId: deleteVariable + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/VariableName' + responses: + '204': + description: Variable deleted + '404': + description: Variable not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '409': + description: '`code: function_served_by_candidate` - a promoted preview serves a function whose environment this write changes; the preview keeps the variables it was built with and the write would reach only the function''s own build, so roll the function back to its own build, or deploy it, first.' + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /auth/password-policy: + get: + tags: + - Authentication + summary: Get the effective password policy description: | - Original browser IPv4 or IPv6 address supplied by a trusted server-side - auth proxy. The proxy must derive this value from its platform-verified - request metadata, never from a browser-supplied header. Requires a valid - `X-Volcano-Proxy-Authorization` header. - schema: - type: string - BackupName: - name: backupName - in: path - required: true - schema: - type: string - minLength: 1 - maxLength: 128 + Returns the backend-enforced password bounds and compromised-password + screening status for the project identified by the anon key. A valid + anon key is required, but no route-specific auth permission is needed. + operationId: authGetPasswordPolicy + security: + - AnonKey: [] + parameters: + - $ref: '#/components/parameters/AuthProxyAuthorization' + - $ref: '#/components/parameters/AuthProxyClientIP' + responses: + '200': + description: Effective password policy + content: + application/json: + schema: + $ref: '#/components/schemas/AuthPasswordPolicy' + '401': + description: Invalid, missing, or revoked anon key; or invalid auth proxy metadata + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Project or auth configuration not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /auth/signup: + post: + tags: + - Authentication + summary: Sign up a new auth user description: | - Backup name, unique within the database, exactly as returned by the list - endpoint. + Create a new end-user account. The project is determined from the anon key. + Requires project-specific anon key in Authorization header. - Deliberately looser than the names you can create: a backup made by a - schedule is named for you, so reading or deleting one accepts any name a - backup can have. - BranchName: - name: branchName - in: path - required: true - schema: - type: string - pattern: ^[a-z0-9_]+$ - maxLength: 64 - description: Branch name (unique within the parent database, lowercase letters, numbers, and underscores only) - BucketName: - name: bucketName - in: path - required: true - schema: - type: string - pattern: ^[a-zA-Z0-9_-]+$ - minLength: 1 - maxLength: 64 - description: Storage bucket name - Cursor: - name: cursor - in: query - required: false - schema: - type: string + **Session-less**: signup never issues a session. On success it returns a + uniform acknowledgement (`AuthSignupResponse`) with no tokens; the client + obtains a session with a subsequent `POST /auth/signin`. If email confirmation + is enabled for the project, a confirmation email is sent and + `confirmation_required` is `true`. + + **Anti-enumeration**: a signup for an already-registered email returns the + exact same `201` response as a fresh signup — it never returns `409` — so the + response cannot be used to discover which emails are registered. + operationId: authSignup + security: + - AnonKey: [] + parameters: + - $ref: '#/components/parameters/AuthProxyAuthorization' + - $ref: '#/components/parameters/AuthProxyClientIP' + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - email + - password + properties: + email: + type: string + format: email + password: + type: string + description: | + Password validated after NFC normalization against the + policy returned by GET /auth/password-policy. + user_metadata: + type: object + additionalProperties: true + responses: + '201': + description: | + Signup acknowledged (session-less). Returned identically for a new + account and for an already-registered email (anti-enumeration). + content: + application/json: + schema: + $ref: '#/components/schemas/AuthSignupResponse' + '400': + description: Invalid input (bad email/password format) + '401': + description: | + Unauthorized - Invalid, tampered, revoked, or wrong-project anon key. + Also returned for invalid, repeated, or under-scoped auth proxy metadata + (`invalid auth proxy metadata`). + '403': + description: | + Forbidden - Signups disabled, anon key lacks signup permission, or the + email domain is not in `allowed_email_domains`. The internal + `anonymous.volcano.internal` and `volcano.local` domains are reserved + for anonymous accounts and for the debug accounts an earlier Builder + created (Volcano no longer creates them), and are refused whatever the + project allows. + '429': + description: Rate limit exceeded + '503': + description: Compromised-password screening is temporarily unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /auth/signin: + post: + tags: + - Authentication + summary: Sign in an auth user description: | - Opaque keyset pagination cursor from a previous response's `next_cursor` - — pages forward. Mutually exclusive with `page` and `ending_before`; - combining them returns 400. When supplied, the request's `search` and - `limit` must match the values bound to the cursor or the request returns 400. - EndingBefore: - name: ending_before - in: query - required: false - schema: - type: string + 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. + operationId: authSignin + security: + - AnonKey: [] + parameters: + - $ref: '#/components/parameters/AuthProxyAuthorization' + - $ref: '#/components/parameters/AuthProxyClientIP' + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - email + - password + properties: + email: + type: string + password: + type: string + session_mode: + type: string + enum: + - cookie + responses: + '200': + description: Signin successful + content: + application/json: + schema: + $ref: '#/components/schemas/AuthTokenResponse' + '400': + description: Invalid input (missing email/password) + '401': + description: | + Unauthorized - Invalid credentials, invalid/tampered/revoked anon key, + or account banned/deleted; or invalid auth proxy metadata + '403': + description: | + Forbidden - Email/password is turned off for the project + (`enable_email_password: false`), the anon key lacks signin + permission, or the email domain is not in `allowed_email_domains` + while `allowed_email_domains_mode` is `signup_and_signin`. Both the + account's canonical email (its primary identity) and the email signed + in with must be on the list. + '429': + description: Rate limit exceeded + /auth/refresh: + post: + tags: + - Authentication + summary: Refresh access token description: | - Opaque keyset pagination cursor from a previous response's `prev_cursor` - — pages backward (the page immediately preceding this cursor). Mutually - exclusive with `page` and `cursor`; combining them returns 400. `search` - and `limit` must match the values bound to the cursor or the request - returns 400. - DatabaseName: - name: databaseName - in: path - required: true - schema: - type: string - pattern: ^[a-z0-9_]+$ - maxLength: 64 - description: Database name (unique within project, lowercase letters, numbers, and underscores only) - DeploymentId: - name: deploymentId - in: path - required: true - schema: - type: string - format: uuid - description: Frontend deployment ID - VariableEnvironmentId: - name: environmentId - in: path - required: true - schema: - type: string - format: uuid - description: Variable Environment ID - FrontendId: - name: frontendId - in: path - required: true - schema: - type: string - format: uuid - description: Frontend ID - FrontendFunctionRouteId: - name: routeId - in: path - required: true - schema: - type: string - format: uuid - description: Frontend Function route ID - FunctionId: - name: functionId - in: path - required: true - schema: - type: string - format: uuid - description: Function ID - DurableFunctionId: - name: functionId - in: path - required: true - schema: - type: string - description: Durable function ID, or its name within the project - DurableExecutionId: - name: executionId - in: path - required: true - schema: - type: string - format: uuid - description: Durable execution ID - DurableApprovalId: - name: approvalId - in: path - required: true - schema: - type: string - format: uuid - description: Durable approval ID - IssueId: - name: issueId - in: path - required: true - schema: - type: string - format: uuid - description: Issue ID - IssueCursor: - name: cursor - in: query - required: false - schema: - type: string - description: | - Opaque cursor from a previous response's `next_cursor`. Pages forward; - keep the same filters while paging. - AutofixRunId: - name: runId - in: path - required: true - schema: - type: string - format: uuid - description: Autofix run ID - DurableApprovalFunctionFilter: - name: function - in: query - required: false - schema: - type: string - minLength: 1 - maxLength: 255 + Get a new access token using a refresh token. Requires an anon key. + + Send `refresh_token` in the body for the default flow. An eligible + cookie-mode browser request may instead send `session_mode: cookie` + with an empty token or omit the request body; the API reads and resets + the project's HttpOnly cookie and omits `refresh_token` from the + response. + operationId: authRefresh + security: + - AnonKey: [] + parameters: + - $ref: '#/components/parameters/AuthProxyAuthorization' + - $ref: '#/components/parameters/AuthProxyClientIP' + requestBody: + required: false + content: + application/json: + schema: + type: object + properties: + refresh_token: + type: string + session_mode: + type: string + enum: + - cookie + responses: + '200': + description: Token refreshed + content: + application/json: + schema: + $ref: '#/components/schemas/AuthTokenResponse' + '401': + description: Invalid or expired refresh token; or invalid auth proxy metadata + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: | + The account's canonical email, or the email of the identity the + session signed in with, is not in `allowed_email_domains` while + `allowed_email_domains_mode` is `signup_and_signin`, so the session + cannot be extended + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: Rate limit exceeded + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /auth/logout: + post: + tags: + - Authentication + summary: Logout (revoke refresh token) description: | - Only approvals requested by this durable function, given by id or by - name. A name also matches approvals from a deleted function of that - name. - DurableMessageIdempotencyKey: - name: Idempotency-Key - in: header - required: false + Invalidate a refresh token. Requires an anon key. + + Send `refresh_token` for the default flow. An eligible cookie-mode + browser request may instead send `session_mode: cookie` with an empty + token; logout remains idempotent when the cookie is missing or expired. + operationId: authLogout + security: + - AnonKey: [] + parameters: + - $ref: '#/components/parameters/AuthProxyAuthorization' + - $ref: '#/components/parameters/AuthProxyClientIP' + requestBody: + required: false + content: + application/json: + schema: + type: object + properties: + refresh_token: + type: string + session_mode: + type: string + enum: + - cookie + responses: + '204': + description: Logged out successfully + '401': + description: Missing, invalid, or revoked anon key; or invalid, repeated, or under-scoped auth proxy metadata + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /auth/forgot-password: + post: + tags: + - Authentication + summary: Request password reset description: | - Makes a send safe to retry. A repeat with a key the same sender has - used on the execution returns the first message and sends nothing. - Keys of different senders never collide. Up to 255 printable ASCII - characters. - schema: - type: string - minLength: 1 - maxLength: 255 - pattern: ^[ -~]+$ - DurableClientToken: - name: X-Volcano-Client-Token - in: header - required: false + Generates recovery token and stores it (email sending pending). + Returns generic message to prevent email enumeration. + Project is identified via the anon key. + operationId: authForgotPassword + security: + - AnonKey: [] + parameters: + - $ref: '#/components/parameters/AuthProxyAuthorization' + - $ref: '#/components/parameters/AuthProxyClientIP' + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - email + properties: + email: + type: string + format: email + responses: + '200': + description: Generic success message (doesn't reveal if email exists) + content: + application/json: + schema: + type: object + properties: + message: + type: string + example: If the email exists, a password reset link has been sent + '401': + description: Missing, invalid, or revoked anon key; or invalid, repeated, or under-scoped auth proxy metadata + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: Password reset or email/password is turned off for this project + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: Rate limit exceeded (10 requests per hour per IP) + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /auth/reset-password: + post: + tags: + - Authentication + summary: Reset password with recovery token description: | - The `client_token` the execution's start returned. Lets an anon key, - or a user who did not start the execution, reach it. - schema: - type: string - maxLength: 128 - DurableMessageDirectionFilter: - name: direction - in: query - required: false - description: Return only messages travelling this way. - schema: - $ref: '#/components/schemas/DurableMessageDirection' - DurableMessageNameFilter: - name: name - in: query - required: false - description: Return only messages with this name. - schema: - $ref: '#/components/schemas/DurableMessageName' - DurableMessageAfter: - name: after - in: query - required: false - description: Return only messages whose `seq` is greater than this. - schema: - type: integer - format: int64 - minimum: 0 - default: 0 - DurableMessageLimit: - name: limit - in: query - required: false - description: Most messages to return. - schema: - type: integer - minimum: 1 - maximum: 500 - default: 100 - Limit: - name: limit - in: query - required: false - schema: - type: integer - minimum: 1 - maximum: 100 - default: 10 - description: Number of items per page (max 100) - LockKey: - name: key - in: path - required: true - description: Project-local lock name. - schema: - type: string - minLength: 1 - maxLength: 128 - pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$ - LockToken: - name: X-Volcano-Lock-Token - in: header - required: true - description: Opaque UUID generated once by the caller and retained for the lease lifetime. - schema: - type: string - format: uuid - LockRequestId: - name: X-Volcano-Request-Id - in: header - required: true - description: | - UUID correlating this request across client and server logs. Repeat safety comes from - the lock token, so a retry under a reused request ID still counts against the quota. - schema: - type: string - format: uuid - DeploymentOperation: - name: operation - in: query - required: false - description: Restrict a deployment feed to one kind of operation. - schema: - type: string - enum: - - deploy - - redeploy - - update - - delete - DeploymentOwnerId: - name: owner_id - in: query - required: false - description: | - The user who owns the projects whose deployments to return - (`projects.user_id`). This is ownership, not the actor that started the - deployment — see `initiated_by_user_id` for that. Not a UUID: platform - user ids are opaque strings. - schema: - type: string - maxLength: 255 - DeploymentOrder: - name: order - in: query - required: false + Reset password using recovery token from forgot-password. + Revokes all existing sessions for security. + operationId: authResetPassword + security: + - AnonKey: [] + parameters: + - $ref: '#/components/parameters/AuthProxyAuthorization' + - $ref: '#/components/parameters/AuthProxyClientIP' + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - token + - new_password + properties: + token: + type: string + description: Recovery token from forgot-password + new_password: + type: string + description: | + Password validated after NFC normalization against the + policy returned by GET /auth/password-policy. + responses: + '200': + description: Password reset successful + content: + application/json: + schema: + type: object + properties: + message: + type: string + '400': + description: Password doesn't meet requirements + '401': + description: Invalid or expired token; or invalid auth proxy metadata + '403': + description: Password reset or email/password is turned off for this project + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '503': + description: Compromised-password screening is temporarily unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /auth/confirm: + post: + tags: + - Authentication + summary: Confirm email address description: | - Sort key and direction. `created_at.desc` (default) is the feed order. - `completed_at.asc` orders finished attempts by completion, oldest first, - and excludes attempts that never completed. - schema: - type: string - enum: - - created_at.desc - - completed_at.asc - default: created_at.desc - DeploymentResourceType: - name: resource_type - in: query - required: false + Confirm email address using token sent via email. + Required if require_email_confirmation is enabled. + operationId: authConfirmEmail + security: + - AnonKey: [] + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - token + properties: + token: + type: string + description: Confirmation token from email + responses: + '200': + description: Email confirmed or already confirmed + content: + application/json: + schema: + type: object + properties: + message: + type: string + enum: + - Email confirmed successfully + - Email already confirmed + examples: + confirmed: + summary: Fresh confirmation + value: + message: Email confirmed successfully + alreadyConfirmed: + summary: Token belongs to already-confirmed user + value: + message: Email already confirmed + '400': + description: Missing confirmation token in request body + '401': + description: Invalid or expired token + /auth/resend-confirmation: + post: + tags: + - Authentication + summary: Resend confirmation email description: | - Restrict a deployment feed to a single resource type. Omit to return - both Function and Frontend deployments. - schema: - type: string - enum: - - function - - frontend - FunctionKindFilter: - name: function_kind - in: query - required: false + Resend email confirmation link. + Returns generic message to prevent email enumeration. + No email is sent when the account does not exist or is already confirmed. + If the account exists and is unconfirmed, a new token is generated and + any previous confirmation token is invalidated. + operationId: authResendConfirmation + security: + - AnonKey: [] + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - email + properties: + email: + type: string + format: email + responses: + '200': + description: Generic success message + content: + application/json: + schema: + type: object + properties: + message: + type: string + '429': + description: Rate limit exceeded + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /auth/signup-anonymous: + post: + tags: + - Authentication + summary: Create anonymous user description: | - Restrict results to functions of one kind. Omit to include both - standard and durable functions. - schema: - $ref: '#/components/schemas/FunctionKindFilter' - DeploymentStatus: - name: status - in: query - required: false - description: Restrict a deployment feed to attempts in one status. - schema: - type: string - enum: - - queued - - provisioning - - active - - degraded - - failed - - superseded - - deleting - - deleted - Offset: - name: offset - in: query - required: false - schema: - type: integer - minimum: 0 - default: 0 - description: | - Bounded row offset past the keyset anchor named by `cursor` (forward) or - `ending_before` (backward) — the hybrid jump. Seek to the anchor, then - skip this many rows within. Used for numbered jump-to-page: from the - current page, seek to its next/prev cursor and offset the remaining - pages. Only honored on the cursor pagination path; ignored otherwise. - Page: - name: page - in: query - required: false - schema: - type: integer - minimum: 1 - description: | - 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. - ProjectId: - name: id - in: path - required: true - schema: - 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 - required: false - schema: - type: string - maxLength: 256 - description: | - Case-insensitive substring match on the resource `name`. See the - endpoint description for supported pagination modes. - RestoreId: - name: restoreId - in: path - required: true - schema: - type: string - format: uuid - description: Database restore ID - SchedulerId: - name: schedulerId - in: path - required: true - schema: - type: string - format: uuid - description: Function scheduler ID - VariableName: - name: name - in: path - required: true - schema: - type: string - minLength: 1 - maxLength: 256 - pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$ - description: Variable name. Function runtime names such as AWS_REGION are reserved and cannot be updated. - 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 - ingress + egress across owned projects). Enforcement is eventual: - requests are rejected until the allowance increases or the next - anniversary cycle begins. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - DatabaseQueryCapExceeded: - description: | - The query was rejected by a billing-cycle allowance: either the owning - platform user's bandwidth allowance (aggregate ingress + egress across - owned projects) or their database-request allowance. Enforcement is - eventual: queries are rejected until the allowance increases or the - next anniversary cycle begins. The error message identifies the resource. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - DatabaseBranchQueryUnavailable: - description: | - The branch exists but cannot serve queries: it is still provisioning, - being reset, expired, or its parent is being restored. Distinct from - `404` so a caller waiting on a branch can tell it apart from a typo. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - OpenAPISpecNotModified: + Create guest user without email/password. + + User metadata (like display_name) can be included and will appear in realtime presence events. + Requires enable_anonymous_signins to be true. + operationId: authSignupAnonymous + security: + - AnonKey: [] + parameters: + - $ref: '#/components/parameters/AuthProxyAuthorization' + - $ref: '#/components/parameters/AuthProxyClientIP' + requestBody: + description: Optional user metadata + content: + application/json: + schema: + type: object + properties: + user_metadata: + type: object + additionalProperties: true + description: Custom user metadata (e.g., display_name, avatar_url) + example: + display_name: Alice + avatar_url: https://example.com/alice.jpg + responses: + '201': + description: Anonymous user created + content: + application/json: + schema: + $ref: '#/components/schemas/AuthTokenResponse' + '401': + description: Missing, invalid, or revoked anon key; or invalid, repeated, or under-scoped auth proxy metadata + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: Anonymous signins disabled + /auth/user/convert-anonymous: + post: + tags: + - Authentication + summary: Convert anonymous user to authenticated description: | - The specification still matches the supplied `If-None-Match`, so no body - is returned. - headers: - ETag: - $ref: '#/components/headers/ETag' - OpenAPISpecHeaders: + Add email and password to anonymous user. + Requires auth user access token. + If require_email_confirmation is enabled for the project, the converted + user remains unconfirmed until /auth/confirm succeeds. When email + sending is enabled, a confirmation email is sent during conversion. + operationId: authConvertAnonymous + security: + - AuthUserAccessToken: [] + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - email + - password + properties: + email: + type: string + format: email + password: + type: string + description: | + Password validated after NFC normalization against the + policy returned by GET /auth/password-policy. + user_metadata: + type: object + additionalProperties: true + responses: + '200': + description: User converted successfully + content: + application/json: + schema: + type: object + properties: + user: + $ref: '#/components/schemas/AuthUser' + '400': + description: Not an anonymous user + '403': + description: | + The chosen email domain is not in `allowed_email_domains`, or is + reserved (`anonymous.volcano.internal`, `volcano.local`) + '409': + description: Email already in use + '503': + description: Compromised-password screening is temporarily unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /auth/user/change-email: + post: + tags: + - Authentication + summary: Request email change 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: - SandboxPreset: + Request to change user's email address. + Sends confirmation token to new email address. + operationId: authRequestEmailChange + security: + - AuthUserAccessToken: [] + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - new_email + properties: + new_email: + type: string + format: email + responses: + '200': + description: Confirmation email sent + content: + application/json: + schema: + type: object + properties: + message: + type: string + new_email: + type: string + '400': + description: Invalid email format or same as current email + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Not authenticated + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: | + The requested email domain is not in `allowed_email_domains`, or is + reserved (`anonymous.volcano.internal`, `volcano.local`) + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '409': + description: Email already in use + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: Rate limit exceeded (10 requests per hour per IP) + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /auth/user/confirm-email-change: + post: + tags: + - Authentication + summary: Confirm email change + description: Confirm email change with token sent to new address + operationId: authConfirmEmailChange + security: + - AuthUserAccessToken: [] + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - email_change_token + properties: + email_change_token: + type: string + responses: + '200': + description: Email changed successfully + content: + application/json: + schema: + type: object + properties: + message: + type: string + user: + $ref: '#/components/schemas/AuthUser' + '400': + description: Invalid or expired token, or no pending email change + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Not authenticated + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: | + The pending email domain is no longer in `allowed_email_domains`. + Re-checked here because the allowlist can narrow between the request + and the confirmation. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '409': + description: Email is now in use by another user + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /auth/user/cancel-email-change: + delete: + tags: + - Authentication + summary: Cancel pending email change + operationId: authCancelEmailChange + security: + - AuthUserAccessToken: [] + responses: + '200': + description: Email change cancelled + content: + application/json: + schema: + type: object + properties: + message: + type: string + '401': + description: Not authenticated + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /auth/user/sessions: + get: + tags: + - Authentication + summary: Get current user's sessions + description: | + Returns paginated sessions for the currently authenticated user. + Each session includes device info, IP addresses, and activity timestamps. + The current session is marked with `is_current: true`. + + **Ordering and pagination.** Without `sort`, results are ordered by most + recent activity and paged with `page`/`limit`, returning the + `sessions`/`total`/`page`/`limit`/`total_pages` body below. This is the + legacy default and is preserved for existing clients. + + Send `sort=created_at` to opt into the standard list contract: results are + ordered by session start (newest first) and may be paged either with + `page`/`limit` or by cursor with `cursor`/`ending_before` plus a bounded + `offset` past the cursor anchor. Cursor responses use the shared + `data` envelope with `next_cursor`/`prev_cursor`. + + Unlike other list endpoints, sending `limit` without `page` does **not** + select cursor mode here; `sort=created_at` is the only opt-in. Cursor + pagination is rejected with 400 for the activity order, because + `last_activity_at` changes whenever a session refreshes its token: a row + that crosses the cursor anchor between two requests would be skipped and + never shown. The `status=expired` filter is also offset-only because a + session can expire above the cursor anchor during a walk. Sending that + filter in cursor mode, `page` with `cursor` or `ending_before`, or both + cursor directions returns 400. + operationId: authGetMySessions + security: + - AuthUserAccessToken: [] + parameters: + - name: page + in: query + description: Page number (1-indexed) + schema: + type: integer + minimum: 1 + default: 1 + - name: limit + in: query + description: Number of sessions per page (max 100) + schema: + type: integer + minimum: 1 + maximum: 100 + default: 20 + - name: sort + in: query + description: | + Sort key. `last_activity` (default) orders by most recent activity and + supports offset pagination only. `created_at` orders by session start + and supports both offset and cursor pagination. + schema: + type: string + enum: + - last_activity + - created_at + default: last_activity + - name: status + in: query + description: | + Filter by whether the session can still be refreshed. Omit for every + stored session, including expired ones. `expired` is not supported + with cursor pagination. + schema: + type: string + enum: + - active + - expired + - name: cursor + in: query + description: | + Opaque keyset cursor from a previous response's `next_cursor`. Requires + `sort=created_at`; mutually exclusive with `page` and `ending_before`. + schema: + type: string + - name: ending_before + in: query + description: | + Opaque keyset cursor from a previous response's `prev_cursor`, paging + backward. Requires `sort=created_at`; mutually exclusive with `page` + and `cursor`. + schema: + type: string + - name: offset + in: query + description: | + Bounded number of rows to skip past the cursor anchor (the hybrid + jump, maximum 100000). Ignored unless `cursor` or `ending_before` is + supplied. + schema: + type: integer + minimum: 0 + maximum: 100000 + responses: + '200': + description: Paginated list of user sessions + content: + application/json: + schema: + type: object + properties: + sessions: + type: array + items: + $ref: '#/components/schemas/AuthSession' + total: + type: integer + description: Total number of sessions + page: + type: integer + description: Current page number + limit: + type: integer + description: Number of sessions per page + total_pages: + type: integer + description: Total number of pages + data: + type: array + description: Sessions for this page (cursor pagination only) + items: + $ref: '#/components/schemas/AuthSession' + has_more: + type: boolean + description: Whether a further page exists (cursor pagination only) + next_cursor: + type: string + description: Opaque cursor for the next page (cursor pagination only) + prev_cursor: + type: string + description: Opaque cursor for the previous page (cursor pagination only). Send as `ending_before`. + '400': + description: Invalid or conflicting pagination parameters + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Not authenticated + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + delete: + tags: + - Authentication + summary: Sign out from all other devices + description: | + Deletes all sessions except the current one. + Use this to log out from all other devices while keeping the current session active. + operationId: authDeleteAllMySessions + security: + - AuthUserAccessToken: [] + responses: + '204': + description: All other sessions deleted + '401': + description: Not authenticated + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /auth/user/sessions/{sessionId}: + delete: + tags: + - Authentication + summary: Sign out from specific device + description: | + Deletes a specific session, logging out that device. + You can get session IDs from the list sessions endpoint. + operationId: authDeleteMySession + security: + - AuthUserAccessToken: [] + parameters: + - name: sessionId + in: path + required: true + description: The session ID to delete + schema: + type: string + format: uuid + responses: + '204': + description: Session deleted + '401': + description: Not authenticated + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Session not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /auth/user: + get: + tags: + - Authentication + summary: Get current user profile + description: Returns authenticated user's profile. Requires access token. + operationId: authGetUser + security: + - AuthUserAccessToken: [] + responses: + '200': + description: User profile + content: + application/json: + schema: + type: object + properties: + user: + $ref: '#/components/schemas/AuthUser' + '401': + description: Not authenticated - access token missing or invalid + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + put: + tags: + - Authentication + summary: Update user profile + description: Update password or metadata. Requires access token. + operationId: authUpdateUser + security: + - AuthUserAccessToken: [] + requestBody: + content: + application/json: + schema: + type: object + properties: + password: + type: string + description: | + Password validated after NFC normalization against the + policy returned by GET /auth/password-policy. + user_metadata: + type: object + additionalProperties: true + description: | + Metadata keys to merge into the current user metadata. + Omitted keys remain unchanged; set a key to null to remove it. + Merging is shallow; nested objects replace the stored value for that top-level key. + responses: + '200': + description: Profile updated + content: + application/json: + schema: + type: object + properties: + user: + $ref: '#/components/schemas/AuthUser' + '400': + description: Bad request - invalid password or metadata format + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Not authenticated - access token missing or invalid + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: The request sent a non-empty `password` while email/password is turned off for the project; nothing is updated + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '503': + description: Compromised-password screening is temporarily unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /auth/user/identities: + get: + tags: + - Authentication + summary: List the current user's identities + description: | + Returns every real email identity the account owns. An account can own + multiple identities (for example a password identity plus one or more + OAuth identities on different emails). Anonymous accounts have no real + identity and return an empty list. + operationId: authListIdentities + security: + - AuthUserAccessToken: [] + responses: + '200': + description: List of identities + content: + application/json: + schema: + $ref: '#/components/schemas/AuthIdentitiesResponse' + '401': + description: Not authenticated + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /auth/user/identities/{identityId}: + delete: + tags: + - Authentication + summary: Unlink an identity from the current user + description: | + Removes a non-primary identity and its attached sign-in methods. Refused + when the identity is the account's primary, its only identity, or when + removing it would leave the account with no way to sign in. + operationId: authUnlinkIdentity + security: + - AuthUserAccessToken: [] + parameters: + - name: identityId + in: path + required: true + description: The identity ID to unlink + schema: + type: string + format: uuid + responses: + '204': + description: Identity unlinked + '400': + description: Identity cannot be unlinked (primary, last, or would remove last sign-in method), or the identity id is malformed + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Not authenticated + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Identity not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /auth/user/methods: + get: + tags: + - Authentication + summary: List the current user's sign-in methods + description: | + Returns a flat list of every sign-in method the account owns (password, + each OAuth provider, and any active anonymous method), with the primary + method flagged. Password stubs and converted anonymous methods are excluded. + operationId: authListMethods + security: + - AuthUserAccessToken: [] + responses: + '200': + description: List of sign-in methods + content: + application/json: + schema: + $ref: '#/components/schemas/AuthMethodsResponse' + '401': + description: Not authenticated + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /auth/user/methods/{methodId}/promote: + post: + tags: + - Authentication + summary: Set a method as the account's primary + description: | + Promotes the given method to the account's primary sign-in method. The + account's canonical email is re-derived from the promoted method's identity. + Refused for password stubs and converted anonymous methods, and for an + identity whose domain is outside the project's `allowed_email_domains`. + operationId: authPromoteMethod + security: + - AuthUserAccessToken: [] + parameters: + - name: methodId + in: path + required: true + description: The method ID to promote + schema: + type: string + format: uuid + responses: + '200': + description: The promoted method + content: + application/json: + schema: + $ref: '#/components/schemas/AuthMethodSummary' + '400': + description: This method cannot be set as primary (password stub, converted anonymous method, or unverified email), or the method id is malformed + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Not authenticated + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: The promoted identity's email domain is not in the project's allowed_email_domains, or is reserved (`anonymous.volcano.internal`, `volcano.local`) + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Method not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /projects/{id}/auth/insights: + get: + tags: + - Auth Admin + summary: Get auth user insights + description: | + Returns current and deleted auth-user totals, rolling 24-hour and 30-day + active users, and zero-filled daily activity and account-retention counts + for an inclusive UTC date range. Weeks start on Monday. + The existing deletions series counts accounts by deletion date; net_growth + remains signups minus deletions and is not affected by bans. + The banned_users, deleted_users, and available_users fields describe the + current state of users registered in each bucket. Banned users exclude + deleted users and expired bans. Available users are signups minus + banned_users minus deleted_users. Unban and expiry restore availability in + the original signup bucket. These current-state cohorts can change after + the requested dates have passed, without rewriting activity counts. + Sign-in counts remain grouped by session creation date. Deleted users + contribute to active counts until their last activity leaves the rolling + window. Token refreshes affect active users but not the sign-in series. + Signup history is backfilled from accounts present when collection was + deployed. Accounts hard-deleted before deletion-history collection cannot + be recovered. Current bans require no separate event-history collection. + operationId: getAuthInsights + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - name: from + in: query + description: Inclusive UTC start date. Defaults to 29 days before `to`. + schema: + type: string + format: date + - name: to + in: query + description: Inclusive UTC end date. Defaults to today. + schema: + type: string + format: date + - name: interval + in: query + description: Chart bucket size. Defaults to `day`. + schema: + $ref: '#/components/schemas/AuthInsightsInterval' + responses: + '200': + description: Auth insights retrieved + content: + application/json: + schema: + $ref: '#/components/schemas/AuthInsightsResponse' + example: + project_id: 4f165080-a931-4e03-b3bd-41c45c3f0058 + observed_at: '2026-07-20T18:00:00Z' + window: + from: '2026-06-21' + to: '2026-07-20' + interval: day + summary: + total_users: 1234 + deleted_users: 42 + active_users_1d: 83 + active_users_30d: 418 + series: + - bucket_start: '2026-07-20' + signups: 12 + signins: 97 + deletions: 3 + banned_users: 2 + deleted_users: 3 + available_users: 7 + net_growth: 9 + is_partial: true + '400': + description: Invalid date range or interval + 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: Access denied + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Project not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: Internal server error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /projects/{id}/auth/users: + get: + tags: + - Auth Admin + summary: List all auth users (admin) + description: List auth users in project. Requires platform token. + operationId: listAuthUsers + 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' + - name: status + in: query + required: false + description: Filter by effective status. `banned` returns only currently-banned users; an expired temporary ban lists as `active`. + schema: + type: string + enum: + - active + - banned + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedAuthUsers' + '400': + description: Invalid status or pagination parameters + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /projects/{id}/auth/users/{userId}: + get: + tags: + - Auth Admin + summary: Get specific auth user (admin) + operationId: getAuthUser + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - name: userId + in: path + required: true + schema: + type: string + format: uuid + responses: + '200': + description: Auth user details + content: + application/json: + schema: + $ref: '#/components/schemas/AuthUser' + delete: + tags: + - Auth Admin + summary: Delete auth user (admin) + description: Soft-deletes user and revokes all sessions + operationId: deleteAuthUser + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - name: userId + in: path + required: true + schema: + type: string + format: uuid + responses: + '204': + description: User deleted + /projects/{id}/auth/users/{userId}/sessions: + get: + tags: + - Auth Admin + summary: List user sessions + description: | + List paginated sessions for a specific auth user. + Returns session details including device info, IP address, and activity timestamps. + + Ordering and pagination match `GET /auth/user/sessions`: the default is + activity order with `page`/`limit` and the legacy `sessions` body, and + `sort=created_at` opts into the standard cursor/offset hybrid with the + shared `data` envelope. Cursor pagination is only available for + `sort=created_at`, because the activity timestamp changes under paging. + The `status=expired` filter is offset-only because sessions can expire + above a cursor anchor during a walk. + operationId: listUserSessions + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - name: userId + in: path + required: true + schema: + type: string + format: uuid + - name: page + in: query + description: Page number (1-indexed) + schema: + type: integer + minimum: 1 + default: 1 + - name: limit + in: query + description: Number of sessions per page (max 100) + schema: + type: integer + minimum: 1 + maximum: 100 + default: 20 + - name: sort + in: query + description: | + Sort key. `last_activity` (default) orders by most recent activity and + supports offset pagination only. `created_at` orders by session start + and supports both offset and cursor pagination. + schema: + type: string + enum: + - last_activity + - created_at + default: last_activity + - name: status + in: query + description: | + Filter by whether the session can still be refreshed. Omit for every + stored session, including expired ones. `expired` is not supported + with cursor pagination. + schema: + type: string + enum: + - active + - expired + - name: cursor + in: query + description: | + Opaque keyset cursor from a previous response's `next_cursor`. Requires + `sort=created_at`; mutually exclusive with `page` and `ending_before`. + schema: + type: string + - name: ending_before + in: query + description: | + Opaque keyset cursor from a previous response's `prev_cursor`, paging + backward. Requires `sort=created_at`; mutually exclusive with `page` + and `cursor`. + schema: + type: string + - name: offset + in: query + description: | + Bounded number of rows to skip past the cursor anchor (the hybrid + jump, maximum 100000). Ignored unless `cursor` or `ending_before` is + supplied. + schema: + type: integer + minimum: 0 + maximum: 100000 + responses: + '200': + description: Paginated list of user sessions + content: + application/json: + schema: + type: object + properties: + sessions: + type: array + items: + $ref: '#/components/schemas/AuthSession' + total: + type: integer + description: Total number of sessions + page: + type: integer + description: Current page number + limit: + type: integer + description: Number of sessions per page + total_pages: + type: integer + description: Total number of pages + data: + type: array + description: Sessions for this page (cursor pagination only) + items: + $ref: '#/components/schemas/AuthSession' + has_more: + type: boolean + description: Whether a further page exists (cursor pagination only) + next_cursor: + type: string + description: Opaque cursor for the next page (cursor pagination only) + prev_cursor: + type: string + description: Opaque cursor for the previous page (cursor pagination only). Send as `ending_before`. + '400': + description: Invalid or conflicting pagination parameters + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: User not found + delete: + tags: + - Auth Admin + summary: Delete all user sessions + description: | + Revokes all sessions for a user, forcing them to re-authenticate on all devices. + Use this to log out a user from everywhere. + operationId: deleteAllUserSessions + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - name: userId + in: path + required: true + schema: + type: string + format: uuid + responses: + '204': + description: All sessions deleted + '404': + description: User not found + /projects/{id}/auth/users/{userId}/sessions/{sessionId}: + delete: + tags: + - Auth Admin + summary: Delete specific session + description: | + Revokes a specific session for a user. + Use this to log out a user from a single device. + operationId: deleteUserSession + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - name: userId + in: path + required: true + schema: + type: string + format: uuid + - name: sessionId + in: path + required: true + schema: + type: string + format: uuid + responses: + '204': + description: Session deleted + '404': + description: Session or user not found + /projects/{id}/auth/users/{userId}/ban: + post: + tags: + - Auth Admin + summary: Ban a user + description: | + Bans a user temporarily or permanently. Banned users cannot sign in + and all their active sessions are immediately revoked. + Omitting banned_until clears any previous expiry. Deleted accounts cannot be banned. + + - Omit `banned_until` for a permanent ban + - Provide `banned_until` ISO timestamp for a temporary ban + operationId: banAuthUser + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - name: userId + in: path + required: true + schema: + type: string + format: uuid + requestBody: + content: + application/json: + schema: + type: object + properties: + banned_until: + type: string + format: date-time + description: When the ban expires (omit for permanent ban) + example: '2026-12-31T23:59:59Z' + responses: + '200': + description: User banned successfully + content: + application/json: + schema: + $ref: '#/components/schemas/BanUserResponse' + '404': + description: User not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '409': + description: Deleted accounts cannot be banned or restored + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /projects/{id}/auth/users/{userId}/unban: + post: + tags: + - Auth Admin + summary: Unban a user + description: | + Removes a ban from a user, restoring their ability to sign in. + The user's status is set back to 'active'. Deleted accounts cannot be restored. + operationId: unbanAuthUser + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - name: userId + in: path + required: true + schema: + type: string + format: uuid + responses: + '200': + description: User unbanned successfully + content: + application/json: + schema: + $ref: '#/components/schemas/UnbanUserResponse' + '404': + description: User not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '409': + description: Deleted accounts cannot be banned or restored + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /projects/{id}/email-templates: + get: + tags: + - Auth Configuration + summary: List email templates + description: Returns all custom email templates for this project. + operationId: listEmailTemplates + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + responses: + '200': + description: Email templates list + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/EmailTemplate' + post: + tags: + - Auth Configuration + summary: Create email template + description: | + Creates a custom email template for the project. Custom email templates + are a SUPERAGENT feature: requests from a HOBBY project owner are + rejected with 403, and HOBBY projects always send the built-in default + templates regardless of any previously saved custom rows. + Every project is created with one template per type, so customizing one + is usually a PUT; creating a type the project already has returns 409. + Valid template types: welcome, confirmation, password_reset, password_changed + operationId: createEmailTemplate + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateEmailTemplateRequest' + responses: + '201': + description: Template created + content: + application/json: + schema: + $ref: '#/components/schemas/EmailTemplate' + '400': + description: Invalid template type or subject containing a literal interior carriage return or newline + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: Custom email templates require the SUPERAGENT plan + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '409': + description: The project already has a template of this type + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /projects/{id}/email-templates/{type}: + get: + tags: + - Auth Configuration + summary: Get email template + operationId: getEmailTemplate + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - name: type + in: path + required: true + schema: + type: string + enum: + - welcome + - confirmation + - password_reset + - password_changed + responses: + '200': + description: Email template + content: + application/json: + schema: + $ref: '#/components/schemas/EmailTemplate' + '404': + description: Template not found + put: + tags: + - Auth Configuration + summary: Update email template + description: | + Updates a custom email template. Custom email templates are a SUPERAGENT + feature: requests from a HOBBY project owner are rejected with 403 + (including after a downgrade), so a HOBBY project cannot modify + templates and always sends the built-in defaults. + operationId: updateEmailTemplate + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - name: type + in: path + required: true + schema: + type: string + enum: + - welcome + - confirmation + - password_reset + - password_changed + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateEmailTemplateRequest' + responses: + '200': + description: Template updated + content: + application/json: + schema: + $ref: '#/components/schemas/EmailTemplate' + '400': + description: Subject contains a literal interior carriage return or newline + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: Custom email templates require the SUPERAGENT plan + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Template not found + delete: + tags: + - Auth Configuration + summary: Delete email template + description: | + Deletes a custom template, reverting to the default. Custom email + templates are a SUPERAGENT feature: requests from a HOBBY project owner + are rejected with 403. + operationId: deleteEmailTemplate + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - name: type + in: path + required: true + schema: + type: string + enum: + - welcome + - confirmation + - password_reset + - password_changed + responses: + '204': + description: Template deleted + '403': + description: Custom email templates require the SUPERAGENT plan + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Template not found + /email-templates/defaults: + get: + tags: + - Auth Configuration + summary: Get default email templates + description: Returns the default email templates used when no custom template is configured. + operationId: getDefaultEmailTemplates + responses: + '200': + description: Default templates + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/DefaultEmailTemplate' + /email-templates/defaults/{type}: + get: + tags: + - Auth Configuration + summary: Get default email template by type + operationId: getDefaultEmailTemplate + parameters: + - name: type + in: path + required: true + schema: + type: string + enum: + - welcome + - confirmation + - password_reset + - password_changed + responses: + '200': + description: Default template + content: + application/json: + schema: + $ref: '#/components/schemas/DefaultEmailTemplate' + '404': + description: Template type not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /projects/{id}/auth/config: + get: + tags: + - Auth Configuration + summary: Get auth configuration + operationId: getAuthConfig + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + responses: + '200': + description: Auth configuration + content: + application/json: + schema: + $ref: '#/components/schemas/AuthConfig' + put: + tags: + - Auth Configuration + summary: Update auth configuration + description: | + Updates the project's auth configuration. Only the fields present in + the body are changed. + operationId: updateAuthConfig + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateAuthConfigRequest' + responses: + '200': + description: Configuration updated + content: + application/json: + schema: + $ref: '#/components/schemas/AuthConfig' + '400': + description: Invalid auth configuration, including a subject with a literal interior carriage return or newline + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: | + The update would turn on, widen, or otherwise edit the email domain + allowlist (`allowed_email_domains`, `allowed_email_domains_mode`) + for a project that is not on the SUPERAGENT plan. A HOBBY project keeps + whatever allowlist it already has — parked, enforcing nothing until + it upgrades — and may still remove it, so a downgrade never leaves a + project locked out of its own signups. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /projects/{id}/auth/config/test-email: + post: + tags: + - Auth Configuration + summary: Send a test email using the project's saved SMTP config + description: | + Sends a diagnostic email to `to_email` using the project's + persisted `auth_config` SMTP credentials. If `html_body` or + `text_body` is supplied, the override path is taken: those + values (plus optional `subject`) are rendered through + html/text templates against the project's `Data` and + used as the body — used by the template editor's "Send Test" + affordance to preview an unsaved template. With both bodies + omitted, a hardcoded diagnostic message is sent and any + `subject` field is ignored. Sending `subject` alone (no + bodies) is rejected with 400 to avoid a silently-dropped + subject or a blank message. Also rejects with 400 if + `email_enabled=false`, `smtp_host` is empty, or the saved + `smtp_password` can't be read and must be set again. + Sender values with interior line breaks return 400 before SMTP delivery. + Rendered override subjects containing a line break have outer whitespace + trimmed; any remaining interior line break returns 400 before delivery. + Outside local mode, the email is sent only to a public `smtp_host`. + When the host is, or resolves to, a non-public address, or the server + cannot be reached or closes the connection before its greeting, the + 502 carries a fixed message that does not include the network error. + In local mode, the 502 includes the network error. + Replies from the SMTP server itself, such as a refused greeting, + rejected credentials, or a rejected recipient, are included in the 502. + operationId: testEmailConfig + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TestEmailRequest' + responses: + '200': + description: Test email sent + content: + application/json: + schema: + $ref: '#/components/schemas/TestEmailResponse' + '400': + description: Invalid request, unsafe email headers, or email delivery not configured + '401': + description: Unauthorized + '403': + description: Forbidden + '404': + description: Project not found + '502': + description: Template render failure, an unreachable or non-public SMTP host, or the SMTP server refused the email + /projects/{id}/auth/hosted-pages/{pageType}: + get: + tags: + - Auth Configuration + summary: Get hosted auth page + description: | + Returns the saved HTML/CSS for the page type, or `page: null` when the + project has not customized it yet. Always returns `defaults` (the theme + shell to seed an editor with, which is valid input to the update endpoint) + and `runtime` (the script the rendered page runs, plus a preview harness). + operationId: getAuthHostedPage + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - name: pageType + in: path + required: true + schema: + $ref: '#/components/schemas/HostedAuthPageType' + responses: + '200': + description: Hosted page loaded + content: + application/json: + schema: + $ref: '#/components/schemas/AuthHostedPageResponse' + put: + tags: + - Auth Configuration + summary: Update hosted auth page + description: | + Saves the current HTML/CSS for this page type. + Security validation rejects script tags, javascript: URLs, inline event handlers, iframe/object/embed/meta/link tags in HTML, + and closing style/head tags in CSS. + operationId: updateAuthHostedPage + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - name: pageType + in: path + required: true + schema: + $ref: '#/components/schemas/HostedAuthPageType' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateAuthHostedPageRequest' + responses: + '200': + description: Hosted page updated + content: + application/json: + schema: + $ref: '#/components/schemas/AuthHostedPageResponse' + '400': + description: Invalid input or unsafe markup + '401': + description: Unauthorized + '403': + description: Forbidden + '404': + description: Project not found + /projects/{id}/auth/pages/appearance: + get: + tags: + - Auth Configuration + summary: Get managed auth page appearance + operationId: getAuthPageAppearance + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + responses: + '200': + description: Saved appearance and effective plan state + content: + application/json: + schema: + $ref: '#/components/schemas/AuthPageAppearanceResponse' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: Access denied + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Project not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: Appearance could not be read + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /projects/{id}/auth/pages/theme: + put: + tags: + - Auth Configuration + summary: Save the managed auth page theme + operationId: updateAuthPageTheme + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateAuthPageThemeRequest' + responses: + '200': + description: Theme saved + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateAuthPageThemeRequest' + '400': + description: Invalid or unreadable theme + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: Plan does not permit customisation + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Project not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: Theme could not be saved + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + delete: + tags: + - Auth Configuration + summary: Clear the managed auth page theme + operationId: deleteAuthPageTheme + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + responses: + '204': + description: Theme cleared + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: Plan does not permit customisation + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Project not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: Theme could not be cleared + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /projects/{id}/auth/pages/{pageType}/layout: + parameters: + - $ref: '#/components/parameters/ProjectId' + - name: pageType + in: path + required: true + schema: + $ref: '#/components/schemas/HostedAuthPageType' + put: + tags: + - Auth Configuration + summary: Save one managed auth page layout + operationId: updateAuthPageLayout + security: + - UserToken: [] + - ProjectAccessToken: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateAuthPageLayoutRequest' + responses: + '200': + description: Layout saved + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateAuthPageLayoutRequest' + '400': + description: Invalid page type or layout + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: Plan does not permit customisation + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Project not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: Layout could not be saved + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + delete: + tags: + - Auth Configuration + summary: Clear one managed auth page layout + operationId: deleteAuthPageLayout + security: + - UserToken: [] + - ProjectAccessToken: [] + responses: + '204': + description: Layout cleared + '400': + description: Invalid page type + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: Plan does not permit customisation + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Project not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: Layout could not be cleared + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /projects/{id}/auth/pages/{pageType}/preview: + get: + tags: + - Auth Configuration + summary: Render a short-lived managed auth page preview + description: | + Public HTML endpoint for a preview URL returned by the POST operation. + The signed ticket contains the unsaved appearance, expires shortly, and + runs the production page runtime against mocked authentication responses. + operationId: renderAuthPagePreview + security: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - name: pageType + in: path + required: true + schema: + $ref: '#/components/schemas/HostedAuthPageType' + - name: ticket + in: query + required: true + schema: + type: string + minLength: 1 + maxLength: 4096 + description: Short-lived signed preview ticket returned by the POST operation. + responses: + '200': + description: Rendered preview document + content: + text/html: + schema: + type: string + '404': + description: Ticket is invalid or expired, its path does not match, or managed authentication is disabled + content: + text/plain: + schema: + type: string + '500': + description: Preview could not be rendered + content: + text/plain: + schema: + type: string + post: + tags: + - Auth Configuration + summary: Preview an unsaved managed auth page appearance + operationId: previewAuthPage + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - name: pageType + in: path + required: true + schema: + $ref: '#/components/schemas/HostedAuthPageType' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PreviewAuthPageRequest' + responses: + '200': + description: Short-lived URL for the rendered preview document + content: + application/json: + schema: + $ref: '#/components/schemas/PreviewAuthPageResponse' + '400': + description: Invalid page type or draft + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: Access denied + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Project not found or managed authentication is disabled + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: Preview could not be rendered + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /projects/{id}/auth/hosted/{pageType}: + get: + tags: + - Auth Configuration + summary: Render a managed auth page + description: | + Public HTML endpoint for signup, forgot-password, device approval, + verify-email, and reset-password pages. Login uses the path without a + page type. + Requires `Accept: text/html`. + Returns 404 when managed hosted pages are disabled for the project. + security: [] + operationId: renderManagedAuthPage + parameters: + - $ref: '#/components/parameters/ProjectId' + - name: pageType + in: path + required: true + schema: + $ref: '#/components/schemas/HostedRenderablePageType' + responses: + '200': + description: Hosted auth page HTML + content: + text/html: + schema: + type: string + '400': + description: Invalid project id or unsupported Accept header + '404': + description: Managed pages disabled or page type not found + /projects/{id}/auth/hosted: + get: + tags: + - Auth Configuration + summary: Render default managed auth page + description: | + Public HTML endpoint for the managed login page. + Requires `Accept: text/html`. + security: [] + operationId: renderDefaultManagedAuthPage + parameters: + - $ref: '#/components/parameters/ProjectId' + - name: action + in: query + required: false + schema: + type: string + enum: + - login + - signup + - forgot-password + - device + description: | + Optional deep-link action for the unified hosted page. Ignored when a + custom login page is configured. `action=device` renders the device + authorization approval UI inline (no redirect to any external app); + it signs the user in and calls `POST /auth/device/verify`. + - name: user_code + in: query + required: false + schema: + type: string + description: Device user code (from `POST /auth/device/authorize`) used with `action=device`. + - name: anon_key + in: query + required: false + schema: + type: string + description: Project anon key used by built-in managed auth flows (required for login/signup/device actions). + - name: state + in: query + required: false + schema: + type: string + description: | + Opaque one-time nonce generated by the client SDK before redirecting + here. On successful login/signup it is echoed back in the post-auth + redirect fragment as `state`, so the SDK can bind the returned session + to the flow it initiated (login-CSRF / session-fixation defense). The + SDK rejects a returned session whose `state` does not match. + responses: + '200': + description: Hosted auth page HTML + content: + text/html: + schema: + type: string + '400': + description: Invalid project id or unsupported Accept header + '404': + description: Managed pages disabled + /projects/{id}/auth/hosted/login/options: + get: + tags: + - Auth Configuration + summary: Get hosted login runtime options + description: | + Returns runtime options for the built-in managed login flow. + Requires `anon_key` query parameter. + Rate limited per project and client IP. Excess requests return `429` and `Retry-After`. + security: [] + operationId: getHostedLoginOptions + parameters: + - $ref: '#/components/parameters/ProjectId' + - name: anon_key + in: query + required: true + schema: + type: string + responses: + '200': + description: Hosted login options returned + content: + application/json: + schema: + $ref: '#/components/schemas/HostedLoginOptionsResponse' + '401': + description: Invalid or missing anon key + '404': + description: Managed pages disabled + '429': + description: Rate limit exceeded + /projects/{id}/auth/hosted/login/check-email: + post: + tags: + - Auth Configuration + summary: Check whether email exists for hosted login flow + description: | + Used by the built-in managed login page to branch UI between signin and signup. + Requires anon key in Authorization header. + Rate limited per project and client IP. Excess requests return `429` and `Retry-After`. + security: [] + operationId: hostedLoginCheckEmail + parameters: + - $ref: '#/components/parameters/ProjectId' + - name: Authorization + in: header + required: true + schema: + type: string + description: Bearer anon key (`Bearer `) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/HostedLoginEmailCheckRequest' + responses: + '200': + description: Email existence evaluated + content: + application/json: + schema: + $ref: '#/components/schemas/HostedLoginEmailCheckResponse' + '401': + description: Invalid or missing anon key + '429': + description: Rate limit exceeded + /projects/{id}/auth/methods: + get: + tags: + - Auth Configuration + summary: Get all authentication methods + description: | + Returns all configured authentication methods for this project, + including email/password, anonymous, device authorization, and OAuth providers. + operationId: getAuthMethods + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + responses: + '200': + description: Authentication methods configuration + content: + application/json: + schema: + type: object + properties: + email_password: + type: object + properties: + enabled: + type: boolean + method: + type: string + name: + type: string + anonymous: + type: object + properties: + enabled: + type: boolean + method: + type: string + name: + type: string + oauth_providers: + type: array + items: + type: object + properties: + enabled: + type: boolean + method: + type: string + provider: + type: string + name: + type: string + redirect_url: + type: string + scopes: + type: array + items: + type: string + available_methods: + type: array + items: + type: string + example: + - email_password + - oauth_google + - oauth_github + put: + tags: + - Auth Configuration + summary: Configure authentication methods (unified) + description: | + Configure all authentication methods in a single request. + At least one method must remain enabled. + operationId: configureAuthMethods + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + requestBody: + content: + application/json: + schema: + type: object + properties: + enable_email_password: + type: boolean + enable_anonymous: + type: boolean + oauth_providers: + type: array + items: + type: object + properties: + provider: + type: string + enabled: + type: boolean + responses: + '200': + description: Methods configured + '400': + description: At least one method must be enabled + /projects/{id}/oauth/configs: + get: + tags: + - OAuth Configuration + summary: List OAuth configurations + description: List all OAuth provider configurations for this project + operationId: listOAuthConfigs + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + responses: + '200': + description: List of OAuth configurations + content: + application/json: + schema: + type: object + properties: + configs: + type: array + items: + $ref: '#/components/schemas/OAuthConfig' + post: + tags: + - OAuth Configuration + summary: Create OAuth configuration + description: Configure OAuth provider (Google, GitHub, Microsoft, Apple, Device) + operationId: createOAuthConfig + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateOAuthConfigRequest' + responses: + '201': + description: OAuth config created + content: + application/json: + schema: + $ref: '#/components/schemas/OAuthConfig' + '409': + description: Provider already configured + /projects/{id}/oauth/configs/{provider}: + get: + tags: + - OAuth Configuration + summary: Get OAuth configuration + operationId: getOAuthConfig + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - name: provider + in: path + required: true + schema: + type: string + enum: + - google + - github + - microsoft + - apple + - device + - name: client_id + in: query + required: false + schema: + type: string + description: Required when `provider=device` to select a specific device client. + responses: + '200': + description: OAuth configuration + content: + application/json: + schema: + $ref: '#/components/schemas/OAuthConfig' + put: + tags: + - OAuth Configuration + summary: Update OAuth configuration + operationId: updateOAuthConfig + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - name: provider + in: path + required: true + schema: + type: string + enum: + - google + - github + - microsoft + - apple + - device + - name: client_id + in: query + required: false + schema: + type: string + description: Required when `provider=device` to select a specific device client. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateOAuthConfigRequest' + responses: + '200': + description: OAuth config updated + content: + application/json: + schema: + $ref: '#/components/schemas/OAuthConfig' + delete: + tags: + - OAuth Configuration + summary: Delete OAuth configuration + operationId: deleteOAuthConfig + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - name: provider + in: path + required: true + schema: + type: string + enum: + - google + - github + - microsoft + - apple + - device + - name: client_id + in: query + required: false + schema: + type: string + description: Required when `provider=device` to select a specific device client. + responses: + '204': + description: OAuth config deleted + /projects/{id}/oauth/providers: + get: + tags: + - OAuth Configuration + summary: List available OAuth providers + description: Get list of supported OAuth providers and their default scopes + operationId: listAvailableOAuthProviders + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + responses: + '200': + description: Available providers + content: + application/json: + schema: + type: object + properties: + providers: + type: array + items: + type: object + properties: + id: + type: string + name: + type: string + default_scopes: + type: array + items: + type: string + /auth/oauth/{provider}/authorize: + get: + tags: + - OAuth Authentication + summary: Start OAuth authorization + description: | + Redirects user to OAuth provider for authorization. + Handles CSRF protection with state parameter. + Project is identified via the anon_key query parameter. + operationId: authOAuthAuthorize + parameters: + - name: provider + in: path + required: true + schema: + type: string + enum: + - google + - github + - microsoft + - apple + - name: anon_key + in: query + required: true + schema: + type: string + description: Project anon key (required - identifies the project) + - name: redirect_url + in: query + schema: + type: string + description: | + URL to redirect to after the OAuth flow (optional). Must exactly + match an entry in the project's `allowed_redirect_urls`, including + its query string, or be the project's own managed hosted-auth page + URL. + - name: client_state + in: query + schema: + type: string + maxLength: 255 + description: | + Optional application nonce. It is stored with the server-generated + provider state and echoed to redirect_url as `state`. + - name: response_mode + in: query + schema: + type: string + enum: + - code + description: | + Set to `code` to receive a short-lived authorization code at + redirect_url, then use POST /auth/oauth/exchange to obtain the + session. `redirect_url` is required in this mode. When omitted, the + established session-fragment response is retained for compatibility + with existing clients. + responses: + '307': + description: Redirect to OAuth provider + '400': + description: | + OAuth provider is disabled for this project, or `redirect_url` is + not registered in `allowed_redirect_urls` + '404': + description: OAuth provider not configured + /auth/oauth/{provider}/callback: + get: + tags: + - OAuth Authentication + summary: OAuth callback handler + description: | + Handles OAuth provider callback with authorization code. + Exchanges code for tokens and creates/signs in user. + operationId: authOAuthCallback + parameters: + - name: provider + in: path + required: true + schema: + type: string + enum: + - google + - github + - microsoft + - apple + - name: code + in: query + required: true + schema: + type: string + - name: state + in: query + required: true + schema: + type: string + - name: error + in: query + schema: + type: string + responses: + '200': + description: Existing user signed in (when redirect_url was omitted) + content: + application/json: + schema: + $ref: '#/components/schemas/AuthTokenResponse' + '201': + description: New user created and signed in (when redirect_url was omitted) + content: + application/json: + schema: + $ref: '#/components/schemas/AuthTokenResponse' + '303': + description: | + Redirect to the exact registered redirect_url. Flows that requested + response_mode=code receive a short-lived, single-use `code` and + optional application `state`; compatibility flows receive the + established session fragment. + '400': + description: | + Missing/invalid code or state, the state parameter expired, the + provider was disabled after the flow started, or the flow's stored + redirect_url is no longer registered in allowed_redirect_urls (both + re-checked at callback time) + '403': + description: | + The provider's email domain is not in `allowed_email_domains`. Creating + an account is refused under `signup` and `signup_and_signin`; signing in + an already-linked account is refused under `signup_and_signin`, as it is + when the account's canonical email is outside the list. A new account + at a reserved domain (`anonymous.volcano.internal`, `volcano.local`) is + refused whatever the project allows. + '404': + description: | + The provider's configuration was removed after the flow started + (re-checked at callback time), or the account a link started from + was deleted + '409': + description: Email already exists (requires linking) + /auth/oauth/exchange: + post: + tags: + - OAuth Authentication + summary: Exchange OAuth authorization code + description: | + Atomically consumes a short-lived callback code and returns the user's + session. The request must use the same project anon key and exact + redirect_url that initiated the flow. + operationId: authOAuthExchange + security: + - AnonKey: [] + parameters: + - $ref: '#/components/parameters/AuthProxyAuthorization' + - $ref: '#/components/parameters/AuthProxyClientIP' + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - code + - redirect_url + properties: + code: + type: string + redirect_url: + type: string + format: uri + responses: + '200': + description: Authorization code consumed and session created + content: + application/json: + schema: + $ref: '#/components/schemas/AuthTokenResponse' + '400': + description: Invalid, expired, consumed, or redirect-mismatched code + '401': + description: Missing or invalid project anon key; or invalid auth proxy metadata + '403': + description: | + Email confirmation is now required, or the account's canonical email or + the provider identity's email is not in `allowed_email_domains` while + `allowed_email_domains_mode` is `signup_and_signin`. Both are re-checked here because the code outlives + the callback that issued it. + '429': + description: Too many exchange attempts from this client + /auth/device/authorize: + post: + tags: + - OAuth Authentication + summary: Start RFC8628 device authorization + description: | + Starts OAuth 2.0 Device Authorization Grant (RFC 8628). + Returns `device_code` for the CLI and `user_code` for browser verification. + + By default the returned `verification_uri` / `verification_uri_complete` + point at the project's managed device-approval page served by this API + (`/projects/{projectId}/auth/hosted?action=device&user_code=...&anon_key=...`), + which requires managed auth enabled and a default anon key for the + project. + + Projects can override this by setting `device_verification_url` on the + auth config (`PATCH /auth/config`). When set, that URL is returned as-is + with the `user_code` appended (no `action=device` hint and no embedded + anon key — the page brings its own), so a CLI's `login` command surfaces + the project's own RFC 8628 approval page. With a custom URL, device login + does **not** require managed auth to be enabled; the custom page's origin + must be in the project's auth CORS allowlist to call + `POST /auth/device/verify`. Either way the verification page must + authenticate the end user and call `POST /auth/device/verify` with the + `user_code`. See the device-auth guide for both approaches. + operationId: authDeviceAuthorize + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - client_id + properties: + client_id: + type: string + description: Enabled `device` OAuth client ID for the target project + responses: + '200': + description: Device authorization started + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceAuthorizationResponse' + '400': + description: Invalid request or unauthorized client + content: + application/json: + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + /auth/device/token: + post: + tags: + - OAuth Authentication + summary: Poll device token endpoint + description: | + RFC8628 token polling endpoint. + Returns OAuth errors such as `authorization_pending`, `slow_down`, `access_denied`, and `expired_token`. + operationId: authDeviceToken + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - grant_type + - device_code + - client_id + properties: + grant_type: + type: string + enum: + - urn:ietf:params:oauth:grant-type:device_code + device_code: + type: string + client_id: + type: string + responses: + '200': + description: Device flow completed, auth-user session minted + content: + application/json: + schema: + $ref: '#/components/schemas/AuthTokenResponse' + '400': + description: Polling state/error response + content: + application/json: + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + '403': + description: | + `access_denied` - the approving account's canonical email, or the email + of any of its identities, is not in `allowed_email_domains` while `allowed_email_domains_mode` is + `signup_and_signin`. Re-checked here because approval and redemption + are separate requests. + content: + application/json: + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + /auth/device/verify: + post: + tags: + - OAuth Authentication + summary: Approve or deny a device code + description: | + Browser-side endpoint for authenticated auth-users to approve (`approve`) or deny (`deny`) a `user_code`. + + Called by the verification page after the end user signs in. The grant is + scoped to the project the auth-user token belongs to: approving a + `user_code` issued for a different project returns `403`. This endpoint + does not require managed auth to be enabled, so a custom verification page + (hosted anywhere) can drive approval — it just needs an authenticated + project auth-user access token and, for cross-origin browser calls, the + page origin allowed in the project's auth CORS settings. + operationId: authDeviceVerify + security: + - AuthUserAccessToken: [] + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - user_code + properties: + user_code: + type: string + action: + type: string + enum: + - approve + - deny + default: approve + responses: + '200': + description: Verification action accepted + content: + application/json: + schema: + type: object + properties: + success: + type: boolean + status: + type: string + '401': + description: Not authenticated + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /auth/platform/exchange: + post: + tags: + - OAuth Authentication + summary: Exchange auth-user device session for platform token + description: | + Exchanges a verified auth-user device-flow session into a platform token for CLI usage. + The target platform user is derived from authenticated auth-user mapping; client cannot select another user. + operationId: authPlatformExchange + security: + - AuthUserAccessToken: [] + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - client_id + properties: + client_id: + type: string + responses: + '200': + description: Platform token minted + content: + application/json: + schema: + $ref: '#/components/schemas/PlatformExchangeResponse' + '403': + description: | + Exchange not allowed for this session/client/project, or the + account's canonical email, or the email of any of its identities, is + not in `allowed_email_domains` while `allowed_email_domains_mode` is + `signup_and_signin`. The domain is re-checked here because the minted platform token outlives the + session it is exchanged from. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /auth/oauth/providers: + get: + tags: + - OAuth Authentication + summary: List user's linked providers + description: | + Lists the OAuth providers linked to the signed-in user, with the + user's own account ID at each provider. Match on `provider_user_id`, + which never changes, rather than on the login or email. For + GitHub, it is the numeric user ID that GitHub reports elsewhere, such + as a webhook's `sender.id`. + operationId: authListOAuthProviders + security: + - AuthUserAccessToken: [] + responses: + '200': + description: Linked providers + content: + application/json: + schema: + type: object + properties: + providers: + type: array + items: + type: object + required: + - provider + - provider_user_id + - linked_at + - updated_at + properties: + provider: + type: string + provider_user_id: + type: string + description: | + The user's account ID at the provider, as a string. + It stays the same when the user renames the account. + example: '583231' + provider_login: + type: string + description: | + The account's login at the provider when it was + linked, such as a GitHub username. It isn't updated + when the user renames the account. Omitted for + providers without logins. + example: octocat + linked_at: + type: string + format: date-time + updated_at: + type: string + format: date-time + '401': + description: Not authenticated + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /auth/oauth/{provider}/link: + post: + tags: + - OAuth Authentication + summary: Link OAuth provider to current user + description: | + Generates authorization URL to link OAuth provider to existing account. + User must be authenticated. + operationId: authLinkOAuthProvider + security: + - AuthUserAccessToken: [] + parameters: + - name: provider + in: path + required: true + schema: + type: string + enum: + - google + - github + - microsoft + - apple + - name: redirect_url + in: query + schema: + type: string + description: | + URL to redirect to after linking completes (optional). Same + allowed_redirect_urls requirement as GET /auth/oauth/{provider}/authorize. + - name: client_state + in: query + schema: + type: string + maxLength: 255 + description: | + Optional application nonce echoed to redirect_url as `state`. + - name: response_mode + in: query + schema: + type: string + enum: + - code + description: | + Set to `code` to receive a short-lived authorization code at + redirect_url. `redirect_url` is required in this mode. When + omitted, the established session-fragment response is retained for + compatibility with existing clients. + responses: + '200': + description: Authorization URL generated + content: + application/json: + schema: + type: object + properties: + authorization_url: + type: string + '400': + description: redirect_url is not registered in allowed_redirect_urls + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Not authenticated + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: OAuth provider not configured + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '409': + description: Provider already linked + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /auth/oauth/{provider}/unlink: + delete: + tags: + - OAuth Authentication + summary: Unlink OAuth provider + description: | + Remove OAuth provider from user's account. Refused when the account would + have no other way to sign in: another linked OAuth provider that's enabled + for the project, or a password while email/password sign-in is on for the + project (`enable_email_password`). + operationId: authUnlinkOAuthProvider + security: + - AuthUserAccessToken: [] + parameters: + - name: provider + in: path + required: true + schema: + type: string + enum: + - google + - github + - microsoft + - apple + responses: + '204': + description: Provider unlinked + '400': + description: Cannot unlink last authentication method + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Not authenticated + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Provider not linked + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /auth/oauth/{provider}/refresh-token: + post: + tags: + - OAuth Authentication + summary: Refresh OAuth provider token + description: | + Refresh the access token for an OAuth provider using its refresh token. + Allows calling provider APIs on user's behalf (e.g., Google Drive, GitHub repos). + operationId: refreshOAuthProviderToken + security: + - AuthUserAccessToken: [] + parameters: + - name: provider + in: path + required: true + schema: + type: string + enum: + - google + - github + - microsoft + - apple + responses: + '200': + description: Token refreshed successfully + content: + application/json: + schema: + type: object + properties: + message: + type: string + provider: + type: string + expires_in: + type: integer + '400': + description: No refresh token available or refresh failed + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Not authenticated + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Provider not linked + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /auth/oauth/{provider}/token: + get: + tags: + - OAuth Authentication + summary: Get current provider access token + description: | + Get valid access token for OAuth provider. + Automatically refreshes if expired. + operationId: getOAuthProviderToken + security: + - AuthUserAccessToken: [] + parameters: + - name: provider + in: path + required: true + schema: + type: string + enum: + - google + - github + - microsoft + - apple + responses: + '200': + description: Current access token + content: + application/json: + schema: + type: object + properties: + message: + type: string + provider: + type: string + expires_in: + type: integer + '401': + description: Not authenticated + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Provider not linked + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /auth/oauth/{provider}/call-api: + post: + tags: + - OAuth Authentication + summary: Call OAuth provider API + description: | + Make an authenticated request to an OAuth provider's API on behalf of the user. + The user's stored access token is automatically used and refreshed if needed. + + The request is always sent to the provider's fixed API base URL joined with + the caller-supplied `endpoint`. `endpoint` must be a relative path beginning + with `/` (optionally with a query string); it cannot change the target host. + Absolute URLs, protocol-relative `//host` values, or userinfo (`@host`) are + rejected with `400` so the request can never be redirected to another host. + + Examples of `endpoint`: + - Google userinfo: `/oauth2/v1/userinfo` + - GitHub repositories: `/user/repos` + - Microsoft Graph profile: `/me` + + The response wraps the provider's raw JSON value with request metadata. + An empty provider body is represented as `data: null`; the envelope + preserves the provider's HTTP status in `status_code`, including errors. + Provider response bodies are limited to 8 MiB after decompression. + Transport failures, invalid JSON (including invalid UTF-8), and oversized + bodies return `502`. Provider redirects to another origin are blocked and + return `400`. + operationId: callOAuthProviderAPI + security: + - AuthUserAccessToken: [] + parameters: + - name: provider + in: path + required: true + schema: + type: string + enum: + - google + - github + - microsoft + - apple + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - endpoint + properties: + endpoint: + type: string + description: | + Relative path on the provider's API, beginning with `/`. It is + joined with the provider's fixed base URL; it must not contain a + scheme, host, userinfo, or a leading `//`. + example: /user/repos + method: + type: string + enum: + - GET + - POST + default: GET + description: HTTP method to use + body: + type: object + additionalProperties: true + description: Request body for POST requests + responses: + '200': + description: Provider API response + content: + application/json: + schema: + type: object + description: OAuth provider API response envelope + required: + - provider + - endpoint + - status_code + - data + properties: + provider: + type: string + enum: + - google + - github + - microsoft + - apple + endpoint: + type: string + status_code: + type: integer + minimum: 100 + maximum: 599 + data: + description: Raw provider JSON value, or null when the provider returns no body + nullable: true + '400': + description: | + Invalid request (for example: missing `endpoint`, an `endpoint` that is + not a relative path, or an unsupported HTTP method), or a provider + redirect to another origin. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Not authenticated + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: OAuth provider configuration not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '413': + description: Request body exceeds 4,194,304 bytes, or its JSON has too many objects, arrays or values + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: Failed to create the provider API request + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '502': + description: Provider transport failure, invalid JSON, or response body larger than 8 MiB + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /projects/{id}/anon-keys: + get: + tags: + - Anon Keys + summary: List anon keys + description: | + Supports two mutually exclusive pagination modes. Offset mode uses `page` + and `limit` and is the default when neither `cursor` nor `search` is + supplied (first page, default `limit`). Cursor mode uses `cursor` and + `limit`, supports `search` (case-insensitive name match), and returns + `next_cursor`. Sending both `page` and `cursor` (or `page` and `search`) + returns 400. + operationId: listAnonKeys + 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: List of anon keys + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/AnonKey' + total: + type: integer + description: Total number of items matching the query (so the UI can render numbered pages). + has_more: + type: boolean + description: Whether a next page exists. + next_cursor: + type: string + description: Opaque cursor for the next page (cursor pagination only) + prev_cursor: + type: string + description: Opaque cursor for the previous page (cursor pagination only). Send as `ending_before`. + post: + tags: + - Anon Keys + summary: Create anon key + operationId: createAnonKey + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - name + properties: + name: + type: string + description: | + Key name for identification. + Can only contain letters, numbers, underscores, and hyphens. + pattern: ^[A-Za-z0-9_-]+$ + minLength: 1 + maxLength: 255 + example: frontend-app + permissions: + type: array + items: + type: string + enum: + - auth.signup + - auth.signin + - auth.refresh + - auth.logout + - auth.password_reset + - auth.confirm_email + - auth.resend_confirmation + - storage.upload + - storage.download + - storage.list + - storage.delete + - realtime.connect + - realtime.subscribe + - realtime.publish + - functions.invoke + description: | + Optional list of permissions for this key. + If not provided, defaults to auth-only permissions: auth.signup, auth.signin, auth.refresh, auth.logout, auth.password_reset, auth.confirm_email, auth.resend_confirmation. + Storage, realtime, and functions permissions must be explicitly added if needed. + example: + - auth.signup + - auth.signin + - auth.refresh + - auth.logout + responses: + '201': + description: Anon key created + content: + application/json: + schema: + $ref: '#/components/schemas/AnonKey' + '400': + description: Invalid key name or request + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '409': + description: Key with this name already exists + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /projects/{id}/anon-keys/{keyId}: + get: + tags: + - Anon Keys + summary: Get anon key + description: Get details of a specific anon key + operationId: getAnonKey + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - name: keyId + in: path + required: true + schema: + type: string + format: uuid + responses: + '200': + description: Anon key details + content: + application/json: + schema: + $ref: '#/components/schemas/AnonKey' + '404': + description: Key not found + delete: + tags: + - Anon Keys + summary: Revoke anon key + description: Revokes key - it will immediately stop working + operationId: revokeAnonKey + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - name: keyId + in: path + required: true + schema: + type: string + format: uuid + responses: + '204': + description: Key revoked + '401': + description: Unauthorized + '403': + description: Forbidden + '404': + description: Key not found + '409': + description: Cannot delete the project's default anon key + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: Internal server error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /projects/{id}/anon-keys/{keyId}/regenerate: + post: + tags: + - Anon Keys + summary: Regenerate anon key + description: Generate new JWT value for existing key + operationId: regenerateAnonKey + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - name: keyId + in: path + required: true + schema: + type: string + format: uuid + responses: + '200': + description: Key regenerated + content: + application/json: + schema: + $ref: '#/components/schemas/AnonKey' + '404': + description: Anon key not found, including deletion before the updated key can be returned + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /projects/{id}/anon-keys/{keyId}/set-default: + post: + tags: + - Anon Keys + summary: Set default anon key + description: Promotes the given key to the project's configured default. At most one key per project can be default. + operationId: setDefaultAnonKey + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - name: keyId + in: path + required: true + schema: + type: string + format: uuid + responses: + '200': + description: Key set as default + content: + application/json: + schema: + $ref: '#/components/schemas/AnonKey' + '401': + description: Unauthorized + '403': + description: Forbidden + '404': + description: Anon key not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: Internal server error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /projects/{id}/access-tokens: + get: + tags: + - Project Access Tokens + summary: List a project's access tokens + description: | + 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. + + Delegated grants are hidden by default too. A first-party app you have + allowed to act on this project mints one every few minutes, and you + revoke the app's access as a whole rather than grant by grant. Pass + `include_delegated=true` to list them; they have scope `delegated`. + They never count toward the project's limit of 100 live tokens. + + 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/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 + - name: include_delegated + in: query + required: false + description: | + Include delegated grants: short tokens a first-party app mints for + one run from the access you allowed it. + schema: + type: boolean + default: false + responses: + '200': + description: Successful response + content: + application/json: + schema: + $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: + - Project Access Tokens + summary: Create a project access token + description: | + 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. + operationId: createProjectAccessToken + security: + - UserToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateProjectAccessTokenRequest' + responses: + '201': + description: Token created - save the secret now, it cannot be retrieved again + content: + application/json: + schema: + $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: | + 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: + - 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. Delegated grants are + not, as the token list hides them by default; read one grant's usage by + its ID. + + `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: 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: + 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: 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. + + A key that holds `ai.invoke` is an AI key for the Volcano AI gateway, + which calls models on the project's behalf. Volcano pays the model + provider for those calls; the project is not billed for them. It holds `ai.invoke` and nothing else, and is marked as created + by a person, so the gateway can tell it from every other key: a key + that holds `"*"`, and a key created before AI keys existed, never + count. Only a person creates one: signed in to the dashboard, or with + a `volcano login` token whose sign-in is live. A project access token, + a request made through MCP, a platform token created through the token + API, and a sign-in that ended get `403` with code `person_required`. + On a local server, the local platform token counts as the person. + Reading or regenerating an AI key takes the same person as creating + it, and lists leave its value out. An AI key only mints run tokens: + the database API and realtime refuse it, whether or not service key + scopes apply to them yet. While the `ai_gateway` capability + is unavailable, asking for `ai.invoke` answers `404` with code + `feature_unavailable`; existing keys keep working with the other + service key routes. + + A key that holds `grants.mint` lets a first-party app, such as the + Builder, mint delegated grants. It too holds that permission alone + and takes a person, as an AI key does. Only a registered first-party + app's project may hold one, and only its owner creates it: another + project gets `403` with code + `first_party_app_required`. The `ai_gateway` capability doesn't apply + to it, and it carries no AI marker. + 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, project locks, sandboxes, and server-side auth proxy + metadata (auth.signin, auth.signup, auth.refresh, auth.logout, + auth.password_reset). A key scoped to a list without "*" reads, stops, + and messages a durable execution only with the `client_token` its + start returned. Today the scope doesn't restrict the database API, and + restricts realtime only on a durable run's channel: every service key + queries every table with RLS bypassed, subscribes to every other channel, + and publishes on broadcast channels. Once Volcano applies scopes to the + database API and realtime, a key without "*" gets 403 from the database + API, needs realtime.subscribe for broadcast and presence channels and + realtime.publish to publish, and needs "*" for table changes. `ai.invoke` + and `grants.mint` are reserved: "*" doesn't include them, only a person + may ask for one, and it must be the key's only permission. + example: + - functions.invoke + - locks.manage + responses: + '201': + description: Service key created - save the key_value immediately! + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceKey' + '400': + description: Invalid key name or request, or `ai.invoke` or `grants.mint` asked for beside another permission. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: 'Code `person_required` means a person did not ask for a key that holds `ai.invoke` or `grants.mint`: a full-scope project access token, MCP, a platform token created through the token API, or a `volcano login` token whose sign-in ended made the request. Create the key signed in to the dashboard or with `volcano login`. Code `first_party_app_required` means `grants.mint` was asked for on a project that is not a registered first-party app''s. Without a code: the project belongs to another account, a read-only project access token made the request, or the account is read-only.' + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Not found. Code `feature_unavailable` means `ai.invoke` was asked for while the `ai_gateway` capability is unavailable. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '409': + description: Key with this name already exists + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /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' + '403': + description: | + Without a code: the key belongs to another project, or a read-only + project access token asked for a credential. + Code `person_required` means the key holds `ai.invoke` or + `grants.mint` and a person signed in did not make the request: a + full-scope project access token, MCP, a platform token created + through the token API, or a `volcano login` token whose sign-in + ended made it. Use the dashboard or `volcano login`. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Key not found + delete: + tags: + - Service Keys + summary: Delete service key + description: | + Permanently delete a service key. + Any services using this key will immediately lose access. + operationId: deleteServiceKey + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - name: keyId + in: path + required: true + schema: + type: string + format: uuid + responses: + '204': + description: Key deleted + /projects/{id}/service-keys/{keyId}/regenerate: + post: + tags: + - Service Keys + summary: Regenerate service key + description: | + 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. + operationId: regenerateServiceKey + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - name: keyId + in: path + required: true + schema: + type: string + format: uuid + responses: + '200': + description: Key regenerated - save the new key_value immediately! + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceKey' + '403': + description: | + Without a code: the key belongs to another project, or a read-only + project access token asked to regenerate it. + Code `person_required` means the key holds `ai.invoke` or + `grants.mint` and a person signed in did not make the request: a + full-scope project access token, MCP, a platform token created + through the token API, or a `volcano login` token whose sign-in + ended made it. Use the dashboard or `volcano login`. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /projects/{id}/storage/buckets: + get: + tags: + - Storage Buckets + summary: List all storage buckets in a project + description: | + With no pagination params, returns the full bucket list as a bare array + (legacy). Supplying `cursor`, `ending_before`, `search`, or `limit` + switches to keyset (cursor) pagination and returns a paginated envelope + with `next_cursor`/`prev_cursor` and a filtered `total`. + operationId: listStorageBuckets + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/Limit' + - $ref: '#/components/parameters/Cursor' + - $ref: '#/components/parameters/EndingBefore' + - $ref: '#/components/parameters/Offset' + - $ref: '#/components/parameters/Search' + responses: + '200': + description: | + Either the full bucket list (bare array, legacy) or a paginated + envelope when cursor pagination is requested. + content: + application/json: + schema: + oneOf: + - type: array + items: + $ref: '#/components/schemas/StorageBucket' + - $ref: '#/components/schemas/PaginatedStorageBuckets' + post: + tags: + - Storage Buckets + summary: Create a new storage bucket + operationId: createStorageBucket + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateStorageBucketRequest' + responses: + '201': + description: Bucket created + content: + application/json: + schema: + $ref: '#/components/schemas/StorageBucket' + '409': + description: Bucket already exists + /projects/{id}/storage/buckets/{bucketName}: + get: + tags: + - Storage Buckets + summary: Get storage bucket by name + operationId: getStorageBucket + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/BucketName' + responses: + '200': + description: Bucket details + content: + application/json: + schema: + $ref: '#/components/schemas/StorageBucket' + '404': + description: Bucket not found + patch: + tags: + - Storage Buckets + summary: Update storage bucket settings + operationId: updateStorageBucket + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/BucketName' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateStorageBucketRequest' + responses: + '200': + description: Bucket updated + content: + application/json: + schema: + $ref: '#/components/schemas/StorageBucket' + delete: + tags: + - Storage Buckets + summary: Delete storage bucket and all objects + operationId: deleteStorageBucket + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/BucketName' + responses: + '200': + description: Bucket deleted + /projects/{id}/storage/buckets/{bucketName}/policies: + get: + tags: + - Storage Policies + summary: List storage policies for a bucket + operationId: listStoragePolicies + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/BucketName' + responses: + '200': + description: List of policies + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/StoragePolicy' + post: + tags: + - Storage Policies + summary: Create a storage policy + operationId: createStoragePolicy + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/BucketName' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateStoragePolicyRequest' + responses: + '201': + description: Policy created + content: + application/json: + schema: + $ref: '#/components/schemas/StoragePolicy' + /projects/{id}/storage/buckets/{bucketName}/policies/{policyId}: + delete: + tags: + - Storage Policies + summary: Delete a storage policy + operationId: deleteStoragePolicy + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - $ref: '#/components/parameters/BucketName' + - name: policyId + in: path + required: true + schema: + type: string + format: uuid + responses: + '200': + description: Policy deleted + '404': + description: Project, bucket, or policy not found. Also returned when the policy ID is malformed or belongs to another bucket. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /projects/{id}/storage/objects: + get: + tags: + - Storage Admin + summary: List all storage objects in a project + description: | + Returns a paginated list of all storage objects across all buckets in the project. + Supports filtering by owner and pagination. + operationId: listStorageObjectsAdmin + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + - name: owner_id + in: query + description: Filter by owner user ID + schema: + type: string + format: uuid + - name: page + in: query + description: Page number (1-based) + schema: + type: integer + default: 1 + minimum: 1 + - name: limit + in: query + description: Items per page + schema: + type: integer + default: 50 + minimum: 1 + maximum: 100 + - $ref: '#/components/parameters/Cursor' + - $ref: '#/components/parameters/EndingBefore' + - $ref: '#/components/parameters/Offset' + - $ref: '#/components/parameters/Search' + responses: + '200': + description: Paginated list of storage objects + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/StorageObjectWithBucket' + page: + type: integer + limit: + type: integer + total: + type: integer + has_more: + type: boolean + next_cursor: + type: string + description: Opaque cursor for the next page (cursor pagination only) + prev_cursor: + type: string + description: Opaque cursor for the previous page (cursor pagination only). Send as `ending_before`. + /projects/{id}/storage/stats: + get: + tags: + - Storage Admin + summary: Get storage statistics for a project + description: Returns aggregate storage statistics including bucket count, object count, and total size. + operationId: getStorageStats + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + responses: + '200': + description: Storage statistics + content: + application/json: + schema: + $ref: '#/components/schemas/StorageStats' + /projects/{id}/realtime/config: + get: + tags: + - Realtime + summary: Get realtime configuration for a project + description: Returns the realtime configuration including enabled features and limits. + operationId: getRealtimeConfig + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + responses: + '200': + description: Realtime configuration + content: + application/json: + schema: + $ref: '#/components/schemas/RealtimeConfig' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Project not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + put: + tags: + - Realtime + summary: Update realtime configuration for a project + description: Updates realtime settings including feature toggles and limits. + operationId: updateRealtimeConfig + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateRealtimeConfigRequest' + responses: + '200': + description: Updated realtime configuration + content: + application/json: + schema: + $ref: '#/components/schemas/RealtimeConfig' + '400': + description: Invalid configuration values + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /projects/{id}/realtime/stats: + get: + tags: + - Realtime + summary: Get realtime statistics for a project + description: Returns realtime usage statistics including connection counts and subscribed tables. + operationId: getRealtimeStats + security: + - UserToken: [] + - ProjectAccessToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + responses: + '200': + description: Realtime statistics + content: + application/json: + schema: + $ref: '#/components/schemas/RealtimeStats' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /realtime/v1/publish: + post: + tags: + - Realtime + summary: Publish a message to a Realtime channel + description: | + Sends one message to a broadcast or grant channel of the project + embedded in the service-role key, for a backend that holds no + WebSocket, such as a function. The key needs `realtime.publish`. + + `channel` is a client channel: `broadcast:`, or + `grant:` for a channel only Realtime grant holders watch. Every + subscriber receives `{"type": , "payload": }` as the + message data, the shape `channel.on(, ...)` matches. + + The publish is metered like any server publish: the publish plus one + per subscriber it reaches. Messages are not stored; a subscriber that + was not connected misses it. A project's publishes share the rate a + WebSocket client publishes at; over it the answer is 429 + `realtime_publish_rate_limited`. + operationId: publishRealtimeMessage + security: + - ServiceRoleKey: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/RealtimePublishRequest' + responses: + '202': + description: The message was sent to the channel's subscribers + content: + application/json: + schema: + $ref: '#/components/schemas/RealtimePublishResult' + '400': + description: 'The body breaks the schema, such as a channel that is not `broadcast:` or `grant:`, an invalid event or payload; these answers carry no code. Code `invalid_channel`: the server refuses the channel''s name. Code `feature_unavailable`: a grant channel while Realtime grants are off.' + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Missing or invalid credentials + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: A non-service credential was supplied or the service key lacks `realtime.publish` + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Publishing over HTTP is not available here (`feature_unavailable`). `GET /capabilities` lists `realtime.http_publish` unavailable while it is. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '409': + description: Realtime, or broadcast for a broadcast channel, is off for the project (`realtime_disabled`) + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '413': + description: The message is larger than the project's Realtime message size (`message_too_large`), or its JSON has too many objects, arrays or values + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: The project used its monthly Realtime messages (`realtime_message_limit_exceeded`), or is publishing faster than its publish rate (`realtime_publish_rate_limited`) + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '503': + description: | + Realtime is paused (`feature_paused`); try again after + `Retry-After`. Without a code, the message could not be metered + or sent. + headers: + Retry-After: + description: Seconds to wait before trying again. Sent with `feature_paused`. + schema: + type: integer + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /storage/{bucketName}: + get: + tags: + - Storage Objects + summary: List objects in a bucket + operationId: listStorageObjects + security: + - AnonKey: [] + - ServiceRoleKey: [] + - AuthUserAccessToken: [] + parameters: + - $ref: '#/components/parameters/BucketName' + - name: prefix + in: query + description: Filter objects by path prefix + schema: + type: string + - name: limit + in: query + description: Maximum objects to return + schema: + type: integer + default: 50 + maximum: 1000 + - name: cursor + in: query + description: Pagination cursor + schema: + type: string + responses: + '200': + description: List of objects + content: + application/json: + schema: + $ref: '#/components/schemas/StorageListResponse' + '403': + description: Access denied by storage policy + '429': + $ref: '#/components/responses/BandwidthCapExceeded' + /locks/{key}/lease: + post: + tags: + - Locks + summary: Acquire a project lock + description: | + Acquires a project-scoped lease using the project embedded in the service-role key. + The caller must hold the `locks.manage` permission. Repeating the request with the + same lock token is idempotent and resets that lease to the requested TTL. A different + live owner receives `409 lock_held`; a caller whose own lease already lapsed receives + `409 lock_ownership_lost`. + operationId: acquireProjectLock + security: + - ServiceRoleKey: [] + parameters: + - $ref: '#/components/parameters/LockKey' + - $ref: '#/components/parameters/LockToken' + - $ref: '#/components/parameters/LockRequestId' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ProjectLockLeaseRequest' + responses: + '201': + description: Lease acquired + content: + application/json: + schema: + $ref: '#/components/schemas/ProjectLockLease' + '400': + description: Invalid lock key, token, or TTL + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Missing or invalid credentials + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: A non-service credential was supplied or the service key lacks `locks.manage` + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '409': + description: | + The lock is held by another live lease (`lock_held`), or the caller's own lease + lapsed and is not yet reclaimable (`lock_ownership_lost`). + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: Project lock request limit exceeded + headers: + Retry-After: + description: Seconds until the current fixed-minute window ends. + schema: + type: integer + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '503': + description: Lock service unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + patch: + tags: + - Locks + summary: Renew a project lock + description: | + Renews a lease owned by the supplied lock token. The request must arrive + more than one second before `expires_at`; this safety margin prevents + clock skew between regional API instances from resurrecting an expired + lease. + operationId: renewProjectLock + security: + - ServiceRoleKey: [] + parameters: + - $ref: '#/components/parameters/LockKey' + - $ref: '#/components/parameters/LockToken' + - $ref: '#/components/parameters/LockRequestId' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ProjectLockLeaseRequest' + responses: + '200': + description: Lease renewed + content: + application/json: + schema: + $ref: '#/components/schemas/ProjectLockLease' + '400': + description: Invalid lock key, token, or TTL + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Missing or invalid credentials + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: A non-service credential was supplied or the service key lacks `locks.manage` + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '409': + description: The lease expired or is owned by another token + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: Project lock request limit exceeded + headers: + Retry-After: + description: Seconds until the current fixed-minute window ends. + schema: + type: integer + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '503': + description: Lock service unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + delete: + tags: + - Locks + summary: Release a project lock + description: Releases a lease only when the supplied lock token still owns it. + operationId: releaseProjectLock + security: + - ServiceRoleKey: [] + parameters: + - $ref: '#/components/parameters/LockKey' + - $ref: '#/components/parameters/LockToken' + - $ref: '#/components/parameters/LockRequestId' + responses: + '204': + description: Lease released + '400': + description: Invalid lock key or token + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Missing or invalid credentials + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: A non-service credential was supplied or the service key lacks `locks.manage` + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '409': + description: The lease is owned by another token + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: Project lock request limit exceeded + headers: + Retry-After: + description: Seconds until the current fixed-minute window ends. + schema: + type: integer + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '503': + description: Lock service unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /locks/{key}: + get: + tags: + - Locks + summary: Read a project lock + description: | + Reports whether the lock is currently held, when its lease expires, and the + holder's fencing token. `held` follows takeover eligibility rather than raw + expiry, so `held: false` means an acquire would succeed now. No lock token is + required, making this usable for monitoring and recovery. + operationId: getProjectLock + security: + - ServiceRoleKey: [] + parameters: + - $ref: '#/components/parameters/LockKey' + - $ref: '#/components/parameters/LockRequestId' + responses: + '200': + description: Current lock state + content: + application/json: + schema: + $ref: '#/components/schemas/ProjectLockState' + '400': + description: Invalid lock key + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Missing or invalid credentials + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: A non-service credential was supplied or the service key lacks `locks.manage` + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: Project lock request limit exceeded + headers: + Retry-After: + description: Seconds until the current fixed-minute window ends. + schema: + type: integer + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '503': + description: Lock service unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + delete: + tags: + - Locks + summary: Force release a project lock + description: | + Drops the lease whatever token holds it, for recovering a lock whose holder + died without releasing. Use `DELETE /locks/{key}/lease` for normal release. + + This breaks mutual exclusion by itself: the previous holder keeps working + until its own renewal fails. Guard the protected resource with the lease's + `fencing_token`, which the next acquisition raises, so a write from the + displaced holder can be rejected. Succeeds when the lock is already absent. + operationId: forceReleaseProjectLock + security: + - ServiceRoleKey: [] + parameters: + - $ref: '#/components/parameters/LockKey' + - $ref: '#/components/parameters/LockRequestId' + responses: + '204': + description: Lock released + '400': + description: Invalid lock key + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '401': + description: Missing or invalid credentials + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: A non-service credential was supplied or the service key lacks `locks.manage` + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: Project lock request limit exceeded + headers: + Retry-After: + description: Seconds until the current fixed-minute window ends. + schema: + type: integer + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '503': + description: Lock service unavailable + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /storage/{bucketName}/move: + post: + tags: + - Storage Objects + summary: Move/rename an object + operationId: moveStorageObject + security: + - ServiceRoleKey: [] + - AuthUserAccessToken: [] + parameters: + - $ref: '#/components/parameters/BucketName' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/StorageMoveRequest' + responses: + '200': + description: Object moved + content: + application/json: + schema: + $ref: '#/components/schemas/StorageObject' + '403': + description: Access denied by storage policy + '413': + description: Request body exceeds 16,384 bytes + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + $ref: '#/components/responses/BandwidthCapExceeded' + /storage/{bucketName}/copy: + post: + tags: + - Storage Objects + summary: Copy an object + operationId: copyStorageObject + security: + - ServiceRoleKey: [] + - AuthUserAccessToken: [] + parameters: + - $ref: '#/components/parameters/BucketName' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/StorageCopyRequest' + responses: + '201': + description: Object copied + content: + application/json: + schema: + $ref: '#/components/schemas/StorageObject' + '403': + description: Access denied by storage policy + '413': + description: Request body exceeds 16,384 bytes + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + $ref: '#/components/responses/BandwidthCapExceeded' + /storage/{bucketName}/{path}: + post: + tags: + - Storage Objects + summary: Upload a file or create resumable session + description: | + Unified endpoint for file uploads. Behavior depends on Content-Type and headers: + + **Simple Upload (multipart/form-data):** + Upload a complete file in a single request. Best for files under 100MB. + + **Create Resumable Session (application/json):** + Create a session for chunked uploads. Best for large files or unreliable networks. + Requires: `Content-Type: application/json` with body `{"filename": "...", "content_type": "...", "total_size": ...}` + + **Complete Resumable Session:** + Complete a session after all parts are uploaded. + Requires: `X-Upload-Session` header with session ID and `X-Upload-Complete: true` header. + + **Resumable Session Ownership:** + A session created with a user access token remains bound to that user. A session + created with an anon key remains bound to that exact anon key. Reuse the same + identity or anon key for part uploads, status, completion, and abort requests; + an ownership mismatch returns `404`. + operationId: uploadStorageObject + security: + - AnonKey: [] + - ServiceRoleKey: [] + - AuthUserAccessToken: [] + parameters: + - $ref: '#/components/parameters/BucketName' + - name: path + in: path + required: true + description: Object path within bucket + schema: + type: string + - name: X-Upload-Session + in: header + required: false + description: Upload session ID (for completing resumable uploads) + schema: + type: string + - name: X-Upload-Complete + in: header + required: false + description: Set to "true" to complete a resumable upload session + schema: + type: string + enum: + - 'true' + requestBody: + required: true + content: + multipart/form-data: + schema: + type: object + required: + - file + properties: + file: + type: string + format: binary + description: File to upload (simple upload) + application/json: + schema: + $ref: '#/components/schemas/CreateUploadSessionRequest' + responses: + '200': + description: Resumable upload completed (when X-Upload-Complete=true) + content: + application/json: + schema: + $ref: '#/components/schemas/CompleteUploadSessionResponse' + '201': + description: File uploaded or session created + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/StorageObject' + - $ref: '#/components/schemas/CreateUploadSessionResponse' + '400': + description: | + Bad request. This can occur when: + - MIME type is not in the bucket's allowed_mime_types list + - File exceeds the bucket's configured file_size_limit + - File exceeds the global maximum upload size (5GB) + - Invalid request body or missing required fields + '403': + description: Access denied by storage policy + '404': + description: Resumable upload session not found or not owned by this credential + '413': + description: | + The upload is too large. This occurs when: + - File exceeds the plan-based maximum file size (HOBBY or SUPERAGENT tier) + - The account on the HOBBY plan holds its file-storage allowance. + Enforcement is eventual: uploads are accepted until Volcano's + next allowance check sees the account at its allowance + - The `application/json` body that creates a resumable session + exceeds 16,384 bytes + '429': + $ref: '#/components/responses/BandwidthCapExceeded' + put: + tags: + - Storage Objects + summary: Upload a part of a resumable upload + description: | + Upload a single part of a resumable upload session. + + **Requirements:** + - Part numbers start at 1 + - All parts except the last must be at least 5MB + - Maximum part size is 25MB + - Parts can be uploaded in any order + - Re-uploading a part overwrites the previous upload + - Anonymous sessions must reuse the exact anon key that created the session + operationId: uploadPart + security: + - AnonKey: [] + - ServiceRoleKey: [] + - AuthUserAccessToken: [] + parameters: + - $ref: '#/components/parameters/BucketName' + - name: path + in: path + required: true + description: Object path within bucket + schema: + type: string + - name: X-Upload-Session + in: header + required: true + description: Upload session ID + schema: + type: string + - name: X-Part-Number + in: header + required: true + description: Part number (1 to 10000) + schema: + type: integer + minimum: 1 + maximum: 10000 + requestBody: + required: true + content: + application/octet-stream: + schema: + type: string + format: binary + responses: + '200': + description: Part uploaded + content: + application/json: + schema: + $ref: '#/components/schemas/UploadSessionPart' + '400': + description: Invalid part number or part data + '403': + description: Access denied + '404': + description: Session not found or not owned by this credential + get: + tags: + - Storage Objects + summary: Download a file or get upload session status + description: | + Download a file, or get the status of a resumable upload session. + + **File Download (default):** + Downloads the file at the specified path. + + **Session Status (with X-Upload-Session header):** + Returns the status of a resumable upload session, including which parts have been uploaded. + Anonymous sessions must reuse the exact anon key that created the session. + operationId: downloadStorageObject + security: + - AnonKey: [] + - ServiceRoleKey: [] + - AuthUserAccessToken: [] + parameters: + - $ref: '#/components/parameters/BucketName' + - name: path + in: path + required: true + description: Object path within bucket + schema: + type: string + - name: Range + in: header + required: false + description: | + HTTP Range header for partial downloads. + Format: bytes=start-end or bytes=start- + Examples: bytes=0-1023, bytes=1000- + schema: + type: string + pattern: ^bytes=\d+-\d*$ + - name: X-Upload-Session + in: header + required: false + description: Upload session ID (to get session status instead of downloading) + schema: + type: string + responses: + '200': + description: File content or session status + headers: + Content-Type: + schema: + type: string + Content-Length: + schema: + type: integer + ETag: + schema: + type: string + content: + application/octet-stream: + schema: + type: string + format: binary + application/json: + schema: + $ref: '#/components/schemas/UploadSessionStatusResponse' + '206': + description: Partial content (range request) + '400': + description: Invalid Range header format + '403': + description: Access denied by storage policy + '404': + description: Object or session not found, or session not owned by this credential + '416': + $ref: '#/components/responses/StorageRangeNotSatisfiable' + '429': + $ref: '#/components/responses/BandwidthCapExceeded' + delete: + tags: + - Storage Objects + summary: Delete a file or abort upload session + description: | + Delete a file, or abort a resumable upload session. + + **File Delete (default):** + Deletes the file at the specified path. + + **Abort Session (with X-Upload-Session header):** + Aborts a resumable upload session and cleans up any uploaded parts. + Anonymous sessions must reuse the exact anon key that created the session. + operationId: deleteStorageObject + security: + - AnonKey: [] + - ServiceRoleKey: [] + - AuthUserAccessToken: [] + parameters: + - $ref: '#/components/parameters/BucketName' + - name: path + in: path + required: true + description: Object path within bucket + schema: + type: string + - name: X-Upload-Session + in: header + required: false + description: Upload session ID (to abort session instead of deleting file) + schema: + type: string + responses: + '200': + description: Object deleted or session aborted + '403': + description: Access denied by storage policy + '404': + description: Object or session not found, or session not owned by this credential + '429': + $ref: '#/components/responses/BandwidthCapExceeded' + /storage/{bucketName}/{path}/visibility: + patch: + tags: + - Storage Objects + summary: Update file visibility (public/private) + description: | + Change whether a file is publicly accessible. Only the file owner or a service key can change visibility. + If the bucket defines UPDATE policies, the owner must also satisfy one of them. + + - Public files can be downloaded with just an anon key (no user authentication required) + - Private files (default) require authentication and must pass policy checks + - All downloads go through the Volcano API - there is no direct access to the underlying store + operationId: updateStorageObjectVisibility + security: + - ServiceRoleKey: [] + - AuthUserAccessToken: [] + parameters: + - $ref: '#/components/parameters/BucketName' + - name: path + in: path + required: true + description: Object path within bucket + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/StorageVisibilityRequest' + responses: + '200': + description: Visibility updated + content: + application/json: + schema: + $ref: '#/components/schemas/StorageObject' + '403': + description: Not the file owner or denied by the bucket's UPDATE policies + '404': + description: Object not found + '413': + description: Request body exceeds 16,384 bytes + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /public/{projectId}/{bucketName}/{path}: + get: + tags: + - Storage Objects + summary: Download a public file (no authentication required) + description: | + Download a file that has been marked as public. This endpoint requires NO authentication. + + **Access Requirements:** + - The file must have `is_public: true` set via the visibility endpoint + - Private files will return 403 Forbidden + + **Use Cases:** + - Shareable public URLs for profile pictures, public documents, etc. + - Embedding public files on external websites + - Direct linking without requiring SDK or authentication + + **URL Format:** + ``` + GET /public/{projectId}/{bucketName}/{path} + ``` + + **Example:** + ``` + https://api.volcano.dev/public/abc123/avatars/user-photo.jpg + ``` + + **CORS:** + This endpoint allows all origins since the file is already public. + operationId: downloadPublicFile + parameters: + - name: projectId + in: path + required: true + description: Project ID + schema: + type: string + format: uuid + - $ref: '#/components/parameters/BucketName' + - name: path + in: path + required: true + description: Object path within bucket + schema: + type: string + responses: + '200': + description: File content + content: + '*/*': + schema: + type: string + format: binary + '206': + description: Partial content (range request) + '404': + description: Not found (file doesn't exist or is not public) + '416': + $ref: '#/components/responses/StorageRangeNotSatisfiable' + '429': + $ref: '#/components/responses/BandwidthCapExceeded' + /health: + get: + tags: + - System + 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 + /capabilities: + get: + tags: + - System + summary: List capabilities + description: | + Lists which product capabilities accept new work in this environment. Check it + to decide what to offer, instead of calling a route to see whether it fails. + + | ID | Covers | + | --- | --- | + | `sandboxes` | The Sandbox API: presets, templates, sessions, and executions | + | `sandboxes.sessions` | Starting and resuming sessions, and one-shot executions | + | `sandboxes.custom_templates` | Deploying a custom template; its validation waits while `sandboxes.sessions` is unavailable | + | `sandboxes.network_isolation` | Creating sessions and one-shot executions with `network.egress` `deny_all`; existing `deny_all` sessions work either way | + | `sandboxes.output_not_kept` | Commands that keep no output: `keep_output: false` on a command, and `executions.keep_output: false` on a session; commands that keep output work either way | + | `issues` | The Issues API: listing, reading, and updating grouped runtime errors | + | `issues.create` | Writing an issue with `POST /issues`; written issues already recorded read and update either way | + | `lavaflow` | LavaFlow, which diagnoses a project's issues and opens pull requests that fix them. Here it reports cloud deployment readiness. Read `GET /projects/{id}/capabilities` for a project's eligibility. New projects start with LavaFlow off | + | `lavaflow.merge` | LavaFlow merging its fixes, with `autonomy: merge`. Requires LavaFlow availability. The project owner chooses merge autonomy | + | `lavaflow.lineage` | LavaFlow following up its fixes: linking a fix's recurrence or a new issue its deploy caused to the fix, the follow-up runs, and the lineage holds. Requires LavaFlow availability | + | `lavaflow.open_pr_ci_start` | Compatibility alias for `lavaflow.repository_ci`. The repository owner must grant permission separately | + | `lavaflow.repository_ci` | Normal repository CI availability specifically. Eligible fixes use it only after the owner grants `allow_ungated_workflows` for the connected repository and installation. The repository controls its CI and credential access. This capability does not authorize execution or prove a workflow ran | + | `lavaflow.code_quality` | LavaFlow Code Quality, which reviews the code each frontend production deploy changes. Here it reports only whether Code Quality is released in this environment; whether a project has it comes from `GET /projects/{id}/capabilities` | + | `lavaflow.slack` | Reporting problems to LavaFlow from Slack: installing the Volcano Slack app, connecting Slack identities, and binding channels to projects. Requires LavaFlow availability and a configured Slack app | + | `lavaflow.aikido` | LavaFlow fixing the security issues Aikido finds: connecting an Aikido workspace and binding projects to it. Requires LavaFlow availability | + | `functions.response_streaming` | Streaming an HTTP-mode function's response on its own URL as the function writes it | + | `frontend_routes` | Creating and changing Frontend routes; listing, deleting, and serving existing ones work either way | + | `frontends.candidates` | Creating, redeploying, promoting and rolling back to a frontend Candidate; reading, deleting and rolling back to the frontend's own runtime always work | + | `databases.migrations` | Starting migration runs and recording a baseline; reading history and runs works either way | + | `shares` | Creating, switching on and publishing shares, and forking one | + | `ai_gateway` | The Volcano AI gateway: creating a key that holds `ai.invoke` with `POST /projects/{id}/service-keys`, and minting the first run token of a run; reading, regenerating and deleting existing keys, and reading, extending, revoking and minting again for a run already minted for, work either way | + | `realtime.http_publish` | Publishing a message with `POST /realtime/v1/publish`; while Realtime is paused it stays available, and the route answers `503` `feature_paused` | + | `git_deploy.skip_unchanged` | A Git push leaving unchanged functions and frontends on their current deployments, as a project's `skip_unchanged` Git deploy setting asks; while it is unavailable every push deploys every function and frontend, and the setting still reads and saves | + + A capability missing from the list is unavailable, and a capability under + another, such as `sandboxes.sessions`, is unavailable whenever its parent is. + While a capability is unavailable, requests that start new work answer `404` + or `400` with code `feature_unavailable`; refresh this list when you receive + that code. Reading, deleting, and terminating what already exists keep + working unless the whole feature is absent from the environment. Every caller + in an environment gets the same answer; `GET /projects/{id}/capabilities` + answers for one project. + + `functions.response_streaming` refuses nothing: while it is unavailable, a + function's own URL still answers and sends a streamed response whole, once + the function finishes, up to 6 MiB with headers; a larger one fails the + invocation. Frontend Function routes stream either way. + + After these, the list names each first-party app Volcano runs in this + environment, such as `builder`, by its own ID. Such an app is available + while it accepts new work. When only the app's own release is off, work + it already accepted continues; when first-party app mounts are off, its + mount refuses every request with 404 `feature_unavailable`. + operationId: listCapabilities + security: [] + responses: + '200': + description: Capabilities in this environment + content: + application/json: + schema: + $ref: '#/components/schemas/CapabilityList' + example: + data: + - id: sandboxes + status: available + - id: sandboxes.sessions + status: available + - id: sandboxes.custom_templates + status: unavailable + - id: sandboxes.network_isolation + status: available + - id: sandboxes.output_not_kept + status: available + - id: issues + status: available + - id: functions.response_streaming + status: available + - id: frontend_routes + status: available + - id: frontends.candidates + status: unavailable + - id: databases.migrations + status: available + - id: shares + status: unavailable + - id: ai_gateway + status: unavailable + /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: A JSON-RPC response object + content: + application/json: + schema: + 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 + scheme: bearer + bearerFormat: JWT + description: | + Project-specific public key for frontend authentication. + Required for signup, signin, refresh, and logout endpoints. + Get from Project Settings → Authentication → Anon Keys. + Safe to expose in frontend code (scoped to project, limited permissions). + AuthUserAccessToken: + type: http + scheme: bearer + bearerFormat: JWT + description: | + Auth user access token obtained from signup/signin. + Used for authenticated function invocation and user profile access. + Functions invoked with access tokens receive user context in event.__volcano_auth. + Expires after configured lifetime (default: 1 hour). + ServiceRoleKey: + type: http + scheme: bearer + bearerFormat: JWT + description: | + Service role key for admin operations. + **WARNING:** Bypasses Row-Level Security - backend use only! + Create via POST /projects/{id}/service-keys. + Used for function invocation with full database access. + UserToken: + type: http + scheme: bearer + 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: | + 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: + AuthProxyAuthorization: + name: X-Volcano-Proxy-Authorization + in: header + required: false + description: | + Trusted server-side auth proxy credential in `Bearer SERVICE_KEY` + form. When supplied, `X-Volcano-Client-IP` is also required. The service + key must belong to the anon key's project and hold this operation's scope: + `auth.signup` for signup and anonymous signup, `auth.signin` for signin + and OAuth code exchange, `auth.refresh` for refresh, `auth.logout` for + logout, and `auth.password_reset` for forgot-password and reset-password. + The password policy accepts any service key for the project. Never expose + a service key to browser code. + schema: + type: string + AuthProxyClientIP: + name: X-Volcano-Client-IP + in: header + required: false + description: | + Original browser IPv4 or IPv6 address supplied by a trusted server-side + auth proxy. The proxy must derive this value from its platform-verified + request metadata, never from a browser-supplied header. Requires a valid + `X-Volcano-Proxy-Authorization` header. + schema: + type: string + BackupName: + name: backupName + in: path + required: true + schema: + type: string + minLength: 1 + maxLength: 128 + description: | + Backup name, unique within the database, exactly as returned by the list + endpoint. + + Deliberately looser than the names you can create: a backup made by a + schedule is named for you, so reading or deleting one accepts any name a + backup can have. + BranchName: + name: branchName + in: path + required: true + schema: + type: string + pattern: ^[a-z0-9_]+$ + maxLength: 64 + description: Branch name (unique within the parent database, lowercase letters, numbers, and underscores only) + BucketName: + name: bucketName + in: path + required: true + schema: + type: string + pattern: ^[a-zA-Z0-9_-]+$ + minLength: 1 + maxLength: 64 + description: Storage bucket name + Cursor: + name: cursor + in: query + required: false + schema: + type: string + description: | + Opaque keyset pagination cursor from a previous response's `next_cursor` + — pages forward. Mutually exclusive with `page` and `ending_before`; + combining them returns 400. When supplied, the request's `search` and + `limit` must match the values bound to the cursor or the request returns 400. + EndingBefore: + name: ending_before + in: query + required: false + schema: + type: string + description: | + Opaque keyset pagination cursor from a previous response's `prev_cursor` + — pages backward (the page immediately preceding this cursor). Mutually + exclusive with `page` and `cursor`; combining them returns 400. `search` + and `limit` must match the values bound to the cursor or the request + returns 400. + DatabaseName: + name: databaseName + in: path + required: true + schema: + type: string + pattern: ^[a-z0-9_]+$ + maxLength: 64 + description: Database name (unique within project, lowercase letters, numbers, and underscores only) + DeploymentId: + name: deploymentId + in: path + required: true + schema: + type: string + format: uuid + description: Frontend deployment ID + SessionListPage: + name: page + in: query + description: | + Page number (1-indexed). Omit it for the first page, and always with + `cursor` or `ending_before`. + schema: + type: integer + minimum: 1 + SessionListLimit: + name: limit + in: query + description: Number of sessions per page (max 100, default 20) + schema: + type: integer + minimum: 1 + maximum: 100 + SessionListSort: + name: sort + in: query + description: | + Sort key. `last_activity` (default) orders by most recent activity and + supports offset pagination only. `created_at` orders by session start + and supports both offset and cursor pagination. + schema: + type: string + enum: + - last_activity + - created_at + default: last_activity + SessionListStatus: + name: status + in: query + description: | + Filter by whether the session can still be refreshed. Omit for every + stored session, including expired ones. `expired` is not supported + with cursor pagination. + schema: + type: string + enum: + - active + - expired + SessionListCursor: + name: cursor + in: query + description: | + Opaque keyset cursor from a previous response's `next_cursor`. Requires + `sort=created_at`; mutually exclusive with `page` and `ending_before`. + schema: + type: string + SessionListEndingBefore: + name: ending_before + in: query + description: | + Opaque keyset cursor from a previous response's `prev_cursor`, paging + backward. Requires `sort=created_at`; mutually exclusive with `page` + and `cursor`. + schema: + type: string + SessionListOffset: + name: offset + in: query + description: | + Bounded number of rows to skip past the cursor anchor (the hybrid + jump, maximum 100000). Ignored unless `cursor` or `ending_before` is + supplied. + schema: + type: integer + minimum: 0 + maximum: 100000 + VariableEnvironmentId: + name: environmentId + in: path + required: true + schema: + type: string + format: uuid + description: Variable Environment ID + FrontendId: + name: frontendId + in: path + required: true + schema: + type: string + format: uuid + description: Frontend ID + FrontendCandidateId: + name: candidateId + in: path + required: true + schema: + type: string + format: uuid + description: Frontend Candidate ID + FunctionCandidateId: + name: candidateId + in: path + required: true + schema: + type: string + format: uuid + description: Function preview (Candidate) ID + FrontendFunctionRouteId: + name: routeId + in: path + required: true + schema: + type: string + format: uuid + description: Frontend Function route ID + FrontendRouteId: + name: routeId + in: path + required: true + schema: + type: string + format: uuid + description: Frontend route ID + FrontendCustomDomainHostname: + name: domain + in: path + required: true + schema: + type: string + minLength: 1 + maxLength: 253 + description: The custom domain's hostname, such as `www.example.com` + FunctionId: + name: functionId + in: path + required: true + schema: + type: string + format: uuid + description: Function ID + DurableFunctionId: + name: functionId + in: path + required: true + schema: + type: string + description: Durable function ID, or its name within the project + DurableExecutionId: + name: executionId + in: path + required: true + schema: + type: string + format: uuid + description: Durable execution ID + DurableApprovalId: + name: approvalId + in: path + required: true + schema: + type: string + format: uuid + description: Durable approval ID + IssueId: + name: issueId + in: path + required: true + schema: + type: string + format: uuid + description: Issue ID + IssueCursor: + name: cursor + in: query + required: false + schema: + type: string + description: | + Opaque cursor from a previous response's `next_cursor`. Pages forward; + keep the same filters while paging. + DurableApprovalFunctionFilter: + name: function + in: query + required: false + schema: + type: string + minLength: 1 + maxLength: 255 + description: | + Only approvals requested by this durable function, given by id or by + name. A name also matches approvals from a deleted function of that + name. + DurableMessageIdempotencyKey: + name: Idempotency-Key + in: header + required: false + description: | + Makes a send safe to retry. A repeat with a key the same sender has + used on the execution returns the first message and sends nothing. + Keys of different senders never collide. Up to 255 printable ASCII + characters. + schema: + type: string + minLength: 1 + maxLength: 255 + pattern: ^[ -~]+$ + DurableClientToken: + name: X-Volcano-Client-Token + in: header + required: false + description: | + The `client_token` the execution's start returned. Lets an anon key, a + service key scoped to a list without `*`, or a user who did not start + the execution, reach it. + schema: + type: string + maxLength: 128 + DurableMessageDirectionFilter: + name: direction + in: query + required: false + description: Return only messages travelling this way. + schema: + $ref: '#/components/schemas/DurableMessageDirection' + DurableMessageNameFilter: + name: name + in: query + required: false + description: Return only messages with this name. + schema: + $ref: '#/components/schemas/DurableMessageName' + DurableMessageAfter: + name: after + in: query + required: false + description: Return only messages whose `seq` is greater than this. + schema: + type: integer + format: int64 + minimum: 0 + default: 0 + DurableMessageLimit: + name: limit + in: query + required: false + description: Most messages to return. + schema: + type: integer + minimum: 1 + maximum: 500 + default: 100 + Limit: + name: limit + in: query + required: false + schema: + type: integer + minimum: 1 + maximum: 100 + default: 10 + description: Number of items per page (max 100) + LockKey: + name: key + in: path + required: true + description: Project-local lock name. + schema: + type: string + minLength: 1 + maxLength: 128 + pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$ + LockToken: + name: X-Volcano-Lock-Token + in: header + required: true + description: Opaque UUID generated once by the caller and retained for the lease lifetime. + schema: + type: string + format: uuid + LockRequestId: + name: X-Volcano-Request-Id + in: header + required: true + description: | + UUID correlating this request across client and server logs. Repeat safety comes from + the lock token, so a retry under a reused request ID still counts against the quota. + schema: + type: string + format: uuid + DeploymentOperation: + name: operation + in: query + required: false + description: Restrict a deployment feed to one kind of operation. + schema: + type: string + enum: + - deploy + - redeploy + - update + - delete + DeploymentOwnerId: + name: owner_id + in: query + required: false + description: | + The user who owns the projects whose deployments to return + (`projects.user_id`). This is ownership, not the actor that started the + deployment — see `initiated_by_user_id` for that. Not a UUID: platform + user ids are opaque strings. + schema: + type: string + maxLength: 255 + DeploymentOrder: + name: order + in: query + required: false + description: | + Sort key and direction. `created_at.desc` (default) is the feed order. + `completed_at.asc` orders finished attempts by completion, oldest first, + and excludes attempts that never completed. + schema: + type: string + enum: + - created_at.desc + - completed_at.asc + default: created_at.desc + DeploymentResourceType: + name: resource_type + in: query + required: false + description: | + Restrict a deployment feed to a single resource type. Omit to return + both Function and Frontend deployments. + schema: + type: string + enum: + - function + - frontend + FunctionKindFilter: + name: function_kind + in: query + required: false + description: | + Restrict results to functions of one kind. Omit to include both + standard and durable functions. + schema: + $ref: '#/components/schemas/FunctionKindFilter' + DeploymentStatus: + name: status + in: query + required: false + description: Restrict a deployment feed to attempts in one status. + schema: + type: string + enum: + - queued + - provisioning + - active + - degraded + - failed + - superseded + - deleting + - deleted + Offset: + name: offset + in: query + required: false + schema: + type: integer + minimum: 0 + default: 0 + description: | + Bounded row offset past the keyset anchor named by `cursor` (forward) or + `ending_before` (backward) — the hybrid jump. Seek to the anchor, then + skip this many rows within. Used for numbered jump-to-page: from the + current page, seek to its next/prev cursor and offset the remaining + pages. Only honored on the cursor pagination path; ignored otherwise. + Page: + name: page + in: query + required: false + schema: + type: integer + minimum: 1 + description: | + 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. + LavaflowDays: + name: days + in: query + required: false + schema: + type: integer + minimum: 1 + maximum: 217 + default: 30 + description: Number of UTC days in the window, ending today. + LavaflowResourceIdFilter: + name: resource_id + in: query + required: false + schema: + type: string + format: uuid + description: Only runs for issues of this resource. + LavaflowRunId: + name: run_id + in: path + required: true + schema: + type: string + format: uuid + description: LavaFlow run ID + LavaflowRunCursor: + name: cursor + in: query + required: false + schema: + type: string + description: | + Opaque cursor from a previous response's `next_cursor`. Pages forward, + and works only for the same `project_id` and caller; keep the same + filters while paging. + LavaflowRunLimit: + name: limit + in: query + required: false + schema: + type: integer + minimum: 1 + maximum: 100 + default: 25 + description: Number of runs per page (max 100) + LavaflowScanLimit: + name: limit + in: query + required: false + schema: + type: integer + minimum: 1 + maximum: 100 + default: 25 + description: Number of scans per page (max 100) + LavaflowRunStatusFilter: + name: status + in: query + required: false + schema: + $ref: '#/components/schemas/LavaflowRunStatus' + description: Only runs in this status. + SlackRedirect: + name: redirect + in: query + required: false + description: Where to send the browser after Slack's callback. It must be on the Volcano dashboard's origin, or `http` to `127.0.0.1` or `[::1]` with a port. + schema: + type: string + LavaflowCategoryFilter: + name: category + in: query + required: false + schema: + type: string + enum: + - bug + - performance + - security + - improvement + - configuration + - dependency + - external + - uncategorized + description: Only runs in this category; `uncategorized` for runs without one. + LavaflowInvolvedResourceFilter: + name: involved_resource_id + in: query + required: false + schema: + type: string + format: uuid + description: 'Only runs that involve this function, durable function or frontend in any role: the issue came from it, the diagnosis traced the cause to it, or the fix changes it.' + LavaflowIssueIdFilter: + name: issue_id + in: query + required: false + schema: + type: string + format: uuid + description: Only runs on this issue. An issue the project doesn't have answers `404`, like an unknown issue. + LavaflowPullRequestStateFilter: + name: pull_request_state + in: query + required: false + schema: + type: string + enum: + - open + - merged + - closed + - none + description: Only runs whose pull request is in this state; `none` for runs without one. + LavaflowRunDays: + name: days + in: query + required: false + schema: + type: integer + minimum: 1 + maximum: 90 + description: Only runs created in the last `days` UTC days, today included. Omit for every run. + LavaflowRunOrder: + name: order + in: query + required: false + schema: + type: string + enum: + - created_at.desc + - created_at.asc + - issue_events.desc + default: created_at.desc + description: '`created_at.desc` is newest first and `created_at.asc` oldest first. `issue_events.desc` orders by the issue''s current `event_count`, most first, then newest first. That count grows as errors arrive or scans see a finding again, so paging this order can skip runs, not only move them between pages. To read every run, for an export say, page `created_at.desc` or `created_at.asc`. A cursor works only with the order it came from.' + LavaflowRunInclude: + name: include + in: query + required: false + style: form + explode: false + schema: + type: array + uniqueItems: true + items: + type: string + enum: + - counts + description: '`counts` adds `counts` to the response. Ask on the first page; the counts don''t depend on the cursor.' + ProjectId: + name: id + in: path + required: true + schema: + type: string + format: uuid + description: Project ID + ProjectIdQuery: + name: project_id + in: query + required: true + schema: + type: string + format: uuid + description: The project to read. A project the caller can't read answers like one that doesn't exist. + ConnectorId: + name: connector_id + in: path + required: true + description: The connector's ID, from listing connectors + schema: + type: string + format: uuid + ItemProjectIdQuery: + name: project_id + in: query + required: false + schema: + type: string + format: uuid + description: Optional. The item's own project authorizes the request; when given, the item must belong to this project, or it answers like an unknown one. + ShareId: + name: share_id + in: path + required: true + schema: + type: string + pattern: ^[A-Za-z0-9]{12}$ + description: Share ID, the 12 characters at the end of the share's deploy URL + ShareIdQuery: + name: share_id + in: query + required: true + schema: + type: string + pattern: ^[A-Za-z0-9]{12}$ + description: The share to read. The share's own project authorizes the read; a share the caller can't read answers like one that doesn't exist. + ShareReleaseCursor: + name: cursor + in: query + required: false + schema: + type: string + description: | + Opaque cursor from a previous response's `next_cursor`. Pages forward, and + works only for the same `share_id` and `limit`. + TokenId: + name: tokenId + in: path + required: true + schema: + type: string + format: uuid + description: Project access token ID + Search: + name: search + in: query + required: false + schema: + type: string + maxLength: 256 + description: | + Case-insensitive substring match on the resource `name`. See the + endpoint description for supported pagination modes. + RestoreId: + name: restoreId + in: path + required: true + schema: + type: string + format: uuid + description: Database restore ID + MigrationRunId: + name: runId + in: path + required: true + schema: + type: string + format: uuid + description: Database migration run ID + SchedulerId: + name: schedulerId + in: path + required: true + schema: + type: string + format: uuid + description: Function scheduler ID + VariableName: + name: name + in: path + required: true + schema: + type: string + minLength: 1 + maxLength: 256 + pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$ + description: Variable name. Function runtime names such as AWS_REGION are reserved and cannot be updated. + 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: + StorageRangeNotSatisfiable: + description: The requested byte range does not overlap the file content. + headers: + Content-Range: + description: Current file size as `bytes */size`, when available. + schema: + type: string + pattern: ^bytes \*/\d+$ + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + 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 + ingress + egress across owned projects). Enforcement is eventual: + requests are rejected until the allowance increases or the next + anniversary cycle begins. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + DatabaseQueryCapExceeded: + description: | + The query was rejected by a billing-cycle allowance: either the owning + platform user's bandwidth allowance (aggregate ingress + egress across + owned projects) or their database-request allowance. Enforcement is + eventual: queries are rejected until the allowance increases or the + next anniversary cycle begins. The error message identifies the resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + DatabaseBranchQueryUnavailable: + description: | + The database or branch cannot currently serve queries, or connection + capacity was unavailable before the statement could execute. Capacity + refusals and the five-second acquisition timeout return `Retry-After: 1` + and `Database capacity temporarily unavailable; query was not executed`. + Wait at least the indicated seconds and use bounded backoff with jitter. + Provisioning, resetting, expired branches and restoring parents can also + return 503 without Retry-After. A 503 alone does not mean a write is safe + to replay; only the explicit pre-execution capacity response does. + headers: + Retry-After: + description: Present only for pre-execution capacity failures; minimum seconds before retrying. + schema: + type: integer + minimum: 1 + content: + 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: + AccountSession: + type: object + description: A sign-in to your Volcano account, from the CLI or a browser. + properties: + id: + type: string + format: uuid + description: Unique session identifier + user_id: + type: string + format: uuid + description: | + The sign-in identity (auth user) the session belongs to. This is + not your account ID: an identity linked to your account has its + own ID. + provider: + type: string + description: | + How the session was created: `email`, `google`, `github`, + `microsoft`, `apple`, or `device:` for a device-code + login such as the `volcano` CLI. More values may be added; use + `kind` to tell CLI logins from browser sign-ins. + example: github + kind: + type: string + description: | + `cli` for a device-code login, such as `volcano login`, and + `browser` for every other sign-in. + enum: + - cli + - browser + example: cli + user_agent: + type: string + description: Browser/device user agent string + ip_address: + type: string + description: IP address of the client when the session was created + last_ip_address: + type: string + description: IP address of the most recent activity (token refresh) + expires_at: + type: string + format: date-time + description: When this session expires + last_activity_at: + type: string + format: date-time + description: Last activity timestamp + session_started_at: + type: string + format: date-time + description: When the session was created + is_active: + type: boolean + description: Whether the session is currently active (not expired) + is_current: + type: boolean + description: Whether this is the session making the current request + created_at: + type: string + format: date-time + updated_at: + type: string + format: date-time + required: + - id + - user_id + - provider + - kind + - expires_at + - is_active + - is_current + AccountSessionList: + type: object + description: | + A page of sessions. Without `sort` the body is the legacy + `sessions`/`total`/`page`/`limit`/`total_pages` shape; with + `sort=created_at` and a cursor it is the shared `data` envelope. + properties: + sessions: + type: array + items: + $ref: '#/components/schemas/AccountSession' + total: + type: integer + description: Total number of sessions + page: + type: integer + description: Current page number + limit: + type: integer + description: Number of sessions per page + total_pages: + type: integer + description: Total number of pages + data: + type: array + description: Sessions for this page (cursor pagination only) + items: + $ref: '#/components/schemas/AccountSession' + has_more: + type: boolean + description: Whether a further page exists (cursor pagination only) + next_cursor: + type: string + description: Opaque cursor for the next page (cursor pagination only) + prev_cursor: + type: string + description: Opaque cursor for the previous page (cursor pagination only). Send as `ending_before`. + SandboxPreset: + type: object + additionalProperties: false + properties: + id: + type: string + runtime: + type: string + version: + type: string + memory_mb: + type: integer + enum: + - 1024 + - 2048 + regions: + type: array + items: + type: string + required: + - id + - runtime + - version + - memory_mb + - regions + SandboxTemplate: + type: object + additionalProperties: false + properties: + id: + type: string + format: uuid + project_id: + type: string + format: uuid + name: + type: string + pattern: ^[a-z][a-z0-9-]{0,62}$ + preset: + type: string + memory_mb: + type: integer + status: + type: string + enum: + - ready + - unavailable + - deleting + x-enum-varnames: + - SandboxTemplateStatusReady + - SandboxTemplateStatusUnavailable + - SandboxTemplateStatusDeleting + created_at: + type: string + format: date-time + required: + - id + - project_id + - name + - status + - created_at + CreateSandboxTemplateRequest: + type: object + additionalProperties: false + properties: + name: + type: string + pattern: ^[a-z][a-z0-9-]{0,62}$ + preset: + type: string + description: Preset ID from the available Sandbox preset catalog. + memory_mb: + type: integer + enum: + - 1024 + - 2048 + default: 1024 + required: + - name + - preset + UpdateSandboxTemplateRequest: + type: object + additionalProperties: false + properties: + name: + type: string + pattern: ^[a-z][a-z0-9-]{0,62}$ + required: + - name + SandboxSession: + type: object + additionalProperties: false + properties: + id: + type: string + format: uuid + project_id: + type: string + format: uuid + last_error_code: + type: string + description: Last recorded lifecycle reason, such as sandbox_run_hook_timeout or sandbox_authority_or_expiry. Historical information, not a current error; use state for the current session state. Retained when later observations supply no reason, including after termination or recovery. Omitted when no reason is known. Values may be added; this field does not imply whether a command ran or whether it can be retried. + sandbox_id: + type: string + format: uuid + nullable: true + description: Explicit template used to create the session. Null when created directly from a preset. + state: + type: string + enum: + - starting + - running + - suspending + - suspended + - resuming + - terminating + - terminated + - unknown + desired_state: + type: string + enum: + - running + - suspended + - terminated + region: + type: string + memory_mb: + type: integer + created_at: + type: string + format: date-time + started_at: + type: string + format: date-time + expires_at: + type: string + format: date-time + nullable: true + description: Absolute VM expiry. Null means unlimited in local mode. + network: + $ref: '#/components/schemas/SandboxSessionNetwork' + executions: + $ref: '#/components/schemas/SandboxSessionExecutions' + limits: + $ref: '#/components/schemas/SandboxSessionAppliedLimits' + required: + - id + - project_id + - sandbox_id + - state + - desired_state + - region + - memory_mb + - created_at + - expires_at + - network + - executions + SandboxSessionNetwork: + type: object + additionalProperties: false + properties: + egress: + type: string + enum: + - default + - deny_all + description: The outbound network policy the session was created with. It never changes. + applied: + type: string + enum: + - default + - deny_all + - unknown + description: The outbound network policy Volcano last observed on the session's VM, never the request alone. It is `unknown` until the session is first observed, from a suspend or resume request until it is observed again, briefly while Volcano rolls out an update, and whenever the observation does not match the request. A terminated session keeps what Volcano last observed, so a `deny_all` session ended because Volcano observed outbound access reads `default`. A session first reports `state` `running` only once its network has been observed. To depend on `deny_all`, wait for `running`, then terminate the session unless `applied` is `deny_all`. Act on `applied` only while the session is `running`, and on a later `unknown` only while `desired_state` is `running`. + required: + - egress + - applied + SandboxSessionNetworkRequest: + type: object + additionalProperties: false + description: Outbound network policy for the session. Omitting `network` is the same as `egress` `default`. + properties: + egress: + type: string + enum: + - default + - deny_all + x-enum-varnames: + - SandboxSessionNetworkRequestEgressDefault + - SandboxSessionNetworkRequestEgressDenyAll + description: '`default` gives the session the region''s standard outbound internet access. `deny_all` gives it no outbound network for its whole lifetime: DNS lookups, internet and link-local addresses, and connections back out through Volcano all fail, and the session accepts no port access. Commands, files and the rest of the session API work as usual. The policy cannot be changed after creation; suspend and resume keep it. Check `network.applied` before relying on it. Where `GET /capabilities` lists `sandboxes.network_isolation` as unavailable, `deny_all` answers `400` with code `feature_unavailable`.' + required: + - egress + CreateSandboxSessionRequest: + type: object + additionalProperties: false + properties: + preset: + type: string + description: Preset ID from the available Sandbox preset catalog. + sandbox_id: + type: string + format: uuid + memory_mb: + description: Baseline memory in MiB. Cloud HOBBY supports 1024; SUPERAGENT supports 1024 or 2048. Omission uses the preset or template default; a template requiring more than the plan permits is rejected. Local sessions are exempt from cloud plan limits. + type: integer + enum: + - 1024 + - 2048 + region: + type: string + pattern: ^(aws-)?[a-z]{2}(-[a-z]+)+-[0-9]+$ + description: Region such as `us-east-1`, from the preset catalog. Region IDs issued by earlier versions of the API are still accepted. A temporarily unavailable region answers 400 with code `sandbox_region_unavailable`. + max_duration_seconds: + type: integer + minimum: 0 + maximum: 2147483647 + description: Inherits the template TTL when omitted (cloud default 3600 seconds; local default 0, unlimited). Cloud HOBBY accepts 30–3600 seconds; SUPERAGENT accepts 30–28800 seconds. Inherited template defaults are clamped to the plan limit; explicit values above it are rejected. Local accepts 0 for unlimited or a positive lifetime. + network: + $ref: '#/components/schemas/SandboxSessionNetworkRequest' + executions: + $ref: '#/components/schemas/SandboxSessionExecutions' + limits: + $ref: '#/components/schemas/SandboxSessionLimits' + required: + - region + oneOf: + - required: + - preset + not: + required: + - sandbox_id + - required: + - sandbox_id + not: + required: + - preset + SandboxSessionLimits: + type: object + additionalProperties: false + minProperties: 1 + description: | + Caps the session's code runs under, enforced inside the session. Each + cap is an upper bound; the session's own size still bounds both. + properties: + vcpus: + type: integer + minimum: 1 + maximum: 4 + description: | + CPU time the session's commands and template service may use + together, in vCPUs. A 1024 MiB session has 2 vCPUs and a 2048 MiB + session has 4; asking for more answers 400 with code + `sandbox_limits_exceed_session`. + disk_mib: + type: integer + minimum: 64 + maximum: 6144 + description: | + Space the session can write beyond its image's contents, in MiB. + It covers every path commands and the template service can write, + including `/workspace` and `/tmp`. A write past it fails with + `ENOSPC`. `/dev/shm` is memory, capped separately at 64 MiB. + SandboxSessionAppliedLimits: + type: object + additionalProperties: false + description: | + The caps the session enforces, as the session reports them. Present only + when the session was created with `limits`. The session stays + `starting` until `applied` is known. + properties: + vcpus: + type: integer + description: Enforced vCPU cap. Never higher than requested; lower when the session has fewer vCPUs. + disk_mib: + type: integer + description: Enforced disk cap in MiB. Never higher than requested; lower when the session's disk has less free space. + applied: + $ref: '#/components/schemas/SandboxLimitsApplied' + required: + - applied + SandboxLimitsApplied: + type: string + description: | + `enforced` when every requested cap is enforced, `not_enforced` when the + session could not enforce them, and `unknown` until the session reports. + Terminate a session that reports anything but `enforced` if you rely on + the caps. + enum: + - enforced + - not_enforced + - unknown + x-enum-varnames: + - SandboxLimitsEnforced + - SandboxLimitsNotEnforced + - SandboxLimitsUnknown + SandboxCommandRequest: + type: object + additionalProperties: false + properties: + command: + type: string + minLength: 1 + maxLength: 65536 + timeout_seconds: + type: integer + minimum: 0 + maximum: 2147483647 + description: Command execution time from process start. Cloud defaults to 60 seconds and accepts 1–28800; local defaults to 0 (unlimited) and accepts nonnegative values. VM expiry always takes precedence. Cloud synchronous requests must return within the public connection idle limit (1000 seconds); use a session with a background process and short polling requests for longer work. + environment: + type: object + additionalProperties: + type: string + maxProperties: 64 + keep_output: + type: boolean + description: Set false to keep no output. stdout and stderr are returned once in this response, and Volcano's control plane never stores them in the execution journal, database, logs or traces. This does not cover the Sandbox's memory or a suspended session's snapshot. A retry with the same Idempotency-Key returns the exit code with `output_kept` false and empty streams, without running the command again. Omit it to use the session's `executions.keep_output`. True in a session that keeps no output is refused with 400 and code `sandbox_session_keeps_no_output`. False is refused with 400 and code `feature_unavailable` while the `sandboxes.output_not_kept` capability is unavailable. + required: + - command + SandboxExecutionRequest: + type: object + additionalProperties: false + properties: + preset: + type: string + description: Preset ID from the available Sandbox preset catalog. + sandbox_id: + type: string + format: uuid + memory_mb: + description: Baseline memory in MiB. Cloud HOBBY supports 1024; SUPERAGENT supports 1024 or 2048. Omission uses the preset or template default; a template requiring more than the plan permits is rejected. Local sessions are exempt from cloud plan limits. + type: integer + enum: + - 1024 + - 2048 + region: + type: string + pattern: ^(aws-)?[a-z]{2}(-[a-z]+)+-[0-9]+$ + description: Region such as `us-east-1`, from the preset catalog. Region IDs issued by earlier versions of the API are still accepted. A temporarily unavailable region answers 400 with code `sandbox_region_unavailable`. + max_duration_seconds: + type: integer + minimum: 0 + maximum: 2147483647 + description: Absolute VM lifetime including startup, bounded by environment capacity policy. Inherits the template TTL when omitted (cloud default 3600 seconds; local default 0, unlimited). Cloud HOBBY accepts 30–3600 seconds; SUPERAGENT accepts 30–28800 seconds. Inherited template defaults are clamped to the plan limit; explicit values above it are rejected. Local accepts 0 for unlimited or a positive lifetime. The VM is reclaimed early when the command finishes. + command: + type: string + minLength: 1 + maxLength: 65536 + timeout_seconds: + type: integer + minimum: 0 + maximum: 2147483647 + description: Command execution time from process start. Cloud defaults to 60 seconds and accepts 1–28800; local defaults to 0 (unlimited) and accepts nonnegative values. VM expiry always takes precedence. Cloud synchronous requests must return within the public connection idle limit (1000 seconds); use a session with a background process and short polling requests for longer work. + environment: + type: object + additionalProperties: + type: string + maxProperties: 64 + network: + $ref: '#/components/schemas/SandboxSessionNetworkRequest' + keep_output: + type: boolean + default: true + description: Set false to keep no output. stdout and stderr are returned once in this response, and Volcano's control plane never stores them in the execution journal, database, logs or traces. This does not cover the Sandbox's memory or a suspended session's snapshot. A retry with the same Idempotency-Key returns the exit code with `output_kept` false and empty streams, without running the command again. False is refused with 400 and code `feature_unavailable` while the `sandboxes.output_not_kept` capability is unavailable. + required: + - region + - command + oneOf: + - required: + - preset + not: + required: + - sandbox_id + - required: + - sandbox_id + not: + required: + - preset + SandboxCommandResult: + type: object + additionalProperties: false + properties: + stdout: + type: string + description: The first 1 MiB (1,048,576 bytes) the command wrote to stdout. Empty in a replay of a command that kept no output. + stderr: + type: string + description: The first 1 MiB (1,048,576 bytes) the command wrote to stderr. Empty in a replay of a command that kept no output. + exit_code: + type: integer + stdout_truncated: + type: boolean + description: True when the command wrote more than 1 MiB to stdout. False in a replay of a command that kept no output. + stderr_truncated: + type: boolean + description: True when the command wrote more than 1 MiB to stderr. False in a replay of a command that kept no output. + timed_out: + type: boolean + output_kept: + type: boolean + description: False when the command kept no output. Its streams appear only in the response to the request that ran it, and Volcano's control plane never stores them in the execution journal, database, logs or traces. This does not cover the Sandbox's memory or a suspended session's snapshot. A retry with the same Idempotency-Key returns them empty. + required: + - stdout + - stderr + - exit_code + - stdout_truncated + - stderr_truncated + - timed_out + - output_kept + SandboxExecutionResult: + type: object + additionalProperties: false + properties: + stdout: + type: string + description: The first 1 MiB (1,048,576 bytes) the command wrote to stdout. Empty in a replay of a command that kept no output. + stderr: + type: string + description: The first 1 MiB (1,048,576 bytes) the command wrote to stderr. Empty in a replay of a command that kept no output. + exit_code: + type: integer + stdout_truncated: + type: boolean + description: True when the command wrote more than 1 MiB to stdout. False in a replay of a command that kept no output. + stderr_truncated: + type: boolean + description: True when the command wrote more than 1 MiB to stderr. False in a replay of a command that kept no output. + timed_out: + type: boolean + output_kept: + type: boolean + description: False when the command kept no output. Its streams appear only in the response to the request that ran it, and Volcano's control plane never stores them in the execution journal, database, logs or traces. This does not cover the Sandbox's memory or a suspended session's snapshot. A retry with the same Idempotency-Key returns them empty. + session_id: + type: string + format: uuid + region: + type: string + duration_ms: + type: integer + format: int64 + minimum: 0 + required: + - stdout + - stderr + - exit_code + - stdout_truncated + - stderr_truncated + - timed_out + - output_kept + - session_id + - region + - duration_ms + SandboxFileWriteRequest: + type: object + additionalProperties: false + properties: + path: + type: string + minLength: 1 + maxLength: 4096 + data: + type: string + format: byte + maxLength: 11184812 + required: + - path + - data + SandboxFileReadRequest: + type: object + additionalProperties: false + properties: + path: + type: string + minLength: 1 + maxLength: 4096 + required: + - path + SandboxFileResult: + type: object + additionalProperties: false + properties: + data: + type: string + format: byte + required: + - data + SandboxFileArchiveForm: + type: object + description: Send `project_id`, `session_id` and `path`, in any order, then the `archive` part. + properties: + project_id: + type: string + format: uuid + session_id: + type: string + format: uuid + path: + type: string + minLength: 1 + maxLength: 4096 + description: Workspace directory to extract into, relative to `/workspace`. It must name a directory below the workspace root; a path that resolves to the root or to `/`, such as `.`, `./`, `/`, `/workspace` or `/workspace/.`, is refused. + archive: + type: string + format: binary + description: A tar archive, optionally gzip-compressed. + required: + - project_id + - session_id + - path + - archive + SandboxFileArchive: + type: object + additionalProperties: false + properties: + project_id: + type: string + format: uuid + session_id: + type: string + format: uuid + path: + type: string + files: + type: integer + format: int64 + minimum: 0 + description: Regular files written. + bytes: + type: integer + format: int64 + minimum: 0 + description: Bytes of file content written. + required: + - project_id + - session_id + - path + - files + - bytes + SandboxFilePartRequest: + type: object + additionalProperties: false + properties: + project_id: + type: string + format: uuid + session_id: + type: string + format: uuid + path: + type: string + minLength: 1 + maxLength: 4096 + description: Workspace file to write, relative to `/workspace`. + offset: + type: integer + format: int64 + minimum: 0 + description: Byte offset of this part's data in the file. + size: + type: integer + format: int64 + minimum: 1 + maximum: 1073741824 + description: Size of the whole file in bytes, at most 1 GiB. + sha256: + type: string + pattern: ^[0-9a-f]{64}$ + description: Lowercase hex SHA-256 of the whole file. + data: + type: string + format: byte + minLength: 4 + maxLength: 11184812 + description: This part's bytes, at most 8 MiB. + required: + - project_id + - session_id + - path + - offset + - size + - sha256 + - data + SandboxFilePart: + type: object + additionalProperties: false + properties: + project_id: + type: string + format: uuid + session_id: + type: string + format: uuid + path: + type: string + offset: + type: integer + format: int64 + minimum: 0 + size: + type: integer + format: int64 + minimum: 1 + received: + type: integer + format: int64 + minimum: 1 + description: Bytes of the file received through the end of this part. + complete: + type: boolean + description: True when this part finished the file and it is now at `path`. + required: + - project_id + - session_id + - path + - offset + - size + - received + - complete + SandboxFileEntry: + type: object + additionalProperties: false + properties: + path: + type: string + description: Path relative to the workspace root, usable with the read and write file routes. + type: + type: string + enum: + - file + - directory + - symlink + - other + description: Entry type from the entry itself. A symlink is reported, never followed. + size: + type: integer + format: int64 + minimum: 0 + description: Size in bytes of a regular file; 0 for every other type. + mode: + type: integer + minimum: 0 + maximum: 4095 + description: Permission bits, including setuid, setgid and sticky (`st_mode & 07777`). For example, 420 is `0644` and 493 is `0755`. + sha256: + type: string + pattern: ^[0-9a-f]{64}$ + description: Lowercase hex SHA-256 of a regular file's content, present only when `include_sha256` is true and the file could be hashed. + sha256_skipped: + type: string + enum: + - budget + - changing + - unreadable + description: Why a regular file has no `sha256` when `include_sha256` is true. `budget` is a file over 256 MiB. `changing` is a file that changed while it was hashed or kept changing; list it again later. `unreadable` is a file the session user doesn't own, whose owner-read bit (`0400`) is clear, or that has more than one hard link. Treat such a file as unverified. + unreadable: + type: boolean + description: 'True on a directory the session user can''t list; the listing doesn''t enter it. The user''s permission bits on the directory lack read or execute: the owner bits when the user owns it, the group bits when it belongs to the user''s group, and the other bits otherwise. Absent on every other entry.' + unsupported_names: + type: integer + minimum: 1 + description: 'In a recursive listing, how many names directly inside this directory no entry can carry: names that are not UTF-8, or whose path would pass 4096 bytes. The listing skips them and everything below them. Absent when there are none.' + required: + - path + - type + - size + - mode + SandboxFileListResult: + type: object + additionalProperties: false + properties: + project_id: + type: string + format: uuid + description: The project the session belongs to. + session_id: + type: string + format: uuid + description: The session listed. + entries: + type: array + items: + $ref: '#/components/schemas/SandboxFileEntry' + description: Entries sorted by path, compared one path element at a time by bytes, so a directory comes right before its contents. + unsupported_names: + type: integer + minimum: 1 + description: 'How many names directly inside the listed directory no entry can carry: names that are not UTF-8, or whose path would pass 4096 bytes. The listing skips them and everything below them. Every page reports it. Absent when there are none.' + next_cursor: + type: string + description: Present when more entries remain. Pass it as `cursor` to get the next page. + required: + - project_id + - session_id + - entries + SandboxSubjectGrantRequest: + type: object + additionalProperties: false + properties: + expires_at: + type: string + format: date-time + required: + - expires_at + SandboxAccessRequest: + type: object + additionalProperties: false + properties: + port: + type: integer + minimum: 1 + maximum: 65532 + expires_in_seconds: + type: integer + minimum: 1 + maximum: 300 + default: 300 + required: + - port + SandboxAccess: + type: object + additionalProperties: false + properties: + url: + type: string + format: uri + token: + type: string + expires_at: + type: string + format: date-time + required: + - url + - token + - expires_at + SandboxBuildLogPage: + type: object + required: + - data + properties: + data: + type: array + items: + type: object + required: + - timestamp + - message + properties: + timestamp: + type: string + format: date-time + message: + type: string + next_cursor: + type: string + description: Opaque cursor for the next page. Absent when caught up. + SandboxDeployment: + type: object + additionalProperties: false + properties: + id: + type: string + format: uuid + status: + type: string + created_at: + type: string + format: date-time + updated_at: + type: string + format: date-time + required: + - id + - status + - created_at + - updated_at + SandboxPagination: + type: object + additionalProperties: false + properties: + limit: + type: integer + has_more: + type: boolean + next_cursor: + type: string + required: + - limit + - has_more + SandboxTemplatePage: + type: object + additionalProperties: false + properties: + data: + type: array + items: + $ref: '#/components/schemas/SandboxTemplate' + pagination: + $ref: '#/components/schemas/SandboxPagination' + required: + - data + - pagination + SandboxSessionPage: + type: object + additionalProperties: false + properties: + data: + type: array + items: + $ref: '#/components/schemas/SandboxSession' + pagination: + $ref: '#/components/schemas/SandboxPagination' + required: + - data + - pagination + SandboxDeploymentPage: + type: object + additionalProperties: false + properties: + data: + type: array + items: + $ref: '#/components/schemas/SandboxDeployment' + pagination: + $ref: '#/components/schemas/SandboxPagination' + required: + - data + - pagination + SandboxPresetList: + type: object + additionalProperties: false + properties: + data: + type: array + items: + $ref: '#/components/schemas/SandboxPreset' + required: + - data + Capability: + type: object + additionalProperties: false + description: A product capability and whether it accepts new work in this environment. + properties: + id: + type: string + description: Stable capability ID, such as `sandboxes`, `sandboxes.sessions`, `sandboxes.custom_templates`, or `issues`. New IDs may appear at any time. + example: sandboxes.sessions + status: + $ref: '#/components/schemas/CapabilityStatus' + code: + type: string + description: Why an `unavailable` capability refuses new work, named like the error code its requests answer with, such as `plan_required`. Absent on any other status, and when requests answer `feature_unavailable`. Treat an unknown code as absent. + example: plan_required + required: + - id + - status + CapabilityStatus: + type: string + enum: + - available + - unavailable + - read_only + x-enum-varnames: + - CapabilityStatusAvailable + - CapabilityStatusUnavailable + - CapabilityStatusReadOnly + description: '`available` means the capability accepts new work; a temporary outage still answers `503`. `unavailable` means requests that start new work answer `404` or `400` with code `feature_unavailable`, or with the capability''s `code` when it has one; while the owner''s plan can''t be read, they answer `403` without a code. `read_only` means the capability takes no new work for the project, but what the project already has stays readable; only a project''s list reports it. Treat any other value as `unavailable`.' + CapabilityList: + type: object + additionalProperties: false + properties: + data: + type: array + items: + $ref: '#/components/schemas/Capability' + required: + - data + SandboxCapacity: + type: object + additionalProperties: false + properties: + region: + type: string + allocated_memory_mb: + type: integer + format: int64 + minimum: 0 + required: + - region + - allocated_memory_mb + SandboxCapacityList: + type: object + additionalProperties: false + properties: + data: + type: array + items: + $ref: '#/components/schemas/SandboxCapacity' + required: + - data + PublishSandboxPresetRequest: + type: object + additionalProperties: false + properties: + id: + type: string + format: uuid + preset: + type: string + enum: + - python3.12 + - node22 + memory_mb: + type: integer + enum: + - 1024 + - 2048 + deployment_id: + type: string + format: uuid + required: + - id + - preset + - memory_mb + - deployment_id + AnonKey: + type: object + properties: + id: + type: string + format: uuid + project_id: + type: string + format: uuid + name: + type: string + key_value: + type: string + description: JWT token - use this in frontend Authorization header + permissions: + type: array + items: + type: string + description: | + Permissions granted to this anon key. + Auth permissions: auth.signup, auth.signin, auth.refresh, auth.logout, auth.password_reset, auth.confirm_email, auth.resend_confirmation + Storage permissions: storage.upload, storage.download, storage.list, storage.delete + Realtime permissions: realtime.connect, realtime.subscribe, realtime.publish + Functions permissions: functions.invoke + example: + - auth.signup + - auth.signin + - auth.refresh + - auth.logout + is_default: + type: boolean + description: Whether this is the project's configured default anon key. Only one key per project can be default. + created_at: + type: string + format: date-time + required: + - id + - name + - key_value + AuthConfig: + type: object + properties: + project_id: + type: string + format: uuid + access_token_lifetime: + type: integer + description: Access token lifetime in seconds + default: 3600 + refresh_token_lifetime: + type: integer + description: Refresh token lifetime in seconds + default: 2592000 + refresh_token_reuse_interval: + type: integer + description: A refresh within this many seconds of the refresh token being issued returns the same refresh token instead of rotating it, so concurrent refreshes from several tabs all succeed + default: 10 + inactivity_timeout: + type: integer + description: Force re-login after inactivity (seconds, 0=never) + default: 0 + max_session_duration: + type: integer + description: Force re-login after duration (seconds, 0=never) + default: 0 + min_password_length: + type: integer + minimum: 15 + maximum: 128 + default: 15 + description: Configured minimum password length in Unicode characters. + password_policy: + $ref: '#/components/schemas/AuthPasswordPolicy' + require_uppercase: + type: boolean + default: false + require_lowercase: + type: boolean + default: false + require_numbers: + type: boolean + default: false + require_special_chars: + type: boolean + default: false + enable_signup: + type: boolean + description: Master switch - allow new user signups via ANY provider + default: true + enable_email_password: + type: boolean + description: Enable email/password authentication as a provider + default: true + rate_limit_signup: + type: integer + description: Signups per hour per IP + default: 100 + rate_limit_signin: + type: integer + description: Signins per hour per IP + default: 100 + rate_limit_token_refresh: + type: integer + description: Refreshes per hour per IP + default: 1000 + rate_limit_password_reset: + type: integer + description: Password reset requests per hour per IP. Unlike the other limits, 0 applies the default of 10 instead of turning the limit off. + default: 10 + cors_enabled: + type: boolean + default: false + cors_allowed_origins: + type: array + items: + type: string + example: + - https://myapp.com + - http://localhost:3000 + enable_anonymous_signins: + type: boolean + description: Allow creating users without email/password + default: false + allowed_email_domains: + type: array + description: | + Email domains allowed to create users in this project. Applies to + email/password signup, OAuth/SSO signup, anonymous conversion, and + email changes. Empty (the default) allows every domain. + + Entries are stored normalized (lowercase, no `@` prefix) and match + the domain part exactly: `domain1.com` does not cover + `mail.domain1.com`. Signups from other domains are rejected with + 403, and `allowed_email_domains_mode` decides whether sign-in is + covered as well. + + The allowlist is a SUPERAGENT feature to configure and to enforce. A + downgrade parks it: the domains are still returned here and stop + being applied until the project is back on SUPERAGENT. + items: + type: string + example: + - domain1.com + - domain2.com + allowed_email_domains_mode: + type: string + description: | + How far `allowed_email_domains` reaches. `signup` only gates account + creation, so accounts that predate the list keep signing in. + `signup_and_signin` also refuses to issue a session to an account + whose domain is not listed. `disabled` keeps the list without + enforcing it. + enum: + - disabled + - signup + - signup_and_signin + default: signup + platform_token_ttl: + type: integer + description: TTL in seconds for platform tokens minted via `/auth/platform/exchange` + default: 2592000 + allow_password_reset: + type: boolean + description: Enable forgot password flow + default: true + password_reset_timeout: + type: integer + description: Recovery token expiry in seconds + default: 3600 + max_password_history: + type: integer + description: Number of previous passwords to remember (0=disabled) + default: 0 + cors_allow_credentials: + type: boolean + description: Allow credentials in CORS requests + default: true + cors_max_age: + type: integer + description: CORS preflight cache duration (seconds) + default: 86400 + cors_allow_frontend_previews: + type: boolean + description: Allow the exact origins of the project's own live frontend previews in its CORS checks, in addition to `cors_allowed_origins`. A preview's origin stops being allowed within seconds of the preview being deleted or expiring, with no configuration change. + default: false + frontend_preview_origins: + type: array + readOnly: true + description: Origins of the project's live frontend previews that its CORS checks currently allow. Empty unless `cors_allow_frontend_previews` is true. Omitted when the live previews could not be read; the rest of the response, and any update it answers, is unaffected. + items: + type: string + require_email_confirmation: + type: boolean + description: Require users to confirm email before sign-in. Can only be true when email_enabled is true. + default: false + email_confirmation_timeout: + type: integer + description: Email confirmation token expiry in seconds. + default: 86400 + auto_link_verified_oauth: + type: boolean + description: Link a verified OAuth identity to an existing confirmed account with the same email instead of returning a conflict. Requires require_email_confirmation to be true. + default: false + email_enabled: + type: boolean + description: Enable transactional email sending (confirmation, reset, change notifications). Must be true when require_email_confirmation is true. + default: false + email_from_address: + type: string + description: Sender email address. New or changed values containing carriage returns or newlines return 400. Unchanged stored or exported values are preserved. Leading and trailing whitespace in previously saved settings is trimmed in responses and exports, and ignored when sending. + email_from_name: + type: string + description: Sender display name; supports punctuation and Unicode. New or changed values containing carriage returns or newlines return 400. Unchanged stored or exported values are preserved. Leading and trailing whitespace in previously saved settings is trimmed in responses and exports, and ignored when sending. + smtp_host: + type: string + description: SMTP server host name or IP address. Outside local mode, Volcano connects only to public internet addresses, and a host that is, or resolves to, a loopback, private, link-local, or other non-public address fails delivery. + smtp_port: + type: integer + default: 587 + smtp_username: + type: string + smtp_password_configured: + type: boolean + description: Whether an SMTP password is configured. The password itself is never returned. + default: false + smtp_use_tls: + type: boolean + default: true + email_confirmation_subject: + type: string + email_password_reset_subject: + type: string + email_password_changed_subject: + type: string + managed_auth_enabled: + type: boolean + description: Enables project-hosted managed auth pages. + default: false + post_auth_redirect_url: + type: string + description: Default redirect target after successful hosted auth. + allowed_redirect_urls: + type: array + description: Redirect allowlist used to validate post_auth_redirect_url and post_logout_redirect_url. + items: + type: string + post_logout_redirect_url: + type: string + description: Redirect target after logout from hosted pages. + device_verification_url: + type: string + description: | + Optional override for the device-authorization verification page. + When set, POST /auth/device/authorize returns this URL (with the + user_code) as verification_uri/verification_uri_complete instead of + the built-in managed device page. Lets a CLI surface the project's + own RFC 8628 approval page. Empty falls back to the managed page. + example: https://app.acme.com/device + created_at: + type: string + format: date-time + updated_at: + type: string + format: date-time + required: + - password_policy + AuthInsightsInterval: + type: string + enum: + - day + - week + - month + AuthInsightsResponse: + type: object + additionalProperties: false + properties: + project_id: + type: string + format: uuid + observed_at: + type: string + format: date-time + window: + $ref: '#/components/schemas/AuthInsightsWindow' + summary: + $ref: '#/components/schemas/AuthInsightsSummary' + series: + type: array + items: + $ref: '#/components/schemas/AuthInsightsSeriesPoint' + required: + - project_id + - observed_at + - window + - summary + - series + AuthInsightsSeriesPoint: + type: object + additionalProperties: false + properties: + bucket_start: + type: string + format: date + signups: + type: integer + format: int64 + minimum: 0 + description: Registrations during the bucket. Subsequent deletion does not subtract from this count. Historical counts removed before deletion-history collection cannot be reconstructed. + signins: + type: integer + format: int64 + minimum: 0 + description: Successful session creations during the bucket. + banned_users: + type: integer + format: int64 + minimum: 0 + description: Users registered in this bucket who are currently banned. Excludes deleted users, lifted bans, expired temporary bans, and internal test identities. + deleted_users: + type: integer + format: int64 + minimum: 0 + description: Users registered in this bucket who are now deleted, counted once across soft and hard deletion. Grouped by signup date, not deletion date. + available_users: + type: integer + format: int64 + minimum: 0 + description: Currently available users registered in this bucket (signups minus banned_users minus deleted_users). Unban or expiry restores availability in the original signup bucket. This measures account availability, not return activity. + deletions: + type: integer + format: int64 + minimum: 0 + description: Accounts deleted during this bucket, counted once across soft and hard deletion. + net_growth: + type: integer + format: int64 + description: Registrations minus deletions during this bucket. May be negative. Bans do not affect this value. + is_partial: + type: boolean + description: Whether the requested window or observation time clips this bucket. + required: + - bucket_start + - signups + - signins + - is_partial + - deletions + - banned_users + - deleted_users + - available_users + - net_growth + AuthInsightsSummary: + type: object + additionalProperties: false + properties: + total_users: + type: integer + format: int64 + minimum: 0 + description: Current auth-user count, excluding accounts with deleted status. + deleted_users: + type: integer + format: int64 + minimum: 0 + description: Recorded deletions, excluding internal test identities. Includes soft and hard deletion, counted once per account. + active_users_1d: + type: integer + format: int64 + minimum: 0 + description: Distinct users active in the trailing 24 hours, including activity before account deletion. + active_users_30d: + type: integer + format: int64 + minimum: 0 + description: Distinct users with a successful session creation or refresh in the trailing 30 days, including activity before account deletion. + required: + - total_users + - active_users_30d + - active_users_1d + - deleted_users + AuthInsightsWindow: + type: object + additionalProperties: false + properties: + from: + type: string + format: date + to: + type: string + format: date + interval: + $ref: '#/components/schemas/AuthInsightsInterval' + required: + - from + - to + - interval + AuthHostedPage: + type: object + properties: + id: + type: string + format: uuid + project_id: + type: string + format: uuid + page_type: + $ref: '#/components/schemas/HostedAuthPageType' + html: + type: string + description: HTML content for this page type. + css: + type: string + description: CSS content for this page type. + created_at: + type: string + format: date-time + updated_at: + type: string + format: date-time + AuthPageAppearanceResponse: + type: object + required: + - theme + - layouts + - customisation_allowed + - parked + - defaults + - options + properties: + theme: + $ref: '#/components/schemas/AuthPageTheme' + layouts: + type: object + additionalProperties: + $ref: '#/components/schemas/AuthPageLayout' + customisation_allowed: + type: boolean + parked: + type: object + additionalProperties: + type: boolean + description: Per-page saved-but-not-live state. + defaults: + $ref: '#/components/schemas/AuthPageAppearanceDefaults' + options: + $ref: '#/components/schemas/AuthPageAppearanceOptions' + AuthPageDensity: + type: string + enum: + - compact + - comfortable + - spacious + AuthPageFont: + type: string + enum: + - system + - humanist + - geometric + - slab + - mono + AuthPageLayout: + type: string + enum: + - centered + - split-left + - split-right + AuthPageRadius: + type: string + enum: + - none + - small + - medium + - large + AuthPageScale: + type: string + enum: + - small + - default + - large + AuthPageTheme: + type: object + additionalProperties: false + required: + - version + - colors + - font + - scale + - density + - radius + properties: + version: + type: integer + enum: + - 1 + colors: + $ref: '#/components/schemas/AuthPageThemeColors' + font: + $ref: '#/components/schemas/AuthPageFont' + scale: + $ref: '#/components/schemas/AuthPageScale' + density: + $ref: '#/components/schemas/AuthPageDensity' + radius: + $ref: '#/components/schemas/AuthPageRadius' + AuthHostedPageResponse: + type: object + required: + - page + - defaults + - runtime + properties: + page: + allOf: + - $ref: '#/components/schemas/AuthHostedPage' + nullable: true + description: The saved page, or null when the project has not customized this page type yet. + defaults: + $ref: '#/components/schemas/AuthHostedPageDefaults' + runtime: + $ref: '#/components/schemas/AuthHostedPageRuntime' + AuthIdentity: + type: object + description: | + A real email identity owned by the account. One account can own multiple + identities (for example a work email plus a personal email linked via OAuth). + properties: + id: + type: string + format: uuid + description: Unique identity identifier + email: + type: string + format: email + description: The email address this identity represents + email_verified: + type: boolean + description: Whether ownership of this email has been verified + is_primary: + type: boolean + description: Whether the account's primary sign-in method resolves to this identity + created_at: + type: string + format: date-time + required: + - id + - email + - email_verified + - is_primary + - created_at + AuthIdentitiesResponse: + type: object + properties: + identities: + type: array + items: + $ref: '#/components/schemas/AuthIdentity' + required: + - identities + AuthMethodSummary: + type: object + description: | + A single sign-in method the account owns (password, an OAuth provider, or an + active anonymous method). `is_primary` reflects the account's primary_method_id. + properties: + id: + type: string + format: uuid + description: Unique method identifier + type: + type: string + x-go-type: string + description: The kind of sign-in method + enum: + - password + - oauth + - anonymous + provider: + type: string + description: OAuth provider name; present only when type is oauth + example: google + identity_id: + type: string + description: | + The identity this method signs in to — a UUID for password/oauth methods, + empty for anonymous methods. + email: + type: string + description: The email of the method's identity (empty for anonymous) + is_primary: + type: boolean + description: Whether this is the account's primary sign-in method + last_used_at: + type: string + format: date-time + description: When this method was last used to sign in, if ever + created_at: + type: string + format: date-time + updated_at: + type: string + format: date-time + required: + - id + - type + - identity_id + - email + - is_primary + - created_at + - updated_at + AuthMethodsResponse: + type: object + properties: + methods: + type: array + items: + $ref: '#/components/schemas/AuthMethodSummary' + required: + - methods + AuthPasswordPolicy: + type: object + additionalProperties: false + description: Effective backend-enforced password policy. + properties: + effective_min_length: + type: integer + minimum: 15 + maximum: 128 + description: Effective minimum password length in Unicode characters. + min_configurable_length: + type: integer + minimum: 15 + maximum: 15 + description: Lowest minimum password length accepted by the auth configuration endpoint. + max_length: + type: integer + minimum: 128 + maximum: 128 + description: Maximum password length in Unicode characters. + require_uppercase: + type: boolean + description: Whether passwords must contain an ASCII uppercase letter (A-Z). + require_lowercase: + type: boolean + description: Whether passwords must contain an ASCII lowercase letter (a-z). + require_numbers: + type: boolean + description: Whether passwords must contain an ASCII digit (0-9). + require_special_chars: + type: boolean + description: Whether passwords must contain one of the backend-supported special characters. + compromised_passwords_rejected: + type: boolean + description: Whether common and known-compromised passwords are rejected by the backend. + required: + - effective_min_length + - min_configurable_length + - max_length + - require_uppercase + - require_lowercase + - require_numbers + - require_special_chars + - compromised_passwords_rejected + AuthSession: + type: object + description: An authentication session for a user + properties: + id: + type: string + format: uuid + description: Unique session identifier + user_id: + type: string + format: uuid + description: The user this session belongs to + provider: + type: string + description: Authentication provider used to create this session + enum: + - email + - google + - github + - microsoft + - apple + - anonymous + example: email + user_agent: + type: string + description: Browser/device user agent string + example: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) + ip_address: + type: string + description: IP address of the client when the session was created + example: 192.168.1.1 + last_ip_address: + type: string + description: IP address of the most recent activity (token refresh) + example: 192.168.1.100 + expires_at: + type: string + format: date-time + description: When this session expires + last_activity_at: + type: string + format: date-time + description: Last activity timestamp + session_started_at: + type: string + format: date-time + description: When the session was created + is_active: + type: boolean + description: Whether the session is currently active (not expired) + is_current: + type: boolean + description: Whether this is the session making the current request + created_at: + type: string + format: date-time + updated_at: + type: string + format: date-time + required: + - id + - user_id + - provider + - expires_at + - is_active + - is_current + AuthSignupResponse: + type: object + description: | + Uniform, session-less response returned by POST /auth/signup. It carries no + tokens and no user object, and is identical for a new account and for an + already-registered email (anti-enumeration). Clients obtain a session with a + subsequent POST /auth/signin. + properties: + confirmation_required: + type: boolean + description: | + Whether the project requires email confirmation. Reflects project config + only (identical for a new and an existing email), so it leaks nothing about + account existence. + message: + type: string + description: Human-readable acknowledgement. + required: + - confirmation_required + - message + AuthTokenResponse: + type: object + properties: + access_token: + type: string + description: JWT access token (expires after configured lifetime) + token_type: + type: string + example: bearer + expires_in: + type: integer + description: Access token lifetime in seconds + refresh_token: + type: string + x-go-type-skip-optional-pointer: true + description: | + Long-lived token for getting new access tokens. Omitted when the + request uses eligible HttpOnly cookie session storage. + user: + $ref: '#/components/schemas/AuthUser' + required: + - access_token + - token_type + - expires_in + - user + AuthUser: + type: object + properties: + id: + type: string + format: uuid + project_id: + type: string + format: uuid + email: + type: string + format: email + email_confirmed: + type: boolean + user_metadata: + type: object + additionalProperties: true + description: User-editable metadata + app_metadata: + type: object + additionalProperties: true + description: Application-controlled metadata (read-only for users) + avatar_url: + type: string + format: uri + description: User avatar URL (from OAuth provider or manually set) + status: + type: string + enum: + - active + - banned + - deleted + banned_until: + type: string + format: date-time + nullable: true + description: When temporary ban expires (null if not banned or permanent) + last_sign_in_at: + type: string + format: date-time + created_at: + type: string + format: date-time + updated_at: + type: string + format: date-time + required: + - id + - email + - status + BanUserResponse: + type: object + description: Response when banning a user + properties: + message: + type: string + example: User banned until 2026-12-31T23:59:59Z + user_id: + type: string + format: uuid + email: + type: string + format: email + status: + type: string + enum: + - banned + banned_until: + type: string + format: date-time + nullable: true + description: When the ban expires (null for permanent ban) + required: + - message + - user_id + - email + - status + BatchFunctionDeployFailure: + type: object + properties: + name: + type: string + function_id: + type: string + format: uuid + operation: + type: string + enum: + - deploy + - update + error: + type: string + required: + - name + - error + BatchFunctionDeployResponse: + type: object + properties: + batch_id: + type: string + format: uuid + data: + type: array + description: Functions whose deployment workflows were started successfully + items: + $ref: '#/components/schemas/Function' + failed: + type: array + description: Functions that failed before their workflow started. Successful functions are left running; failed new functions are deleted and failed updates are rolled back where possible. + items: + $ref: '#/components/schemas/BatchFunctionDeployFailure' + required: + - batch_id + - data + CompleteUploadSessionResponse: + type: object + description: Response when completing an upload + properties: + object: + $ref: '#/components/schemas/StorageObject' + CreateDatabaseBackupRequest: + type: object + properties: + name: + type: string + description: | + Backup name, unique within the database. Names beginning with + `volcano-` are reserved for the platform's own snapshots, and names + beginning with `before-migration-` for the backups migration runs + take. + pattern: ^[a-z0-9][a-z0-9_-]{0,62}$ + maxLength: 63 + example: before_migration + required: + - name + CreateDatabaseBranchRequest: + type: object + properties: + name: + type: string + description: | + Branch name, unique within the parent database. Names beginning + with `migration_rehearsal_` are reserved for the branches migration + runs rehearse on. + pattern: ^[a-z0-9_]+$ + maxLength: 64 + example: feature_checkout + ttl_seconds: + type: integer + format: int64 + minimum: 3600 + maximum: 2592000 + description: | + How long the branch should live, between one hour and 30 days. + Defaults to 7 days when omitted. + example: 86400 + required: + - name + CreateDatabaseRestoreRequest: + type: object + description: | + Names what to restore. Supply exactly one of `backup_name` or + `restore_to`. + properties: + backup_name: + type: string + minLength: 1 + maxLength: 128 + description: | + A backup of this database to restore, exactly as returned by the list + endpoint. + + Deliberately looser than the names you can create, like the backup + path parameter: a backup made by a schedule is named for you, so + restoring one accepts any name a backup can have. + example: before_migration + restore_to: + type: string + format: date-time + description: | + A point in time to restore to, which must fall inside the + `restore_window` reported when listing backups. + example: '2026-01-15T09:30:00Z' + CreateDatabaseRequest: + type: object + description: | + Create a new PostgreSQL database. Volcano automatically sets up: + - Auth helpers (auth.uid(), auth.email(), auth.role()) + - Database roles (anon for unauthenticated, authenticated for signed-in users) + - Secure multi-tenant isolation + - Ready for Row-Level Security + properties: + name: + type: string + description: Database name (must be unique within project) + pattern: ^[a-z0-9_]+$ + maxLength: 64 + example: my_database + region: + type: string + description: | + Region for database hosting, such as `us-east-1`. The accepted values + are the regions this environment runs in, so read them from + `GET /databases/regions` rather than hardcoding a list. A region the + environment does not offer is rejected with 400. Region IDs issued by + earlier versions of the API are still accepted. + example: us-east-1 + pg_version: + type: string + description: | + PostgreSQL major version. `GET /databases/postgres-versions` lists + the versions this environment accepts; local mode accepts only the + version its server runs. Any other value is rejected with 400. + example: '18' + enum: + - '16' + - '17' + - '18' + database_type: + type: string + description: | + Compute size tier (optional, defaults to volcano-db-xs). + Determines autoscaling limits for the database. + enum: + - volcano-db-xs + - volcano-db-s + - volcano-db-m + - volcano-db-l + - volcano-db-xl + - volcano-db-2xl + default: volcano-db-xs + example: volcano-db-xs + required: + - name + - region + - pg_version + CreateEmailTemplateRequest: + type: object + properties: + template_type: + type: string + enum: + - welcome + - confirmation + - password_reset + - password_changed + description: Type of email template + subject: + type: string + description: Subject template. After Go template whitespace trimming, literal interior carriage returns or newlines return 400. Outer whitespace and trailing block-scalar newlines are allowed. + example: Confirm your email + html_body: + type: string + description: | + HTML template body. Available placeholders: + - {{.Token}} - The confirmation/reset token + - {{.ProjectName}} - The project name + - {{.Email}} - User's email address + text_body: + type: string + description: Plain text template body (same placeholders as HTML) + required: + - template_type + - subject + - html_body + - text_body + CreateFrontendCustomDomainRequest: + type: object + additionalProperties: false + properties: + domain: + type: string + maxLength: 253 + description: 'Fully-qualified domain name (hostname only, no scheme/path). Managed TLS (`tls.mode: managed`) accepts at most 219 characters; BYOC accepts 253.' + example: app.example.com + tls: + $ref: '#/components/schemas/FrontendCustomDomainTLSConfig' + required: + - domain + - tls + CreateFrontendDomainRequest: + type: object + additionalProperties: false + properties: + domain: + type: string + maxLength: 253 + description: 'Fully-qualified domain name (hostname only, no scheme/path). Managed TLS (`tls.mode: managed`) accepts at most 219 characters; BYOC accepts 253.' + example: www.example.com + tls: + $ref: '#/components/schemas/FrontendCustomDomainTLSConfig' + redirect: + $ref: '#/components/schemas/FrontendCustomDomainRedirectRequest' + required: + - domain + - tls + CreateFunctionSchedulerRequest: + type: object + required: + - name + - schedule + properties: + name: + type: string + maxLength: 200 + enabled: + type: boolean + default: true + schedule: + $ref: '#/components/schemas/ScheduleRequest' + payload: + type: object + additionalProperties: true + regions: + type: array + description: Optional single explicit deployed region. If omitted, the scheduler chooses one deployed region and invokes according to the cron expression. + maxItems: 1 + items: + type: string + CreateOAuthConfigRequest: + type: object + required: + - provider + properties: + provider: + type: string + enum: + - google + - github + - microsoft + - apple + - device + example: google + client_id: + type: string + example: 123456789.apps.googleusercontent.com + description: Required for non-device providers. Must not be provided for `provider=device`; server always auto-generates it. + client_secret: + type: string + example: GOCSPX-abc123def456 + description: Required for non-device providers. Must not be provided for `provider=device`; server always auto-generates it. + redirect_url: + type: string + description: Required for non-device providers. Not used for `provider=device`. + format: uri + example: https://yourapp.com/auth/callback + scopes: + type: array + items: + type: string + example: + - openid + - email + - profile + description: Optional for non-device providers, uses provider defaults if omitted. Not used for `provider=device`. + CreateProjectRequest: + type: object + description: Request to create a new project + properties: + name: + type: string + description: | + Project name. A name you already use is not refused: the project is + created with a short random suffix added to it. + Can only contain letters, numbers, underscores, and hyphens. + pattern: ^[A-Za-z0-9_-]+$ + minLength: 1 + maxLength: 255 + example: my-awesome-app + template_id: + type: string + description: Optional trusted starter template identifier. The server resolves immutable source and database initialization artifacts. Callers cannot supply artifact locations or database credentials. Creation accepts an asynchronous installation; poll the individual project until template_installation.status is ready before using the app. Use pixel-board, trellini, or collab-pad for the configured starter bundles. The official-starter legacy identifier has environment-specific availability. + enum: + - pixel-board + - trellini + - collab-pad + - official-starter + example: pixel-board + all_regions: + type: boolean + description: | + Optional region policy. + - `true` (default): project functions deploy to all configured regions + - `false`: project deploys only to `selected_regions` + default: true + selected_regions: + type: array + items: + type: string + description: | + Optional region subset. Requires `all_regions=false`. + Region names must be a subset of platform `AWS_REGIONS`. + example: + - us-east-1 + - us-west-2 + required: + - name + CreateStorageBucketRequest: + type: object + properties: + name: + type: string + description: Bucket name (alphanumeric, dashes, underscores) + pattern: ^[a-zA-Z0-9_-]+$ + minLength: 1 + maxLength: 64 + file_size_limit: + type: integer + format: int64 + description: Maximum file size in bytes + allowed_mime_types: + type: array + items: + type: string + description: Allowed MIME types (e.g., ["image/png", "image/jpeg"]) + required: + - name + CreateStoragePolicyRequest: + type: object + properties: + name: + type: string + description: Policy name + operation: + type: string + enum: + - SELECT + - INSERT + - UPDATE + - DELETE + description: Operation this policy applies to + definition: + type: string + description: Policy expression + required: + - name + - operation + - definition + CreateUploadSessionRequest: + type: object + description: Request to create a resumable upload session + properties: + object_path: + type: string + description: Target file path within the bucket + example: videos/large-file.mp4 + content_type: + type: string + description: MIME type of the file + example: video/mp4 + total_size: + type: integer + format: int64 + description: Total file size in bytes (max 5TB) + minimum: 1 + maximum: 5497558138880 + example: 5368709120 + part_size: + type: integer + format: int64 + description: 'Part size in bytes (default: 25MB, min: 5MB, max: 25MB)' + minimum: 5242880 + maximum: 26214400 + example: 26214400 + required: + - object_path + - content_type + - total_size + CreateUploadSessionResponse: + type: object + description: Response when creating an upload session + properties: + session_id: + type: string + description: Upload session ID + example: session-abc123 + part_size: + type: integer + format: int64 + description: Actual part size to use + example: 26214400 + total_parts: + type: integer + description: Number of parts to upload + example: 52 + expires_at: + type: string + format: date-time + description: When the session expires (7 days from creation) + example: '2024-01-22T10:30:00Z' + CreateVariableRequest: + type: object + properties: + 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. + name: + type: string + description: Project variable name. Function runtime names such as AWS_REGION are reserved and return 400; see the environment variables guide for the full list. + minLength: 1 + maxLength: 256 + pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$ + value: + type: string + required: + - name + - value + VariableEnvironment: + type: object + description: Stable identity for a Project-owned variable Environment. + properties: + id: + type: string + format: uuid + project_id: + type: string + format: uuid + name: + type: string + pattern: ^[A-Za-z0-9_-]{1,64}$ + minLength: 1 + maxLength: 64 + is_global: + type: boolean + description: Whether this is the reserved Global Environment. + created_at: + type: string + format: date-time + updated_at: + type: string + format: date-time + required: + - id + - project_id + - name + - is_global + - created_at + - updated_at + VariableEnvironmentList: + type: object + properties: + data: + type: array + maxItems: 101 + items: + $ref: '#/components/schemas/VariableEnvironment' + required: + - data + CreateVariableEnvironmentRequest: + type: object + additionalProperties: false + properties: + name: + type: string + description: Leading and trailing ASCII whitespace is trimmed before validating 1–64 ASCII letters, digits, underscores, or hyphens. Global is reserved. + pattern: ^[ \t\n\f\r]*[A-Za-z0-9_-]{1,64}[ \t\n\f\r]*$ + required: + - name + RenameVariableEnvironmentRequest: + type: object + additionalProperties: false + properties: + name: + type: string + description: Leading and trailing ASCII whitespace is trimmed before validating 1–64 ASCII letters, digits, underscores, or hyphens. Global is reserved. + pattern: ^[ \t\n\f\r]*[A-Za-z0-9_-]{1,64}[ \t\n\f\r]*$ + required: + - name + Database: + type: object + description: | + PostgreSQL database with automatic scalability and security features. + properties: + id: + type: string + format: uuid + project_id: + type: string + format: uuid + name: + type: string + description: Database name + pattern: ^[a-z0-9_]+$ + maxLength: 64 + status: + type: string + enum: + - provisioning + - active + - failed + - restoring + - deleting + description: | + Database status. `restoring` means a restore is replacing the + database's data: it does not accept connections, and the operations + that would race the restore are rejected until it finishes. Its + branches keep serving throughout. + provisioning_started_at: + type: string + format: date-time + description: Timestamp when the current provisioning phase started + connection_string: + type: string + description: | + Secure PostgreSQL connection URI for your database. + + The database is identified by the globally-unique username + (`volcano_client_{database_id}`) already in this URI; the + `application_name` parameter only selects the access mode: + - `volcano_full_access` — Full admin access (DDL, migrations) + - `volcano_user_access:{user_id}` — User impersonation (RLS enforced) + - `volcano_user_access` — Anonymous access (anon role, RLS enforced) + region: + type: string + description: Region where the database is hosted + example: us-east-1 + pg_version: + type: string + description: PostgreSQL major version + example: '18' + database_type: + type: string + description: | + Database size tier that determines available RAM and scaling limits. + enum: + - volcano-db-xs + - volcano-db-s + - volcano-db-m + - volcano-db-l + - volcano-db-xl + - volcano-db-2xl + example: volcano-db-xs + storage_bytes: + type: integer + format: int64 + minimum: 0 + description: | + Latest observed storage for this database, in bytes: its own on-disk + size, plus what each branch has diverged from it, plus what its + backups cost to hold. This is the figure the storage allowance is + enforced against, and the stats endpoint breaks it down. A + point-in-time gauge recorded by a background pass, so it may be + absent until the database has been sampled, and it can trail the + stats endpoint's `current_storage_bytes`, which measures on request. + Summing the latest samples for every database in a project produces + the project's "Database Storage (Bytes)" usage gauge. Populated on + database list responses; single-database responses omit it. + last_invoked_at: + type: string + format: date-time + description: Most recent request timestamp for this database + created_at: + type: string + format: date-time + updated_at: + type: string + format: date-time + required: + - id + - project_id + - name + - status + - created_at + - updated_at + DatabaseBackup: + type: object + description: | + A point-in-time copy of a database, kept by the storage provider and + restorable in place. + + Backups cover the database itself, not its branches. Restoring one + replaces the database's data and keeps its connection string. + properties: + name: + type: string + description: | + Backup name, unique within the database. Backups you create are + named by you; scheduled backups are named by the storage provider. + source: + type: string + enum: + - manual + - scheduled + - migration + description: | + Whether the backup was requested explicitly, produced by the backup + schedule, or taken before migrations were applied to the database. + Only `manual` backups count against the plan's backup allowance. + size_bytes: + type: integer + format: int64 + minimum: 0 + description: | + Storage the backup occupies. Absent until the provider has costed + it, which takes a few minutes after the backup is taken; absent is + not the same as empty. + expires_at: + type: string + format: date-time + description: | + When the backup is deleted automatically, from the plan's retention. + Absent means it is kept until deleted explicitly. + created_at: + type: string + format: date-time + description: The point in time the backup captures. + required: + - name + - source + - created_at + DatabaseBackupList: + type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/DatabaseBackup' + restore_window: + $ref: '#/components/schemas/DatabaseRestoreWindow' + required: + - data + DatabaseBackupSchedule: + type: object + description: | + The database's automated backup schedule. An empty list means no + scheduled backups; sending one clears the schedule. + properties: + entries: + type: array + items: + $ref: '#/components/schemas/DatabaseBackupScheduleEntry' + required: + - entries + DatabaseBackupScheduleEntry: + type: object + description: One recurrence of the automated backup schedule. + properties: + frequency: + type: string + enum: + - daily + - weekly + - monthly + hour: + type: integer + minimum: 0 + maximum: 23 + description: Hour of the day in UTC. + day: + type: integer + minimum: 1 + maximum: 28 + description: | + Day of the week (1-7, Monday to Sunday) for a weekly schedule, or day + of the month (1-28) for a monthly one. Required for both, ignored for + a daily schedule. Monthly stops at 28 so the schedule fires in every + month. + retention_seconds: + type: integer + format: int64 + minimum: 3600 + description: | + How long each backup from this recurrence is kept. Clamped to the + plan's retention, and defaulted to it when omitted. + required: + - frequency + - hour + DatabaseBranch: + type: object + description: | + A copy-on-write fork of a database, for development and testing. + + A branch starts as an exact copy of its parent's data and diverges from + there. It has its own connection string and its own credential, so a + branch password cannot reach the parent. + + Every branch expires. `expires_at` is a hard deadline: once it passes the + branch stops accepting connections and is deleted. Use `PATCH` to extend + a branch you are still working on. + properties: + id: + type: string + format: uuid + database_id: + type: string + format: uuid + description: The parent database this branch was forked from. + project_id: + type: string + format: uuid + name: + type: string + description: Branch name, unique within the parent database. + pattern: ^[a-z0-9_]+$ + maxLength: 64 + status: + type: string + enum: + - provisioning + - active + - failed + - deleting + description: | + Branch status. A new branch starts `provisioning` and is not + connectable until it reports `active`; poll this endpoint until it + does. `connection_string` is only present while `active`. + + `provisioning` also covers a branch being rebuilt after a `reset`, + and a build that is between retries, so it is the status to keep + waiting on. `failed` is terminal: it means the platform gave up, and + the branch will not become `active` on its own. + connection_string: + type: string + description: | + PostgreSQL connection URI for this branch. Present only while the + branch is `active`. + + The URI carries the branch's own globally-unique username and + password; `application_name` selects the access mode exactly as it + does for the parent database: + - `volcano_full_access` — Full admin access (DDL, migrations) + - `volcano_user_access:{user_id}` — User impersonation (RLS enforced) + - `volcano_user_access` — Anonymous access (anon role, RLS enforced) + ttl_seconds: + type: integer + format: int64 + minimum: 1 + description: | + The lifetime the branch was created with. Resetting a branch re-arms + this same duration, so a reset never shortens a branch's remaining + life. + expires_at: + type: string + format: date-time + description: | + When the branch stops serving connections and becomes eligible for + deletion. Enforced on the connection path, so it holds even if + reclamation is delayed. + storage_bytes: + type: integer + format: int64 + minimum: 0 + description: | + Bytes this branch has diverged from its parent, which is what a + branch actually costs. Shared pages are not counted twice. Counts + against the parent database's storage allowance. Absent until the + branch has been sampled. + last_invoked_at: + type: string + format: date-time + description: Most recent request timestamp for this branch + created_at: + type: string + format: date-time + updated_at: + type: string + format: date-time + required: + - id + - database_id + - project_id + - name + - status + - ttl_seconds + - expires_at + - created_at + - updated_at + DatabaseBranchList: + type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/DatabaseBranch' + required: + - data + DatabaseBranchStorage: + type: object + description: One branch's contribution to its parent database's storage. + properties: + id: + type: string + format: uuid + name: + type: string + description: Branch name + storage_bytes: + type: integer + format: int64 + minimum: 0 + description: | + Bytes this branch has diverged from its parent. Pages the branch + still shares with the parent are not counted, so this is what the + branch actually adds to the total rather than its apparent size. + required: + - id + - name + - storage_bytes + DatabaseSelectRequest: + type: object + properties: + table: + type: string + description: Table name to query + example: posts + select: + type: array + items: + type: string + description: Columns to select (omit for *) + example: + - id + - title + - content + - created_at + filters: + type: array + items: + $ref: '#/components/schemas/DatabaseQueryFilter' + description: WHERE conditions (combined with AND) + example: + - column: status + operator: eq + value: published + - column: views + operator: gt + value: 100 + order: + type: array + items: + $ref: '#/components/schemas/DatabaseQueryOrder' + description: ORDER BY clauses + example: + - column: created_at + ascending: false + limit: + type: integer + minimum: 1 + maximum: 1000 + description: Maximum rows to return + example: 10 + offset: + type: integer + minimum: 0 + description: Number of rows to skip (for pagination) + example: 0 + required: + - table + DatabaseInsertRequest: + type: object + properties: + table: + type: string + description: Table name + example: posts + values: + type: object + additionalProperties: true + description: | + Column values to insert. JSON objects and arrays are stored as JSON, + so send them to `json` or `jsonb` columns. For a Postgres array + column, send an array literal string such as `"{a,b}"`. + example: + title: My New Post + content: This is the content + status: draft + required: + - table + - values + DatabaseUpdateRequest: + type: object + properties: + table: + type: string + description: Table name + example: posts + values: + type: object + additionalProperties: true + description: | + Column values to update. JSON objects and arrays are stored as JSON, + so send them to `json` or `jsonb` columns. For a Postgres array + column, send an array literal string such as `"{a,b}"`. + example: + title: Updated Title + status: published + filters: + type: array + minItems: 1 + items: + $ref: '#/components/schemas/DatabaseQueryFilter' + description: | + WHERE conditions for which rows to update. At least one filter is + required; a filterless update is rejected to avoid rewriting every + row. + example: + - column: id + operator: eq + value: post-uuid + required: + - table + - values + - filters + DatabaseDeleteRequest: + type: object + properties: + table: + type: string + description: Table name + example: posts + filters: + type: array + minItems: 1 + items: + $ref: '#/components/schemas/DatabaseQueryFilter' + description: WHERE conditions (required for safety) + example: + - column: id + operator: eq + value: post-uuid + required: + - table + - filters + DatabaseQueryResult: + type: object + description: | + Rows returned by a data API request. RLS-filtered unless the request was + made with a service key. + properties: + data: + type: array + items: + type: object + additionalProperties: true + description: Result rows + count: + type: integer + description: Number of rows returned + DatabaseRestore: + type: object + description: | + A restore of a database, either from a named backup or to a point in + time. Restores run in the background and take longer than a request, so + the database is unavailable until this reports `completed`. + properties: + id: + type: string + format: uuid + database_id: + type: string + format: uuid + project_id: + type: string + format: uuid + kind: + type: string + enum: + - snapshot + - point_in_time + description: | + Whether the restore targets a named backup or an arbitrary point in + time. Both replace the database's data in place. + status: + type: string + enum: + - pending + - running + - completed + - failed + - exhausted + description: | + Restore status. `pending` and `running` both mean the restore is + still in flight and the database is not connectable; an attempt that + fails with tries left goes back to `pending`. `failed` and + `exhausted` both mean Volcano gave up: the database is left `failed` + if its data may already have been replaced, and `active` if the + restore never started — a backup that no longer exists at the + provider ends the restore without touching the database. A restore + cannot be cancelled once it starts. + backup_name: + type: string + description: | + The backup restored, kept even if that backup is later deleted. + Absent for a point-in-time restore. + restore_to: + type: string + format: date-time + description: The point in time restored to. Absent for a backup restore. + error: + type: string + description: Why the most recent attempt failed, when one has. + completed_at: + type: string + format: date-time + created_at: + type: string + format: date-time + updated_at: + type: string + format: date-time + required: + - id + - database_id + - project_id + - kind + - status + - created_at + - updated_at + DatabaseRestoreList: + type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/DatabaseRestore' + required: + - data + DatabaseRestoreWindow: + type: object + description: | + The span a point-in-time restore may target. Absent from the response + when the owner's plan does not include point-in-time restore, and while + the storage provider has no history window in place yet — briefly the + case after an upgrade, since the window is applied asynchronously. The + window is read from the provider rather than from the plan, so it never + advertises a point a restore could not actually reach. + properties: + earliest_restore_at: + type: string + format: date-time + description: | + The oldest point that can still be restored. Moves forward + continuously as history ages out, so treat it as a lower bound at + the moment it was read rather than a fixed value. + latest_restore_at: + type: string + format: date-time + description: The most recent point that can be restored, which is now. + DatabaseRestoreConflictError: + description: | + A restore refused by the database's state. With code + `migration_run_in_progress`, `run_id` names the migration run backing up + or applying to the database. + allOf: + - $ref: '#/components/schemas/Error' + - type: object + properties: + run_id: + type: string + format: uuid + DatabaseMigrationFile: + type: object + description: One migration file and its SQL. + properties: + name: + type: string + minLength: 5 + maxLength: 320 + pattern: ^([a-z0-9_]+/)?[^/\\]+\.sql$ + description: | + The file's path under `volcano/migrations/`: a file name such as + `001_create_users.sql`, or `/001_create_users.sql` in a + project with more than one database, where `` must be + this database. Every file in a request takes the same form. Files + run in byte order of their file name, which the history records. + example: 001_create_users.sql + sql: + type: string + maxLength: 1048576 + description: | + The file's SQL, at most 1 MiB. A file may hold several statements + and runs in one transaction. A file cannot commit, roll back, use + savepoints, or `COPY` from the client; such a file fails with + `migration_failed`. A statement that cannot run in a transaction, + such as `CREATE INDEX CONCURRENTLY`, goes alone in a file whose + first line is `-- volcano:no-transaction`. That file runs outside a + transaction and runs again from its start when a run retries it. A + run refuses with `invalid_file`, before anything runs, a file with + the marker on any other line, and a marked file that builds an + unnamed index with `CREATE INDEX CONCURRENTLY` or starts with + `COPY`. + required: + - name + - sql + DatabaseMigrationFilesRequest: + type: object + properties: + files: + type: array + minItems: 1 + maxItems: 1000 + items: + $ref: '#/components/schemas/DatabaseMigrationFile' + required: + - files + DatabaseMigrationHistoryEntry: + type: object + description: One file the database's migration history records. + properties: + name: + type: string + example: 001_create_users.sql + checksum: + type: string + description: | + `sha256:` and the hex digest of the file as recorded, with a leading + byte order mark removed and CRLF line endings converted to LF. + example: sha256:9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08 + status: + type: string + enum: + - applied + - baselined + description: | + `applied`: a run ran the file and it committed. `baselined`: the file + was recorded as applied without running. + applied_at: + type: string + format: date-time + run_id: + type: string + format: uuid + description: The run that recorded the file. Absent for a baseline. + required: + - name + - checksum + - status + - applied_at + DatabaseMigrations: + type: object + properties: + history: + type: array + description: Every file the history records, in name order. + items: + $ref: '#/components/schemas/DatabaseMigrationHistoryEntry' + active_run_id: + type: string + format: uuid + description: The run that is queued or running, if any. + required: + - history + DatabaseMigrationBaseline: + type: object + properties: + recorded: + type: array + description: | + The files this request recorded, in name order. Empty when the + history already recorded every file. + items: + type: string + required: + - recorded + DatabaseMigrationConflictError: + description: | + A migration request refused by the database's state. With code + `migration_run_in_progress`, `run_id` names the run that is queued or + running. + allOf: + - $ref: '#/components/schemas/Error' + - type: object + properties: + run_id: + type: string + format: uuid + DatabaseMigrationRunFile: + type: object + properties: + name: + type: string + example: 001_create_users.sql + outcome: + type: string + enum: + - pending + - already_applied + - applied + - failed + - not_run + - unknown + description: | + `pending`: not settled yet, including a file the run will try again + on its next attempt. `already_applied`: the history already recorded + it, so it did not run; a file can also end this way in `apply`, when + another session applied or baselined it after the run planned. + `applied`: this run applied it. `failed`: its own SQL failed and + its transaction rolled back, in the rehearsal or in the database as + the run's `phase` says, including when the run's time limit stopped + it; a file whose `COMMIT` failed is `unknown` instead. A file whose + first line is `-- volcano:no-transaction` runs outside a + transaction, so nothing rolls back what it did before failing, such + as the invalid index a failed `CREATE INDEX CONCURRENTLY` leaves. + `not_run`: the run ended before the file committed, without its + SQL failing: before `apply`, after an earlier file failed or lost + its `COMMIT`, or after the connection was lost or Volcano's own + statements around the file failed, which rolled it back. `unknown`: + the run ended in `apply` without confirming whether the file ran, + for example because its attempts ran out, its `COMMIT` failed or + was cut short, or it ran outside a transaction and the connection + was lost or Volcano's own statements after it failed. The file may + have committed. The database's history says whether a file that + ran in a transaction committed, and the next run's plan applies a + file only if the history does not record it. + While the run is `queued` or `running`, each attempt reads the + history again before it runs a file, and sets every file the run + has not applied from it: `already_applied` if the history holds + it, `pending` otherwise. The exception is a file that runs outside + a transaction: it is `unknown` from just before Volcano sends it + until Volcano confirms what became of it. If it may have run, it + stays `unknown` until an attempt applies it or the history holds + it, and keeps the `error` of a later attempt that fails it. + error: + $ref: '#/components/schemas/DatabaseMigrationFileError' + required: + - name + - outcome + DatabaseMigrationFileError: + type: object + description: | + The database's error for a `failed` file, or for an `unknown` file + that runs outside a transaction, when a later attempt failed it after + an earlier one may have run it. `message` is the database's own + message and can quote values from the file or the data. + properties: + message: + type: string + description: | + At most 8 KiB (8,192 bytes). A longer message is cut and ends with + ` … [truncated]`. Volcano reads each reply the database sends about + the file up to 4 MiB, which leaves room for a reply that quotes the + whole file twice. A larger reply is not read: the file fails, and + this message says so instead. + example: column "email" of relation "users" already exists + sqlstate: + type: string + description: The Postgres error code, when the database reported one. + example: '42701' + line: + type: integer + minimum: 1 + description: The line of the file the database reported, when known. + required: + - message + DatabaseMigrationWarning: + type: object + description: A condition the run reports that did not stop it. + properties: + code: + type: string + enum: + - out_of_order + - missing_file + - rehearsal_skipped + - backup_skipped + - backup_prune_failed + - warnings_truncated + description: | + `out_of_order`: a pending file sorts before one the history already + records; it still ran. `missing_file`: the history records a file + the run did not include. `rehearsal_skipped`: the files were not + rehearsed, because branches are not available here or on the plan. + `backup_skipped`: no backup was taken, because backups are not + available here or on the plan. `backup_prune_failed`: Volcano + could not delete older migration backups beyond the 20 it keeps; + the run's outcome is unaffected, and the next run that takes a + backup tries again. `warnings_truncated`: the run raised more than + 100 warnings; it is the last one, and its message says how many + more were not kept. + file: + type: string + description: The file the warning is about, when it is about one. + message: + type: string + required: + - code + - message + DatabaseMigrationRunError: + type: object + description: Why the run failed, or why its last attempt did. + properties: + code: + type: string + enum: + - migration_failed + - checksum_mismatch + - history_missing + - history_too_large + - invalid_file + - invalid_layout + - plan_changed + - branch_limit + - rehearsal_unavailable + - backup_failed + - restore_in_progress + - database_unavailable + - owner_not_active + - locked + - connection_failed + - timeout + - attempts_exhausted + - internal_error + - operator_failed + description: | + Stable machine-readable reason. `migration_failed`: a file's SQL, + or its `COMMIT`, failed; `phase` says whether in the rehearsal, + leaving the database untouched, or in the database, where the files + before it stay applied. `checksum_mismatch`: an applied file changed. + `history_missing`: the database's history table is gone though + migrations ran there; record a baseline of the files already + applied. Dropping the whole `_volcano_migrations` schema is not + supported and not detected: the database reads as new, and the run + applies every file again. `history_too_large`: the history has + more than the 1,000 entries Volcano reads. `invalid_file`: a file + Volcano refuses to run. `invalid_layout`: file paths that do not map + to the database. + `plan_changed`: the history changed after the rehearsal. + `branch_limit`: the rehearsal branch would exceed the plan's branch + allowance. `backup_failed` and `rehearsal_unavailable`: Volcano + could not take the backup or prepare the rehearsal. + `restore_in_progress` and `database_unavailable`: the database could + not take the run. `owner_not_active`: the project owner's account + was not `active` when Volcano picked the run up, or before its + `backup` or `apply`, or before a file in `apply` unless held + `read_only` only for the plan's limits, so the run applied nothing + further; files it already applied stay applied. + `locked`: another session held the migration lock, + or a file, or Volcano's drop of a failed build's index, waited too + long for a lock. `connection_failed`: the + database could not be reached, or the connection was lost, + including while a file ran. `internal_error`: Volcano failed for a + reason of its own, such as its own statements around a file. + `timeout` and `attempts_exhausted`: the run could not finish. + `operator_failed`: Volcano ended a run that stopped making + progress; read the history to see which files were applied, then + start a new run. + message: + type: string + description: | + What happened, naming files and Postgres error codes. The + database's own message is on the failed file. + required: + - code + - message + DatabaseMigrationRun: + type: object + description: | + One application of migration files to a database. A run plans the files + against the database's history, rehearses the pending ones on a + short-lived branch, takes a backup, and applies them. + properties: + id: + type: string + format: uuid + database: + $ref: '#/components/schemas/ResourceReference' + status: + type: string + enum: + - queued + - running + - succeeded + - failed + description: | + `queued` and `running` mean the run has not ended; a run waiting + to retry stays `running`. `succeeded`: every pending file was + applied, or none was pending. `failed`: `error` says why. + phase: + type: string + enum: + - plan + - rehearse + - backup + - apply + x-enum-varnames: + - DatabaseMigrationRunPhasePlan + - DatabaseMigrationRunPhaseRehearse + - DatabaseMigrationRunPhaseBackup + - DatabaseMigrationRunPhaseApply + description: | + The step the run is on, or the one it ended on. `plan` compares the + files with the history. `rehearse` applies the pending files to a + short-lived branch of the database, which is deleted afterwards. + `backup` takes the backup named by `backup_name`. `apply` applies + the files to the database. + source: + type: string + enum: + - git_deploy + - api + description: What started the run. + commit_sha: + type: string + description: The commit whose files the run applies. Present for `git_deploy` runs. + backup_name: + type: string + description: | + The backup the run takes before it applies the files, named once + the run starts taking it. It is listed with the database's backups + with `source: migration`. A run that ended in its `backup` phase + may name a backup that was never created. + example: before-migration-7f3a1c2e-5d4b-4a91-8c6f-2b1e9d0a4c73 + files: + type: array + description: | + The run's files, in the order they run, with what became of each. + Absent when listing runs. + items: + $ref: '#/components/schemas/DatabaseMigrationRunFile' + warnings: + type: array + maxItems: 101 + description: | + A run keeps at most 100 warnings, keeping those about the run, such + as a skipped backup, ahead of those about files. A run that raised + more ends the list with a `warnings_truncated` warning. + items: + $ref: '#/components/schemas/DatabaseMigrationWarning' + error: + $ref: '#/components/schemas/DatabaseMigrationRunError' + started_at: + type: string + format: date-time + description: When a worker first picked the run up. + completed_at: + type: string + format: date-time + created_at: + type: string + format: date-time + updated_at: + type: string + format: date-time + required: + - id + - database + - status + - phase + - source + - warnings + - created_at + - updated_at + DatabaseMigrationRunList: + type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/DatabaseMigrationRun' + required: + - data + DatabaseStats: + type: object + properties: + current_storage_bytes: + type: integer + format: int64 + minimum: 0 + description: | + On-disk size right now, in bytes: the database itself, plus every + branch's divergence from it, plus what its backups cost to hold. This + is the figure the storage allowance is enforced against. `branches` + and `backup_storage_bytes` break it down. + current_storage_mb: + type: number + format: double + minimum: 0 + description: '`current_storage_bytes` expressed in megabytes.' + branches: + type: array + description: | + Per-branch contribution to `current_storage_bytes`. Empty when the + database has no branches. A branch that has not diverged from its + parent contributes nothing. + items: + $ref: '#/components/schemas/DatabaseBranchStorage' + backup_storage_bytes: + type: integer + format: int64 + minimum: 0 + description: | + What this database's backups contribute to `current_storage_bytes`. + + A backup taken on request is charged as a full copy of the database + as it was at that moment, so two backups of a 2 GB database are 4 GB. + A backup schedule is charged its first snapshot in full and each + later one only for the storage it adds. Deleting a backup releases + its storage immediately. + + Sampled from the provider rather than measured live, so it can lag a + change by a few minutes, and a backup taken seconds ago may not be + costed yet. Zero on a plan without backups. + storage_bytes: + type: integer + format: int64 + description: Total storage used in bytes (data + WAL) + data_written_bytes: + type: integer + format: int64 + description: Total data written in bytes + data_transfer_bytes: + type: integer + format: int64 + description: Total data transferred in bytes + compute_time_seconds: + type: number + format: double + description: Total CPU seconds consumed + active_time_seconds: + type: number + format: double + description: Total active compute time in seconds + time_range: + type: string + description: Time range of the metrics (e.g., "2024-01-01T00:00:00Z to 2024-01-02T00:00:00Z") + granularity: + type: string + enum: + - hourly + - daily + - monthly + description: Granularity of the aggregated metrics + required: + - current_storage_bytes + - current_storage_mb + - backup_storage_bytes + - storage_bytes + - data_written_bytes + - data_transfer_bytes + - compute_time_seconds + - active_time_seconds + DatabaseQueryPerformanceResponse: + type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/DatabaseQueryPerformanceItem' + required: + - data + UpdateDatabaseBranchRequest: + type: object + description: Replace the branch's lifetime and restart its countdown from now. + properties: + ttl_seconds: + type: integer + format: int64 + minimum: 3600 + maximum: 2592000 + description: The new lifetime, between one hour and 30 days. + example: 86400 + required: + - ttl_seconds + DeviceAuthorizationResponse: + type: object + properties: + device_code: + type: string + user_code: + type: string + verification_uri: + type: string + description: | + Browser verification URL. Points at the project's managed device + approval page served by this API: + `/projects/{projectId}/auth/hosted?action=device&anon_key=...`. + Requires the project to have managed auth enabled and a default anon + key. A custom CLI may ignore this and direct users to its own + RFC 8628-compatible page instead (see the device-auth guide). + verification_uri_complete: + type: string + description: | + Same as `verification_uri` but with the `user_code` prefilled + (`&user_code=...`). This is the URL most device clients open. + expires_in: + type: integer + interval: + type: integer + required: + - device_code + - user_code + - verification_uri + - verification_uri_complete + - expires_in + - interval + DefaultEmailTemplate: + type: object + description: Built-in email template used when no custom template applies. + properties: + type: + type: string + enum: + - welcome + - confirmation + - password_reset + - password_changed + x-enum-varnames: + - DefaultEmailTemplateWelcome + - DefaultEmailTemplateConfirmation + - DefaultEmailTemplatePasswordReset + - DefaultEmailTemplatePasswordChanged + subject: + type: string + html_body: + type: string + description: HTML template with placeholders + text_body: + type: string + description: Plain text template with placeholders + required: + - type + - subject + - html_body + - text_body + EmailTemplate: + type: object + description: Custom email template + properties: + id: + type: string + format: uuid + project_id: + type: string + format: uuid + template_type: + type: string + enum: + - welcome + - confirmation + - password_reset + - password_changed + subject: + type: string + example: Confirm your email address + html_body: + type: string + description: HTML template with placeholders + text_body: + type: string + description: Plain text template with placeholders + created_at: + type: string + format: date-time + updated_at: + type: string + format: date-time + required: + - template_type + Error: + type: object + properties: + error: + type: string + code: + type: string + description: 'Stable machine-readable error code when a specific recovery path is available. `plan_required` (403) means the project owner''s plan does not include the requested feature or option; upgrading the plan unlocks it. `person_required` (403) means a project access token tried to change LavaFlow settings, which only the project''s owner changes, with a platform token, or that the change needs the owner''s own credential that expires, a project repository, and an owner whose GitHub account can push to it; `error` says which. A 403 without a code leaves the reason unspecified: it can be an access refusal, a reached limit, or a plan check that could not read the owner''s plan. Match on the code, not the message text.' + required: + - error + ImportProvider: + type: string + description: Where an import comes from. `vercel` imports a Vercel project through a Vercel Integration connection. `github` imports a GitHub repository through the caller's own GitHub connection (`GET /user/git/connections`) and one of its Volcano GitHub App installations; it has no connect flow of its own under `/user/imports`. + enum: + - vercel + - github + default: vercel + x-enum-varnames: + - ImportProviderVercel + - ImportProviderGitHub + ImportConnectStartResponse: + type: object + properties: + authorization_url: + type: string + required: + - authorization_url + ImportConnection: + type: object + properties: + id: + type: string + format: uuid + provider: + $ref: '#/components/schemas/ImportProvider' + account_id: + type: string + account_name: + type: string + configuration_id: + type: string + granted_scopes: + type: array + items: + type: string + status: + type: string + expires_at: + type: string + format: date-time + nullable: true + last_authenticated_at: + type: string + format: date-time + created_at: + type: string + format: date-time + updated_at: + type: string + format: date-time + required: + - id + - provider + - account_id + - account_name + - configuration_id + - granted_scopes + - status + - last_authenticated_at + - created_at + - updated_at + ImportConnectionsResponse: + type: object + properties: + connections: + type: array + items: + $ref: '#/components/schemas/ImportConnection' + required: + - connections + ImportSource: + type: object + properties: + id: + type: string + description: Provider identifier. For `github`, the repository's stable numeric GitHub ID. + name: + type: string + description: For `github`, the repository's `owner/name`. + account_id: + type: string + description: For `github`, the login of the account that owns the repository. + framework: + type: string + description: For `github`, empty in the source list and `nextjs` in a preflight report when the commit holds a supported frontend. + repository: + $ref: '#/components/schemas/ImportSourceRepository' + required: + - id + - name + - account_id + - framework + ImportSourceRepository: + type: object + description: A GitHub repository the caller reaches through one of its Volcano GitHub App installations. Only `github` sources have one. + properties: + installation_id: + type: integer + format: int64 + account_login: + type: string + full_name: + type: string + default_branch: + type: string + description: The branch an import deploys when the request names none. + private: + type: boolean + empty: + type: boolean + description: True when the repository has no commits. An empty repository cannot be imported. + required: + - installation_id + - account_login + - full_name + - default_branch + - private + - empty + ImportSourcesResponse: + type: object + properties: + sources: + type: array + items: + $ref: '#/components/schemas/ImportSource' + required: + - sources + ProjectImportTarget: + type: string + enum: + - production + x-enum-varnames: + - ProjectImportTargetProduction + ProjectImportDestinationMode: + type: string + enum: + - create + x-enum-varnames: + - ProjectImportDestinationCreate + ProjectImportDisposition: + type: string + enum: + - automatic + - manual + - deferred + - unsupported + x-enum-varnames: + - ProjectImportDispositionAutomatic + - ProjectImportDispositionManual + - ProjectImportDispositionDeferred + - ProjectImportDispositionUnsupported + ProjectImportImpact: + type: string + enum: + - none + - warning + - blocking + x-enum-varnames: + - ProjectImportImpactNone + - ProjectImportImpactWarning + - ProjectImportImpactBlocking + ProjectImportReadiness: + type: string + enum: + - importable + - needs_input + - blocked + x-enum-varnames: + - ProjectImportReadinessImportable + - ProjectImportReadinessNeedsInput + - ProjectImportReadinessBlocked + ProjectImportActionCode: + type: string + enum: + - project.create + - git.connect + - frontend.configure + - variable.set + x-enum-varnames: + - ProjectImportActionProjectCreate + - ProjectImportActionGitConnect + - ProjectImportActionFrontendConfigure + - ProjectImportActionVariableSet + ProjectImportResourceKind: + type: string + enum: + - project + - git_repository + - frontend + - variable + - domain + - function + x-enum-varnames: + - ProjectImportResourceProject + - ProjectImportResourceGitRepository + - ProjectImportResourceFrontend + - ProjectImportResourceVariable + - ProjectImportResourceDomain + - ProjectImportResourceFunction + ProjectImportPreflightRequest: + type: object + properties: + connection_id: + type: string + format: uuid + source_id: + type: string + minLength: 1 + project_name: + type: string + maxLength: 255 + pattern: ^[A-Za-z0-9_-]+$ + target: + $ref: '#/components/schemas/ProjectImportTarget' + confirm_environment_variable_read: + type: boolean + default: false + description: Set to true only after the user confirms an immediately preceding disclosure that the Vercel Integration grant permits reads and writes, while this preflight reads production variable values only. When false or omitted, preflight reads variable metadata only and reports readable values as manual input. `github` reads no variable values and ignores it. + branch: + $ref: '#/components/schemas/ProjectImportBranch' + root_directory: + $ref: '#/components/schemas/ProjectImportRootDirectory' + app_root: + $ref: '#/components/schemas/ProjectImportAppRoot' + required: + - connection_id + - source_id + - project_name + - target + ProjectImportBranch: + type: string + minLength: 1 + maxLength: 255 + description: '`github` only. The branch to deploy, which becomes the project''s production branch. Omit it to use the repository''s default branch.' + ProjectImportRootDirectory: + type: string + maxLength: 1024 + description: '`github` only. The repository directory, relative to its root, that holds the project, as in a monorepo. Omit it or send an empty string for the repository root. It becomes the project''s root directory. A deployment receives only this directory.' + ProjectImportAppRoot: + type: string + maxLength: 1024 + description: '`github` only. The directory of the Next.js app, relative to `root_directory`, when the root directory holds a workspace that installs the app, as in a pnpm, npm or Yarn monorepo. Omit it or send an empty string for the app at the root directory. It becomes the project''s frontend app root. A repository whose `.volcano/source-layout.json` names its frontends takes none, and sending one is refused with `import_source_invalid`.' + ProjectImportVariable: + type: object + properties: + name: + type: string + minLength: 1 + maxLength: 255 + value: + type: string + maxLength: 65536 + required: + - name + - value + ProjectImportStartRequest: + type: object + properties: + connection_id: + type: string + format: uuid + source_id: + type: string + minLength: 1 + maxLength: 255 + project_name: + type: string + maxLength: 255 + pattern: ^[A-Za-z0-9_-]+$ + target: + $ref: '#/components/schemas/ProjectImportTarget' + confirm_environment_variable_read: + type: boolean + enum: + - true + description: Required by `vercel`, which reads production variable values. `github` reads none and does not need it. + preflight_fingerprint: + type: string + pattern: ^sha256:[0-9a-f]{64}$ + branch: + $ref: '#/components/schemas/ProjectImportBranch' + root_directory: + $ref: '#/components/schemas/ProjectImportRootDirectory' + app_root: + $ref: '#/components/schemas/ProjectImportAppRoot' + deploy_migrations: + type: boolean + default: false + description: '`github` only. Turns on applying `volcano/migrations` for later pushes. The first deployment never applies migrations, because a new project has no database yet; preflight reports the files it found. Turning it on while database migrations are unavailable is refused with `feature_unavailable`.' + variables: + type: array + maxItems: 500 + description: '`github` only. Project variables to store before the first deployment. Nothing is read from the repository''s env files. A name must start with a letter or underscore and hold only letters, digits and underscores, must not be reserved, and must not repeat another entry''s; otherwise the start is refused with 400 `import_variable_name_invalid`. The whole request body is limited to 1 MiB; a larger one is refused with 413.' + items: + $ref: '#/components/schemas/ProjectImportVariable' + required: + - connection_id + - source_id + - project_name + - target + - preflight_fingerprint + ProjectImportSourceScan: + type: object + description: '`github` only. What the selected commit holds and what the import deploys from it, found by preparing the commit the way a deployment does.' + properties: + repository_id: + type: integer + format: int64 + repository_full_name: + type: string + installation_id: + type: integer + format: int64 + branch: + type: string + commit_sha: + type: string + description: The branch head the report describes. A push after preflight makes a start with this report's fingerprint stale. + root_directory: + type: string + app_root: + type: string + description: The app root the scan used, relative to `root_directory`; empty for the root directory itself. + functions: + type: array + description: Functions under `volcano/functions`. Functions are never inferred from other layouts. + items: + $ref: '#/components/schemas/ProjectImportScannedFunction' + frontends: + type: array + description: The app at the root directory, or each frontend `.volcano/source-layout.json` names. Only `supported` frontends deploy. + items: + $ref: '#/components/schemas/ProjectImportScannedFrontend' + migrations: + type: array + items: + $ref: '#/components/schemas/ProjectImportScannedMigrations' + sandboxes: + type: array + items: + type: string + unsupported: + type: array + description: What the import leaves out, each with the reason. + items: + $ref: '#/components/schemas/ProjectImportUnsupportedItem' + deployable: + type: boolean + description: True when the commit holds at least one function or one supported frontend. A start is refused when it is false. + candidates: + type: array + maxItems: 20 + description: 'Other settings for this commit that hold something a deployment would deploy, found below `root_directory`, sorted by path. The search looks two directory levels deep, and further for members of a workspace the root directory declares. It skips `node_modules`, build output, and directories whose names start with `.` or `_`. A source with `.volcano/source-layout.json` has none. A candidate is not checked as fully as the report: run preflight again with its `root_directory` and `app_root` to see what it deploys.' + items: + $ref: '#/components/schemas/ProjectImportRootCandidate' + required: + - repository_id + - repository_full_name + - installation_id + - branch + - commit_sha + - root_directory + - app_root + - functions + - frontends + - migrations + - sandboxes + - unsupported + - deployable + - candidates + ProjectImportRootCandidate: + type: object + description: A `root_directory` and `app_root` to import instead. A Next.js app in a workspace has the workspace root as its root directory and its own directory as the app root, because a deployment receives only the root directory and the app installs from its workspace. Any other app, and a `volcano/functions` directory, is its own root directory. + properties: + root_directory: + type: string + description: Relative to the repository root; empty for the repository root. + app_root: + type: string + description: Relative to `root_directory`; empty for none. + reasons: + type: array + minItems: 1 + description: 'What it holds: `nextjs_app`, a Next.js app the frontend build supports; `volcano_functions`, a `volcano/functions` directory with at least one function.' + items: + $ref: '#/components/schemas/ProjectImportRootCandidateReason' + required: + - root_directory + - app_root + - reasons + ProjectImportRootCandidateReason: + type: string + enum: + - nextjs_app + - volcano_functions + x-enum-varnames: + - ProjectImportRootCandidateReasonNextjsApp + - ProjectImportRootCandidateReasonVolcanoFunctions + ProjectImportScannedFunction: + type: object + properties: + name: + type: string + runtime: + type: string + kind: + type: string + enum: + - standard + - durable + x-enum-varnames: + - ProjectImportFunctionKindStandard + - ProjectImportFunctionKindDurable + required: + - name + - runtime + - kind + ProjectImportScannedFrontend: + type: object + properties: + name: + type: string + workspace: + type: string + description: The frontend's workspace relative to the root directory; empty for the root directory itself. + app_root: + type: string + description: The app relative to its workspace; empty for the workspace itself. + framework: + type: string + description: '`nextjs`, another framework its package names (such as `vite` or `astro`), or `unknown`.' + supported: + type: boolean + required: + - name + - workspace + - app_root + - framework + - supported + ProjectImportScannedMigrations: + type: object + properties: + database: + type: string + description: The database directory under `volcano/migrations`, or empty for files at its top level, which belong to a project's only database. + files: + type: array + items: + type: string + required: + - database + - files + ProjectImportUnsupportedItem: + type: object + properties: + kind: + $ref: '#/components/schemas/ProjectImportResourceKind' + name: + type: string + path: + type: string + description: Repository-relative path of the item. + reason: + type: string + required: + - kind + - name + - path + - reason + ProjectImportRunStatus: + type: string + enum: + - pending + - running + - succeeded + - failed + - superseded + x-enum-varnames: + - ProjectImportRunStatusPending + - ProjectImportRunStatusRunning + - ProjectImportRunStatusSucceeded + - ProjectImportRunStatusFailed + - ProjectImportRunStatusSuperseded + ProjectImportRun: + type: object + properties: + id: + type: string + provider: + $ref: '#/components/schemas/ImportProvider' + source_id: + type: string + destination_project_name: + type: string + resource: + $ref: '#/components/schemas/ResourceReference' + deployment: + $ref: '#/components/schemas/DeploymentReference' + status: + $ref: '#/components/schemas/ProjectImportRunStatus' + error_code: + type: string + description: 'Set when `status` is `failed`: `import.deployment_skipped` when the import''s deployment was skipped, otherwise the error code of the Git deployment run the import started (see `GitDeploymentRunError.code`), such as `source_invalid`, `deploy_refused`, `child_deploy_failed`, `child_deploy_not_started`, or `deploy_failed`. Treat a code you do not know as a failure.' + error_message: + type: string + created_at: + type: string + format: date-time + updated_at: + type: string + format: date-time + required: + - id + - provider + - source_id + - destination_project_name + - resource + - deployment + - status + - created_at + - updated_at + ProjectImportDestination: + type: object + properties: + mode: + $ref: '#/components/schemas/ProjectImportDestinationMode' + project_name: + type: string + target: + $ref: '#/components/schemas/ProjectImportTarget' + required: + - mode + - project_name + - target + ProjectImportResource: + type: object + properties: + kind: + $ref: '#/components/schemas/ProjectImportResourceKind' + name: + type: string + source_id: + type: string + minLength: 1 + description: Stable provider identifier for a scoped source resource. + scope: + type: string + minLength: 1 + description: URL-encoded source scope, including target, branch, and custom environment identifiers. + required: + - kind + - name + ProjectImportAction: + type: object + properties: + code: + $ref: '#/components/schemas/ProjectImportActionCode' + resource: + $ref: '#/components/schemas/ProjectImportResource' + disposition: + $ref: '#/components/schemas/ProjectImportDisposition' + required: + - code + - resource + - disposition + ProjectImportFinding: + type: object + properties: + code: + type: string + pattern: ^(vercel|github|volcano|import)\.[a-z0-9_]+$ + resource: + $ref: '#/components/schemas/ProjectImportResource' + disposition: + $ref: '#/components/schemas/ProjectImportDisposition' + impact: + $ref: '#/components/schemas/ProjectImportImpact' + message: + type: string + remediation: + type: string + required: + - code + - resource + - disposition + - impact + - message + - remediation + SharedVariablesReplaceResult: + type: object + additionalProperties: false + required: + - skipped_functions + properties: + skipped_functions: + type: array + description: Functions the replacement changes whose variables were not synchronized. + items: + $ref: '#/components/schemas/SkippedServedFunction' + SkippedServedFunction: type: object additionalProperties: false + required: + - id + - name + - code + - message properties: id: type: string - runtime: + format: uuid + description: Function ID. + name: + type: string + description: Function name. + code: + type: string + description: | + Why the function was left out. Clients must accept codes not listed here. + `function_served_by_candidate` - a promoted preview serves the function and keeps the + variables it was built with. + message: + type: string + description: What brings the function in line. + ProjectImportSummary: + type: object + properties: + automatic: + type: integer + minimum: 0 + manual: + type: integer + minimum: 0 + deferred: + type: integer + minimum: 0 + unsupported: + type: integer + minimum: 0 + warnings: + type: integer + minimum: 0 + blocking: + type: integer + minimum: 0 + required: + - automatic + - manual + - deferred + - unsupported + - warnings + - blocking + ProjectImportReport: + type: object + properties: + source_scan: + $ref: '#/components/schemas/ProjectImportSourceScan' + schema_version: + type: string + provider: + $ref: '#/components/schemas/ImportProvider' + source: + $ref: '#/components/schemas/ImportSource' + destination: + $ref: '#/components/schemas/ProjectImportDestination' + actions: + type: array + items: + $ref: '#/components/schemas/ProjectImportAction' + findings: + type: array + items: + $ref: '#/components/schemas/ProjectImportFinding' + summary: + $ref: '#/components/schemas/ProjectImportSummary' + readiness: + $ref: '#/components/schemas/ProjectImportReadiness' + source_fingerprint: + type: string + capability_fingerprint: + type: string + fingerprint: type: string - version: + generated_at: type: string - memory_mb: - type: integer - enum: - - 1024 - - 2048 - regions: - type: array - items: - type: string + format: date-time required: - - id - - runtime - - version - - memory_mb - - regions - SandboxTemplate: + - schema_version + - provider + - source + - destination + - actions + - findings + - summary + - readiness + - source_fingerprint + - capability_fingerprint + - fingerprint + - generated_at + GitConnection: type: object - additionalProperties: false properties: id: type: string format: uuid - project_id: + provider: type: string - format: uuid - name: + provider_user_id: type: string - pattern: ^[a-z][a-z0-9-]{0,62}$ - preset: + provider_login: type: string - memory_mb: - type: integer status: type: string - enum: - - ready - - unavailable - - deleting + last_authenticated_at: + type: string + format: date-time created_at: type: string format: date-time + updated_at: + type: string + format: date-time required: - id - - project_id - - name + - provider + - provider_user_id + - provider_login - status + - last_authenticated_at - created_at - CreateSandboxTemplateRequest: - type: object - additionalProperties: false - properties: - name: - type: string - pattern: ^[a-z][a-z0-9-]{0,62}$ - preset: - type: string - description: Preset ID from the available Sandbox preset catalog. - memory_mb: - type: integer - enum: - - 1024 - - 2048 - default: 1024 - required: - - name - - preset - UpdateSandboxTemplateRequest: + - updated_at + SlackTeamId: + type: string + description: A Slack workspace ID, such as `T0123ABCD`. + pattern: ^T[A-Z0-9]{2,31}$ + SlackChannelId: + type: string + description: A Slack channel ID, such as `C0123ABCD`. + pattern: ^[CG][A-Z0-9]{2,31}$ + SlackAuthorizationResponse: type: object - additionalProperties: false properties: - name: + authorization_url: type: string - pattern: ^[a-z][a-z0-9-]{0,62}$ + description: The Slack page to send the browser to. required: - - name - SandboxSession: + - authorization_url + SlackConnection: type: object - additionalProperties: false + description: A Slack identity connected to the caller's Volcano account. properties: id: type: string format: uuid - project_id: - type: string - format: uuid - sandbox_id: - type: string - format: uuid - nullable: true - description: Explicit template used to create the session. Null when created directly from a preset. - state: + team_id: + $ref: '#/components/schemas/SlackTeamId' + team_name: type: string - enum: - - starting - - running - - suspending - - suspended - - resuming - - terminating - - terminated - - unknown - desired_state: + description: The workspace's name, or empty until the Volcano app is installed in it. + slack_user_id: type: string - enum: - - running - - suspended - - terminated - region: + description: The Slack user ID Slack verified. + slack_user_name: type: string - memory_mb: - type: integer + description: The Slack user's name, as Slack gave it when the identity last connected, or empty for a connection made before Volcano kept it. Connect the identity again to fill it. + installed: + type: boolean + description: Whether the Volcano app is installed in the workspace. created_at: type: string format: date-time - started_at: - type: string - format: date-time - expires_at: - type: string - format: date-time - nullable: true - description: Absolute VM expiry. Null means unlimited in local mode. required: - id - - project_id - - sandbox_id - - state - - desired_state - - region - - memory_mb + - team_id + - team_name + - slack_user_id + - slack_user_name + - installed - created_at - - expires_at - CreateSandboxSessionRequest: - type: object - additionalProperties: false - properties: - preset: - type: string - description: Preset ID from the available Sandbox preset catalog. - sandbox_id: - type: string - format: uuid - memory_mb: - description: Baseline memory in MiB. Cloud HOBBY supports 1024; SUPERAGENT supports 1024 or 2048. Omission uses the preset or template default; a template requiring more than the plan permits is rejected. Local sessions are exempt from cloud plan limits. - type: integer - enum: - - 1024 - - 2048 - region: - type: string - pattern: ^(aws-)?[a-z]{2}(-[a-z]+)+-[0-9]+$ - description: Region such as `us-east-1`. Region IDs issued by earlier versions of the API are still accepted. - max_duration_seconds: - type: integer - minimum: 0 - maximum: 2147483647 - description: Inherits the template TTL when omitted (cloud default 3600 seconds; local default 0, unlimited). Cloud HOBBY accepts 30–3600 seconds; SUPERAGENT accepts 30–28800 seconds. Inherited template defaults are clamped to the plan limit; explicit values above it are rejected. Local accepts 0 for unlimited or a positive lifetime. - required: - - region - oneOf: - - required: - - preset - not: - required: - - sandbox_id - - required: - - sandbox_id - not: - required: - - preset - SandboxCommandRequest: - type: object - additionalProperties: false - properties: - command: - type: string - minLength: 1 - maxLength: 65536 - timeout_seconds: - type: integer - minimum: 0 - maximum: 2147483647 - description: Command execution time from process start. Cloud defaults to 60 seconds and accepts 1–28800; local defaults to 0 (unlimited) and accepts nonnegative values. VM expiry always takes precedence. Cloud synchronous requests must return within the public connection idle limit (1000 seconds); use a session with a background process and short polling requests for longer work. - environment: - type: object - additionalProperties: - type: string - maxProperties: 64 - required: - - command - SandboxExecutionRequest: + SlackConnectionsResponse: type: object - additionalProperties: false properties: - preset: - type: string - description: Preset ID from the available Sandbox preset catalog. - sandbox_id: - type: string - format: uuid - memory_mb: - description: Baseline memory in MiB. Cloud HOBBY supports 1024; SUPERAGENT supports 1024 or 2048. Omission uses the preset or template default; a template requiring more than the plan permits is rejected. Local sessions are exempt from cloud plan limits. - type: integer - enum: - - 1024 - - 2048 - region: - type: string - pattern: ^(aws-)?[a-z]{2}(-[a-z]+)+-[0-9]+$ - description: Region such as `us-east-1`. Region IDs issued by earlier versions of the API are still accepted. - max_duration_seconds: - type: integer - minimum: 0 - maximum: 2147483647 - description: Absolute VM lifetime including startup, bounded by environment capacity policy. Inherits the template TTL when omitted (cloud default 3600 seconds; local default 0, unlimited). Cloud HOBBY accepts 30–3600 seconds; SUPERAGENT accepts 30–28800 seconds. Inherited template defaults are clamped to the plan limit; explicit values above it are rejected. Local accepts 0 for unlimited or a positive lifetime. The VM is reclaimed early when the command finishes. - command: - type: string - minLength: 1 - maxLength: 65536 - timeout_seconds: - type: integer - minimum: 0 - maximum: 2147483647 - description: Command execution time from process start. Cloud defaults to 60 seconds and accepts 1–28800; local defaults to 0 (unlimited) and accepts nonnegative values. VM expiry always takes precedence. Cloud synchronous requests must return within the public connection idle limit (1000 seconds); use a session with a background process and short polling requests for longer work. - environment: - type: object - additionalProperties: - type: string - maxProperties: 64 + connections: + type: array + items: + $ref: '#/components/schemas/SlackConnection' required: - - region - - command - oneOf: - - required: - - preset - not: - required: - - sandbox_id - - required: - - sandbox_id - not: - required: - - preset - SandboxCommandResult: + - connections + SlackChannel: type: object - additionalProperties: false properties: - stdout: - type: string - stderr: - type: string - exit_code: - type: integer - stdout_truncated: - type: boolean - stderr_truncated: - type: boolean - timed_out: + id: + $ref: '#/components/schemas/SlackChannelId' + name: + type: string + is_private: type: boolean required: - - stdout - - stderr - - exit_code - - stdout_truncated - - stderr_truncated - - timed_out - SandboxExecutionResult: + - id + - name + - is_private + SlackChannelsResponse: type: object - additionalProperties: false properties: - stdout: + channels: + type: array + items: + $ref: '#/components/schemas/SlackChannel' + required: + - channels + ConnectorType: + type: string + description: The outside service a connector links to. + enum: + - slack + - aikido + Connector: + type: object + description: A link from Volcano to an outside service. A `slack` connector is a Slack workspace the Volcano app is installed in, shared by every Volcano account with a Slack identity connected there. An `aikido` connector is an Aikido workspace one Volcano account connected with its own credentials. + properties: + id: type: string - stderr: + format: uuid + type: + $ref: '#/components/schemas/ConnectorType' + name: type: string - exit_code: - type: integer - stdout_truncated: - type: boolean - stderr_truncated: - type: boolean - timed_out: + description: The connector's name in its service, such as the Slack or Aikido workspace's name. + slack: + $ref: '#/components/schemas/SlackConnector' + aikido: + $ref: '#/components/schemas/AikidoConnector' + removable: type: boolean - session_id: + description: Whether the caller can remove the connector. Only the person who installed the Volcano app in a Slack workspace can; an `aikido` connector is always the caller's own. + created_at: type: string - format: uuid + format: date-time + required: + - id + - type + - name + - removable + - created_at + SlackConnector: + type: object + description: A `slack` connector's workspace. Present when `type` is `slack`. + properties: + team_id: + $ref: '#/components/schemas/SlackTeamId' + required: + - team_id + AikidoConnector: + type: object + description: An `aikido` connector's workspace. Present when `type` is `aikido`. + properties: region: - type: string - duration_ms: + $ref: '#/components/schemas/AikidoRegion' + workspace_id: type: integer format: int64 - minimum: 0 + description: The workspace's ID in Aikido, which its webhook deliveries name. required: - - stdout - - stderr - - exit_code - - stdout_truncated - - stderr_truncated - - timed_out - - session_id - region - - duration_ms - SandboxFileWriteRequest: + - workspace_id + AikidoRegion: + type: string + description: 'The Aikido region the workspace lives in: `eu` for app.aikido.dev, `us` for app.us.aikido.dev, `au` for app.au.aikido.dev, and `me` for app.me.aikido.dev.' + enum: + - eu + - us + - au + - me + AikidoSeverity: + type: string + description: An Aikido issue severity, lowest first. + enum: + - low + - medium + - high + - critical + ConnectorCreate: type: object additionalProperties: false properties: - path: - type: string - minLength: 1 - maxLength: 4096 - data: + type: type: string - format: byte - maxLength: 11184812 + description: The service to connect. Slack installs with `POST /user/slack/installations`. + enum: + - aikido + aikido: + $ref: '#/components/schemas/AikidoConnectorCreate' required: - - path - - data - SandboxFileReadRequest: + - type + - aikido + AikidoConnectorCreate: type: object additionalProperties: false + description: The Aikido workspace's REST API client and webhook signing secret. properties: - path: + region: + $ref: '#/components/schemas/AikidoRegion' + client_id: type: string minLength: 1 - maxLength: 4096 + maxLength: 512 + client_secret: + type: string + minLength: 1 + maxLength: 512 + webhook_secret: + type: string + minLength: 1 + maxLength: 512 + description: The signing secret from Aikido's webhooks page, which verifies its deliveries. required: - - path - SandboxFileResult: + - region + - client_id + - client_secret + - webhook_secret + ConnectorsResponse: type: object - additionalProperties: false properties: - data: - type: string - format: byte + connectors: + type: array + items: + $ref: '#/components/schemas/Connector' required: - - data - SandboxSubjectGrantRequest: + - connectors + LavaflowConnectorBinding: type: object - additionalProperties: false + description: 'A place in a connector that reports problems to LavaFlow for a project: a Slack channel, or an Aikido workspace''s issues on the project''s repository.' properties: - expires_at: + id: + type: string + format: uuid + description: The binding's ID, which removing it takes. + project_id: + type: string + format: uuid + connector_type: + $ref: '#/components/schemas/ConnectorType' + connector_id: + type: string + format: uuid + description: The connector the binding reports through. Omitted while the Volcano app is not installed in the binding's Slack workspace; the binding reports again once it is. + slack: + $ref: '#/components/schemas/LavaflowSlackBinding' + aikido: + $ref: '#/components/schemas/LavaflowAikidoBinding' + created_at: type: string format: date-time required: - - expires_at - SandboxAccessRequest: + - id + - project_id + - connector_type + - created_at + LavaflowSlackBinding: type: object - additionalProperties: false + description: The Slack channel a binding reports from. Present when `connector_type` is `slack`. properties: - port: - type: integer - minimum: 1 - maximum: 65532 - expires_in_seconds: - type: integer - minimum: 1 - maximum: 300 - default: 300 + team_id: + $ref: '#/components/schemas/SlackTeamId' + team_name: + type: string + description: The workspace's name, or empty while the Volcano app is not installed in it. + channel_id: + $ref: '#/components/schemas/SlackChannelId' required: - - port - SandboxAccess: + - team_id + - team_name + - channel_id + LavaflowAikidoBinding: type: object - additionalProperties: false + description: The Aikido workspace a binding reports issues from. Present when `connector_type` is `aikido`. properties: - url: - type: string - format: uri - token: - type: string - expires_at: + workspace_name: type: string - format: date-time + min_severity: + $ref: '#/components/schemas/AikidoSeverity' required: - - url - - token - - expires_at - SandboxBuildLogPage: + - workspace_name + - min_severity + LavaflowConnectorBindingsResponse: type: object - required: - - data properties: - data: + bindings: type: array items: - type: object - required: - - timestamp - - message - properties: - timestamp: - type: string - format: date-time - message: - type: string - next_cursor: - type: string - description: Opaque cursor for the next page. Absent when caught up. - SandboxDeployment: + $ref: '#/components/schemas/LavaflowConnectorBinding' + required: + - bindings + LavaflowConnectorBindingCreate: type: object additionalProperties: false properties: - id: + project_id: type: string format: uuid - status: - type: string - created_at: - type: string - format: date-time - updated_at: + description: The project the place reports for. + connector_id: type: string - format: date-time + format: uuid + description: The connector to bind, from `GET /connectors`. + slack: + $ref: '#/components/schemas/LavaflowSlackBindingTarget' + aikido: + $ref: '#/components/schemas/LavaflowAikidoBindingTarget' required: - - id - - status - - created_at - - updated_at - SandboxPagination: + - project_id + - connector_id + description: Send exactly one of `slack` and `aikido`, matching the connector's type. + oneOf: + - required: + - slack + - required: + - aikido + LavaflowSlackBindingTarget: type: object additionalProperties: false + description: The channel to bind, for a `slack` connector. properties: - limit: - type: integer - has_more: - type: boolean - next_cursor: - type: string + channel_id: + $ref: '#/components/schemas/SlackChannelId' required: - - limit - - has_more - SandboxTemplatePage: + - channel_id + LavaflowAikidoBindingTarget: type: object additionalProperties: false + description: What an `aikido` connector reports for the project. Send `aikido`, not `slack`, for an `aikido` connector. properties: - data: + min_severity: + allOf: + - $ref: '#/components/schemas/AikidoSeverity' + description: 'The lowest severity that starts a LavaFlow run. Defaults to `high`: each run counts against the project''s LavaFlow runs.' + GitConnectStartResponse: + type: object + properties: + authorization_url: + type: string + required: + - authorization_url + VerifiedDomain: + type: object + description: A domain the account owns, along with every name below it. + properties: + domain: + type: string + example: example.com + verified_at: + type: string + format: date-time + description: When the account last proved ownership. + required: + - domain + - verified_at + VerifiedDomainsResponse: + type: object + properties: + domains: type: array items: - $ref: '#/components/schemas/SandboxTemplate' - pagination: - $ref: '#/components/schemas/SandboxPagination' + $ref: '#/components/schemas/VerifiedDomain' required: - - data - - pagination - SandboxSessionPage: + - domains + VerifyDomainRequest: type: object - additionalProperties: false properties: - data: + domain: + type: string + minLength: 1 + maxLength: 253 + description: The domain to verify, such as `example.com`. + required: + - domain + GitConnectionsResponse: + type: object + properties: + connections: type: array items: - $ref: '#/components/schemas/SandboxSession' - pagination: - $ref: '#/components/schemas/SandboxPagination' + $ref: '#/components/schemas/GitConnection' required: - - data - - pagination - SandboxDeploymentPage: + - connections + GitInstallation: + type: object + properties: + id: + type: integer + format: int64 + account_login: + type: string + account_type: + type: string + repository_selection: + type: string + required: + - id + - account_login + - account_type + - repository_selection + GitInstallationsResponse: type: object - additionalProperties: false properties: - data: + installations: type: array items: - $ref: '#/components/schemas/SandboxDeployment' - pagination: - $ref: '#/components/schemas/SandboxPagination' + $ref: '#/components/schemas/GitInstallation' required: - - data - - pagination - SandboxPresetList: + - installations + GitRepository: + allOf: + - $ref: '#/components/schemas/GitRepositoryReference' + - type: object + properties: + default_branch: + type: string + private: + type: boolean + is_empty: + type: boolean + description: Whether the repository has no commits and can receive an initial source export. + required: + - default_branch + - private + - is_empty + GitRepositoriesResponse: type: object - additionalProperties: false properties: - data: + repositories: type: array items: - $ref: '#/components/schemas/SandboxPreset' + $ref: '#/components/schemas/GitRepository' required: - - data - Capability: + - repositories + Share: type: object - additionalProperties: false - description: A product capability and whether it accepts new work in this environment. properties: id: type: string - description: Stable capability ID, such as `sandboxes`, `sandboxes.sessions`, `sandboxes.custom_templates`, `issues`, or `autofix`. New IDs may appear at any time. - example: sandboxes.sessions + pattern: ^[A-Za-z0-9]{12}$ + description: The link's public identifier. Its address is `https://volcano.dev/deploy/`. + project_id: + type: string + format: uuid + suggested_name: + type: string + description: A project name for clients to offer a visitor as the default. The create request still carries its own `name`; Volcano does not fill one in from the link. + description: + type: string + maxLength: 280 + description: What the project does, in the owner's words, shown to visitors before they deploy. One line of plain text; empty when the owner wrote none. + allow_reshare: + type: boolean + description: Whether the projects made from this link, and the projects made from those, may be shared again by their owners. False by default, so a copy of this project cannot create, draft, publish or switch on a deploy link of its own, and its links serve nothing. Read at each request, so switching it off stops copies' links that are already on. status: - $ref: '#/components/schemas/CapabilityStatus' + type: string + enum: + - active + - disabled + description: Whether the owner, or Volcano, has the link on. An `active` link can still not serve; see `serving`. + serving: + type: boolean + description: | + Whether the link's address serves its current release now: it is + `active`, published, and nothing stops it, such as deploy links not being + available in this environment, the project being deleted, the owner's + account not allowing traffic, or the project being a copy that may no + longer be shared. An `active` link that is not serving + answers visitors as one switched off, and switching it on again changes + nothing until what stops it is resolved. + disabled_reason: + type: string + nullable: true + example: owner + description: | + Why the link is off. Set only while it is disabled. New reasons can be + added, so treat an unknown one as disabled. `owner`: its owner switched + it off. `operator`: Volcano took it down; its owner cannot switch it back + on or delete it (`PATCH` and `DELETE` answer `403` with code + `operator_disabled`), but can still edit it. While it is down, its + project cannot be shared any more (no new link, draft or publish, and no + link switched on), and no project made from it, or from a copy of it, can + be shared either. + current_release: + allOf: + - $ref: '#/components/schemas/ShareReleaseRef' + nullable: true + description: The release visitors are offered. Null until the first publish; until then the link's preview answers `404`. + created_at: + type: string + format: date-time + updated_at: + type: string + format: date-time required: - id + - project_id + - suggested_name + - description + - allow_reshare - status - CapabilityStatus: - type: string - enum: - - available - - unavailable - description: '`available` means the capability accepts new work; a temporary outage still answers `503`. `unavailable` means requests that start new work answer `404` or `400` with code `feature_unavailable`. Treat any other value as `unavailable`.' - CapabilityList: - type: object - additionalProperties: false - properties: - data: - type: array - items: - $ref: '#/components/schemas/Capability' - required: - - data - SandboxCapacity: + - serving + - current_release + - created_at + - updated_at + ShareReleaseRef: type: object - additionalProperties: false properties: - region: + id: type: string - allocated_memory_mb: - type: integer - format: int64 - minimum: 0 + format: uuid + published_at: + type: string + format: date-time required: - - region - - allocated_memory_mb - SandboxCapacityList: + - id + - published_at + SharesResponse: type: object - additionalProperties: false properties: - data: + shares: type: array items: - $ref: '#/components/schemas/SandboxCapacity' + $ref: '#/components/schemas/Share' required: - - data - PublishSandboxPresetRequest: + - shares + ShareCreateRequest: type: object additionalProperties: false properties: - id: + project_id: type: string format: uuid - preset: + description: The project to share. A project the caller can't share answers like one that doesn't exist. + suggested_name: type: string - enum: - - python3.12 - - node22 - memory_mb: - type: integer - enum: - - 1024 - - 2048 - deployment_id: + maxLength: 64 + pattern: ^[A-Za-z0-9_-]*$ + description: A project name for clients to offer visitors as the default; the create request still carries its own `name`. It may contain only letters, numbers, underscores and hyphens. + description: type: string - format: uuid + maxLength: 280 + description: What the project does, shown to visitors before they deploy. One line of plain text with no control characters; surrounding spaces are trimmed. + allow_reshare: + type: boolean + description: Lets the projects made from this link be shared again by their owners. Defaults to false. required: - - id - - preset - - memory_mb - - deployment_id - AnonKey: + - project_id + ShareUpdateRequest: type: object + additionalProperties: false + minProperties: 1 properties: - id: + suggested_name: type: string - format: uuid - project_id: + maxLength: 64 + pattern: ^[A-Za-z0-9_-]*$ + description: type: string - format: uuid - name: + maxLength: 280 + description: What the project does, shown to visitors before they deploy. One line of plain text with no control characters; surrounding spaces are trimmed. Send an empty string to remove it. + allow_reshare: + type: boolean + description: Lets the projects made from this link be shared again by their owners. Switching it off stops their copies, and copies of those, from sharing again, read at each request, including links of theirs that are already on. + status: type: string - key_value: + enum: + - active + - disabled + ShareReleaseCreateRequest: + type: object + additionalProperties: false + properties: + share_id: type: string - description: JWT token - use this in frontend Authorization header - permissions: + pattern: ^[A-Za-z0-9]{12}$ + description: The share to publish to. Its own project authorizes the publish. + draft_id: + type: string + minLength: 1 + maxLength: 128 + description: | + The `draft_id` of the draft the owner reviewed. If a fresh build of the + project is not that draft, nothing is published and the answer is `409` + `draft_changed` with the new draft. + variables: type: array + maxItems: 100 items: type: string + minLength: 1 + maxLength: 256 description: | - Permissions granted to this anon key. - Auth permissions: auth.signup, auth.signin, auth.refresh, auth.logout, auth.password_reset, auth.confirm_email, auth.resend_confirmation - Storage permissions: storage.upload, storage.download, storage.list, storage.delete - Realtime permissions: realtime.connect, realtime.subscribe, realtime.publish - Functions permissions: functions.invoke - example: - - auth.signup - - auth.signin - - auth.refresh - - auth.logout - is_default: - type: boolean - description: Whether this is the project's configured default anon key. Only one key per project can be default. - created_at: - type: string - format: date-time + Every name in the draft's `variables`, which a project created from the + release gets. Values are never carried: each is created empty unless the + visitor gives one. + service_key_functions: + type: array + maxItems: 100 + items: + type: string + minLength: 1 + maxLength: 255 + description: | + The functions that receive the new project's `VOLCANO_SERVICE_KEY`, which + bypasses row-level security. Must be exactly the draft's + `service_key_functions`. required: - - id - - name - - key_value - AuthConfig: + - share_id + - draft_id + - variables + - service_key_functions + ForkCreateRequest: type: object + additionalProperties: false properties: - project_id: + share_id: + type: string + pattern: ^[A-Za-z0-9]{12}$ + description: The share to fork, the id at the end of its deploy URL. + release_id: type: string format: uuid - access_token_lifetime: - type: integer - description: Access token lifetime in seconds - default: 3600 - refresh_token_lifetime: - type: integer - description: Refresh token lifetime in seconds - default: 2592000 - refresh_token_reuse_interval: - type: integer - description: A refresh within this many seconds of the refresh token being issued returns the same refresh token instead of rotating it, so concurrent refreshes from several tabs all succeed - default: 10 - inactivity_timeout: - type: integer - description: Force re-login after inactivity (seconds, 0=never) - default: 0 - max_session_duration: - type: integer - description: Force re-login after duration (seconds, 0=never) - default: 0 - min_password_length: - type: integer - minimum: 15 - maximum: 128 - default: 15 - description: Configured minimum password length in Unicode characters. - password_policy: - $ref: '#/components/schemas/AuthPasswordPolicy' - require_uppercase: - type: boolean - default: false - require_lowercase: - type: boolean - default: false - require_numbers: - type: boolean - default: false - require_special_chars: - type: boolean - default: false - enable_signup: - type: boolean - description: Master switch - allow new user signups via ANY provider - default: true - enable_email_password: - type: boolean - description: Enable email/password authentication as a provider - default: true - rate_limit_signup: - type: integer - description: Signups per hour per IP - default: 100 - rate_limit_signin: - type: integer - description: Signins per hour per IP - default: 100 - rate_limit_token_refresh: - type: integer - description: Refreshes per hour per IP - default: 1000 - rate_limit_password_reset: - type: integer - description: Password reset requests per hour per IP. Unlike the other limits, 0 applies the default of 10 instead of turning the limit off. - default: 10 - cors_enabled: - type: boolean - default: false - cors_allowed_origins: + description: The `release.id` the share's preview returned, so only the release the visitor saw is installed. + name: + type: string + minLength: 1 + maxLength: 255 + description: The new project's name, which may contain only letters, numbers, underscores and hyphens. A name you already use gets a short random suffix. An invalid name answers `400` before anything is counted against the share or your hourly fork limit. + variables: + type: object + maxProperties: 100 + additionalProperties: + type: string + maxLength: 4096 + description: | + Values for the variables the preview lists, by name. Any may be left out + and is then created empty; only listed names are accepted (`422` + otherwise). Each value is at most 4096 bytes of UTF-8, since a function's + environment is limited in bytes; a longer one, or one containing a NUL + character, answers `400`. Values are never logged, and `Idempotency-Key` compares only the names given a value. + required: + - share_id + - release_id + - name + ShareReleaseFunction: + type: object + properties: + name: + type: string + kind: + type: string + enum: + - standard + - durable + visibility: + type: string + description: The function's invocation visibility, as installed. + invocation_mode: + type: string + description: The function's invocation mode, when it is not the default. + http_auth_mode: + type: string + description: | + How the function's HTTP invocations authenticate, when its invocation + settings are not the default; omitted means `volcano`. `none` lets + anyone call the function without a credential in every project made from + the release. Releases published before this was recorded omit it. + openapi_spec_sha256: + type: string + pattern: ^[0-9a-f]{64}$ + description: | + The SHA-256 of the function's OpenAPI document as the release carries it, + when it has one, so a draft shows when the document changed. Releases + published before this was recorded omit it. + variable_scope: + type: string + enum: + - scoped + description: | + `scoped` when the function receives only the variables it declares, as + your project's function does, listed in `variables`. Omitted when it + receives every variable shared with functions. The service key is not + part of it: `service_key_functions` says which functions receive that. + Releases published before this was recorded omit it. + variables: type: array items: type: string - example: - - https://myapp.com - - http://localhost:3000 - enable_anonymous_signins: - type: boolean - description: Allow creating users without email/password - default: false - allowed_email_domains: - type: array + description: For a `scoped` function, the variables it declares that a project made from the release has. + required: + - name + - kind + ShareReleaseOmission: + type: object + description: Something a release does not carry. + properties: + kind: + type: string + enum: + - no_source + - database + - sandbox + - secret_file + - unsupported_entry + description: | + `no_source`: a function or frontend whose current deployment has no stored + source to carry. `database`: a database; a visitor's project starts without + one. `sandbox`: a sandbox, which releases do not deploy. `secret_file`: a + file that may hold credentials, such as a dotenv or `.envrc` file, a tool's + token file like `.netrc` or an `.npmrc` holding a registry credential, a + private key, a credential JSON or a Terraform variables file. `unsupported_entry`: a file that is not a regular file, + such as a symbolic link. + resource: + type: string + description: The function, frontend, database or sandbox, when there is one. + path: + type: string + description: The file left out, for a file. + required: + - kind + ShareReleaseDraft: + type: object + properties: + draft_id: + type: string description: | - Email domains allowed to create users in this project. Applies to - email/password signup, OAuth/SSO signup, anonymous conversion, and - email changes. Empty (the default) allows every domain. - - Entries are stored normalized (lowercase, no `@` prefix) and match - the domain part exactly: `domain1.com` does not cover - `mail.domain1.com`. Signups from other domains are rejected with - 403, and `allowed_email_domains_mode` decides whether sign-in is - covered as well. - - The allowlist is a SUPERAGENT feature to configure and to enforce. A - downgrade parks it: the domains are still returned here and stop - being applied until the project is back on SUPERAGENT. + Opaque. Names exactly what a release built now would carry: each + function's and frontend's current deployment, and everything the draft + lists, including each function's settings (`http_auth_mode`, + `openapi_spec_sha256`, `variable_scope`), the `variables`, the + `frontend_variables` and the `omissions`. It stays the same while those + do, and changes when a function or frontend is redeployed or anything the + draft lists changes. A sandbox is not part of it, since a release does not + carry one: rebuilding only a sandbox leaves it unchanged. Send it with the + publish. + functions: + type: array + items: + $ref: '#/components/schemas/ShareReleaseFunction' + frontends: + type: array items: type: string - example: - - domain1.com - - domain2.com - allowed_email_domains_mode: - type: string + variables: + type: array + items: + $ref: '#/components/schemas/ShareVariable' + description: The project's variables a visitor could be asked to supply. Volcano's own, such as `VOLCANO_API_URL`, are never listed. + service_key_functions: + type: array + items: + type: string + description: The functions whose code reads `VOLCANO_SERVICE_KEY`. A release gives them the visitor project's service key once the owner confirms them. + omissions: + type: array + items: + $ref: '#/components/schemas/ShareReleaseOmission' + frontend_variables: + type: object + additionalProperties: + type: array + items: + type: string description: | - How far `allowed_email_domains` reaches. `signup` only gates account - creation, so accounts that predate the list keep signing in. - `signup_and_signin` also refuses to issue a session to an account - whose domain is not listed. `disabled` keeps the list without - enforcing it. - enum: - - disabled - - signup - - signup_and_signin - default: signup - platform_token_ttl: - type: integer - description: TTL in seconds for platform tokens minted via `/auth/platform/exchange` - default: 2592000 - allow_password_reset: - type: boolean - description: Enable forgot password flow - default: true - password_reset_timeout: - type: integer - description: Recovery token expiry in seconds - default: 3600 - max_password_history: - type: integer - description: Number of previous passwords to remember (0=disabled) - default: 0 - cors_allow_credentials: - type: boolean - description: Allow credentials in CORS requests - default: true - cors_max_age: - type: integer - description: CORS preflight cache duration (seconds) - default: 86400 - require_email_confirmation: - type: boolean - description: Require users to confirm email before sign-in. Can only be true when email_enabled is true. - default: false - email_confirmation_timeout: - type: integer - description: Email confirmation token expiry in seconds. - default: 86400 - auto_link_verified_oauth: - type: boolean - description: Link a verified OAuth identity to an existing confirmed account with the same email instead of returning a conflict. Requires require_email_confirmation to be true. - default: false - email_enabled: - type: boolean - description: Enable transactional email sending (confirmation, reset, change notifications). Must be true when require_email_confirmation is true. - default: false - email_from_address: + The draft's variables each frontend receives, by frontend name, as your + project's frontend of that name selects them by its variable scope now. + A frontend receives no others. + required: + - draft_id + - functions + - frontends + - variables + - service_key_functions + - omissions + - frontend_variables + ShareDraftChangedError: + type: object + properties: + error: type: string - email_from_name: + code: type: string - smtp_host: + enum: + - draft_changed + draft: + $ref: '#/components/schemas/ShareReleaseDraft' + required: + - error + - code + - draft + ShareRelease: + type: object + properties: + id: type: string - smtp_port: - type: integer - default: 587 - smtp_username: + format: uuid + share_id: type: string - smtp_password_configured: - type: boolean - description: Whether an SMTP password is configured. The password itself is never returned. - default: false - smtp_use_tls: - type: boolean - default: true - email_confirmation_subject: + pattern: ^[A-Za-z0-9]{12}$ + project_id: type: string - email_password_reset_subject: + format: uuid + published_at: type: string - email_password_changed_subject: + format: date-time + published_by: type: string - managed_auth_enabled: - type: boolean - description: Enables project-hosted managed auth pages. - default: false - post_auth_redirect_url: + description: The id of the user who published the release. + sha256: type: string - description: Default redirect target after successful hosted auth. - allowed_redirect_urls: + pattern: ^[0-9a-f]{64}$ + description: The digest of the stored release archive. An install refuses an archive that does not match it. + size_bytes: + type: integer + format: int64 + functions: + type: array + items: + $ref: '#/components/schemas/ShareReleaseFunction' + frontends: type: array - description: Redirect allowlist used to validate post_auth_redirect_url and post_logout_redirect_url. items: type: string - post_logout_redirect_url: + variables: + type: array + items: + $ref: '#/components/schemas/ShareVariable' + service_key_functions: + type: array + items: + type: string + omissions: + type: array + items: + $ref: '#/components/schemas/ShareReleaseOmission' + required: + - id + - share_id + - project_id + - published_at + - published_by + - sha256 + - size_bytes + - functions + - frontends + - variables + - service_key_functions + - omissions + PaginatedShareReleases: + type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/ShareRelease' + limit: + type: integer + description: Number of items per page + has_more: + type: boolean + description: Whether a next page exists + next_cursor: type: string - description: Redirect target after logout from hosted pages. - device_verification_url: + description: Opaque cursor for the next page, present if has_more is true. It works only for the same share_id and limit. + required: + - data + - limit + - has_more + SharePreview: + type: object + properties: + id: type: string - description: | - Optional override for the device-authorization verification page. - When set, POST /auth/device/authorize returns this URL (with the - user_code) as verification_uri/verification_uri_complete instead of - the built-in managed device page. Lets a CLI surface the project's - own RFC 8628 approval page. Empty falls back to the managed page. - example: https://app.acme.com/device - created_at: + pattern: ^[A-Za-z0-9]{12}$ + suggested_name: type: string - format: date-time - updated_at: + description: A project name the link's owner suggests, for clients to offer as the default. The create request still carries its own `name`; Volcano does not fill one in from the link. + description: type: string - format: date-time + description: What the project does, in the owner's words. Plain text; empty when the owner wrote none. + release: + $ref: '#/components/schemas/SharePreviewRelease' required: - - password_policy - AuthInsightsInterval: - type: string - enum: - - day - - week - - month - AuthInsightsResponse: + - id + - suggested_name + - description + - release + SharePreviewRelease: type: object - additionalProperties: false + description: The release a project created from the link installs. properties: - project_id: + id: type: string format: uuid - observed_at: + description: Send it as `release_id` in `POST /forks` to confirm this release. + published_at: type: string format: date-time - window: - $ref: '#/components/schemas/AuthInsightsWindow' - summary: - $ref: '#/components/schemas/AuthInsightsSummary' - series: + sha256: + type: string + pattern: ^[0-9a-f]{64}$ + description: The digest of the stored release archive. + frontends: + type: array + items: + type: string + description: Names of the frontends installing the release creates. + functions: type: array items: - $ref: '#/components/schemas/AuthInsightsSeriesPoint' + type: string + description: Names of the functions installing the release creates. + service_key_functions: + type: array + items: + type: string + description: | + Names of the functions that receive the new project's `VOLCANO_SERVICE_KEY`, + which bypasses row-level security. Show them to the visitor before they + confirm. Empty when no function receives it. + variables: + type: array + items: + $ref: '#/components/schemas/ShareVariable' + description: | + The project variables the new project gets, sorted by name. A visitor may + give a value for any of them as `variables` when creating + the fork with `POST /forks`; each one left out is created empty, for the visitor to set + later. Volcano's own variables, such as `VOLCANO_API_URL`, are never + listed: the install sets them. + omissions: + type: array + items: + $ref: '#/components/schemas/ShareReleaseOmission' + description: What the release does not carry. A `database` entry means the new project starts without that database. required: - - project_id - - observed_at - - window - - summary - - series - AuthInsightsSeriesPoint: + - id + - published_at + - sha256 + - frontends + - functions + - service_key_functions + - variables + - omissions + ShareVariable: type: object - additionalProperties: false + description: A project variable a deploy link's release declares. A project created from the link always gets it. properties: - bucket_start: + name: type: string - format: date - signups: - type: integer - format: int64 - minimum: 0 - description: Registrations during the bucket. Subsequent deletion does not subtract from this count. Historical counts removed before deletion-history collection cannot be reconstructed. - signins: - type: integer - format: int64 - minimum: 0 - description: Successful session creations during the bucket. - banned_users: - type: integer - format: int64 - minimum: 0 - description: Users registered in this bucket who are currently banned. Excludes deleted users, lifted bans, expired temporary bans, and internal test identities. - deleted_users: - type: integer - format: int64 - minimum: 0 - description: Users registered in this bucket who are now deleted, counted once across soft and hard deletion. Grouped by signup date, not deletion date. - available_users: - type: integer - format: int64 - minimum: 0 - description: Currently available users registered in this bucket (signups minus banned_users minus deleted_users). Unban or expiry restores availability in the original signup bucket. This measures account availability, not return activity. - deletions: - type: integer - format: int64 - minimum: 0 - description: Accounts deleted during this bucket, counted once across soft and hard deletion. - net_growth: - type: integer - format: int64 - description: Registrations minus deletions during this bucket. May be negative. Bans do not affect this value. - is_partial: + description: The variable's name. + required: type: boolean - description: Whether the requested window or observation time clips this bucket. + description: | + Always true: a project created from the link always gets this variable, + created empty when the visitor gives no value. It never means a value must + be given. + secret: + type: boolean + description: | + Whether to treat the value as a secret: take it masked and never show it back. Only a + `NEXT_PUBLIC_` name, which a Next.js build copies into the browser, is not secret. + unshared: + type: boolean + description: | + True when the source project gives the variable only to the scoped + functions that declare it, not to every function, and so does a project + made from the release. Omitted when false. required: - - bucket_start - - signups - - signins - - is_partial - - deletions - - banned_users - - deleted_users - - available_users - - net_growth - AuthInsightsSummary: + - name + - required + - secret + ShareKindCount: type: object - additionalProperties: false properties: - total_users: - type: integer - format: int64 - minimum: 0 - description: Current auth-user count, excluding accounts with deleted status. - deleted_users: - type: integer - format: int64 - minimum: 0 - description: Recorded deletions, excluding internal test identities. Includes soft and hard deletion, counted once per account. - active_users_1d: + kind: + type: string + enum: + - click + - preview + - confirm + - accepted + - ready + - failed + events: type: integer format: int64 - minimum: 0 - description: Distinct users active in the trailing 24 hours, including activity before account deletion. - active_users_30d: + visitors: type: integer format: int64 - minimum: 0 - description: Distinct users with a successful session creation or refresh in the trailing 30 days, including activity before account deletion. + description: Unique daily visitors among the events that carried one. A visitor is pseudonymised per day, so one who returns on another day counts again. required: - - total_users - - active_users_30d - - active_users_1d - - deleted_users - AuthInsightsWindow: + - kind + - events + - visitors + ShareDailyCount: type: object - additionalProperties: false properties: - from: + day: type: string format: date - to: + description: UTC day. + kind: type: string - format: date - interval: - $ref: '#/components/schemas/AuthInsightsInterval' + enum: + - click + - preview + - confirm + - accepted + - ready + - failed + events: + type: integer + format: int64 required: - - from - - to - - interval - AuthHostedPage: + - day + - kind + - events + ShareStats: type: object properties: - id: + since: type: string - format: uuid - project_id: + format: date-time + description: Start of the counted window. + totals: + type: array + items: + $ref: '#/components/schemas/ShareKindCount' + daily: + type: array + items: + $ref: '#/components/schemas/ShareDailyCount' + required: + - since + - totals + - daily + ProjectGitConnection: + type: object + properties: + repo_installation_id: + type: integer + format: int64 + repo_id: + type: integer + format: int64 + description: Stable GitHub repository id (repository.id), the authoritative binding. + repo_full_name: type: string - format: uuid - page_type: - $ref: '#/components/schemas/HostedAuthPageType' - html: + root_directory: type: string - description: HTML content for this page type. - css: + production_branch: type: string - description: CSS content for this page type. - created_at: + description: The branch a push must land on to deploy. Follows the repository's GitHub default branch unless the project set its own, which a default-branch rename on GitHub then leaves alone. + production_branch_follows_default: + type: boolean + description: True when `production_branch` follows the repository's default branch and moves with a default-branch rename on GitHub. False when the project pinned a branch, even one that matches the current default. Pin a branch with `PUT /projects/{id}/git-connection/production-branch`; send an empty `production_branch` there to follow the default again. + updated_at: type: string format: date-time + description: 'When the connection last changed: its repository, root directory or production branch. Naming the branch it already uses, and other changes to the project, leave it alone. A connection that has not changed since Volcano began tracking this reports the project''s last change before then.' + required: + - repo_installation_id + - repo_id + - repo_full_name + - root_directory + - production_branch + - production_branch_follows_default + - updated_at + ProjectGitOwnerPush: + type: object + description: Whether the project owner can push to the project's connected repository. + properties: + repository_id: + type: integer + format: int64 + description: Stable GitHub repository id of the connected repository, the `repo_id` of the project's git connection. + can_push: + type: boolean + description: True when the project owner's GitHub account can push to the repository. + reason: + type: string + enum: + - owner_not_connected + - owner_reconnect_required + - repository_access_lost + - no_push_permission + x-enum-varnames: + - ProjectGitOwnerPushReasonOwnerNotConnected + - ProjectGitOwnerPushReasonOwnerReconnectRequired + - ProjectGitOwnerPushReasonRepositoryAccessLost + - ProjectGitOwnerPushReasonNoPushPermission + description: 'Why `can_push` is false; absent when it is true. `owner_not_connected`: the owner has not connected a GitHub account. `owner_reconnect_required`: the owner''s GitHub connection expired or was revoked; the owner reconnects GitHub. `repository_access_lost`: the owner''s GitHub account can no longer see the repository. `no_push_permission`: the owner''s GitHub account can read the repository but not push to it.' + required: + - repository_id + - can_push + ProjectGitDeploySettings: + type: object + description: 'A project''s GitHub auto-deploy settings: what a push to the connected repo''s production branch deploys. Every setting but skip_unchanged is default-off.' + properties: + auto_deploy_enabled: + type: boolean + description: Whether a production-branch push triggers a deployment. + deploy_functions: + type: boolean + description: Whether the repo's functions are deployed on push. + frontend_name: + type: string + description: Name of the frontend to build and deploy on push. Omitted when no frontend is deployed. Resolved at deploy time; need not exist yet. + frontend_app_root: + type: string + description: App root (subdirectory) the frontend builds from. Omitted for the repo root. + apply_migrations: + type: boolean + description: Whether a push applies the commit's pending migrations, the SQL files under volcano/migrations, before it deploys anything. Each database gets a migration run with source `git_deploy`; when one fails, nothing from the push deploys and the live version keeps serving. A push starts a migration run only while the project owner's account is `active`; otherwise it starts none, deploys nothing, and fails with code `owner_not_active`. A run an earlier attempt of the push started before the account changed keeps its outcome, but the push still deploys none of its code and fails with `owner_not_active`; its message says the schema changes stay. Nothing retries that push; push again once the account is `active`, and that push skips the migrations already applied. Reads back as saved even where the `databases.migrations` capability is unavailable; there, a push whose commit has migrations deploys nothing. + skip_unchanged: + type: boolean + description: Whether a push leaves a function or frontend on its current deployment when it would deploy the same code the same way. A function is left alone when its live deployment succeeded, was built from a byte-identical source archive by the same build, and has the same runtime, handler, kind, variable scope, memory and regions. A change to shared code under a `_`-prefixed path redeploys every function. A frontend is left alone when its live deployment compiled the same files (the frontend's whole workspace, including `volcano/` for a frontend at the project root) with the same app root, framework, build, build variable values, sizing and regions. Either is deployed again when it was deployed some other way since the last push or a promoted preview serves it, and a function is deployed again after any variable change since its deployment. The push records a skipped resource as unchanged and counts it as succeeded. On by default. Takes effect only where the `git_deploy.skip_unchanged` capability is available; elsewhere every push deploys every function and frontend as if this were off. updated_at: type: string format: date-time - AuthPageAppearanceResponse: - type: object + description: When the settings were last saved, or last changed by connecting a repository. Other changes to the project leave it alone. Settings a connection turned on before Volcano began tracking this report the project's last change before then; settings never saved or changed report when the project was created. required: - - theme - - layouts - - customisation_allowed - - parked - - defaults - - options + - auto_deploy_enabled + - deploy_functions + - apply_migrations + - skip_unchanged + - updated_at + UpdateProjectGitDeploySettingsRequest: + type: object + description: Full replace of a project's Git auto-deploy settings, except apply_migrations and skip_unchanged, which keep their saved values when omitted. properties: - theme: - $ref: '#/components/schemas/AuthPageTheme' - layouts: - type: object - additionalProperties: - $ref: '#/components/schemas/AuthPageLayout' - customisation_allowed: + auto_deploy_enabled: type: boolean - parked: - type: object - additionalProperties: - type: boolean - description: Per-page saved-but-not-live state. - defaults: - $ref: '#/components/schemas/AuthPageAppearanceDefaults' - options: - $ref: '#/components/schemas/AuthPageAppearanceOptions' - AuthPageDensity: - type: string - enum: - - compact - - comfortable - - spacious - AuthPageFont: - type: string - enum: - - system - - humanist - - geometric - - slab - - mono - AuthPageLayout: - type: string - enum: - - centered - - split-left - - split-right - AuthPageRadius: - type: string - enum: - - none - - small - - medium - - large - AuthPageScale: + deploy_functions: + type: boolean + frontend_name: + type: string + description: Legacy frontend to deploy on push. In Git mode, explicitly send an empty string to stop deploying the selected frontend; omit frontend_app_root too. This keeps the serving frontend and Git handover intact. Omitting an existing selection or renaming it is refused in Git mode. In platform mode, omit or empty to deploy no frontend. Explicit source-layout mappings are independent of this legacy selection. + frontend_app_root: + type: string + description: App root the frontend builds from. Requires frontend_name; omit for the repo root. + apply_migrations: + type: boolean + description: Apply the commit's pending migrations before each push deploys. Anyone who can push to the production branch can then run any SQL as the database owner, so protect that branch first. Off until set. Omit to leave the saved value unchanged. Turning it on answers `400` with code `feature_unavailable` where the `databases.migrations` capability is unavailable; `false`, or the saved `true` sent back, is accepted even there. While the project owner's account is `read_only`, the request answers `403` whatever it sends; an `inactive` owner's credentials answer `401`. + skip_unchanged: + type: boolean + description: Leave a function or frontend on its current deployment when a push would deploy the same code the same way. On until set. Set it to false to deploy every function and frontend on every push. Omit to leave the saved value unchanged. + required: + - auto_deploy_enabled + - deploy_functions + GitDeploymentRunStatus: type: string enum: - - small - - default - - large - AuthPageTheme: + - pending + - running + - succeeded + - failed + - superseded + - skipped + x-enum-varnames: + - GitDeploymentRunStatusPending + - GitDeploymentRunStatusRunning + - GitDeploymentRunStatusSucceeded + - GitDeploymentRunStatusFailed + - GitDeploymentRunStatusSuperseded + - GitDeploymentRunStatusSkipped + description: 'Where a run is. `pending` and `running` have not ended. `succeeded`: every deployment the run dispatched succeeded, or the commit only had migrations to apply. `failed`: `error` says why. `superseded`: a newer push replaced the run before it started. `skipped`: there was nothing to deploy; `error` says why.' + GitDeploymentRunError: type: object - additionalProperties: false - required: - - version - - colors - - font - - scale - - density - - radius + description: Why a run failed or was skipped. properties: - version: - type: integer - enum: - - 1 - colors: - $ref: '#/components/schemas/AuthPageThemeColors' - font: - $ref: '#/components/schemas/AuthPageFont' - scale: - $ref: '#/components/schemas/AuthPageScale' - density: - $ref: '#/components/schemas/AuthPageDensity' - radius: - $ref: '#/components/schemas/AuthPageRadius' - AuthHostedPageResponse: - type: object + code: + type: string + description: 'Stable machine-readable reason. For a failed run: `migration_failed`, `migration_invalid_layout`, `migration_timeout`, `feature_unavailable`, `source_invalid`, `child_deploy_failed`, `child_deploy_not_started`, `deploy_refused`, `typescript_not_compiled`, `deploy_failed`, `max_attempts_exhausted`, `owner_not_active`, or `project_deleting`. `source_invalid`, `deploy_refused`, and `typescript_not_compiled` fail the same way if the same commit is pushed again; `child_deploy_not_started`, `deploy_failed`, and `max_attempts_exhausted` may succeed on another push; for `owner_not_active`, reactivating the owner''s account restores deployment eligibility; push again to deploy. `project_deleting` means the project is being deleted. For a skipped run: `auto_deploy_disabled`, `binding_changed`, `disconnected`, `project_missing`, or `nothing_to_deploy`. Treat a code you do not know as a failure.' + message: + type: string + description: What happened. For `migration_failed`, `migration_invalid_layout`, `source_invalid`, `deploy_refused`, `child_deploy_not_started`, and `typescript_not_compiled` it names the database, files, resource, or setting at fault when Volcano has them. required: - - page - - defaults - - runtime + - code + - message + GitDeploymentMigrationRun: + type: object + description: A migration run a deployment run started. Get it at `GET /projects/{id}/databases/{databaseName}/migration-runs/{runId}` with `database.name` and `id`. properties: - page: - allOf: - - $ref: '#/components/schemas/AuthHostedPage' - nullable: true - description: The saved page, or null when the project has not customized this page type yet. - defaults: - $ref: '#/components/schemas/AuthHostedPageDefaults' - runtime: - $ref: '#/components/schemas/AuthHostedPageRuntime' - AuthIdentity: + id: + type: string + format: uuid + database: + $ref: '#/components/schemas/ResourceReference' + required: + - id + - database + GitDeploymentRun: type: object - description: | - A real email identity owned by the account. One account can own multiple - identities (for example a work email plus a personal email linked via OAuth). + description: One commit's deployment through Git auto deploy, from a push to the production branch or a `POST /projects/{id}/git-deployment-runs`. properties: id: type: string format: uuid - description: Unique identity identifier - email: + status: + $ref: '#/components/schemas/GitDeploymentRunStatus' + branch: type: string - format: email - description: The email address this identity represents - email_verified: + description: The branch the push updated, the project's production branch at the time. + commit_sha: + type: string + description: The commit the run deploys. + apply_migrations: type: boolean - description: Whether ownership of this email has been verified - is_primary: + description: 'Whether the run applies the commit''s migrations: the project''s `apply_migrations` Git deploy setting when the push arrived.' + skip_unchanged: type: boolean - description: Whether the account's primary sign-in method resolves to this identity + description: 'Whether the push asked to leave unchanged functions and frontends on their current deployments: the project''s `skip_unchanged` Git deploy setting when the push arrived, and false for a run requested with `force: true`. It took effect only where the `git_deploy.skip_unchanged` capability was available when the run deployed; otherwise the run deployed every function and frontend. False for runs recorded before the setting existed.' + migration_runs: + type: array + description: The migration runs the run started, one per database, ordered by database name. Empty when it started none. + items: + $ref: '#/components/schemas/GitDeploymentMigrationRun' + error: + $ref: '#/components/schemas/GitDeploymentRunError' created_at: type: string format: date-time + description: When the push was recorded. + started_at: + type: string + format: date-time + description: When a worker first picked the run up. + completed_at: + type: string + format: date-time + description: When the run ended. required: - id - - email - - email_verified - - is_primary + - status + - branch + - commit_sha + - apply_migrations + - skip_unchanged + - migration_runs - created_at - AuthIdentitiesResponse: + CreateGitDeploymentRunRequest: type: object + additionalProperties: false properties: - identities: + force: + type: boolean + default: false + description: Deploy every configured function and frontend, even one the project's `skip_unchanged` setting would leave on its current deployment. Applies to this run only. + PaginatedGitDeploymentRuns: + type: object + properties: + data: type: array items: - $ref: '#/components/schemas/AuthIdentity' + $ref: '#/components/schemas/GitDeploymentRun' + limit: + type: integer + description: Number of items per page + has_more: + type: boolean + description: Whether a next page exists + next_cursor: + type: string + description: Opaque cursor for the next page (present if has_more is true) required: - - identities - AuthMethodSummary: + - data + - limit + - has_more + RealtimePublishRequest: type: object - description: | - A single sign-in method the account owns (password, an OAuth provider, or an - active anonymous method). `is_primary` reflects the account's primary_method_id. + additionalProperties: false properties: - id: + channel: type: string - format: uuid - description: Unique method identifier - type: - type: string - x-go-type: string - description: The kind of sign-in method - enum: - - password - - oauth - - anonymous - provider: + maxLength: 75 + pattern: ^(broadcast|grant):[A-Za-z0-9_-]+(:[A-Za-z0-9_-]+)*$ + description: The client channel, `broadcast:` or `grant:`, with a name of at most 64 characters. + event: type: string - description: OAuth provider name; present only when type is oauth - example: google - identity_id: + pattern: ^[A-Za-z0-9][A-Za-z0-9_.-]{0,63}$ + description: The message type subscribers match on. + payload: + x-go-type: json.RawMessage + x-go-type-skip-optional-pointer: true + description: Any JSON value, sent to subscribers as `payload`. + required: + - channel + - event + - payload + RealtimePublishResult: + type: object + additionalProperties: false + properties: + channel: type: string + description: The channel the message was sent to. + required: + - channel + ProjectLockLeaseRequest: + type: object + additionalProperties: false + properties: + ttl_seconds: + type: integer + minimum: 5 + maximum: 7776000 description: | - The identity this method signs in to — a UUID for password/oauth methods, - empty for anonymous methods. - email: + Lease duration in seconds, from 5 seconds through 90 days, measured + from when the request is served. Renew before it elapses. A renewal + sets the new expiry outright, so a shorter TTL shortens the lease. + Renewals cannot extend an acquisition beyond its absolute 90-day + deadline. + required: + - ttl_seconds + ProjectLockLease: + type: object + additionalProperties: false + properties: + expires_at: type: string - description: The email of the method's identity (empty for anonymous) - is_primary: + format: date-time + description: Advisory lease expiry timestamp in UTC. + fencing_token: + type: integer + format: int64 + description: | + Monotonically increasing token for this acquisition. It rises whenever the + lock changes hands and stays the same across renewals of one lease. Pass it + to the resource you are protecting and reject any write carrying a token + lower than the highest already seen; that is what stops a displaced holder + from writing after its lease lapsed. + required: + - expires_at + - fencing_token + ProjectLockState: + type: object + additionalProperties: false + properties: + held: type: boolean - description: Whether this is the account's primary sign-in method - last_used_at: + description: | + Whether the lock is unavailable right now. False means an acquire would + succeed. It remains true during the brief grace window after expiry. + expires_at: type: string format: date-time - description: When this method was last used to sign in, if ever - created_at: + description: Advisory lease expiry timestamp in UTC. Present only when held. + fencing_token: + type: integer + format: int64 + description: Current holder's fencing token. Present only when held. + required: + - held + ProjectSourceExportState: + type: object + description: The project's source of truth and any pending Git transition. + properties: + mode: + type: string + enum: + - platform + - git_exporting + - git_pending + - git + transition_started_at: type: string format: date-time - updated_at: + nullable: true + description: When source export started, cleared if an incomplete transition is canceled. + exported_at: + type: string + format: date-time + nullable: true + description: When the initial export push entered deployment, or when a transition was canceled after its commit was reserved. Once set, the one-time export is consumed. + handed_over_at: type: string format: date-time + nullable: true + description: When a complete production-branch deployment first proved the repository could drive the project, null until then. Once set, the repository is the project's source of truth. required: - - id - - type - - identity_id - - email - - is_primary - - created_at - - updated_at - AuthMethodsResponse: + - mode + - transition_started_at + - exported_at + - handed_over_at + ProjectSourceExport: type: object + description: The initial production-branch commit, and everything export could not carry. properties: - methods: + repo_full_name: + type: string + branch: + type: string + description: The production branch that was created. + commit_sha: + type: string + file_count: + type: integer + skipped: type: array + description: Resources whose source could not be taken, with the reason. Most often a resource that has never deployed successfully. items: - $ref: '#/components/schemas/AuthMethodSummary' + $ref: '#/components/schemas/ProjectSourceExportSkip' + omitted: + type: array + description: Things deliberately left out of the branch. + items: + $ref: '#/components/schemas/ProjectSourceExportOmission' required: - - methods - AuthPasswordPolicy: + - repo_full_name + - branch + - commit_sha + - file_count + - skipped + - omitted + ExportProjectSourceRequest: type: object additionalProperties: false - description: Effective backend-enforced password policy. properties: - effective_min_length: - type: integer - minimum: 15 - maximum: 128 - description: Effective minimum password length in Unicode characters. - min_configurable_length: - type: integer - minimum: 15 - maximum: 15 - description: Lowest minimum password length accepted by the auth configuration endpoint. - max_length: + production_branch: + type: string + minLength: 1 + description: The currently configured production branch the user confirmed for export. + repo_id: type: integer - minimum: 128 - maximum: 128 - description: Maximum password length in Unicode characters. - require_uppercase: - type: boolean - description: Whether passwords must contain an ASCII uppercase letter (A-Z). - require_lowercase: - type: boolean - description: Whether passwords must contain an ASCII lowercase letter (a-z). - require_numbers: - type: boolean - description: Whether passwords must contain an ASCII digit (0-9). - require_special_chars: - type: boolean - description: Whether passwords must contain one of the backend-supported special characters. - compromised_passwords_rejected: - type: boolean - description: Whether common and known-compromised passwords are rejected by the backend. + format: int64 + description: | + The `repo_id` of the connected repository the user confirmed for + export, as the git connection reports it. When set, export answers + `409` if the project is now connected to a different repository, so + source is written only to the repository the user was shown. required: - - effective_min_length - - min_configurable_length - - max_length - - require_uppercase - - require_lowercase - - require_numbers - - require_special_chars - - compromised_passwords_rejected - AuthSession: + - production_branch + ProjectSourceExportSkip: type: object - description: An authentication session for a user properties: - id: - type: string - format: uuid - description: Unique session identifier - user_id: - type: string - format: uuid - description: The user this session belongs to - provider: - type: string - description: Authentication provider used to create this session - enum: - - email - - google - - github - - microsoft - - apple - - anonymous - example: email - user_agent: - type: string - description: Browser/device user agent string - example: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) - ip_address: - type: string - description: IP address of the client when the session was created - example: 192.168.1.1 - last_ip_address: + kind: type: string - description: IP address of the most recent activity (token refresh) - example: 192.168.1.100 - expires_at: + description: 'The kind of resource, "function" or "frontend". Deliberately not an enum: the generated constants would collide with an existing resource-type enum and rename its members.' + name: type: string - format: date-time - description: When this session expires - last_activity_at: + reason: type: string - format: date-time - description: Last activity timestamp - session_started_at: + required: + - kind + - name + - reason + ProjectSourceExportOmission: + type: object + properties: + kind: type: string - format: date-time - description: When the session was created - is_active: - type: boolean - description: Whether the session is currently active (not expired) - is_current: - type: boolean - description: Whether this is the session making the current request - created_at: + description: 'What was left out: migrations Volcano stores no copy of, variable values, a credential-shaped file, installed dependencies, or an archive entry a repository cannot carry.' + resource: type: string - format: date-time - updated_at: + description: The resource it came from, empty when project-wide. + path: type: string - format: date-time required: - - id - - user_id - - provider - - expires_at - - is_active - - is_current - AuthSignupResponse: + - kind + - resource + - path + SetProjectGitProductionBranchRequest: type: object - description: | - Uniform, session-less response returned by POST /auth/signup. It carries no - tokens and no user object, and is identical for a new account and for an - already-registered email (anti-enumeration). Clients obtain a session with a - subsequent POST /auth/signin. properties: - confirmation_required: - type: boolean - description: | - Whether the project requires email confirmation. Reflects project config - only (identical for a new and an existing email), so it leaks nothing about - account existence. - message: + production_branch: type: string - description: Human-readable acknowledgement. + maxLength: 255 + description: The branch a push must land on to deploy. Validated as a Git branch name only — it does not have to exist yet. An empty string follows the repository's default branch, including later renames. required: - - confirmation_required - - message - AuthTokenResponse: + - production_branch + SetProjectGitRootDirectoryRequest: type: object properties: - access_token: + root_directory: type: string - description: JWT access token (expires after configured lifetime) - token_type: + maxLength: 1024 + description: Monorepo subdirectory the project builds from, relative to the repository root. An empty string means the repository root. + required: + - root_directory + ConnectProjectGitRequest: + type: object + properties: + connection_id: type: string - example: bearer - expires_in: + format: uuid + description: The caller's user_git_connections row (see /user/git/connections). + installation_id: type: integer - description: Access token lifetime in seconds - refresh_token: + format: int64 + repository_id: + type: integer + format: int64 + description: Stable GitHub repository id (repository.id), the preferred selector. Either repository_id or repo_full_name is required; when both are given they must identify the same live repository. + repo_full_name: type: string - x-go-type-skip-optional-pointer: true - description: | - Long-lived token for getting new access tokens. Omitted when the - request uses eligible HttpOnly cookie session storage. - user: - $ref: '#/components/schemas/AuthUser' + deprecated: true + description: Deprecated selector kept for a compatibility window; prefer repository_id. Either repository_id or repo_full_name is required. + root_directory: + type: string + description: 'Monorepo subdirectory the project builds from, relative to the repository root. Omit it, or send an empty string, `.` or `/`, for the repository root. It is stored and returned in the form a deploy reads it, as PUT /projects/{id}/git-connection/root-directory does: `./apps/web/` comes back as `apps/web`.' + production_branch: + type: string + maxLength: 255 + description: 'The branch a push must land on to deploy, with three cases, because this is a full replace and a read-modify-write client sends back whatever it read. Omit it to follow the repository''s GitHub default branch, which also discards a branch set earlier. Send back the branch the project already deploys from, when that is the repository''s default, and nothing changes either way — a project pinned to that branch stays pinned. Sending the default branch when the project deploys from something else returns it to following the default, including on a rebind, where a pin describes a branch chosen for the repository being left. Any other branch becomes the project''s own choice, exempt from later default-branch renames. Validated as a Git branch name only: it does not have to exist yet, so a project can be pointed at a branch about to be pushed. Changing repository and naming a branch other than the new repository''s default in one request is refused with 400, because the branch named is almost always the previous repository''s, echoed back — connect first, then set the branch. A repository that reports no default branch, as one with no commits can, is connected only by naming a branch, and any branch is accepted for it, including on a rebind. An empty repository that still reports a default follows the rule above.' required: - - access_token - - token_type - - expires_in - - user - AuthUser: + - connection_id + - installation_id + 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 - project_id: + project_id: + type: string + format: uuid + name: + type: string + maxLength: 63 + pattern: ^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$ + framework: + type: string + enum: + - nextjs + app_root: + type: string + maxLength: 1024 + description: Optional relative POSIX path from the uploaded archive root to the Next.js app that is deployed. + status: + type: string + description: | + Frontend lifecycle status. `degraded` means the regional runtime remains + available but edge synchronization exhausted its immediate retries; Volcano + retries edge recovery without rebuilding the frontend, and stops once a new + deployment is queued or the retry budget runs out, leaving the frontend + `degraded` until the next redeploy. A redeploy that fails over a serving + frontend stays `active` on the previous deployment, so `failed` means no + deployment is serving. + enum: + - provisioning + - active + - degraded + - failed + - deleting + provisioning_started_at: + type: string + format: date-time + description: Timestamp when the current provisioning phase started + deployed_regions: + type: array + items: + type: string + current_deployment_id: + type: string + format: uuid + description: Identifier of the latest frontend deployment operation + pending_deployment_id: type: string format: uuid - email: + description: Newest queued deployment that will run after the current operation + serving_candidate_id: type: string - format: email - email_confirmed: - type: boolean - user_metadata: - type: object - additionalProperties: true - description: User-editable metadata - app_metadata: - type: object - additionalProperties: true - description: Application-controlled metadata (read-only for users) - avatar_url: + format: uuid + nullable: true + readOnly: true + description: | + The promoted Candidate whose runtime receives this frontend's traffic, the same as + `candidate_id` in `serving`. Null when the frontend serves its own runtime. While it is + set, `current_deployment_id` and `status` describe a deployment that receives no traffic, + and deploying the frontend is refused until it is rolled back. + site_url: type: string - format: uri - description: User avatar URL (from OAuth provider or manually set) - status: + custom_domain: type: string + description: Active custom domain hostname when configured + custom_domain_status: + type: string + description: Current custom domain lifecycle status enum: + - pending_verification + - provisioning - active - - banned + - detaching + - failed - deleted - banned_until: + function_routes: + type: array + maxItems: 64 + items: + $ref: '#/components/schemas/FrontendFunctionRoute' + description: | + Paths on this frontend that forward to a public function, ordered + from most to least specific. Anyone who can load the frontend can + reach the target function at these paths without a credential. + frontend_routes: + type: array + maxItems: 64 + items: + $ref: '#/components/schemas/FrontendRoute' + description: | + Paths on this frontend served by another frontend in the project, + ordered from most to least specific. Function and Frontend routes + share one path namespace and the 64-route limit. + last_deployed_at: type: string format: date-time - nullable: true - description: When temporary ban expires (null if not banned or permanent) - last_sign_in_at: + description: Recorded completion time of the most recent deploy or redeploy with status active. Omitted when no such deployment has a recorded completion time. Site traffic, pending deployments, degraded deployments, failed deployments, and deletion do not change this value. + last_invoked_at: type: string format: date-time created_at: @@ -18600,511 +30031,465 @@ components: format: date-time required: - id - - email - - status - BanUserResponse: - type: object - description: Response when banning a user - properties: - message: - type: string - example: User banned until 2026-12-31T23:59:59Z - user_id: - type: string - format: uuid - email: - type: string - format: email - status: - type: string - enum: - - banned - banned_until: - type: string - format: date-time - nullable: true - description: When the ban expires (null for permanent ban) - required: - - message - - user_id - - email + - project_id + - name + - framework - status - BatchFunctionDeployFailure: + - deployed_regions + - serving_candidate_id + - function_routes + - frontend_routes + - created_at + - updated_at + FrontendCandidate: type: object + additionalProperties: false + description: | + A copy of a frontend built from an uploaded archive with the frontend's own configuration, so + it can be checked before anything is promoted. A Candidate is reachable by anyone who holds its + URL and is not indexed or listed; it is never public, and it does not claim to be private. properties: - name: - type: string - function_id: + id: type: string format: uuid - operation: - type: string - enum: - - deploy - - update - error: - type: string - required: - - name - - error - BatchFunctionDeployResponse: - type: object - properties: - batch_id: + frontend_id: type: string format: uuid - data: - type: array - description: Functions whose deployment workflows were started successfully - items: - $ref: '#/components/schemas/Function' - failed: - type: array - description: Functions that failed before their workflow started. Successful functions are left running; failed new functions are deleted and failed updates are rolled back where possible. - items: - $ref: '#/components/schemas/BatchFunctionDeployFailure' - required: - - batch_id - - data - CompleteUploadSessionResponse: - type: object - description: Response when completing an upload - properties: - object: - $ref: '#/components/schemas/StorageObject' - CreateDatabaseBackupRequest: - type: object - properties: - name: - type: string - description: | - Backup name, unique within the database. Names beginning with - `volcano-` are reserved for the platform's own snapshots. - pattern: ^[a-z0-9][a-z0-9_-]{0,62}$ - maxLength: 63 - example: before_migration - required: - - name - CreateDatabaseBranchRequest: - type: object - properties: name: type: string - description: Branch name (must be unique within the parent database) - pattern: ^[a-z0-9_]+$ - maxLength: 64 - example: feature_checkout - ttl_seconds: - type: integer - format: int64 - minimum: 3600 - maximum: 2592000 - description: | - How long the branch should live, between one hour and 30 days. - Defaults to 7 days when omitted. - example: 86400 - required: - - name - CreateDatabaseRestoreRequest: - type: object - description: | - Names what to restore. Supply exactly one of `backup_name` or - `restore_to`. - properties: - backup_name: - type: string - minLength: 1 maxLength: 128 - description: | - A backup of this database to restore, exactly as returned by the list - endpoint. - - Deliberately looser than the names you can create, like the backup - path parameter: a backup made by a schedule is named for you, so - restoring one accepts any name a backup can have. - example: before_migration - restore_to: - type: string - format: date-time - description: | - A point in time to restore to, which must fall inside the - `restore_window` reported when listing backups. - example: '2026-01-15T09:30:00Z' - CreateDatabaseRequest: - type: object - description: | - Create a new PostgreSQL database. Volcano automatically sets up: - - Auth helpers (auth.uid(), auth.email(), auth.role()) - - Database roles (anon for unauthenticated, authenticated for signed-in users) - - Secure multi-tenant isolation - - Ready for Row-Level Security - properties: - name: - type: string - description: Database name (must be unique within project) - pattern: ^[a-z0-9_]+$ - maxLength: 64 - example: my_database - region: - type: string - description: | - Region for database hosting, such as `us-east-1`. The accepted values - are the regions this environment runs in, so read them from - `GET /databases/regions` rather than hardcoding a list. A region the - environment does not offer is rejected with 400. Region IDs issued by - earlier versions of the API are still accepted. - example: us-east-1 - pg_version: + status: type: string - description: | - PostgreSQL major version. `GET /databases/postgres-versions` lists - the versions this environment accepts; local mode accepts only the - version its server runs. Any other value is rejected with 400. - example: '18' enum: - - '16' - - '17' - - '18' - database_type: - type: string + - creating + - ready + - deleting + - error description: | - Compute size tier (optional, defaults to volcano-db-xs). - Determines autoscaling limits for the database. - enum: - - volcano-db-xs - - volcano-db-s - - volcano-db-m - - volcano-db-l - - volcano-db-xl - - volcano-db-2xl - default: volcano-db-xs - example: volcano-db-xs - required: - - name - - region - - pg_version - CreateEmailTemplateRequest: - type: object - properties: - template_type: + `creating` until its first deployment succeeds, `ready` while it serves, `deleting` while + its runtime is removed, and `error` when its deletion gave up and needs an operator. + url: type: string - enum: - - welcome - - confirmation - - password_reset - - password_changed - description: Type of email template - subject: + format: uri + description: Where the Candidate is served. Absent until its first deployment succeeds. + expires_at: type: string - description: Email subject line - example: Confirm your email - html_body: + format: date-time + description: When the Candidate is deleted on its own. Absent when it is kept until deleted. + current_deployment_id: type: string + format: uuid description: | - HTML template body. Available placeholders: - - {{.Token}} - The confirmation/reset token - - {{.ProjectName}} - The project name - - {{.Email}} - User's email address - text_body: + The deployment the Candidate serves. Absent until its first + deployment succeeds. It differs from `deployment` while a redeploy runs or after one failed. + deployment: + $ref: '#/components/schemas/FrontendCandidateDeployment' + configuration_status: type: string - description: Plain text template body (same placeholders as HTML) + enum: + - current + - changed + description: | + Present while the Candidate serves a deployment. `current` means that deployment was built + with the variables the frontend selects now; `changed` means they differ, or can no longer + be resolved. Promotion refuses a Candidate whose status is `changed`. + created_at: + type: string + format: date-time + updated_at: + type: string + format: date-time required: - - template_type - - subject - - html_body - - text_body - CreateFrontendCustomDomainRequest: + - id + - frontend_id + - name + - status + - created_at + - updated_at + FunctionCandidate: type: object additionalProperties: false + description: | + A copy of an ordinary function built from an uploaded source with the function's own variables, + run on a runtime of its own and invoked at its own host with the project's service key only, so it + can be checked before it is promoted. It has none of the function's schedules or warmers. Fields + that do not apply yet are absent. properties: - domain: + id: type: string - maxLength: 253 - description: 'Fully-qualified domain name (hostname only, no scheme/path). Managed TLS (`tls.mode: managed`) accepts at most 219 characters; BYOC accepts 253.' - example: app.example.com - tls: - $ref: '#/components/schemas/FrontendCustomDomainTLSConfig' - required: - - domain - - tls - CreateFunctionSchedulerRequest: - type: object - required: - - name - - schedule - properties: + format: uuid + function_id: + type: string + format: uuid name: type: string - maxLength: 200 - enabled: - type: boolean - default: true - schedule: - $ref: '#/components/schemas/ScheduleRequest' - payload: - type: object - additionalProperties: true - regions: - type: array - description: Optional single explicit deployed region. If omitted, the scheduler chooses one deployed region and invokes according to the cron expression. - maxItems: 1 - items: - type: string - CreateOAuthConfigRequest: - type: object - required: - - provider - properties: - provider: + maxLength: 128 + slug: type: string - enum: - - google - - github - - microsoft - - apple - - device - example: google - client_id: + status: type: string - example: 123456789.apps.googleusercontent.com - description: Required for non-device providers. Must not be provided for `provider=device`; server always auto-generates it. - client_secret: + enum: + - creating + - ready + - deleting + - error + description: | + `creating` until its first deployment succeeds, `ready` while it serves, `deleting` while its + runtime is removed, and `error` when its deletion gave up and needs an operator. A deleted + preview answers `404`. + exposure: type: string - example: GOCSPX-abc123def456 - description: Required for non-device providers. Must not be provided for `provider=device`; server always auto-generates it. - redirect_url: + enum: + - private + description: A function preview is always private. Only the project's service key, with `functions.invoke`, can invoke it; signed-in users, anon keys and access tokens are refused. + url: type: string - description: Required for non-device providers. Not used for `provider=device`. format: uri - example: https://yourapp.com/auth/callback - scopes: + description: Where the preview is invoked. Absent until its first deployment succeeds. + expires_at: + type: string + format: date-time + description: When the preview is deleted on its own. Absent when it is kept until deleted. A preview the function runs, or keeps for a rollback, is not deleted then; it expires once it is neither. + created_by: + type: string + description: The user who created the preview, when a user did. + created_at: + type: string + format: date-time + updated_at: + type: string + format: date-time + current_deployment_id: + type: string + format: uuid + description: | + The deployment the preview serves. Absent until its first deployment succeeds. It differs from + `deployment` while a redeploy runs or after one failed. + deployment: + $ref: '#/components/schemas/FunctionCandidateDeployment' + configuration_status: + type: string + enum: + - current + - changed + description: | + Present while the preview serves a deployment. `current` means that deployment was built with + the variables, runtime and handler the function would give that source now; `changed` means + they differ, or can no longer be resolved. Promotion refuses a preview whose status is + `changed`. + serving: + type: boolean + description: The function runs this preview's build. + kept_for_rollback: + type: boolean + description: A rollback of the function returns to this preview's build. + required: + - id + - function_id + - name + - slug + - status + - exposure + - created_at + - updated_at + - serving + - kept_for_rollback + FunctionCandidateList: + type: object + additionalProperties: false + properties: + data: type: array items: - type: string - example: - - openid - - email - - profile - description: Optional for non-device providers, uses provider defaults if omitted. Not used for `provider=device`. - CreateProjectRequest: + $ref: '#/components/schemas/FunctionCandidate' + required: + - data + FunctionCandidateDeployment: type: object - description: Request to create a new project + additionalProperties: false properties: - name: + id: type: string - description: | - Project name (must be unique). - Can only contain letters, numbers, underscores, and hyphens. - pattern: ^[A-Za-z0-9_-]+$ - minLength: 1 - maxLength: 255 - example: my-awesome-app - template_id: + format: uuid + status: type: string - description: Optional trusted starter template identifier. The server resolves immutable source and database initialization artifacts. Callers cannot supply artifact locations or database credentials. Creation accepts an asynchronous installation; poll the individual project until template_installation.status is ready before using the app. Use pixel-board, trellini, or collab-pad for the configured starter bundles. The official-starter legacy identifier has environment-specific availability. Cannot be combined with initialPrompt. enum: - - pixel-board - - trellini - - collab-pad - - official-starter - example: pixel-board - initialPrompt: + - provisioning + - active + - failed + description: | + `provisioning` while the build and deploy run, `active` once the preview serves this + deployment, and `failed` when it could not be built or deployed. A failed deployment of a + preview that already served keeps the previous deployment serving. + operation: type: string - description: Optional initial builder prompt. Cannot be combined with template_id. - all_regions: - type: boolean + enum: + - deploy + - redeploy + image_digests: + type: array description: | - Optional region policy. - - `true` (default): project functions deploy to all configured regions - - `false`: project deploys only to `selected_regions` - default: true - selected_regions: + The digest of the image this deployment published, per region. Present once the deployment + succeeded. A promotion points the function at this image and deploys nothing. + items: + $ref: '#/components/schemas/FunctionImageDigest' + configuration_digest: + type: string + pattern: ^sha256:[0-9a-f]{64}$ + description: Identifies the variables the build used without carrying any value. + regions: type: array items: type: string - description: | - Optional region subset. Requires `all_regions=false`. - Region names must be a subset of platform `AWS_REGIONS`. - example: - - us-east-1 - - us-west-2 + error_message: + type: string + description: Why a failed deployment failed. + created_at: + type: string + format: date-time + completed_at: + type: string + format: date-time + description: Set once the deployment is no longer provisioning. required: - - name - CreateStorageBucketRequest: + - id + - status + - operation + - configuration_digest + - regions + - created_at + FunctionCandidateDeploymentList: type: object + additionalProperties: false properties: - name: - type: string - description: Bucket name (alphanumeric, dashes, underscores) - pattern: ^[a-zA-Z0-9_-]+$ - minLength: 1 - maxLength: 64 - file_size_limit: - type: integer - format: int64 - description: Maximum file size in bytes - allowed_mime_types: + data: type: array items: - type: string - description: Allowed MIME types (e.g., ["image/png", "image/jpeg"]) + $ref: '#/components/schemas/FunctionCandidateDeployment' required: - - name - CreateStoragePolicyRequest: + - data + FunctionServing: type: object + additionalProperties: false + description: | + What a function runs. Until a preview is promoted it runs its own build and `candidate_id` is + null. After a promotion, the function's traffic runs on that preview's runtime, nothing is rebuilt + or deployed, and `previous_candidate_id` is what a rollback returns to (null when that is the + function's own build). A preview the function runs cannot be deleted and does not expire. One kept + only as what a rollback returns to does not expire either, but it can be deleted, which gives up + that rollback; the function's own build stays one `to_production` rollback away. properties: - name: - type: string - description: Policy name - operation: + revision: + type: integer + format: int64 + minimum: 0 + description: Counts changes to what the function runs or can roll back to — promotions, rollbacks, a deployment that returns the traffic to the function's own build, and deleting the preview kept for a rollback. A promotion or rollback names the revision it read, so one that read before such a change fails with `409` (`stale_revision`) instead of overwriting it; read the serving state again and retry. + candidate_id: type: string - enum: - - SELECT - - INSERT - - UPDATE - - DELETE - description: Operation this policy applies to - definition: + format: uuid + nullable: true + description: The preview whose build the function runs; null for its own. + previous_candidate_id: type: string - description: Policy expression - required: - - name - - operation - - definition - CreateUploadSessionRequest: + format: uuid + nullable: true + description: The preview a rollback returns to; null for the function's own build. + activation: + $ref: '#/components/schemas/FunctionServingActivation' + production_environment: + $ref: '#/components/schemas/FunctionProductionEnvironment' + required: + - revision + - candidate_id + - previous_candidate_id + - production_environment + FunctionServingActivation: type: object - description: Request to create a resumable upload session + additionalProperties: false + description: | + The latest change to what serves the function's traffic: a promotion, a rollback, or a deployment + of the function that returned its traffic to its own build. Each takes effect at once. Absent until + the function's first promotion. properties: - object_path: + id: type: string - description: Target file path within the bucket - example: videos/large-file.mp4 - content_type: + format: uuid + kind: + type: string + enum: + - promotion + - rollback + - deploy + x-enum-varnames: + - FunctionServingActivationKindPromotion + - FunctionServingActivationKindRollback + - FunctionServingActivationKindDeploy + description: '`deploy`: a successful deployment of the function cleared the preview pointers.' + status: type: string - description: MIME type of the file - example: video/mp4 - total_size: + enum: + - applied + description: '`applied`: the change takes effect when it is recorded.' + revision: type: integer format: int64 - description: Total file size in bytes (max 5TB) minimum: 1 - maximum: 5497558138880 - example: 5368709120 - part_size: - type: integer - format: int64 - description: 'Part size in bytes (default: 25MB, min: 5MB, max: 25MB)' - minimum: 5242880 - maximum: 26214400 - example: 26214400 + candidate_id: + type: string + format: uuid + description: The preview the activation pointed the function at. Absent for the function's own build. + image_digests: + type: array + description: The digests of the image the activation pointed the function at. Absent for the function's own build. + items: + $ref: '#/components/schemas/FunctionImageDigest' required: - - object_path - - content_type - - total_size - CreateUploadSessionResponse: + - id + - kind + - status + - revision + FunctionProductionEnvironment: type: object - description: Response when creating an upload session + additionalProperties: false + description: | + Whether the function's own build has the project's current variables. While a preview serves the + function, `volcano config deploy` and replacing the shared variable list skip the function, so its + own build keeps the values it had. A rollback to the function's own build starts synchronizing them + as it returns the traffic, and the status reads `current` once that synchronization completes or a + deployment of the function activates. A synchronization that fails leaves it `out_of_date`. properties: - session_id: + status: type: string - description: Upload session ID - example: session-abc123 - part_size: - type: integer - format: int64 - description: Actual part size to use - example: 26214400 - total_parts: - type: integer - description: Number of parts to upload - example: 52 - expires_at: + enum: + - current + - out_of_date + x-enum-varnames: + - FunctionProductionEnvironmentStatusCurrent + - FunctionProductionEnvironmentStatusOutOfDate + description: '`out_of_date`: a stored variable change skipped the function while a preview served it.' + out_of_date_since: type: string format: date-time - description: When the session expires (7 days from creation) - example: '2024-01-22T10:30:00Z' - CreateVariableRequest: + description: When the latest skipped change was stored. Absent while `status` is `current`. + required: + - status + FunctionImageDigest: type: object + additionalProperties: false + description: The content digest of a function image in one region. It names no registry or account. properties: - 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. - name: + region: type: string - description: Project variable name. Function runtime names such as AWS_REGION are reserved and return 400; see the environment variables guide for the full list. - minLength: 1 - maxLength: 256 - pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$ - value: + description: The region the image was published to. Absent when the build published one image for every region. + digest: type: string + pattern: ^sha256:[0-9a-f]{64}$ required: - - name - - value - VariableEnvironment: + - digest + FunctionPromotionRequest: type: object - description: Stable identity for a Project-owned variable Environment. + additionalProperties: false + required: + - expected_revision + properties: + expected_revision: + type: integer + format: int64 + minimum: 0 + description: The `revision` the caller read from `serving`. Refuses the promotion with `stale_revision` unless what the function runs is still at this revision. + FunctionRollbackRequest: + type: object + additionalProperties: false + required: + - expected_revision + properties: + expected_revision: + type: integer + format: int64 + minimum: 0 + description: The `revision` the caller read from `serving`. Refuses the rollback with `stale_revision` unless what the function runs is still at this revision, so a retried rollback cannot undo itself. + to_production: + type: boolean + default: false + description: Return to the function's own build whatever it ran before. + FrontendCandidateDeployment: + type: object + additionalProperties: false properties: id: type: string format: uuid - project_id: + status: type: string - format: uuid - name: + enum: + - provisioning + - active + - failed + description: | + `provisioning` while the build and deploy run, `active` once the Candidate serves this + deployment, and `failed` when it could not be built or deployed. A failed deployment of a + Candidate that already served keeps the previous deployment serving. + configuration_digest: type: string - pattern: ^[A-Za-z0-9_-]{1,64}$ - minLength: 1 - maxLength: 64 - is_global: - type: boolean - description: Whether this is the reserved Global Environment. + pattern: ^sha256:[0-9a-f]{64}$ + description: Identifies the resolved configuration the deployment was built with. It carries no value. + error_message: + type: string + description: Why a failed deployment failed. created_at: type: string format: date-time - updated_at: + completed_at: type: string format: date-time + description: Set once the deployment is no longer provisioning. required: - id - - project_id - - name - - is_global + - status + - configuration_digest - created_at - - updated_at - VariableEnvironmentList: - type: object - properties: - data: - type: array - maxItems: 101 - items: - $ref: '#/components/schemas/VariableEnvironment' - required: - - data - CreateVariableEnvironmentRequest: + FrontendServing: type: object additionalProperties: false + description: | + What a frontend serves. Until a Candidate is promoted it serves its own runtime and + `candidate_id` is null. After a promotion, the frontend's traffic is routed to that + Candidate's runtime, nothing is rebuilt or copied, and `previous_candidate_id` is the runtime a + rollback returns to (null when that is the frontend's own). A Candidate that serves cannot be + deleted and does not expire. One kept only as the runtime a rollback returns to does not + expire either, but it can be deleted, which gives up that rollback; the frontend's own + runtime stays one `to_production` rollback away. properties: - name: + revision: + type: integer + format: int64 + minimum: 0 + description: Counts changes to what the frontend serves or can roll back to — promotions, rollbacks, and deleting the Candidate kept for a rollback. A promotion or rollback names the revision it read, so one that read before such a change fails with `409` instead of overwriting it; read the serving state again and retry. + candidate_id: type: string - description: Leading and trailing ASCII whitespace is trimmed before validating 1–64 ASCII letters, digits, underscores, or hyphens. Global is reserved. - pattern: ^[ \t\n\f\r]*[A-Za-z0-9_-]{1,64}[ \t\n\f\r]*$ + format: uuid + nullable: true + previous_candidate_id: + type: string + format: uuid + nullable: true required: - - name - RenameVariableEnvironmentRequest: + - revision + - candidate_id + - previous_candidate_id + FrontendCandidateList: type: object additionalProperties: false properties: - name: - type: string - description: Leading and trailing ASCII whitespace is trimmed before validating 1–64 ASCII letters, digits, underscores, or hyphens. Global is reserved. - pattern: ^[ \t\n\f\r]*[A-Za-z0-9_-]{1,64}[ \t\n\f\r]*$ + data: + type: array + items: + $ref: '#/components/schemas/FrontendCandidate' required: - - name - Database: + - data + FrontendFunctionRoute: type: object - description: | - PostgreSQL database with automatic scalability and security features. + additionalProperties: false properties: id: type: string @@ -19112,78 +30497,19 @@ components: project_id: type: string format: uuid - name: - type: string - description: Database name - pattern: ^[a-z0-9_]+$ - maxLength: 64 - status: - type: string - enum: - - provisioning - - active - - failed - - restoring - - deleting - description: | - Database status. `restoring` means a restore is replacing the - database's data: it does not accept connections, and the operations - that would race the restore are rejected until it finishes. Its - branches keep serving throughout. - provisioning_started_at: - type: string - format: date-time - description: Timestamp when the current provisioning phase started - connection_string: - type: string - description: | - Secure PostgreSQL connection URI for your database. - - The database is identified by the globally-unique username - (`volcano_client_{database_id}`) already in this URI; the - `application_name` parameter only selects the access mode: - - `volcano_full_access` — Full admin access (DDL, migrations) - - `volcano_user_access:{user_id}` — User impersonation (RLS enforced) - - `volcano_user_access` — Anonymous access (anon role, RLS enforced) - region: - type: string - description: Region where the database is hosted - example: us-east-1 - pg_version: + frontend_id: type: string - description: PostgreSQL major version - example: '18' - database_type: + format: uuid + function_id: type: string - description: | - Database size tier that determines available RAM and scaling limits. - enum: - - volcano-db-xs - - volcano-db-s - - volcano-db-m - - volcano-db-l - - volcano-db-xl - - volcano-db-2xl - example: volcano-db-xs - storage_bytes: - type: integer - format: int64 - minimum: 0 - description: | - Latest observed storage for this database, in bytes: its own on-disk - size, plus what each branch has diverged from it, plus what its - backups cost to hold. This is the figure the storage allowance is - enforced against, and the stats endpoint breaks it down. A - point-in-time gauge recorded by a background pass, so it may be - absent until the database has been sampled, and it can trail the - stats endpoint's `current_storage_bytes`, which measures on request. - Summing the latest samples for every database in a project produces - the project's "Database Storage (Bytes)" usage gauge. Populated on - database list responses; single-database responses omit it. - last_invoked_at: + format: uuid + path_prefix: type: string - format: date-time - description: Most recent request timestamp for this database + minLength: 2 + maxLength: 512 + pattern: ^/[^?#\\]*[^/?#\\]$ + strip_prefix: + type: boolean created_at: type: string format: date-time @@ -19191,198 +30517,233 @@ components: type: string format: date-time required: - - id - - project_id - - name - - status - - created_at - - updated_at - DatabaseBackup: + - id + - project_id + - frontend_id + - function_id + - path_prefix + - strip_prefix + - created_at + - updated_at + FrontendFunctionRouteList: + type: object + additionalProperties: false + properties: + data: + type: array + items: + $ref: '#/components/schemas/FrontendFunctionRoute' + required: + - data + CreateFrontendFunctionRouteRequest: + type: object + additionalProperties: false + properties: + function_id: + type: string + format: uuid + path_prefix: + type: string + minLength: 2 + maxLength: 512 + pattern: ^/[^?#\\]*[^/?#\\]$ + strip_prefix: + type: boolean + default: false + required: + - function_id + - path_prefix + FrontendRoute: type: object + additionalProperties: false description: | - A point-in-time copy of a database, kept by the storage provider and - restorable in place. - - Backups cover the database itself, not its branches. Restoring one - replaces the database's data and keeps its connection string. + A path prefix on this Frontend's hostnames served by another Frontend in the Project, the + mounted Frontend. Paths are forwarded unchanged, so the mounted Frontend serves its prefix + as real pages (page directories or a matching `basePath`). properties: - name: + id: type: string - description: | - Backup name, unique within the database. Backups you create are - named by you; scheduled backups are named by the storage provider. - source: + format: uuid + project_id: type: string - enum: - - manual - - scheduled - description: | - Whether the backup was requested explicitly or produced by the - backup schedule. Only `manual` backups count against the plan's - backup allowance. - size_bytes: - type: integer - format: int64 - minimum: 0 - description: | - Storage the backup occupies. Absent until the provider has costed - it, which takes a few minutes after the backup is taken; absent is - not the same as empty. - expires_at: + format: uuid + frontend_id: type: string - format: date-time - description: | - When the backup is deleted automatically, from the plan's retention. - Absent means it is kept until deleted explicitly. + format: uuid + description: The Frontend whose hostnames serve the route + target_frontend_id: + type: string + format: uuid + description: The mounted Frontend + path_prefix: + type: string + minLength: 2 + maxLength: 512 + pattern: ^/[^?#\\]*[^/?#\\]$ created_at: type: string format: date-time - description: The point in time the backup captures. + updated_at: + type: string + format: date-time required: - - name - - source + - id + - project_id + - frontend_id + - target_frontend_id + - path_prefix - created_at - DatabaseBackupList: + - updated_at + FrontendRouteList: type: object + additionalProperties: false properties: data: type: array items: - $ref: '#/components/schemas/DatabaseBackup' - restore_window: - $ref: '#/components/schemas/DatabaseRestoreWindow' + $ref: '#/components/schemas/FrontendRoute' required: - data - DatabaseBackupSchedule: + CreateFrontendRouteRequest: type: object - description: | - The database's automated backup schedule. An empty list means no - scheduled backups; sending one clears the schedule. + additionalProperties: false properties: - entries: - type: array - items: - $ref: '#/components/schemas/DatabaseBackupScheduleEntry' + target_frontend_id: + type: string + format: uuid + description: The Frontend to mount. It must be another Frontend in the Project. + path_prefix: + type: string + minLength: 2 + maxLength: 512 + pattern: ^/[^?#\\]*[^/?#\\]$ required: - - entries - DatabaseBackupScheduleEntry: + - target_frontend_id + - path_prefix + CreateFrontendDeploymentRequest: type: object - description: One recurrence of the automated backup schedule. + additionalProperties: false + description: Deploys the build of an existing deployment instead of compiling the frontend's source. properties: - frequency: + source_deployment_id: type: string - enum: - - daily - - weekly - - monthly - hour: - type: integer - minimum: 0 - maximum: 23 - description: Hour of the day in UTC. - day: - type: integer - minimum: 1 - maximum: 28 - description: | - Day of the week (1-7, Monday to Sunday) for a weekly schedule, or day - of the month (1-28) for a monthly one. Required for both, ignored for - a daily schedule. Monthly stops at 28 so the schedule fires in every - month. - retention_seconds: - type: integer - format: int64 - minimum: 3600 - description: | - How long each backup from this recurrence is kept. Clamped to the - plan's retention, and defaulted to it when omitted. + format: uuid + description: An `active` or `degraded` deployment of another frontend in the same project. Its build is copied to this frontend and published without compiling it again. required: - - frequency - - hour - DatabaseBranch: + - source_deployment_id + FrontendCustomDomainTLSConfig: type: object - description: | - A copy-on-write fork of a database, for development and testing. - - A branch starts as an exact copy of its parent's data and diverges from - there. It has its own connection string and its own credential, so a - branch password cannot reach the parent. - - Every branch expires. `expires_at` is a hard deadline: once it passes the - branch stops accepting connections and is deleted. Use `PATCH` to extend - a branch you are still working on. + description: 'TLS for a new custom domain. With `mode: managed`, Volcano issues and renews the certificate; omit every PEM field. With `mode: byoc`, send both `certificate_pem` and `private_key_pem`, plus an optional `certificate_chain_pem`.' + additionalProperties: false + not: + anyOf: + - allOf: + - properties: + mode: + enum: + - managed + required: + - mode + - anyOf: + - required: + - certificate_pem + - required: + - private_key_pem + - required: + - certificate_chain_pem + - allOf: + - properties: + mode: + enum: + - byoc + required: + - mode + - anyOf: + - not: + required: + - certificate_pem + - not: + required: + - private_key_pem properties: - id: + mode: type: string - format: uuid - database_id: + enum: + - managed + - byoc + default: byoc + description: managed for a Volcano-issued certificate; byoc to supply your own. + certificate_pem: type: string - format: uuid - description: The parent database this branch was forked from. - project_id: + maxLength: 65536 + description: PEM-encoded certificate. Required when mode is byoc; not allowed when mode is managed. + private_key_pem: type: string - format: uuid - name: + maxLength: 65536 + description: PEM-encoded private key. Required when mode is byoc; not allowed when mode is managed. + certificate_chain_pem: type: string - description: Branch name, unique within the parent database. - pattern: ^[a-z0-9_]+$ - maxLength: 64 - status: + maxLength: 65536 + description: Optional PEM-encoded certificate chain when mode is byoc; not allowed when mode is managed. + required: + - mode + FrontendCustomDomainResponse: + type: object + properties: + domain: + type: string + tls_mode: type: string enum: + - managed + - byoc + domain_status: + type: string + enum: + - pending_verification - provisioning - active + - detaching - failed - - deleting - description: | - Branch status. A new branch starts `provisioning` and is not - connectable until it reports `active`; poll this endpoint until it - does. `connection_string` is only present while `active`. - - `provisioning` also covers a branch being rebuilt after a `reset`, - and a build that is between retries, so it is the status to keep - waiting on. `failed` is terminal: it means the platform gave up, and - the branch will not become `active` on its own. - connection_string: - type: string - description: | - PostgreSQL connection URI for this branch. Present only while the - branch is `active`. - - The URI carries the branch's own globally-unique username and - password; `application_name` selects the access mode exactly as it - does for the parent database: - - `volcano_full_access` — Full admin access (DDL, migrations) - - `volcano_user_access:{user_id}` — User impersonation (RLS enforced) - - `volcano_user_access` — Anonymous access (anon role, RLS enforced) - ttl_seconds: - type: integer - format: int64 - minimum: 1 - description: | - The lifetime the branch was created with. Resetting a branch re-arms - this same duration, so a reset never shortens a branch's remaining - life. - expires_at: + - deleted + verification_status: type: string - format: date-time - description: | - When the branch stops serving connections and becomes eligible for - deletion. Enforced on the connection path, so it holds even if - reclamation is delayed. - storage_bytes: - type: integer - format: int64 - minimum: 0 - description: | - Bytes this branch has diverged from its parent, which is what a - branch actually costs. Shared pages are not counted twice. Counts - against the parent database's storage allowance. Absent until the - branch has been sampled. - last_invoked_at: + enum: + - pending + - verified + - failed + description: '`verified`: the domain is served by a validated certificate. `pending`: it is not served yet, is being re-validated after its certificate material was withdrawn, or Volcano is retrying after a failure. `failed`: a failure left the domain unserved, alongside `domain_status: failed`; managed domains report the cause in `failure_reason`.' + serving_certificate: type: string - format: date-time - description: Most recent request timestamp for this branch + enum: + - uploaded + - managed + description: 'Certificate the domain serves, present only while it is active. `uploaded`: the BYOC certificate, including after the domain switched to managed TLS and until Volcano issues the managed one; `failure_reason` then reports an issuance failure. `managed`: a certificate Volcano issued.' + failure_reason: + type: string + description: Failure category, present when managed TLS setup has failed, or when issuance is failing for a domain that switched to managed TLS and still serves its uploaded certificate. Current values are provider, certificate, ownership, and internal; ownership means another account has already claimed the hostname through ownership verification. Treat unrecognized values as internal. + verification_records: + type: array + description: DNS records to publish now. For a managed domain whose hostname the account already owns, the create response names the `_acme-challenge` CNAME that authorizes certificate issuance and renewal. Otherwise it names the `_volcano` TXT record that proves ownership of the hostname's registrable domain, and reads return the CNAME once Volcano sees that record. Usually empty for BYOC. + items: + $ref: '#/components/schemas/FrontendDomainVerificationRecord' + required_routing_record: + allOf: + - $ref: '#/components/schemas/FrontendDomainRoutingRecord' + deprecated: true + description: Deprecated and no longer returned. Use routing_target_hostname as the DNS routing target. + routing_target_hostname: + type: string + description: DNS routing target hostname for this frontend. The DNS record type depends on whether the custom domain is a zone apex. + effective_urls: + type: array + items: + type: string + redirect: + allOf: + - $ref: '#/components/schemas/FrontendCustomDomainRedirect' + nullable: true + description: Where the domain redirects every request, or null when it serves the frontend. created_at: type: string format: date-time @@ -19390,242 +30751,145 @@ components: type: string format: date-time required: - - id - - database_id - - project_id - - name - - status - - ttl_seconds - - expires_at + - domain + - tls_mode + - domain_status + - verification_status + - effective_urls + - redirect - created_at - updated_at - DatabaseBranchList: + FrontendCustomDomainList: type: object properties: data: type: array items: - $ref: '#/components/schemas/DatabaseBranch' + $ref: '#/components/schemas/FrontendCustomDomainResponse' required: - data - DatabaseBranchStorage: + FrontendCustomDomainRedirect: type: object - description: One branch's contribution to its parent database's storage. properties: - id: - type: string - format: uuid - name: + to: type: string - description: Branch name - storage_bytes: + description: Hostname the domain redirects to. + status: type: integer - format: int64 - minimum: 0 - description: | - Bytes this branch has diverged from its parent. Pages the branch - still shares with the parent are not counted, so this is what the - branch actually adds to the total rather than its apparent size. + enum: + - 301 + - 302 + - 307 + - 308 required: - - id - - name - - storage_bytes - DatabaseSelectRequest: + - to + - status + FrontendCustomDomainRedirectRequest: type: object + additionalProperties: false + description: Redirects every request for the domain to `to`, another active domain of the same frontend that serves it, keeping the path and query string. properties: - table: + to: type: string - description: Table name to query - example: posts - select: - type: array - items: - type: string - description: Columns to select (omit for *) - example: - - id - - title - - content - - created_at - filters: - type: array - items: - $ref: '#/components/schemas/DatabaseQueryFilter' - description: WHERE conditions (combined with AND) - example: - - column: status - operator: eq - value: published - - column: views - operator: gt - value: 100 - order: - type: array - items: - $ref: '#/components/schemas/DatabaseQueryOrder' - description: ORDER BY clauses - example: - - column: created_at - ascending: false - limit: - type: integer - minimum: 1 - maximum: 1000 - description: Maximum rows to return - example: 10 - offset: + minLength: 1 + maxLength: 253 + description: Hostname of an active domain of the same frontend that serves it. + example: www.example.com + status: type: integer - minimum: 0 - description: Number of rows to skip (for pagination) - example: 0 - required: - - table - DatabaseInsertRequest: - type: object - properties: - table: - type: string - description: Table name - example: posts - values: - type: object - additionalProperties: true - description: | - Column values to insert. JSON objects and arrays are stored as JSON, - so send them to `json` or `jsonb` columns. For a Postgres array - column, send an array literal string such as `"{a,b}"`. - example: - title: My New Post - content: This is the content - status: draft - required: - - table - - values - DatabaseUpdateRequest: - type: object - properties: - table: - type: string - description: Table name - example: posts - values: - type: object - additionalProperties: true - description: | - Column values to update. JSON objects and arrays are stored as JSON, - so send them to `json` or `jsonb` columns. For a Postgres array - column, send an array literal string such as `"{a,b}"`. - example: - title: Updated Title - status: published - filters: - type: array - minItems: 1 - items: - $ref: '#/components/schemas/DatabaseQueryFilter' - description: | - WHERE conditions for which rows to update. At least one filter is - required; a filterless update is rejected to avoid rewriting every - row. - example: - - column: id - operator: eq - value: post-uuid + enum: + - 301 + - 302 + - 307 + - 308 + default: 308 + description: Redirect status. 301 and 308 are permanent, 302 and 307 temporary; 307 and 308 keep the request method and body. required: - - table - - values - - filters - DatabaseDeleteRequest: + - to + UpdateFrontendCustomDomainRequest: type: object + additionalProperties: false properties: - table: - type: string - description: Table name - example: posts - filters: - type: array - minItems: 1 - items: - $ref: '#/components/schemas/DatabaseQueryFilter' - description: WHERE conditions (required for safety) - example: - - column: id - operator: eq - value: post-uuid + redirect: + allOf: + - $ref: '#/components/schemas/FrontendCustomDomainRedirectRequest' + nullable: true + description: The redirect to set, or null to make the domain serve the frontend. required: - - table - - filters - DatabaseQueryResult: - type: object - description: | - Rows returned by a data API request. RLS-filtered unless the request was - made with a service key. - properties: - data: - type: array - items: - type: object - additionalProperties: true - description: Result rows - count: - type: integer - description: Number of rows returned - DatabaseRestore: + - redirect + FrontendDeployment: type: object - description: | - A restore of a database, either from a named backup or to a point in - time. Restores run in the background and take longer than a request, so - the database is unavailable until this reports `completed`. properties: id: type: string format: uuid - database_id: + frontend_id: type: string format: uuid project_id: type: string format: uuid - kind: + operation: type: string enum: - - snapshot - - point_in_time - description: | - Whether the restore targets a named backup or an arbitrary point in - time. Both replace the database's data in place. + - deploy + - redeploy + - delete status: type: string + description: | + Deployment lifecycle status. A `degraded` redeploy remains available while + edge-only recovery is retried. A `failed` redeploy is recorded here while the + frontend keeps serving its previous deployment. enum: - - pending - - running - - completed + - queued + - provisioning + - active + - degraded - failed - - exhausted - description: | - Restore status. `pending` and `running` both mean the restore is - still in flight and the database is not connectable; an attempt that - fails with tries left goes back to `pending`. `failed` and - `exhausted` both mean Volcano gave up: the database is left `failed` - if its data may already have been replaced, and `active` if the - restore never started — a backup that no longer exists at the - provider ends the restore without touching the database. A restore - cannot be cancelled once it starts. - backup_name: + - superseded + - deleting + - deleted + deploy_source: + type: string + enum: + - git + - cli + - web + - api + - system + - unknown + description: What initiated this deployment. + initiated_by: type: string - description: | - The backup restored, kept even if that backup is later deleted. - Absent for a point-in-time restore. - restore_to: + description: Platform user that triggered a request-initiated deployment; absent for git and system deployments. + commit: + $ref: '#/components/schemas/DeploymentCommit' + git_deployment_run_id: type: string - format: date-time - description: The point in time restored to. Absent for a backup restore. - error: + format: uuid + description: The Git deployment run that made this deployment. Absent for a deployment no Git deployment run made. + source_deployment_id: type: string - description: Why the most recent attempt failed, when one has. - completed_at: + format: uuid + description: The deployment whose build this deployment published instead of compiling its own source. Absent when the deployment compiled. + site_url: + type: string + build_duration_seconds: + type: integer + format: int64 + description: Total build time recorded for this deployment, in seconds. + build_count: + type: integer + description: Number of completed builds included in build_duration_seconds. + build_duration_recorded_at: type: string format: date-time + description: When the build time was last recorded. + progress: + $ref: '#/components/schemas/DeploymentProgress' + error_message: + type: string created_at: type: string format: date-time @@ -19634,179 +30898,133 @@ components: format: date-time required: - id - - database_id + - frontend_id - project_id - - kind + - operation - status + - deploy_source - created_at - updated_at - DatabaseRestoreList: + FrontendDomainRoutingRecord: type: object properties: - data: - type: array - items: - $ref: '#/components/schemas/DatabaseRestore' + record_type: + type: string + enum: + - CNAME + name: + type: string + value: + type: string required: - - data - DatabaseRestoreWindow: + - record_type + - name + - value + FrontendDomainVerificationRecord: type: object - description: | - The span a point-in-time restore may target. Absent from the response - when the owner's plan does not include point-in-time restore, and while - the storage provider has no history window in place yet — briefly the - case after an upgrade, since the window is applied asynchronously. The - window is read from the provider rather than from the plan, so it never - advertises a point a restore could not actually reach. + description: The DNS records currently required. Volcano may require an account-specific TXT ownership record for the hostname's domain before returning a CNAME that authorizes managed certificate issuance and renewal. Clients must follow the records returned for the current lifecycle state instead of assuming a fixed sequence. properties: - earliest_restore_at: + name: type: string - format: date-time - description: | - The oldest point that can still be restored. Moves forward - continuously as history ages out, so treat it as a lower bound at - the moment it was read rather than a fixed value. - latest_restore_at: + type: type: string - format: date-time - description: The most recent point that can be restored, which is now. - DatabaseStats: + value: + type: string + required: + - name + - type + - value + FrontendCustomDomainConflictError: + description: 'Domain ownership conflict. With `code: ownership_verification_required`, the account has not proven it owns the domain: publish `required_record` in DNS and send the same request again. The retry succeeds once Volcano can see the record. With `code: custom_domain_releasing`, a removed domain still holds the hostname or the frontend while Volcano releases it: send the same request again after the response''s `Retry-After` seconds. A release that will not finish within a few minutes is a plain conflict. Other conflicts omit both fields.' + allOf: + - $ref: '#/components/schemas/Error' + - type: object + properties: + required_record: + $ref: '#/components/schemas/FrontendDomainVerificationRecord' + FrontendUsageDailyEntry: type: object + description: One day of request and error counts for a single frontend. properties: - current_storage_bytes: - type: integer - format: int64 - minimum: 0 - description: | - On-disk size right now, in bytes: the database itself, plus every - branch's divergence from it, plus what its backups cost to hold. This - is the figure the storage allowance is enforced against. `branches` - and `backup_storage_bytes` break it down. - current_storage_mb: - type: number - format: double - minimum: 0 - description: '`current_storage_bytes` expressed in megabytes.' - branches: - type: array - description: | - Per-branch contribution to `current_storage_bytes`. Empty when the - database has no branches. A branch that has not diverged from its - parent contributes nothing. - items: - $ref: '#/components/schemas/DatabaseBranchStorage' - backup_storage_bytes: - type: integer - format: int64 - minimum: 0 - description: | - What this database's backups contribute to `current_storage_bytes`. - - A backup taken on request is charged as a full copy of the database - as it was at that moment, so two backups of a 2 GB database are 4 GB. - A backup schedule is charged its first snapshot in full and each - later one only for the storage it adds. Deleting a backup releases - its storage immediately. - - Sampled from the provider rather than measured live, so it can lag a - change by a few minutes, and a backup taken seconds ago may not be - costed yet. Zero on a plan without backups. - storage_bytes: + day: + type: string + format: date + description: UTC date (YYYY-MM-DD) the counts cover. + requests: type: integer format: int64 - description: Total storage used in bytes (data + WAL) - data_written_bytes: + description: Total requests served on this day. + errors: type: integer format: int64 - description: Total data written in bytes - data_transfer_bytes: + description: 5xx responses served on this day. + page_views: type: integer format: int64 - description: Total data transferred in bytes - compute_time_seconds: - type: number - format: double - description: Total CPU seconds consumed - active_time_seconds: - type: number - format: double - description: Total active compute time in seconds - time_range: - type: string - description: Time range of the metrics (e.g., "2024-01-01T00:00:00Z to 2024-01-02T00:00:00Z") - granularity: - type: string - enum: - - hourly - - daily - - monthly - description: Granularity of the aggregated metrics - required: - - current_storage_bytes - - current_storage_mb - - backup_storage_bytes - - storage_bytes - - data_written_bytes - - data_transfer_bytes - - compute_time_seconds - - active_time_seconds - DatabaseQueryPerformanceResponse: - type: object - properties: - data: - type: array - items: - $ref: '#/components/schemas/DatabaseQueryPerformanceItem' + description: Navigable-document responses served on this day (text/html or Sec-Fetch-Dest=document) — strict subset of `requests`. required: - - data - UpdateDatabaseBranchRequest: + - day + - requests + - errors + - page_views + FrontendUsageData: type: object - description: Replace the branch's lifetime and restart its countdown from now. + description: Monthly frontend request totals grouped by frontend. properties: - ttl_seconds: + frontend_id: + type: string + format: uuid + description: Frontend ID + frontend_name: + type: string + description: Frontend name at the time usage was fetched + nullable: true + requests: type: integer format: int64 - minimum: 3600 - maximum: 2592000 - description: The new lifetime, between one hour and 30 days. - example: 86400 + description: Total requests for this frontend in the current usage month required: - - ttl_seconds - DeviceAuthorizationResponse: + - frontend_id + - requests + FrontendUsageHistoryResponse: type: object + description: Zero-filled daily series of request + error counts for a single frontend, oldest first. properties: - device_code: - type: string - user_code: - type: string - verification_uri: - type: string - description: | - Browser verification URL. Points at the project's managed device - approval page served by this API: - `/projects/{projectId}/auth/hosted?action=device&anon_key=...`. - Requires the project to have managed auth enabled and a default anon - key. A custom CLI may ignore this and direct users to its own - RFC 8628-compatible page instead (see the device-auth guide). - verification_uri_complete: + frontend_id: type: string - description: | - Same as `verification_uri` but with the `user_code` prefilled - (`&user_code=...`). This is the URL most device clients open. - expires_in: + format: uuid + days: type: integer - interval: + description: Number of daily entries returned (always equal to the `days` query param after clamping). + daily: + type: array + items: + $ref: '#/components/schemas/FrontendUsageDailyEntry' + total_requests: type: integer - required: - - device_code - - user_code - - verification_uri - - verification_uri_complete - - expires_in - - interval - EmailTemplate: + format: int64 + total_errors: + type: integer + format: int64 + total_page_views: + type: integer + format: int64 + required: + - frontend_id + - days + - daily + - total_requests + - total_errors + - total_page_views + ProjectAccessToken: type: object - description: Custom email template + 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 @@ -19814,84 +31032,294 @@ components: project_id: type: string format: uuid - template_type: + 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/ProjectAccessTokenListedScope' + status: type: string enum: - - welcome - - confirmation - - password_reset - - password_changed - subject: + - 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 - example: Confirm your email address - html_body: + enum: + - api + - cli + - dashboard + description: What created the token. + expires_at: type: string - description: HTML template with placeholders - text_body: + format: date-time + nullable: true + description: Absent for a token that does not expire. + last_used_at: type: string - description: Plain text template with placeholders + 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 - updated_at: + 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 + ProjectAccessTokenListedScope: + type: string + description: | + A listed token's scope. `full` and `read_only` are the scopes you + choose when you create a token; see `ProjectAccessTokenScope`. + + `delegated` marks a delegated grant: a `pg-` token a first-party app + minted for one run from the access you allowed it. It is listed only + with `include_delegated=true`, and you cannot create one. + enum: + - full + - read_only + - delegated + x-enum-varnames: + - ProjectAccessTokenListedScopeFull + - ProjectAccessTokenListedScopeReadOnly + - ProjectAccessTokenListedScopeDelegated + 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: - - template_type - - subject - - html_body - - text_body - Error: + - 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: - error: + data: + type: array + items: + $ref: '#/components/schemas/ProjectAccessToken' + page: + type: integer + limit: + type: integer + total: + type: integer + has_more: + type: boolean + next: type: string - code: + 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: Stable machine-readable error code when a specific recovery path is available. + 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: - - error - ImportProvider: - type: string - enum: - - vercel - default: vercel - x-enum-varnames: - - ImportProviderVercel - ImportConnectStartResponse: + - token_id + - name + - token_prefix + - days + - daily + - total_requests + ProjectAccessTokenUsageDailyEntry: type: object properties: - authorization_url: + day: type: string + format: date + description: UTC day. + requests: + type: integer + format: int64 required: - - authorization_url - ImportConnection: + - day + - requests + Function: type: object properties: id: type: string format: uuid - provider: - $ref: '#/components/schemas/ImportProvider' - account_id: + project_id: type: string - account_name: + format: uuid + name: type: string - configuration_id: + maxLength: 63 + pattern: ^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$ + status: + type: string + enum: + - provisioning + - active + - failed + - deleting + provisioning_started_at: + type: string + format: date-time + description: Timestamp when the current provisioning phase started + visibility: + $ref: '#/components/schemas/FunctionVisibility' + is_public: + type: boolean + deprecated: true + description: Deprecated. `true` exactly when `visibility` is `public`. + invocation_mode: + $ref: '#/components/schemas/FunctionInvocationMode' + http_auth_mode: + $ref: '#/components/schemas/FunctionHTTPAuthMode' + openapi_spec: + type: object + nullable: true + additionalProperties: true + description: Optional OpenAPI 3.0 or 3.1 document describing an HTTP-mode function. + has_openapi_spec: + type: boolean + description: Whether OpenAPI metadata is configured; list responses omit the document itself. + invoke_url: type: string - granted_scopes: + 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. In local development it is `http://{id}.functions.localhost:8000/`, served by the local API. Omitted when the deployment serves no function invocation domain, so a client testing for an empty string never matches.' + deployed_regions: type: array items: type: string - status: + description: Regions where this function is currently deployed + runtime: type: string - expires_at: + handler: type: string - format: date-time + current_deployment_id: + type: string + format: uuid + description: Identifier of the latest function deployment operation + pending_deployment_id: + type: string + format: uuid + description: Newest queued deployment that will run after the current operation + serving_candidate_id: + type: string + format: uuid nullable: true - last_authenticated_at: + readOnly: true + description: | + The promoted preview whose runtime receives this function's traffic, the same as + `candidate_id` in `serving`. Null when the function runs its own build. While it is set, + `current_deployment_id` and `status` describe the function's own build, which receives no + traffic until the function is rolled back. + last_invoked_at: type: string format: date-time + description: Most recent successful invocation timestamp created_at: type: string format: date-time @@ -19900,208 +31328,100 @@ components: format: date-time required: - id - - provider - - account_id - - account_name - - configuration_id - - granted_scopes + - project_id + - name - status - - last_authenticated_at + - visibility + - is_public + - invocation_mode + - http_auth_mode + - openapi_spec + - has_openapi_spec + - deployed_regions + - serving_candidate_id - created_at - updated_at - ImportConnectionsResponse: - type: object - properties: - connections: - type: array - items: - $ref: '#/components/schemas/ImportConnection' - required: - - connections - ImportSource: + DurableFunction: type: object + description: | + A durable function. Separate from `Function` because a durable function + is invoked only through its own execution endpoints, so it has no + invocation mode, HTTP auth mode, OpenAPI document or invoke URL, and it + carries a `durable` configuration that a standard function has no field + for. properties: id: type: string - name: - type: string - account_id: - type: string - framework: - type: string - required: - - id - - name - - account_id - - framework - ImportSourcesResponse: - type: object - properties: - sources: - type: array - items: - $ref: '#/components/schemas/ImportSource' - required: - - sources - ProjectImportTarget: - type: string - enum: - - production - x-enum-varnames: - - ProjectImportTargetProduction - ProjectImportDestinationMode: - type: string - enum: - - create - x-enum-varnames: - - ProjectImportDestinationCreate - ProjectImportDisposition: - type: string - enum: - - automatic - - manual - - deferred - - unsupported - x-enum-varnames: - - ProjectImportDispositionAutomatic - - ProjectImportDispositionManual - - ProjectImportDispositionDeferred - - ProjectImportDispositionUnsupported - ProjectImportImpact: - type: string - enum: - - none - - warning - - blocking - x-enum-varnames: - - ProjectImportImpactNone - - ProjectImportImpactWarning - - ProjectImportImpactBlocking - ProjectImportReadiness: - type: string - enum: - - importable - - needs_input - - blocked - x-enum-varnames: - - ProjectImportReadinessImportable - - ProjectImportReadinessNeedsInput - - ProjectImportReadinessBlocked - ProjectImportActionCode: - type: string - enum: - - project.create - - git.connect - - frontend.configure - - variable.set - x-enum-varnames: - - ProjectImportActionProjectCreate - - ProjectImportActionGitConnect - - ProjectImportActionFrontendConfigure - - ProjectImportActionVariableSet - ProjectImportResourceKind: - type: string - enum: - - project - - git_repository - - frontend - - variable - - domain - x-enum-varnames: - - ProjectImportResourceProject - - ProjectImportResourceGitRepository - - ProjectImportResourceFrontend - - ProjectImportResourceVariable - - ProjectImportResourceDomain - ProjectImportPreflightRequest: - type: object - properties: - connection_id: - type: string format: uuid - source_id: - type: string - minLength: 1 - project_name: - type: string - maxLength: 255 - pattern: ^[A-Za-z0-9_-]+$ - target: - $ref: '#/components/schemas/ProjectImportTarget' - confirm_environment_variable_read: - type: boolean - default: false - description: Set to true only after the user confirms an immediately preceding disclosure that the Vercel Integration grant permits reads and writes, while this preflight reads production variable values only. When false or omitted, preflight reads variable metadata only and reports readable values as manual input. - required: - - connection_id - - source_id - - project_name - - target - ProjectImportStartRequest: - type: object - properties: - connection_id: + project_id: type: string format: uuid - source_id: + name: type: string - minLength: 1 - maxLength: 255 - project_name: + maxLength: 63 + pattern: ^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$ + status: type: string - maxLength: 255 - pattern: ^[A-Za-z0-9_-]+$ - target: - $ref: '#/components/schemas/ProjectImportTarget' - confirm_environment_variable_read: - type: boolean enum: - - true - preflight_fingerprint: + - provisioning + - active + - failed + - deleting + provisioning_started_at: type: string - pattern: ^sha256:[0-9a-f]{64}$ - required: - - connection_id - - source_id - - project_name - - target - - confirm_environment_variable_read - - preflight_fingerprint - ProjectImportRunStatus: - type: string - enum: - - pending - - running - - succeeded - - failed - - superseded - x-enum-varnames: - - ProjectImportRunStatusPending - - ProjectImportRunStatusRunning - - ProjectImportRunStatusSucceeded - - ProjectImportRunStatusFailed - - ProjectImportRunStatusSuperseded - ProjectImportRun: - type: object - properties: - id: + format: date-time + description: Timestamp when the current provisioning phase started + visibility: + allOf: + - $ref: '#/components/schemas/FunctionVisibility' + description: | + Who may start executions of this function through + `POST /durable-functions/{functionId}/executions`, and read and stop + them through `GET /durable-functions/{functionId}/executions/{executionId}` + and its `/stop`: service keys at every level (a scoped key needs + `functions.invoke`), signed-in users of the project from + `authenticated`, and anon keys holding `functions.invoke` only at + `public`. On the read and stop routes a service key holding `*`, + the default, reaches every execution. A service key scoped to a + list without `*` and an anon key reach the ones whose client token + they send, which the start returns, and a signed-in user also the + ones they started. The project-scoped routes under + `/projects/{id}/durable-functions` take the project owner's token or + a project access token, whatever this is set to. + + Set it when the function is deployed. Durable functions have no + update endpoint, so changing visibility later means redeploying. + + A durable function is startable, never invocable: it is not + reachable through `POST /functions/{functionId}/invoke` or a + function URL, which answer `404` at every level. + is_public: + type: boolean + deprecated: true + description: Deprecated. `true` exactly when `visibility` is `public`. + durable: + $ref: '#/components/schemas/DurableFunctionConfig' + deployed_regions: + type: array + items: + type: string + description: Regions where this function is currently deployed + runtime: type: string - provider: - $ref: '#/components/schemas/ImportProvider' - source_id: + handler: type: string - destination_project_name: + current_deployment_id: type: string - resource: - $ref: '#/components/schemas/ResourceReference' - deployment: - $ref: '#/components/schemas/DeploymentReference' - status: - $ref: '#/components/schemas/ProjectImportRunStatus' - error_code: + format: uuid + description: Identifier of the latest deployment operation + pending_deployment_id: type: string - error_message: + format: uuid + description: Newest queued deployment that will run after the current operation + last_invoked_at: type: string + format: date-time + description: Most recent successful invocation timestamp created_at: type: string format: date-time @@ -20110,2122 +31430,2532 @@ components: format: date-time required: - id - - provider - - source_id - - destination_project_name - - resource - - deployment + - project_id + - name - status + - visibility + - is_public + - durable + - deployed_regions - created_at - updated_at - ProjectImportDestination: + DurableFunctionConfig: type: object + description: | + Execution limits the function was created with, derived from the + project's plan. Fixed for the life of the function: changing them means + creating a new one. + + The memory the function runs at, and the timeout on one attempt within + an execution, also come from the plan but are not reported here: they + are applied to the deployed function rather than recorded on it. Both + are published per plan in the plans and limits guide. properties: - mode: - $ref: '#/components/schemas/ProjectImportDestinationMode' - project_name: - type: string - target: - $ref: '#/components/schemas/ProjectImportTarget' + execution_timeout_seconds: + type: integer + format: int64 + description: | + How long a whole execution may run, including time suspended in a + wait. This is not a limit on one attempt: an execution outlives any + single attempt by checkpointing and resuming, and the per-attempt + timeout is the plan's own, smaller number. + retention_days: + type: integer + format: int64 + description: | + How long a finished execution's result and history are retained, for + as long as the function exists. Deleting the function, or its + project, ends retention early and takes the history with it. A + result or error Volcano has just read is kept in memory for up to + five minutes, so a read can still return it for up to five minutes + after retention ends. required: - - mode - - project_name - - target - ProjectImportResource: + - execution_timeout_seconds + - retention_days + DurableExecution: type: object properties: - kind: - $ref: '#/components/schemas/ProjectImportResourceKind' + id: + type: string + format: uuid + function_id: + type: string + format: uuid name: type: string - source_id: + description: | + Idempotency key for the execution. Supplied by the client through + `X-Volcano-Execution-Name`, otherwise generated. + status: + $ref: '#/components/schemas/DurableExecutionStatus' + region: type: string - minLength: 1 - description: Stable provider identifier for a scoped source resource. - scope: + description: | + Region the execution runs in. An execution is pinned to one region + for its whole life because its checkpoints live there. + result: + description: | + Whatever the function returned, verbatim. Absent while the execution + is still running, absent when the result was too large to return and + was checkpointed instead, and absent once the retention period has + lapsed. A result Volcano has just read can still be returned for up + to five minutes after that. + result_expired: + type: boolean + description: | + `true` when the execution is terminal but its result is no longer + retained, which distinguishes a discarded result from an empty one. + Shortly after that the execution itself is dropped and reads answer + `404`. + + A result that was checkpointed rather than returned leaves this + unset, so it reads like a function that returned nothing. + error: + $ref: '#/components/schemas/DurableExecutionError' + created_at: type: string - minLength: 1 - description: URL-encoded source scope, including target, branch, and custom environment identifiers. + format: date-time + completed_at: + type: string + format: date-time + description: Present once the execution has reached a terminal status. + client_token: + type: string + description: | + Lets a browser read the execution, stop it, and read and send its + messages, and a service key scoped to a list without `*` do the + same. Returned only by the start whose input the execution runs, + never by a repeat under the same name or by a read. Send it as + `X-Volcano-Client-Token`. required: - - kind + - id + - function_id - name - ProjectImportAction: - type: object - properties: - code: - $ref: '#/components/schemas/ProjectImportActionCode' - resource: - $ref: '#/components/schemas/ProjectImportResource' - disposition: - $ref: '#/components/schemas/ProjectImportDisposition' - required: - - code - - resource - - disposition - ProjectImportFinding: + - status + - region + - created_at + DurableExecutionStatus: + type: string + enum: + - pending + - running + - succeeded + - failed + - timed_out + - stopped + - unknown + description: | + Lifecycle state of an execution. `pending` covers the window between the + platform reserving the execution name and the function accepting the + start, and has no counterpart once the execution is under way. + `succeeded`, `failed`, `timed_out`, `stopped` and `unknown` are + terminal. + + `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. properties: - code: + type: type: string - pattern: ^(vercel|volcano|import)\.[a-z0-9_]+$ - resource: - $ref: '#/components/schemas/ProjectImportResource' - disposition: - $ref: '#/components/schemas/ProjectImportDisposition' - impact: - $ref: '#/components/schemas/ProjectImportImpact' message: type: string - remediation: - type: string - required: - - code - - resource - - disposition - - impact - - message - - remediation - ProjectImportSummary: - type: object - properties: - automatic: - type: integer - minimum: 0 - manual: - type: integer - minimum: 0 - deferred: - type: integer - minimum: 0 - unsupported: - type: integer - minimum: 0 - warnings: - type: integer - minimum: 0 - blocking: - type: integer - minimum: 0 - required: - - automatic - - manual - - deferred - - unsupported - - warnings - - blocking - ProjectImportReport: + DurableExecutionOperationList: type: object + description: A durable execution's trace. properties: - schema_version: - type: string - provider: - $ref: '#/components/schemas/ImportProvider' - source: - $ref: '#/components/schemas/ImportSource' - destination: - $ref: '#/components/schemas/ProjectImportDestination' - actions: + data: type: array + description: | + Every operation the execution began. The execution itself comes + first and is the only operation without a `parent_id`; the rest + follow in the order they started. items: - $ref: '#/components/schemas/ProjectImportAction' - findings: + $ref: '#/components/schemas/DurableExecutionOperation' + invocations: type: array + description: | + When the function's code was running, oldest first. An execution + suspended in a wait holds no runtime, so the gaps between these are + not charged as compute. items: - $ref: '#/components/schemas/ProjectImportFinding' - summary: - $ref: '#/components/schemas/ProjectImportSummary' - readiness: - $ref: '#/components/schemas/ProjectImportReadiness' - source_fingerprint: - type: string - capability_fingerprint: - type: string - fingerprint: - type: string - generated_at: + $ref: '#/components/schemas/DurableExecutionInvocation' + complete: + type: boolean + description: | + `true` once the execution has finished and nothing more will be + recorded. Its operations no longer change, and it is no longer + refreshed on read; a final invocation window can still be added + shortly after. + synced_at: type: string format: date-time + description: | + When the trace was last refreshed. Absent before it has been + refreshed at all. A running execution's trace is usually within + about ten seconds of the execution, and further behind when many + executions are being watched at once. required: - - schema_version - - provider - - source - - destination - - actions - - findings - - summary - - readiness - - source_fingerprint - - capability_fingerprint - - fingerprint - - generated_at - GitConnection: + - data + - invocations + - complete + DurableExecutionOperation: type: object + description: One operation on an execution's timeline. properties: id: type: string - format: uuid - provider: + description: Identifies the operation within its execution. + parent_id: type: string - provider_user_id: + description: | + The operation this one ran inside: a child context, map item or + parallel branch, or the execution itself for top-level work. Absent + only on the execution. + name: type: string - provider_login: + description: | + The name the handler gave the operation. Map items and parallel + branches the handler did not name carry the SDK's positional name, + such as `map-item-0`. Absent for an unnamed operation. + type: + type: string + enum: + - execution + - step + - wait + - callback + - context + - chained_invoke + description: The kind of checkpointed operation Volcano recorded. + kind: type: string + enum: + - execution + - step + - wait + - wait_until + - callback + - child + - map + - map_item + - parallel + - parallel_branch + - invoke + description: | + The operation as the handler wrote it: `ctx.step` is `step`, + `ctx.wait` is `wait`, `ctx.waitUntil` is `wait_until`, `ctx.child` + is `child`, `ctx.map` is `map` with one `map_item` per item, and + `ctx.parallel` is `parallel` with one `parallel_branch` per branch. status: type: string - last_authenticated_at: + enum: + - running + - waiting + - retrying + - succeeded + - failed + - cancelled + - timed_out + - stopped + - unknown + description: | + Where the operation stands. `waiting` holds no runtime: a wait that + has not elapsed, or a `waitUntil` between checks. `retrying` is a step whose last attempt failed and + whose next one is scheduled at `next_attempt_at`. Work still open + when the execution ended is `cancelled` at the moment it ended. + `unknown` is only ever the execution itself, when its outcome was + lost with its history, as in the execution's own `unknown` status. + started_at: type: string format: date-time - created_at: + ended_at: type: string format: date-time - updated_at: + description: Present once the operation has ended. + scheduled_end_at: type: string format: date-time - required: - - id - - provider - - provider_user_id - - provider_login - - status - - last_authenticated_at - - created_at - - updated_at - GitConnectStartResponse: - type: object - properties: - authorization_url: - type: string - required: - - authorization_url - VerifiedDomain: - type: object - description: A domain the account owns, along with every name below it. - properties: - domain: - type: string - example: example.com - verified_at: + description: When a wait is due to elapse. + next_attempt_at: type: string format: date-time - description: When the account last proved ownership. - required: - - domain - - verified_at - VerifiedDomainsResponse: - type: object - properties: - domains: - type: array - items: - $ref: '#/components/schemas/VerifiedDomain' - required: - - domains - VerifyDomainRequest: - type: object - properties: - domain: - type: string - minLength: 1 - maxLength: 253 - description: The domain to verify, such as `example.com`. - required: - - domain - GitConnectionsResponse: - type: object - properties: - connections: + description: | + When a step's next attempt, or a `waitUntil`'s next check, is due. + Present only while one is scheduled. + attempts: type: array + description: | + Each run of a step's body, in order. Present on steps and + `waitUntil` polls, where each check is an attempt. items: - $ref: '#/components/schemas/GitConnection' + $ref: '#/components/schemas/DurableExecutionOperationAttempt' + error: + $ref: '#/components/schemas/DurableExecutionError' required: - - connections - GitInstallation: + - id + - type + - kind + - status + - started_at + DurableExecutionOperationAttempt: type: object + description: One run of a step's body. properties: - id: + attempt: type: integer - format: int64 - account_login: + minimum: 1 + description: The attempt's number, starting at 1. + status: type: string - account_type: + enum: + - running + - succeeded + - failed + description: | + How the attempt ended. A `waitUntil` check whose condition did not + hold yet is `succeeded`: the check ran, and the poll continues. + started_at: type: string - repository_selection: + format: date-time + ended_at: type: string + format: date-time + description: Present once the attempt has ended. + error: + $ref: '#/components/schemas/DurableExecutionError' required: - - id - - account_login - - account_type - - repository_selection - GitInstallationsResponse: + - attempt + - status + - started_at + DurableExecutionInvocation: type: object + description: A window in which the function's code was running. properties: - installations: - type: array - items: - $ref: '#/components/schemas/GitInstallation' + started_at: + type: string + format: date-time + ended_at: + type: string + format: date-time required: - - installations - GitRepository: + - started_at + - ended_at + FunctionInvocationMode: + type: string + enum: + - rpc + - http + description: | + Invocation contract. `rpc` preserves the existing POST `{payload: ...}` contract; + `http` forwards HTTP request semantics to the function runtime. + FunctionHTTPAuthMode: + type: string + enum: + - volcano + - none + description: | + Authentication applied by the HTTP ingress. `none` is valid only for + HTTP-mode functions with `visibility: public` and is intended for + externally signed webhooks. + FunctionVisibility: + type: string + enum: + - private + - authenticated + - public + x-enum-varnames: + - FunctionVisibilityPrivate + - FunctionVisibilityAuthenticated + - FunctionVisibilityPublic + description: | + Who can invoke the function. Each level admits everything the one + before it does. + - `private`: service keys and the project's schedulers only. The + default for a new function. To any other credential the function + does not exist: it answers 404, like a missing one. + - `authenticated`: also any signed-in user of the project, including + anonymous sign-ins. The function receives their auth context. + - `public`: also anon keys holding `functions.invoke`, and Frontend + Function routes, which forward requests without a credential. + FunctionDeployment: type: object properties: id: - type: integer - format: int64 - description: Stable GitHub repository id (repository.id), unchanged by renames. - full_name: type: string - default_branch: + format: uuid + function_id: type: string - private: - type: boolean - is_empty: - type: boolean - description: Whether the repository has no commits and can receive an initial source export. - required: - - id - - full_name - - default_branch - - private - - is_empty - GitRepositoriesResponse: - type: object - properties: - repositories: - type: array - items: - $ref: '#/components/schemas/GitRepository' - required: - - repositories - ProjectGitConnection: - type: object - properties: - repo_installation_id: + format: uuid + project_id: + type: string + format: uuid + batch_id: + type: string + format: uuid + operation: + type: string + enum: + - deploy + - update + - delete + status: + type: string + enum: + - queued + - provisioning + - active + - failed + - superseded + - deleting + - deleted + deploy_source: + type: string + enum: + - git + - cli + - web + - api + - system + - unknown + description: What initiated this deployment. + initiated_by: + type: string + description: Platform user that triggered a request-initiated deployment; absent for git and system deployments. + commit: + $ref: '#/components/schemas/DeploymentCommit' + git_deployment_run_id: + type: string + format: uuid + description: The Git deployment run that made this deployment. Absent for a deployment no Git deployment run made. + build_duration_seconds: type: integer format: int64 - repo_id: + description: Total build time recorded for this deployment, in seconds. + build_count: type: integer - format: int64 - description: Stable GitHub repository id (repository.id), the authoritative binding. - repo_full_name: - type: string - root_directory: + description: Number of completed builds included in build_duration_seconds. + build_duration_recorded_at: type: string - production_branch: + format: date-time + description: When the build time was last recorded. + progress: + $ref: '#/components/schemas/DeploymentProgress' + error_message: type: string - description: The branch a push must land on to deploy. Follows the repository's GitHub default branch unless the project set its own, which a default-branch rename on GitHub then leaves alone. - updated_at: + completed_at: type: string format: date-time - required: - - repo_installation_id - - repo_id - - repo_full_name - - root_directory - - production_branch - - updated_at - ProjectGitDeploySettings: - type: object - description: 'A project''s GitHub auto-deploy settings: what a push to the connected repo''s production branch deploys. All settings are default-off.' - properties: - auto_deploy_enabled: - type: boolean - description: Whether a production-branch push triggers a deployment. - deploy_functions: - type: boolean - description: Whether the repo's functions are deployed on push. - frontend_name: - type: string - description: Name of the frontend to build and deploy on push. Omitted when no frontend is deployed. Resolved at deploy time; need not exist yet. - frontend_app_root: + created_at: type: string - description: App root (subdirectory) the frontend builds from. Omitted for the repo root. + format: date-time updated_at: type: string format: date-time required: - - auto_deploy_enabled - - deploy_functions + - id + - function_id + - project_id + - operation + - status + - deploy_source + - created_at - updated_at - UpdateProjectGitDeploySettingsRequest: - type: object - description: Full replace of a project's Git auto-deploy settings. - properties: - auto_deploy_enabled: - type: boolean - deploy_functions: - type: boolean - frontend_name: - type: string - description: Frontend to deploy on push. Omit or empty to deploy no frontend. - frontend_app_root: - type: string - description: App root the frontend builds from. Requires frontend_name; omit for the repo root. - required: - - auto_deploy_enabled - - deploy_functions - ProjectLockLeaseRequest: + FunctionInvocationRequest: type: object - additionalProperties: false properties: - ttl_seconds: - type: integer - minimum: 5 - maximum: 7776000 + payload: + type: object + additionalProperties: true description: | - Lease duration in seconds, from 5 seconds through 90 days, measured - from when the request is served. Renew before it elapses. A renewal - sets the new expiry outright, so a shorter TTL shortens the lease. - Renewals cannot extend an acquisition beyond its absolute 90-day - deadline. - required: - - ttl_seconds - ProjectLockLease: + Payload to send to the function. + + If invoked with auth user token, Volcano automatically injects `__volcano_auth` context: + ```javascript + { + ...yourPayload, + __volcano_auth: { + user_id: "uuid", + email: "user@example.com", + project_id: "uuid", + role: "authenticated" | "anonymous" + } + } + ``` + + The top-level `__volcano_auth`, `__volcano_http` and `__volcano_mount` + keys are reserved; Volcano removes caller-supplied values for all three. + FunctionInvocationResponse: type: object - additionalProperties: false + description: Raw function response body returned by the invoked function. + additionalProperties: true + LogActivityBucket: + type: object + description: Log-event counts for one activity time bucket. The first and last buckets can extend past the requested window; they count only events inside it. properties: - expires_at: + start_time: type: string format: date-time - description: Advisory lease expiry timestamp in UTC. - fencing_token: - type: integer - format: int64 - description: | - Monotonically increasing token for this acquisition. It rises whenever the - lock changes hands and stays the same across renewals of one lease. Pass it - to the resource you are protecting and reject any write carrying a token - lower than the highest already seen; that is what stops a displaced holder - from writing after its lease lapsed. - required: - - expires_at - - fencing_token - ProjectLockState: - type: object - additionalProperties: false - properties: - held: - type: boolean - description: | - Whether the lock is unavailable right now. False means an acquire would - succeed. It remains true during the brief grace window after expiry. - expires_at: + description: Bucket start time, inclusive. + end_time: type: string format: date-time - description: Advisory lease expiry timestamp in UTC. Present only when held. - fencing_token: + description: Bucket end time, exclusive. + counts: + type: object + description: Counts grouped by activity dimension. + properties: + levels: + type: object + additionalProperties: + type: integer + description: Counts by normalized log level. + regions: + type: object + additionalProperties: + type: integer + description: Counts by event region. + resource_ids: + type: object + additionalProperties: + type: integer + description: Counts by resource ID. + required: + - levels + - regions + - resource_ids + total: type: integer - format: int64 - description: Current holder's fencing token. Present only when held. + description: Total events in this bucket. required: - - held - ProjectSourceExportState: + - start_time + - end_time + - counts + - total + LogActivityRequest: type: object - description: The project's source of truth and any pending Git transition. + description: Activity request for bucketed log counts. + additionalProperties: false properties: - mode: - type: string - enum: - - platform - - git_exporting - - git_pending - - git - transition_started_at: + resource: + $ref: '#/components/schemas/LogRequestResource' + q: type: string - format: date-time - nullable: true - description: When source export started, cleared if an incomplete transition is canceled. - exported_at: + maxLength: 512 + description: Optional activity query. Supports quoted text, implicit AND, AND/OR/NOT, parentheses, and fields such as `level`, `region`, `invocation.id`, `resource.id`, `resource.name`, `function`, `frontend`, `database`, and `body`. + start_time: type: string format: date-time - nullable: true - description: When the initial export push entered deployment, or when a transition was canceled after its commit was reserved. Once set, the one-time export is consumed. - handed_over_at: + description: Start of the window, inclusive. Defaults to 24 hours before `end_time`. + end_time: type: string format: date-time - nullable: true - description: When a complete production-branch deployment first proved the repository could drive the project, null until then. Once set, the repository is the project's source of truth. + description: End of the window, exclusive. Defaults to now. + bucket_count: + type: integer + minimum: 1 + maximum: 96 + description: Maximum number of buckets. Defaults to 24. Volcano picks the smallest bucket width from 1s, 2s, 5s, 10s, 15s, 30s, 1m, 2m, 5m, 10m, 15m, 30m, 1h, 2h, 3h, 6h, 12h, 1d, or a whole number of days that covers the window in at most this many buckets. Bucket edges fall on UTC multiples of the width, so they stay fixed as the window moves, and the response can contain fewer buckets. `1` returns one bucket that spans exactly the window. required: - - mode - - transition_started_at - - exported_at - - handed_over_at - ProjectSourceExport: + - resource + LogActivityResponse: type: object - description: The initial production-branch commit, and everything export could not carry. + description: Bucketed runtime log activity. properties: - repo_full_name: - type: string - branch: - type: string - description: The production branch that was created. - commit_sha: - type: string - file_count: - type: integer - skipped: - type: array - description: Resources whose source could not be taken, with the reason. Most often a resource that has never deployed successfully. - items: - $ref: '#/components/schemas/ProjectSourceExportSkip' - omitted: + data: type: array - description: Things deliberately left out of the branch. items: - $ref: '#/components/schemas/ProjectSourceExportOmission' + $ref: '#/components/schemas/LogActivityBucket' + total: + type: integer + description: Total events counted across all buckets. required: - - repo_full_name - - branch - - commit_sha - - file_count - - skipped - - omitted - ExportProjectSourceRequest: + - data + - total + LogSearchRequest: type: object + description: Search request for project logs. additionalProperties: false properties: - production_branch: + resource: + $ref: '#/components/schemas/LogRequestResource' + q: type: string - minLength: 1 - description: The currently configured production branch the user confirmed for export. - required: - - production_branch - ProjectSourceExportSkip: - type: object - properties: - kind: + maxLength: 512 + description: Optional log query. Supports quoted text, implicit AND, AND/OR/NOT, parentheses, and fields such as `level`, `region`, `invocation.id`, `resource.id`, `resource.name`, `function`, `frontend`, `database`, and `body`. + start_time: type: string - description: 'The kind of resource, "function" or "frontend". Deliberately not an enum: the generated constants would collide with an existing resource-type enum and rename its members.' - name: + format: date-time + description: Start time. + end_time: type: string - reason: + format: date-time + description: End time. + limit: + type: integer + minimum: 1 + maximum: 1000 + default: 100 + description: Maximum number of records to return. + cursor: type: string + description: Opaque pagination cursor from the previous response's `next_cursor`. required: - - kind - - name - - reason - ProjectSourceExportOmission: + - resource + LogStreamRequest: type: object + description: Stream request for live project logs. Pagination cursors and fixed end times are not supported. + additionalProperties: false properties: - kind: - type: string - description: 'What was left out: migrations Volcano stores no copy of, variable values, a credential-shaped file, installed dependencies, or an archive entry a repository cannot carry.' resource: + $ref: '#/components/schemas/LogRequestResource' + q: type: string - description: The resource it came from, empty when project-wide. - path: + maxLength: 512 + description: Optional log query using the same syntax as search and activity requests. + start_time: type: string + format: date-time + description: Start time. + limit: + type: integer + minimum: 1 + maximum: 1000 + default: 100 + description: Maximum number of records to deliver on connect or reconnect before following new events. required: - - kind - resource - - path - SetProjectGitProductionBranchRequest: + LogSearchEvent: + allOf: + - $ref: '#/components/schemas/LogEvent' + - type: object + description: Runtime log event returned by project log search. Search results always include a stable event ID and owning resource. + properties: + id: + type: string + description: Opaque stable log event ID for pagination, deduplication, and display. + resource: + $ref: '#/components/schemas/LogResource' + required: + - id + - resource + LogSearchResponse: type: object + description: Paginated project runtime log search response. properties: - production_branch: + data: + type: array + items: + $ref: '#/components/schemas/LogSearchEvent' + description: Array of log events sorted by timestamp, newest first. + limit: + type: integer + description: Number of items requested per page. + has_more: + type: boolean + description: Whether the search may have more matching log events. A page can hold fewer than `limit` events, or none, while this is true; keep paging until it is false. + next_cursor: type: string - minLength: 1 - maxLength: 255 - description: The branch a push must land on to deploy. Validated as a Git branch name only — it does not have to exist yet. + description: Opaque cursor for the next page, present while `has_more` is true. Send this value as `cursor` on the next request, even when `data` is empty. required: - - production_branch - ConnectProjectGitRequest: + - data + - limit + - has_more + FunctionRegion: type: object + required: + - code + - label + - flag properties: - connection_id: - type: string - format: uuid - description: The caller's user_git_connections row (see /user/git/connections). - installation_id: - type: integer - format: int64 - repository_id: - type: integer - format: int64 - description: Stable GitHub repository id (repository.id), the preferred selector. Either repository_id or repo_full_name is required; when both are given they must identify the same live repository. - repo_full_name: + code: type: string - deprecated: true - description: Deprecated selector kept for a compatibility window; prefer repository_id. Either repository_id or repo_full_name is required. - root_directory: + example: us-east-1 + description: Region identifier accepted by function APIs. + label: type: string - description: Monorepo subdirectory the project builds from. Omit for the repo root. - production_branch: + example: NA-East + description: Human-readable region label suitable for display in pickers. + flag: type: string - maxLength: 255 - description: 'The branch a push must land on to deploy, with three cases, because this is a full replace and a read-modify-write client sends back whatever it read. Omit it to follow the repository''s GitHub default branch, which also discards a branch set earlier. Send back the branch the project already deploys from, when that is the repository''s default, and nothing changes either way — a project pinned to that branch stays pinned. Sending the default branch when the project deploys from something else returns it to following the default, including on a rebind, where a pin describes a branch chosen for the repository being left. Any other branch becomes the project''s own choice, exempt from later default-branch renames. Validated as a Git branch name only: it does not have to exist yet, so a project can be pointed at a branch about to be pushed. Changing repository and naming a branch other than the new repository''s default in one request is refused with 400, because the branch named is almost always the previous repository''s, echoed back — connect first, then set the branch.' - required: - - connection_id - - installation_id - Frontend: + example: 🇺🇸 + description: Country flag emoji associated with the region's geography. + FunctionRuntimeOption: type: object + required: + - name + - label + - language + - default + - durable_capable + - deployment 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 - project_id: - type: string - format: uuid name: type: string - maxLength: 63 - pattern: ^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$ - framework: - type: string - enum: - - nextjs - app_root: - type: string - maxLength: 1024 - description: Optional relative POSIX path from the uploaded archive root to the Next.js app that is deployed. - status: + example: nodejs24.x + description: Runtime identifier accepted by function APIs. + label: type: string - description: | - Frontend lifecycle status. `degraded` means the regional runtime remains - available but edge synchronization exhausted its immediate retries; Volcano - retries edge recovery without rebuilding the frontend, and stops once a new - deployment is queued or the retry budget runs out, leaving the frontend - `degraded` until the next redeploy. A redeploy that fails over a serving - frontend stays `active` on the previous deployment, so `failed` means no - deployment is serving. - enum: - - provisioning - - active - - degraded - - failed - - deleting - provisioning_started_at: + example: Node.js 24 + description: Human-readable runtime label suitable for display in pickers. + language: type: string - format: date-time - description: Timestamp when the current provisioning phase started - deployed_regions: + example: nodejs + description: Runtime language family used by the CLI to choose defaults from source files. + default: + type: boolean + description: Whether this runtime is the CLI default for its language. + durable_capable: + type: boolean + description: Whether a durable function can be authored on this runtime. Only runtimes with a durable authoring API report true, and a durable deploy naming any other runtime is rejected. + deployment: + $ref: '#/components/schemas/FunctionRuntimeDeployment' + FunctionRuntimesResponse: + type: object + required: + - runtimes + properties: + runtimes: type: array items: - type: string - current_deployment_id: + $ref: '#/components/schemas/FunctionRuntimeOption' + FunctionKindFilter: + type: string + enum: + - standard + - durable + description: | + A function kind to filter a list by. Unlike `FunctionKind` it has no + default: omitting the filter includes both kinds. + x-enum-varnames: + - FunctionKindFilterStandard + - FunctionKindFilterDurable + FunctionScheduler: + type: object + properties: + id: type: string format: uuid - description: Identifier of the latest frontend deployment operation - pending_deployment_id: + project_id: type: string format: uuid - description: Newest queued deployment that will run after the current operation - site_url: + function_id: type: string - custom_domain: + format: uuid + function_kind: + allOf: + - $ref: '#/components/schemas/FunctionKind' + description: | + Which collection the scheduled function belongs to. A project-wide + scheduler list mixes both kinds, and this is what says whether the + function is read back from `/projects/{id}/functions` or + `/projects/{id}/durable-functions` — and whether a tick invokes it + or starts a durable execution. + name: type: string - description: Active custom domain hostname when configured - custom_domain_status: + enabled: + type: boolean + schedule_kind: type: string - description: Current custom domain lifecycle status enum: - - pending_verification - - provisioning - - active - - detaching - - failed - - deleted - function_routes: + - cron + cron_expression: + type: string + payload: + type: object + additionalProperties: true + regions: type: array - maxItems: 64 items: - $ref: '#/components/schemas/FrontendFunctionRoute' - description: | - Paths on this frontend that forward to a public function, ordered - from most to least specific. Anyone who can load the frontend can - reach the target function at these paths without a credential. - last_deployed_at: - type: string - format: date-time - description: Recorded completion time of the most recent deploy or redeploy with status active. Omitted when no such deployment has a recorded completion time. Site traffic, pending deployments, degraded deployments, failed deployments, and deletion do not change this value. - last_invoked_at: + type: string + regions_explicit: + type: boolean + next_run_at: type: string format: date-time - created_at: + last_started_at: type: string format: date-time - updated_at: + last_completed_at: type: string format: date-time - required: - - id - - project_id - - name - - framework - - status - - deployed_regions - - function_routes - - created_at - - updated_at - FrontendFunctionRoute: - type: object - additionalProperties: false - properties: - id: + last_error: type: string - format: uuid - project_id: + run_count: + type: integer + format: int64 + description: Total number of times this scheduler has executed. 0 for a scheduler that has never run. + health: type: string - format: uuid - frontend_id: + enum: + - healthy + - failing + description: '`failing` while `consecutive_failures` is above 0; `healthy` otherwise, including before its first run in the region the scheduler runs in now. A run from a region it moved away from does not count. For a durable function a run finishes when its execution does, so a run that starts but then fails counts as failed.' + consecutive_failures: + type: integer + format: int64 + minimum: 0 + description: How many runs in a row have failed in the region the scheduler runs in now. Resets to 0 when a run succeeds, and starts at 0 in a region it moves to. + last_run_status: type: string - format: uuid - function_id: + enum: + - succeeded + - failed + description: Outcome of the most recent finished run. Absent before the first. + last_success_at: type: string - format: uuid - path_prefix: + format: date-time + description: When the most recent successful run finished. + last_failure_at: type: string - minLength: 2 - maxLength: 512 - pattern: ^/[^?#\\]*[^/?#\\]$ - strip_prefix: - type: boolean + format: date-time + description: When the most recent failed run finished. created_at: type: string format: date-time updated_at: type: string format: date-time - required: - - id - - project_id - - frontend_id - - function_id - - path_prefix - - strip_prefix - - created_at - - updated_at - FrontendFunctionRouteList: + FunctionSchedulerListResponse: type: object - additionalProperties: false properties: data: type: array items: - $ref: '#/components/schemas/FrontendFunctionRoute' + $ref: '#/components/schemas/FunctionScheduler' + page: + type: integer + limit: + type: integer + total: + type: integer + has_more: + type: boolean + next_cursor: + type: string + description: Opaque cursor for the next page (cursor pagination only; present if has_more is true) + prev_cursor: + type: string + description: Opaque cursor for the previous page (cursor pagination only; present when a previous page exists). Send as `ending_before`. required: - data - CreateFrontendFunctionRouteRequest: + - page + - limit + - total + - has_more + HostedAuthPageType: + type: string + enum: + - login + - signup + - forgot-password + - device + - verify-email + - reset-password + HostedLoginEmailCheckRequest: type: object - additionalProperties: false + required: + - email properties: - function_id: - type: string - format: uuid - path_prefix: + email: type: string - minLength: 2 - maxLength: 512 - pattern: ^/[^?#\\]*[^/?#\\]$ - strip_prefix: + format: email + HostedLoginEmailCheckResponse: + type: object + properties: + exists: type: boolean - default: false - required: - - function_id - - path_prefix - FrontendCustomDomainTLSConfig: + HostedLoginOptionsResponse: type: object - description: 'TLS for a new custom domain. With `mode: managed`, Volcano issues and renews the certificate; omit every PEM field. With `mode: byoc`, send both `certificate_pem` and `private_key_pem`, plus an optional `certificate_chain_pem`.' - additionalProperties: false - not: - anyOf: - - allOf: - - properties: - mode: - enum: - - managed - required: - - mode - - anyOf: - - required: - - certificate_pem - - required: - - private_key_pem - - required: - - certificate_chain_pem - - allOf: - - properties: - mode: - enum: - - byoc - required: - - mode - - anyOf: - - not: - required: - - certificate_pem - - not: - required: - - private_key_pem properties: - mode: + require_email_confirmation: + type: boolean + email_password_enabled: + type: boolean + enable_signup: + type: boolean + post_auth_redirect_url: type: string - enum: - - managed - - byoc - default: byoc - description: managed for a Volcano-issued certificate; byoc to supply your own. - certificate_pem: + oauth_providers: + type: array + items: + type: string + HostedRenderablePageType: + type: string + enum: + - signup + - forgot-password + - device + - verify-email + - reset-password + LogEvent: + type: object + description: Historical log event returned by log APIs. + properties: + id: type: string - maxLength: 65536 - description: PEM-encoded certificate. Required when mode is byoc; not allowed when mode is managed. - private_key_pem: + description: Opaque stable log event ID for pagination, deduplication, and display. + timestamp: type: string - maxLength: 65536 - description: PEM-encoded private key. Required when mode is byoc; not allowed when mode is managed. - certificate_chain_pem: + format: date-time + description: Event timestamp. + level: + $ref: '#/components/schemas/LiveLogLevel' + body: + description: Application log value. JSON arguments retain their JSON type. Strings containing a serialized JSON object or array are normalized to that object or array; all other strings remain strings. + nullable: true + oneOf: + - type: string + - type: object + additionalProperties: true + - type: array + items: {} + - type: number + format: double + - type: boolean + region: type: string - maxLength: 65536 - description: Optional PEM-encoded certificate chain when mode is byoc; not allowed when mode is managed. + description: Region where this log event originated. + resource: + $ref: '#/components/schemas/LogResource' + deployment: + $ref: '#/components/schemas/LogDeployment' + invocation_id: + type: string + description: Function invocation ID associated with this log event, when available. required: - - mode - FrontendCustomDomainResponse: + - timestamp + - body + LiveLogLevel: + type: string + enum: + - trace + - debug + - info + - warn + - error + - fatal + description: Canonical lowercase function runtime log level. + MetricUsageData: type: object + description: Usage data for one metric across totals, daily, and hourly windows. properties: - domain: - type: string - tls_mode: + metric: type: string - enum: - - managed - - byoc - domain_status: + description: | + Metric name (for example, "Function & Frontend Invocations", "Frontend Requests", + "Durable Executions", "Durable Operations", "Durable Compute (MB-Seconds)", + "Build Seconds", + "Bandwidth Ingress (Bytes)", "Bandwidth Egress (Bytes)", + "Bandwidth Total (Bytes)", or "Database Storage (Bytes)"). Byte-based metrics are + reported in bytes. "Bandwidth Total (Bytes)" is derived (ingress + egress) and + is not billed separately. The three durable metrics are + counted separately from "Function & Frontend Invocations", which covers standard + invocations only. Operations and compute are counted when an execution finishes, + so they appear in the window the execution completed in rather than the one it + started in. "Durable Compute (MB-Seconds)" reports the memory the execution ran + at times the time it spent running, in megabyte-seconds; the allowance for it is + published in gigabyte-seconds, which is 1024 of these. + "Sandbox Running (MiB-Seconds)", "Sandbox Suspended (Seconds)", and + "Sandbox Uncertain (MiB-Seconds)" report cloud Sandbox usage. Running + reports configured baseline memory times confirmed runtime, not measured + CPU or elastic memory consumption. For sessions admitted after the pricing + release, confirmed running time consumes the account's runtime allowance; + SUPERAGENT overage debits credits according to the account's pricing terms. + Suspended time and uncertain usage do not consume runtime allowance or + debit credits. Uncertain includes observation gaps and unconfirmed state + transitions. Suspended reports duration, not snapshot size; snapshot costs + are included in runtime pricing. Local and platform image-validation + sessions do not contribute. Existing preview sessions remain unbilled, + and preview history is never charged retroactively. Displayed totals are + rounded down after aggregating millisecond measurements; billing uses + unrounded measurements in the monthly account billing cycle. + "Database Storage (Bytes)" is a current observed gauge, + not a cumulative counter. It is the sum of the latest samples exposed as + `storage_bytes` by the project's database list, so it includes what each + database's branches and backups hold, and it inherits that field's lag + behind a live measurement. + total: + type: integer + format: int64 + description: Total usage for the current usage month + all_time: + type: integer + format: int64 + description: Lifetime cumulative usage across every month for this metric + daily: + type: array + description: Last 30 days of daily usage points + items: + $ref: '#/components/schemas/UsageDataPoint' + hourly: + type: array + description: Last 24 hours of hourly usage points + items: + $ref: '#/components/schemas/UsageDataPoint' + required: + - metric + - total + - all_time + - daily + - hourly + OAuthConfig: + type: object + properties: + id: type: string - enum: - - pending_verification - - provisioning - - active - - detaching - - failed - - deleted - verification_status: + format: uuid + provider: type: string enum: - - pending - - verified - - failed - description: '`verified`: the domain is served by a validated certificate. `pending`: it is not served yet, is being re-validated after its certificate material was withdrawn, or Volcano is retrying after a failure. `failed`: a failure left the domain unserved, alongside `domain_status: failed`; managed domains report the cause in `failure_reason`.' - serving_certificate: + - google + - github + - microsoft + - apple + - device + client_id: type: string - enum: - - uploaded - - managed - description: 'Certificate the domain serves, present only while it is active. `uploaded`: the BYOC certificate, including after the domain switched to managed TLS and until Volcano issues the managed one; `failure_reason` then reports an issuance failure. `managed`: a certificate Volcano issued.' - failure_reason: + example: 123456789.apps.googleusercontent.com + client_secret: type: string - description: Failure category, present when managed TLS setup has failed, or when issuance is failing for a domain that switched to managed TLS and still serves its uploaded certificate. Current values are provider, certificate, ownership, and internal; ownership means another account has already claimed the hostname through ownership verification. Treat unrecognized values as internal. - verification_records: - type: array - description: DNS records to publish now. For a managed domain whose hostname the account already owns, the create response names the `_acme-challenge` CNAME that authorizes certificate issuance and renewal. Otherwise it names the `_volcano` TXT record that proves ownership of the hostname's registrable domain, and reads return the CNAME once Volcano sees that record. Usually empty for BYOC. - items: - $ref: '#/components/schemas/FrontendDomainVerificationRecord' - required_routing_record: - allOf: - - $ref: '#/components/schemas/FrontendDomainRoutingRecord' - deprecated: true - description: Deprecated and no longer returned. Use routing_target_hostname as the DNS routing target. - routing_target_hostname: + description: Masked in responses (shows only first/last 4 chars) + example: GOCS...**** + enabled: + type: boolean + redirect_url: type: string - description: DNS routing target hostname for this frontend. The DNS record type depends on whether the custom domain is a zone apex. - effective_urls: + format: uri + example: https://yourapp.com/auth/callback + scopes: type: array items: type: string + example: + - openid + - email + - profile created_at: type: string format: date-time updated_at: type: string format: date-time - required: - - domain - - tls_mode - - domain_status - - verification_status - - effective_urls - - created_at - - updated_at - FrontendDeployment: + OAuthErrorResponse: type: object properties: - id: - type: string - format: uuid - frontend_id: - type: string - format: uuid - project_id: - type: string - format: uuid - operation: - type: string - enum: - - deploy - - redeploy - - delete - status: - type: string - description: | - Deployment lifecycle status. A `degraded` redeploy remains available while - edge-only recovery is retried. A `failed` redeploy is recorded here while the - frontend keeps serving its previous deployment. - enum: - - queued - - provisioning - - active - - degraded - - failed - - superseded - - deleting - - deleted - deploy_source: + error: type: string - enum: - - git - - cli - - web - - api - - system - - unknown - description: What initiated this deployment. - initiated_by: + error_description: type: string - description: Platform user that triggered a request-initiated deployment; absent for git and system deployments. - site_url: + required: + - error + PaginatedAuthUsers: + type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/AuthUser' + page: + type: integer + description: Current page number (1-indexed) + limit: + type: integer + description: Number of items per page + total: + type: integer + description: Total number of items across all pages + has_more: + type: boolean + description: Whether there are more pages available + next: type: string - build_duration_seconds: + description: URL path to next page (only present if has_more is true) + required: + - data + - page + - limit + - total + - has_more + PaginatedDatabases: + type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/Database' + page: type: integer - format: int64 - description: Total build time recorded for this deployment, in seconds. - build_count: + description: Current page number (1-indexed) + limit: type: integer - description: Number of completed builds included in build_duration_seconds. - build_duration_recorded_at: - type: string - format: date-time - description: When the build time was last recorded. - progress: - $ref: '#/components/schemas/DeploymentProgress' - error_message: + description: Number of items per page + total: + type: integer + description: Total number of items across all pages + has_more: + type: boolean + description: Whether there are more pages available + next: type: string - created_at: + description: URL path to next page (only present if has_more is true) + next_cursor: type: string - format: date-time - updated_at: + description: Opaque cursor for the next page (cursor pagination only; present if has_more is true) + prev_cursor: type: string - format: date-time + description: Opaque cursor for the previous page (cursor pagination only; present when a previous page exists). Send as `ending_before`. required: - - id - - frontend_id - - project_id - - operation - - status - - deploy_source - - created_at - - updated_at - FrontendDomainRoutingRecord: + - data + - page + - limit + - total + - has_more + PaginatedFrontendDeployments: type: object properties: - record_type: - type: string - enum: - - CNAME - name: - type: string - value: + data: + type: array + items: + $ref: '#/components/schemas/FrontendDeployment' + page: + type: integer + description: Current page number (1-indexed) + limit: + type: integer + description: Number of items per page + total: + type: integer + description: Total number of items across all pages + has_more: + type: boolean + description: Whether there are more pages available + next: type: string + description: URL path to next page (only present if has_more is true) required: - - record_type - - name - - value - FrontendDomainVerificationRecord: + - data + - page + - limit + - total + - has_more + PaginatedFrontends: type: object - description: The DNS records currently required. Volcano may require an account-specific TXT ownership record for the hostname's domain before returning a CNAME that authorizes managed certificate issuance and renewal. Clients must follow the records returned for the current lifecycle state instead of assuming a fixed sequence. properties: - name: + data: + type: array + items: + $ref: '#/components/schemas/Frontend' + page: + type: integer + description: Current page number (1-indexed) + limit: + type: integer + description: Number of items per page + total: + type: integer + description: Total number of items across all pages + has_more: + type: boolean + description: Whether there are more pages available + next: type: string - type: + description: URL path to next page (offset pagination only; present if has_more is true) + next_cursor: type: string - value: + description: Opaque cursor for the next page (cursor pagination only; present if has_more is true) + prev_cursor: type: string + description: Opaque cursor for the previous page (cursor pagination only; present when a previous page exists). Send as `ending_before`. required: - - name - - type - - value - FrontendCustomDomainConflictError: - description: 'Domain ownership conflict. With `code: ownership_verification_required`, the account has not proven it owns the domain: publish `required_record` in DNS and send the same request again. The retry succeeds once Volcano can see the record. With `code: custom_domain_releasing`, a removed domain still holds the hostname or the frontend while Volcano releases it: send the same request again after the response''s `Retry-After` seconds. A release that will not finish within a few minutes is a plain conflict. Other conflicts omit both fields.' - allOf: - - $ref: '#/components/schemas/Error' - - type: object - properties: - required_record: - $ref: '#/components/schemas/FrontendDomainVerificationRecord' - FrontendUsageDailyEntry: + - data + - page + - limit + - total + - has_more + PaginatedFunctionDeployments: type: object - description: One day of request and error counts for a single frontend. properties: - day: - type: string - format: date - description: UTC date (YYYY-MM-DD) the counts cover. - requests: + data: + type: array + items: + $ref: '#/components/schemas/FunctionDeployment' + page: type: integer - format: int64 - description: Total requests served on this day. - errors: + description: Current page number (1-indexed) + limit: type: integer - format: int64 - description: 5xx responses served on this day. - page_views: + description: Number of items per page + total: type: integer - format: int64 - description: Navigable-document responses served on this day (text/html or Sec-Fetch-Dest=document) — strict subset of `requests`. + description: Total number of items across all pages + has_more: + type: boolean + description: Whether there are more pages available + next: + type: string + description: URL path to next page (only present if has_more is true) required: - - day - - requests - - errors - - page_views - FrontendUsageData: + - data + - page + - limit + - total + - has_more + PaginatedFunctions: type: object - description: Monthly frontend request totals grouped by frontend. properties: - frontend_id: + data: + type: array + items: + $ref: '#/components/schemas/Function' + page: + type: integer + description: Current page number (1-indexed) + limit: + type: integer + description: Number of items per page + total: + type: integer + description: Total number of items across all pages + has_more: + type: boolean + description: Whether there are more pages available + next: type: string - format: uuid - description: Frontend ID - frontend_name: + description: URL path to next page (only present if has_more is true) + next_cursor: type: string - description: Frontend name at the time usage was fetched - nullable: true - requests: - type: integer - format: int64 - description: Total requests for this frontend in the current usage month + description: Opaque cursor for the next page (cursor pagination only; present if has_more is true) + prev_cursor: + type: string + description: Opaque cursor for the previous page (cursor pagination only; present when a previous page exists). Send as `ending_before`. required: - - frontend_id - - requests - FrontendUsageHistoryResponse: + - data + - page + - limit + - total + - has_more + PaginatedDurableFunctions: type: object - description: Zero-filled daily series of request + error counts for a single frontend, oldest first. properties: - frontend_id: - type: string - format: uuid - days: + data: + type: array + items: + $ref: '#/components/schemas/DurableFunction' + page: type: integer - description: Number of daily entries returned (always equal to the `days` query param after clamping). - daily: + description: Current page number (1-indexed) + limit: + type: integer + description: Number of items per page + total: + type: integer + description: Total number of items across all pages + has_more: + type: boolean + description: Whether there are more pages available + required: + - data + - page + - limit + - total + - has_more + PaginatedDurableExecutions: + type: object + properties: + data: type: array items: - $ref: '#/components/schemas/FrontendUsageDailyEntry' - total_requests: + $ref: '#/components/schemas/DurableExecution' + page: type: integer - format: int64 - total_errors: + description: Current page number (1-indexed) + limit: type: integer - format: int64 - total_page_views: + description: Number of items per page + total: type: integer - format: int64 + description: Total number of items across all pages + has_more: + type: boolean + description: Whether there are more pages available required: - - frontend_id - - days - - daily - - total_requests - - total_errors - - total_page_views - ProjectAccessToken: + - data + - page + - limit + - total + - has_more + DurableApproval: 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. + description: An approval a durable workflow requested. properties: id: type: string format: uuid - project_id: - type: string - format: uuid + status: + $ref: '#/components/schemas/DurableApprovalStatus' name: type: string - description: Unique per project. - token_prefix: + description: | + The name the workflow gave the approval in `ctx.waitForApproval`. + title: type: string - description: First 12 characters of the secret, for recognising a token in a list. - scope: - $ref: '#/components/schemas/ProjectAccessTokenScope' - status: + description: type: string - enum: - - active - - revoked - - expired + details: 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: + The JSON value the workflow attached for the person deciding, as + given. + function: + $ref: '#/components/schemas/DurableApprovalFunction' + execution: + $ref: '#/components/schemas/DurableApprovalExecution' + requested_at: type: string - enum: - - api - - cli - - dashboard - description: What created the token. + format: date-time expires_at: type: string format: date-time nullable: true - description: Absent for a token that does not expire. - last_used_at: + description: | + When the approval expires if nobody decides. Null when the + workflow set no timeout; the approval then lasts as long as its + execution. + decision: + $ref: '#/components/schemas/DurableApprovalDecision' + required: + - id + - status + - name + - title + - description + - function + - execution + - requested_at + - expires_at + - decision + DurableApprovalStatus: + type: string + enum: + - pending + - approved + - denied + - expired + - cancelled + description: | + `pending` means the workflow is waiting for a decision. `approved` and + `denied` are decisions a person made. `expired` means the workflow's + approval timeout passed first, and `cancelled` means the execution + ended while the approval was still pending. Every status but `pending` + is final. + DurableApprovalRegistration: + type: object + description: The registered approval, as the requesting workflow sees it. + properties: + id: type: string - format: date-time - nullable: true - description: Updated at most once every few minutes, so it may lag slightly. - created_at: + format: uuid + status: + $ref: '#/components/schemas/DurableApprovalStatus' + expires_at: type: string format: date-time - all_time_requests: - type: integer - format: int64 - description: Requests authenticated with this token since it was created. + nullable: true 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: + - expires_at + DurableApprovalStats: + type: object + properties: + from: + type: string + format: date-time + to: + type: string + format: date-time + counts: + $ref: '#/components/schemas/DurableApprovalCounts' + approval_rate: + type: number + format: double + nullable: true + description: | + `approved / (approved + denied)`, from 0 to 1. Null when nothing in + the window was decided. + median_seconds_to_decision: + type: number + format: double + nullable: true + description: Median time from request to decision. Null when nothing was decided. + p90_seconds_to_decision: + type: number + format: double + nullable: true + description: 90th percentile time from request to decision. Null when nothing was decided. + functions: + type: array + description: | + The ten workflows that requested the most approvals, most first. + The rest are summed in `other_functions`. + items: + $ref: '#/components/schemas/DurableApprovalFunctionCounts' + other_functions: + $ref: '#/components/schemas/DurableApprovalCounts' + daily: + type: array + description: | + One entry per UTC day in the window that has approvals, oldest + first. Days with none are omitted. + items: + $ref: '#/components/schemas/DurableApprovalDailyCounts' + required: + - from + - to + - counts + - approval_rate + - median_seconds_to_decision + - p90_seconds_to_decision + - functions + - other_functions + - daily + DurableApprovalDecisionRequest: + type: object + properties: + comment: + type: string + maxLength: 2000 + description: A note for the workflow and the approval's history. + additionalProperties: false + RequestDurableApprovalRequest: type: object properties: + execution_ref: + type: string + minLength: 1 + maxLength: 2048 + description: Opaque reference to the running execution, supplied by the SDK. + callback_id: + type: string + minLength: 1 + maxLength: 1024 + description: Opaque approval reference, supplied by the SDK. 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: + maxLength: 255 + title: type: string - format: date-time - description: Omit for a token that does not expire. + minLength: 1 + maxLength: 200 + description: + type: string + maxLength: 4000 + details: + x-go-type: json.RawMessage + x-go-type-skip-optional-pointer: true + description: | + Any JSON value to show the person deciding. A number's exponent must + be between -324 and 324, and a number too large or too precise to + store is refused with `400`. Numbers are read back written out in + full, so the exponents' absolute values may total at most 65,536. + The whole request is limited to 64 KiB. required: + - execution_ref + - callback_id - 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: + - title + additionalProperties: false + PaginatedDurableApprovals: type: object properties: data: type: array items: - $ref: '#/components/schemas/ProjectAccessToken' + $ref: '#/components/schemas/DurableApproval' page: type: integer + description: Current page number (1-indexed) limit: type: integer + description: Number of items per page total: type: integer + description: Total number of items across all pages has_more: type: boolean - next: - type: string + description: Whether there are more pages available required: - data - page - limit - total - has_more - ProjectAccessTokenUsage: - type: object + DurableMessageName: + type: string + minLength: 1 + maxLength: 237 + pattern: ^[ -~]+$ 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. + The name a workflow waits on or publishes under: up to 237 printable + ASCII characters. + DurableMessageDirection: + type: string + enum: + - in + - out + x-enum-varnames: + - DurableMessageDirectionIn + - DurableMessageDirectionOut + description: | + `in` is a message sent to the execution. `out` is one the execution + published. + DurableMessage: + type: object + description: A message sent to, or published by, a durable execution. properties: - token_id: + id: type: string format: uuid - name: - type: string - token_prefix: + execution_id: 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: + format: uuid + direction: + $ref: '#/components/schemas/DurableMessageDirection' + seq: type: integer format: int64 + description: | + Orders the execution's messages in both directions. It increases + with every message but can skip numbers. Pass the last one you read + as `after` to read what came next. + name: + type: string + data: + x-go-type: json.RawMessage + x-go-type-skip-optional-pointer: true + nullable: true + description: The JSON value sent or published, or null. + sender: + $ref: '#/components/schemas/DurableMessageSender' + status: + $ref: '#/components/schemas/DurableMessageStatus' + delivered_at: + type: string + format: date-time + nullable: true + description: When the execution received the message. Null until then, and for `out` messages. + sent_at: + type: string + format: date-time required: - - token_id + - id + - execution_id + - direction + - seq - name - - token_prefix - - days - - daily - - total_requests - ProjectAccessTokenUsageDailyEntry: + - data + - sender + - status + - delivered_at + - sent_at + DurableMessageList: type: object properties: - day: - type: string - format: date - description: UTC day. - requests: - type: integer - format: int64 + data: + type: array + description: Messages after `after`, oldest first. + items: + $ref: '#/components/schemas/DurableMessage' + has_more: + type: boolean + description: | + Whether more messages follow. Read them with `after` set to the + last message's `seq`. required: - - day - - requests - Function: + - data + - has_more + DurableMessageWait: type: object + description: A wait an execution has open for a message. properties: id: type: string format: uuid - project_id: - type: string - format: uuid name: type: string - maxLength: 63 - pattern: ^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$ status: - type: string - enum: - - provisioning - - active - - failed - - deleting - provisioning_started_at: + $ref: '#/components/schemas/DurableMessageWaitStatus' + expires_at: type: string format: date-time - description: Timestamp when the current provisioning phase started - visibility: - $ref: '#/components/schemas/FunctionVisibility' - is_public: - type: boolean - deprecated: true - description: Deprecated. `true` exactly when `visibility` is `public`. - invocation_mode: - $ref: '#/components/schemas/FunctionInvocationMode' - http_auth_mode: - $ref: '#/components/schemas/FunctionHTTPAuthMode' - openapi_spec: - type: object nullable: true - additionalProperties: true - description: Optional OpenAPI 3.0 or 3.1 document describing an HTTP-mode function. - has_openapi_spec: - type: boolean - description: Whether OpenAPI metadata is configured; list responses omit the document itself. - invoke_url: + description: When the wait times out. Null when the workflow set no timeout. + created_at: type: string - 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: + format: date-time + required: + - id + - name + - status + - expires_at + - created_at + DurableMessageWaitList: + type: object + properties: + data: type: array + description: Open waits, oldest first. items: - type: string - description: Regions where this function is currently deployed - runtime: - type: string - handler: - type: string - current_deployment_id: - type: string - format: uuid - description: Identifier of the latest function deployment operation - pending_deployment_id: + $ref: '#/components/schemas/DurableMessageWait' + required: + - data + SendDurableMessageRequest: + type: object + properties: + name: + $ref: '#/components/schemas/DurableMessageName' + data: + x-go-type: json.RawMessage + x-go-type-skip-optional-pointer: true + nullable: true + description: Any JSON value, up to 64 KiB. Omitted means null. + required: + - name + additionalProperties: false + RegisterDurableMessageWaitRequest: + type: object + properties: + execution_ref: type: string - format: uuid - description: Newest queued deployment that will run after the current operation - last_invoked_at: + minLength: 1 + maxLength: 2048 + description: Opaque reference to the running execution, supplied by the SDK. + callback_id: type: string - format: date-time - description: Most recent successful invocation timestamp - created_at: + minLength: 1 + maxLength: 1024 + description: Opaque wait reference, supplied by the SDK. + name: + $ref: '#/components/schemas/DurableMessageName' + required: + - execution_ref + - callback_id + - name + additionalProperties: false + DurableMessageWaitRegistration: + type: object + description: The registered wait, as the waiting workflow sees it. + properties: + id: type: string - format: date-time - updated_at: + format: uuid + status: + $ref: '#/components/schemas/DurableMessageWaitStatus' + expires_at: type: string format: date-time + nullable: true required: - id - - project_id - - name - status - - visibility - - is_public - - invocation_mode - - http_auth_mode - - openapi_spec - - has_openapi_spec - - deployed_regions - - created_at - - updated_at - DurableFunction: + - expires_at + OpenDurableMessageSessionRequest: + type: object + properties: + execution_ref: + type: string + minLength: 1 + maxLength: 2048 + description: Opaque reference to the running execution, supplied by the SDK. + callback_id: + type: string + minLength: 1 + maxLength: 1024 + description: Opaque session reference, supplied by the SDK. + required: + - execution_ref + - callback_id + additionalProperties: false + DurableMessageSessionRegistration: type: object description: | - A durable function. Separate from `Function` because a durable function - is invoked only through its own execution endpoints, so it has no - invocation mode, HTTP auth mode, OpenAPI document or invoke URL, and it - carries a `durable` configuration that a standard function has no field - for. + The registered session. Its token reaches the workflow through the + workflow itself, never in this response. properties: id: type: string format: uuid - project_id: + required: + - id + PublishDurableMessageRequest: + type: object + properties: + name: + $ref: '#/components/schemas/DurableMessageName' + data: + x-go-type: json.RawMessage + x-go-type-skip-optional-pointer: true + nullable: true + description: Any JSON value, up to 64 KiB. Omitted means null. + required: + - name + additionalProperties: false + RegisterDurableCallbackRequest: + type: object + properties: + execution_ref: type: string - format: uuid + minLength: 1 + maxLength: 2048 + description: Opaque reference to the running execution, supplied by the SDK. + callback_id: + type: string + minLength: 1 + maxLength: 1024 + description: Opaque reference to the waiting step, supplied by the SDK. name: type: string - maxLength: 63 - pattern: ^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$ - status: + minLength: 1 + maxLength: 237 + pattern: ^[ -~]+$ + description: The waiting step's name, up to 237 printable ASCII characters. + operation_id: type: string - enum: - - provisioning - - active - - failed - - deleting - provisioning_started_at: + minLength: 1 + maxLength: 64 + pattern: ^[0-9a-f]+$ + description: | + The operation an earlier run of the workflow opened the waiting step + under, supplied by the SDK when a replay registers it. Volcano then + looks for the step further back in the execution's history than a + first registration reads. + required: + - execution_ref + - callback_id + - name + additionalProperties: false + DurableCallbackRegistration: + type: object + description: The token for the waiting step, as the workflow receives it. + properties: + token: + $ref: '#/components/schemas/DurableCallbackToken' + expires_at: type: string format: date-time - description: Timestamp when the current provisioning phase started - visibility: - allOf: - - $ref: '#/components/schemas/FunctionVisibility' + nullable: true description: | - Who may start executions of this function through - `POST /durable-functions/{functionId}/executions`: service keys at - every level, signed-in users of the project from `authenticated`, - and anon keys holding `functions.invoke` only at `public`. Reading - and stopping an execution always require the project owner's - token, whatever this is set to. - - Set it when the function is deployed. Durable functions have no - update endpoint, so changing visibility later means redeploying. - - A durable function is startable, never invocable: it is not - reachable through `POST /functions/{functionId}/invoke` or a - function URL, which answer `404` at every level. - is_public: - type: boolean - deprecated: true - description: Deprecated. `true` exactly when `visibility` is `public`. - durable: - $ref: '#/components/schemas/DurableFunctionConfig' - deployed_regions: - type: array - items: - type: string - description: Regions where this function is currently deployed - runtime: - type: string - handler: + When the waiting step's `timeout` passes and the token stops + working. Null when the workflow set no `timeout`. A step with a + heartbeat timeout also ends once that long passes without a + heartbeat, which can be before this time. + required: + - token + - expires_at + SucceedDurableCallbackRequest: + type: object + properties: + token: + $ref: '#/components/schemas/DurableCallbackToken' + result: + x-go-type: json.RawMessage + x-go-type-skip-optional-pointer: true + description: | + Any JSON value other than null, up to 64 KiB. The waiting step + resolves with it. Null is refused because a timeout resolves the + step with null. + required: + - token + - result + additionalProperties: false + FailDurableCallbackRequest: + type: object + properties: + token: + $ref: '#/components/schemas/DurableCallbackToken' + error: + $ref: '#/components/schemas/DurableCallbackError' + required: + - token + - error + additionalProperties: false + HeartbeatDurableCallbackRequest: + type: object + properties: + token: + $ref: '#/components/schemas/DurableCallbackToken' + required: + - token + additionalProperties: false + DurableCallbackOutcome: + type: object + properties: + status: + $ref: '#/components/schemas/DurableCallbackStatus' + required: + - status + Issue: + type: object + description: Runtime errors from one function or frontend, grouped by error type and stack, one LavaFlow Code Quality finding, failed builds of one function or frontend with the same first error, a user-reported project problem, or an issue a person wrote. A report or a written issue has a project resource, zero runtime occurrences, and the time it was made as its first and last seen times. + properties: + id: type: string - current_deployment_id: + format: uuid + initial_run_id: type: string format: uuid - description: Identifier of the latest deployment operation - pending_deployment_id: + description: The queued run returned when creating an issue with a start key. + project_id: type: string format: uuid - description: Newest queued deployment that will run after the current operation - last_invoked_at: + resource: + $ref: '#/components/schemas/ResourceReference' + title: type: string - format: date-time - description: Most recent successful invocation timestamp - created_at: + description: | + The error type and message, with values such as IDs, numbers, and + URLs replaced by placeholders like `` and ``. + error_type: type: string - format: date-time - updated_at: + description: The exception class, such as `TypeError`. Omitted when the error has none. + culprit: type: string - format: date-time - required: - - id - - project_id - - name - - status - - visibility - - is_public - - durable - - deployed_regions - - created_at - - updated_at - DurableFunctionConfig: - type: object - description: | - Execution limits the function was created with, derived from the - project's plan. Fixed for the life of the function: changing them means - creating a new one. - - The memory the function runs at, and the timeout on one attempt within - an execution, also come from the plan but are not reported here: they - are applied to the deployed function rather than recorded on it. Both - are published per plan in the plans and limits guide. - properties: - execution_timeout_seconds: - type: integer - format: int64 + description: The innermost frame of your code in the stack, as `function (file)`. For a frontend's Next.js build output, the outermost route or page file of the build in the stack, such as `.next/server/app/checkout/route.js`, or without one, the outermost file of the build. For a minified file of a function's own bundle, the file alone. Omitted without a stack. + status: + $ref: '#/components/schemas/IssueStatus' + source: + allOf: + - $ref: '#/components/schemas/IssueSource' + description: Where the issue came from. A `code_quality` issue's `error_type` is the finding's rule, its `culprit` the enclosing function and file, and its `event_count` the scans that found it. A `build` issue's `title` is the build's first error, its `error_type` the tool's code, such as `TS2322` or `Type error`, its `culprit` the error's `file:line`, its `event_count` the failed deploys, and its `last_deployment_id` the latest of them. + finding: + allOf: + - $ref: '#/components/schemas/IssueFinding' + description: The finding behind a `code_quality` issue. Absent on a `runtime` issue. + description: + type: string + description: What the person who wrote a `request` issue asked for, as they wrote it, trimmed. Omitted for every other source. + exception: + type: boolean description: | - How long a whole execution may run, including time suspended in a - wait. This is not a limit on one attempt: an execution outlives any - single attempt by checkpointing and resuming, and the per-attempt - timeout is the plan's own, smaller number. - retention_days: + Whether the issue holds an exception: one your code threw, or one it + logged with `console.error(err)` or Python's `logger.exception()`. + `false` for an error logged any other way, such as a structured log + line, a logger's error line, or a printed traceback, and for every + `code_quality` issue. `true` for every `build` issue: a failed build + stops its deploy as an exception stops a request. Once `true`, it + stays `true`. + event_count: type: integer format: int64 - description: | - How long a finished execution's result and history are retained, for - as long as the function exists. Deleting the function, or its - project, ends retention early and takes the history with it. - required: - - execution_timeout_seconds - - retention_days - DurableExecution: - type: object - properties: - id: + description: Errors counted in this issue. A retried delivery can count an error twice. + first_seen_at: type: string - format: uuid - function_id: + format: date-time + last_seen_at: + type: string + format: date-time + last_region: + type: string + description: The region that served the latest error, such as `us-east-1`. + last_deployment_id: type: string format: uuid - name: + description: 'For a `build` issue, the latest deployment that failed in its build step. Omitted for every other issue: runtime errors are not tied to a deployment.' + sample_event_id: type: string - description: | - Idempotency key for the execution. Supplied by the client through - `X-Volcano-Execution-Name`, otherwise generated. - status: - $ref: '#/components/schemas/DurableExecutionStatus' - region: + description: The ID of the latest error's log event, while logs retain it. + sample_event_at: type: string - description: | - Region the execution runs in. An execution is pinned to one region - for its whole life because its checkpoints live there. - result: - description: | - Whatever the function returned, verbatim. Absent while the execution - is still running, absent when the result was too large to return and - was checkpointed instead, and absent once the retention period has - lapsed. - result_expired: - type: boolean - description: | - `true` when the execution is terminal but its result is no longer - retained, which distinguishes a discarded result from an empty one. - Shortly after that the execution itself is dropped and reads answer - `404`. - - A result that was checkpointed rather than returned leaves this - unset, so it reads like a function that returned nothing. - error: - $ref: '#/components/schemas/DurableExecutionError' - created_at: + format: date-time + description: When the latest error's log event was written. + resolved_at: type: string format: date-time - completed_at: + description: When the issue was resolved. Present only while it is resolved. + regressed_at: type: string format: date-time - description: Present once the execution has reached a terminal status. - client_token: + description: When a resolved issue was last seen again and reopened. + created_at: type: string - description: | - Lets a browser read and send the execution's messages. Returned only - by the start whose input the execution runs, never by a repeat under - the same name or by a read. Send it as `X-Volcano-Client-Token`. + format: date-time + updated_at: + type: string + format: date-time required: - id - - function_id - - name + - project_id + - resource + - title - status - - region + - source + - exception + - event_count + - first_seen_at + - last_seen_at - created_at - DurableExecutionStatus: + - updated_at + IssueStatus: type: string enum: - - pending - - running - - succeeded - - failed - - timed_out - - stopped - - unknown + - open + - resolved + - ignored description: | - Lifecycle state of an execution. `pending` covers the window between the - platform reserving the execution name and the function accepting the - start, and has no counterpart once the execution is under way. - `succeeded`, `failed`, `timed_out`, `stopped` and `unknown` are - terminal. - - `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. - properties: - type: - type: string - message: - type: string - DurableExecutionOperationList: + `open` until someone resolves or ignores the issue. A resolved issue + seen again reopens. A reported problem resolves when its LavaFlow fix + merges. Volcano ignores one whose report it deleted before any fix + merged, so it no longer counts toward the project's open issues. + IssueSource: + type: string + enum: + - runtime + - code_quality + - build + - report + - request + description: 'Where the issue came from: `runtime` for errors your code logged, `code_quality` for a LavaFlow Code Quality finding in code a deploy changed, `build` for deploys of one function or frontend that failed in its own build step, `report` for a problem reported for the project, such as through Slack, or `request` for an issue a person wrote with `POST /issues`. A later deploy that builds resolves a `build` issue. Deploys Volcano failed, such as a timeout or a refused build, never make one.' + PaginatedIssues: type: object - description: A durable execution's trace. properties: data: type: array - description: | - Every operation the execution began. The execution itself comes - first and is the only operation without a `parent_id`; the rest - follow in the order they started. - items: - $ref: '#/components/schemas/DurableExecutionOperation' - invocations: - type: array - description: | - When the function's code was running, oldest first. An execution - suspended in a wait holds no runtime, so the gaps between these are - not charged as compute. items: - $ref: '#/components/schemas/DurableExecutionInvocation' - complete: + $ref: '#/components/schemas/Issue' + limit: + type: integer + description: Number of items per page + has_more: type: boolean - description: | - `true` once the execution has finished and nothing more will be - recorded. Its operations no longer change, and it is no longer - refreshed on read; a final invocation window can still be added - shortly after. - synced_at: + description: Whether a next page exists + next_cursor: type: string - format: date-time - description: | - When the trace was last refreshed. Absent before it has been - refreshed at all. A running execution's trace is usually within - about ten seconds of the execution, and further behind when many - executions are being watched at once. + description: Opaque cursor for the next page (present if has_more is true) required: - data - - invocations - - complete - DurableExecutionOperation: + - limit + - has_more + CreateIssueRequest: type: object - description: One operation on an execution's timeline. + additionalProperties: false + description: The project, and an issue a person writes on it, describing what to fix. properties: - id: - type: string - description: Identifies the operation within its execution. - parent_id: + start_run_idempotency_key: type: string - description: | - The operation this one ran inside: a child context, map item or - parallel branch, or the execution itself for top-level work. Absent - only on the execution. - name: + format: uuid + description: Queue a LavaFlow run with the issue. Reuse this key when retrying the same submission. + project_id: type: string - description: | - The name the handler gave the operation. Map items and parallel - branches the handler did not name carry the SDK's positional name, - such as `map-item-0`. Absent for an unnamed operation. - type: + format: uuid + description: The project to write the issue on. + description: type: string - enum: - - execution - - step - - wait - - callback - - context - - chained_invoke - description: The kind of checkpointed operation Volcano recorded. - kind: + minLength: 1 + maxLength: 4000 + description: What to fix, in your words, up to 4,000 characters. It can span lines. Leading and trailing whitespace is trimmed, and a description of only whitespace is refused. + title: type: string - enum: - - execution - - step - - wait - - wait_until - - callback - - child - - map - - map_item - - parallel - - parallel_branch - - invoke - description: | - The operation as the handler wrote it: `ctx.step` is `step`, - `ctx.wait` is `wait`, `ctx.waitUntil` is `wait_until`, `ctx.child` - is `child`, `ctx.map` is `map` with one `map_item` per item, and - `ctx.parallel` is `parallel` with one `parallel_branch` per branch. + minLength: 1 + maxLength: 200 + description: A title, on one line, up to 200 characters; whitespace, line breaks included, collapses to single spaces. Omitted, the title is the description's first line, cut to 80 characters with an ellipsis. + required: + - project_id + - description + UpdateIssueRequest: + type: object + additionalProperties: false + properties: status: + $ref: '#/components/schemas/IssueStatus' + required: + - status + LavaflowAutonomy: + type: string + enum: + - diagnose_only + - open_pr + - merge + description: How far LavaFlow goes on its own. `diagnose_only` stops at a diagnosis. `open_pr` also opens a pull request with a fix, and never merges it. `merge` also merges the fix once LavaFlow's reviewers pass it, its required checks pass, and nothing holds it; a held fix is handed to you for good. LavaFlow merges only into a base branch that requires at least one status check, through branch protection or a ruleset; on any other branch it holds every fix with `no_required_checks`. Turning on merge lets LavaFlow's fixes, including those from runs it starts on its own, run your CI with the secrets your pull request workflows get. Choosing `merge` needs the project's `lavaflow.merge` capability. + LavaflowMergePolicy: + type: object + description: 'Your rules for fixes LavaFlow must never merge. They apply with `autonomy: merge`; at another autonomy they are saved and do nothing.' + properties: + human_review_paths: + type: array + maxItems: 50 + items: + type: string + minLength: 1 + maxLength: 200 + description: 'Globs of paths whose change LavaFlow never merges: a fix that changes one is held and handed to you. Paths are relative to the repository root, such as `db/migrations/**`. `*` and `?` match within one directory, `**/` spans any number of directories, and a final `**` matches the rest. A pattern that starts with `/`, `./` or `../`, ends with `/`, holds an empty, `.` or `..` segment, or holds a NUL character answers `400`. Volcano''s own held paths, such as deploy configuration and authentication code, are always held too. Defaults to none.' + required: + - human_review_paths + LavaflowMergePolicyUpdate: + type: object + additionalProperties: false + minProperties: 1 + description: 'The merge policy fields to change. An omitted field keeps its saved value. Send `human_review_paths: []` to clear the paths.' + properties: + human_review_paths: + type: array + maxItems: 50 + items: + type: string + minLength: 1 + maxLength: 200 + LavaflowMergeStatus: + type: string + enum: + - waiting_for_checks + - waiting_for_approval + - queued + - merged + - held + - stopped + description: '`waiting_for_checks`: LavaFlow waits for the checks on the fix''s commit. A pending status published by a GitHub user is advisory when LavaFlow verifies that the pull request and base branch do not require it. `waiting_for_approval`: checks passed and GitHub still requires an approving review. LavaFlow keeps watching and merges or queues the fix once GitHub reports required reviews satisfied and checks still pass. A new or dismissed approval is noticed on the next read, normally within five minutes initially, slowing to at most one hour for unattended waits older than a day. This wait does not consume the CI timeout. `queued`: the fix is in the repository''s merge queue. `merged`: the pull request merged. `held`: something in `hold_reasons` needs a person. LavaFlow commented on the pull request once and never merges, pushes to, rebases or dequeues it again; review it and merge it yourself if you want it. A fix a person merges (its autonomy is `open_pr`, merging was unavailable when it opened, or its run may only open a pull request) is always `held` for `person_merges` once LavaFlow has started its CI, or found it may not. `stopped`: LavaFlow left the pull request open for you, for `reason`.' + LavaflowMergeReason: + type: string + description: 'Why the merge stopped, or what a waiting merge is paused for. A stopped merge leaves the pull request open for you, and LavaFlow never merges, pushes to, rebases or dequeues it again; unless a reason says otherwise, review the change, then merge or close the pull request yourself. `review_unresolved`: LavaFlow''s review didn''t pass the fix; the run''s `review` says why. `checks_failed`: a check on the fix failed. In Merge mode LavaFlow can retry a required GitHub Actions timeout once and revise an eligible failed check on the same pull request. The reviewed replacement must pass fresh checks. `checks_timed_out`: the checks didn''t all finish within 24 hours. `blocked_by_rules`: a rule of the repository that LavaFlow can''t satisfy blocks the merge. `not_mergeable`: GitHub can''t merge the pull request, for example because it conflicts with its base branch. `branch_behind`: the base moved after review and LavaFlow needs a current base for this merge. In Merge mode LavaFlow can review a replacement against the current base and run checks again on the same pull request. `removed_from_queue`: the fix left the merge queue. LavaFlow can retry once when GitHub confirms a merge-group check failure and the pull request head still passes CI. `reads_failed`: LavaFlow failed to read the pull request for about an hour while waiting for required approval or while the fix may have been queued, so it took the fix out of the merge queue when applicable and reachable, and stopped, or failed to read the project''s settings or repository for about a day while merging was paused. For a fix a person merges, which LavaFlow never queues, it means only the latter, with its CI start paused instead of merging. `handed_off`: someone drafted or closed the pull request, or moved it to another branch, so LavaFlow stopped; nothing to do. `unreadable`: the pull request has more checks, reviews, labels or commits than LavaFlow reads, so it can''t judge the fix. `permission_missing`: the Volcano GitHub App, or the project owner''s GitHub account, lacks a permission the merge needs; grant the App''s requested permissions and make sure the owner can push. `repository_changed`: the project now deploys from another repository. `settings_changed`: the project''s settings no longer let LavaFlow merge, or, for a fix a person merges, start its CI: LavaFlow was turned off, `autonomy` is no longer `merge` (no longer `open_pr` or `merge` for a fix a person merges), the owner''s plan no longer includes LavaFlow or Code Quality for this run, Code Quality was disabled for a Code Quality fix, or the project is being deleted. `request_rejected`: GitHub refused LavaFlow''s request to start the checks on the fix. `ci_start_commit_mismatch`: GitHub reports a different commit from the one LavaFlow made to start the checks. `branch_refused`: LavaFlow didn''t start the fix''s checks because the pull request was no longer open, or its branch isn''t a LavaFlow branch of a pull request LavaFlow opened; LavaFlow never starts checks on the default or production branch. `head_unverified`: GitHub doesn''t report the fix''s head as the signed commit LavaFlow pushed, so LavaFlow didn''t start its checks. `checks_not_started`: LavaFlow couldn''t give the fix a commit message that runs CI. `queue_carries_ci_skip`: the repository''s merge queue could carry an instruction to skip checks, from the fix''s commits or its pull request''s title or description, into the base branch; reword LavaFlow''s commit to drop it and force-push, and take any such instruction out of the title and description, before you queue the fix. `merge_carries_ci_skip`: merging would carry an instruction to skip checks into the base branch, for example because the repository allows no squash merge; reword LavaFlow''s commit to drop it and force-push before you merge. After `request_rejected`, `ci_start_commit_mismatch` or `checks_not_started`, the fix''s CI didn''t start: push a commit to its branch to run it. `paused_too_long`: merging stayed paused for more than 7 days, or, for a fix a person merges, LavaFlow''s CI start for such fixes did. `cancelled`: the project is being deleted, so LavaFlow stopped waiting on the merge; nothing to do. `paused`: merging is paused, and the merge waits. LavaFlow takes a queued fix out of the merge queue, so it shows `waiting_for_checks`, and queues it again when merging resumes. For a fix a person merges, LavaFlow''s CI start for such fixes is paused instead, whatever merging does, and LavaFlow never takes it out of a queue. New reasons may appear.' + LavaflowHoldReason: + type: object + description: One reason LavaFlow holds the fix for a person. + properties: + code: type: string - enum: - - running - - waiting - - retrying - - succeeded - - failed - - cancelled - - timed_out - - stopped - - unknown - description: | - Where the operation stands. `waiting` holds no runtime: a wait that - has not elapsed, or a `waitUntil` between checks. `retrying` is a step whose last attempt failed and - whose next one is scheduled at `next_attempt_at`. Work still open - when the execution ended is `cancelled` at the moment it ended. - `unknown` is only ever the execution itself, when its outcome was - lost with its history, as in the execution's own `unknown` status. - started_at: - type: string - format: date-time - ended_at: - type: string - format: date-time - description: Present once the operation has ended. - scheduled_end_at: - type: string - format: date-time - description: When a wait is due to elapse. - next_attempt_at: + description: 'Why the fix is held. `client_reported_commit`: the fix''s deployed source could not be independently verified. `report_admission_lost`: LavaFlow could no longer verify the report''s base or merge authorization. `path`: it changes a path in `human_review_paths`, or deploy or infrastructure configuration Volcano always holds, such as `volcano-config.yaml`, Terraform files, a YAML or JSON file that declares a resource, a YAML template that mentions `apiVersion` or `kind`, a file in a Helm chart or Kustomize directory, or, in a repository too large to read in full, any file no other path reason holds. `sensitive_path`: it changes another path Volcano always holds: authentication or authorization code, Next.js middleware included; secret, key, certificate or cryptography files; a coding agent''s instructions or settings, or Git hook configuration; CI configuration; a dependency manifest or lockfile, or a `package.json` change to what installs or its install scripts; or runtime, container or other configuration files. `label`: the pull request has the `needs-human-review` label. `no_checks`: no CI ran on it. `required_check_skipped`: a required check was skipped. `no_required_checks`: the base branch requires no check, so passing checks alone don''t vouch for the fix. `changes_requested`: a reviewer requested changes. `repository_requires_approval`: a legacy run was handed off because the repository required an approving review. That final hold stays final; new merge watches use `waiting_for_approval` instead. `person_commits`: someone other than LavaFlow pushed to the fix''s branch. `rules_bypass`: the Volcano GitHub App can bypass a ruleset on the base branch. `unchecked_rules`: the base branch has a rule LavaFlow doesn''t check, such as required signatures. On a fix a person merges it names only rules that kept LavaFlow from starting the fix''s CI, such as `code_scanning` or `workflows`, or that LavaFlow couldn''t read them. `commit_convention`: no title can meet the repository''s commit convention. `ungated_workflows`: the fix opened past workflows that can run it with the repository''s secrets before a person approves it, as the project''s owner allowed, or LavaFlow couldn''t check its workflows, or, when LavaFlow was about to start its CI or add it to a merge queue, a workflow could run it with those secrets before a person approves it or couldn''t be read, so LavaFlow takes it no further and never merges it. A fix held for another reason before its CI starts lists it too when that check, run without starting CI, finds such a workflow or can''t finish. `ci_outside_actions`: when LavaFlow was about to start the fix''s CI, the repository could run CI, a build or a preview outside GitHub Actions: the root of the fix''s tree or its base branch''s holds another service''s configuration, such as `.travis.yml`, `.circleci/` or `netlify.toml`, which `paths` names, another app reported checks or statuses on the base branch, or LavaFlow couldn''t read them in full. LavaFlow starts CI only when it finds no sign of CI outside GitHub Actions, so it never starts this fix''s CI or merges it. `lineage_undoes_parent`: the fix follows up an earlier LavaFlow fix and deletes or changes lines that fix added, which could undo it. `lineage_cap`: the fix''s lineage opened as many pull requests as it may. `lineage_held`: an earlier pull request in the fix''s lineage was held, stopped or closed; one a person merges holds it only when closed. `recent_regressions`: fixes LavaFlow merged in the project recently caused new errors. `no_test`: the fix changes code the repository tests and adds no test, because testing it needs test infrastructure the repository doesn''t have or the change has no effect a test can observe. `choices_to_confirm`: the review did not clear every stated choice and did not record a more specific review question. The run lists the choices and private pull requests include them under Choices to confirm. This reason applies when LavaFlow was asked to merge the fix. `risky_change`: the fix adds or removes a line that converts a value, such as with `float()` or `parseInt()`, in a file that names a rate limit or quota, authentication or authorization, or money, so values such as NaN, Infinity or a negative number could get past a check there; `paths` names the files. `review_notes`: LavaFlow''s reviewers passed the fix, but its review''s last round left notes, findings below `major` that a later round no longer sends back for revision, such as a decision the fix makes without stating it. `person_merges`: a person reviews and merges the fix, because the project''s autonomy is `open_pr`, merging was unavailable when it opened, or its run may only open a pull request; LavaFlow ran the fix''s CI once first unless another reason, or the CI start''s own checks, stopped it. Other codes name a concern LavaFlow''s reviewers raised. New codes may appear.' + question: type: string - format: date-time - description: | - When a step's next attempt, or a `waitUntil`'s next check, is due. - Present only while one is scheduled. - attempts: + description: 'Why LavaFlow holds the fix and what to check before you merge it, in one or two sentences to show as given. A reviewer''s reason is a question for you to answer. Reads `Hidden: this field matched a secret.` when it holds one of the project''s secret values or a secret gitleaks detects, or when one of its `paths` reads `""`. Every question reads `Hidden: the fix may add a credential.`, LavaFlow''s fixed sentences too, on a run whose `pull_request_skipped` is `possible_credential`.' + paths: type: array - description: | - Each run of a step's body, in order. Present on steps and - `waitUntil` polls, where each check is an attempt. items: - $ref: '#/components/schemas/DurableExecutionOperationAttempt' - error: - $ref: '#/components/schemas/DurableExecutionError' + type: string + description: The changed paths that matched, for a path code. For `ci_outside_actions`, the entries at the repository's root that another CI or preview service reads, whether or not the fix changes them. `""` for a path that holds a control character, one of the project's secret values or a secret gitleaks detects. required: - - id - - type - - kind - - status - - started_at - DurableExecutionOperationAttempt: + - code + - question + - paths + LavaflowMerge: type: object - description: One run of a step's body. + description: 'Where the run''s merge stands. Present for a run that may merge its fix, once its pull request opens, and for a run whose fix a person merges (its autonomy is `open_pr`, merging was unavailable when it opened, or the run may only open a pull request) that opened ready for review: LavaFlow starts that fix''s CI once, then holds it for `person_merges` and never merges it.' properties: - attempt: - type: integer - minimum: 1 - description: The attempt's number, starting at 1. status: - type: string - enum: - - running - - succeeded - - failed - description: | - How the attempt ended. A `waitUntil` check whose condition did not - hold yet is `succeeded`: the check ran, and the poll continues. - started_at: - type: string - format: date-time - ended_at: - type: string - format: date-time - description: Present once the attempt has ended. - error: - $ref: '#/components/schemas/DurableExecutionError' + $ref: '#/components/schemas/LavaflowMergeStatus' + reason: + allOf: + - $ref: '#/components/schemas/LavaflowMergeReason' + nullable: true + hold_reasons: + type: array + items: + $ref: '#/components/schemas/LavaflowHoldReason' + description: Why LavaFlow holds the fix. Empty unless `status` is `held`. + merged_by_lavaflow: + type: boolean + nullable: true + description: 'Whether LavaFlow made the merge: `true` when it merged the fix''s commit itself or through the merge queue, `false` when someone else merged the pull request while LavaFlow waited. `null` unless `status` is `merged`.' required: - - attempt - status - - started_at - DurableExecutionInvocation: + - reason + - hold_reasons + - merged_by_lavaflow + LavaflowInvolvedResource: type: object - description: A window in which the function's code was running. + description: A resource a run involves, and how. properties: - started_at: - type: string - format: date-time - ended_at: - type: string - format: date-time + resource: + $ref: '#/components/schemas/LavaflowResourceReference' + roles: + type: array + minItems: 1 + items: + type: string + enum: + - issue + - cause + - fix + description: '`issue`: the issue came from it. `cause`: the issue came from it, or code the diagnosis cites as evidence is in its source. `fix`: the diagnosis proposes changing its source, or the fix changes it; a change to code that every function shares involves every function.' required: - - started_at - - ended_at - FunctionInvocationMode: - type: string - enum: - - rpc - - http - description: | - Invocation contract. `rpc` preserves the existing POST `{payload: ...}` contract; - `http` forwards HTTP request semantics to the function runtime. - FunctionHTTPAuthMode: - type: string - enum: - - volcano - - none - description: | - Authentication applied by the HTTP ingress. `none` is valid only for - HTTP-mode functions with `visibility: public` and is intended for - externally signed webhooks. - FunctionVisibility: - type: string - enum: - - private - - authenticated - - public - x-enum-varnames: - - FunctionVisibilityPrivate - - FunctionVisibilityAuthenticated - - FunctionVisibilityPublic - description: | - Who can invoke the function. Each level admits everything the one - before it does. - - `private`: service keys and the project's schedulers only. The - default for a new function. To any other credential the function - does not exist: it answers 404, like a missing one. - - `authenticated`: also any signed-in user of the project, including - anonymous sign-ins. The function receives their auth context. - - `public`: also anon keys holding `functions.invoke`, and Frontend - Function routes, which forward requests without a credential. - FunctionDeployment: + - resource + - roles + LavaflowIssueSummary: type: object + description: The project issue a run works on. properties: id: type: string format: uuid - function_id: - type: string - format: uuid - project_id: - type: string - format: uuid - batch_id: + title: type: string - format: uuid - operation: + description: 'The issue''s title: the error type and message, a Code Quality finding''s title, or a reported problem''s title.' + culprit: type: string - enum: - - deploy - - update - - delete + nullable: true + description: The innermost frame of your code, as `function (file)`; for a Code Quality finding, the symbol and file it is in, as `symbol (file)`, or the file alone; for a failed build, its first error's `file:line`. Null for an error without a stack and for a reported problem. status: + $ref: '#/components/schemas/IssueStatus' + source: + $ref: '#/components/schemas/IssueSource' + severity: type: string enum: - - queued - - provisioning - - active - - failed - - superseded - - deleting - - deleted - deploy_source: - type: string - enum: - - git - - cli - - web - - api - - system - - unknown - description: What initiated this deployment. - initiated_by: - type: string - description: Platform user that triggered a request-initiated deployment; absent for git and system deployments. - build_duration_seconds: + - nit + - minor + - major + - critical + x-enum-varnames: + - LavaflowIssueSeverityNit + - LavaflowIssueSeverityMinor + - LavaflowIssueSeverityMajor + - LavaflowIssueSeverityCritical + description: The confirmed Code Quality finding's recorded severity. Omitted for other issue sources and when no canonical severity is known; absence does not mean the issue has low severity. + event_count: type: integer format: int64 - description: Total build time recorded for this deployment, in seconds. - build_count: - type: integer - description: Number of completed builds included in build_duration_seconds. - build_duration_recorded_at: + description: Errors the issue has grouped so far; for a Code Quality finding, the scans that saw it; for a failed build, the failed deploys; 0 for a reported problem. + last_seen_at: type: string format: date-time - description: When the build time was last recorded. - progress: - $ref: '#/components/schemas/DeploymentProgress' - error_message: - type: string - completed_at: + resolved_at: type: string format: date-time - created_at: + nullable: true + description: When the issue was resolved; null unless it is resolved now. + regressed_at: type: string format: date-time + nullable: true + description: When the issue was last seen again after it was resolved, and reopened; null if it never was. + run_count: + type: integer + format: int64 + description: LavaFlow runs on this issue, this one included. + required: + - id + - title + - culprit + - status + - event_count + - last_seen_at + - resolved_at + - regressed_at + - run_count + LavaflowSettings: + type: object + description: A project's LavaFlow settings. LavaFlow sends this project's logs and source code to an AI service that Volcano operates. + properties: + project_id: + type: string + format: uuid + description: The project the settings belong to. + enabled: + type: boolean + description: Whether LavaFlow works on the project's issues. Off by default. + autonomy: + $ref: '#/components/schemas/LavaflowAutonomy' + merge_policy: + $ref: '#/components/schemas/LavaflowMergePolicy' + code_quality: + $ref: '#/components/schemas/LavaflowCodeQualitySettings' + allow_ungated_workflows: + type: boolean + description: The owner's repository-bound permission for LavaFlow fixes to run workflows with the repository's configured credentials before human review. Normal repository CI requires this permission in addition to the lavaflow.repository_ci capability. Off by default; without permission, the existing guarded workflow policy applies and a fix may be held instead of opening a pull request. Only the project's owner, signed in with a live login credential or an expiring platform token, can grant permission for a repository their GitHub account can push to. Changing or disconnecting the repository, or changing its GitHub App installation, clears the permission. A rename with the same repository and installation IDs retains it. Reconnecting an earlier binding does not restore a revoked grant. Workflows may run generated code influenced by issue and log input, with their configured credentials, before review. This includes draft PRs, fixes whose LavaFlow review did not pass, and fixes held for a person to review. In Merge mode, eligible fixes from connected issue sources can use this grant while LavaFlow takes the reviewed pull request through the repository's required checks and approvals. Revocation stops later unrestricted publication writes; existing PRs and CI runs remain. updated_at: type: string format: date-time + nullable: true + description: When the settings were last saved, or last changed by connecting a repository. Null until they first are. + updated_by: + type: string + nullable: true + description: The user ID of the person who made the last save; null when no person made it, such as a project access token. + can_update: + type: boolean + description: 'Whether the caller can save the settings: true only for the project''s owner with a platform token while the owner''s account is active; false for any project access token and for a read-only account.' + repository: + allOf: + - $ref: '#/components/schemas/ProjectGitConnectionSummary' + nullable: true + description: The GitHub repository the project is linked to, as `GET /projects/{id}/git-connection` reports it. LavaFlow opens fix pull requests there, against `production_branch`. Null when the project has none. + fix_blocker: + allOf: + - $ref: '#/components/schemas/LavaflowFailure' + nullable: true + description: 'What in the project''s repository setup stops LavaFlow from fixing issues although it is on. Null when the repository setup doesn''t, and while the project''s `lavaflow` capability isn''t available; null doesn''t mean nothing else stops LavaFlow. `message` is text to show as given. `repository_required`: the project has no linked repository. With `autonomy` `open_pr` or `merge`, LavaFlow diagnoses issues but fixes none; turned on for a repository the project no longer links, it starts no runs. Link a repository with `PUT /projects/{id}/git-connection` or `volcano git connect `. Turned on with none, LavaFlow fixes issues in the first one linked, unless `message` asks to turn it on again after the link; linking the one it was turned on for resumes it. `repository_changed`: the project is linked to a repository LavaFlow wasn''t turned on for. LavaFlow starts no runs until the owner turns it on again, with `{"enabled": true}` or `volcano cloud lavaflow enable`, which makes the linked repository the one it fixes. New codes may appear; show the `message` of one you don''t know.' required: - - id - - function_id - project_id - - operation - - status - - deploy_source - - created_at + - enabled + - autonomy + - merge_policy + - code_quality + - allow_ungated_workflows - updated_at - FunctionInvocationRequest: + - updated_by + - can_update + - repository + - fix_blocker + LavaflowSettingsUpdate: type: object + additionalProperties: false + minProperties: 2 + description: The project, and at least one field to change. An omitted field keeps its saved value. A repository precondition alone is not a setting change. + not: + required: + - expected_repository + maxProperties: 2 properties: - payload: - type: object - additionalProperties: true - description: | - Payload to send to the function. - - If invoked with auth user token, Volcano automatically injects `__volcano_auth` context: - ```javascript - { - ...yourPayload, - __volcano_auth: { - user_id: "uuid", - email: "user@example.com", - project_id: "uuid", - role: "authenticated" | "anonymous" - } - } - ``` - - The top-level `__volcano_auth` and `__volcano_http` keys are reserved; - Volcano removes caller-supplied values for both. - FunctionInvocationResponse: - type: object - description: Raw function response body returned by the invoked function. - additionalProperties: true - LogActivityBucket: + project_id: + type: string + format: uuid + description: The project whose settings to change. + enabled: + type: boolean + autonomy: + $ref: '#/components/schemas/LavaflowAutonomy' + merge_policy: + $ref: '#/components/schemas/LavaflowMergePolicyUpdate' + code_quality: + $ref: '#/components/schemas/LavaflowCodeQualityUpdate' + expected_repository: + allOf: + - $ref: '#/components/schemas/LavaflowRepositoryExpectation' + description: Optional assertion of the repository and installation the caller reviewed. Checked under the settings save's transaction lock, including when permission is already on. A mismatch returns `409 repository_changed` and changes nothing; review the current connection before sending a new request. Omit it when revoking permission. Without it, existing callers authorize the connection current during the save. + allow_ungated_workflows: + type: boolean + description: 'Grants or revokes repository CI permission for the current repository and GitHub App installation. Normal repository CI requires both this permission and lavaflow.repository_ci availability. Only the project owner can grant it, using a live login credential or an expiring platform token; their GitHub account must have push access to the connected repository. Project tokens, non-expiring platform tokens, and other users cannot grant it (403 person_required). Any owner credential can revoke it. Generated fixes may be influenced by untrusted issue and log input, and configured CI and previews may execute those fixes with their credentials before human review. This includes draft PRs, fixes whose LavaFlow review did not pass, and fixes held for a person to review. In Merge mode, eligible fixes from connected issue sources can use this grant while LavaFlow follows them through the repository''s required reviews and checks. Changing or disconnecting the repository or installation revokes the grant; returning to an earlier binding does not restore it. Revocation does not cancel existing PRs or CI runs. While LavaFlow is unavailable, only false is saved, together with enabled: false.' + required: + - project_id + LavaflowRunCreate: type: object - description: Log-event counts for one activity time bucket. The first and last buckets can extend past the requested window; they count only events inside it. + additionalProperties: false + description: The project, and the issue to start a run on. properties: - start_time: + project_id: type: string - format: date-time - description: Bucket start time, inclusive. - end_time: + format: uuid + description: The project the issue belongs to. + issue_id: + type: string + format: uuid + description: The issue to start a run on. + after_run_id: type: string - format: date-time - description: Bucket end time, exclusive. - counts: - type: object - description: Counts grouped by activity dimension. - properties: - levels: - type: object - additionalProperties: - type: integer - description: Counts by normalized log level. - regions: - type: object - additionalProperties: - type: integer - description: Counts by event region. - resource_ids: - type: object - additionalProperties: - type: integer - description: Counts by resource ID. - required: - - levels - - regions - - resource_ids - total: - type: integer - description: Total events in this bucket. + format: uuid + description: The preceding run on a written issue. If a later run already exists, return that run. required: - - start_time - - end_time - - counts - - total - LogActivityRequest: + - project_id + - issue_id + LavaflowHeldFixOpen: type: object - description: Activity request for bucketed log counts. additionalProperties: false + description: The project, the run, and the diff and jobs of the held fix you read, by the digests the run served them with. properties: - resource: - $ref: '#/components/schemas/LogRequestResource' - q: + project_id: type: string - maxLength: 512 - description: Optional activity query. Supports quoted text, implicit AND, AND/OR/NOT, parentheses, and fields such as `level`, `region`, `invocation.id`, `resource.id`, `resource.name`, `function`, `frontend`, `database`, and `body`. - start_time: + format: uuid + description: The project the run belongs to. + run_id: type: string - format: date-time - description: Start of the window, inclusive. Defaults to 24 hours before `end_time`. - end_time: + format: uuid + description: The run whose held fix to open. + diff_sha256: type: string - format: date-time - description: End of the window, exclusive. Defaults to now. - bucket_count: + pattern: ^[0-9a-f]{64}$ + description: The run's `diff_sha256`, as it served it. + example: 9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08 + jobs_sha256: + type: string + pattern: ^[0-9a-f]{64}$ + description: The run's `held_workflows.jobs_sha256`, as it served it. + example: 2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae + required: + - project_id + - run_id + - diff_sha256 + - jobs_sha256 + LavaflowDayCounts: + type: object + properties: + date: + type: string + format: date + issues_opened: type: integer - minimum: 1 - maximum: 96 - description: Maximum number of buckets. Defaults to 24. Volcano picks the smallest bucket width from 1s, 2s, 5s, 10s, 15s, 30s, 1m, 2m, 5m, 10m, 15m, 30m, 1h, 2h, 3h, 6h, 12h, 1d, or a whole number of days that covers the window in at most this many buckets. Bucket edges fall on UTC multiples of the width, so they stay fixed as the window moves, and the response can contain fewer buckets. `1` returns one bucket that spans exactly the window. + format: int64 + description: Issues LavaFlow took on that UTC day. + pull_requests_opened: + type: integer + format: int64 + description: Pull requests with a fix LavaFlow opened that UTC day. required: - - resource - LogActivityResponse: + - date + - issues_opened + - pull_requests_opened + LavaflowStats: type: object - description: Bucketed runtime log activity. properties: - data: + project_id: + type: string + format: uuid + description: The project the counts are for. + window_start: + type: string + format: date + description: The first UTC day in the window. + window_end: + type: string + format: date + description: The last UTC day in the window, today. + days: type: array + description: One entry per UTC day, oldest first, zeros included. items: - $ref: '#/components/schemas/LogActivityBucket' - total: - type: integer - description: Total events counted across all buckets. + $ref: '#/components/schemas/LavaflowDayCounts' + outcomes: + $ref: '#/components/schemas/LavaflowOutcomes' + delivery: + $ref: '#/components/schemas/LavaflowDeliveryStats' + totals: + type: object + properties: + issues_opened: + type: integer + format: int64 + pull_requests_opened: + type: integer + format: int64 + required: + - issues_opened + - pull_requests_opened required: - - data - - total - LogSearchRequest: + - project_id + - window_start + - window_end + - days + - totals + LavaflowResourceReference: type: object - description: Search request for project logs. - additionalProperties: false + description: A function, durable function or frontend in the project, or the project of a user-reported problem. properties: - resource: - $ref: '#/components/schemas/LogRequestResource' - q: + type: type: string - maxLength: 512 - description: Optional log query. Supports quoted text, implicit AND, AND/OR/NOT, parentheses, and fields such as `level`, `region`, `invocation.id`, `resource.id`, `resource.name`, `function`, `frontend`, `database`, and `body`. - start_time: + enum: + - function + - durable_function + - frontend + - project + id: type: string - format: date-time - description: Start time. - end_time: + format: uuid + name: type: string - format: date-time - description: End time. - limit: - type: integer - minimum: 1 - maximum: 1000 - default: 100 - description: Maximum number of records to return. - cursor: + required: + - type + - id + - name + LavaflowAnomaly: + type: object + properties: + flagged: + type: boolean + reason: type: string - description: Opaque pagination cursor from the previous response's `next_cursor`. + nullable: true + description: Why the resource is flagged, null when it is not. required: - - resource - LogStreamRequest: + - flagged + - reason + LavaflowResource: type: object - description: Stream request for live project logs. Pagination cursors and fixed end times are not supported. - additionalProperties: false properties: - resource: - $ref: '#/components/schemas/LogRequestResource' - q: + project_id: type: string - maxLength: 512 - description: Optional log query using the same syntax as search and activity requests. - start_time: + format: uuid + description: The project the resource belongs to. + resource: + $ref: '#/components/schemas/LavaflowResourceReference' + last_analyzed_at: type: string format: date-time - description: Start time. - limit: + nullable: true + description: When a LavaFlow run last started on the resource, null if never. + issues_opened: type: integer - minimum: 1 - maximum: 1000 - default: 100 - description: Maximum number of records to deliver on connect or reconnect before following new events. + format: int64 + description: Issues LavaFlow took on in the window. + pull_requests_opened: + type: integer + format: int64 + description: Pull requests with a fix LavaFlow opened in the window. + anomaly: + $ref: '#/components/schemas/LavaflowAnomaly' required: + - project_id - resource - LogSearchEvent: - allOf: - - $ref: '#/components/schemas/LogEvent' - - type: object - description: Runtime log event returned by project log search. Search results always include a stable event ID and owning resource. - properties: - id: - type: string - description: Opaque stable log event ID for pagination, deduplication, and display. - resource: - $ref: '#/components/schemas/LogResource' - required: - - id - - resource - LogSearchResponse: + - last_analyzed_at + - issues_opened + - pull_requests_opened + - anomaly + LavaflowResourceList: type: object - description: Paginated project runtime log search response. properties: data: type: array items: - $ref: '#/components/schemas/LogSearchEvent' - description: Array of log events sorted by timestamp, newest first. - limit: - type: integer - description: Number of items requested per page. - has_more: - type: boolean - description: Whether the search may have more matching log events. A page can hold fewer than `limit` events, or none, while this is true; keep paging until it is false. - next_cursor: - type: string - description: Opaque cursor for the next page, present while `has_more` is true. Send this value as `cursor` on the next request, even when `data` is empty. + $ref: '#/components/schemas/LavaflowResource' required: - data - - limit - - has_more - FunctionRegion: + LavaflowRunStatus: + type: string + enum: + - queued + - diagnosing + - fixing + - reviewing + - pr_open + - completed + - failed + - cancelled + description: Where a run is. `diagnosing`, `fixing` and `reviewing` are the stages of a running run. `pr_open` means its pull request is open; `completed` means it finished, with no pull request or one that was merged or closed. + LavaflowPullRequest: type: object - required: - - code - - label - - flag properties: - code: + number: + type: integer + format: int64 + url: type: string - example: us-east-1 - description: Region identifier accepted by function APIs. - label: + format: uri + branch: type: string - example: NA-East - description: Human-readable region label suitable for display in pickers. - flag: + description: The recorded pull request branch. Omitted when it was not recorded, the run's fix is withheld because it may add a credential, or the branch name holds one of the project's secret values or a secret gitleaks detects. It is never shortened. + state: type: string - example: 🇺🇸 - description: Country flag emoji associated with the region's geography. - FunctionRuntimeOption: - type: object - required: - - name - - label - - language - - default - - durable_capable - - deployment - properties: - name: + enum: + - open + - merged + - closed + x-enum-varnames: + - LavaflowPullRequestStateOpen + - LavaflowPullRequestStateMerged + - LavaflowPullRequestStateClosed + opened_at: type: string - example: nodejs24.x - description: Runtime identifier accepted by function APIs. - label: + format: date-time + nullable: true + description: When the run opened the pull request, null for one opened before LavaFlow recorded the time. + merged_at: type: string - example: Node.js 24 - description: Human-readable runtime label suitable for display in pickers. - language: + format: date-time + nullable: true + description: When the pull request merged; null unless `state` is `merged`. + deployed_at: type: string - example: nodejs - description: Runtime language family used by the CLI to choose defaults from source files. - default: - type: boolean - description: Whether this runtime is the CLI default for its language. - durable_capable: - type: boolean - description: Whether a durable function can be authored on this runtime. Only runtimes with a durable authoring API report true, and a durable deploy naming any other runtime is rejected. - deployment: - $ref: '#/components/schemas/FunctionRuntimeDeployment' - FunctionRuntimesResponse: - type: object - required: - - runtimes - properties: - runtimes: - type: array - items: - $ref: '#/components/schemas/FunctionRuntimeOption' - FunctionKindFilter: + format: date-time + nullable: true + description: 'When the merged fix went live: the first live deployment of the issue''s resource that includes it finished. When more than 20 deployments went live between the merge and the one LavaFlow found the fix in, LavaFlow can''t tell which first included it, and this is the merge time. Null until LavaFlow finds the fix live, and for a pull request that didn''t merge. A later live deployment can be verified even more than a week after the merge. Unverifiable or exhausted evidence remains unknown.' + draft: + type: boolean + nullable: true + description: Whether the pull request is a draft, as GitHub last reported it to LavaFlow. Null for one opened before LavaFlow recorded it. + draft_reason: + allOf: + - $ref: '#/components/schemas/LavaflowDraftReason' + nullable: true + description: Why a finished run's pull request is a draft. Null while the run is still reviewing its initial draft, or when `draft` is not true. + required: + - number + - url + - state + - opened_at + - merged_at + - deployed_at + - draft + - draft_reason + LavaflowRunMode: type: string enum: - - standard - - durable - description: | - A function kind to filter a list by. Unlike `FunctionKind` it has no - default: omitting the filter includes both kinds. + - live + - code_quality + description: 'What the run works on: `live` for an issue seen in the project''s logs, `code_quality` for a Code Quality finding.' + LavaflowRunCategory: + type: string + enum: + - bug + - performance + - security + - improvement + - configuration + - dependency + - external + description: 'What kind of problem the run works on. `bug`: the project''s code is wrong. `performance`: the code is too slow or uses too much. `security`: the code exposes data or access it shouldn''t. `improvement`: the code mishandles an edge case or an outside failure, or, for a reported problem''s run, its reporter asked for new content or functionality (`diagnosis.requested`). `configuration`: a setting, variable or manifest value is wrong or missing. `dependency`: a package or its version causes it. `external`: a service outside the project fails and no repository change is right. A Code Quality run''s is its finding''s, `bug` or `improvement`. Any other run''s is `dependency` or `configuration` for a fix that changes only such files, else the kind its diagnosis names. New values may appear; treat an unknown value as uncategorized.' + LavaflowDraftReason: + type: string + enum: + - open_pr + - review_unresolved + - converted_to_draft x-enum-varnames: - - FunctionKindFilterStandard - - FunctionKindFilterDurable - FunctionScheduler: + - LavaflowDraftReasonOpenPr + - LavaflowDraftReasonReviewUnresolved + - LavaflowDraftReasonConvertedToDraft + description: 'Why a run''s pull request is a draft. `open_pr`: LavaFlow doesn''t merge the fix, because the project''s autonomy is `open_pr`, merging was unavailable when it opened, or the run may only open a pull request, and its review didn''t pass, LavaFlow''s CI start for fixes a person merges wasn''t available when it opened, or the repository may run CI or previews outside GitHub Actions (or LavaFlow couldn''t check whether it does) when it opened; or it was already a draft when the run took it on. It waits for a person to review it and mark it ready. `review_unresolved`: LavaFlow''s review didn''t pass the fix, so LavaFlow never merges it; a person decides whether to finish it. `converted_to_draft`: LavaFlow opened it ready for review, and someone made it a draft since.' + LavaflowSkipReason: + type: string + enum: + - diagnose_only + - not_fixable + - low_confidence + - no_patch + - possible_credential + - possible_personal_data + - ungated_workflows + - convention_unsatisfiable + - pull_request_open + - source_unavailable + - permission_missing + - repository_changed + - publish_failed + - draft_unavailable + - lineage_cap + - lineage_held + - review_unresolved + - duplicate_in_repository + - security_finding + x-enum-varnames: + - LavaflowSkipReasonDiagnoseOnly + - LavaflowSkipReasonNotFixable + - LavaflowSkipReasonLowConfidence + - LavaflowSkipReasonNoPatch + - LavaflowSkipReasonPossibleCredential + - LavaflowSkipReasonPossiblePersonalData + - LavaflowSkipReasonUngatedWorkflows + - LavaflowSkipReasonConventionUnsatisfiable + - LavaflowSkipReasonPullRequestOpen + - LavaflowSkipReasonSourceUnavailable + - LavaflowSkipReasonPermissionMissing + - LavaflowSkipReasonRepositoryChanged + - LavaflowSkipReasonPublishFailed + - LavaflowSkipReasonDraftUnavailable + - LavaflowSkipReasonLineageCap + - LavaflowSkipReasonLineageHeld + - LavaflowSkipReasonReviewUnresolved + - LavaflowSkipReasonDuplicateInRepository + - LavaflowSkipReasonSecurityFinding + description: 'Why a finished run opened no pull request, with what you can do next. `diagnose_only`: the project''s `autonomy` was `diagnose_only` when the run was queued, or became it before the pull request opened, so LavaFlow only diagnosed the issue; read the diagnosis. For later runs to open pull requests, send `"autonomy": "open_pr"` to `PATCH /lavaflow/settings`, or run `volcano cloud lavaflow settings set --autonomy open_pr`. `not_fixable`: the diagnosis found no change in the code that fixes the error, for example because the cause is outside it; read the diagnosis. `low_confidence`: the diagnosis is not confident enough to propose a fix; read the diagnosis. `no_patch`: LavaFlow proposed no change; read the diagnosis. `possible_credential`: the fix held what looks like a credential or a project secret, so LavaFlow pushed nothing; apply the fix yourself from the diagnosis. `possible_personal_data`: the fix adds an email address the repository lacks, and the repository isn''t private, so LavaFlow pushed nothing; apply the fix yourself. `ungated_workflows`: on the earlier publication path or under automatic merging, a workflow could run the fix with the repository''s secrets before a person approves it; gate the workflow on a label a person adds, or turn on `allow_ungated_workflows`. `convention_unsatisfiable`: LavaFlow would merge the fix, but no title can meet the repository''s commit convention, so it kept the fix on the run; apply the fix yourself, or relax the convention. `pull_request_open`: when the run checked, before opening a pull request, another LavaFlow pull request for the issue was open, or merged and not yet deployed, so this run opened none; a fix it wrote stays on the run. That pull request may have closed since; find it with `GET /lavaflow/runs?project_id=…&issue_id=…`, whose runs carry their `pull_request`. Review it, or close it if you don''t want it. `source_unavailable`: LavaFlow couldn''t read, or open a fix on, the code that served the error; the run''s `source_unavailable` says why and what to do. `permission_missing`: the Volcano GitHub App, or the project owner''s GitHub account, lacks a permission LavaFlow needs; grant the App''s requested permissions and make sure the owner can push to the repository. `repository_changed`: the project no longer deploys from the repository the run read; a new run uses the current one. `publish_failed`: opening the pull request failed; a new run tries again. `draft_unavailable`: GitHub refused a draft required for a proposal with outstanding external work. Check that the base branch exists and that the repository supports draft pull requests before trying again. `lineage_cap`: LavaFlow opened as many pull requests in this fix''s lineage as it may; review the lineage''s pull requests and fix the rest yourself. `lineage_held`: an earlier pull request in this fix''s lineage was held, stopped or closed (one a person merges holds it only when closed), so LavaFlow opens no more in it; apply the fix yourself from the diagnosis. `review_unresolved`: LavaFlow''s review didn''t pass a Code Quality fix; read the diagnosis. `duplicate_in_repository`: when the run checked, another project on the repository already had the Code Quality pull request for the same finding; review that pull request in the repository. `security_finding`: the finding has security impact and the repository isn''t private, so the fix would disclose it; fix it yourself. New reasons may appear.' + LavaflowRunSummary: type: object properties: id: @@ -22234,1089 +33964,1404 @@ components: project_id: type: string format: uuid - function_id: + description: The project the run belongs to. + status: + $ref: '#/components/schemas/LavaflowRunStatus' + resource: + $ref: '#/components/schemas/LavaflowResourceReference' + issue_id: type: string format: uuid - function_kind: - allOf: - - $ref: '#/components/schemas/FunctionKind' - description: | - Which collection the scheduled function belongs to. A project-wide - scheduler list mixes both kinds, and this is what says whether the - function is read back from `/projects/{id}/functions` or - `/projects/{id}/durable-functions` — and whether a tick invokes it - or starts a durable execution. - name: - type: string - enabled: - type: boolean - schedule_kind: + title: type: string - enum: - - cron - cron_expression: + nullable: true + description: 'Names the problem the run worked on, in at most 80 characters: its diagnosis'' title, else the title of the fix it proposed, else the first line or sentence of its diagnosis'' summary. A sentence too long for a title ends at its last clause that fits, or, with none, is cut at a word and ends with `…`. Null while none is known. Reads `Hidden: this field matched a secret.` when it or the text it comes from holds one of the project''s secret values or a secret gitleaks detects.' + fix_summary: type: string - payload: - type: object - additionalProperties: true - regions: - type: array - items: - type: string - regions_explicit: - type: boolean - next_run_at: + maxLength: 80 + description: 'The saved proposed fix''s title, on one line of at most 80 characters. This describes a proposal, not a verified fix, successful review, merge or deployment. It never falls back to the diagnosis. Omitted when no saved patch title is known. Reads `Hidden: this field matched a secret.` when the full title or the shortened one holds one of the project''s secret values or a secret gitleaks detects, and `Hidden: the fix may add a credential.` when the fix is held for one. A shortened value ends with `…`.' + created_at: type: string format: date-time - last_started_at: + finished_at: type: string format: date-time - last_completed_at: + nullable: true + pull_request: + allOf: + - $ref: '#/components/schemas/LavaflowPullRequest' + nullable: true + merge: + allOf: + - $ref: '#/components/schemas/LavaflowMerge' + nullable: true + mode: + $ref: '#/components/schemas/LavaflowRunMode' + category: + allOf: + - $ref: '#/components/schemas/LavaflowRunCategory' + nullable: true + description: A Code Quality run carries its finding's from the start. Any other run's is null until LavaFlow records a diagnosis. Runs from before categories get one when their diagnosis names one or their saved fix's paths imply one, and stay null only when neither does. + resources: + type: array + description: 'Every resource the run involves: the issue''s first, then by name. A run without a recorded diagnosis lists only the issue''s. For a run whose report came from what it saved rather than its source, such as one from before involved resources were recorded, the list may leave out frontends and the functions involved through shared code or the build root''s dependency files.' + items: + $ref: '#/components/schemas/LavaflowInvolvedResource' + issue: + allOf: + - $ref: '#/components/schemas/LavaflowIssueSummary' + nullable: true + description: Null only for a run that works on no issue. + progress: + allOf: + - $ref: '#/components/schemas/LavaflowRunProgress' + nullable: true + description: Where a run LavaFlow is still working on stands; null once it has nothing left to do. + delivery: + $ref: '#/components/schemas/LavaflowDelivery' + pull_request_skipped: + allOf: + - $ref: '#/components/schemas/LavaflowSkipReason' + nullable: true + description: Why a finished run opened no pull request. A `completed` run without `pull_request` always has one; it is `diagnose_only` when the project's `autonomy` stopped the run at its diagnosis. Null when the run opened a pull request, while it is queued or runs, and when it failed or was cancelled. + lineage: + allOf: + - $ref: '#/components/schemas/LavaflowLineage' + nullable: true + description: The fix lineage the run belongs to. Null for a run in no lineage. + fix_outcome: + allOf: + - $ref: '#/components/schemas/LavaflowFixOutcome' + nullable: true + description: How the run's merged fix fared once it went live. Null until a merged fix goes live with the `lavaflow.lineage` capability on. Also null, meaning unknown, when the fix is first found live only after its 14-day watch ended and its issue neither resolved as of go-live nor was last seen inside the watch. + required: + - id + - project_id + - status + - resource + - issue_id + - title + - created_at + - finished_at + - pull_request + - merge + - mode + - category + - resources + - issue + - progress + - pull_request_skipped + - lineage + - fix_outcome + LavaflowLogLine: + type: object + properties: + timestamp: type: string format: date-time - last_error: - type: string - run_count: - type: integer - format: int64 - description: Total number of times this scheduler has executed. 0 for a scheduler that has never run. - created_at: + nullable: true + level: type: string - format: date-time - updated_at: + message: type: string - format: date-time - FunctionSchedulerListResponse: + required: + - timestamp + - level + - message + LavaflowDiagnosis: type: object + description: 'Each text reads `Hidden: this field matched a secret.` in place of all of it when it holds one of the project''s secret values or a secret gitleaks'' default rules detect; the other texts are served as written. A log line''s `level` reads `""` then.' properties: - data: + summary: + type: string + root_cause: + type: string + evidence: type: array items: - $ref: '#/components/schemas/FunctionScheduler' - page: - type: integer - limit: + type: string + log_lines: + type: array + description: Empty for now. `evidence` cites the log lines the diagnosis relies on. + items: + $ref: '#/components/schemas/LavaflowLogLine' + requested: + type: boolean + description: Whether the run makes a change its report's reporter asked for in their own words, such as new content or functionality, rather than fixing a defect. Only a reported problem's run can set it, and only from what the person who mentioned LavaFlow wrote. + required: + - summary + - root_cause + - evidence + - log_lines + - requested + LavaflowReview: + type: object + properties: + verdict: + type: string + enum: + - passed + - changes_requested + - blocked + - error + description: The last review round's verdict. `blocked` means a critical or major finding stops the fix; `changes_requested` means only minor findings do; `error` means a reviewer failed without a blocking finding, or no reviewer could run. + rounds: type: integer - total: + description: The review rounds that ran, 0 when no reviewer could run. + stopped: + allOf: + - $ref: '#/components/schemas/LavaflowReviewStop' + nullable: true + description: Why the review ended without passing the fix, null when it passed the fix or when the run saved no fix. + open_findings: + type: array + x-go-type-skip-optional-pointer: true + items: + $ref: '#/components/schemas/LavaflowReviewFinding' + description: 'The findings the review saved with the fix left open. When the review passed the fix, the notes its last round left: findings below `major` that a later round no longer sends back, which hold a fix under `autonomy: merge` with `review_notes`. Absent when the review left none open, or the run saved no fix.' + person_reasons: + type: array + x-go-type-skip-optional-pointer: true + items: + $ref: '#/components/schemas/LavaflowReviewPersonReason' + description: What the review saved with the fix asks a person to decide before the fix merges. Absent when it asks nothing or the run saved no fix. + observations: + type: array + x-go-type-skip-optional-pointer: true + items: + type: string + description: 'The reviewers'' observations on the fix saved with the run: follow-ups that don''t hold the fix, such as bad data stored before it or a related problem elsewhere. They aren''t findings, unlike a minor finding that blocks nothing. Each reads `Hidden: this field matched a secret.` when it holds one of the project''s secret values or a secret gitleaks detects, and `Hidden: the fix may add a credential.` when the run is held with `possible_credential`. Absent when there are none or the run saved no fix.' + required: + - verdict + - rounds + - stopped + LavaflowReviewFinding: + type: object + description: 'A finding the review left open, in the reviewer''s words. `explanation` reads `Hidden: this field matched a secret.` when it holds one of the project''s secret values or a secret gitleaks detects, or when `file` reads `""`, and `Hidden: the fix may add a credential.` when the run is held with `possible_credential`.' + properties: + severity: + type: string + enum: + - nit + - minor + - major + - critical + x-enum-varnames: + - LavaflowReviewFindingSeverityNit + - LavaflowReviewFindingSeverityMinor + - LavaflowReviewFindingSeverityMajor + - LavaflowReviewFindingSeverityCritical + file: + type: string + nullable: true + description: The file the finding is about, null when it is about no file. `""` when the path holds a control character, one of the project's secret values or a secret gitleaks detects. + line: type: integer - has_more: - type: boolean - next_cursor: + nullable: true + description: The line of `file` the finding is about, null when it is about no one line. + explanation: type: string - description: Opaque cursor for the next page (cursor pagination only; present if has_more is true) - prev_cursor: + required: + - severity + - file + - line + - explanation + LavaflowReviewPersonReason: + type: object + description: 'One decision the review leaves to a person. `question` reads `Hidden: this field matched a secret.` when it holds one of the project''s secret values or a secret gitleaks detects, and `Hidden: the fix may add a credential.` when the run is held with `possible_credential`.' + properties: + kind: type: string - description: Opaque cursor for the previous page (cursor pagination only; present when a previous page exists). Send as `ending_before`. + description: '`irreversible`: merging the fix itself does what a revert can''t undo, such as deleting or migrating stored data. `trust_boundary`: it changes authentication, authorization, secrets, who can reach what, or rate limits, quotas or other abuse controls, including whether they fail open. `breaks_contract`: it removes or renames an existing field, status, event, or accepted input that other code or users rely on, or changes what one means, or it newly rejects a request the code could serve before it, or input it served even when its documentation marks that input invalid, with a client error, validation error, or limit, or drops or skips records the code handled. `billing`: it touches payments, pricing, metering, or charges. `unexplained`: it changes behavior that neither the diagnosis nor the fix''s stated choices justify, and that the code doesn''t support. `not_reviewable`: it couldn''t be reviewed closely. New kinds may appear.' + question: + type: string + description: What the person decides, written to show as given. required: - - data - - page - - limit - - total - - has_more - HostedAuthPageType: + - kind + - question + LavaflowReviewStop: type: string enum: - - login - - signup - - forgot-password - - device - - verify-email - - reset-password - HostedLoginEmailCheckRequest: + - rounds + - no_revision + - budget_exhausted + - context_limit + - timed_out + - reviewers_failed + - too_few_reviewers + - unreadable + x-enum-varnames: + - LavaflowReviewStopRounds + - LavaflowReviewStopNoRevision + - LavaflowReviewStopBudgetExhausted + - LavaflowReviewStopContextLimit + - LavaflowReviewStopTimedOut + - LavaflowReviewStopReviewersFailed + - LavaflowReviewStopTooFewReviewers + - LavaflowReviewStopUnreadable + description: 'Why a run''s review ended without passing its fix. `rounds`: the last review round still found problems. `no_revision`: LavaFlow gave no revised fix. `budget_exhausted`: the run used its token budget before LavaFlow could revise the fix; this is the run''s own budget, not the project''s daily spend limit. `context_limit`: the fix''s conversation grew too long for the model before LavaFlow could revise it. `timed_out`: the run''s time for review ran out. `reviewers_failed`: no reviewer of the last round finished. `too_few_reviewers`: fewer reviewers could run than a round needs to pass the fix. `unreadable`: a retried run could not read the review saved with its fix, so a person must review it. More values may be added: treat a value you don''t know as other.' + LavaflowFailure: + type: object + properties: + code: + type: string + description: 'Stable code, such as `timed_out` or `feature_paused`. `lavaflow_allowance_exhausted`: the run was canceled before it asked a model anything, because the project owner''s plan stops at its allowance of LavaFlow runs and the owner used it this billing cycle. A queued run waits with `free_spend_limit` while LavaFlow''s daily spend limit for the owner''s plan is reached.' + message: + type: string + description: Text to show for the code. + required: + - code + - message + LavaflowRepositoryChecks: + type: object + description: Whether LavaFlow ran the repository's own checks, such as its tests, on a fix itself, before it opened a pull request or held the fix, and what they found. When LavaFlow ran them more than once, this is the last time the run's last attempt ran them; `not_run` when that attempt didn't, or while the run is queued or running. CI that runs on the pull request afterwards is the repository's own. + properties: + status: + type: string + description: '`passed`: every command the checks ran passed. `failed`: a command failed or timed out; `commands` shows which. `no_checks_found`: LavaFlow found no checks in the repository to run. `not_run`: LavaFlow did not run the repository''s checks on the fix, for the reason `reason` names. Treat a status you don''t know as `not_run`.' + reason: + type: string + description: 'Stable code for why the checks did not run, present only when `status` is `not_run`. `dependencies_changed`: the fix changes the repository''s dependencies. `dependencies_not_installed`: LavaFlow couldn''t install the repository''s dependencies. `run_deadline`: the run reached its time limit. `sandbox_capacity`: no sandbox slot was free in time to run them. `sandbox_budget`: LavaFlow''s sandbox allowance for checks was used up. `sandbox_not_isolated`: LavaFlow couldn''t confirm the sandbox was isolated. `sandbox_plan_limit`: LavaFlow couldn''t start a sandbox large enough to run them. `sandbox_unavailable`: LavaFlow couldn''t run them itself. `source_too_large`: the repository is too large to copy into a sandbox. `source_unavailable`: LavaFlow couldn''t fetch the fix''s source to check it, as when the repository was disconnected or changed during the run. `tool_unavailable`: a tool the checks need isn''t available. New reasons may appear; treat one you don''t know like any other `not_run`.' + message: + type: string + description: 'Text to show for the status and reason. It names the pull request when one opened. For `not_run` on a fix whose pull request opened, a second sentence says what became of the repository''s CI there, as the run stands when read: whether LavaFlow started it, tried to, may still, or won''t.' + revised: + type: boolean + x-go-type-skip-optional-pointer: true + description: Present and `true` only when `status` is `failed` and LavaFlow then revised the fix once without running the checks again. `status` and `commands` describe that earlier version, not the fix as saved, which the checks never ran on. + commands: + type: array + x-go-type-skip-optional-pointer: true + items: + $ref: '#/components/schemas/LavaflowRepositoryCheckCommand' + description: The commands the checks ran, in order. Absent when LavaFlow recorded none, as for `no_checks_found` and `not_run`. + required: + - status + - message + LavaflowRepositoryCheckCommand: type: object + description: 'One command the repository''s checks ran. `command` and `output` are the repository''s own text, served as LavaFlow recorded it. Each reads `Hidden: this field matched a secret.` when it holds one of the project''s secret values or a secret gitleaks detects, and `Hidden: the fix may add a credential.` when the run is held with `possible_credential`.' + properties: + command: + type: string + description: The command as LavaFlow ran it. + status: + type: string + description: '`passed`: the command succeeded. `failed`: it exited with an error. `timed_out`: it ran past its time limit, and LavaFlow stopped it. Treat a status you don''t know as `failed`.' + exit_code: + type: integer + nullable: true + description: The code the command exited with, null when it gave none, as a command that timed out may not. + output: + type: string + description: The end of what the command printed, present only when `status` is `failed` or `timed_out` and LavaFlow kept it; `""` when it printed nothing. + required: + - command + - status + - exit_code + LavaflowRun: + allOf: + - $ref: '#/components/schemas/LavaflowRunSummary' + - type: object + properties: + source_commit: + allOf: + - $ref: '#/components/schemas/LavaflowSourceCommit' + nullable: true + description: The commit the run read the code at. Null when it read none, as for a run that diagnosed from the logs alone. + diagnosis: + allOf: + - $ref: '#/components/schemas/LavaflowDiagnosis' + nullable: true + diff: + type: string + nullable: true + description: The fix LavaFlow saved, as the unified diff its reviewers read, cut short past 256 KiB as they read it, with a last line that starts with `[diff truncated`. When a file's changes hold one of the project's secret values or a secret gitleaks detects, every change to that file is left out, with one line in their place that starts with `# LavaFlow withheld` and names the file; an older fix also keeps the files it was saved with as withheld. A run held with `possible_credential` leaves out every file. Null for a run with no saved fix, or one saved before LavaFlow kept its diff. + diff_sha256: + type: string + nullable: true + pattern: ^[0-9a-f]{64}$ + description: The SHA-256, in hex, of `diff` exactly as served, its UTF-8 bytes. Null whenever `diff` is. + example: 9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08 + diff_truncated: + type: boolean + description: '`diff` was cut short, so it does not show the whole fix. False when `diff` is null.' + diff_withheld: + type: array + items: + type: string + description: The files whose changes `diff` leaves out, by path, as its `# LavaFlow withheld` lines name them; an empty string for a file whose path holds a secret. Empty when `diff` shows every file, or is null. + choices: + type: array + x-go-type-skip-optional-pointer: true + items: + type: string + description: 'Material behavior decisions the saved fix proposes, one plain sentence each. LavaFlow reviews these as part of the patch. An authorized implementation decision may proceed through merge with a complete review. A reviewer can ask for a specific decision, and incomplete choice review can leave `choices_to_confirm`. Each reads `Hidden: this field matched a secret.` when it holds one of the project''s secret values or a secret gitleaks detects, and `Hidden: the fix may add a credential.` when the run is held with `possible_credential`. Absent when the fix states none or the run saved no fix.' + not_fixed: + type: string + nullable: true + description: Where the saved fix says the defect starts outside its changes, such as code that writes records in the wrong shape, and why the fix leaves it, in one plain sentence. Masked as `choices` is. Null when the fix says nothing is left or the run saved no fix. + review: + allOf: + - $ref: '#/components/schemas/LavaflowReview' + nullable: true + description: The review of the run's fix. When no reviewer could run, it still says why in `stopped`. Null when no review ran. + repository_checks: + allOf: + - $ref: '#/components/schemas/LavaflowRepositoryChecks' + nullable: true + description: Whether LavaFlow ran the repository's own checks on the fix itself. Null for a run with no fix. + failure: + allOf: + - $ref: '#/components/schemas/LavaflowFailure' + nullable: true + description: Why the run stopped or waits, null when nothing went wrong. + changed_files: + type: array + items: + type: string + description: Repository paths the fix changes, sorted; empty without a fix. A path that holds a secret is listed as "", as `diff_withheld` lists it, and so is every path when `diff` can't tell the fix's files apart. A file past a truncated `diff`'s cut is listed. + ungated_workflows: + type: array + nullable: true + items: + $ref: '#/components/schemas/LavaflowAllowedWorkflow' + description: The workflow jobs the run's pull request opened past because the project's owner allowed ungated workflows, the first one on each branch or commit checked. Empty when none or when the run opened no pull request. Null when there is no record of the workflows its pull request opened past, as for pull requests opened before LavaFlow recorded them. Under the merge stage, LavaFlow holds such a fix as unchecked, with `ungated_workflows`. + lineage_evidence: + allOf: + - $ref: '#/components/schemas/LavaflowLineageEvidence' + nullable: true + description: What tied the run's issue to a recent LavaFlow fix's deploy. Null when nothing did, and for a recurrence, whose issue came back after the fix. + held_workflows: + allOf: + - $ref: '#/components/schemas/LavaflowHeldWorkflows' + nullable: true + description: For a run whose `pull_request_skipped` is `ungated_workflows`, every workflow job that held its fix. Null for any other run, and for a held run whose workflows LavaFlow couldn't read to the end, such as one with a workflow it couldn't parse, or more than 256 such jobs. + source_unavailable: + allOf: + - $ref: '#/components/schemas/LavaflowSourceUnavailable' + nullable: true + description: Why LavaFlow couldn't read, or open a fix on, the code that served the error. Available when LavaFlow records a source blocker, including `source_unavailable`, `diagnose_only`, and `repository_changed` skips and verified source reads awaiting retry. Null when no source failure reason was recorded. + required: + - source_commit + - diagnosis + - diff + - diff_sha256 + - diff_truncated + - diff_withheld + - not_fixed + - review + - repository_checks + - failure + - changed_files + - ungated_workflows + - lineage_evidence + - held_workflows + - source_unavailable + LavaflowAllowedWorkflow: + type: object + description: A workflow job that could run a fix's pull request with the repository's secrets before a person approves it. + properties: + source: + type: string + description: The branch or commit whose workflows run it. + example: main + path: + type: string + example: .github/workflows/preview.yml + job: + type: string + description: The job, absent for a workflow that could not be read. + example: deploy-preview + trigger: + type: string + description: The event that runs it, absent for a workflow that could not be read. + example: pull_request_target required: - - email + - source + - path + LavaflowHeldWorkflows: + type: object + description: Every workflow job that could run a held fix's pull request with the repository's secrets before a person approves it, as LavaFlow found them when it held the fix, and the commits it read the workflows at. properties: - email: + read_at: + type: array + items: + $ref: '#/components/schemas/LavaflowWorkflowSource' + description: 'Each branch or commit whose workflows LavaFlow read: the project''s production branch, the repository''s default branch, and the commit the fix is cut from.' + jobs: + type: array + items: + $ref: '#/components/schemas/LavaflowAllowedWorkflow' + description: Every such job, at most 256, sorted by source, path and job. Empty when LavaFlow read every workflow to the end and found none, such as when they changed between the hold and the read. + jobs_sha256: type: string - format: email - HostedLoginEmailCheckResponse: + pattern: ^[0-9a-f]{64}$ + description: 'Identifies `read_at` and `jobs` together. Treat it as opaque: it changes when a listed job, or a commit the workflows were read at, does.' + example: 2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae + required: + - read_at + - jobs + - jobs_sha256 + LavaflowWorkflowSource: type: object + description: A branch or commit whose workflows LavaFlow read, and the commit it read them at. properties: - exists: - type: boolean - HostedLoginOptionsResponse: + source: + type: string + description: The branch, or the commit SHA for a commit. + example: main + commit_sha: + type: string + description: The commit LavaFlow read the workflows at. + example: 3f786850e387550fdab836ed7e6dc881de23001b + required: + - source + - commit_sha + LavaflowSourceUnavailable: type: object + description: Why LavaFlow couldn't read, or open a fix on, the code that served a run's error. The run can still be awaiting a retry. properties: - require_email_confirmation: - type: boolean - email_password_enabled: - type: boolean - enable_signup: - type: boolean - post_auth_redirect_url: + reason: + $ref: '#/components/schemas/LavaflowSourceUnavailableReason' + deployment_id: type: string - oauth_providers: - type: array - items: - type: string - HostedRenderablePageType: + format: uuid + nullable: true + description: The deployment of the run's `resource` that served the error, for `no_commit`, `uncommitted_changes`, `unverified_commit` and `other_repository`, or for a repository read failure after LavaFlow verified the serving deployment. Null when no deployment can be identified. + example: 7c2e5a1f-3b8d-4e6a-9f0c-1d2e3f4a5b6c + required: + - reason + - deployment_id + LavaflowSourceUnavailableReason: type: string enum: - - signup - - forgot-password - - device - - verify-email - - reset-password - LogEvent: + - no_repository + - no_commit + - uncommitted_changes + - unverified_commit + - other_repository + - repository_unreadable + - repository_rate_limited + - repository_provider_unavailable + - repository_download_interrupted + - repository_access_denied + - repository_source_invalid + - commit_not_on_production_branch + - deployment_unattributed + x-enum-varnames: + - LavaflowSourceUnavailableReasonNoRepository + - LavaflowSourceUnavailableReasonNoCommit + - LavaflowSourceUnavailableReasonUncommittedChanges + - LavaflowSourceUnavailableReasonUnverifiedCommit + - LavaflowSourceUnavailableReasonOtherRepository + - LavaflowSourceUnavailableReasonRepositoryUnreadable + - LavaflowSourceUnavailableReasonRepositoryRateLimited + - LavaflowSourceUnavailableReasonRepositoryProviderUnavailable + - LavaflowSourceUnavailableReasonRepositoryDownloadInterrupted + - LavaflowSourceUnavailableReasonRepositoryAccessDenied + - LavaflowSourceUnavailableReasonRepositorySourceInvalid + - LavaflowSourceUnavailableReasonCommitNotOnProductionBranch + - LavaflowSourceUnavailableReasonDeploymentUnattributed + description: 'Why LavaFlow couldn''t read, or open a fix on, the code that served the error, with what you can do. LavaFlow reads the deployment that served the error, so once you deploy code it can read, it starts a new run when the error happens again. `no_repository`: LavaFlow is on for no repository; link one. `no_commit`: the deployment recorded no commit, nor did the build a redeploy serves, or no deployment was serving; deploy by pushing to the linked repository''s production branch, or with the CLI from a clean checkout of a commit on that branch. `uncommitted_changes`: the deployment''s files differ from its commit (`dirty: true`), as when the checkout had uncommitted changes; commit and push them, then deploy from the clean checkout. `unverified_commit`: Volcano couldn''t verify the deployment''s commit against the linked repository (`verification: none`), for example because the commit isn''t on the production branch, or the deployment is a function redeploy, which doesn''t carry its upload''s `verification: repository` commit; push the commit to the production branch and deploy it again. `other_repository`: the commit LavaFlow would read is from a repository other than the one LavaFlow is on for, Volcano checked it under an earlier repository link, or the project no longer links that repository. For a deployment, deploy again from the linked repository; for a reported problem or a Code Quality finding, start a new run while the project links the repository LavaFlow is on for. `repository_unreadable`: LavaFlow couldn''t read the repository at the commit, for example because the Volcano GitHub App lost access to it; check the project''s repository link and the App''s access. `repository_rate_limited`: GitHub throttled reads of the verified commit. `repository_provider_unavailable`: GitHub did not complete the read. `repository_download_interrupted`: the source archive could not finish downloading. For these three reasons, a queued or running retry may recover automatically. If the run has finished, check that GitHub can serve the exact commit archive before starting a new run. `repository_access_denied`: GitHub refused access to the repository or archive. Restore the project''s GitHub connection and read access to the verified commit. `repository_source_invalid`: the verified commit or its archive could not be read as valid repository source. Verify that the linked repository serves a valid archive for that commit, or deploy from a verified commit. `commit_not_on_production_branch`: the production branch no longer holds the commit the fix is on, so LavaFlow opened no pull request; deploy from the production branch. `deployment_unattributed`: a newer deployment that may have changed the code was going live when the error happened, so LavaFlow couldn''t tell which one threw it; if the error happens again, LavaFlow starts a new run once; if that run also ends `deployment_unattributed`, the next waits for a new deploy. A `deployment_unattributed` run right after another one, even one a deploy started, gets no such run. New reasons may appear.' + LavaflowIssuePrompt: type: object - description: Historical log event returned by log APIs. + required: + - version + - mode + - description + - created_at + - status properties: - id: + version: + type: integer + format: int64 + mode: type: string - description: Opaque stable log event ID for pagination, deduplication, and display. - timestamp: + enum: + - original + - replace + - follow_up + description: + type: string + author: + type: string + redacted: + type: boolean + created_at: type: string format: date-time - description: Event timestamp. - level: - $ref: '#/components/schemas/LiveLogLevel' - body: - description: Application log value. JSON arguments retain their JSON type. Strings containing a serialized JSON object or array are normalized to that object or array; all other strings remain strings. - nullable: true - oneOf: - - type: string - - type: object - additionalProperties: true - - type: array - items: {} - - type: number - format: double - - type: boolean - region: + status: type: string - description: Region where this log event originated. - resource: - $ref: '#/components/schemas/LogResource' - deployment: - $ref: '#/components/schemas/LogDeployment' - invocation_id: + enum: + - saved + - queued + - applied + - failed + - superseded + applied_at: type: string - description: Function invocation ID associated with this log event, when available. - required: - - timestamp - - body - LiveLogLevel: - type: string - enum: - - trace - - debug - - info - - warn - - error - - fatal - description: Canonical lowercase function runtime log level. - MetricUsageData: + format: date-time + run_id: + type: string + format: uuid + LavaflowIssuePrompts: type: object - description: Usage data for one metric across totals, daily, and hourly windows. + required: + - data + - version properties: - metric: - type: string - description: | - Metric name (for example, "Function & Frontend Invocations", "Frontend Requests", - "Durable Executions", "Durable Operations", "Durable Compute (MB-Seconds)", - "Build Seconds", - "Bandwidth Ingress (Bytes)", "Bandwidth Egress (Bytes)", - "Bandwidth Total (Bytes)", or "Database Storage (Bytes)"). Byte-based metrics are - reported in bytes. "Bandwidth Total (Bytes)" is derived (ingress + egress) and - is not billed separately. The three durable metrics are - counted separately from "Function & Frontend Invocations", which covers standard - invocations only. Operations and compute are counted when an execution finishes, - so they appear in the window the execution completed in rather than the one it - started in. "Durable Compute (MB-Seconds)" reports the memory the execution ran - at times the time it spent running, in megabyte-seconds; the allowance for it is - published in gigabyte-seconds, which is 1024 of these. - "Sandbox Running (MiB-Seconds)", "Sandbox Suspended (Seconds)", and - "Sandbox Uncertain (MiB-Seconds)" report cloud Sandbox usage. Running - reports configured baseline memory times confirmed runtime, not measured - CPU or elastic memory consumption. For sessions admitted after the pricing - release, confirmed running time consumes the account's runtime allowance; - SUPERAGENT overage debits credits according to the account's pricing terms. - Suspended time and uncertain usage do not consume runtime allowance or - debit credits. Uncertain includes observation gaps and unconfirmed state - transitions. Suspended reports duration, not snapshot size; snapshot costs - are included in runtime pricing. Local and platform image-validation - sessions do not contribute. Existing preview sessions remain unbilled, - and preview history is never charged retroactively. Displayed totals are - rounded down after aggregating millisecond measurements; billing uses - unrounded measurements in the monthly account billing cycle. - "Database Storage (Bytes)" is a current observed gauge, - not a cumulative counter. It is the sum of the latest samples exposed as - `storage_bytes` by the project's database list, so it includes what each - database's branches and backups hold, and it inherits that field's lag - behind a live measurement. - total: - type: integer - format: int64 - description: Total usage for the current usage month - all_time: - type: integer - format: int64 - description: Lifetime cumulative usage across every month for this metric - daily: + activity: type: array - description: Last 30 days of daily usage points items: - $ref: '#/components/schemas/UsageDataPoint' - hourly: + $ref: '#/components/schemas/LavaflowTaskActivity' + more_activity: + type: boolean + data: type: array - description: Last 24 hours of hourly usage points items: - $ref: '#/components/schemas/UsageDataPoint' + $ref: '#/components/schemas/LavaflowIssuePrompt' + version: + type: integer + format: int64 + LavaflowIssuePromptCreate: + type: object required: - - metric - - total - - all_time - - daily - - hourly - OAuthConfig: + - project_id + - issue_id + - expected_version + - mode + - description + properties: + project_id: + type: string + format: uuid + issue_id: + type: string + format: uuid + expected_version: + type: integer + format: int64 + minimum: 1 + mode: + type: string + enum: + - follow_up + description: + type: string + minLength: 1 + maxLength: 4000 + LavaflowProjectIssue: type: object + description: An issue LavaFlow has taken on, or a written request waiting for its first run. + required: + - id + - project_id + - title + - resource + - state + - activity_at properties: id: type: string format: uuid - provider: + project_id: type: string - enum: - - google - - github - - microsoft - - apple - - device - client_id: + format: uuid + title: type: string - example: 123456789.apps.googleusercontent.com - client_secret: + description: type: string - description: Masked in responses (shows only first/last 4 chars) - example: GOCS...**** - enabled: - type: boolean - redirect_url: + description: The text of a written request. + slack_thread_url: type: string format: uri - example: https://yourapp.com/auth/callback - scopes: - type: array - items: - type: string - example: - - openid - - email - - profile - created_at: + description: A link to the original Slack thread when its source record is available. + source: + $ref: '#/components/schemas/IssueSource' + resource: + $ref: '#/components/schemas/LavaflowResourceReference' + run_id: type: string - format: date-time - updated_at: + format: uuid + description: The latest run for this issue. + activity_at: type: string format: date-time - OAuthErrorResponse: - type: object - properties: - error: + latest_activity: type: string - error_description: + description: Latest action in the active run. + state: type: string - required: - - error - PaginatedAuthUsers: + enum: + - awaiting_pickup + - queued + - investigating + - fixing + - reviewing + - waiting_for_checks + - merge_queued + - waiting_for_approval + - needs_review + - failed + - cancelled + - pull_request_closed + - fix_unavailable + - diagnosis_complete + - fix_merged + - resolved + - ignored + PaginatedLavaflowProjectIssues: type: object + required: + - data properties: data: type: array items: - $ref: '#/components/schemas/AuthUser' - page: - type: integer - description: Current page number (1-indexed) - limit: - type: integer - description: Number of items per page - total: - type: integer - description: Total number of items across all pages - has_more: - type: boolean - description: Whether there are more pages available - next: + $ref: '#/components/schemas/LavaflowProjectIssue' + next_cursor: type: string - description: URL path to next page (only present if has_more is true) - required: - - data - - page - - limit - - total - - has_more - PaginatedDatabases: + description: An opaque cursor for the same project and finished filter. + realtime: + type: object + required: + - token + - channel + - expires_at + properties: + token: + type: string + description: A short-lived subscribe-only grant. + channel: + type: string + expires_at: + type: string + format: date-time + PaginatedLavaflowRuns: type: object properties: data: type: array items: - $ref: '#/components/schemas/Database' - page: - type: integer - description: Current page number (1-indexed) + $ref: '#/components/schemas/LavaflowRunSummary' limit: type: integer description: Number of items per page - total: - type: integer - description: Total number of items across all pages has_more: type: boolean - description: Whether there are more pages available - next: - type: string - description: URL path to next page (only present if has_more is true) + description: Whether a next page exists next_cursor: type: string - description: Opaque cursor for the next page (cursor pagination only; present if has_more is true) - prev_cursor: - type: string - description: Opaque cursor for the previous page (cursor pagination only; present when a previous page exists). Send as `ending_before`. + description: Opaque cursor for the next page, present if has_more is true. It works only for the same project_id, caller and order. + counts: + allOf: + - $ref: '#/components/schemas/LavaflowRunCounts' + description: Present with `include=counts`. required: - data - - page - limit - - total - has_more - PaginatedFrontendDeployments: + LavaflowRunProgress: type: object + description: 'How far an active run has come. The steps are `queued`, `diagnosing`, `fixing`, `reviewing`, `waiting_for_checks` and `merge_queued`, in that order, and a run takes as many as its autonomy when it was queued allows: 2 for `diagnose_only`, 4 for `open_pr` (opening the pull request ends it, unless LavaFlow starts the fix''s CI once, when it shows `waiting_for_checks` as step 5 until LavaFlow has), 6 for `merge` (the merge ends it). Step 5 also covers required approval: `merge.status` is `waiting_for_approval` once checks passed but a required review is missing.' properties: - data: - type: array - items: - $ref: '#/components/schemas/FrontendDeployment' - page: - type: integer - description: Current page number (1-indexed) - limit: + stage: + type: string + enum: + - queued + - diagnosing + - fixing + - reviewing + - waiting_for_checks + - merge_queued + description: New stages may appear. + step: type: integer - description: Number of items per page - total: + description: The stage's place among the run's steps, from 1. + steps: type: integer - description: Total number of items across all pages - has_more: - type: boolean - description: Whether there are more pages available - next: - type: string - description: URL path to next page (only present if has_more is true) + description: How many steps the run takes. required: - - data - - page - - limit - - total - - has_more - PaginatedFrontends: + - stage + - step + - steps + LavaflowRunCounts: type: object + description: Runs that match the request. `total` applies every filter. Each breakdown applies every filter but its own, so it shows what picking another value would return. properties: - data: - type: array - items: - $ref: '#/components/schemas/Frontend' - page: - type: integer - description: Current page number (1-indexed) - limit: - type: integer - description: Number of items per page total: type: integer - description: Total number of items across all pages - has_more: - type: boolean - description: Whether there are more pages available - next: - type: string - description: URL path to next page (offset pagination only; present if has_more is true) - next_cursor: - type: string - description: Opaque cursor for the next page (cursor pagination only; present if has_more is true) - prev_cursor: - type: string - description: Opaque cursor for the previous page (cursor pagination only; present when a previous page exists). Send as `ending_before`. + format: int64 + status: + $ref: '#/components/schemas/LavaflowRunStatusCounts' + category: + $ref: '#/components/schemas/LavaflowCategoryCounts' + pull_request_state: + $ref: '#/components/schemas/LavaflowPullRequestStateCounts' + involved_resources: + type: array + maxItems: 50 + description: Resources involved in at least one matching run, most runs first, then by name; at most 50. A run counts once per resource it involves. A run whose report came from what it saved rather than its source, such as one from before involved resources were recorded, may leave out frontends and the functions involved through shared code or the build root's dependency files, so these counts can undercount them. + items: + $ref: '#/components/schemas/LavaflowInvolvedResourceCount' required: - - data - - page - - limit - total - - has_more - PaginatedFunctionDeployments: + - status + - category + - pull_request_state + - involved_resources + LavaflowRunStatusCounts: type: object + description: Matching runs in each status, zeros included. properties: - data: - type: array - items: - $ref: '#/components/schemas/FunctionDeployment' - page: + queued: type: integer - description: Current page number (1-indexed) - limit: + format: int64 + diagnosing: type: integer - description: Number of items per page - total: + format: int64 + fixing: type: integer - description: Total number of items across all pages - has_more: - type: boolean - description: Whether there are more pages available - next: - type: string - description: URL path to next page (only present if has_more is true) + format: int64 + reviewing: + type: integer + format: int64 + pr_open: + type: integer + format: int64 + completed: + type: integer + format: int64 + failed: + type: integer + format: int64 + cancelled: + type: integer + format: int64 required: - - data - - page - - limit - - total - - has_more - PaginatedFunctions: + - queued + - diagnosing + - fixing + - reviewing + - pr_open + - completed + - failed + - cancelled + LavaflowCategoryCounts: type: object + description: Matching runs in each category, zeros included. `uncategorized` counts runs whose `category` is null. properties: - data: - type: array - items: - $ref: '#/components/schemas/Function' - page: + bug: type: integer - description: Current page number (1-indexed) - limit: + format: int64 + performance: type: integer - description: Number of items per page - total: + format: int64 + security: type: integer - description: Total number of items across all pages - has_more: - type: boolean - description: Whether there are more pages available - next: - type: string - description: URL path to next page (only present if has_more is true) - next_cursor: - type: string - description: Opaque cursor for the next page (cursor pagination only; present if has_more is true) - prev_cursor: - type: string - description: Opaque cursor for the previous page (cursor pagination only; present when a previous page exists). Send as `ending_before`. + format: int64 + improvement: + type: integer + format: int64 + configuration: + type: integer + format: int64 + dependency: + type: integer + format: int64 + external: + type: integer + format: int64 + uncategorized: + type: integer + format: int64 required: - - data - - page - - limit - - total - - has_more - PaginatedDurableFunctions: + - bug + - performance + - security + - improvement + - configuration + - dependency + - external + - uncategorized + LavaflowPullRequestStateCounts: type: object + description: Matching runs by the state of their pull request, zeros included. `none` counts runs without one. properties: - data: - type: array - items: - $ref: '#/components/schemas/DurableFunction' - page: + open: type: integer - description: Current page number (1-indexed) - limit: + format: int64 + merged: type: integer - description: Number of items per page - total: + format: int64 + closed: type: integer - description: Total number of items across all pages - has_more: - type: boolean - description: Whether there are more pages available + format: int64 + none: + type: integer + format: int64 required: - - data - - page - - limit - - total - - has_more - PaginatedDurableExecutions: + - open + - merged + - closed + - none + LavaflowInvolvedResourceCount: type: object + description: A resource and how many matching runs involve it. properties: - data: - type: array - items: - $ref: '#/components/schemas/DurableExecution' - page: - type: integer - description: Current page number (1-indexed) - limit: - type: integer - description: Number of items per page - total: + resource: + $ref: '#/components/schemas/LavaflowResourceReference' + runs: type: integer - description: Total number of items across all pages - has_more: + format: int64 + required: + - resource + - runs + LavaflowCodeQualitySettings: + type: object + description: 'LavaFlow Code Quality: whether LavaFlow reviews the code each production deploy changes and opens pull requests that fix what it confirms.' + properties: + enabled: type: boolean - description: Whether there are more pages available + description: Whether Code Quality reviews the project's deploys. Off by default. It reads as off while the project points at another repository than the one it was turned on for, and works only while LavaFlow is on. required: - - data - - page - - limit - - total - - has_more - DurableApproval: + - enabled + LavaflowCodeQualityUpdate: type: object - description: An approval a durable workflow requested. + additionalProperties: false + description: Turns Code Quality on or off. Only the project's owner, signed in, can turn it on; any credential that can save the settings can turn it off. properties: - id: - type: string - format: uuid - status: - $ref: '#/components/schemas/DurableApprovalStatus' - name: - type: string - description: | - The name the workflow gave the approval in `ctx.waitForApproval`. - title: - type: string - description: - type: string - details: - description: | - The JSON value the workflow attached for the person deciding, as - given. - function: - $ref: '#/components/schemas/DurableApprovalFunction' - execution: - $ref: '#/components/schemas/DurableApprovalExecution' - requested_at: - type: string - format: date-time - expires_at: - type: string - format: date-time - nullable: true - description: | - When the approval expires if nobody decides. Null when the - workflow set no timeout; the approval then lasts as long as its - execution. - decision: - $ref: '#/components/schemas/DurableApprovalDecision' + enabled: + type: boolean required: - - id - - status - - name - - title - - description - - function - - execution - - requested_at - - expires_at - - decision - DurableApprovalStatus: + - enabled + LavaflowScanStatus: type: string enum: - - pending - - approved - - denied - - expired + - waiting + - running + - completed + - failed - cancelled - description: | - `pending` means the workflow is waiting for a decision. `approved` and - `denied` are decisions a person made. `expired` means the workflow's - approval timeout passed first, and `cancelled` means the execution - ended while the approval was still pending. Every status but `pending` - is final. - DurableApprovalRegistration: + description: 'Where the scan stands. `waiting` is the project''s next scan: deploys that went live since the last one, waiting out a short settle window or a bound named by `waiting_reason`.' + LavaflowScanResource: type: object - description: The registered approval, as the requesting workflow sees it. + description: A resource whose production deploy the scan covers. Only frontend deploys ask for a scan for now. properties: - id: + resource_type: + type: string + enum: + - function + - frontend + resource_id: type: string format: uuid - status: - $ref: '#/components/schemas/DurableApprovalStatus' - expires_at: + deployment_id: type: string - format: date-time - nullable: true + format: uuid required: - - id - - status - - expires_at - DurableApprovalStats: + - resource_type + - resource_id + - deployment_id + LavaflowScanCounts: type: object + description: What the scan did with the problems it found. properties: - from: - type: string - format: date-time - to: - type: string - format: date-time - counts: - $ref: '#/components/schemas/DurableApprovalCounts' - approval_rate: - type: number - format: double - nullable: true - description: | - `approved / (approved + denied)`, from 0 to 1. Null when nothing in - the window was decided. - median_seconds_to_decision: - type: number - format: double - nullable: true - description: Median time from request to decision. Null when nothing was decided. - p90_seconds_to_decision: - type: number - format: double - nullable: true - description: 90th percentile time from request to decision. Null when nothing was decided. - functions: - type: array - description: | - The ten workflows that requested the most approvals, most first. - The rest are summed in `other_functions`. - items: - $ref: '#/components/schemas/DurableApprovalFunctionCounts' - other_functions: - $ref: '#/components/schemas/DurableApprovalCounts' - daily: - type: array - description: | - One entry per UTC day in the window that has approvals, oldest - first. Days with none are omitted. - items: - $ref: '#/components/schemas/DurableApprovalDailyCounts' + found: + type: integer + format: int64 + description: Candidates the scan found in the changed lines. + created: + type: integer + format: int64 + description: New issues the scan opened. + duplicate: + type: integer + format: int64 + description: Candidates that matched an issue the project already has, or a finding the scan already kept. + suppressed: + type: integer + format: int64 + description: Candidates a person had already turned down, by closing their pull request or ignoring their issue. + capped: + type: integer + format: int64 + description: Confirmed findings past the plan's findings per scan, which no later scan reports again. + rejected: + type: integer + format: int64 + description: Candidates LavaFlow's second check didn't confirm, or that it couldn't report. required: - - from - - to - - counts - - approval_rate - - median_seconds_to_decision - - p90_seconds_to_decision - - functions - - other_functions - - daily - DurableApprovalDecisionRequest: - type: object - properties: - comment: - type: string - maxLength: 2000 - description: A note for the workflow and the approval's history. - additionalProperties: false - RequestDurableApprovalRequest: + - found + - created + - duplicate + - suppressed + - capped + - rejected + LavaflowScanBilledFinding: type: object + description: A finding of the scan whose Code Quality runs were billed. properties: - execution_ref: - type: string - minLength: 1 - maxLength: 2048 - description: Opaque reference to the running execution, supplied by the SDK. - callback_id: + issue_id: type: string - minLength: 1 - maxLength: 1024 - description: Opaque approval reference, supplied by the SDK. - name: + format: uuid + description: The finding's issue. Its `finding` says where the problem is and why. + rule: type: string - minLength: 1 - maxLength: 255 + description: The rule the finding is about. title: type: string - minLength: 1 - maxLength: 200 - description: - type: string - maxLength: 4000 - details: - x-go-type: json.RawMessage - x-go-type-skip-optional-pointer: true - description: | - Any JSON value to show the person deciding. A number's exponent must - be between -324 and 324, and a number too large or too precise to - store is refused with `400`. Numbers are read back written out in - full, so the exponents' absolute values may total at most 65,536. - The whole request is limited to 64 KiB. + billable_events: + type: object + additionalProperties: + type: integer + format: int64 + description: How many billable events of each kind the finding's runs recorded, keyed by kind, such as `issue_diagnosed` and `pull_request_opened`. required: - - execution_ref - - callback_id - - name + - issue_id + - rule - title - additionalProperties: false - PaginatedDurableApprovals: - type: object - properties: - data: - type: array - items: - $ref: '#/components/schemas/DurableApproval' - page: - type: integer - description: Current page number (1-indexed) - limit: - type: integer - description: Number of items per page - total: - type: integer - description: Total number of items across all pages - has_more: - type: boolean - description: Whether there are more pages available - required: - - data - - page - - limit - - total - - has_more - DurableMessageName: - type: string - minLength: 1 - maxLength: 237 - pattern: ^[ -~]+$ - description: | - The name a workflow waits on or publishes under: up to 237 printable - ASCII characters. - DurableMessageDirection: - type: string - enum: - - in - - out - x-enum-varnames: - - DurableMessageDirectionIn - - DurableMessageDirectionOut - description: | - `in` is a message sent to the execution. `out` is one the execution - published. - DurableMessage: + - billable_events + LavaflowScan: type: object - description: A message sent to, or published by, a durable execution. + description: One Code Quality scan of the code a project's deploys changed. properties: id: type: string format: uuid - execution_id: + nullable: true + description: The scan's ID, null while it is waiting. + project_id: + type: string + format: uuid + source: + type: string + enum: + - deployment + description: What asked for the scan. + status: + $ref: '#/components/schemas/LavaflowScanStatus' + outcome: type: string - format: uuid - direction: - $ref: '#/components/schemas/DurableMessageDirection' - seq: + nullable: true + description: 'How a finished scan ended: `scanned`; `no_changes` when the deploy changed nothing since the last scan, as after a redeploy or a rollback; `no_base` when there was no earlier commit to compare against, so the head became the starting point; `unreachable` when the head commit is on neither the project''s production branch nor the repository''s default branch; `repository_changed`; `failed`; or `cancelled`. Null until it ends.' + waiting_reason: + type: string + nullable: true + description: 'The bound a waiting scan waits at: `findings_limit`, `pull_request_limit`, `spend_limit`, `scan_limit` or `feature_unavailable`; `feature_paused` means a platform publication pause is holding the scan without spending its retry allowance. Null while it only waits out its settle window, and for a scan that started. A waiting scan skips no deploy: it covers every commit since the last scan when it starts.' + repository_id: type: integer format: int64 - description: | - Orders the execution's messages in both directions. It increases - with every message but can skip numbers. Pass the last one you read - as `after` to read what came next. - name: + description: The GitHub repository the scan reads. + base_sha: type: string - data: - x-go-type: json.RawMessage - x-go-type-skip-optional-pointer: true nullable: true - description: The JSON value sent or published, or null. - sender: - $ref: '#/components/schemas/DurableMessageSender' - status: - $ref: '#/components/schemas/DurableMessageStatus' - delivered_at: + description: The commit the scan compares against, null while waiting or when there was none. + head_sha: + type: string + description: The newest deployed commit the scan covers. + resources: + type: array + items: + $ref: '#/components/schemas/LavaflowScanResource' + truncated: + type: boolean + description: Whether the scan reviewed only part of the change. A change too large to review whole keeps the files with the most changed lines, a review that stops early keeps what it found, and a repository too large to read whole skips the files past what it read. No later scan covers the rest. + counts: + $ref: '#/components/schemas/LavaflowScanCounts' + billed: + type: array + items: + $ref: '#/components/schemas/LavaflowScanBilledFinding' + description: The scan's findings whose runs were billed. + requested_at: + type: string + format: date-time + description: When the first deploy the scan covers asked for it. + started_at: type: string format: date-time nullable: true - description: When the execution received the message. Null until then, and for `out` messages. - sent_at: + completed_at: type: string format: date-time + nullable: true required: - id - - execution_id - - direction - - seq - - name - - data - - sender + - project_id + - source - status - - delivered_at - - sent_at - DurableMessageList: + - outcome + - waiting_reason + - repository_id + - base_sha + - head_sha + - resources + - truncated + - counts + - billed + - requested_at + - started_at + - completed_at + PaginatedLavaflowScans: type: object properties: data: type: array - description: Messages after `after`, oldest first. items: - $ref: '#/components/schemas/DurableMessage' + $ref: '#/components/schemas/LavaflowScan' + limit: + type: integer + description: Number of items per page has_more: type: boolean - description: | - Whether more messages follow. Read them with `after` set to the - last message's `seq`. + description: Whether a next page exists + next_cursor: + type: string + description: Opaque cursor for the next page, present if has_more is true. It works only for the same project_id and caller. required: - data + - limit - has_more - DurableMessageWait: + NotificationSettings: type: object - description: A wait an execution has open for a message. + additionalProperties: false properties: - id: + project_id: type: string format: uuid - name: - type: string - status: - $ref: '#/components/schemas/DurableMessageWaitStatus' - expires_at: + email: + $ref: '#/components/schemas/NotificationEmailSettings' + webhook: + $ref: '#/components/schemas/NotificationWebhookSettings' + scheduler_failures: + $ref: '#/components/schemas/SchedulerFailureAlertPolicy' + updated_at: type: string format: date-time - nullable: true - description: When the wait times out. Null when the workflow set no timeout. - created_at: + description: When the settings were last saved. Absent until the first save. + required: + - project_id + - email + - webhook + - scheduler_failures + UpdateNotificationSettingsRequest: + type: object + additionalProperties: false + description: Omitted fields keep their current values. + properties: + email: + $ref: '#/components/schemas/UpdateNotificationEmail' + webhook: + $ref: '#/components/schemas/UpdateNotificationWebhook' + scheduler_failures: + $ref: '#/components/schemas/UpdateSchedulerFailureAlertPolicy' + NotificationTestResult: + type: object + additionalProperties: false + properties: + deliveries: + type: array + items: + $ref: '#/components/schemas/NotificationTestDelivery' + required: + - deliveries + GitRepositoryReference: + type: object + description: A GitHub repository, by its stable id and its name. + properties: + id: + type: integer + format: int64 + description: GitHub's repository id. It stays the same through a rename or a transfer. + full_name: type: string - format: date-time + description: The repository's owner and name, such as `acme/shop`. required: - id - - name - - status - - expires_at - - created_at - DurableMessageWaitList: + - full_name + PaginatedProjectCustomDomains: type: object properties: data: type: array - description: Open waits, oldest first. items: - $ref: '#/components/schemas/DurableMessageWait' + $ref: '#/components/schemas/ProjectFrontendCustomDomain' + page: + type: integer + description: Current page number (1-indexed) + limit: + type: integer + description: Number of items per page + total: + type: integer + description: Total number of items across all pages + has_more: + type: boolean + description: Whether there are more pages available + next: + type: string + description: URL path to next page (only present if has_more is true) required: - data - SendDurableMessageRequest: + - page + - limit + - total + - has_more + PaginatedProjectDeployments: type: object properties: - name: - $ref: '#/components/schemas/DurableMessageName' data: - x-go-type: json.RawMessage - x-go-type-skip-optional-pointer: true - nullable: true - description: Any JSON value, up to 64 KiB. Omitted means null. - required: - - name - additionalProperties: false - RegisterDurableMessageWaitRequest: - type: object - properties: - execution_ref: + type: array + items: + $ref: '#/components/schemas/ProjectDeployment' + page: + type: integer + minimum: 1 + description: | + Current page number (1-indexed). Offset pagination only — omitted in + cursor mode, where position comes from the cursor and there is no page + number to report. Required-and-1-indexed would otherwise force a `0` + onto every cursor response. + limit: + type: integer + description: Number of items per page + total: + type: integer + description: Total number of items across all pages + has_more: + type: boolean + description: Whether there are more pages available + next: type: string - minLength: 1 - maxLength: 2048 - description: Opaque reference to the running execution, supplied by the SDK. - callback_id: + description: URL path to next page (offset pagination only; present if has_more is true) + next_cursor: type: string - minLength: 1 - maxLength: 1024 - description: Opaque wait reference, supplied by the SDK. - name: - $ref: '#/components/schemas/DurableMessageName' + description: Opaque cursor for the next page (cursor pagination only; present if has_more is true) + prev_cursor: + type: string + description: Opaque cursor for the previous page (cursor pagination only; present when a previous page exists). Send as `ending_before`. required: - - execution_ref - - callback_id - - name - additionalProperties: false - DurableMessageWaitRegistration: + - data + - limit + - total + - has_more + PaginatedProjects: type: object - description: The registered wait, as the waiting workflow sees it. properties: - id: + data: + type: array + items: + $ref: '#/components/schemas/Project' + page: + type: integer + description: Current page number (1-indexed) + limit: + type: integer + description: Number of items per page + total: + type: integer + description: Total number of items across all pages + has_more: + type: boolean + description: Whether there are more pages available + next: type: string - format: uuid + description: URL path to next page (offset pagination only; present if has_more is true) + next_cursor: + type: string + description: Opaque cursor for the next page (cursor pagination only; present if has_more is true) + prev_cursor: + type: string + description: Opaque cursor for the previous page (cursor pagination only; present when a previous page exists). Send as `ending_before`. status: - $ref: '#/components/schemas/DurableMessageWaitStatus' - expires_at: type: string - format: date-time - nullable: true - required: - - id - - status - - expires_at - OpenDurableMessageSessionRequest: - type: object - properties: - execution_ref: + enum: + - provisioning + - active + - failed + description: Latest project variable propagation status. + current_sync_id: type: string - minLength: 1 - maxLength: 2048 - description: Opaque reference to the running execution, supplied by the SDK. - callback_id: + format: uuid + description: Identifier of the latest variable propagation sync. + provisioning_started_at: type: string - minLength: 1 - maxLength: 1024 - description: Opaque session reference, supplied by the SDK. + format: date-time + description: Timestamp when the current variable propagation phase started. required: - - execution_ref - - callback_id - additionalProperties: false - DurableMessageSessionRegistration: + - data + - page + - limit + - total + - has_more + PaginatedServiceKeys: type: object - description: | - The registered session. Its token reaches the workflow through the - workflow itself, never in this response. properties: - id: + data: + type: array + items: + $ref: '#/components/schemas/ServiceKey' + page: + type: integer + description: Current page number (1-indexed) + limit: + type: integer + description: Number of items per page + total: + type: integer + description: Total number of items across all pages + has_more: + type: boolean + description: Whether there are more pages available + next: type: string - format: uuid + description: URL path to next page (offset pagination only; present if has_more is true) + next_cursor: + type: string + description: Opaque cursor for the next page (cursor pagination only; present if has_more is true) + prev_cursor: + type: string + description: Opaque cursor for the previous page (cursor pagination only; present when a previous page exists). Send as `ending_before`. required: - - id - PublishDurableMessageRequest: + - data + - page + - limit + - total + - has_more + PaginatedStorageBuckets: type: object + description: Cursor-paginated storage buckets (returned only when cursor pagination is requested). properties: - name: - $ref: '#/components/schemas/DurableMessageName' data: - x-go-type: json.RawMessage - x-go-type-skip-optional-pointer: true - nullable: true - description: Any JSON value, up to 64 KiB. Omitted means null. + type: array + items: + $ref: '#/components/schemas/StorageBucket' + limit: + type: integer + description: Number of items per page + total: + type: integer + description: Total number of items matching the query + has_more: + type: boolean + description: Whether a next page exists + next_cursor: + type: string + description: Opaque cursor for the next page (present if has_more is true) + prev_cursor: + type: string + description: Opaque cursor for the previous page (present when a previous page exists). Send as `ending_before`. required: - - name - additionalProperties: false - RegisterDurableCallbackRequest: + - data + - limit + - has_more + PaginatedVariables: type: object properties: - execution_ref: - type: string - minLength: 1 - maxLength: 2048 - description: Opaque reference to the running execution, supplied by the SDK. - callback_id: + data: + type: array + items: + $ref: '#/components/schemas/Variable' + page: + type: integer + description: Current page number (1-indexed) + limit: + type: integer + description: Number of items per page + total: + type: integer + description: Total number of items across all pages + has_more: + type: boolean + description: Whether there are more pages available + next: type: string - minLength: 1 - maxLength: 1024 - description: Opaque reference to the waiting step, supplied by the SDK. - name: + description: URL path to next page (only present if has_more is true) + next_cursor: type: string - minLength: 1 - maxLength: 237 - pattern: ^[ -~]+$ - description: The waiting step's name, up to 237 printable ASCII characters. - operation_id: + description: Opaque cursor for the next page (cursor pagination only; present if has_more is true) + prev_cursor: type: string - minLength: 1 - maxLength: 64 - pattern: ^[0-9a-f]+$ - description: | - The operation an earlier run of the workflow opened the waiting step - under, supplied by the SDK when a replay registers it. Volcano then - looks for the step further back in the execution's history than a - first registration reads. + description: Opaque cursor for the previous page (cursor pagination only; present when a previous page exists). Send as `ending_before`. required: - - execution_ref - - callback_id - - name - additionalProperties: false - DurableCallbackRegistration: + - data + - page + - limit + - total + - has_more + PlatformExchangeResponse: type: object - description: The token for the waiting step, as the workflow receives it. properties: token: - $ref: '#/components/schemas/DurableCallbackToken' + type: string + user_id: + type: string + token_id: + type: string + format: uuid expires_at: type: string format: date-time - nullable: true - description: | - When the waiting step times out and the token stops working. Null - when the workflow set no timeout, in which case the token works - until the execution ends. required: - token + - user_id + - token_id - expires_at - SucceedDurableCallbackRequest: - type: object - properties: - token: - $ref: '#/components/schemas/DurableCallbackToken' - result: - x-go-type: json.RawMessage - x-go-type-skip-optional-pointer: true - description: | - Any JSON value other than null, up to 64 KiB. The waiting step - resolves with it. Null is refused because a timeout resolves the - step with null. - required: - - token - - result - additionalProperties: false - FailDurableCallbackRequest: - type: object - properties: - token: - $ref: '#/components/schemas/DurableCallbackToken' - error: - $ref: '#/components/schemas/DurableCallbackError' - required: - - token - - error - additionalProperties: false - HeartbeatDurableCallbackRequest: - type: object - properties: - token: - $ref: '#/components/schemas/DurableCallbackToken' - required: - - token - additionalProperties: false - DurableCallbackOutcome: - type: object - properties: - status: - $ref: '#/components/schemas/DurableCallbackStatus' - required: - - status - Issue: + Project: type: object - description: Runtime errors from one function or frontend, grouped by error type and stack. properties: + template_installation: + $ref: '#/components/schemas/ProjectTemplateInstallation' id: type: string format: uuid - project_id: - type: string - format: uuid - resource: - $ref: '#/components/schemas/ResourceReference' - title: - type: string - description: | - The error type and message, with values such as IDs, numbers, and - URLs replaced by placeholders like `` and ``. - error_type: - type: string - description: The exception class, such as `TypeError`. Omitted when the error has none. - culprit: + name: type: string - description: The innermost frame of your code in the stack, as `function (file)`. Omitted without a stack. status: - $ref: '#/components/schemas/IssueStatus' - event_count: - type: integer - format: int64 - description: Errors counted in this issue. A retried delivery can count an error twice. - first_seen_at: - type: string - format: date-time - last_seen_at: - type: string - format: date-time - last_region: - type: string - description: The region that served the latest error, such as `us-east-1`. - sample_event_id: type: string - description: The ID of the latest error's log event, while logs retain it. - sample_event_at: + enum: + - active + - deleting + - failed + plan: type: string - format: date-time - description: When the latest error's log event was written. - resolved_at: + enum: + - HOBBY + - SUPERAGENT + description: Plan name applied to the project when available. + all_regions: + type: boolean + description: | + Region policy for function deployment. + - `true`: deploy functions to all configured platform regions + - `false`: deploy only to `selected_regions` + selected_regions: + type: array + items: + type: string + description: Effective region set for this project (normalized and deduplicated) + last_invoked_at: type: string format: date-time - description: When the issue was resolved. Present only while it is resolved. - regressed_at: + description: Most recent activity timestamp across project resources + logo_url: type: string - format: date-time - description: When a resolved issue was last seen again and reopened. + description: | + Relative API path that serves the project logo when one has been + uploaded. The path is versioned with a `?v=` cache-busting query + param that changes on each upload. Absent when the project has no + logo. The logo image is stored in the project's storage folder. + example: /projects/3fa85f64-5717-4562-b3fc-2c963f66afa6/logo?v=1718524800 + git_connection: + allOf: + - $ref: '#/components/schemas/ProjectGitConnectionSummary' + description: Present for connected projects when `git_connection` is requested through the list endpoint's `include` parameter. + health: + allOf: + - $ref: '#/components/schemas/ProjectHealthSummary' + description: Present when `health` is requested through the list endpoint's `include` parameter. created_at: type: string format: date-time @@ -23325,2207 +35370,2348 @@ components: format: date-time required: - id - - project_id - - resource - - title + - name - status - - event_count - - first_seen_at - - last_seen_at + - all_regions + - selected_regions - created_at - updated_at - IssueStatus: - type: string - enum: - - open - - resolved - - ignored - description: | - `open` until someone resolves or ignores the issue. A resolved issue - seen again reopens. - PaginatedIssues: + ProjectConfig: type: object + additionalProperties: false + description: | + Declarative project configuration manifest (the JSON form of + volcano-config.yaml). Omitted sections are left untouched. Within + declared entries, omitted optional fields keep their current server + values (patch semantics). Declared collection keys are fully synced to + the manifest: `variables`, `buckets[].policies`, `auth.providers.oauth`, + `auth.email.templates`, and `functions[].schedulers` are reconciled to + exactly match, deleting resources absent from the manifest. Functions, + frontends, databases, and buckets are never created or deleted through + this manifest; entries referencing resources that do not exist are + skipped and reported. properties: - data: + version: + type: integer + enum: + - 1 + description: Manifest schema version. Must be 1. + project: + $ref: '#/components/schemas/ProjectConfigProject' + databases: type: array items: - $ref: '#/components/schemas/Issue' - limit: - type: integer - description: Number of items per page - has_more: - type: boolean - description: Whether a next page exists - next_cursor: - type: string - description: Opaque cursor for the next page (present if has_more is true) + $ref: '#/components/schemas/ProjectConfigDatabase' + shared_variables: + type: array + uniqueItems: true + description: Replace the complete shared function-variable list with existing names, without changing variable values. Omission keeps membership unchanged; an empty list clears it. + 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. + items: + $ref: '#/components/schemas/ProjectConfigVariable' + buckets: + type: array + items: + $ref: '#/components/schemas/ProjectConfigBucket' + realtime: + $ref: '#/components/schemas/ProjectConfigRealtime' + lavaflow: + $ref: '#/components/schemas/ProjectConfigLavaFlow' + notifications: + $ref: '#/components/schemas/ProjectConfigNotifications' + auth: + $ref: '#/components/schemas/ProjectConfigAuth' + functions: + type: array + items: + $ref: '#/components/schemas/ProjectConfigFunction' + frontends: + type: array + items: + $ref: '#/components/schemas/ProjectConfigFrontend' + sandboxes: + type: array + description: Settings for existing templates; Git deploy applies build settings to matching sandbox source directories. Templates are never deleted by omission. + items: + $ref: '#/components/schemas/ProjectConfigSandbox' required: - - data - - limit - - has_more - UpdateIssueRequest: + - version + ProjectConfigApplyResult: type: object - additionalProperties: false + description: Per-resource report for a project config apply (or dry run). properties: - status: - $ref: '#/components/schemas/IssueStatus' + dry_run: + type: boolean + description: True when the request was a dry run and no changes were made. + results: + type: array + items: + $ref: '#/components/schemas/ProjectConfigApplyResultEntry' + skipped: + type: array + description: | + Manifest entries referencing functions, frontends, databases, or + buckets that do not exist. Their configuration was not applied; + deploy/create the resource first, then re-apply. + items: + $ref: '#/components/schemas/ProjectConfigSkippedResource' + missing: + type: array + description: | + Existing functions, frontends, databases, or buckets that have no + entry in the corresponding declared manifest section. + items: + $ref: '#/components/schemas/ProjectConfigMissingResource' + summary: + $ref: '#/components/schemas/ProjectConfigApplySummary' required: - - status - AutofixSettings: + - results + - skipped + - missing + - summary + ProjectConfigApplyResultEntry: type: object - additionalProperties: false properties: - project_id: + section: type: string - format: uuid - enabled: - type: boolean - description: Whether Volcano diagnoses the project's issues with AI. - max_stage: - $ref: '#/components/schemas/AutofixStage' - auto_trigger: - type: boolean - description: Whether a new or reopened issue starts a run on its own. When false, runs start only on request. - provider: - $ref: '#/components/schemas/AutofixProvider' - model: - $ref: '#/components/schemas/AutofixModel' - api_key_configured: - type: boolean - description: Whether your own API key is stored. The key itself is never returned. - api_key_provider: - allOf: - - $ref: '#/components/schemas/AutofixProvider' - description: The provider the stored key belongs to, present when one is stored. - api_key_last4: + description: Manifest section the entry belongs to (e.g. variables, buckets, auth.providers.oauth). + name: type: string - description: The stored key's last four characters, present when one is stored. - plan_includes_autofix: - type: boolean - description: Whether the owner's plan includes autofix. When false, saved settings stay stored and no run starts. Absent when a save that needed no plan succeeded but the plan could not be resolved. - updated_at: + description: Resource name or key within the section. Empty for singleton sections. + action: type: string - format: date-time - description: When the settings were last saved. Absent until the first save. + enum: + - created + - updated + - deleted + - unchanged + - error + error: + type: string + description: Error detail when action is `error`. + code: + type: string + description: | + Machine-readable reason for a `notice`, when it has one. Clients must accept codes not listed + here. `function_served_by_candidate` - a promoted preview serves the function and keeps the + variables it was built with, so the apply did not synchronize the function's variables; the + entry's action is `unchanged`, and the rest of the apply succeeded. + notice: + type: string + description: Optional operational note (e.g. disabling realtime drops active connections). required: - - project_id - - enabled - - max_stage - - auto_trigger - - provider - - model - - api_key_configured - AutofixStage: - type: string - enum: - - diagnose - - pull_request - x-enum-varnames: - - AutofixStageDiagnose - - AutofixStagePullRequest - description: How far a run may go. `diagnose` stops at a root-cause diagnosis. `pull_request` may also open a draft pull request with a fix in the project's connected repository. - AutofixProvider: - type: string - enum: - - volcano - - anthropic - x-enum-varnames: - - AutofixProviderVolcano - - AutofixProviderAnthropic - description: Who serves the model. `volcano` runs on Volcano's models. `anthropic` runs on your own Anthropic API key. - AutofixModel: - type: string - enum: - - claude-fable-5-1 - - claude-opus-5-5 - - claude-sonnet-5-5 - - claude-haiku-5-5 - - claude-opus-5 - - claude-sonnet-5 - - claude-haiku-4-5 - x-enum-varnames: - - AutofixModelClaudeFable51 - - AutofixModelClaudeOpus55 - - AutofixModelClaudeSonnet55 - - AutofixModelClaudeHaiku55 - - AutofixModelClaudeOpus5 - - AutofixModelClaudeSonnet5 - - AutofixModelClaudeHaiku45 - description: The Claude model a run uses. `claude-opus-5-5` is the default. - UpdateAutofixSettingsRequest: + - section + - action + ProjectConfigApplySummary: type: object - additionalProperties: false properties: - enabled: - type: boolean - max_stage: - $ref: '#/components/schemas/AutofixStage' - auto_trigger: - type: boolean - default: false - provider: - $ref: '#/components/schemas/AutofixProvider' - model: - $ref: '#/components/schemas/AutofixModel' - api_key: - type: string - format: password - writeOnly: true - minLength: 20 - maxLength: 512 - pattern: ^[!-~]+$ - description: Your own API key for `provider`, such as an Anthropic key for `anthropic`. Omit it to keep the stored key. Encrypted at rest and never returned. + created: + type: integer + updated: + type: integer + deleted: + type: integer + unchanged: + type: integer + errors: + type: integer + skipped: + type: integer + missing: + type: integer required: - - enabled - AutofixRunStatus: - type: string - enum: - - queued - - running - - succeeded - - failed - - canceled - x-enum-varnames: - - AutofixRunStatusQueued - - AutofixRunStatusRunning - - AutofixRunStatusSucceeded - - AutofixRunStatusFailed - - AutofixRunStatusCanceled - description: Where a run is. `canceled` means the project's settings or plan stopped allowing the run before it finished; `failure_code` says which. - AutofixRunTrigger: - type: string - enum: - - manual - - new_issue - - regression - x-enum-varnames: - - AutofixRunTriggerManual - - AutofixRunTriggerNewIssue - - AutofixRunTriggerRegression - description: What started the run. `manual` is a request; `new_issue` and `regression` are automatic runs for an issue that appeared or reopened. - AutofixEvidence: + - created + - updated + - deleted + - unchanged + - errors + - skipped + - missing + ProjectConfigAuth: type: object additionalProperties: false + description: Authentication settings, grouped like the dashboard auth-settings tabs. properties: - kind: - type: string - enum: - - log - - code - - other - x-enum-varnames: - - AutofixEvidenceKindLog - - AutofixEvidenceKindCode - - AutofixEvidenceKindOther - detail: - type: string - location: - type: string - description: A file and line, or a log timestamp. Absent when the evidence has none. - required: - - kind - - detail - AutofixDiagnosis: + tokens: + $ref: '#/components/schemas/ProjectConfigAuthTokens' + sessions: + $ref: '#/components/schemas/ProjectConfigAuthSessions' + signup: + $ref: '#/components/schemas/ProjectConfigAuthSignup' + rate_limits: + $ref: '#/components/schemas/ProjectConfigAuthRateLimits' + password: + $ref: '#/components/schemas/ProjectConfigAuthPassword' + password_reset: + $ref: '#/components/schemas/ProjectConfigAuthPasswordReset' + email_verification: + $ref: '#/components/schemas/ProjectConfigAuthEmailVerification' + cors: + $ref: '#/components/schemas/ProjectConfigAuthCORS' + providers: + $ref: '#/components/schemas/ProjectConfigAuthProviders' + email: + $ref: '#/components/schemas/ProjectConfigAuthEmail' + managed_pages: + $ref: '#/components/schemas/ProjectConfigAuthManagedPages' + ProjectConfigAuthCORS: type: object additionalProperties: false properties: - summary: - type: string - description: One or two sentences on what goes wrong. - root_cause: - type: string - evidence: - type: array - items: - $ref: '#/components/schemas/AutofixEvidence' - suggested_fix: - type: string - confidence: - type: string - enum: - - low - - medium - - high - x-enum-varnames: - - AutofixConfidenceLow - - AutofixConfidenceMedium - - AutofixConfidenceHigh - fixable: + enabled: type: boolean - description: Whether a change to the project's code would fix the issue. - files: + allowed_origins: type: array - description: Repository paths a fix would change. items: type: string - required: - - summary - - root_cause - - evidence - - suggested_fix - - confidence - - fixable - - files - AutofixRunUsage: + allow_credentials: + type: boolean + max_age: + type: integer + allow_frontend_previews: + type: boolean + description: Allow the origins of the project's own live frontend previews. + ProjectConfigAuthEmail: type: object additionalProperties: false - description: Model tokens the run used across every attempt. properties: - input_tokens: - type: integer - format: int64 - output_tokens: - type: integer - format: int64 - cache_read_input_tokens: - type: integer - format: int64 - cache_creation_input_tokens: - type: integer - format: int64 - required: - - input_tokens - - output_tokens - - cache_read_input_tokens - - cache_creation_input_tokens - AutofixEdit: + enabled: + type: boolean + description: Enable transactional email sending + from: + $ref: '#/components/schemas/ProjectConfigAuthEmailFrom' + smtp: + $ref: '#/components/schemas/ProjectConfigAuthEmailSMTP' + templates: + $ref: '#/components/schemas/ProjectConfigEmailTemplates' + ProjectConfigAuthEmailFrom: type: object additionalProperties: false - description: One exact text replacement. An empty `old_text` creates the file. properties: - path: - type: string - old_text: + address: type: string - new_text: + description: Sender email address. New or changed values containing carriage returns or newlines return 422. Unchanged exported values are preserved. + name: type: string - required: - - path - - old_text - - new_text - AutofixPatch: + description: Sender display name; supports punctuation and Unicode. New or changed values containing carriage returns or newlines return 422. Unchanged exported values are preserved. + ProjectConfigAuthEmailPasswordProvider: type: object additionalProperties: false - description: The fix the model proposed, applied to the deployed commit. Present whenever the run opened a pull request, and when a valid fix could not be published. properties: - title: - type: string - edits: - type: array - items: - $ref: '#/components/schemas/AutofixEdit' - required: - - title - - edits - AutofixPullRequestState: - type: string - enum: - - open - - merged - - closed - x-enum-varnames: - - AutofixPullRequestStateOpen - - AutofixPullRequestStateMerged - - AutofixPullRequestStateClosed - AutofixPullRequest: + enabled: + type: boolean + ProjectConfigAuthEmailSMTP: type: object additionalProperties: false - description: The draft pull request the run opened on the connected repository. properties: - number: - type: integer - format: int64 - url: - type: string - format: uri - branch: + host: type: string - description: The branch the fix is on, `volcano/autofix/`. - state: - $ref: '#/components/schemas/AutofixPullRequestState' - closed_at: + description: SMTP server host name or IP address. Outside local mode, Volcano connects only to public internet addresses, and a host that is, or resolves to, a loopback, private, link-local, or other non-public address fails delivery. + port: + type: integer + username: type: string - format: date-time - description: When the pull request was merged or closed. - deployed_at: + password: type: string - format: date-time - description: When a deployment that includes the merged fix went live. The issue resolves then, unless it occurred again since. When more than 20 deployments went live after the merge before Volcano checked, it is the merge time instead. - required: - - number - - url - - branch - - state - AutofixPullRequestSkipped: - type: string - enum: - - source_unavailable - - pull_request_open - - not_fixable - - low_confidence - - no_patch - - permission_missing - - repository_changed - - publish_failed - x-enum-varnames: - - AutofixPullRequestSkippedSourceUnavailable - - AutofixPullRequestSkippedPullRequestOpen - - AutofixPullRequestSkippedNotFixable - - AutofixPullRequestSkippedLowConfidence - - AutofixPullRequestSkippedNoPatch - - AutofixPullRequestSkippedPermissionMissing - - AutofixPullRequestSkippedRepositoryChanged - - AutofixPullRequestSkippedPublishFailed - description: Why a run whose `max_stage` is `pull_request` opened no pull request. The diagnosis stands either way. - AutofixRun: + format: password + writeOnly: true + description: Write-only; omitted from config export. + use_tls: + type: boolean + ProjectConfigAuthEmailVerification: type: object additionalProperties: false properties: - id: - type: string - format: uuid - project_id: - type: string - format: uuid - issue_id: - type: string - format: uuid - trigger: - $ref: '#/components/schemas/AutofixRunTrigger' - status: - $ref: '#/components/schemas/AutofixRunStatus' - max_stage: - $ref: '#/components/schemas/AutofixStage' - stage_reached: - $ref: '#/components/schemas/AutofixStage' - provider: - $ref: '#/components/schemas/AutofixProvider' - model: - $ref: '#/components/schemas/AutofixModel' - diagnosis: - $ref: '#/components/schemas/AutofixDiagnosis' - patch: - $ref: '#/components/schemas/AutofixPatch' - pull_request: - $ref: '#/components/schemas/AutofixPullRequest' - pull_request_skipped: - $ref: '#/components/schemas/AutofixPullRequestSkipped' - commit_sha: - type: string - description: The commit the diagnosis read, when a push to the connected repository deployed the resource. Absent when the run read logs only. - failure_code: - type: string - description: Why the run failed or was canceled, or why its last attempt will be retried. One of `api_key_rejected`, `model_request_rejected`, `model_unavailable`, `model_refused`, `no_diagnosis`, `budget_exhausted`, `timed_out`, `attempts_exhausted`, `autofix_disabled`, `plan_required`, `managed_models_unavailable`, `settings_changed`, `issue_not_found`, or `internal_error`. - failure_message: - type: string - usage: - $ref: '#/components/schemas/AutofixRunUsage' - created_at: - type: string - format: date-time - started_at: - type: string - format: date-time - completed_at: - type: string - format: date-time - required: - - id - - project_id - - issue_id - - trigger - - status - - max_stage - - provider - - model - - usage - - created_at - PaginatedAutofixRuns: + require_confirmation: + type: boolean + description: Require users to confirm email before sign-in. Requires email sending to be enabled. + confirmation_timeout: + type: integer + description: Email confirmation token expiry in seconds + ProjectConfigAuthManagedPages: type: object + additionalProperties: false properties: - data: - type: array - items: - $ref: '#/components/schemas/AutofixRun' - limit: - type: integer - description: Number of items per page - has_more: + enabled: type: boolean - description: Whether a next page exists - next_cursor: - type: string - description: Opaque cursor for the next page (present if has_more is true) - required: - - data - - limit - - has_more - PaginatedProjectCustomDomains: + description: Enable or disable managed auth hosted pages + redirects: + $ref: '#/components/schemas/ProjectConfigAuthRedirects' + pages: + $ref: '#/components/schemas/ProjectConfigHostedPages' + appearance: + $ref: '#/components/schemas/ProjectConfigAuthPageAppearance' + ProjectConfigAuthPassword: type: object + additionalProperties: false properties: - data: - type: array - items: - $ref: '#/components/schemas/ProjectFrontendCustomDomain' - page: - type: integer - description: Current page number (1-indexed) - limit: - type: integer - description: Number of items per page - total: + min_length: type: integer - description: Total number of items across all pages - has_more: + minimum: 15 + maximum: 128 + require_uppercase: type: boolean - description: Whether there are more pages available - next: - type: string - description: URL path to next page (only present if has_more is true) - required: - - data - - page - - limit - - total - - has_more - PaginatedProjectDeployments: + require_lowercase: + type: boolean + require_numbers: + type: boolean + require_special_chars: + type: boolean + ProjectConfigAuthPasswordReset: type: object + additionalProperties: false properties: - data: - type: array - items: - $ref: '#/components/schemas/ProjectDeployment' - page: - type: integer - minimum: 1 - description: | - Current page number (1-indexed). Offset pagination only — omitted in - cursor mode, where position comes from the cursor and there is no page - number to report. Required-and-1-indexed would otherwise force a `0` - onto every cursor response. - limit: - type: integer - description: Number of items per page - total: - type: integer - description: Total number of items across all pages - has_more: + allow: type: boolean - description: Whether there are more pages available - next: - type: string - description: URL path to next page (offset pagination only; present if has_more is true) - next_cursor: - type: string - description: Opaque cursor for the next page (cursor pagination only; present if has_more is true) - prev_cursor: - type: string - description: Opaque cursor for the previous page (cursor pagination only; present when a previous page exists). Send as `ending_before`. - required: - - data - - limit - - total - - has_more - PaginatedProjects: + timeout: + type: integer + description: Password reset token expiry in seconds + max_history: + type: integer + description: Number of previous passwords to disallow (0=disabled) + ProjectConfigAuthProviders: type: object + additionalProperties: false properties: - data: + email_password: + $ref: '#/components/schemas/ProjectConfigAuthEmailPasswordProvider' + oauth: type: array + description: Fully synced when declared - providers absent from this list are deleted. items: - $ref: '#/components/schemas/Project' - page: + $ref: '#/components/schemas/ProjectConfigOAuthProvider' + ProjectConfigAuthRateLimits: + type: object + additionalProperties: false + description: Rate limits per hour. + properties: + signup: type: integer - description: Current page number (1-indexed) - limit: + signin: type: integer - description: Number of items per page - total: + token_refresh: type: integer - description: Total number of items across all pages - has_more: - type: boolean - description: Whether there are more pages available - next: - type: string - description: URL path to next page (offset pagination only; present if has_more is true) - next_cursor: - type: string - description: Opaque cursor for the next page (cursor pagination only; present if has_more is true) - prev_cursor: - type: string - description: Opaque cursor for the previous page (cursor pagination only; present when a previous page exists). Send as `ending_before`. - status: - type: string - enum: - - provisioning - - active - - failed - description: Latest project variable propagation status. - current_sync_id: - type: string - format: uuid - description: Identifier of the latest variable propagation sync. - provisioning_started_at: - type: string - format: date-time - description: Timestamp when the current variable propagation phase started. - required: - - data - - page - - limit - - total - - has_more - PaginatedServiceKeys: + password_reset: + type: integer + ProjectConfigAuthRedirects: type: object + additionalProperties: false properties: - data: + allowed: type: array items: - $ref: '#/components/schemas/ServiceKey' - page: - type: integer - description: Current page number (1-indexed) - limit: - type: integer - description: Number of items per page - total: - type: integer - description: Total number of items across all pages - has_more: - type: boolean - description: Whether there are more pages available - next: + type: string + description: Redirect allowlist. Every entry must be a valid http/https URL. + post_auth: type: string - description: URL path to next page (offset pagination only; present if has_more is true) - next_cursor: + description: Must be included in `allowed` when set. + post_logout: type: string - description: Opaque cursor for the next page (cursor pagination only; present if has_more is true) - prev_cursor: + description: Must be included in `allowed` when set. + device_verification: type: string - description: Opaque cursor for the previous page (cursor pagination only; present when a previous page exists). Send as `ending_before`. - required: - - data - - page - - limit - - total - - has_more - PaginatedStorageBuckets: + description: Optional custom device-authorization verification page URL. + ProjectConfigAuthSessions: type: object - description: Cursor-paginated storage buckets (returned only when cursor pagination is requested). + additionalProperties: false properties: - data: - type: array - items: - $ref: '#/components/schemas/StorageBucket' - limit: + inactivity_timeout: type: integer - description: Number of items per page - total: + description: Force re-login after inactivity (seconds, 0=never) + max_session_duration: type: integer - description: Total number of items matching the query - has_more: - type: boolean - description: Whether a next page exists - next_cursor: - type: string - description: Opaque cursor for the next page (present if has_more is true) - prev_cursor: - type: string - description: Opaque cursor for the previous page (present when a previous page exists). Send as `ending_before`. - required: - - data - - limit - - has_more - PaginatedVariables: + description: Force re-login after duration (seconds, 0=never) + ProjectConfigAuthSignup: type: object + additionalProperties: false properties: - data: + enable_signup: + type: boolean + description: Master switch for signups across ALL providers + enable_anonymous_signins: + type: boolean + allowed_email_domains: type: array + maxItems: 100 + description: | + Email domains allowed to create users. Empty allows every domain. + Replaces the stored list; entries are normalized (lowercase, no `@` + prefix) and must be bare domains such as `domain1.com`. Matching is + exact, so subdomains need their own entry. At most 100 entries. + + Restricting signups is a SUPERAGENT feature to configure and to enforce: a + HOBBY project can only declare the list it already has or remove the + restriction, and the list it keeps is parked until it upgrades. items: - $ref: '#/components/schemas/Variable' - page: + type: string + example: + - domain1.com + - domain2.com + allowed_email_domains_mode: + type: string + description: | + How far `allowed_email_domains` reaches. `signup` gates account + creation only. `signup_and_signin` also blocks sign-in for accounts + outside the list and signs out the ones it locks out. `disabled` + keeps the list without enforcing it. + enum: + - disabled + - signup + - signup_and_signin + ProjectConfigAuthTokens: + type: object + additionalProperties: false + description: Token lifetimes in seconds. + properties: + access_token_lifetime: type: integer - description: Current page number (1-indexed) - limit: + refresh_token_lifetime: type: integer - description: Number of items per page - total: + refresh_token_reuse_interval: type: integer - description: Total number of items across all pages - has_more: - type: boolean - description: Whether there are more pages available - next: + platform_token_ttl: + type: integer + ProjectConfigBucket: + type: object + additionalProperties: false + description: | + Settings for an existing storage bucket. Buckets are never created or + deleted through the manifest. When `policies` is declared it is fully + synced (policies absent from the list are deleted; an empty list + deletes all); omitting `policies` leaves the bucket's policies + untouched. + properties: + name: type: string - description: URL path to next page (only present if has_more is true) - next_cursor: + pattern: ^[a-zA-Z0-9_-]+$ + minLength: 1 + maxLength: 64 + file_size_limit: + type: integer + format: int64 + description: Maximum file size in bytes + allowed_mime_types: + type: array + items: + type: string + policies: + type: array + items: + $ref: '#/components/schemas/ProjectConfigBucketPolicy' + required: + - name + ProjectConfigBucketPolicy: + type: object + additionalProperties: false + properties: + name: type: string - description: Opaque cursor for the next page (cursor pagination only; present if has_more is true) - prev_cursor: + minLength: 1 + operation: type: string - description: Opaque cursor for the previous page (cursor pagination only; present when a previous page exists). Send as `ending_before`. + enum: + - SELECT + - INSERT + - UPDATE + - DELETE + definition: + type: string + description: Policy expression + required: + - name + - operation + - definition + ProjectConfigCustomDomain: + type: object + additionalProperties: false + description: | + Custom domain with managed or BYOC TLS. `tls` is required + when the domain is first created and optional afterwards. For an existing + domain, omitting `tls` or sending only `tls.mode` keeps the stored + certificate; new BYOC material for the same domain rotates the + certificate in place (zero downtime). Changing `tls.mode` for the same + hostname switches an active domain in place (zero downtime); a domain + that is not yet active, or a managed domain changing hostname, must be + deleted first. BYOC TLS material is write-only; exports render only + `tls.mode`. + properties: + domain: + type: string + maxLength: 253 + description: 'Fully-qualified domain name (hostname only, no scheme/path). Managed TLS (`tls.mode: managed`) accepts at most 219 characters; BYOC accepts 253.' + tls: + $ref: '#/components/schemas/ProjectConfigFrontendCustomDomainTLSConfig' required: - - data - - page - - limit - - total - - has_more - PlatformExchangeResponse: + - domain + ProjectConfigFrontendCustomDomain: type: object + additionalProperties: false + description: | + One of the frontend's custom domains. `domain` and `tls` behave as in + `custom_domain`. With `redirect`, the domain redirects every request to + another listed domain that serves the frontend. properties: - token: - type: string - user_id: - type: string - token_id: - type: string - format: uuid - expires_at: + domain: type: string - format: date-time + maxLength: 253 + description: 'Fully-qualified domain name (hostname only, no scheme/path). Managed TLS (`tls.mode: managed`) accepts at most 219 characters; BYOC accepts 253.' + tls: + $ref: '#/components/schemas/ProjectConfigFrontendCustomDomainTLSConfig' + redirect: + $ref: '#/components/schemas/ProjectConfigCustomDomainRedirect' required: - - token - - user_id - - token_id - - expires_at - Project: + - domain + ProjectConfigCustomDomainRedirect: type: object + additionalProperties: false properties: - template_installation: - $ref: '#/components/schemas/ProjectTemplateInstallation' - id: + to: type: string - format: uuid + minLength: 1 + maxLength: 253 + description: Another domain in the same `custom_domains` list, without `redirect`. + status: + type: integer + enum: + - 301 + - 302 + - 307 + - 308 + default: 308 + required: + - to + ProjectConfigDatabase: + type: object + additionalProperties: false + description: | + Assertion-only entry for an existing database. No database property is + mutable through the manifest; declared values are compared against the + deployed database and any mismatch fails validation. Databases are + never created or deleted here. + properties: name: type: string - status: + minLength: 1 + region: type: string - enum: - - active - - deleting - - failed - plan: + description: Deployed region ID (e.g. us-east-1). Asserted, never written; region IDs issued by earlier versions of the API match too. + pg_version: type: string enum: - - HOBBY - - SUPERAGENT - description: Plan name applied to the project when available. - all_regions: - type: boolean + - '15' + - '16' + - '17' + - '18' description: | - Region policy for function deployment. - - `true`: deploy functions to all configured platform regions - - `false`: deploy only to `selected_regions` - selected_regions: - type: array - items: - type: string - description: Effective region set for this project (normalized and deduplicated) - last_invoked_at: - type: string - format: date-time - description: Most recent activity timestamp across project resources - logo_url: + PostgreSQL major version. Asserted, never written. Also accepts + versions new databases can no longer be created on, so an export + of an existing database re-applies. + database_type: type: string + enum: + - volcano-db-xs + - volcano-db-s + - volcano-db-m + - volcano-db-l + - volcano-db-xl + - volcano-db-2xl description: | - Relative API path that serves the project logo when one has been - uploaded. The path is versioned with a `?v=` cache-busting query - param that changes on each upload. Absent when the project has no - logo. The logo image is stored in the project's storage folder. - example: /projects/3fa85f64-5717-4562-b3fc-2c963f66afa6/logo?v=1718524800 - git_connection: - allOf: - - $ref: '#/components/schemas/ProjectGitConnectionSummary' - description: Present for connected projects when `git_connection` is requested through the list endpoint's `include` parameter. - health: - allOf: - - $ref: '#/components/schemas/ProjectHealthSummary' - description: Present when `health` is requested through the list endpoint's `include` parameter. - created_at: - type: string - format: date-time - updated_at: - type: string - format: date-time + Compute tier. Asserted, never written - tier changes are not + supported via the manifest; use the databases API/CLI/GUI instead. required: - - id - name - - status - - all_regions - - selected_regions - - created_at - - updated_at - ProjectConfig: + - region + - pg_version + ProjectConfigEmailTemplate: + type: object + additionalProperties: false + properties: + subject: + type: string + description: Subject template. For new or changed values, literal interior carriage returns or newlines after Go template whitespace trimming return 422. Outer whitespace and trailing block-scalar newlines are allowed. Unchanged stored subjects are preserved. + html_body: + type: string + maxLength: 262144 + description: HTML body. Max 256 KiB. SUPERAGENT plan required for custom bodies. + text_body: + type: string + maxLength: 262144 + description: Plain-text body. Max 256 KiB. SUPERAGENT plan required for custom bodies. + ProjectConfigEmailTemplates: type: object additionalProperties: false description: | - Declarative project configuration manifest (the JSON form of - volcano-config.yaml). Omitted sections are left untouched. Within - declared entries, omitted optional fields keep their current server - values (patch semantics). Declared collection keys are fully synced to - the manifest: `variables`, `buckets[].policies`, `auth.providers.oauth`, - `auth.email.templates`, and `functions[].schedulers` are reconciled to - exactly match, deleting resources absent from the manifest. Functions, - frontends, databases, and buckets are never created or deleted through - this manifest; entries referencing resources that do not exist are - skipped and reported. + Email templates keyed by type. Fully synced when declared - template + types absent from a declared map revert to server defaults (custom + bodies deleted, subject overrides cleared). Custom template bodies + require the SUPERAGENT plan; subject-only changes are available on HOBBY. properties: - version: - type: integer + confirmation: + $ref: '#/components/schemas/ProjectConfigEmailTemplate' + password_reset: + $ref: '#/components/schemas/ProjectConfigEmailTemplate' + password_changed: + $ref: '#/components/schemas/ProjectConfigEmailTemplate' + welcome: + $ref: '#/components/schemas/ProjectConfigEmailTemplate' + ProjectConfigFrontend: + type: object + additionalProperties: false + description: | + Configuration for an existing (deployed) frontend. Frontends are never + created or deleted through the manifest. + properties: + variable_scope: + type: string enum: - - 1 - description: Manifest schema version. Must be 1. - project: - $ref: '#/components/schemas/ProjectConfigProject' - databases: - type: array - items: - $ref: '#/components/schemas/ProjectConfigDatabase' - shared_variables: - type: array - uniqueItems: true - description: Replace the complete shared function-variable list with existing names, without changing variable values. Omission keeps membership unchanged; an empty list clears it. - items: - type: string - pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$ - frontend_shared_variables: + - 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 - 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. - items: - $ref: '#/components/schemas/ProjectConfigVariable' - buckets: - type: array - items: - $ref: '#/components/schemas/ProjectConfigBucket' - realtime: - $ref: '#/components/schemas/ProjectConfigRealtime' - autofix: - $ref: '#/components/schemas/ProjectConfigAutofix' - auth: - $ref: '#/components/schemas/ProjectConfigAuth' - functions: + 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 + custom_domain: + allOf: + - $ref: '#/components/schemas/ProjectConfigCustomDomain' + nullable: true + x-go-type: nullable.Nullable[ProjectConfigCustomDomain] + x-go-type-skip-optional-pointer: true + description: | + The frontend's custom domain. Omission leaves an existing domain + untouched; null deletes it. For a frontend with more than one + domain, or a redirect, use `custom_domains`; an entry may not set + both. + custom_domains: type: array + maxItems: 100 + description: | + Complete set of the frontend's custom domains when declared. + Domains not listed are deleted; an empty list deletes all of them. + Omission leaves existing domains untouched. More than one domain + needs a plan that allows it. items: - $ref: '#/components/schemas/ProjectConfigFunction' - frontends: + $ref: '#/components/schemas/ProjectConfigFrontendCustomDomain' + function_routes: type: array + maxItems: 64 + description: Complete set of same-origin Function path mappings when declared. Omission preserves existing mappings; an empty list deletes all mappings. items: - $ref: '#/components/schemas/ProjectConfigFrontend' - sandboxes: + $ref: '#/components/schemas/ProjectConfigFrontendFunctionRoute' + frontend_routes: type: array - description: Settings for existing templates; Git deploy applies build settings to matching sandbox source directories. Templates are never deleted by omission. + maxItems: 64 + description: | + Complete set of paths this frontend serves from another frontend in the project when + declared. Omission preserves existing routes; an empty list deletes all of them. + Function and Frontend routes share one path namespace and the 64-route limit. items: - $ref: '#/components/schemas/ProjectConfigSandbox' + $ref: '#/components/schemas/ProjectConfigFrontendRoute' required: - - version - ProjectConfigApplyResult: + - name + ProjectConfigFunction: type: object - description: Per-resource report for a project config apply (or dry run). + additionalProperties: false + description: | + Configuration for an existing (deployed) function. Functions are never + created or deleted through the manifest. When `schedulers` is declared + it is fully synced (schedulers absent from the list are deleted); + omitting `schedulers` leaves the function's schedulers untouched. The + same applies to `variables`: declaring it replaces the function's + declared variable names, and omitting it leaves them untouched. properties: - dry_run: + name: + type: string + minLength: 1 + kind: + $ref: '#/components/schemas/FunctionKind' + visibility: + $ref: '#/components/schemas/FunctionVisibility' + public: type: boolean - description: True when the request was a dry run and no changes were made. - results: + deprecated: true + description: | + Deprecated alias for `visibility`: `true` means `public` and + `false` means `authenticated`, not `private`, so an entry left at + `false` applies `authenticated` on every apply; declare + `visibility: private` to keep a function private. Declaring both + with different meanings is an error. Exports write `visibility` + only. + variable_scope: + type: string + 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 + it selects: every name declared in `variables`, plus the names + Volcano detects in its source that the project defines. + variables: type: array items: - $ref: '#/components/schemas/ProjectConfigApplyResultEntry' - skipped: - type: array + type: string + minLength: 1 + maxLength: 256 description: | - Manifest entries referencing functions, frontends, databases, or - buckets that do not exist. Their configuration was not applied; - deploy/create the resource first, then re-apply. - items: - $ref: '#/components/schemas/ProjectConfigSkippedResource' - missing: + Project variable names this function requires, on top of the ones + detected in its source. Declare a name here when the function reads + it through a computed key, which detection cannot see, or when the + function must not deploy without it: a declared name the project does + not define fails the apply, while a detected name it does not define + is ignored. Only used when `variable_scope` is `scoped`. + invocation_mode: + $ref: '#/components/schemas/FunctionInvocationMode' + http_auth_mode: + $ref: '#/components/schemas/FunctionHTTPAuthMode' + openapi_spec: + type: object + nullable: true + additionalProperties: true + x-go-type: nullable.Nullable[map[string]interface{}] + x-go-type-skip-optional-pointer: true + description: OpenAPI 3.0 or 3.1 metadata for an HTTP-mode function + schedulers: type: array - description: | - Existing functions, frontends, databases, or buckets that have no - entry in the corresponding declared manifest section. items: - $ref: '#/components/schemas/ProjectConfigMissingResource' - summary: - $ref: '#/components/schemas/ProjectConfigApplySummary' + $ref: '#/components/schemas/ProjectConfigScheduler' required: - - results - - skipped - - missing - - summary - ProjectConfigApplyResultEntry: + - name + ProjectConfigHostedPage: type: object + additionalProperties: false properties: - section: - type: string - description: Manifest section the entry belongs to (e.g. variables, buckets, auth.providers.oauth). - name: - type: string - description: Resource name or key within the section. Empty for singleton sections. - action: - type: string - enum: - - created - - updated - - deleted - - unchanged - - error - error: + html: type: string - description: Error detail when action is `error`. - notice: + maxLength: 262144 + description: Raw HTML markup for the page. Max 256 KiB. + css: type: string - description: Optional operational note (e.g. disabling realtime drops active connections). - required: - - section - - action - ProjectConfigApplySummary: - type: object - properties: - created: - type: integer - updated: - type: integer - deleted: - type: integer - unchanged: - type: integer - errors: - type: integer - skipped: - type: integer - missing: - type: integer + maxLength: 262144 + description: Optional CSS injected at render time. Max 256 KiB. required: - - created - - updated - - deleted - - unchanged - - errors - - skipped - - missing - ProjectConfigAuth: + - html + ProjectConfigHostedPages: type: object additionalProperties: false - description: Authentication settings, grouped like the dashboard auth-settings tabs. + description: | + Hosted auth pages keyed by page type (SUPERAGENT plan). Upsert-only: omitted + pages are left untouched (there is no delete for hosted pages). properties: - tokens: - $ref: '#/components/schemas/ProjectConfigAuthTokens' - sessions: - $ref: '#/components/schemas/ProjectConfigAuthSessions' + login: + $ref: '#/components/schemas/ProjectConfigHostedPage' + reset_password: + $ref: '#/components/schemas/ProjectConfigHostedPage' signup: - $ref: '#/components/schemas/ProjectConfigAuthSignup' - rate_limits: - $ref: '#/components/schemas/ProjectConfigAuthRateLimits' - password: - $ref: '#/components/schemas/ProjectConfigAuthPassword' - password_reset: - $ref: '#/components/schemas/ProjectConfigAuthPasswordReset' - email_verification: - $ref: '#/components/schemas/ProjectConfigAuthEmailVerification' - cors: - $ref: '#/components/schemas/ProjectConfigAuthCORS' - providers: - $ref: '#/components/schemas/ProjectConfigAuthProviders' - email: - $ref: '#/components/schemas/ProjectConfigAuthEmail' - managed_pages: - $ref: '#/components/schemas/ProjectConfigAuthManagedPages' - ProjectConfigAuthCORS: + $ref: '#/components/schemas/ProjectConfigHostedPage' + forgot_password: + $ref: '#/components/schemas/ProjectConfigHostedPage' + device: + $ref: '#/components/schemas/ProjectConfigHostedPage' + verify_email: + $ref: '#/components/schemas/ProjectConfigHostedPage' + PreviewAuthPageRequest: type: object additionalProperties: false + required: + - theme + - layout properties: - enabled: - type: boolean - allowed_origins: - type: array - items: - type: string - allow_credentials: - type: boolean - max_age: - type: integer - ProjectConfigAuthEmail: + theme: + $ref: '#/components/schemas/AuthPageTheme' + layout: + $ref: '#/components/schemas/AuthPageLayout' + action: + type: string + PreviewAuthPageResponse: type: object - additionalProperties: false + required: + - preview_url + - expires_at properties: - enabled: - type: boolean - description: Enable transactional email sending - from: - $ref: '#/components/schemas/ProjectConfigAuthEmailFrom' - smtp: - $ref: '#/components/schemas/ProjectConfigAuthEmailSMTP' - templates: - $ref: '#/components/schemas/ProjectConfigEmailTemplates' - ProjectConfigAuthEmailFrom: + preview_url: + type: string + format: uri + expires_at: + type: string + format: date-time + ProjectConfigMissingResource: type: object - additionalProperties: false properties: - address: + type: type: string + enum: + - function + - frontend + - database + - bucket + - sandbox name: type: string - ProjectConfigAuthEmailPasswordProvider: + required: + - type + - name + ProjectConfigOAuthProvider: type: object additionalProperties: false properties: + provider: + type: string + enum: + - google + - github + - microsoft + - apple + - device enabled: type: boolean - ProjectConfigAuthEmailSMTP: - type: object - additionalProperties: false - properties: - host: - type: string - port: - type: integer - username: + client_id: type: string - password: + description: | + Required for non-device providers. Server-generated for + `provider=device` (exported read-only, ignored on apply). + client_secret: type: string format: password writeOnly: true - description: Write-only; omitted from config export. - use_tls: - type: boolean - ProjectConfigAuthEmailVerification: - type: object - additionalProperties: false - properties: - require_confirmation: - type: boolean - description: Require users to confirm email before sign-in. Requires email sending to be enabled. - confirmation_timeout: - type: integer - description: Email confirmation token expiry in seconds - ProjectConfigAuthManagedPages: + description: Write-only; omitted from config export. Not used for `provider=device`. + redirect_url: + type: string + description: Not used for `provider=device`. + scopes: + type: array + items: + type: string + required: + - provider + ProjectConfigProject: type: object additionalProperties: false + description: Project-level settings. `name` renames the project. properties: - enabled: + name: + type: string + pattern: ^[A-Za-z0-9_-]+$ + minLength: 1 + maxLength: 255 + all_regions: type: boolean - description: Enable or disable managed auth hosted pages - redirects: - $ref: '#/components/schemas/ProjectConfigAuthRedirects' - pages: - $ref: '#/components/schemas/ProjectConfigHostedPages' - appearance: - $ref: '#/components/schemas/ProjectConfigAuthPageAppearance' - ProjectConfigAuthPassword: + description: Region policy. `false` requires `selected_regions` (SUPERAGENT plan). + selected_regions: + type: array + items: + type: string + description: Region subset (bare region names). Requires `all_regions=false`. + ProjectConfigRealtime: type: object additionalProperties: false properties: - min_length: - type: integer - minimum: 15 - maximum: 128 - require_uppercase: + enabled: type: boolean - require_lowercase: + broadcast_enabled: type: boolean - require_numbers: + presence_enabled: type: boolean - require_special_chars: + postgres_changes_enabled: type: boolean - ProjectConfigAuthPasswordReset: + ProjectConfigLavaFlow: + type: object + deprecated: true + description: Ignored. The manifest doesn't configure LavaFlow. A manifest that still declares this section applies as before, without it, and the result reports it as `unchanged` with a notice. Export never includes it. + ProjectConfigScheduler: type: object additionalProperties: false properties: - allow: + name: + type: string + minLength: 1 + maxLength: 200 + cron: + type: string + description: 5-field UTC cron expression + enabled: type: boolean - timeout: - type: integer - description: Password reset token expiry in seconds - max_history: - type: integer - description: Number of previous passwords to disallow (0=disabled) - ProjectConfigAuthProviders: + payload: + type: object + additionalProperties: true + required: + - name + - cron + ProjectConfigSkippedResource: type: object - additionalProperties: false properties: - email_password: - $ref: '#/components/schemas/ProjectConfigAuthEmailPasswordProvider' - oauth: + type: + type: string + enum: + - function + - frontend + - database + - bucket + - sandbox + name: + type: string + reason: + type: string + required: + - type + - name + - reason + ProjectConfigValidationError: + type: object + properties: + section: + type: string + description: Manifest section the error refers to (e.g. databases, functions). + name: + type: string + description: Resource name or key within the section, when applicable. + message: + type: string + required: + - section + - message + ProjectConfigValidationErrorResponse: + type: object + description: Returned when manifest validation fails. Nothing was applied. + properties: + error: + type: string + errors: type: array - description: Fully synced when declared - providers absent from this list are deleted. items: - $ref: '#/components/schemas/ProjectConfigOAuthProvider' - ProjectConfigAuthRateLimits: + $ref: '#/components/schemas/ProjectConfigValidationError' + required: + - error + - errors + ProjectConfigVariable: type: object additionalProperties: false - description: Rate limits per hour. properties: - signup: - type: integer - signin: - type: integer - token_refresh: - type: integer - password_reset: - type: integer - ProjectConfigAuthRedirects: + 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. + name: + type: string + description: Project variable name. Function runtime names such as AWS_REGION are reserved and fail validation; see the environment variables guide for the full list. + minLength: 1 + value: + type: string + required: + - name + - value + ProjectHealthResource: type: object - additionalProperties: false properties: - allowed: - type: array - items: - type: string - description: Redirect allowlist. Every entry must be a valid http/https URL. - post_auth: + type: type: string - description: Must be included in `allowed` when set. - post_logout: + enum: + - project + - function + - frontend + - database + - database_branch + id: type: string - description: Must be included in `allowed` when set. - device_verification: + format: uuid + name: type: string - description: Optional custom device-authorization verification page URL. - ProjectConfigAuthSessions: + kind: + allOf: + - $ref: '#/components/schemas/FunctionKind' + description: | + Which kind of function this check is about. Present only when `type` + is `function`, where both kinds share the name space and this is + what tells them apart. + required: + - type + - id + - name + ResourceReference: type: object - additionalProperties: false + description: Stable reference to a Volcano resource. properties: - inactivity_timeout: - type: integer - description: Force re-login after inactivity (seconds, 0=never) - max_session_duration: - type: integer - description: Force re-login after duration (seconds, 0=never) - ProjectConfigAuthSignup: + type: + type: string + enum: + - project + - function + - frontend + - database + id: + type: string + format: uuid + name: + type: string + required: + - type + - id + - name + DeploymentReference: type: object - additionalProperties: false + description: Stable reference to a Volcano deployment run. properties: - enable_signup: - type: boolean - description: Master switch for signups across ALL providers - enable_anonymous_signins: - type: boolean - allowed_email_domains: - type: array - maxItems: 100 - description: | - Email domains allowed to create users. Empty allows every domain. - Replaces the stored list; entries are normalized (lowercase, no `@` - prefix) and must be bare domains such as `domain1.com`. Matching is - exact, so subdomains need their own entry. At most 100 entries. - - Restricting signups is a SUPERAGENT feature to configure and to enforce: a - HOBBY project can only declare the list it already has or remove the - restriction, and the list it keeps is parked until it upgrades. - items: - type: string - example: - - domain1.com - - domain2.com - allowed_email_domains_mode: + id: type: string - description: | - How far `allowed_email_domains` reaches. `signup` gates account - creation only. `signup_and_signin` also blocks sign-in for accounts - outside the list and signs out the ones it locks out. `disabled` - keeps the list without enforcing it. - enum: - - disabled - - signup - - signup_and_signin - ProjectConfigAuthTokens: + format: uuid + required: + - id + ProjectHealthScope: type: object - additionalProperties: false - description: Token lifetimes in seconds. properties: - access_token_lifetime: - type: integer - refresh_token_lifetime: - type: integer - refresh_token_reuse_interval: - type: integer - platform_token_ttl: - type: integer - ProjectConfigBucket: + resource: + $ref: '#/components/schemas/ProjectHealthResource' + required: + - resource + ProjectHealthResponse: type: object - additionalProperties: false - description: | - Settings for an existing storage bucket. Buckets are never created or - deleted through the manifest. When `policies` is declared it is fully - synced (policies absent from the list are deleted; an empty list - deletes all); omitting `policies` leaves the bucket's policies - untouched. properties: - name: + project_id: type: string - pattern: ^[a-zA-Z0-9_-]+$ - minLength: 1 - maxLength: 64 - file_size_limit: - type: integer - format: int64 - description: Maximum file size in bytes - allowed_mime_types: + format: uuid + status: + $ref: '#/components/schemas/ProjectHealthStatus' + observed_at: + type: string + format: date-time + fresh_through: + type: string + format: date-time + data_status: + $ref: '#/components/schemas/ProjectHealthDataStatus' + checks: type: array items: - type: string - policies: + $ref: '#/components/schemas/ProjectHealthCheck' + findings: + description: Top findings ordered by severity, then stable check ID. type: array + maxItems: 5 items: - $ref: '#/components/schemas/ProjectConfigBucketPolicy' + $ref: '#/components/schemas/ProjectHealthCheck' required: - - name - ProjectConfigBucketPolicy: + - project_id + - status + - observed_at + - fresh_through + - data_status + - checks + - findings + ProjectHealthStatus: + type: string + description: empty means no functions, frontends, databases, storage, Volcano Auth users, or Sandbox resources are listed. needs_attention means an operation needs review without confirmed service impairment, or a serving frontend whose edge recovery gave up needs a redeploy. degraded means a resource is only partly available or is unavailable for an expected, temporary reason, such as a frontend whose edge synchronization did not complete or a database being restored; critical means use is blocked. A failed workflow or deployment record alone does not establish an outage. Findings remain available for empty projects. + enum: + - empty + - healthy + - needs_attention + - degraded + - critical + - unknown + ProjectHealthDataStatus: + type: string + enum: + - complete + - partial + - no_data + - stale + ProjectHealthCategory: + type: string + enum: + - lifecycle + - storage + ProjectHealthEvidence: type: object - additionalProperties: false properties: - name: - type: string - minLength: 1 - operation: + metric: type: string - enum: - - SELECT - - INSERT - - UPDATE - - DELETE - definition: + value: + type: number + format: double + unit: type: string - description: Policy expression + sample_count: + type: integer + format: int64 + minimum: 0 required: - - name - - operation - - definition - ProjectConfigCustomDomain: + - metric + - value + - unit + - sample_count + ProjectHealthCheck: type: object - additionalProperties: false - description: | - Custom domain with managed or BYOC TLS. `tls` is required - when the domain is first created and optional afterwards. For an existing - domain, omitting `tls` or sending only `tls.mode` keeps the stored - certificate; new BYOC material for the same domain rotates the - certificate in place (zero downtime). Changing `tls.mode` for the same - hostname switches an active domain in place (zero downtime); a domain - that is not yet active, or a managed domain changing hostname, must be - deleted first. BYOC TLS material is write-only; exports render only - `tls.mode`. properties: - domain: + id: type: string - maxLength: 253 - description: 'Fully-qualified domain name (hostname only, no scheme/path). Managed TLS (`tls.mode: managed`) accepts at most 219 characters; BYOC accepts 253.' - tls: - $ref: '#/components/schemas/ProjectConfigFrontendCustomDomainTLSConfig' + category: + $ref: '#/components/schemas/ProjectHealthCategory' + status: + $ref: '#/components/schemas/ProjectHealthStatus' + reason_code: + type: string + scope: + $ref: '#/components/schemas/ProjectHealthScope' + evidence: + $ref: '#/components/schemas/ProjectHealthEvidence' required: - - domain - ProjectConfigDatabase: + - id + - category + - status + - reason_code + - scope + - evidence + ProjectMetricsDataStatus: + type: string + enum: + - complete + - partial + - no_data + ProjectMetricsDimensions: type: object additionalProperties: false - description: | - Assertion-only entry for an existing database. No database property is - mutable through the manifest; declared values are compared against the - deployed database and any mismatch fails validation. Databases are - never created or deleted here. properties: - name: - type: string - minLength: 1 region: type: string - description: Deployed region ID (e.g. us-east-1). Asserted, never written; region IDs issued by earlier versions of the API match too. - pg_version: - type: string - enum: - - '15' - - '16' - - '17' - - '18' - description: | - PostgreSQL major version. Asserted, never written. Also accepts - versions new databases can no longer be created on, so an export - of an existing database re-applies. - database_type: + resource_type: type: string enum: - - volcano-db-xs - - volcano-db-s - - volcano-db-m - - volcano-db-l - - volcano-db-xl - - volcano-db-2xl - description: | - Compute tier. Asserted, never written - tier changes are not - supported via the manifest; use the databases API/CLI/GUI instead. - required: - - name + - function + - frontend + ProjectMetricsGroupBy: + type: string + enum: - region - - pg_version - ProjectConfigEmailTemplate: + - resource_type + ProjectMetricsMetric: + type: string + enum: + - request_count + - server_error_count + - availability + - p95_latency + ProjectMetricsQuery: type: object additionalProperties: false properties: - subject: - type: string - html_body: - type: string - maxLength: 262144 - description: HTML body. Max 256 KiB. SUPERAGENT plan required for custom bodies. - text_body: + id: type: string - maxLength: 262144 - description: Plain-text body. Max 256 KiB. SUPERAGENT plan required for custom bodies. - ProjectConfigEmailTemplates: - type: object - additionalProperties: false - description: | - Email templates keyed by type. Fully synced when declared - template - types absent from a declared map revert to server defaults (custom - bodies deleted, subject overrides cleared). Custom template bodies - require the SUPERAGENT plan; subject-only changes are available on HOBBY. - properties: - confirmation: - $ref: '#/components/schemas/ProjectConfigEmailTemplate' - password_reset: - $ref: '#/components/schemas/ProjectConfigEmailTemplate' - password_changed: - $ref: '#/components/schemas/ProjectConfigEmailTemplate' - welcome: - $ref: '#/components/schemas/ProjectConfigEmailTemplate' - ProjectConfigFrontend: + minLength: 1 + maxLength: 64 + pattern: ^[A-Za-z][A-Za-z0-9_-]*$ + metric: + $ref: '#/components/schemas/ProjectMetricsMetric' + group_by: + $ref: '#/components/schemas/ProjectMetricsGroupBy' + required: + - id + - metric + ProjectMetricsQueryRequest: type: object additionalProperties: false - description: | - 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. 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 - custom_domain: - $ref: '#/components/schemas/ProjectConfigCustomDomain' - function_routes: + time_range: + $ref: '#/components/schemas/ProjectMetricsQueryTimeRange' + queries: type: array - maxItems: 64 - description: Complete set of same-origin Function path mappings when declared. Omission preserves existing mappings; an empty list deletes all mappings. + minItems: 1 + maxItems: 10 items: - $ref: '#/components/schemas/ProjectConfigFrontendFunctionRoute' + $ref: '#/components/schemas/ProjectMetricsQuery' required: - - name - ProjectConfigFunction: + - time_range + - queries + ProjectMetricsQueryResponse: type: object additionalProperties: false - description: | - Configuration for an existing (deployed) function. Functions are never - created or deleted through the manifest. When `schedulers` is declared - it is fully synced (schedulers absent from the list are deleted); - omitting `schedulers` leaves the function's schedulers untouched. The - same applies to `variables`: declaring it replaces the function's - declared variable names, and omitting it leaves them untouched. properties: - name: + observed_at: type: string - minLength: 1 - kind: - $ref: '#/components/schemas/FunctionKind' - visibility: - $ref: '#/components/schemas/FunctionVisibility' - public: - type: boolean - deprecated: true - description: | - Deprecated alias for `visibility`: `true` means `public` and - `false` means `authenticated`, not `private`, so an entry left at - `false` applies `authenticated` on every apply; declare - `visibility: private` to keep a function private. Declaring both - with different meanings is an error. Exports write `visibility` - only. - variable_scope: + format: date-time + fresh_through: type: string - 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 - it selects: every name declared in `variables`, plus the names - Volcano detects in its source that the project defines. - variables: - type: array - items: - type: string - minLength: 1 - maxLength: 256 - description: | - Project variable names this function requires, on top of the ones - detected in its source. Declare a name here when the function reads - it through a computed key, which detection cannot see, or when the - function must not deploy without it: a declared name the project does - not define fails the apply, while a detected name it does not define - is ignored. Only used when `variable_scope` is `scoped`. - invocation_mode: - $ref: '#/components/schemas/FunctionInvocationMode' - http_auth_mode: - $ref: '#/components/schemas/FunctionHTTPAuthMode' - openapi_spec: - type: object - nullable: true - additionalProperties: true - x-go-type: nullable.Nullable[map[string]interface{}] - x-go-type-skip-optional-pointer: true - description: OpenAPI 3.0 or 3.1 metadata for an HTTP-mode function - schedulers: + format: date-time + window: + $ref: '#/components/schemas/ProjectMetricsWindow' + results: type: array items: - $ref: '#/components/schemas/ProjectConfigScheduler' + $ref: '#/components/schemas/ProjectMetricsResult' required: - - name - ProjectConfigHostedPage: + - observed_at + - window + - results + ProjectMetricsQueryTimeRange: type: object additionalProperties: false properties: - html: - type: string - maxLength: 262144 - description: Raw HTML markup for the page. Max 256 KiB. - css: + window: type: string - maxLength: 262144 - description: Optional CSS injected at render time. Max 256 KiB. + enum: + - 30m + - 1h + - 24h + - 7d required: - - html - ProjectConfigHostedPages: + - window + ProjectMetricsResult: type: object additionalProperties: false - description: | - Hosted auth pages keyed by page type (SUPERAGENT plan). Upsert-only: omitted - pages are left untouched (there is no delete for hosted pages). properties: - login: - $ref: '#/components/schemas/ProjectConfigHostedPage' - reset_password: - $ref: '#/components/schemas/ProjectConfigHostedPage' - signup: - $ref: '#/components/schemas/ProjectConfigHostedPage' - forgot_password: - $ref: '#/components/schemas/ProjectConfigHostedPage' - device: - $ref: '#/components/schemas/ProjectConfigHostedPage' - verify_email: - $ref: '#/components/schemas/ProjectConfigHostedPage' - PreviewAuthPageRequest: + id: + type: string + metric: + $ref: '#/components/schemas/ProjectMetricsMetric' + unit: + $ref: '#/components/schemas/ProjectMetricsUnit' + data_status: + $ref: '#/components/schemas/ProjectMetricsDataStatus' + values: + type: array + items: + $ref: '#/components/schemas/ProjectMetricsValue' + required: + - id + - metric + - unit + - data_status + - values + ProjectMetricsUnit: + type: string + enum: + - count + - ratio + - seconds + ProjectMetricsValue: type: object additionalProperties: false + properties: + dimensions: + $ref: '#/components/schemas/ProjectMetricsDimensions' + value: + type: number + format: double + minimum: 0 required: - - theme - - layout + - dimensions + - value + ProjectMetricsWindow: + type: object properties: - theme: - $ref: '#/components/schemas/AuthPageTheme' - layout: - $ref: '#/components/schemas/AuthPageLayout' - action: + from: type: string - PreviewAuthPageResponse: - type: object + format: date-time + to: + type: string + format: date-time required: - - preview_url - - expires_at + - from + - to + ProjectFrontendCustomDomain: + allOf: + - $ref: '#/components/schemas/FrontendCustomDomainResponse' + - type: object + properties: + frontend: + type: object + description: | + The frontend this custom domain is attached to. Inlined to + avoid a second fetch from the project-scoped feed. + properties: + id: + type: string + format: uuid + name: + type: string + required: + - id + - name + required: + - frontend + ProjectDeployment: + type: object + description: A Function or Frontend deployment attempt in a project-scoped feed. properties: - preview_url: + id: type: string - format: uri - expires_at: + format: uuid + project_id: + type: string + format: uuid + resource: + $ref: '#/components/schemas/ProjectDeploymentResource' + operation: + type: string + enum: + - deploy + - redeploy + - update + - delete + status: + type: string + enum: + - queued + - provisioning + - active + - degraded + - failed + - superseded + - deleting + - deleted + deploy_source: + type: string + enum: + - git + - cli + - web + - api + - system + - unknown + description: What initiated this deployment. + error_message: + type: string + completed_at: type: string format: date-time - ProjectConfigMissingResource: + progress: + $ref: '#/components/schemas/DeploymentProgress' + commit: + $ref: '#/components/schemas/DeploymentCommit' + git_deployment_run_id: + type: string + format: uuid + description: The Git deployment run that made this deployment. Absent for a deployment no Git deployment run made. + created_at: + type: string + format: date-time + updated_at: + type: string + format: date-time + required: + - id + - project_id + - resource + - operation + - status + - deploy_source + - created_at + - updated_at + ProjectDeploymentResource: type: object + description: The resource this deployment belongs to. properties: type: type: string enum: - function - frontend - - database - - bucket - - sandbox + id: + type: string + format: uuid name: type: string + kind: + allOf: + - $ref: '#/components/schemas/FunctionKind' + description: | + Which kind of function this deployment belongs to. Both kinds appear + in this feed under `type: function`, because a deployment means the + same thing for either, so this is what tells them apart. Absent when + `type` is `frontend`. required: - type + - id - name - ProjectConfigOAuthProvider: + ProjectDeploymentSummary: type: object - additionalProperties: false + description: Aggregate deployment statistics for one resource pipeline. properties: - provider: - type: string - enum: - - google - - github - - microsoft - - apple - - device - enabled: - type: boolean - client_id: - type: string - description: | - Required for non-device providers. Server-generated for - `provider=device` (exported read-only, ignored on apply). - client_secret: - type: string - format: password - writeOnly: true - description: Write-only; omitted from config export. Not used for `provider=device`. - redirect_url: - type: string - description: Not used for `provider=device`. - scopes: - type: array - items: - type: string + deployment_count: + type: integer + description: All deployment attempts matching the filters. + successful_count: + type: integer + description: Attempts that reached active or deleted. + failed_count: + type: integer + description: Attempts that reached failed or degraded. + canceled_count: + type: integer + description: Superseded attempts, excluded from success rate and duration. + success_rate: + type: number + format: double + minimum: 0 + maximum: 1 + nullable: true + description: Successful attempts divided by successful plus failed attempts. + median_build_duration_seconds: + type: number + format: double + minimum: 0 + nullable: true + description: Median build duration across eligible completed attempts. required: - - provider - ProjectConfigProject: + - deployment_count + - successful_count + - failed_count + - canceled_count + - success_rate + - median_build_duration_seconds + ProjectUsageResponse: type: object - additionalProperties: false - description: Project-level settings. `name` renames the project. + description: Aggregated usage metrics for a project. properties: - name: + project_id: type: string - pattern: ^[A-Za-z0-9_-]+$ - minLength: 1 - maxLength: 255 - all_regions: - type: boolean - description: Region policy. `false` requires `selected_regions` (SUPERAGENT plan). - selected_regions: + format: uuid + description: Project ID + month: + type: string + description: Usage month in YYYY-MM format + example: 2026-02 + metrics: type: array + description: Usage metrics for the project items: - type: string - description: Region subset (bare region names). Requires `all_regions=false`. - ProjectConfigRealtime: + $ref: '#/components/schemas/MetricUsageData' + frontends: + type: array + description: Per-frontend request totals for the current usage month + items: + $ref: '#/components/schemas/FrontendUsageData' + required: + - project_id + - month + - metrics + RealtimeConfig: type: object - additionalProperties: false + description: | + Realtime configuration for a project. + Note: Message size and channels per connection are plan-based (not configurable). properties: + project_id: + type: string + format: uuid + description: Project ID enabled: type: boolean + description: Whether realtime is enabled for this project + default: false broadcast_enabled: type: boolean + description: Whether broadcast channels are enabled + default: true presence_enabled: type: boolean + description: Whether presence tracking is enabled + default: true postgres_changes_enabled: type: boolean - ProjectConfigAutofix: + description: Whether Postgres change notifications are enabled + default: true + created_at: + type: string + format: date-time + description: When the configuration was created + updated_at: + type: string + format: date-time + description: When the configuration was last updated + RealtimePlanLimits: type: object - additionalProperties: false - description: 'AI diagnosis and fix settings. Omitted fields keep their current value. Your API key is never part of the manifest, and an apply never sets or deletes it: set it with `PUT /projects/{id}/autofix` before turning on a provider that runs on your own key.' + description: Plan-based limits for realtime features properties: - enabled: - type: boolean - max_stage: - $ref: '#/components/schemas/AutofixStage' - auto_trigger: - type: boolean - provider: - $ref: '#/components/schemas/AutofixProvider' - model: - $ref: '#/components/schemas/AutofixModel' - ProjectConfigScheduler: + plan: + type: string + description: Public plan name (HOBBY or SUPERAGENT). + example: HOBBY + max_connections: + type: integer + description: Maximum concurrent connections allowed + example: 100 + messages_per_month: + type: integer + description: Maximum messages per month + example: 1000000 + message_size_kb: + type: integer + description: Maximum message size in KB + example: 32 + channels_per_conn: + type: integer + description: Maximum channels per connection + example: 100 + RealtimeStats: + type: object + description: Realtime usage statistics for a project + properties: + num_connections: + type: integer + description: Current number of active connections + peak_connections: + type: integer + description: Peak concurrent connections this usage period + last_invoked_at: + type: string + format: date-time + description: Most recent realtime activity timestamp across channels + limits: + $ref: '#/components/schemas/RealtimePlanLimits' + ResolveFunctionResponse: type: object - additionalProperties: false properties: name: type: string - minLength: 1 - maxLength: 200 - cron: + maxLength: 63 + pattern: ^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$ + description: DNS-safe function name + function_id: + 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 in local development and when the deployment serves no public invocation domain; invoke through POST /functions/{functionId}/invoke instead.' + cache_ttl_seconds: + type: integer + minimum: 1 + description: Suggested SDK cache TTL for this name-to-ID mapping + required: + - name + - function_id + - cache_ttl_seconds + ScheduleRequest: + type: object + required: + - cron_expression + properties: + kind: + type: string + enum: + - cron + default: cron + cron_expression: + type: string + description: Standard 5-field cron expression evaluated in UTC. Seconds fields, descriptors, and Quartz syntax are not supported. + example: '*/5 * * * *' + ServiceKey: + type: object + description: | + Service role key for admin operations. + **WARNING:** Bypasses all RLS - backend use only! + properties: + id: + type: string + format: uuid + project_id: + type: string + format: uuid + name: + type: string + description: Descriptive name for the key + key_value: + type: string + description: | + Full JWT token for Authorization header. + Returned on create, get, and list (decrypted from storage). List + responses leave it out for a key that holds `ai.invoke` or `grants.mint`. + **Store securely - NEVER expose in frontend code!** + key_prefix: + type: string + description: First 12 characters of the key for display/identification + maxLength: 12 + permissions: + type: array + items: + type: string + description: | + Operations this key may perform. ["*"] grants full admin access + (default for keys created without an explicit scope). Scoped keys + list specific permissions, e.g. ["functions.invoke", "locks.manage"]. + example: + - '*' + created_at: + type: string + format: date-time + updated_at: type: string - description: 5-field UTC cron expression - enabled: - type: boolean - payload: - type: object - additionalProperties: true + format: date-time required: + - id - name - - cron - ProjectConfigSkippedResource: + - key_prefix + - permissions + StorageBucket: type: object + description: | + A named container for files within a project. + Public access is controlled at the file level via is_public on StorageObject. properties: - type: + id: type: string - enum: - - function - - frontend - - database - - bucket - - sandbox + format: uuid + project_id: + type: string + format: uuid name: type: string - reason: + description: Bucket name (unique within project) + pattern: ^[a-zA-Z0-9_-]+$ + minLength: 1 + maxLength: 64 + file_size_limit: + type: integer + format: int64 + nullable: true + description: Maximum file size in bytes (null for no limit) + allowed_mime_types: + type: array + nullable: true + items: + type: string + description: Allowed MIME types (null for all types) + last_invoked_at: + type: string + format: date-time + description: Most recent bucket operation timestamp + created_at: + type: string + format: date-time + updated_at: type: string + format: date-time required: - - type + - id - name - - reason - ProjectConfigValidationError: + StorageCopyRequest: type: object properties: - section: - type: string - description: Manifest section the error refers to (e.g. databases, functions). - name: + from: type: string - description: Resource name or key within the section, when applicable. - message: + description: Source path + to: type: string + description: Destination path required: - - section - - message - ProjectConfigValidationErrorResponse: + - from + - to + StorageListResponse: type: object - description: Returned when manifest validation fails. Nothing was applied. properties: - error: - type: string - errors: + objects: type: array items: - $ref: '#/components/schemas/ProjectConfigValidationError' + $ref: '#/components/schemas/StorageObject' + next_cursor: + type: string + description: Cursor for next page (empty if no more results) + StorageMoveRequest: + type: object + properties: + from: + type: string + description: Source path + to: + type: string + description: Destination path required: - - error - - errors - ProjectConfigVariable: + - from + - to + StorageObject: type: object - additionalProperties: false properties: - 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. + id: + type: string + format: uuid + bucket_id: + type: string + format: uuid name: type: string - description: Project variable name. Function runtime names such as AWS_REGION are reserved and fail validation; see the environment variables guide for the full list. - minLength: 1 - value: + description: Full path within bucket (e.g., "users/abc123/avatar.png") + owner_id: + type: string + format: uuid + nullable: true + description: Auth user who uploaded (null for anonymous/service) + is_public: + type: boolean + default: false + description: | + If true, the file can be downloaded with just an anon key (no user authentication). + Files are private by default. Only the owner or a service key can change visibility. + size: + type: integer + format: int64 + description: File size in bytes + mime_type: + type: string + description: MIME type + etag: + type: string + description: Entity tag for cache validation + metadata: + type: object + additionalProperties: true + description: | + Custom user metadata (key-value pairs). + Limits: Maximum 50 keys, maximum 10KB total serialized size. + created_at: + type: string + format: date-time + updated_at: + type: string + format: date-time + public_url: type: string + format: uri + description: | + Shareable public URL for this file (only set for public files with is_public=true). + This URL requires NO authentication and can be embedded in HTML, shared via email, etc. + The URL is properly URL-encoded by the server - use it as-is without additional encoding. required: + - id + - bucket_id - name - - value - ProjectHealthResource: + - is_public + - size + - mime_type + StorageObjectWithBucket: type: object + description: Storage object with bucket name included (for admin listing across buckets) properties: - type: - type: string - enum: - - project - - function - - frontend - - database - - database_branch id: type: string format: uuid + bucket_id: + type: string + format: uuid + bucket_name: + type: string + description: Name of the bucket containing this object name: type: string - kind: - allOf: - - $ref: '#/components/schemas/FunctionKind' + description: Full path within bucket + owner_id: + type: string + format: uuid + nullable: true + description: Auth user who uploaded (null for anonymous/service) + is_public: + type: boolean + default: false + size: + type: integer + format: int64 + description: File size in bytes + mime_type: + type: string + etag: + type: string + metadata: + type: object + additionalProperties: true + created_at: + type: string + format: date-time + updated_at: + type: string + format: date-time + public_url: + type: string + format: uri description: | - Which kind of function this check is about. Present only when `type` - is `function`, where both kinds share the name space and this is - what tells them apart. + Shareable public URL for this file (only set for public files with is_public=true). + This URL requires NO authentication and can be embedded in HTML, shared via email, etc. required: - - type - id + - bucket_id + - bucket_name - name - ResourceReference: + - is_public + - size + - mime_type + StoragePolicy: type: object - description: Stable reference to a Volcano resource. properties: - type: - type: string - enum: - - project - - function - - frontend - - database id: type: string format: uuid + bucket_id: + type: string + format: uuid name: type: string + description: Policy name (unique within bucket) + operation: + type: string + enum: + - SELECT + - INSERT + - UPDATE + - DELETE + description: Operation this policy applies to + definition: + type: string + description: | + Policy expression evaluated at request time. + Examples: + - "true" - Allow all + - "auth.uid() = owner_id" - Owner only + - "auth.role() = 'authenticated'" - Authenticated users + - "(storage.foldername(name))[1] = auth.uid()::text" - User's folder + created_at: + type: string + format: date-time + updated_at: + type: string + format: date-time required: - - type - id + - bucket_id - name - DeploymentReference: + - operation + - definition + StorageStats: type: object - description: Stable reference to a Volcano deployment run. + description: Aggregate storage statistics for a project properties: - id: - type: string - format: uuid + bucket_count: + type: integer + description: Number of storage buckets + object_count: + type: integer + description: Total number of stored files + total_size: + type: integer + format: int64 + description: Total storage used in bytes required: - - id - ProjectHealthScope: + - bucket_count + - object_count + - total_size + StorageVisibilityRequest: type: object properties: - resource: - $ref: '#/components/schemas/ProjectHealthResource' + is_public: + type: boolean + description: Whether the file should be publicly accessible required: - - resource - ProjectHealthResponse: + - is_public + UnbanUserResponse: type: object + description: Response when unbanning a user properties: - project_id: + message: + type: string + example: User unbanned successfully + user_id: type: string format: uuid - status: - $ref: '#/components/schemas/ProjectHealthStatus' - observed_at: + email: type: string - format: date-time - fresh_through: + format: email + status: type: string - format: date-time - data_status: - $ref: '#/components/schemas/ProjectHealthDataStatus' - checks: - type: array - items: - $ref: '#/components/schemas/ProjectHealthCheck' - findings: - description: Top findings ordered by severity, then stable check ID. - type: array - maxItems: 5 - items: - $ref: '#/components/schemas/ProjectHealthCheck' + enum: + - active required: - - project_id + - message + - user_id + - email - status - - observed_at - - fresh_through - - data_status - - checks - - findings - ProjectHealthStatus: - type: string - description: empty means no functions, frontends, databases, storage, Volcano Auth users, or Sandbox resources are listed. needs_attention means an operation needs review without confirmed service impairment, or a serving frontend whose edge recovery gave up needs a redeploy. degraded means a resource is only partly available or is unavailable for an expected, temporary reason, such as a frontend whose edge synchronization did not complete or a database being restored; critical means use is blocked. A failed workflow or deployment record alone does not establish an outage. Findings remain available for empty projects. - enum: - - empty - - healthy - - needs_attention - - degraded - - critical - - unknown - ProjectHealthDataStatus: - type: string - enum: - - complete - - partial - - no_data - - stale - ProjectHealthCategory: - type: string - enum: - - lifecycle - - storage - ProjectHealthEvidence: + TestEmailRequest: type: object - properties: - metric: - type: string - value: - type: number - format: double - unit: - type: string - sample_count: - type: integer - format: int64 - minimum: 0 required: - - metric - - value - - unit - - sample_count - ProjectHealthCheck: - type: object + - to_email + description: | + When `html_body` or `text_body` is provided the backend renders + those (plus optional `subject`) through html/text templates + against the standard `Data` (ProjectName, Name, SiteURL) + and sends the result — used by the template-editor "Send Test" + affordance to preview an unsaved template. When both bodies are + omitted a hardcoded diagnostic message is sent to verify SMTP + credentials and `subject` is ignored. Sending `subject` alone + (without a body) is rejected with 400. properties: - id: + to_email: type: string - category: - $ref: '#/components/schemas/ProjectHealthCategory' - status: - $ref: '#/components/schemas/ProjectHealthStatus' - reason_code: + format: email + x-go-type: string + description: Recipient address for the diagnostic email. + subject: type: string - scope: - $ref: '#/components/schemas/ProjectHealthScope' - evidence: - $ref: '#/components/schemas/ProjectHealthEvidence' - required: - - id - - category - - status - - reason_code - - scope - - evidence - ProjectMetricsDataStatus: - type: string - enum: - - complete - - partial - - no_data - ProjectMetricsDimensions: - type: object - additionalProperties: false - properties: - region: + description: | + Optional subject override, rendered as a text/template. Only + applied on the override path — requires `html_body` or + `text_body` to also be set, otherwise the request is + rejected with 400. + html_body: type: string - resource_type: + maxLength: 262144 + description: Optional HTML body override. Rendered as an html/template. Max 256 KiB. + text_body: type: string - enum: - - function - - frontend - ProjectMetricsGroupBy: - type: string - enum: - - region - - resource_type - ProjectMetricsMetric: - type: string - enum: - - request_count - - server_error_count - - availability - - p95_latency - ProjectMetricsQuery: + maxLength: 262144 + description: Optional plain-text body override. Rendered as a text/template. Max 256 KiB. + TestEmailResponse: type: object - additionalProperties: false - properties: - id: - type: string - minLength: 1 - maxLength: 64 - pattern: ^[A-Za-z][A-Za-z0-9_-]*$ - metric: - $ref: '#/components/schemas/ProjectMetricsMetric' - group_by: - $ref: '#/components/schemas/ProjectMetricsGroupBy' required: - - id - - metric - ProjectMetricsQueryRequest: + - success + properties: + success: + type: boolean + UpdateAuthConfigRequest: type: object - additionalProperties: false + description: 'All fields optional - only include fields you want to update. Validation rule: require_email_confirmation=true requires email_enabled=true.' properties: - time_range: - $ref: '#/components/schemas/ProjectMetricsQueryTimeRange' - queries: + access_token_lifetime: + type: integer + refresh_token_lifetime: + type: integer + refresh_token_reuse_interval: + type: integer + inactivity_timeout: + type: integer + max_session_duration: + type: integer + platform_token_ttl: + type: integer + description: TTL in seconds for platform tokens minted via `/auth/platform/exchange`. From 3600 (1 hour) to 31536000 (365 days). + minimum: 3600 + maximum: 31536000 + min_password_length: + type: integer + minimum: 15 + maximum: 128 + require_uppercase: + type: boolean + require_lowercase: + type: boolean + require_numbers: + type: boolean + require_special_chars: + type: boolean + enable_signup: + type: boolean + description: Master switch for signups across ALL providers + enable_email_password: + type: boolean + description: Enable/disable email/password provider + rate_limit_signup: + type: integer + rate_limit_signin: + type: integer + rate_limit_token_refresh: + type: integer + rate_limit_password_reset: + type: integer + description: Password reset requests per hour per IP. Unlike the other limits, 0 applies the default of 10 instead of turning the limit off. + cors_enabled: + type: boolean + cors_allowed_origins: type: array - minItems: 1 - maxItems: 10 + description: Replaces the allowed origins list. items: - $ref: '#/components/schemas/ProjectMetricsQuery' - required: - - time_range - - queries - ProjectMetricsQueryResponse: - type: object - additionalProperties: false - properties: - observed_at: - type: string - format: date-time - fresh_through: - type: string - format: date-time - window: - $ref: '#/components/schemas/ProjectMetricsWindow' - results: + type: string + example: + - https://myapp.com + - http://localhost:3000 + cors_allow_credentials: + type: boolean + cors_max_age: + type: integer + cors_allow_frontend_previews: + type: boolean + description: Allow the origins of the project's own live frontend previews. + enable_anonymous_signins: + type: boolean + allowed_email_domains: type: array + maxItems: 100 + description: | + Replaces the email domain allowlist. Empty array removes the + restriction so any domain can sign up. Entries must be bare domains + such as `domain1.com` and are stored normalized (lowercase, no `@` + prefix); matching is exact, so subdomains need their own entry. At + most 100 entries. + + Restricting signups is a SUPERAGENT feature to configure and to enforce: a + HOBBY project can only remove the restriction and gets 403 for any + other change, and the list it keeps is parked until it upgrades. items: - $ref: '#/components/schemas/ProjectMetricsResult' - required: - - observed_at - - window - - results - ProjectMetricsQueryTimeRange: - type: object - additionalProperties: false - properties: - window: + type: string + example: + - domain1.com + - domain2.com + allowed_email_domains_mode: type: string + description: | + How far `allowed_email_domains` reaches. `signup` gates account + creation only. `signup_and_signin` also blocks sign-in for accounts + outside the list; switching to it, or narrowing the list while in + it, deletes the sessions of every account it locks out. `disabled` + keeps the list without enforcing it. enum: - - 30m - - 1h - - 24h - - 7d - required: - - window - ProjectMetricsResult: - type: object - additionalProperties: false - properties: - id: + - disabled + - signup + - signup_and_signin + allow_password_reset: + type: boolean + password_reset_timeout: + type: integer + max_password_history: + type: integer + require_email_confirmation: + type: boolean + description: Require users to confirm email before sign-in. Can only be true when email_enabled is true. + email_confirmation_timeout: + type: integer + description: Email confirmation token expiry in seconds. + auto_link_verified_oauth: + type: boolean + description: Link a verified OAuth identity to an existing confirmed account with the same email instead of returning a conflict. Requires require_email_confirmation to be true. + email_enabled: + type: boolean + description: Enable transactional email sending. Cannot be false while require_email_confirmation is true. + email_from_address: type: string - metric: - $ref: '#/components/schemas/ProjectMetricsMetric' - unit: - $ref: '#/components/schemas/ProjectMetricsUnit' - data_status: - $ref: '#/components/schemas/ProjectMetricsDataStatus' - values: - type: array - items: - $ref: '#/components/schemas/ProjectMetricsValue' - required: - - id - - metric - - unit - - data_status - - values - ProjectMetricsUnit: - type: string - enum: - - count - - ratio - - seconds - ProjectMetricsValue: - type: object - additionalProperties: false - properties: - dimensions: - $ref: '#/components/schemas/ProjectMetricsDimensions' - value: - type: number - format: double - minimum: 0 - required: - - dimensions - - value - ProjectMetricsWindow: - type: object - properties: - from: + description: Sender email address. New or changed values containing carriage returns or newlines return 400. Unchanged stored or exported values are preserved. Leading and trailing whitespace in previously saved settings is ignored when sending. + email_from_name: type: string - format: date-time - to: + description: Sender display name; supports punctuation and Unicode. New or changed values containing carriage returns or newlines return 400. Unchanged stored or exported values are preserved. Leading and trailing whitespace in previously saved settings is ignored when sending. + smtp_host: type: string - format: date-time - required: - - from - - to - ProjectFrontendCustomDomain: - allOf: - - $ref: '#/components/schemas/FrontendCustomDomainResponse' - - type: object - properties: - frontend: - type: object - description: | - The frontend this custom domain is attached to. Inlined to - avoid a second fetch from the project-scoped feed. - properties: - id: - type: string - format: uuid - name: - type: string - required: - - id - - name - required: - - frontend - ProjectDeployment: - type: object - description: A Function or Frontend deployment attempt in a project-scoped feed. - properties: - id: + description: SMTP server host name or IP address. Outside local mode, Volcano connects only to public internet addresses, and a host that is, or resolves to, a loopback, private, link-local, or other non-public address fails delivery. + smtp_port: + type: integer + smtp_username: type: string - format: uuid - project_id: + smtp_password: type: string - format: uuid - resource: - $ref: '#/components/schemas/ProjectDeploymentResource' - operation: + format: password + writeOnly: true + minLength: 1 + description: Replacement SMTP password. Omit this field to preserve the configured password. The value is encrypted at rest and never returned. + smtp_use_tls: + type: boolean + email_confirmation_subject: type: string - enum: - - deploy - - redeploy - - update - - delete - status: + description: Subject template. For new or changed values, literal interior carriage returns or newlines after Go template whitespace trimming return 400. Outer whitespace and trailing block-scalar newlines are allowed. Unchanged stored subjects are preserved. + email_password_reset_subject: type: string - enum: - - queued - - provisioning - - active - - degraded - - failed - - superseded - - deleting - - deleted - deploy_source: + description: Subject template. For new or changed values, literal interior carriage returns or newlines after Go template whitespace trimming return 400. Outer whitespace and trailing block-scalar newlines are allowed. Unchanged stored subjects are preserved. + email_password_changed_subject: type: string - enum: - - git - - cli - - web - - api - - system - - unknown - description: What initiated this deployment. - error_message: + description: Subject template. For new or changed values, literal interior carriage returns or newlines after Go template whitespace trimming return 400. Outer whitespace and trailing block-scalar newlines are allowed. Unchanged stored subjects are preserved. + managed_auth_enabled: + type: boolean + description: Enable or disable managed auth hosted pages for the project. + post_auth_redirect_url: type: string - completed_at: + description: Must be included in allowed_redirect_urls when set. + allowed_redirect_urls: + type: array + items: + type: string + description: Redirect allowlist. Every entry must be a valid http/https URL. + post_logout_redirect_url: type: string - format: date-time - progress: - $ref: '#/components/schemas/DeploymentProgress' - created_at: + description: Must be included in allowed_redirect_urls when set. + device_verification_url: type: string - format: date-time - updated_at: + description: | + Optional custom device-authorization verification page. Must be a + valid http/https URL (not tied to allowed_redirect_urls). When set, + device-code logins return this URL (with user_code) instead of the + managed device page. Send an empty string to clear the override. + UpdateAuthHostedPageRequest: + type: object + required: + - html + properties: + html: type: string - format: date-time + description: Raw HTML markup for the page. Max 256 KiB. + css: + type: string + description: Optional CSS injected at render time. Max 256 KiB. + UpdateAuthPageLayoutRequest: + type: object + additionalProperties: false + required: + - layout + properties: + layout: + $ref: '#/components/schemas/AuthPageLayout' + UpdateAuthPageThemeRequest: + type: object + additionalProperties: false required: - - id - - project_id - - resource - - operation - - status - - deploy_source - - created_at - - updated_at - ProjectDeploymentResource: + - theme + properties: + theme: + $ref: '#/components/schemas/AuthPageTheme' + UpdateDatabaseTypeRequest: type: object - description: The resource this deployment belongs to. + description: Update database compute size tier properties: - type: + database_type: type: string + description: New compute size tier enum: - - function - - frontend - id: + - volcano-db-xs + - volcano-db-s + - volcano-db-m + - volcano-db-l + - volcano-db-xl + - volcano-db-2xl + example: volcano-db-m + required: + - database_type + UpdateEmailTemplateRequest: + type: object + properties: + subject: type: string - format: uuid - name: + description: Subject template. For new or changed values, literal interior carriage returns or newlines after Go template whitespace trimming return 400. Outer whitespace and trailing block-scalar newlines are allowed. Unchanged stored subjects are preserved. + html_body: type: string - kind: - allOf: - - $ref: '#/components/schemas/FunctionKind' - description: | - Which kind of function this deployment belongs to. Both kinds appear - in this feed under `type: function`, because a deployment means the - same thing for either, so this is what tells them apart. Absent when - `type` is `frontend`. - required: - - type - - id - - name - ProjectDeploymentSummary: + text_body: + type: string + UpdateFunctionRequest: type: object - description: Aggregate deployment statistics for one resource pipeline. + additionalProperties: false + minProperties: 1 properties: - deployment_count: - type: integer - description: All deployment attempts matching the filters. - successful_count: - type: integer - description: Attempts that reached active or deleted. - failed_count: - type: integer - description: Attempts that reached failed or degraded. - canceled_count: - type: integer - description: Superseded attempts, excluded from success rate and duration. - success_rate: - type: number - format: double - minimum: 0 - maximum: 1 - nullable: true - description: Successful attempts divided by successful plus failed attempts. - median_build_duration_seconds: - type: number - format: double - minimum: 0 + visibility: + $ref: '#/components/schemas/FunctionVisibility' + is_public: + type: boolean + deprecated: true + description: | + Deprecated alias for `visibility`: `true` means `public` and + `false` means `authenticated`. Sending both with different meanings + returns 400. + invocation_mode: + $ref: '#/components/schemas/FunctionInvocationMode' + http_auth_mode: + $ref: '#/components/schemas/FunctionHTTPAuthMode' + openapi_spec: + type: object nullable: true - description: Median build duration across eligible completed attempts. - required: - - deployment_count - - successful_count - - failed_count - - canceled_count - - success_rate - - median_build_duration_seconds - ProjectUsageResponse: + additionalProperties: true + description: OpenAPI 3.0 or 3.1 metadata for HTTP mode. Send null to clear it. + UpdateFunctionSchedulerRequest: type: object - description: Aggregated usage metrics for a project. properties: - project_id: + name: type: string - format: uuid - description: Project ID - month: + maxLength: 200 + enabled: + type: boolean + schedule: + $ref: '#/components/schemas/ScheduleRequest' + payload: + type: object + additionalProperties: true + regions: + type: array + maxItems: 1 + items: + type: string + UpdateOAuthConfigRequest: + type: object + properties: + client_id: type: string - description: Usage month in YYYY-MM format - example: 2026-02 - metrics: + description: Supported for non-device providers. Not supported for `provider=device`. + client_secret: + type: string + description: Supported for non-device providers. Not supported for `provider=device`. + redirect_url: + type: string + format: uri + scopes: type: array - description: Usage metrics for the project items: - $ref: '#/components/schemas/MetricUsageData' - frontends: + type: string + enabled: + type: boolean + UpdateProjectRequest: + type: object + description: Update mutable project fields (name and/or region policy) + properties: + name: + type: string + minLength: 1 + maxLength: 255 + example: my-awesome-app-renamed + all_regions: + type: boolean + description: | + If omitted and `selected_regions` is also omitted, existing region policy is preserved. + If `selected_regions` is provided without `all_regions`, it is treated as subset mode. + selected_regions: type: array - description: Per-frontend request totals for the current usage month items: - $ref: '#/components/schemas/FrontendUsageData' - required: - - project_id - - month - - metrics - RealtimeConfig: + type: string + description: | + Region subset for project deployments. + Provide with `all_regions=false`. + example: + - us-east-1 + UpdateRealtimeConfigRequest: type: object description: | - Realtime configuration for a project. - Note: Message size and channels per connection are plan-based (not configurable). + Request to update realtime configuration. + Limits (message size, channels per connection) are plan-based and cannot be configured. properties: - project_id: - type: string - format: uuid - description: Project ID enabled: type: boolean description: Whether realtime is enabled for this project - default: false broadcast_enabled: type: boolean description: Whether broadcast channels are enabled - default: true presence_enabled: type: boolean description: Whether presence tracking is enabled - default: true postgres_changes_enabled: type: boolean description: Whether Postgres change notifications are enabled - default: true - created_at: - type: string - format: date-time - description: When the configuration was created - updated_at: + UpdateStorageBucketRequest: + type: object + properties: + file_size_limit: + type: integer + format: int64 + allowed_mime_types: + type: array + items: + type: string + UpdateVariableRequest: + type: object + properties: + 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. + value: type: string - format: date-time - description: When the configuration was last updated - RealtimePlanLimits: + required: + - value + UploadSessionPart: type: object - description: Plan-based limits for realtime features + description: Information about an uploaded part properties: - plan: + part_number: + type: integer + description: Part number (1-10000) + etag: type: string - description: Public plan name (HOBBY or SUPERAGENT). - example: HOBBY - max_connections: + description: ETag of the uploaded part + size: type: integer - description: Maximum concurrent connections allowed - example: 100 - messages_per_month: + format: int64 + description: Size of the part in bytes + UploadSessionStatusResponse: + type: object + description: Status of an upload session + properties: + session_id: + type: string + description: Upload session ID + status: + type: string + enum: + - pending + - uploading + - completing + - completed + - aborted + description: Current status of the upload + path: + type: string + description: Target file path + content_type: + type: string + description: MIME type + total_size: type: integer - description: Maximum messages per month - example: 1000000 - message_size_kb: + format: int64 + description: Total file size in bytes + part_size: type: integer - description: Maximum message size in KB - example: 32 - channels_per_conn: + format: int64 + description: Size of each part (except last) + total_parts: type: integer - description: Maximum channels per connection - example: 100 - RealtimeStats: - type: object - description: Realtime usage statistics for a project - properties: - num_connections: + description: Total number of parts + parts_uploaded: type: integer - description: Current number of active connections - peak_connections: + description: Number of parts uploaded + bytes_uploaded: type: integer - description: Peak concurrent connections this usage period - last_invoked_at: + format: int64 + description: Total bytes uploaded so far + parts: + type: array + description: List of uploaded parts (for resume) + items: + $ref: '#/components/schemas/UploadSessionPart' + expires_at: type: string format: date-time - description: Most recent realtime activity timestamp across channels - limits: - $ref: '#/components/schemas/RealtimePlanLimits' - ResolveFunctionResponse: + description: Session expiry time + created_at: + type: string + format: date-time + description: Session creation time + UsageDataPoint: type: object + description: A single timestamped usage value. properties: - name: - type: string - maxLength: 63 - pattern: ^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$ - description: DNS-safe function name - function_id: - type: string - format: uuid - description: Canonical function ID used for invocation routing - invoke_url: + timestamp: 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: + format: date-time + description: UTC timestamp for the data point + value: type: integer - minimum: 1 - description: Suggested SDK cache TTL for this name-to-ID mapping - required: - - name - - function_id - - cache_ttl_seconds - ScheduleRequest: - type: object + format: int64 + description: Usage value at the timestamp required: - - cron_expression - properties: - kind: - type: string - enum: - - cron - default: cron - cron_expression: - type: string - description: Standard 5-field cron expression evaluated in UTC. Seconds fields, descriptors, and Quartz syntax are not supported. - example: '*/5 * * * *' - ServiceKey: + - timestamp + - value + Variable: type: object - description: | - Service role key for admin operations. - **WARNING:** Bypasses all RLS - backend use only! properties: + 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 @@ -25534,27 +37720,34 @@ components: format: uuid name: type: string - description: Descriptive name for the key - key_value: + maxLength: 256 + value: type: string - description: | - Full JWT token for Authorization header. - Returned on create, get, and list (decrypted from storage). - **Store securely - NEVER expose in frontend code!** - key_prefix: + status: type: string - description: First 12 characters of the key for display/identification - maxLength: 12 - permissions: - type: array - items: - type: string - description: | - Operations this key may perform. ["*"] grants full admin access - (default for keys created without an explicit scope). Scoped keys - list specific permissions, e.g. ["functions.invoke", "locks.manage"]. - example: - - '*' + enum: + - provisioning + - active + - failed + description: Latest project variable propagation status, when a sync has run. + current_sync_id: + type: string + format: uuid + description: Identifier of the latest variable propagation sync. + provisioning_started_at: + type: string + format: date-time + description: Timestamp when the current variable propagation phase started. + deploy_source: + type: string + enum: + - git + - cli + - web + - api + - system + - unknown + description: What initiated the latest variable propagation sync, when one has run. created_at: type: string format: date-time @@ -25563,1375 +37756,1478 @@ components: format: date-time required: - id + - project_id - name - - key_prefix - - permissions - StorageBucket: + - value + - created_at + - updated_at + OpenAPISpecDocument: type: object + additionalProperties: true description: | - A named container for files within a project. - Public access is controlled at the file level via is_public on StorageObject. + This OpenAPI document, with every reference resolved. Shared by the JSON + and YAML operations, which differ only in serialization. + SandboxSessionExecutions: + type: object + additionalProperties: false + description: How the session's command executions are kept. Fixed when the session is created. properties: - id: + keep_output: + type: boolean + description: When false, every command in the session keeps no output. stdout and stderr are returned once in the command's response, and Volcano's control plane never stores them in the execution journal, database, logs or traces. This does not cover the Sandbox's memory or a suspended session's snapshot. A retry with the same Idempotency-Key returns the exit code with empty streams. A command in such a session that sets `keep_output` to true is refused with 400 and code `sandbox_session_keeps_no_output`. False is refused with 400 and code `feature_unavailable` while the `sandboxes.output_not_kept` capability is unavailable. + required: + - keep_output + ProjectTemplateInstallationSource: + type: object + description: The share release a fork was installed from. + required: + - kind + - share_id + - release_id + properties: + kind: type: string - format: uuid - project_id: + enum: + - share_release + share_id: + type: string + description: The share the release belongs to. + release_id: type: string format: uuid - name: + description: The release the project was installed from. + ProjectTemplateInstallation: + type: object + description: | + Template initialization progress, returned by project creation and the + individual project endpoint. Omitted for projects without a template. + Project creation accepts the installation; wait for `ready` before use. + A failed installation retains the project for inspection or deletion. + required: + - status + - phase + properties: + status: type: string - description: Bucket name (unique within project) - pattern: ^[a-zA-Z0-9_-]+$ - minLength: 1 - maxLength: 64 - file_size_limit: + enum: + - pending + - running + - ready + - failed + phase: + type: string + enum: + - database + - restore + - configure + - deploy + - verify + - ready + source: + $ref: '#/components/schemas/ProjectTemplateInstallationSource' + failure_code: + type: string + example: source_withdrawn + description: | + Why the installation failed. Present only when `status` is `failed`, and + absent for installations that failed before Volcano recorded a reason. + New codes can be added, so treat an unknown one as a generic failure. + `source_withdrawn`: the deploy link was switched off or deleted, or its + project is being deleted. `source_invalid`: the source failed Volcano's checks, + such as a release archive whose digest, size or contents are wrong. + `source_access_lost`: Volcano can no longer read the source repository. + `invalid_source_configuration`: the source's `volcano-config.yaml` is + invalid, or it declares a variable the new project does not have. + `nothing_to_deploy`: the source has no function or frontend. + `database_not_supported`: the source ships database SQL. + `function_deploy_refused`: a function in the source cannot be deployed + as defined. `function_quota_exceeded`, + `durable_function_quota_exceeded`, `frontend_quota_exceeded`, + `frontend_deploy_limit` and `build_minutes_exceeded`: the project + reached a plan limit. `build_failed`: a function or frontend from the + source failed to build or deploy; its deployment's build logs say why. + `retry_budget_exhausted`: the installation kept failing and Volcano + stopped retrying. `internal_error`: Volcano failed for a reason of its + own. + ProjectGitConnectionSummary: + type: object + properties: + repo_installation_id: type: integer format: int64 - nullable: true - description: Maximum file size in bytes (null for no limit) - allowed_mime_types: + repo_id: + type: integer + format: int64 + repo_full_name: + type: string + root_directory: + type: string + production_branch: + type: string + updated_at: + type: string + format: date-time + description: 'When the connection last changed: its repository, root directory or production branch. Naming the branch it already uses, and other changes to the project, leave it alone. A connection that has not changed since Volcano began tracking this reports the project''s last change before then.' + required: + - repo_installation_id + - repo_id + - repo_full_name + - root_directory + - production_branch + - updated_at + ProjectHealthSummary: + type: object + properties: + status: + $ref: '#/components/schemas/ProjectHealthStatus' + required: + - status + FunctionKind: + type: string + enum: + - standard + - durable + default: standard + description: | + Which kind of function this is. `standard` runs once per invocation. + `durable` checkpoints its progress and resumes from the last completed + step, and is invoked asynchronously through its own executions + collection. A function's kind is fixed when it is created and cannot be + changed afterwards. Omitting this field means `standard`. + UpdateNotificationEmail: + type: object + additionalProperties: false + properties: + enabled: + type: boolean + recipients: type: array - nullable: true + maxItems: 10 items: type: string - description: Allowed MIME types (null for all types) - last_invoked_at: - type: string - format: date-time - description: Most recent bucket operation timestamp - created_at: - type: string - format: date-time - updated_at: - type: string - format: date-time - required: - - id - - name - StorageCopyRequest: + format: email + maxLength: 254 + description: Only the project owner's verified account email address is supported. An empty list, or one naming only that address, emails the owner and is saved as an empty list. Any other list is refused as invalid. + UpdateNotificationWebhook: type: object + additionalProperties: false properties: - from: - type: string - description: Source path - to: + url: type: string - description: Destination path - required: - - from - - to - StorageListResponse: + maxLength: 2048 + pattern: ^\s*(|[hH][tT][tT][pP][sS]?://.+)\s*$ + description: An `http` or `https` URL. Surrounding whitespace is trimmed. An empty string removes the webhook and its secret. + SchedulerFailureNotifyOn: + type: string + enum: + - first_failure + - consecutive_failures + x-enum-varnames: + - SchedulerFailureNotifyOnFirstFailure + - SchedulerFailureNotifyOnConsecutiveFailures + description: 'When a failing scheduler is announced: on its first failed run, or once `threshold` runs in a row have failed. Either way a streak is announced once, and a scheduler is announced failing at most once an hour.' + UpdateSchedulerFailureAlertPolicy: type: object + additionalProperties: false properties: - objects: - type: array - items: - $ref: '#/components/schemas/StorageObject' - next_cursor: - type: string - description: Cursor for next page (empty if no more results) - StorageMoveRequest: + notify_on: + $ref: '#/components/schemas/SchedulerFailureNotifyOn' + threshold: + type: integer + minimum: 1 + maximum: 100 + notify_on_recovery: + type: boolean + ProjectConfigNotifications: type: object + additionalProperties: false + description: 'Where the project''s alerts go and when a failing scheduler is announced. Omitted fields keep their current value. The webhook signing secret is never part of the manifest: setting `webhook.url` on a project without a webhook generates one that is never shown. Rotate it with `POST /projects/{id}/notifications/webhook-secret` to get a secret you can use.' properties: - from: - type: string - description: Source path - to: - type: string - description: Destination path - required: - - from - - to - StorageObject: + email: + $ref: '#/components/schemas/UpdateNotificationEmail' + webhook: + $ref: '#/components/schemas/UpdateNotificationWebhook' + scheduler_failures: + $ref: '#/components/schemas/UpdateSchedulerFailureAlertPolicy' + AuthPageThemeColors: type: object + additionalProperties: false + required: + - background + - surface + - text + - accent + - accent_text properties: - id: - type: string - format: uuid - bucket_id: - type: string - format: uuid - name: - type: string - description: Full path within bucket (e.g., "users/abc123/avatar.png") - owner_id: + background: type: string - format: uuid - nullable: true - description: Auth user who uploaded (null for anonymous/service) - is_public: - type: boolean - default: false - description: | - If true, the file can be downloaded with just an anon key (no user authentication). - Files are private by default. Only the owner or a service key can change visibility. - size: - type: integer - format: int64 - description: File size in bytes - mime_type: + pattern: ^#[0-9a-fA-F]{6}$ + surface: type: string - description: MIME type - etag: + pattern: ^#[0-9a-fA-F]{6}$ + text: type: string - description: Entity tag for cache validation - metadata: - type: object - additionalProperties: true - description: | - Custom user metadata (key-value pairs). - Limits: Maximum 50 keys, maximum 10KB total serialized size. - created_at: + pattern: ^#[0-9a-fA-F]{6}$ + accent: type: string - format: date-time - updated_at: + pattern: ^#[0-9a-fA-F]{6}$ + accent_text: type: string - format: date-time - public_url: + pattern: ^#[0-9a-fA-F]{6}$ + ProjectConfigAuthPageLayouts: + type: object + additionalProperties: false + properties: + login: + $ref: '#/components/schemas/AuthPageLayout' + signup: + $ref: '#/components/schemas/AuthPageLayout' + forgot_password: + $ref: '#/components/schemas/AuthPageLayout' + device: + $ref: '#/components/schemas/AuthPageLayout' + verify_email: + $ref: '#/components/schemas/AuthPageLayout' + reset_password: + $ref: '#/components/schemas/AuthPageLayout' + ProjectConfigAuthPageAppearance: + type: object + additionalProperties: false + properties: + theme: + $ref: '#/components/schemas/AuthPageTheme' + layouts: + $ref: '#/components/schemas/ProjectConfigAuthPageLayouts' + ManagedProjectConfigFrontendCustomDomainTLSConfig: + type: object + description: Volcano issues and renews the certificate. Certificate fields are not allowed. + additionalProperties: false + properties: + mode: type: string - format: uri - description: | - Shareable public URL for this file (only set for public files with is_public=true). - This URL requires NO authentication and can be embedded in HTML, shared via email, etc. - The URL is properly URL-encoded by the server - use it as-is without additional encoding. + enum: + - managed required: - - id - - bucket_id - - name - - is_public - - size - - mime_type - StorageObjectWithBucket: + - mode + BYOCProjectConfigFrontendCustomDomainTLSConfig: type: object - description: Storage object with bucket name included (for admin listing across buckets) + description: 'Your own certificate. Send `certificate_pem` and `private_key_pem` together, with an optional `certificate_chain_pem`, to create the domain or rotate its certificate. For an existing BYOC domain, `mode: byoc` without certificate fields keeps the stored certificate; exports render only the mode.' + additionalProperties: false + not: + anyOf: + - required: + - certificate_pem + not: + required: + - private_key_pem + - required: + - private_key_pem + not: + required: + - certificate_pem + - required: + - certificate_chain_pem + not: + required: + - certificate_pem + - private_key_pem properties: - id: + mode: type: string - format: uuid - bucket_id: + enum: + - byoc + description: Optional; a TLS block without `mode` is BYOC. + certificate_pem: type: string - format: uuid - bucket_name: + maxLength: 65536 + description: PEM-encoded certificate for create or rotation. Requires private_key_pem. Omitted from exports. + private_key_pem: type: string - description: Name of the bucket containing this object - name: + maxLength: 65536 + description: PEM-encoded private key for create or rotation. Requires certificate_pem. Omitted from exports. + certificate_chain_pem: type: string - description: Full path within bucket - owner_id: + maxLength: 65536 + description: Optional PEM-encoded certificate chain. Requires certificate_pem and private_key_pem. Omitted from exports. + ProjectConfigFrontendCustomDomainTLSConfig: + description: TLS for the custom domain. `mode` defaults to `byoc` when omitted. + oneOf: + - $ref: '#/components/schemas/ManagedProjectConfigFrontendCustomDomainTLSConfig' + - $ref: '#/components/schemas/BYOCProjectConfigFrontendCustomDomainTLSConfig' + ProjectConfigFrontendFunctionRoute: + type: object + additionalProperties: false + properties: + function: type: string - format: uuid - nullable: true - description: Auth user who uploaded (null for anonymous/service) - is_public: + minLength: 1 + description: Name of an existing public standard Function configured for HTTP invocation. + path_prefix: + type: string + minLength: 2 + maxLength: 512 + pattern: ^/[^?#\\]*[^/?#\\]$ + strip_prefix: type: boolean default: false - size: - type: integer - format: int64 - description: File size in bytes - mime_type: - type: string - etag: - type: string - metadata: - type: object - additionalProperties: true - created_at: - type: string - format: date-time - updated_at: - type: string - format: date-time - public_url: - type: string - format: uri - description: | - Shareable public URL for this file (only set for public files with is_public=true). - This URL requires NO authentication and can be embedded in HTML, shared via email, etc. required: - - id - - bucket_id - - bucket_name - - name - - is_public - - size - - mime_type - StoragePolicy: + - function + - path_prefix + ProjectConfigFrontendRoute: type: object + additionalProperties: false properties: - id: - type: string - format: uuid - bucket_id: - type: string - format: uuid - name: - type: string - description: Policy name (unique within bucket) - operation: - type: string - enum: - - SELECT - - INSERT - - UPDATE - - DELETE - description: Operation this policy applies to - definition: - type: string - description: | - Policy expression evaluated at request time. - Examples: - - "true" - Allow all - - "auth.uid() = owner_id" - Owner only - - "auth.role() = 'authenticated'" - Authenticated users - - "(storage.foldername(name))[1] = auth.uid()::text" - User's folder - created_at: + frontend: type: string - format: date-time - updated_at: + minLength: 1 + description: Name of another existing frontend in the project to mount. Paths are forwarded unchanged. + path_prefix: type: string - format: date-time + minLength: 2 + maxLength: 512 + pattern: ^/[^?#\\]*[^/?#\\]$ required: - - id - - bucket_id - - name - - operation - - definition - StorageStats: + - frontend + - path_prefix + ProjectConfigSandbox: type: object - description: Aggregate storage statistics for a project + additionalProperties: false + required: + - name properties: - bucket_count: - type: integer - description: Number of storage buckets - object_count: + name: + type: string + pattern: ^[a-z][a-z0-9-]{0,62}$ + description: Name of an existing sandbox template or matching Git source directory. + memory_mb: type: integer - description: Total number of stored files - total_size: + enum: + - 1024 + - 2048 + description: Immutable deployed memory profile; config apply asserts it and Git deploy builds it. + ports: + type: array + uniqueItems: true + maxItems: 16 + description: Service readiness ports; config apply asserts them and Git deploy builds them. + items: + type: integer + minimum: 1 + maximum: 65532 + ttl_seconds: type: integer - format: int64 - description: Total storage used in bytes - required: - - bucket_count - - object_count - - total_size - StorageVisibilityRequest: - type: object - properties: - is_public: - type: boolean - description: Whether the file should be publicly accessible - required: - - is_public - UnbanUserResponse: + minimum: 0 + maximum: 2147483647 + description: Default absolute lifetime for new sessions when the caller omits it. Cloud templates accept 30–28800 seconds; inherited lifetimes are clamped to the session plan limit (3600 for HOBBY, 28800 for SUPERAGENT). Local accepts 0 for unlimited or a positive lifetime. + DatabaseQueryPerformanceDatabase: type: object - description: Response when unbanning a user properties: - message: - type: string - example: User unbanned successfully - user_id: + id: type: string format: uuid - email: - type: string - format: email - status: + name: type: string - enum: - - active required: - - message - - user_id - - email - - status - TestEmailRequest: + - id + - name + DatabaseQueryPerformanceItem: type: object - required: - - to_email - description: | - When `html_body` or `text_body` is provided the backend renders - those (plus optional `subject`) through html/text templates - against the standard `Data` (ProjectName, Name, SiteURL) - and sends the result — used by the template-editor "Send Test" - affordance to preview an unsaved template. When both bodies are - omitted a hardcoded diagnostic message is sent to verify SMTP - credentials and `subject` is ignored. Sending `subject` alone - (without a body) is rejected with 400. properties: - to_email: - type: string - format: email - description: Recipient address for the diagnostic email. - subject: + query_id: type: string - description: | - Optional subject override, rendered as a text/template. Only - applied on the override path — requires `html_body` or - `text_body` to also be set, otherwise the request is - rejected with 400. - html_body: + description: pg_stat_statements query identifier. + query: type: string - maxLength: 262144 - description: Optional HTML body override. Rendered as an html/template. Max 256 KiB. - text_body: + maxLength: 8192 + description: Normalized representative query text with literal values replaced by `?`. + database: + $ref: '#/components/schemas/DatabaseQueryPerformanceDatabase' + role: type: string - maxLength: 262144 - description: Optional plain-text body override. Rendered as a text/template. Max 256 KiB. - TestEmailResponse: - type: object - required: - - success - properties: - success: - type: boolean - UpdateAuthConfigRequest: - type: object - description: 'All fields optional - only include fields you want to update. Validation rule: require_email_confirmation=true requires email_enabled=true.' - properties: - access_token_lifetime: - type: integer - refresh_token_lifetime: - type: integer - refresh_token_reuse_interval: - type: integer - inactivity_timeout: - type: integer - max_session_duration: - type: integer - platform_token_ttl: - type: integer - description: TTL in seconds for platform tokens minted via `/auth/platform/exchange`. From 3600 (1 hour) to 31536000 (365 days). - minimum: 3600 - maximum: 31536000 - min_password_length: - type: integer - minimum: 15 - maximum: 128 - require_uppercase: - type: boolean - require_lowercase: - type: boolean - require_numbers: - type: boolean - require_special_chars: - type: boolean - enable_signup: - type: boolean - description: Master switch for signups across ALL providers - enable_email_password: - type: boolean - description: Enable/disable email/password provider - rate_limit_signup: - type: integer - rate_limit_signin: - type: integer - rate_limit_token_refresh: - type: integer - rate_limit_password_reset: + description: Postgres role that ran the query, such as `anon` or `authenticated` for RLS-enforced connections, `service_role`, the database owner role for full-access connections, or a role you created. `unknown` when the role no longer exists. + calls: type: integer - description: Password reset requests per hour per IP. Unlike the other limits, 0 applies the default of 10 instead of turning the limit off. - cors_enabled: - type: boolean - cors_allowed_origins: - type: array - description: Replaces the allowed origins list. - items: - type: string - example: - - https://myapp.com - - http://localhost:3000 - cors_allow_credentials: - type: boolean - cors_max_age: + format: int64 + total_exec_time_seconds: + type: number + format: double + description: Cumulative total execution time from pg_stat_statements in seconds. + max_exec_time_seconds: + type: number + format: double + mean_exec_time_seconds: + type: number + format: double + min_exec_time_seconds: + type: number + format: double + rows_processed: type: integer - enable_anonymous_signins: - type: boolean - allowed_email_domains: - type: array - maxItems: 100 - description: | - Replaces the email domain allowlist. Empty array removes the - restriction so any domain can sign up. Entries must be bare domains - such as `domain1.com` and are stored normalized (lowercase, no `@` - prefix); matching is exact, so subdomains need their own entry. At - most 100 entries. - - Restricting signups is a SUPERAGENT feature to configure and to enforce: a - HOBBY project can only remove the restriction and gets 403 for any - other change, and the list it keeps is parked until it upgrades. - items: - type: string - example: - - domain1.com - - domain2.com - allowed_email_domains_mode: + format: int64 + required: + - query_id + - query + - database + - role + - calls + - total_exec_time_seconds + - max_exec_time_seconds + - mean_exec_time_seconds + - min_exec_time_seconds + - rows_processed + DeploymentPhase: + type: object + description: Timing and outcome for one normalized deployment pipeline phase. + properties: + name: type: string - description: | - How far `allowed_email_domains` reaches. `signup` gates account - creation only. `signup_and_signin` also blocks sign-in for accounts - outside the list; switching to it, or narrowing the list while in - it, deletes the sessions of every account it locks out. `disabled` - keeps the list without enforcing it. enum: - - disabled - - signup - - signup_and_signin - allow_password_reset: - type: boolean - password_reset_timeout: - type: integer - max_password_history: - type: integer - require_email_confirmation: - type: boolean - description: Require users to confirm email before sign-in. Can only be true when email_enabled is true. - email_confirmation_timeout: - type: integer - description: Email confirmation token expiry in seconds. - auto_link_verified_oauth: - type: boolean - description: Link a verified OAuth identity to an existing confirmed account with the same email instead of returning a conflict. Requires require_email_confirmation to be true. - email_enabled: - type: boolean - description: Enable transactional email sending. Cannot be false while require_email_confirmation is true. - email_from_address: + - queue + - checkout + - build + - image + - provisioning + - rollout + - verification + status: type: string - email_from_name: + enum: + - pending + - in_progress + - succeeded + - failed + - skipped + started_at: type: string - smtp_host: + format: date-time + completed_at: type: string - smtp_port: + format: date-time + duration_seconds: type: integer - smtp_username: + format: int64 + minimum: 0 + required: + - name + - status + DeploymentProgress: + type: object + description: Normalized live progress derived from the deployment workflow and build phases. + properties: + current_phase: type: string - smtp_password: + enum: + - queue + - checkout + - build + - image + - provisioning + - rollout + - verification + started_at: type: string - format: password - writeOnly: true - minLength: 1 - description: Replacement SMTP password. Omit this field to preserve the configured password. The value is encrypted at rest and never returned. - smtp_use_tls: - type: boolean - email_confirmation_subject: + format: date-time + completed_at: type: string - email_password_reset_subject: + format: date-time + elapsed_seconds: + type: integer + format: int64 + minimum: 0 + phases: + type: array + minItems: 7 + maxItems: 7 + items: + $ref: '#/components/schemas/DeploymentPhase' + updated_at: type: string - email_password_changed_subject: + format: date-time + required: + - started_at + - elapsed_seconds + - phases + - updated_at + DeploymentCommit: + type: object + description: 'The commit the deployment''s source came from: the commit a deploy client reported, or for a deployment a Git deployment run made, the commit the run deployed. Absent when there is neither. A frontend deployment that publishes another deployment''s build carries the commit that deployment''s client reported; one that publishes a Git deployment run''s build has none.' + properties: + repository: type: string - managed_auth_enabled: - type: boolean - description: Enable or disable managed auth hosted pages for the project. - post_auth_redirect_url: + description: GitHub repository as `owner/name`, normalized from what the client sent. + example: acme/app + sha: type: string - description: Must be included in allowed_redirect_urls when set. - allowed_redirect_urls: - type: array - items: - type: string - description: Redirect allowlist. Every entry must be a valid http/https URL. - post_logout_redirect_url: + pattern: ^[0-9a-f]{40}$ + description: Full commit ID. + branch: type: string - description: Must be included in allowed_redirect_urls when set. - device_verification_url: + description: The branch a Git deployment run deployed the commit from. Absent for a commit a deploy client reported. + example: main + dirty: + type: boolean + description: '`true` when the client reported that the uploaded files differ from the commit, or Volcano found an uploaded file in the project''s root directory that the commit does not hold, so the deployed code may differ from the commit.' + verified: + type: boolean + description: '`true` only when `verification` is `files`: Volcano confirmed that the deployed files are the commit''s. A commit verified at the `repository` level is not `verified`.' + verification: type: string - description: | - Optional custom device-authorization verification page. Must be a - valid http/https URL (not tied to allowed_redirect_urls). When set, - device-code logins return this URL (with user_code) instead of the - managed device page. Send an empty string to clear the override. - UpdateAuthHostedPageRequest: + enum: + - none + - repository + - files + x-enum-varnames: + - DeploymentCommitVerificationNone + - DeploymentCommitVerificationRepository + - DeploymentCommitVerificationFiles + description: 'What Volcano confirmed about the commit, through the project''s GitHub connection, when it recorded the deployment. `files`: `repository` is the project''s connected repository, `sha` is on its production branch, every uploaded file is the commit''s file at its path, and the upload holds the commit''s files under its root but those deploy clients leave out. Only a frontend upload is checked this far. `repository`: `repository` is the project''s connected repository and `sha` is on its production branch, but the uploaded files were not compared with the commit, since a function upload holds build output rather than the repository''s layout. Only a function upload the client reports clean is checked at this level. `none`: Volcano confirmed nothing, as for a commit the client reports dirty, one from another branch or repository, one from a project without a connection, or one it couldn''t check in time. A Git deployment run''s commit is `files`: the run fetched the commit''s files from the connected repository itself.' + required: + - repository + - sha + - dirty + - verified + - verification + DurableMessageSender: type: object - required: - - html + description: Who sent the message. properties: - html: + type: type: string - description: Raw HTML markup for the page. Max 256 KiB. - css: + enum: + - service_key + - user + - anon + - project + - execution + description: | + The credential the message was sent with. `project` is the + project's owner or one of its access tokens, and `execution` is the + execution itself publishing. + user_id: type: string - description: Optional CSS injected at render time. Max 256 KiB. - UpdateAuthPageLayoutRequest: + nullable: true + description: The auth user who sent it. Null unless `type` is `user`. + required: + - type + - user_id + DurableMessageStatus: + type: string + enum: + - queued + - delivering + - delivered + - dropped + - published + description: | + An `in` message is `queued` until a wait for its name takes it, + `delivering` while it is handed over, and `delivered` once the + execution has it. It is `dropped` if the execution ended before any + wait took it. Every `out` message is `published`. + LogDeploymentRequestSelector: + type: object + description: Deployment log selector for deployable resources. + additionalProperties: false + properties: + ids: + type: array + maxItems: 25 + description: Optional deployment identifiers. Omit or send an empty array to include every deployment for the selected resources. + items: + type: string + format: uuid + LogFunctionRequestResource: type: object + description: Edge Function log resource selector. additionalProperties: false + properties: + type: + type: string + enum: + - function + description: Resource type to read logs for. + ids: + type: array + maxItems: 25 + description: Optional function identifiers. Omit or send an empty array to include every function in the project. + items: + type: string + format: uuid + kind: + allOf: + - $ref: '#/components/schemas/FunctionKindFilter' + description: | + Read only functions of this kind. Omit to include standard and + durable functions. With `ids`, the listed functions of other kinds + are left out, so an ID of the other kind returns no logs. Search, + stream, and activity cursors are bound to the kind. + deployments: + $ref: '#/components/schemas/LogDeploymentRequestSelector' required: - - layout + - type + LogFrontendRequestResource: + type: object + description: Frontend log resource selector. + additionalProperties: false properties: - layout: - $ref: '#/components/schemas/AuthPageLayout' - UpdateAuthPageThemeRequest: + type: + type: string + enum: + - frontend + description: Resource type to read logs for. + ids: + type: array + maxItems: 25 + description: Optional frontend identifiers. Omit or send an empty array to include every frontend in the project. + items: + type: string + format: uuid + deployments: + $ref: '#/components/schemas/LogDeploymentRequestSelector' + required: + - type + LogDatabaseRequestResource: type: object + description: Database runtime log resource selector. Deployment logs are not supported for databases. additionalProperties: false + properties: + type: + type: string + enum: + - database + description: Resource type to read logs for. + ids: + type: array + maxItems: 25 + description: Optional database identifiers. Omit or send an empty array to include every database in the project. + items: + type: string + format: uuid required: - - theme - properties: - theme: - $ref: '#/components/schemas/AuthPageTheme' - UpdateDatabaseTypeRequest: + - type + LogAppRequestResource: type: object - description: Update database compute size tier + description: | + Selector for the entries a first-party app writes into this project's + logs, such as the Builder's run lifecycle. Each app is one resource. + Its ID is UUIDv5(`7374f5e9-35ff-4e46-ac13-a4717bae00e1`, slug), with + the app's slug as UTF-8 bytes, and its name is the slug. The Builder + (`builder`) is `b52fc8fa-8656-5141-adef-99d698ce6f3c`. Deployment logs + are not supported for apps. + additionalProperties: false properties: - database_type: + type: type: string - description: New compute size tier enum: - - volcano-db-xs - - volcano-db-s - - volcano-db-m - - volcano-db-l - - volcano-db-xl - - volcano-db-2xl - example: volcano-db-m + - app + description: Resource type to read logs for. + ids: + type: array + maxItems: 25 + description: Optional app resource IDs, each UUIDv5 of an app's slug. Omit or send an empty array to include every app. + items: + type: string + format: uuid required: - - database_type - UpdateEmailTemplateRequest: + - type + LogRequestResource: + description: Resource selectors for project log reads. + oneOf: + - $ref: '#/components/schemas/LogFunctionRequestResource' + - $ref: '#/components/schemas/LogFrontendRequestResource' + - $ref: '#/components/schemas/LogDatabaseRequestResource' + - $ref: '#/components/schemas/LogAppRequestResource' + discriminator: + propertyName: type + mapping: + function: '#/components/schemas/LogFunctionRequestResource' + frontend: '#/components/schemas/LogFrontendRequestResource' + database: '#/components/schemas/LogDatabaseRequestResource' + app: '#/components/schemas/LogAppRequestResource' + LogResource: type: object + description: Resource that owns a historical log event. properties: - subject: + type: type: string - html_body: + enum: + - function + - frontend + - database + - app + description: Resource type that owns the log event. + id: type: string - text_body: + format: uuid + description: | + Resource ID that owns the log event. For type `app`, the ID is + UUIDv5(`7374f5e9-35ff-4e46-ac13-a4717bae00e1`, slug), with the app's + slug as UTF-8 bytes; the Builder (`builder`) is + `b52fc8fa-8656-5141-adef-99d698ce6f3c`. + name: type: string - UpdateFunctionRequest: + description: Resource name associated with the log event, when available. For type `app`, the app's slug, such as `builder`. + required: + - type + - id + LogDeployment: type: object - additionalProperties: false - minProperties: 1 + description: Deployment context associated with a historical deployment log event. properties: - visibility: - $ref: '#/components/schemas/FunctionVisibility' - is_public: - type: boolean - deprecated: true - description: | - Deprecated alias for `visibility`: `true` means `public` and - `false` means `authenticated`. Sending both with different meanings - returns 400. - invocation_mode: - $ref: '#/components/schemas/FunctionInvocationMode' - http_auth_mode: - $ref: '#/components/schemas/FunctionHTTPAuthMode' - openapi_spec: - type: object - nullable: true - additionalProperties: true - description: OpenAPI 3.0 or 3.1 metadata for HTTP mode. Send null to clear it. - UpdateFunctionSchedulerRequest: + id: + type: string + format: uuid + description: Deployment ID associated with the log event. + stage: + type: string + enum: + - compile + - publish + description: Deployment stage that produced the log event, when available. + required: + - id + NotificationEmailStatus: + type: string + enum: + - delivering + - disabled + - owner_email_unverified + description: Whether alerts are being emailed. `owner_email_unverified` means email is enabled but the project owner has no active account with a verified email address, so no alert is emailed, and email does not count as a channel when deciding whether to announce a failing scheduler, until the owner verifies it. Changing the account email address needs a new verification. + NotificationEmailSettings: type: object + additionalProperties: false properties: - name: - type: string - maxLength: 200 enabled: type: boolean - schedule: - $ref: '#/components/schemas/ScheduleRequest' - payload: - type: object - additionalProperties: true - regions: + description: Whether alerts are emailed. + recipients: type: array - maxItems: 1 + maxItems: 10 items: type: string - UpdateOAuthConfigRequest: + format: email + description: Empty. Alerts are emailed to the project owner's verified account email address, the only recipient supported. + status: + $ref: '#/components/schemas/NotificationEmailStatus' + required: + - enabled + - recipients + - status + NotificationWebhookSettings: type: object + additionalProperties: false properties: - client_id: - type: string - description: Supported for non-device providers. Not supported for `provider=device`. - client_secret: - type: string - description: Supported for non-device providers. Not supported for `provider=device`. - redirect_url: + url: type: string - format: uri - scopes: - type: array - items: - type: string - enabled: + description: Where alerts are posted. Absent when no webhook is configured. + secret_configured: type: boolean - UpdateProjectRequest: - type: object - description: Update mutable project fields (name and/or region policy) - properties: - name: + description: Whether a signing secret is set. The secret itself is returned only once. + secret: type: string - minLength: 1 - maxLength: 255 - example: my-awesome-app-renamed - all_regions: - type: boolean - description: | - If omitted and `selected_regions` is also omitted, existing region policy is preserved. - If `selected_regions` is provided without `all_regions`, it is treated as subset mode. - selected_regions: - type: array - items: - type: string - description: | - Region subset for project deployments. - Provide with `all_regions=false`. - example: - - us-east-1 - UpdateRealtimeConfigRequest: + description: 'The signing secret, starting with `whsec_`. Present only in the response that generated it: the update that first set `url`, or a rotation. Store it then; it cannot be read again.' + required: + - secret_configured + SchedulerFailureAlertPolicy: type: object - description: | - Request to update realtime configuration. - Limits (message size, channels per connection) are plan-based and cannot be configured. + additionalProperties: false properties: - enabled: - type: boolean - description: Whether realtime is enabled for this project - broadcast_enabled: - type: boolean - description: Whether broadcast channels are enabled - presence_enabled: - type: boolean - description: Whether presence tracking is enabled - postgres_changes_enabled: + notify_on: + $ref: '#/components/schemas/SchedulerFailureNotifyOn' + threshold: + type: integer + minimum: 1 + maximum: 100 + description: How many runs in a row have to fail before a `consecutive_failures` alert. Ignored for `first_failure`. + notify_on_recovery: type: boolean - description: Whether Postgres change notifications are enabled - UpdateStorageBucketRequest: + description: Whether a successful run after an alerted failure streak sends a `scheduler.recovered` alert. + required: + - notify_on + - threshold + - notify_on_recovery + NotificationTestDelivery: type: object + additionalProperties: false properties: - file_size_limit: + channel: + type: string + enum: + - email + - webhook + x-enum-varnames: + - NotificationChannelEmail + - NotificationChannelWebhook + delivered: + type: boolean + status_code: type: integer - format: int64 - allowed_mime_types: - type: array - items: - type: string - UpdateVariableRequest: + description: The webhook's response status. Absent for email, and when no response arrived. + error: + type: string + description: Why the delivery failed. Absent when it arrived. + required: + - channel + - delivered + DurableMessageWaitStatus: + type: string + enum: + - waiting + - matched + - delivered + - expired + - cancelled + description: | + `waiting` until a message for its name arrives, `matched` while that + message is handed over, then `delivered`. `expired` means the wait's + timeout passed first, and `cancelled` that the execution stopped + waiting. + DurableCallbackToken: + type: string + minLength: 5 + maxLength: 128 + pattern: ^vcb_[A-Za-z0-9_-]+$ + description: | + The `vcb_` token the workflow handed out. It is the only credential + the callback operations take, so treat it as a secret. + DurableCallbackStatus: + type: string + enum: + - waiting + - delivering + - succeeded + - failed + description: | + `waiting` until the token is succeeded or failed. `delivering` while + the outcome is on its way to the workflow; Volcano finishes the + delivery on its own. `succeeded` or `failed` once the workflow has the + outcome. + DurableCallbackError: type: object + description: The error the waiting step raises. properties: - 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. - value: + type: + type: string + minLength: 1 + maxLength: 256 + pattern: ^[^\x00-\x1F\x7F]+$ + description: | + A name workflows can branch on, such as `PaymentDeclined`. Up to + 256 characters, without control characters. + message: type: string + maxLength: 32768 + pattern: ^[^\x00-\x08\x0B-\x1F\x7F]*$ + description: | + A human-readable explanation of up to 32,768 bytes of UTF-8, with + tab and newline as its only control characters. A character + outside ASCII takes more than one byte, so such text reaches the + limit before `maxLength`. required: - - value - UploadSessionPart: + - type + additionalProperties: false + LavaflowRepositoryExpectation: type: object - description: Information about an uploaded part + additionalProperties: false + description: The repository connection the caller expects. This is a save precondition, not an instruction to change the connection. properties: - part_number: + repo_id: type: integer - description: Part number (1-10000) - etag: - type: string - description: ETag of the uploaded part - size: + format: int64 + minimum: 1 + repo_installation_id: type: integer format: int64 - description: Size of the part in bytes - UploadSessionStatusResponse: + minimum: 1 + required: + - repo_id + - repo_installation_id + LavaflowOutcomeValues: type: object - description: Status of an upload session + description: Exact counts only when collection coverage is complete. Null means unknown, including days with no retained observations. properties: - session_id: - type: string - description: Upload session ID - status: - type: string - enum: - - pending - - uploading - - completing - - completed - - aborted - description: Current status of the upload - path: - type: string - description: Target file path - content_type: - type: string - description: MIME type - total_size: + pull_requests_merged: type: integer format: int64 - description: Total file size in bytes - part_size: + minimum: 0 + nullable: true + improvements_observed_live: type: integer format: int64 - description: Size of each part (except last) - total_parts: - type: integer - description: Total number of parts - parts_uploaded: - type: integer - description: Number of parts uploaded - bytes_uploaded: + minimum: 0 + nullable: true + issue_resolutions: type: integer format: int64 - description: Total bytes uploaded so far - parts: - type: array - description: List of uploaded parts (for resume) - items: - $ref: '#/components/schemas/UploadSessionPart' - expires_at: - type: string - format: date-time - description: Session expiry time - created_at: - type: string - format: date-time - description: Session creation time - UsageDataPoint: + minimum: 0 + nullable: true + required: + - pull_requests_merged + - improvements_observed_live + - issue_resolutions + LavaflowOutcomeCounts: type: object - description: A single timestamped usage value. + description: Retained confirmations in the requested interval. These are lower bounds when collection coverage is incomplete. properties: - timestamp: - type: string - format: date-time - description: UTC timestamp for the data point - value: + pull_requests_merged: type: integer format: int64 - description: Usage value at the timestamp + minimum: 0 + improvements_observed_live: + type: integer + format: int64 + minimum: 0 + issue_resolutions: + type: integer + format: int64 + minimum: 0 required: - - timestamp - - value - Variable: + - pull_requests_merged + - improvements_observed_live + - issue_resolutions + LavaflowOutcomeDay: type: object properties: - 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 - project_id: - type: string - format: uuid - name: - type: string - maxLength: 256 - value: + date: type: string + format: date + counts: + $ref: '#/components/schemas/LavaflowOutcomeValues' + confirmed_counts: + $ref: '#/components/schemas/LavaflowOutcomeCounts' + required: + - date + - counts + - confirmed_counts + LavaflowOutcomeCoverage: + type: object + description: Collection coverage for one metric. A migration or the earliest retained event establishes no complete interval. Undated observations are not assigned to the requested dates or totals. + properties: status: type: string enum: - - provisioning - - active - - failed - description: Latest project variable propagation status, when a sync has run. - current_sync_id: - type: string - format: uuid - description: Identifier of the latest variable propagation sync. - provisioning_started_at: - type: string - format: date-time - description: Timestamp when the current variable propagation phase started. - deploy_source: - type: string - enum: - - git - - cli - - web - - api - - system - - unknown - description: What initiated the latest variable propagation sync, when one has run. - created_at: + - complete + - partial + - unavailable + x-enum-varnames: + - LavaflowOutcomeCoverageStatusComplete + - LavaflowOutcomeCoverageStatusPartial + - LavaflowOutcomeCoverageStatusUnavailable + complete_from: type: string format: date-time - updated_at: + nullable: true + complete_through: type: string format: date-time - required: - - id - - project_id - - name - - 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. - ProjectTemplateInstallation: - type: object - description: | - Template initialization progress, returned by project creation and the - individual project endpoint. Omitted for projects without a template. - Project creation accepts the installation; wait for `ready` before use. - A failed installation retains the project for inspection or deletion. - required: - - status - - phase - properties: - status: + nullable: true + reason: type: string - enum: - - pending - - running - - ready - - failed - phase: + event_time_basis: type: string enum: - - database - - restore - - configure - - deploy - - verify - - ready - ProjectGitConnectionSummary: - type: object - properties: - repo_installation_id: + - confirmed_merge_time + - first_recorded_live_confirmation + - recorded_automatic_resolution + supported_sources: + type: array + items: + type: string + undated_confirmed_events: type: integer format: int64 - repo_id: + minimum: 0 + required: + - status + - complete_from + - complete_through + - reason + - event_time_basis + - supported_sources + - undated_confirmed_events + LavaflowOutcomeCurrent: + type: object + description: Current known open critical Code Quality findings, including findings without a fix run. The historical window and run-category filter do not narrow this inventory. Zero is not an exhaustive security assessment. + properties: + known_open_critical_count: type: integer format: int64 - repo_full_name: - type: string - root_directory: - type: string - production_branch: - type: string - updated_at: + minimum: 0 + scope: type: string - format: date-time + enum: + - confirmed_code_quality + inventory_not_exhaustive: + type: boolean + category_filter_applied: + type: boolean required: - - repo_installation_id - - repo_id - - repo_full_name - - root_directory - - production_branch - - updated_at - ProjectHealthSummary: + - known_open_critical_count + - scope + - inventory_not_exhaustive + - category_filter_applied + LavaflowOutcomes: type: object + description: Separate confirmed merges, live improvements and actual automatic issue-resolution episodes. A live improvement is counted once per project, repository and pull request when inclusion is first durably confirmed on a tracked function or frontend. Resolution includes automatic open or ignored to resolved transitions, preserves the reason and category, and excludes manual actions. The primary issue resolution count includes every category, even when a category filter narrows merge and live counts. Only the first qualifying automatic resolution of a metric episode contributes a count. Recurrence and manual reopen start new metric episodes without erasing previous resolutions; moving resolved to ignored does not start an episode. Existing activity counts remain separate. Older servers omit this object; absence is unavailable, never zero. properties: - status: - $ref: '#/components/schemas/ProjectHealthStatus' + as_of: + type: string + format: date-time + description: The UTC timestamp of the consistent database snapshot. + days: + type: array + description: The same ordered UTC date domain as the activity series, with unknown counts distinct from zero retained confirmations. + items: + $ref: '#/components/schemas/LavaflowOutcomeDay' + totals: + $ref: '#/components/schemas/LavaflowOutcomeValues' + confirmed_totals: + $ref: '#/components/schemas/LavaflowOutcomeCounts' + coverage: + type: object + properties: + pull_requests_merged: + $ref: '#/components/schemas/LavaflowOutcomeCoverage' + improvements_observed_live: + $ref: '#/components/schemas/LavaflowOutcomeCoverage' + issue_resolutions: + $ref: '#/components/schemas/LavaflowOutcomeCoverage' + required: + - pull_requests_merged + - improvements_observed_live + - issue_resolutions + current: + $ref: '#/components/schemas/LavaflowOutcomeCurrent' required: - - status - FunctionKind: - type: string - enum: - - standard - - durable - default: standard - description: | - Which kind of function this is. `standard` runs once per invocation. - `durable` checkpoints its progress and resumes from the last completed - step, and is invoked asynchronously through its own executions - collection. A function's kind is fixed when it is created and cannot be - changed afterwards. Omitting this field means `standard`. - AuthPageThemeColors: + - as_of + - days + - totals + - confirmed_totals + - coverage + - current + LavaflowDeliveryStats: type: object - additionalProperties: false - required: - - background - - surface - - text - - accent - - accent_text + description: Delivery for retained runs created in the requested UTC window and category, evaluated at as_of. + properties: + as_of: + type: string + format: date-time + runs: + type: integer + format: int64 + runs_without_owned_pr: + type: integer + format: int64 + description: All runs in the cohort without a pull request of their own, including active, stopped, and covered runs. + finished_without_owned_pr: + type: integer + format: int64 + description: Runs without a pull request of their own that were no longer queued or running at as_of. + issues_with_runs: + type: integer + format: int64 + description: Distinct issues represented by runs in the cohort. + issues_with_pr_coverage: + type: integer + format: int64 + description: Distinct issues with a pull request on the project's current repository. For owned pull requests and verified duplicate-run links, counts open pull requests, merges with a recorded deployment, and merges within the past seven days still awaiting deployment. Verified fix-lineage links count while their pull request is open or merged. + time_to_pr_samples: + type: integer + format: int64 + description: Runs with a recorded opening time at or after run creation. + mean_time_to_pr_seconds: + type: integer + format: int64 + nullable: true + description: Mean seconds from run creation to opening its own pull request. Null when there are no samples. + time_to_coverage_samples: + type: integer + format: int64 + description: Runs with a recorded duplicate-PR observation or lineage attribution time at or after run creation. + mean_time_to_coverage_seconds: + type: integer + format: int64 + nullable: true + description: Mean seconds from run creation to recorded coverage by another pull request. Null when there are no samples. + required: + - as_of + - runs + - runs_without_owned_pr + - finished_without_owned_pr + - issues_with_runs + - issues_with_pr_coverage + - time_to_pr_samples + - mean_time_to_pr_seconds + - time_to_coverage_samples + - mean_time_to_coverage_seconds + LavaflowTaskActivity: + type: object + required: + - sequence + - occurred_at + - actor + - message + - run_id properties: - background: - type: string - pattern: ^#[0-9a-fA-F]{6}$ - surface: + sequence: + type: integer + format: int64 + occurred_at: type: string - pattern: ^#[0-9a-fA-F]{6}$ - text: + format: date-time + actor: type: string - pattern: ^#[0-9a-fA-F]{6}$ - accent: + message: type: string - pattern: ^#[0-9a-fA-F]{6}$ - accent_text: + run_id: type: string - pattern: ^#[0-9a-fA-F]{6}$ - ProjectConfigAuthPageLayouts: - type: object - additionalProperties: false - properties: - login: - $ref: '#/components/schemas/AuthPageLayout' - signup: - $ref: '#/components/schemas/AuthPageLayout' - forgot_password: - $ref: '#/components/schemas/AuthPageLayout' - device: - $ref: '#/components/schemas/AuthPageLayout' - verify_email: - $ref: '#/components/schemas/AuthPageLayout' - reset_password: - $ref: '#/components/schemas/AuthPageLayout' - ProjectConfigAuthPageAppearance: - type: object - additionalProperties: false - properties: - theme: - $ref: '#/components/schemas/AuthPageTheme' - layouts: - $ref: '#/components/schemas/ProjectConfigAuthPageLayouts' - ManagedProjectConfigFrontendCustomDomainTLSConfig: + format: uuid + LavaflowDeliveryState: + type: string + enum: + - pending + - pr_created + - covered + - waiting_for_prerequisite + - terminal_miss + - stopped + x-enum-varnames: + - LavaflowDeliveryStatePending + - LavaflowDeliveryStatePrCreated + - LavaflowDeliveryStateCovered + - LavaflowDeliveryStateWaitingForPrerequisite + - LavaflowDeliveryStateTerminalMiss + - LavaflowDeliveryStateStopped + description: Where pull request delivery stands. `pending` means LavaFlow is still working. `pr_created` includes drafts. `covered` means another run owns the verified pull request. `waiting_for_prerequisite` means delivery can resume on this run. `terminal_miss` means this run ended without delivery and can include guidance for future work. `stopped` includes runs deliberately limited to diagnosis. + LavaflowDeliveryCoverage: type: object - description: Volcano issues and renews the certificate. Certificate fields are not allowed. - additionalProperties: false + description: Another run's verified covering pull request. That run owns the pull request. properties: - mode: + run_id: type: string - enum: - - managed - required: - - mode - BYOCProjectConfigFrontendCustomDomainTLSConfig: - type: object - description: 'Your own certificate. Send `certificate_pem` and `private_key_pem` together, with an optional `certificate_chain_pem`, to create the domain or rotate its certificate. For an existing BYOC domain, `mode: byoc` without certificate fields keeps the stored certificate; exports render only the mode.' - additionalProperties: false - not: - anyOf: - - required: - - certificate_pem - not: - required: - - private_key_pem - - required: - - private_key_pem - not: - required: - - certificate_pem - - required: - - certificate_chain_pem - not: - required: - - certificate_pem - - private_key_pem - properties: - mode: + format: uuid + repository_id: + type: integer + format: int64 + description: Repository ID recorded for the pull request. Omitted if unknown. + number: + type: integer + format: int64 + url: + type: string + format: uri + state: type: string enum: - - byoc - description: Optional; a TLS block without `mode` is BYOC. - certificate_pem: + - open + - merged + x-enum-varnames: + - LavaflowDeliveryCoverageStateOpen + - LavaflowDeliveryCoverageStateMerged + opened_at: type: string - maxLength: 65536 - description: PEM-encoded certificate for create or rotation. Requires private_key_pem. Omitted from exports. - private_key_pem: + format: date-time + nullable: true + merged_at: type: string - maxLength: 65536 - description: PEM-encoded private key for create or rotation. Requires certificate_pem. Omitted from exports. - certificate_chain_pem: + format: date-time + nullable: true + deployed_at: type: string - maxLength: 65536 - description: Optional PEM-encoded certificate chain. Requires certificate_pem and private_key_pem. Omitted from exports. - ProjectConfigFrontendCustomDomainTLSConfig: - description: TLS for the custom domain. `mode` defaults to `byoc` when omitted. - oneOf: - - $ref: '#/components/schemas/ManagedProjectConfigFrontendCustomDomainTLSConfig' - - $ref: '#/components/schemas/BYOCProjectConfigFrontendCustomDomainTLSConfig' - ProjectConfigFrontendFunctionRoute: + format: date-time + nullable: true + required: + - run_id + - number + - url + - state + - opened_at + - merged_at + - deployed_at + LavaflowDeliverySkip: type: object - additionalProperties: false properties: - function: - type: string - minLength: 1 - description: Name of an existing public standard Function configured for HTTP invocation. - path_prefix: + reason: + $ref: '#/components/schemas/LavaflowSkipReason' + recorded_at: type: string - minLength: 2 - maxLength: 512 - pattern: ^/[^?#\\]*[^/?#\\]$ - strip_prefix: - type: boolean - default: false + format: date-time + nullable: true required: - - function - - path_prefix - ProjectConfigSandbox: + - reason + - recorded_at + LavaflowDelivery: type: object - additionalProperties: false - required: - - name + description: Pull request delivery recorded independently of run execution and live recovery. properties: - name: + state: + $ref: '#/components/schemas/LavaflowDeliveryState' + reason: type: string - pattern: ^[a-z][a-z0-9-]{0,62}$ - description: Name of an existing sandbox template or matching Git source directory. - memory_mb: - type: integer - enum: - - 1024 - - 2048 - description: Immutable deployed memory profile; config apply asserts it and Git deploy builds it. - ports: + description: Recorded skip or failure code, `no_recorded_pr` if none was recorded, or `external_prerequisite` for an open proposal that still needs external action. New codes may appear. + next_action: + type: string + description: Action to resume delivery, address an undelivered issue, or complete the setup for a draft proposal, when known. + recorded_at: + type: string + format: date-time + nullable: true + description: When the current delivery result was recorded, if known. + coverage: + $ref: '#/components/schemas/LavaflowDeliveryCoverage' + prior_skips: type: array - uniqueItems: true - maxItems: 16 - description: Service readiness ports; config apply asserts them and Git deploy builds them. + description: Reasons recorded before the run resumed, in order. items: - type: integer - minimum: 1 - maximum: 65532 - ttl_seconds: - type: integer - minimum: 0 - maximum: 2147483647 - description: Default absolute lifetime for new sessions when the caller omits it. Cloud templates accept 30–28800 seconds; inherited lifetimes are clamped to the session plan limit (3600 for HOBBY, 28800 for SUPERAGENT). Local accepts 0 for unlimited or a positive lifetime. - DatabaseQueryPerformanceDatabase: + $ref: '#/components/schemas/LavaflowDeliverySkip' + required: + - state + - recorded_at + - prior_skips + LavaflowRunReference: type: object + description: Another LavaFlow run of the same project. properties: id: type: string format: uuid - name: + title: type: string + nullable: true + description: The run's title, as `LavaflowRunSummary.title` gives it. required: - id - - name - DatabaseQueryPerformanceItem: + - title + LavaflowLineage: type: object + description: 'A chain of LavaFlow fixes: a merged fix, and the runs that followed up an issue traced to it or to a fix after it.' properties: - query_id: - type: string - description: pg_stat_statements query identifier. - query: - type: string - maxLength: 8192 - description: Normalized representative query text with literal values replaced by `?`. - database: - $ref: '#/components/schemas/DatabaseQueryPerformanceDatabase' - role: + id: type: string - description: Postgres role that ran the query, such as `anon` or `authenticated` for RLS-enforced connections, `service_role`, the database owner role for full-access connections, or a role you created. `unknown` when the role no longer exists. - calls: - type: integer - format: int64 - total_exec_time_seconds: - type: number - format: double - description: Cumulative total execution time from pg_stat_statements in seconds. - max_exec_time_seconds: - type: number - format: double - mean_exec_time_seconds: - type: number - format: double - min_exec_time_seconds: - type: number - format: double - rows_processed: + format: uuid + description: The lineage's root run. + depth: type: integer format: int64 - required: - - query_id - - query - - database - - role - - calls - - total_exec_time_seconds - - max_exec_time_seconds - - mean_exec_time_seconds - - min_exec_time_seconds - - rows_processed - DeploymentPhase: - type: object - description: Timing and outcome for one normalized deployment pipeline phase. - properties: - name: + description: 0 for the root fix. + relation: type: string enum: - - queue - - checkout - - build - - image - - provisioning - - rollout - - verification - status: + - regression + - recurrence + nullable: true + description: '`regression` for an issue traced to the parent''s deploy, `recurrence` for an issue that came back after the parent went live. Null for the root.' + confidence: type: string enum: - - pending - - in_progress - - succeeded - - failed - - skipped - started_at: - type: string - format: date-time - completed_at: - type: string - format: date-time - duration_seconds: - type: integer - format: int64 - minimum: 0 - required: - - name - - status - DeploymentProgress: - type: object - description: Normalized live progress derived from the deployment workflow and build phases. - properties: - current_phase: + - strong + - weak + nullable: true + description: 'Null for the root, and otherwise `strong`. `weak` is reserved: nothing writes it.' + parent: + allOf: + - $ref: '#/components/schemas/LavaflowRunReference' + nullable: true + description: The fix this run follows up. Null for the root. + covered_by: + allOf: + - $ref: '#/components/schemas/LavaflowRunReference' + nullable: true + description: The run whose fix also covers this issue, so this run opened nothing. + remedy: type: string enum: - - queue - - checkout - - build - - image - - provisioning - - rollout - - verification - started_at: + - fix + - revert + - none + x-enum-varnames: + - LavaflowLineageRemedyFix + - LavaflowLineageRemedyRevert + - LavaflowLineageRemedyNone + description: 'How the run follows up its parent. Currently always `fix`: a regression gets a follow-up fix. `revert` and `none` are reserved.' + state: type: string - format: date-time - completed_at: + enum: + - active + - settled + - held + hold_reason: type: string - format: date-time - elapsed_seconds: + nullable: true + description: 'Why the lineage holds: `lineage_cap`, `lineage_held` or `repository_changed`. New values may appear. Null unless `state` is `held`.' + pull_requests_opened: type: integer format: int64 - minimum: 0 - phases: - type: array - minItems: 7 - maxItems: 7 - items: - $ref: '#/components/schemas/DeploymentPhase' - updated_at: - type: string - format: date-time + description: Pull requests the lineage opened, counting the root's. + pull_request_cap: + type: integer + format: int64 + description: The most pull requests a lineage opens before it holds. required: - - started_at - - elapsed_seconds - - phases - - updated_at - DurableMessageSender: + - id + - depth + - relation + - confidence + - parent + - covered_by + - remedy + - state + - hold_reason + - pull_requests_opened + - pull_request_cap + LavaflowFixOutcome: type: object - description: Who sent the message. + description: How a merged LavaFlow fix fared once it went live. properties: - type: + state: type: string enum: - - service_key - - user - - anon - - project - - execution - description: | - The credential the message was sent with. `project` is the - project's owner or one of its access tokens, and `execution` is the - execution itself publishing. - user_id: + - awaiting_deploy + - watching + - effective + - ineffective + - regressed + - reverted + description: '`watching` for 14 days after the fix goes live, then `effective` unless its issue came back (`ineffective`) or a new issue was traced to its deploy (`regressed`). An outcome never moves back. `reverted` is reserved and not produced yet.' + live_at: type: string + format: date-time nullable: true - description: The auth user who sent it. Null unless `type` is `user`. + watch_until: + type: string + format: date-time + nullable: true + follow_ups: + type: integer + format: int64 + description: Runs linked to this fix. required: - - type - - user_id - DurableMessageStatus: + - state + - live_at + - watch_until + - follow_ups + LavaflowCommitOrigin: type: string enum: - - queued - - delivering - - delivered - - dropped - - published - description: | - An `in` message is `queued` until a wait for its name takes it, - `delivering` while it is handed over, and `delivered` once the - execution has it. It is `dropped` if the execution ended before any - wait took it. Every `out` message is `published`. - LogDeploymentRequestSelector: - type: object - description: Deployment log selector for deployable resources. - additionalProperties: false - properties: - ids: - type: array - maxItems: 25 - description: Optional deployment identifiers. Omit or send an empty array to include every deployment for the selected resources. - items: - type: string - format: uuid - LogFunctionRequestResource: + - push + - client_reported + - client_reported_repository + - repository + x-enum-varnames: + - LavaflowCommitOriginPush + - LavaflowCommitOriginClientReported + - LavaflowCommitOriginClientReportedRepository + - LavaflowCommitOriginRepository + description: 'Where the commit a run read came from. `push`: a push to the project''s connected repository deployed it. `client_reported`: the deploy client reported it, and Volcano matched the deployed files against it. `client_reported_repository`: the deploy client reported it, and Volcano confirmed only that the connected repository''s production branch holds it, without matching the deployed files, which for a function are build output. A fix on such a commit opens only while the production branch still holds it. `repository`: LavaFlow verified the revision in the connected repository for a report, written issue, or Code Quality finding. Such a revision need not be deployed.' + LavaflowSourceCommit: type: object - description: Edge Function log resource selector. - additionalProperties: false + description: The commit a run read its source at. properties: - type: + sha: type: string - enum: - - function - description: Resource type to read logs for. - ids: - type: array - maxItems: 25 - description: Optional function identifiers. Omit or send an empty array to include every function in the project. - items: - type: string - format: uuid - kind: + description: The commit's full SHA. + origin: allOf: - - $ref: '#/components/schemas/FunctionKindFilter' - description: | - Read only functions of this kind. Omit to include standard and - durable functions. With `ids`, the listed functions of other kinds - are left out, so an ID of the other kind returns no logs. Search, - stream, and activity cursors are bound to the kind. - deployments: - $ref: '#/components/schemas/LogDeploymentRequestSelector' + - $ref: '#/components/schemas/LavaflowCommitOrigin' + nullable: true + description: Where the commit came from. Null for a run recorded before Volcano kept it. required: - - type - LogFrontendRequestResource: + - sha + - origin + LavaflowLineageEvidence: type: object - description: Frontend log resource selector. - additionalProperties: false + description: What tied the run's issue to a recent LavaFlow fix. A `display` link rests on less than a strong one and joins no lineage. properties: - type: + confidence: type: string enum: - - frontend - description: Resource type to read logs for. - ids: + - strong + - weak + - display + description: '`strong` or `display`. `weak` is reserved: nothing writes it.' + parent: + allOf: + - $ref: '#/components/schemas/LavaflowRunReference' + description: The fix the issue was traced to. + deployment: + type: object + properties: + commit_sha: + type: string + description: The commit of the deployment that served the occurrence attribution judged (`opened_at`). + commit_origin: + type: string + description: '`push` for a commit Volcano built from a push, `client_reported` for one the deploy client reported. New values may appear.' + required: + - commit_sha + - commit_origin + previous_commit_sha: + type: string + nullable: true + description: The commit of the deployment before it. + fix_live_at: + type: string + format: date-time + opened_at: + type: string + format: date-time + description: The occurrence attribution judged. + overlapping_functions: type: array - maxItems: 25 - description: Optional frontend identifiers. Omit or send an empty array to include every frontend in the project. items: type: string - format: uuid - deployments: - $ref: '#/components/schemas/LogDeploymentRequestSelector' - required: - - type - LogDatabaseRequestResource: - type: object - description: Database runtime log resource selector. Deployment logs are not supported for databases. - additionalProperties: false - properties: - type: - type: string - enum: - - database - description: Resource type to read logs for. - ids: + overlapping_files: type: array - maxItems: 25 - description: Optional database identifiers. Omit or send an empty array to include every database in the project. items: type: string - format: uuid - required: - - type - LogRequestResource: - description: Resource selectors for project log reads. - oneOf: - - $ref: '#/components/schemas/LogFunctionRequestResource' - - $ref: '#/components/schemas/LogFrontendRequestResource' - - $ref: '#/components/schemas/LogDatabaseRequestResource' - discriminator: - propertyName: type - mapping: - function: '#/components/schemas/LogFunctionRequestResource' - frontend: '#/components/schemas/LogFrontendRequestResource' - database: '#/components/schemas/LogDatabaseRequestResource' - LogResource: - type: object - description: Resource that owns a historical log event. - properties: - type: - type: string - enum: - - function - - frontend - - database - description: Resource type that owns the log event. - id: - type: string - format: uuid - description: Resource ID that owns the log event. - name: - type: string - description: Resource name associated with the log event, when available. required: - - type - - id - LogDeployment: + - confidence + - parent + - deployment + - previous_commit_sha + - fix_live_at + - opened_at + - overlapping_functions + - overlapping_files + IssueFinding: type: object - description: Deployment context associated with a historical deployment log event. + description: The LavaFlow Code Quality finding behind a `code_quality` issue. properties: - id: + rule: type: string - format: uuid - description: Deployment ID associated with the log event. - stage: + description: The rule the finding names, such as `null-dereference`. + severity: type: string enum: - - compile - - publish - description: Deployment stage that produced the log event, when available. - required: - - id - DurableMessageWaitStatus: - type: string - enum: - - waiting - - matched - - delivered - - expired - - cancelled - description: | - `waiting` until a message for its name arrives, `matched` while that - message is handed over, then `delivered`. `expired` means the wait's - timeout passed first, and `cancelled` that the execution stopped - waiting. - DurableCallbackToken: - type: string - minLength: 5 - maxLength: 128 - pattern: ^vcb_[A-Za-z0-9_-]+$ - description: | - The `vcb_` token the workflow handed out. It is the only credential - the callback operations take, so treat it as a secret. - DurableCallbackStatus: - type: string - enum: - - waiting - - delivering - - succeeded - - failed - description: | - `waiting` until the token is succeeded or failed. `delivering` while - the outcome is on its way to the workflow; Volcano finishes the - delivery on its own. `succeeded` or `failed` once the workflow has the - outcome. - DurableCallbackError: - type: object - description: The error the waiting step raises. - properties: - type: + - nit + - minor + - major + - critical + description: How much the problem matters, as the finding was confirmed. + commit_sha: type: string - minLength: 1 - maxLength: 256 - pattern: ^[^\x00-\x1F\x7F]+$ - description: | - A name workflows can branch on, such as `PaymentDeclined`. Up to - 256 characters, without control characters. - message: + description: The deployed commit the scan found the problem in. + path: type: string - maxLength: 32768 - pattern: ^[^\x00]*$ - description: A human-readable explanation, up to 32 KiB. + description: The file, from the repository root. + start_line: + type: integer + format: int64 + description: The first line of the problem in that commit, from 1. + end_line: + type: integer + format: int64 + description: The last line of the problem in that commit. + explanation: + type: string + description: 'What fails and on which input, as plain text. When it holds one of the project''s secret values or a secret gitleaks'' default rules detect, it reads `Hidden: this field matched a secret.` in place of all of it.' required: - - type - additionalProperties: false + - rule + - severity + - commit_sha + - path + - start_line + - end_line + - explanation DurableApprovalFunction: type: object description: | diff --git a/src/volcano_sdk/_generated/api/autofix/__init__.py b/src/volcano_sdk/_generated/api/account_sessions/__init__.py similarity index 100% rename from src/volcano_sdk/_generated/api/autofix/__init__.py rename to src/volcano_sdk/_generated/api/account_sessions/__init__.py diff --git a/src/volcano_sdk/_generated/api/account_sessions/list_account_sessions.py b/src/volcano_sdk/_generated/api/account_sessions/list_account_sessions.py new file mode 100644 index 00000000..544013a9 --- /dev/null +++ b/src/volcano_sdk/_generated/api/account_sessions/list_account_sessions.py @@ -0,0 +1,366 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.account_session_list import AccountSessionList +from ...models.error import Error +from ...models.list_account_sessions_sort import check_list_account_sessions_sort +from ...models.list_account_sessions_sort import ListAccountSessionsSort +from ...models.list_account_sessions_status import check_list_account_sessions_status +from ...models.list_account_sessions_status import ListAccountSessionsStatus +from ...types import UNSET, Unset +from typing import cast + + + +def request_kwargs( + *, + page: int | Unset = UNSET, + limit: int | Unset = UNSET, + sort: ListAccountSessionsSort | Unset = 'last_activity', + status: ListAccountSessionsStatus | Unset = UNSET, + cursor: str | Unset = UNSET, + ending_before: str | Unset = UNSET, + offset: int | Unset = UNSET, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + params["page"] = page + + params["limit"] = limit + + json_sort: str | Unset = UNSET + if not isinstance(sort, Unset): + json_sort = sort + + params["sort"] = json_sort + + json_status: str | Unset = UNSET + if not isinstance(status, Unset): + json_status = status + + params["status"] = json_status + + params["cursor"] = cursor + + params["ending_before"] = ending_before + + params["offset"] = offset + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/user/sessions", + "params": params, + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> AccountSessionList | Error | None: + if response.status_code == 200: + response_200 = AccountSessionList.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 500: + response_500 = Error.from_dict(response.json()) + + + + return response_500 + + if response.status_code == 501: + response_501 = Error.from_dict(response.json()) + + + + return response_501 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[AccountSessionList | Error]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + page: int | Unset = UNSET, + limit: int | Unset = UNSET, + sort: ListAccountSessionsSort | Unset = 'last_activity', + status: ListAccountSessionsStatus | Unset = UNSET, + cursor: str | Unset = UNSET, + ending_before: str | Unset = UNSET, + offset: int | Unset = UNSET, + +) -> Response[AccountSessionList | Error]: + """ List your account's sign-in sessions + + Lists the sign-in sessions of the account that owns the calling + platform token: dashboard sign-ins (`kind: browser`) and CLI logins + (`kind: cli`). The session the calling token was exchanged from is + marked `is_current: true`. A token created in the dashboard or through + the management API, rather than by signing in, has no session, so no + session is current. + + Ordering and pagination match `GET /auth/user/sessions`. + + Only a platform token (`pk-`) can call it. A project access token is + refused with `403`. + + Args: + page (int | Unset): + limit (int | Unset): + sort (ListAccountSessionsSort | Unset): Default: 'last_activity'. + status (ListAccountSessionsStatus | Unset): + cursor (str | Unset): + ending_before (str | Unset): + offset (int | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AccountSessionList | Error] + """ + + + kwargs = request_kwargs( + page=page, +limit=limit, +sort=sort, +status=status, +cursor=cursor, +ending_before=ending_before, +offset=offset, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient, + page: int | Unset = UNSET, + limit: int | Unset = UNSET, + sort: ListAccountSessionsSort | Unset = 'last_activity', + status: ListAccountSessionsStatus | Unset = UNSET, + cursor: str | Unset = UNSET, + ending_before: str | Unset = UNSET, + offset: int | Unset = UNSET, + +) -> AccountSessionList | Error | None: + """ List your account's sign-in sessions + + Lists the sign-in sessions of the account that owns the calling + platform token: dashboard sign-ins (`kind: browser`) and CLI logins + (`kind: cli`). The session the calling token was exchanged from is + marked `is_current: true`. A token created in the dashboard or through + the management API, rather than by signing in, has no session, so no + session is current. + + Ordering and pagination match `GET /auth/user/sessions`. + + Only a platform token (`pk-`) can call it. A project access token is + refused with `403`. + + Args: + page (int | Unset): + limit (int | Unset): + sort (ListAccountSessionsSort | Unset): Default: 'last_activity'. + status (ListAccountSessionsStatus | Unset): + cursor (str | Unset): + ending_before (str | Unset): + offset (int | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AccountSessionList | Error + """ + + + return sync_detailed( + client=client, +page=page, +limit=limit, +sort=sort, +status=status, +cursor=cursor, +ending_before=ending_before, +offset=offset, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + page: int | Unset = UNSET, + limit: int | Unset = UNSET, + sort: ListAccountSessionsSort | Unset = 'last_activity', + status: ListAccountSessionsStatus | Unset = UNSET, + cursor: str | Unset = UNSET, + ending_before: str | Unset = UNSET, + offset: int | Unset = UNSET, + +) -> Response[AccountSessionList | Error]: + """ List your account's sign-in sessions + + Lists the sign-in sessions of the account that owns the calling + platform token: dashboard sign-ins (`kind: browser`) and CLI logins + (`kind: cli`). The session the calling token was exchanged from is + marked `is_current: true`. A token created in the dashboard or through + the management API, rather than by signing in, has no session, so no + session is current. + + Ordering and pagination match `GET /auth/user/sessions`. + + Only a platform token (`pk-`) can call it. A project access token is + refused with `403`. + + Args: + page (int | Unset): + limit (int | Unset): + sort (ListAccountSessionsSort | Unset): Default: 'last_activity'. + status (ListAccountSessionsStatus | Unset): + cursor (str | Unset): + ending_before (str | Unset): + offset (int | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AccountSessionList | Error] + """ + + + kwargs = request_kwargs( + page=page, +limit=limit, +sort=sort, +status=status, +cursor=cursor, +ending_before=ending_before, +offset=offset, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient, + page: int | Unset = UNSET, + limit: int | Unset = UNSET, + sort: ListAccountSessionsSort | Unset = 'last_activity', + status: ListAccountSessionsStatus | Unset = UNSET, + cursor: str | Unset = UNSET, + ending_before: str | Unset = UNSET, + offset: int | Unset = UNSET, + +) -> AccountSessionList | Error | None: + """ List your account's sign-in sessions + + Lists the sign-in sessions of the account that owns the calling + platform token: dashboard sign-ins (`kind: browser`) and CLI logins + (`kind: cli`). The session the calling token was exchanged from is + marked `is_current: true`. A token created in the dashboard or through + the management API, rather than by signing in, has no session, so no + session is current. + + Ordering and pagination match `GET /auth/user/sessions`. + + Only a platform token (`pk-`) can call it. A project access token is + refused with `403`. + + Args: + page (int | Unset): + limit (int | Unset): + sort (ListAccountSessionsSort | Unset): Default: 'last_activity'. + status (ListAccountSessionsStatus | Unset): + cursor (str | Unset): + ending_before (str | Unset): + offset (int | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AccountSessionList | Error + """ + + + return (await asyncio_detailed( + client=client, +page=page, +limit=limit, +sort=sort, +status=status, +cursor=cursor, +ending_before=ending_before, +offset=offset, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/account_sessions/revoke_account_session.py b/src/volcano_sdk/_generated/api/account_sessions/revoke_account_session.py new file mode 100644 index 00000000..6b21c7a9 --- /dev/null +++ b/src/volcano_sdk/_generated/api/account_sessions/revoke_account_session.py @@ -0,0 +1,219 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from typing import cast + + + +def request_kwargs( + session_id: str, + +) -> dict[str, Any]: + + + + + + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/user/sessions/{session_id}".format(session_id=quote(str(session_id), safe=""),), + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | Error | None: + if response.status_code == 204: + response_204 = cast(Any, None) + return response_204 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 500: + response_500 = Error.from_dict(response.json()) + + + + return response_500 + + if response.status_code == 501: + response_501 = Error.from_dict(response.json()) + + + + return response_501 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any | Error]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + session_id: str, + *, + client: AuthenticatedClient, + +) -> Response[Any | Error]: + """ Sign out one session + + Ends one of the account's sessions and revokes the platform tokens + exchanged from it. A session that is not the account's, or does not + exist, answers `404`. + + Args: + session_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | Error] + """ + + + kwargs = request_kwargs( + session_id=session_id, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + session_id: str, + *, + client: AuthenticatedClient, + +) -> Any | Error | None: + """ Sign out one session + + Ends one of the account's sessions and revokes the platform tokens + exchanged from it. A session that is not the account's, or does not + exist, answers `404`. + + Args: + session_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | Error + """ + + + return sync_detailed( + session_id=session_id, +client=client, + + ).parsed + +async def asyncio_detailed( + session_id: str, + *, + client: AuthenticatedClient, + +) -> Response[Any | Error]: + """ Sign out one session + + Ends one of the account's sessions and revokes the platform tokens + exchanged from it. A session that is not the account's, or does not + exist, answers `404`. + + Args: + session_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | Error] + """ + + + kwargs = request_kwargs( + session_id=session_id, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + session_id: str, + *, + client: AuthenticatedClient, + +) -> Any | Error | None: + """ Sign out one session + + Ends one of the account's sessions and revokes the platform tokens + exchanged from it. A session that is not the account's, or does not + exist, answers `404`. + + Args: + session_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | Error + """ + + + return (await asyncio_detailed( + session_id=session_id, +client=client, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/account_sessions/revoke_current_user_token.py b/src/volcano_sdk/_generated/api/account_sessions/revoke_current_user_token.py new file mode 100644 index 00000000..270b45c5 --- /dev/null +++ b/src/volcano_sdk/_generated/api/account_sessions/revoke_current_user_token.py @@ -0,0 +1,207 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from typing import cast + + + +def request_kwargs( + +) -> dict[str, Any]: + + + + + + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/user/tokens/current", + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | Error | None: + if response.status_code == 204: + response_204 = cast(Any, None) + return response_204 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 500: + response_500 = Error.from_dict(response.json()) + + + + return response_500 + + if response.status_code == 501: + response_501 = Error.from_dict(response.json()) + + + + return response_501 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any | Error]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + +) -> Response[Any | Error]: + """ Revoke the calling platform token + + Revokes the platform token that authenticates this request, and ends + the sign-in session it was created from, if any. Ending the session + also revokes every other token created from it. Every later request + with the token answers `401`. + + Only a platform token (`pk-`) can call it. A project access token is + refused with `403`. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | Error] + """ + + + kwargs = request_kwargs( + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient, + +) -> Any | Error | None: + """ Revoke the calling platform token + + Revokes the platform token that authenticates this request, and ends + the sign-in session it was created from, if any. Ending the session + also revokes every other token created from it. Every later request + with the token answers `401`. + + Only a platform token (`pk-`) can call it. A project access token is + refused with `403`. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | Error + """ + + + return sync_detailed( + client=client, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + +) -> Response[Any | Error]: + """ Revoke the calling platform token + + Revokes the platform token that authenticates this request, and ends + the sign-in session it was created from, if any. Ending the session + also revokes every other token created from it. Every later request + with the token answers `401`. + + Only a platform token (`pk-`) can call it. A project access token is + refused with `403`. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | Error] + """ + + + kwargs = request_kwargs( + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient, + +) -> Any | Error | None: + """ Revoke the calling platform token + + Revokes the platform token that authenticates this request, and ends + the sign-in session it was created from, if any. Ending the session + also revokes every other token created from it. Every later request + with the token answers `401`. + + Only a platform token (`pk-`) can call it. A project access token is + refused with `403`. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | Error + """ + + + return (await asyncio_detailed( + client=client, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/account_sessions/revoke_other_account_sessions.py b/src/volcano_sdk/_generated/api/account_sessions/revoke_other_account_sessions.py new file mode 100644 index 00000000..994b60d6 --- /dev/null +++ b/src/volcano_sdk/_generated/api/account_sessions/revoke_other_account_sessions.py @@ -0,0 +1,207 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from typing import cast + + + +def request_kwargs( + +) -> dict[str, Any]: + + + + + + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/user/sessions", + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | Error | None: + if response.status_code == 204: + response_204 = cast(Any, None) + return response_204 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 500: + response_500 = Error.from_dict(response.json()) + + + + return response_500 + + if response.status_code == 501: + response_501 = Error.from_dict(response.json()) + + + + return response_501 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any | Error]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + +) -> Response[Any | Error]: + """ Sign out every other session + + Ends every session of the account except the one the calling token + was exchanged from, and revokes the platform tokens exchanged from + them. When the calling token has no session, every session ends. + + Platform tokens that were never linked to a session, such as one + created in the dashboard or through the management API, keep working. + Revoke each with `DELETE /user/tokens/current`. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | Error] + """ + + + kwargs = request_kwargs( + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient, + +) -> Any | Error | None: + """ Sign out every other session + + Ends every session of the account except the one the calling token + was exchanged from, and revokes the platform tokens exchanged from + them. When the calling token has no session, every session ends. + + Platform tokens that were never linked to a session, such as one + created in the dashboard or through the management API, keep working. + Revoke each with `DELETE /user/tokens/current`. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | Error + """ + + + return sync_detailed( + client=client, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + +) -> Response[Any | Error]: + """ Sign out every other session + + Ends every session of the account except the one the calling token + was exchanged from, and revokes the platform tokens exchanged from + them. When the calling token has no session, every session ends. + + Platform tokens that were never linked to a session, such as one + created in the dashboard or through the management API, keep working. + Revoke each with `DELETE /user/tokens/current`. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | Error] + """ + + + kwargs = request_kwargs( + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient, + +) -> Any | Error | None: + """ Sign out every other session + + Ends every session of the account except the one the calling token + was exchanged from, and revokes the platform tokens exchanged from + them. When the calling token has no session, every session ends. + + Platform tokens that were never linked to a session, such as one + created in the dashboard or through the management API, keep working. + Revoke each with `DELETE /user/tokens/current`. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | Error + """ + + + return (await asyncio_detailed( + client=client, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/anon_keys/create_anon_key.py b/src/volcano_sdk/_generated/api/anon_keys/create_anon_key.py index 682efb30..98abc90d 100644 --- a/src/volcano_sdk/_generated/api/anon_keys/create_anon_key.py +++ b/src/volcano_sdk/_generated/api/anon_keys/create_anon_key.py @@ -10,6 +10,7 @@ from ...models.anon_key import AnonKey from ...models.create_anon_key_body import CreateAnonKeyBody +from ...models.error import Error from typing import cast from uuid import UUID @@ -42,7 +43,7 @@ def request_kwargs( -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> AnonKey | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> AnonKey | Error | None: if response.status_code == 201: response_201 = AnonKey.from_dict(response.json()) @@ -50,13 +51,27 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return response_201 + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 409: + response_409 = Error.from_dict(response.json()) + + + + return response_409 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: return None -def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[AnonKey]: +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[AnonKey | Error]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -71,7 +86,7 @@ def sync_detailed( client: AuthenticatedClient, body: CreateAnonKeyBody, -) -> Response[AnonKey]: +) -> Response[AnonKey | Error]: """ Create anon key Args: @@ -83,7 +98,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AnonKey] + Response[AnonKey | Error] """ @@ -105,7 +120,7 @@ def sync( client: AuthenticatedClient, body: CreateAnonKeyBody, -) -> AnonKey | None: +) -> AnonKey | Error | None: """ Create anon key Args: @@ -117,7 +132,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AnonKey + AnonKey | Error """ @@ -134,7 +149,7 @@ async def asyncio_detailed( client: AuthenticatedClient, body: CreateAnonKeyBody, -) -> Response[AnonKey]: +) -> Response[AnonKey | Error]: """ Create anon key Args: @@ -146,7 +161,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AnonKey] + Response[AnonKey | Error] """ @@ -168,7 +183,7 @@ async def asyncio( client: AuthenticatedClient, body: CreateAnonKeyBody, -) -> AnonKey | None: +) -> AnonKey | Error | None: """ Create anon key Args: @@ -180,7 +195,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AnonKey + AnonKey | Error """ diff --git a/src/volcano_sdk/_generated/api/anon_keys/regenerate_anon_key.py b/src/volcano_sdk/_generated/api/anon_keys/regenerate_anon_key.py index 83e6c576..3ef8ce99 100644 --- a/src/volcano_sdk/_generated/api/anon_keys/regenerate_anon_key.py +++ b/src/volcano_sdk/_generated/api/anon_keys/regenerate_anon_key.py @@ -9,6 +9,7 @@ from ... import errors from ...models.anon_key import AnonKey +from ...models.error import Error from typing import cast from uuid import UUID @@ -35,7 +36,7 @@ def request_kwargs( -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> AnonKey | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> AnonKey | Error | None: if response.status_code == 200: response_200 = AnonKey.from_dict(response.json()) @@ -43,13 +44,20 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return response_200 + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: return None -def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[AnonKey]: +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[AnonKey | Error]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -64,7 +72,7 @@ def sync_detailed( *, client: AuthenticatedClient, -) -> Response[AnonKey]: +) -> Response[AnonKey | Error]: """ Regenerate anon key Generate new JWT value for existing key @@ -78,7 +86,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AnonKey] + Response[AnonKey | Error] """ @@ -100,7 +108,7 @@ def sync( *, client: AuthenticatedClient, -) -> AnonKey | None: +) -> AnonKey | Error | None: """ Regenerate anon key Generate new JWT value for existing key @@ -114,7 +122,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AnonKey + AnonKey | Error """ @@ -131,7 +139,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, -) -> Response[AnonKey]: +) -> Response[AnonKey | Error]: """ Regenerate anon key Generate new JWT value for existing key @@ -145,7 +153,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AnonKey] + Response[AnonKey | Error] """ @@ -167,7 +175,7 @@ async def asyncio( *, client: AuthenticatedClient, -) -> AnonKey | None: +) -> AnonKey | Error | None: """ Regenerate anon key Generate new JWT value for existing key @@ -181,7 +189,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AnonKey + AnonKey | Error """ diff --git a/src/volcano_sdk/_generated/api/anon_keys/set_default_anon_key.py b/src/volcano_sdk/_generated/api/anon_keys/set_default_anon_key.py index f7c5cf55..38562119 100644 --- a/src/volcano_sdk/_generated/api/anon_keys/set_default_anon_key.py +++ b/src/volcano_sdk/_generated/api/anon_keys/set_default_anon_key.py @@ -53,7 +53,10 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return response_403 if response.status_code == 404: - response_404 = cast(Any, None) + response_404 = Error.from_dict(response.json()) + + + return response_404 if response.status_code == 500: diff --git a/src/volcano_sdk/_generated/api/auth_configuration/get_default_email_template.py b/src/volcano_sdk/_generated/api/auth_configuration/get_default_email_template.py index 8f6b852e..aed4699b 100644 --- a/src/volcano_sdk/_generated/api/auth_configuration/get_default_email_template.py +++ b/src/volcano_sdk/_generated/api/auth_configuration/get_default_email_template.py @@ -8,7 +8,8 @@ from ...types import Response, UNSET from ... import errors -from ...models.email_template import EmailTemplate +from ...models.default_email_template import DefaultEmailTemplate +from ...models.error import Error from ...models.get_default_email_template_type import check_get_default_email_template_type from ...models.get_default_email_template_type import GetDefaultEmailTemplateType from typing import cast @@ -35,16 +36,19 @@ def request_kwargs( -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | EmailTemplate | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> DefaultEmailTemplate | Error | None: if response.status_code == 200: - response_200 = EmailTemplate.from_dict(response.json()) + response_200 = DefaultEmailTemplate.from_dict(response.json()) return response_200 if response.status_code == 404: - response_404 = cast(Any, None) + response_404 = Error.from_dict(response.json()) + + + return response_404 if client.raise_on_unexpected_status: @@ -53,7 +57,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any | EmailTemplate]: +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[DefaultEmailTemplate | Error]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -67,7 +71,7 @@ def sync_detailed( *, client: AuthenticatedClient | Client, -) -> Response[Any | EmailTemplate]: +) -> Response[DefaultEmailTemplate | Error]: """ Get default email template by type Args: @@ -78,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | EmailTemplate] + Response[DefaultEmailTemplate | Error] """ @@ -98,7 +102,7 @@ def sync( *, client: AuthenticatedClient | Client, -) -> Any | EmailTemplate | None: +) -> DefaultEmailTemplate | Error | None: """ Get default email template by type Args: @@ -109,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | EmailTemplate + DefaultEmailTemplate | Error """ @@ -124,7 +128,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient | Client, -) -> Response[Any | EmailTemplate]: +) -> Response[DefaultEmailTemplate | Error]: """ Get default email template by type Args: @@ -135,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | EmailTemplate] + Response[DefaultEmailTemplate | Error] """ @@ -155,7 +159,7 @@ async def asyncio( *, client: AuthenticatedClient | Client, -) -> Any | EmailTemplate | None: +) -> DefaultEmailTemplate | Error | None: """ Get default email template by type Args: @@ -166,7 +170,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | EmailTemplate + DefaultEmailTemplate | Error """ diff --git a/src/volcano_sdk/_generated/api/auth_configuration/test_email_config.py b/src/volcano_sdk/_generated/api/auth_configuration/test_email_config.py index c65d5579..ca5aa43f 100644 --- a/src/volcano_sdk/_generated/api/auth_configuration/test_email_config.py +++ b/src/volcano_sdk/_generated/api/auth_configuration/test_email_config.py @@ -107,6 +107,16 @@ def sync_detailed( subject or a blank message. Also rejects with 400 if `email_enabled=false`, `smtp_host` is empty, or the saved `smtp_password` can't be read and must be set again. + Sender values with interior line breaks return 400 before SMTP delivery. + Rendered override subjects containing a line break have outer whitespace + trimmed; any remaining interior line break returns 400 before delivery. + Outside local mode, the email is sent only to a public `smtp_host`. + When the host is, or resolves to, a non-public address, or the server + cannot be reached or closes the connection before its greeting, the + 502 carries a fixed message that does not include the network error. + In local mode, the 502 includes the network error. + Replies from the SMTP server itself, such as a refused greeting, + rejected credentials, or a rejected recipient, are included in the 502. Args: id (UUID): @@ -162,6 +172,16 @@ def sync( subject or a blank message. Also rejects with 400 if `email_enabled=false`, `smtp_host` is empty, or the saved `smtp_password` can't be read and must be set again. + Sender values with interior line breaks return 400 before SMTP delivery. + Rendered override subjects containing a line break have outer whitespace + trimmed; any remaining interior line break returns 400 before delivery. + Outside local mode, the email is sent only to a public `smtp_host`. + When the host is, or resolves to, a non-public address, or the server + cannot be reached or closes the connection before its greeting, the + 502 carries a fixed message that does not include the network error. + In local mode, the 502 includes the network error. + Replies from the SMTP server itself, such as a refused greeting, + rejected credentials, or a rejected recipient, are included in the 502. Args: id (UUID): @@ -212,6 +232,16 @@ async def asyncio_detailed( subject or a blank message. Also rejects with 400 if `email_enabled=false`, `smtp_host` is empty, or the saved `smtp_password` can't be read and must be set again. + Sender values with interior line breaks return 400 before SMTP delivery. + Rendered override subjects containing a line break have outer whitespace + trimmed; any remaining interior line break returns 400 before delivery. + Outside local mode, the email is sent only to a public `smtp_host`. + When the host is, or resolves to, a non-public address, or the server + cannot be reached or closes the connection before its greeting, the + 502 carries a fixed message that does not include the network error. + In local mode, the 502 includes the network error. + Replies from the SMTP server itself, such as a refused greeting, + rejected credentials, or a rejected recipient, are included in the 502. Args: id (UUID): @@ -267,6 +297,16 @@ async def asyncio( subject or a blank message. Also rejects with 400 if `email_enabled=false`, `smtp_host` is empty, or the saved `smtp_password` can't be read and must be set again. + Sender values with interior line breaks return 400 before SMTP delivery. + Rendered override subjects containing a line break have outer whitespace + trimmed; any remaining interior line break returns 400 before delivery. + Outside local mode, the email is sent only to a public `smtp_host`. + When the host is, or resolves to, a non-public address, or the server + cannot be reached or closes the connection before its greeting, the + 502 carries a fixed message that does not include the network error. + In local mode, the 502 includes the network error. + Replies from the SMTP server itself, such as a refused greeting, + rejected credentials, or a rejected recipient, are included in the 502. Args: id (UUID): diff --git a/src/volcano_sdk/_generated/api/auth_configuration/update_auth_config.py b/src/volcano_sdk/_generated/api/auth_configuration/update_auth_config.py index b4bb3e43..f3289f6d 100644 --- a/src/volcano_sdk/_generated/api/auth_configuration/update_auth_config.py +++ b/src/volcano_sdk/_generated/api/auth_configuration/update_auth_config.py @@ -54,6 +54,13 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return response_200 + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + if response.status_code == 403: response_403 = Error.from_dict(response.json()) diff --git a/src/volcano_sdk/_generated/api/auth_configuration/update_email_template.py b/src/volcano_sdk/_generated/api/auth_configuration/update_email_template.py index d16ed402..cf8a35b0 100644 --- a/src/volcano_sdk/_generated/api/auth_configuration/update_email_template.py +++ b/src/volcano_sdk/_generated/api/auth_configuration/update_email_template.py @@ -54,6 +54,13 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return response_200 + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + if response.status_code == 403: response_403 = Error.from_dict(response.json()) diff --git a/src/volcano_sdk/_generated/api/authentication/auth_reset_password.py b/src/volcano_sdk/_generated/api/authentication/auth_reset_password.py index 4147b7cc..658e98c1 100644 --- a/src/volcano_sdk/_generated/api/authentication/auth_reset_password.py +++ b/src/volcano_sdk/_generated/api/authentication/auth_reset_password.py @@ -66,6 +66,13 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res response_401 = cast(Any, None) return response_401 + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + if response.status_code == 503: response_503 = Error.from_dict(response.json()) diff --git a/src/volcano_sdk/_generated/api/authentication/auth_update_user.py b/src/volcano_sdk/_generated/api/authentication/auth_update_user.py index a53c132e..5d06c8b8 100644 --- a/src/volcano_sdk/_generated/api/authentication/auth_update_user.py +++ b/src/volcano_sdk/_generated/api/authentication/auth_update_user.py @@ -66,6 +66,13 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return response_401 + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + if response.status_code == 503: response_503 = Error.from_dict(response.json()) diff --git a/src/volcano_sdk/_generated/api/autofix/start_autofix_run.py b/src/volcano_sdk/_generated/api/autofix/start_autofix_run.py deleted file mode 100644 index 0fee78e8..00000000 --- a/src/volcano_sdk/_generated/api/autofix/start_autofix_run.py +++ /dev/null @@ -1,291 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast -from urllib.parse import quote - -import httpx - -from ...client import AuthenticatedClient, Client -from ...types import Response, UNSET -from ... import errors - -from ...models.autofix_run import AutofixRun -from ...models.error import Error -from typing import cast -from uuid import UUID - - - -def request_kwargs( - id: UUID | str, - issue_id: UUID | str, - -) -> dict[str, Any]: - - - - - - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/projects/{id}/issues/{issue_id}/autofix-runs".format(id=quote(str(id), safe=""),issue_id=quote(str(issue_id), safe=""),), - } - - - return _kwargs - - - -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> AutofixRun | Error | None: - if response.status_code == 202: - response_202 = AutofixRun.from_dict(response.json()) - - - - return response_202 - - if response.status_code == 400: - response_400 = Error.from_dict(response.json()) - - - - return response_400 - - if response.status_code == 403: - response_403 = Error.from_dict(response.json()) - - - - return response_403 - - if response.status_code == 404: - response_404 = Error.from_dict(response.json()) - - - - return response_404 - - if response.status_code == 409: - response_409 = Error.from_dict(response.json()) - - - - return response_409 - - if response.status_code == 429: - response_429 = Error.from_dict(response.json()) - - - - return response_429 - - if response.status_code == 501: - response_501 = Error.from_dict(response.json()) - - - - return response_501 - - if response.status_code == 503: - response_503 = Error.from_dict(response.json()) - - - - return response_503 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[AutofixRun | Error]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - id: UUID | str, - issue_id: UUID | str, - *, - client: AuthenticatedClient, - -) -> Response[AutofixRun | Error]: - """ Diagnose an issue - - Queues a run that diagnoses the issue with AI. The run reads the - issue's runtime logs and, when a push to the project's connected - repository built the deployment that was live when the issue was - last seen, its source at that commit. Poll the run until its status is - `succeeded`, `failed`, or `canceled`. - - Autofix must be on for the project. An issue has at most one queued or - running run, a project runs one at a time, and a project starts at most - 25 runs, manual and automatic, in any 24 hours. - - Project access tokens are refused. A run spends model tokens on the - project's provider, so a person starts it with a platform token or in - the dashboard. - - Args: - id (UUID): - issue_id (UUID): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[AutofixRun | Error] - """ - - - kwargs = request_kwargs( - id=id, -issue_id=issue_id, - - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return build_response(client=client, response=response) - -def sync( - id: UUID | str, - issue_id: UUID | str, - *, - client: AuthenticatedClient, - -) -> AutofixRun | Error | None: - """ Diagnose an issue - - Queues a run that diagnoses the issue with AI. The run reads the - issue's runtime logs and, when a push to the project's connected - repository built the deployment that was live when the issue was - last seen, its source at that commit. Poll the run until its status is - `succeeded`, `failed`, or `canceled`. - - Autofix must be on for the project. An issue has at most one queued or - running run, a project runs one at a time, and a project starts at most - 25 runs, manual and automatic, in any 24 hours. - - Project access tokens are refused. A run spends model tokens on the - project's provider, so a person starts it with a platform token or in - the dashboard. - - Args: - id (UUID): - issue_id (UUID): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - AutofixRun | Error - """ - - - return sync_detailed( - id=id, -issue_id=issue_id, -client=client, - - ).parsed - -async def asyncio_detailed( - id: UUID | str, - issue_id: UUID | str, - *, - client: AuthenticatedClient, - -) -> Response[AutofixRun | Error]: - """ Diagnose an issue - - Queues a run that diagnoses the issue with AI. The run reads the - issue's runtime logs and, when a push to the project's connected - repository built the deployment that was live when the issue was - last seen, its source at that commit. Poll the run until its status is - `succeeded`, `failed`, or `canceled`. - - Autofix must be on for the project. An issue has at most one queued or - running run, a project runs one at a time, and a project starts at most - 25 runs, manual and automatic, in any 24 hours. - - Project access tokens are refused. A run spends model tokens on the - project's provider, so a person starts it with a platform token or in - the dashboard. - - Args: - id (UUID): - issue_id (UUID): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[AutofixRun | Error] - """ - - - kwargs = request_kwargs( - id=id, -issue_id=issue_id, - - ) - - response = await client.get_async_httpx_client().request( - **kwargs - ) - - return build_response(client=client, response=response) - -async def asyncio( - id: UUID | str, - issue_id: UUID | str, - *, - client: AuthenticatedClient, - -) -> AutofixRun | Error | None: - """ Diagnose an issue - - Queues a run that diagnoses the issue with AI. The run reads the - issue's runtime logs and, when a push to the project's connected - repository built the deployment that was live when the issue was - last seen, its source at that commit. Poll the run until its status is - `succeeded`, `failed`, or `canceled`. - - Autofix must be on for the project. An issue has at most one queued or - running run, a project runs one at a time, and a project starts at most - 25 runs, manual and automatic, in any 24 hours. - - Project access tokens are refused. A run spends model tokens on the - project's provider, so a person starts it with a platform token or in - the dashboard. - - Args: - id (UUID): - issue_id (UUID): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - AutofixRun | Error - """ - - - return (await asyncio_detailed( - id=id, -issue_id=issue_id, -client=client, - - )).parsed diff --git a/src/volcano_sdk/_generated/api/autofix/update_autofix_settings.py b/src/volcano_sdk/_generated/api/autofix/update_autofix_settings.py deleted file mode 100644 index 0949213d..00000000 --- a/src/volcano_sdk/_generated/api/autofix/update_autofix_settings.py +++ /dev/null @@ -1,332 +0,0 @@ -from http import HTTPStatus -from typing import Any, cast -from urllib.parse import quote - -import httpx - -from ...client import AuthenticatedClient, Client -from ...types import Response, UNSET -from ... import errors - -from ...models.autofix_settings import AutofixSettings -from ...models.error import Error -from ...models.update_autofix_settings_request import UpdateAutofixSettingsRequest -from typing import cast -from uuid import UUID - - - -def request_kwargs( - id: UUID | str, - *, - body: UpdateAutofixSettingsRequest, - -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - - - - - - _kwargs: dict[str, Any] = { - "method": "put", - "url": "/projects/{id}/autofix".format(id=quote(str(id), safe=""),), - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - - -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> AutofixSettings | Error | None: - if response.status_code == 200: - response_200 = AutofixSettings.from_dict(response.json()) - - - - return response_200 - - if response.status_code == 400: - response_400 = Error.from_dict(response.json()) - - - - return response_400 - - if response.status_code == 403: - response_403 = Error.from_dict(response.json()) - - - - return response_403 - - if response.status_code == 404: - response_404 = Error.from_dict(response.json()) - - - - return response_404 - - if response.status_code == 501: - response_501 = Error.from_dict(response.json()) - - - - return response_501 - - if response.status_code == 503: - response_503 = Error.from_dict(response.json()) - - - - return response_503 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[AutofixSettings | Error]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - id: UUID | str, - *, - client: AuthenticatedClient, - body: UpdateAutofixSettingsRequest, - -) -> Response[AutofixSettings | Error]: - """ Replace autofix settings - - Replaces the project's autofix settings. Omitted fields take their - defaults, except three: an omitted `provider` or `model` keeps its saved - value, and an omitted `api_key` keeps the stored key. So - `{"enabled": false}` turns autofix off and keeps the key. - - Project access tokens are refused. Autofix opens pull requests in the - project's repository, so a person turns it on with a platform token or - in the dashboard. - - Turning autofix on needs a plan that includes it. Settings that are - already on stay stored after a downgrade, and saving them again is not - refused, but no run starts until the plan includes autofix again. Other - saves need no plan. - - Provider `anthropic` runs on your own API key. A key belongs to the - provider it was saved with, and turning autofix on with a provider that - runs on your own key needs one for it. Turning autofix off or switching - providers keeps the stored key; only - `DELETE /projects/{id}/autofix/api-key` removes it. Turning autofix on - with provider `volcano` needs the `autofix.managed_models` capability; - without it the request answers `400` with code `feature_unavailable`. - - Where autofix is not available, a project with saved settings can - still change them with `enabled: false`. Turning autofix on answers - `404` with code `feature_unavailable`. - - Args: - id (UUID): - body (UpdateAutofixSettingsRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[AutofixSettings | Error] - """ - - - kwargs = request_kwargs( - id=id, -body=body, - - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return build_response(client=client, response=response) - -def sync( - id: UUID | str, - *, - client: AuthenticatedClient, - body: UpdateAutofixSettingsRequest, - -) -> AutofixSettings | Error | None: - """ Replace autofix settings - - Replaces the project's autofix settings. Omitted fields take their - defaults, except three: an omitted `provider` or `model` keeps its saved - value, and an omitted `api_key` keeps the stored key. So - `{"enabled": false}` turns autofix off and keeps the key. - - Project access tokens are refused. Autofix opens pull requests in the - project's repository, so a person turns it on with a platform token or - in the dashboard. - - Turning autofix on needs a plan that includes it. Settings that are - already on stay stored after a downgrade, and saving them again is not - refused, but no run starts until the plan includes autofix again. Other - saves need no plan. - - Provider `anthropic` runs on your own API key. A key belongs to the - provider it was saved with, and turning autofix on with a provider that - runs on your own key needs one for it. Turning autofix off or switching - providers keeps the stored key; only - `DELETE /projects/{id}/autofix/api-key` removes it. Turning autofix on - with provider `volcano` needs the `autofix.managed_models` capability; - without it the request answers `400` with code `feature_unavailable`. - - Where autofix is not available, a project with saved settings can - still change them with `enabled: false`. Turning autofix on answers - `404` with code `feature_unavailable`. - - Args: - id (UUID): - body (UpdateAutofixSettingsRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - AutofixSettings | Error - """ - - - return sync_detailed( - id=id, -client=client, -body=body, - - ).parsed - -async def asyncio_detailed( - id: UUID | str, - *, - client: AuthenticatedClient, - body: UpdateAutofixSettingsRequest, - -) -> Response[AutofixSettings | Error]: - """ Replace autofix settings - - Replaces the project's autofix settings. Omitted fields take their - defaults, except three: an omitted `provider` or `model` keeps its saved - value, and an omitted `api_key` keeps the stored key. So - `{"enabled": false}` turns autofix off and keeps the key. - - Project access tokens are refused. Autofix opens pull requests in the - project's repository, so a person turns it on with a platform token or - in the dashboard. - - Turning autofix on needs a plan that includes it. Settings that are - already on stay stored after a downgrade, and saving them again is not - refused, but no run starts until the plan includes autofix again. Other - saves need no plan. - - Provider `anthropic` runs on your own API key. A key belongs to the - provider it was saved with, and turning autofix on with a provider that - runs on your own key needs one for it. Turning autofix off or switching - providers keeps the stored key; only - `DELETE /projects/{id}/autofix/api-key` removes it. Turning autofix on - with provider `volcano` needs the `autofix.managed_models` capability; - without it the request answers `400` with code `feature_unavailable`. - - Where autofix is not available, a project with saved settings can - still change them with `enabled: false`. Turning autofix on answers - `404` with code `feature_unavailable`. - - Args: - id (UUID): - body (UpdateAutofixSettingsRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[AutofixSettings | Error] - """ - - - kwargs = request_kwargs( - id=id, -body=body, - - ) - - response = await client.get_async_httpx_client().request( - **kwargs - ) - - return build_response(client=client, response=response) - -async def asyncio( - id: UUID | str, - *, - client: AuthenticatedClient, - body: UpdateAutofixSettingsRequest, - -) -> AutofixSettings | Error | None: - """ Replace autofix settings - - Replaces the project's autofix settings. Omitted fields take their - defaults, except three: an omitted `provider` or `model` keeps its saved - value, and an omitted `api_key` keeps the stored key. So - `{"enabled": false}` turns autofix off and keeps the key. - - Project access tokens are refused. Autofix opens pull requests in the - project's repository, so a person turns it on with a platform token or - in the dashboard. - - Turning autofix on needs a plan that includes it. Settings that are - already on stay stored after a downgrade, and saving them again is not - refused, but no run starts until the plan includes autofix again. Other - saves need no plan. - - Provider `anthropic` runs on your own API key. A key belongs to the - provider it was saved with, and turning autofix on with a provider that - runs on your own key needs one for it. Turning autofix off or switching - providers keeps the stored key; only - `DELETE /projects/{id}/autofix/api-key` removes it. Turning autofix on - with provider `volcano` needs the `autofix.managed_models` capability; - without it the request answers `400` with code `feature_unavailable`. - - Where autofix is not available, a project with saved settings can - still change them with `enabled: false`. Turning autofix on answers - `404` with code `feature_unavailable`. - - Args: - id (UUID): - body (UpdateAutofixSettingsRequest): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - AutofixSettings | Error - """ - - - return (await asyncio_detailed( - id=id, -client=client, -body=body, - - )).parsed diff --git a/src/volcano_sdk/_generated/api/connectors/__init__.py b/src/volcano_sdk/_generated/api/connectors/__init__.py new file mode 100644 index 00000000..c9921b5f --- /dev/null +++ b/src/volcano_sdk/_generated/api/connectors/__init__.py @@ -0,0 +1 @@ +""" Contains endpoint functions for accessing the API """ diff --git a/src/volcano_sdk/_generated/api/connectors/create_connector.py b/src/volcano_sdk/_generated/api/connectors/create_connector.py new file mode 100644 index 00000000..b901e3c3 --- /dev/null +++ b/src/volcano_sdk/_generated/api/connectors/create_connector.py @@ -0,0 +1,301 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.connector import Connector +from ...models.connector_create import ConnectorCreate +from ...models.error import Error +from typing import cast + + + +def request_kwargs( + *, + body: ConnectorCreate, + +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + + + + + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/connectors", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Connector | Error | None: + if response.status_code == 201: + response_201 = Connector.from_dict(response.json()) + + + + return response_201 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 409: + response_409 = Error.from_dict(response.json()) + + + + return response_409 + + if response.status_code == 422: + response_422 = Error.from_dict(response.json()) + + + + return response_422 + + if response.status_code == 502: + response_502 = Error.from_dict(response.json()) + + + + return response_502 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Connector | Error]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: ConnectorCreate, + +) -> Response[Connector | Error]: + """ Connect a service + + Connects an outside service with credentials the caller created there, + and answers `201` with the connector. Today that is an `aikido` + workspace, so LavaFlow can fix the security issues Aikido finds on the + caller's projects. Install the Volcano Slack app with + `POST /user/slack/installations` instead: it needs the browser. + + For Aikido, create a REST API client in Aikido's settings with read + access to issues, repositories and the workspace, and a webhook + signing secret on its webhooks page. Volcano checks the client with + Aikido, reads which workspace it belongs to, and stores all three + values encrypted; it never returns them. Then point an Aikido webhook + for new issues at `https:///webhooks/aikido`, and bind + projects with `POST /lavaflow/connector-bindings`. Volcano writes + nothing back to Aikido. A workspace connects to one Volcano account at + a time. + + Connecting Aikido needs LavaFlow and Aikido reports to be available in + this environment, as the `lavaflow.aikido` capability reports; + otherwise this answers `404` with code `feature_unavailable`. + + Args: + body (ConnectorCreate): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Connector | Error] + """ + + + kwargs = request_kwargs( + body=body, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient, + body: ConnectorCreate, + +) -> Connector | Error | None: + """ Connect a service + + Connects an outside service with credentials the caller created there, + and answers `201` with the connector. Today that is an `aikido` + workspace, so LavaFlow can fix the security issues Aikido finds on the + caller's projects. Install the Volcano Slack app with + `POST /user/slack/installations` instead: it needs the browser. + + For Aikido, create a REST API client in Aikido's settings with read + access to issues, repositories and the workspace, and a webhook + signing secret on its webhooks page. Volcano checks the client with + Aikido, reads which workspace it belongs to, and stores all three + values encrypted; it never returns them. Then point an Aikido webhook + for new issues at `https:///webhooks/aikido`, and bind + projects with `POST /lavaflow/connector-bindings`. Volcano writes + nothing back to Aikido. A workspace connects to one Volcano account at + a time. + + Connecting Aikido needs LavaFlow and Aikido reports to be available in + this environment, as the `lavaflow.aikido` capability reports; + otherwise this answers `404` with code `feature_unavailable`. + + Args: + body (ConnectorCreate): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Connector | Error + """ + + + return sync_detailed( + client=client, +body=body, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: ConnectorCreate, + +) -> Response[Connector | Error]: + """ Connect a service + + Connects an outside service with credentials the caller created there, + and answers `201` with the connector. Today that is an `aikido` + workspace, so LavaFlow can fix the security issues Aikido finds on the + caller's projects. Install the Volcano Slack app with + `POST /user/slack/installations` instead: it needs the browser. + + For Aikido, create a REST API client in Aikido's settings with read + access to issues, repositories and the workspace, and a webhook + signing secret on its webhooks page. Volcano checks the client with + Aikido, reads which workspace it belongs to, and stores all three + values encrypted; it never returns them. Then point an Aikido webhook + for new issues at `https:///webhooks/aikido`, and bind + projects with `POST /lavaflow/connector-bindings`. Volcano writes + nothing back to Aikido. A workspace connects to one Volcano account at + a time. + + Connecting Aikido needs LavaFlow and Aikido reports to be available in + this environment, as the `lavaflow.aikido` capability reports; + otherwise this answers `404` with code `feature_unavailable`. + + Args: + body (ConnectorCreate): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Connector | Error] + """ + + + kwargs = request_kwargs( + body=body, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient, + body: ConnectorCreate, + +) -> Connector | Error | None: + """ Connect a service + + Connects an outside service with credentials the caller created there, + and answers `201` with the connector. Today that is an `aikido` + workspace, so LavaFlow can fix the security issues Aikido finds on the + caller's projects. Install the Volcano Slack app with + `POST /user/slack/installations` instead: it needs the browser. + + For Aikido, create a REST API client in Aikido's settings with read + access to issues, repositories and the workspace, and a webhook + signing secret on its webhooks page. Volcano checks the client with + Aikido, reads which workspace it belongs to, and stores all three + values encrypted; it never returns them. Then point an Aikido webhook + for new issues at `https:///webhooks/aikido`, and bind + projects with `POST /lavaflow/connector-bindings`. Volcano writes + nothing back to Aikido. A workspace connects to one Volcano account at + a time. + + Connecting Aikido needs LavaFlow and Aikido reports to be available in + this environment, as the `lavaflow.aikido` capability reports; + otherwise this answers `404` with code `feature_unavailable`. + + Args: + body (ConnectorCreate): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Connector | Error + """ + + + return (await asyncio_detailed( + client=client, +body=body, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/connectors/delete_connector.py b/src/volcano_sdk/_generated/api/connectors/delete_connector.py new file mode 100644 index 00000000..93f80ffd --- /dev/null +++ b/src/volcano_sdk/_generated/api/connectors/delete_connector.py @@ -0,0 +1,264 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from typing import cast +from uuid import UUID + + + +def request_kwargs( + connector_id: UUID | str, + +) -> dict[str, Any]: + + + + + + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/connectors/{connector_id}".format(connector_id=quote(str(connector_id), safe=""),), + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | Error | None: + if response.status_code == 204: + response_204 = cast(Any, None) + return response_204 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 502: + response_502 = Error.from_dict(response.json()) + + + + return response_502 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any | Error]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + connector_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Response[Any | Error]: + """ Remove a connector + + Removes a connector. Removing a `slack` connector uninstalls the + Volcano app from the Slack workspace, for every Volcano account that + uses it. Only the person who installed the app there can remove it + (`removable` is `true` for them); anyone else can uninstall the app in + Slack. The workspace's channels stop reporting problems at their next + check, which also cancels reports still queued. The channel bindings + stay, and report again if the app is installed in the workspace again. + + Removing an `aikido` connector deletes its credentials and its project + bindings, and cancels its queued reports at their next check. Remove + the webhook in Aikido too: Volcano refuses its deliveries from then on. + + Removing works whether or not reporting problems from either service + is available in this environment. + + Args: + connector_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | Error] + """ + + + kwargs = request_kwargs( + connector_id=connector_id, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + connector_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Any | Error | None: + """ Remove a connector + + Removes a connector. Removing a `slack` connector uninstalls the + Volcano app from the Slack workspace, for every Volcano account that + uses it. Only the person who installed the app there can remove it + (`removable` is `true` for them); anyone else can uninstall the app in + Slack. The workspace's channels stop reporting problems at their next + check, which also cancels reports still queued. The channel bindings + stay, and report again if the app is installed in the workspace again. + + Removing an `aikido` connector deletes its credentials and its project + bindings, and cancels its queued reports at their next check. Remove + the webhook in Aikido too: Volcano refuses its deliveries from then on. + + Removing works whether or not reporting problems from either service + is available in this environment. + + Args: + connector_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | Error + """ + + + return sync_detailed( + connector_id=connector_id, +client=client, + + ).parsed + +async def asyncio_detailed( + connector_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Response[Any | Error]: + """ Remove a connector + + Removes a connector. Removing a `slack` connector uninstalls the + Volcano app from the Slack workspace, for every Volcano account that + uses it. Only the person who installed the app there can remove it + (`removable` is `true` for them); anyone else can uninstall the app in + Slack. The workspace's channels stop reporting problems at their next + check, which also cancels reports still queued. The channel bindings + stay, and report again if the app is installed in the workspace again. + + Removing an `aikido` connector deletes its credentials and its project + bindings, and cancels its queued reports at their next check. Remove + the webhook in Aikido too: Volcano refuses its deliveries from then on. + + Removing works whether or not reporting problems from either service + is available in this environment. + + Args: + connector_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | Error] + """ + + + kwargs = request_kwargs( + connector_id=connector_id, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + connector_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Any | Error | None: + """ Remove a connector + + Removes a connector. Removing a `slack` connector uninstalls the + Volcano app from the Slack workspace, for every Volcano account that + uses it. Only the person who installed the app there can remove it + (`removable` is `true` for them); anyone else can uninstall the app in + Slack. The workspace's channels stop reporting problems at their next + check, which also cancels reports still queued. The channel bindings + stay, and report again if the app is installed in the workspace again. + + Removing an `aikido` connector deletes its credentials and its project + bindings, and cancels its queued reports at their next check. Remove + the webhook in Aikido too: Volcano refuses its deliveries from then on. + + Removing works whether or not reporting problems from either service + is available in this environment. + + Args: + connector_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | Error + """ + + + return (await asyncio_detailed( + connector_id=connector_id, +client=client, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/connectors/get_connector.py b/src/volcano_sdk/_generated/api/connectors/get_connector.py new file mode 100644 index 00000000..e3ce4a5b --- /dev/null +++ b/src/volcano_sdk/_generated/api/connectors/get_connector.py @@ -0,0 +1,210 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.connector import Connector +from ...models.error import Error +from typing import cast +from uuid import UUID + + + +def request_kwargs( + connector_id: UUID | str, + +) -> dict[str, Any]: + + + + + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/connectors/{connector_id}".format(connector_id=quote(str(connector_id), safe=""),), + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Connector | Error | None: + if response.status_code == 200: + response_200 = Connector.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Connector | Error]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + connector_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Response[Connector | Error]: + """ Get a connector + + Returns one connector the caller can use, as listing connectors shows + it. A connector the caller cannot see answers like one that doesn't + exist. + + Args: + connector_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Connector | Error] + """ + + + kwargs = request_kwargs( + connector_id=connector_id, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + connector_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Connector | Error | None: + """ Get a connector + + Returns one connector the caller can use, as listing connectors shows + it. A connector the caller cannot see answers like one that doesn't + exist. + + Args: + connector_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Connector | Error + """ + + + return sync_detailed( + connector_id=connector_id, +client=client, + + ).parsed + +async def asyncio_detailed( + connector_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Response[Connector | Error]: + """ Get a connector + + Returns one connector the caller can use, as listing connectors shows + it. A connector the caller cannot see answers like one that doesn't + exist. + + Args: + connector_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Connector | Error] + """ + + + kwargs = request_kwargs( + connector_id=connector_id, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + connector_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Connector | Error | None: + """ Get a connector + + Returns one connector the caller can use, as listing connectors shows + it. A connector the caller cannot see answers like one that doesn't + exist. + + Args: + connector_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Connector | Error + """ + + + return (await asyncio_detailed( + connector_id=connector_id, +client=client, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/connectors/list_connectors.py b/src/volcano_sdk/_generated/api/connectors/list_connectors.py new file mode 100644 index 00000000..c244d559 --- /dev/null +++ b/src/volcano_sdk/_generated/api/connectors/list_connectors.py @@ -0,0 +1,202 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.connectors_response import ConnectorsResponse +from ...models.error import Error +from typing import cast + + + +def request_kwargs( + +) -> dict[str, Any]: + + + + + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/connectors", + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> ConnectorsResponse | Error | None: + if response.status_code == 200: + response_200 = ConnectorsResponse.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[ConnectorsResponse | Error]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + +) -> Response[ConnectorsResponse | Error]: + """ List connectors + + Lists the connectors the caller can use. A connector links Volcano to + an outside service. A `slack` connector is a Slack workspace the + Volcano app is installed in: it is listed to the person who installed + it there, and to anyone with a Slack identity in that workspace + connected to their Volcano account. Add one with + `POST /user/slack/installations`. An `aikido` connector is an Aikido + workspace the caller connected with `POST /connectors`; it holds their + Aikido credentials, so it is listed to them alone. The list answers + whether or not reporting problems from either service is available in + this environment, so turning it off strands no connector. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ConnectorsResponse | Error] + """ + + + kwargs = request_kwargs( + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient, + +) -> ConnectorsResponse | Error | None: + """ List connectors + + Lists the connectors the caller can use. A connector links Volcano to + an outside service. A `slack` connector is a Slack workspace the + Volcano app is installed in: it is listed to the person who installed + it there, and to anyone with a Slack identity in that workspace + connected to their Volcano account. Add one with + `POST /user/slack/installations`. An `aikido` connector is an Aikido + workspace the caller connected with `POST /connectors`; it holds their + Aikido credentials, so it is listed to them alone. The list answers + whether or not reporting problems from either service is available in + this environment, so turning it off strands no connector. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ConnectorsResponse | Error + """ + + + return sync_detailed( + client=client, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + +) -> Response[ConnectorsResponse | Error]: + """ List connectors + + Lists the connectors the caller can use. A connector links Volcano to + an outside service. A `slack` connector is a Slack workspace the + Volcano app is installed in: it is listed to the person who installed + it there, and to anyone with a Slack identity in that workspace + connected to their Volcano account. Add one with + `POST /user/slack/installations`. An `aikido` connector is an Aikido + workspace the caller connected with `POST /connectors`; it holds their + Aikido credentials, so it is listed to them alone. The list answers + whether or not reporting problems from either service is available in + this environment, so turning it off strands no connector. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ConnectorsResponse | Error] + """ + + + kwargs = request_kwargs( + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient, + +) -> ConnectorsResponse | Error | None: + """ List connectors + + Lists the connectors the caller can use. A connector links Volcano to + an outside service. A `slack` connector is a Slack workspace the + Volcano app is installed in: it is listed to the person who installed + it there, and to anyone with a Slack identity in that workspace + connected to their Volcano account. Add one with + `POST /user/slack/installations`. An `aikido` connector is an Aikido + workspace the caller connected with `POST /connectors`; it holds their + Aikido credentials, so it is listed to them alone. The list answers + whether or not reporting problems from either service is available in + this environment, so turning it off strands no connector. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ConnectorsResponse | Error + """ + + + return (await asyncio_detailed( + client=client, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/database_backups/create_database_restore.py b/src/volcano_sdk/_generated/api/database_backups/create_database_restore.py index 0189862d..23c3f868 100644 --- a/src/volcano_sdk/_generated/api/database_backups/create_database_restore.py +++ b/src/volcano_sdk/_generated/api/database_backups/create_database_restore.py @@ -10,6 +10,7 @@ from ...models.create_database_restore_request import CreateDatabaseRestoreRequest from ...models.database_restore import DatabaseRestore +from ...models.database_restore_conflict_error import DatabaseRestoreConflictError from ...models.error import Error from typing import cast from uuid import UUID @@ -44,7 +45,7 @@ def request_kwargs( -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> DatabaseRestore | Error | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> DatabaseRestore | DatabaseRestoreConflictError | Error | None: if response.status_code == 202: response_202 = DatabaseRestore.from_dict(response.json()) @@ -74,7 +75,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return response_404 if response.status_code == 409: - response_409 = Error.from_dict(response.json()) + response_409 = DatabaseRestoreConflictError.from_dict(response.json()) @@ -93,7 +94,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[DatabaseRestore | Error]: +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[DatabaseRestore | DatabaseRestoreConflictError | Error]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -109,7 +110,7 @@ def sync_detailed( client: AuthenticatedClient, body: CreateDatabaseRestoreRequest, -) -> Response[DatabaseRestore | Error]: +) -> Response[DatabaseRestore | DatabaseRestoreConflictError | Error]: """ Restore a database Replaces the database's data, either with a named backup or with its @@ -138,7 +139,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[DatabaseRestore | Error] + Response[DatabaseRestore | DatabaseRestoreConflictError | Error] """ @@ -162,7 +163,7 @@ def sync( client: AuthenticatedClient, body: CreateDatabaseRestoreRequest, -) -> DatabaseRestore | Error | None: +) -> DatabaseRestore | DatabaseRestoreConflictError | Error | None: """ Restore a database Replaces the database's data, either with a named backup or with its @@ -191,7 +192,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - DatabaseRestore | Error + DatabaseRestore | DatabaseRestoreConflictError | Error """ @@ -210,7 +211,7 @@ async def asyncio_detailed( client: AuthenticatedClient, body: CreateDatabaseRestoreRequest, -) -> Response[DatabaseRestore | Error]: +) -> Response[DatabaseRestore | DatabaseRestoreConflictError | Error]: """ Restore a database Replaces the database's data, either with a named backup or with its @@ -239,7 +240,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[DatabaseRestore | Error] + Response[DatabaseRestore | DatabaseRestoreConflictError | Error] """ @@ -263,7 +264,7 @@ async def asyncio( client: AuthenticatedClient, body: CreateDatabaseRestoreRequest, -) -> DatabaseRestore | Error | None: +) -> DatabaseRestore | DatabaseRestoreConflictError | Error | None: """ Restore a database Replaces the database's data, either with a named backup or with its @@ -292,7 +293,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - DatabaseRestore | Error + DatabaseRestore | DatabaseRestoreConflictError | Error """ diff --git a/src/volcano_sdk/_generated/api/database_backups/list_database_backups.py b/src/volcano_sdk/_generated/api/database_backups/list_database_backups.py index 1140f955..d421c958 100644 --- a/src/volcano_sdk/_generated/api/database_backups/list_database_backups.py +++ b/src/volcano_sdk/_generated/api/database_backups/list_database_backups.py @@ -99,9 +99,9 @@ def sync_detailed( Returns every backup of the database, newest first, together with the window a point-in-time restore may target. - Both backups you took and backups the schedule produced are listed; - `source` tells them apart. Only manual backups count against the plan's - backup allowance. + Backups you took, backups the schedule produced, and backups taken + before migrations are all listed; `source` tells them apart. Only manual + backups count against the plan's backup allowance. Args: id (UUID): @@ -140,9 +140,9 @@ def sync( Returns every backup of the database, newest first, together with the window a point-in-time restore may target. - Both backups you took and backups the schedule produced are listed; - `source` tells them apart. Only manual backups count against the plan's - backup allowance. + Backups you took, backups the schedule produced, and backups taken + before migrations are all listed; `source` tells them apart. Only manual + backups count against the plan's backup allowance. Args: id (UUID): @@ -176,9 +176,9 @@ async def asyncio_detailed( Returns every backup of the database, newest first, together with the window a point-in-time restore may target. - Both backups you took and backups the schedule produced are listed; - `source` tells them apart. Only manual backups count against the plan's - backup allowance. + Backups you took, backups the schedule produced, and backups taken + before migrations are all listed; `source` tells them apart. Only manual + backups count against the plan's backup allowance. Args: id (UUID): @@ -217,9 +217,9 @@ async def asyncio( Returns every backup of the database, newest first, together with the window a point-in-time restore may target. - Both backups you took and backups the schedule produced are listed; - `source` tells them apart. Only manual backups count against the plan's - backup allowance. + Backups you took, backups the schedule produced, and backups taken + before migrations are all listed; `source` tells them apart. Only manual + backups count against the plan's backup allowance. Args: id (UUID): diff --git a/src/volcano_sdk/_generated/api/database_migrations/__init__.py b/src/volcano_sdk/_generated/api/database_migrations/__init__.py new file mode 100644 index 00000000..c9921b5f --- /dev/null +++ b/src/volcano_sdk/_generated/api/database_migrations/__init__.py @@ -0,0 +1 @@ +""" Contains endpoint functions for accessing the API """ diff --git a/src/volcano_sdk/_generated/api/database_migrations/baseline_database_migrations.py b/src/volcano_sdk/_generated/api/database_migrations/baseline_database_migrations.py new file mode 100644 index 00000000..9792595c --- /dev/null +++ b/src/volcano_sdk/_generated/api/database_migrations/baseline_database_migrations.py @@ -0,0 +1,322 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.database_migration_baseline import DatabaseMigrationBaseline +from ...models.database_migration_conflict_error import DatabaseMigrationConflictError +from ...models.database_migration_files_request import DatabaseMigrationFilesRequest +from ...models.error import Error +from typing import cast +from uuid import UUID + + + +def request_kwargs( + id: UUID | str, + database_name: str, + *, + body: DatabaseMigrationFilesRequest, + +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + + + + + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/projects/{id}/databases/{database_name}/migrations/baseline".format(id=quote(str(id), safe=""),database_name=quote(str(database_name), safe=""),), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> DatabaseMigrationBaseline | DatabaseMigrationConflictError | Error | None: + if response.status_code == 200: + response_200 = DatabaseMigrationBaseline.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 409: + response_409 = DatabaseMigrationConflictError.from_dict(response.json()) + + + + return response_409 + + if response.status_code == 413: + response_413 = Error.from_dict(response.json()) + + + + return response_413 + + if response.status_code == 503: + response_503 = Error.from_dict(response.json()) + + + + return response_503 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[DatabaseMigrationBaseline | DatabaseMigrationConflictError | Error]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID | str, + database_name: str, + *, + client: AuthenticatedClient, + body: DatabaseMigrationFilesRequest, + +) -> Response[DatabaseMigrationBaseline | DatabaseMigrationConflictError | Error]: + """ Record migrations as applied without running them + + Records each file in the database's migration history as applied, + without running it. Use it once for a database whose schema already + reflects the files, such as one migrated before Volcano tracked its + migrations, so later runs apply only newer files. It is refused while + a run is queued or running, and no run starts while it records. It + does not queue: while another request is changing the database, or the + database holds it up, such as with a lock on the migration history, it + answers `409` with code `database_busy`. + + Files the history already records with the same checksum are skipped, so + repeating the request changes nothing. A file recorded with a different + checksum is refused, and nothing is recorded. + + It also rebuilds a history that was lost (`history_missing`): send + exactly the files that were already applied, and later runs apply only + the rest. + + Where migration runs are not available, answers `404` with code + `feature_unavailable`. + + Args: + id (UUID): + database_name (str): + body (DatabaseMigrationFilesRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DatabaseMigrationBaseline | DatabaseMigrationConflictError | Error] + """ + + + kwargs = request_kwargs( + id=id, +database_name=database_name, +body=body, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + id: UUID | str, + database_name: str, + *, + client: AuthenticatedClient, + body: DatabaseMigrationFilesRequest, + +) -> DatabaseMigrationBaseline | DatabaseMigrationConflictError | Error | None: + """ Record migrations as applied without running them + + Records each file in the database's migration history as applied, + without running it. Use it once for a database whose schema already + reflects the files, such as one migrated before Volcano tracked its + migrations, so later runs apply only newer files. It is refused while + a run is queued or running, and no run starts while it records. It + does not queue: while another request is changing the database, or the + database holds it up, such as with a lock on the migration history, it + answers `409` with code `database_busy`. + + Files the history already records with the same checksum are skipped, so + repeating the request changes nothing. A file recorded with a different + checksum is refused, and nothing is recorded. + + It also rebuilds a history that was lost (`history_missing`): send + exactly the files that were already applied, and later runs apply only + the rest. + + Where migration runs are not available, answers `404` with code + `feature_unavailable`. + + Args: + id (UUID): + database_name (str): + body (DatabaseMigrationFilesRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DatabaseMigrationBaseline | DatabaseMigrationConflictError | Error + """ + + + return sync_detailed( + id=id, +database_name=database_name, +client=client, +body=body, + + ).parsed + +async def asyncio_detailed( + id: UUID | str, + database_name: str, + *, + client: AuthenticatedClient, + body: DatabaseMigrationFilesRequest, + +) -> Response[DatabaseMigrationBaseline | DatabaseMigrationConflictError | Error]: + """ Record migrations as applied without running them + + Records each file in the database's migration history as applied, + without running it. Use it once for a database whose schema already + reflects the files, such as one migrated before Volcano tracked its + migrations, so later runs apply only newer files. It is refused while + a run is queued or running, and no run starts while it records. It + does not queue: while another request is changing the database, or the + database holds it up, such as with a lock on the migration history, it + answers `409` with code `database_busy`. + + Files the history already records with the same checksum are skipped, so + repeating the request changes nothing. A file recorded with a different + checksum is refused, and nothing is recorded. + + It also rebuilds a history that was lost (`history_missing`): send + exactly the files that were already applied, and later runs apply only + the rest. + + Where migration runs are not available, answers `404` with code + `feature_unavailable`. + + Args: + id (UUID): + database_name (str): + body (DatabaseMigrationFilesRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DatabaseMigrationBaseline | DatabaseMigrationConflictError | Error] + """ + + + kwargs = request_kwargs( + id=id, +database_name=database_name, +body=body, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + id: UUID | str, + database_name: str, + *, + client: AuthenticatedClient, + body: DatabaseMigrationFilesRequest, + +) -> DatabaseMigrationBaseline | DatabaseMigrationConflictError | Error | None: + """ Record migrations as applied without running them + + Records each file in the database's migration history as applied, + without running it. Use it once for a database whose schema already + reflects the files, such as one migrated before Volcano tracked its + migrations, so later runs apply only newer files. It is refused while + a run is queued or running, and no run starts while it records. It + does not queue: while another request is changing the database, or the + database holds it up, such as with a lock on the migration history, it + answers `409` with code `database_busy`. + + Files the history already records with the same checksum are skipped, so + repeating the request changes nothing. A file recorded with a different + checksum is refused, and nothing is recorded. + + It also rebuilds a history that was lost (`history_missing`): send + exactly the files that were already applied, and later runs apply only + the rest. + + Where migration runs are not available, answers `404` with code + `feature_unavailable`. + + Args: + id (UUID): + database_name (str): + body (DatabaseMigrationFilesRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DatabaseMigrationBaseline | DatabaseMigrationConflictError | Error + """ + + + return (await asyncio_detailed( + id=id, +database_name=database_name, +client=client, +body=body, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/database_migrations/create_database_migration_run.py b/src/volcano_sdk/_generated/api/database_migrations/create_database_migration_run.py new file mode 100644 index 00000000..b983bc5a --- /dev/null +++ b/src/volcano_sdk/_generated/api/database_migrations/create_database_migration_run.py @@ -0,0 +1,319 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.database_migration_conflict_error import DatabaseMigrationConflictError +from ...models.database_migration_files_request import DatabaseMigrationFilesRequest +from ...models.database_migration_run import DatabaseMigrationRun +from ...models.error import Error +from ...types import UNSET, Unset +from typing import cast +from uuid import UUID + + + +def request_kwargs( + id: UUID | str, + database_name: str, + *, + body: DatabaseMigrationFilesRequest, + idempotency_key: str | Unset = UNSET, + +) -> dict[str, Any]: + headers: dict[str, Any] = {} + if not isinstance(idempotency_key, Unset): + headers["Idempotency-Key"] = idempotency_key + + + + + + + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/projects/{id}/databases/{database_name}/migration-runs".format(id=quote(str(id), safe=""),database_name=quote(str(database_name), safe=""),), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> DatabaseMigrationConflictError | DatabaseMigrationRun | Error | None: + if response.status_code == 200: + response_200 = DatabaseMigrationRun.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 202: + response_202 = DatabaseMigrationRun.from_dict(response.json()) + + + + return response_202 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 409: + response_409 = DatabaseMigrationConflictError.from_dict(response.json()) + + + + return response_409 + + if response.status_code == 413: + response_413 = Error.from_dict(response.json()) + + + + return response_413 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[DatabaseMigrationConflictError | DatabaseMigrationRun | Error]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID | str, + database_name: str, + *, + client: AuthenticatedClient, + body: DatabaseMigrationFilesRequest, + idempotency_key: str | Unset = UNSET, + +) -> Response[DatabaseMigrationConflictError | DatabaseMigrationRun | Error]: + """ Apply migrations to a database + + Starts a migration run: Volcano compares the files with the database's + history, rehearses the pending ones on a short-lived branch of the + database, takes a backup, and applies them in name order. Files the + history already records with the same checksum are skipped. + + Asynchronous: the response is `202` with the run `queued`. Poll the run + until its `status` is `succeeded` or `failed`. + + Send `Idempotency-Key` to make a retry safe: a repeat with a key this + database has seen returns that run with `200` and starts nothing. A + database runs one migration run at a time. + + Where migration runs are not available, answers `404` with code + `feature_unavailable`. + + Args: + id (UUID): + database_name (str): + idempotency_key (str | Unset): + body (DatabaseMigrationFilesRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DatabaseMigrationConflictError | DatabaseMigrationRun | Error] + """ + + + kwargs = request_kwargs( + id=id, +database_name=database_name, +body=body, +idempotency_key=idempotency_key, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + id: UUID | str, + database_name: str, + *, + client: AuthenticatedClient, + body: DatabaseMigrationFilesRequest, + idempotency_key: str | Unset = UNSET, + +) -> DatabaseMigrationConflictError | DatabaseMigrationRun | Error | None: + """ Apply migrations to a database + + Starts a migration run: Volcano compares the files with the database's + history, rehearses the pending ones on a short-lived branch of the + database, takes a backup, and applies them in name order. Files the + history already records with the same checksum are skipped. + + Asynchronous: the response is `202` with the run `queued`. Poll the run + until its `status` is `succeeded` or `failed`. + + Send `Idempotency-Key` to make a retry safe: a repeat with a key this + database has seen returns that run with `200` and starts nothing. A + database runs one migration run at a time. + + Where migration runs are not available, answers `404` with code + `feature_unavailable`. + + Args: + id (UUID): + database_name (str): + idempotency_key (str | Unset): + body (DatabaseMigrationFilesRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DatabaseMigrationConflictError | DatabaseMigrationRun | Error + """ + + + return sync_detailed( + id=id, +database_name=database_name, +client=client, +body=body, +idempotency_key=idempotency_key, + + ).parsed + +async def asyncio_detailed( + id: UUID | str, + database_name: str, + *, + client: AuthenticatedClient, + body: DatabaseMigrationFilesRequest, + idempotency_key: str | Unset = UNSET, + +) -> Response[DatabaseMigrationConflictError | DatabaseMigrationRun | Error]: + """ Apply migrations to a database + + Starts a migration run: Volcano compares the files with the database's + history, rehearses the pending ones on a short-lived branch of the + database, takes a backup, and applies them in name order. Files the + history already records with the same checksum are skipped. + + Asynchronous: the response is `202` with the run `queued`. Poll the run + until its `status` is `succeeded` or `failed`. + + Send `Idempotency-Key` to make a retry safe: a repeat with a key this + database has seen returns that run with `200` and starts nothing. A + database runs one migration run at a time. + + Where migration runs are not available, answers `404` with code + `feature_unavailable`. + + Args: + id (UUID): + database_name (str): + idempotency_key (str | Unset): + body (DatabaseMigrationFilesRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DatabaseMigrationConflictError | DatabaseMigrationRun | Error] + """ + + + kwargs = request_kwargs( + id=id, +database_name=database_name, +body=body, +idempotency_key=idempotency_key, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + id: UUID | str, + database_name: str, + *, + client: AuthenticatedClient, + body: DatabaseMigrationFilesRequest, + idempotency_key: str | Unset = UNSET, + +) -> DatabaseMigrationConflictError | DatabaseMigrationRun | Error | None: + """ Apply migrations to a database + + Starts a migration run: Volcano compares the files with the database's + history, rehearses the pending ones on a short-lived branch of the + database, takes a backup, and applies them in name order. Files the + history already records with the same checksum are skipped. + + Asynchronous: the response is `202` with the run `queued`. Poll the run + until its `status` is `succeeded` or `failed`. + + Send `Idempotency-Key` to make a retry safe: a repeat with a key this + database has seen returns that run with `200` and starts nothing. A + database runs one migration run at a time. + + Where migration runs are not available, answers `404` with code + `feature_unavailable`. + + Args: + id (UUID): + database_name (str): + idempotency_key (str | Unset): + body (DatabaseMigrationFilesRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DatabaseMigrationConflictError | DatabaseMigrationRun | Error + """ + + + return (await asyncio_detailed( + id=id, +database_name=database_name, +client=client, +body=body, +idempotency_key=idempotency_key, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/database_migrations/get_database_migration_run.py b/src/volcano_sdk/_generated/api/database_migrations/get_database_migration_run.py new file mode 100644 index 00000000..0bd1aaeb --- /dev/null +++ b/src/volcano_sdk/_generated/api/database_migrations/get_database_migration_run.py @@ -0,0 +1,226 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.database_migration_run import DatabaseMigrationRun +from ...models.error import Error +from typing import cast +from uuid import UUID + + + +def request_kwargs( + id: UUID | str, + database_name: str, + run_id: UUID | str, + +) -> dict[str, Any]: + + + + + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/projects/{id}/databases/{database_name}/migration-runs/{run_id}".format(id=quote(str(id), safe=""),database_name=quote(str(database_name), safe=""),run_id=quote(str(run_id), safe=""),), + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> DatabaseMigrationRun | Error | None: + if response.status_code == 200: + response_200 = DatabaseMigrationRun.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[DatabaseMigrationRun | Error]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID | str, + database_name: str, + run_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Response[DatabaseMigrationRun | Error]: + """ Get a migration run + + Returns the run with each file's outcome. Poll this after starting a + run. + + Available whether or not migration runs are. + + Args: + id (UUID): + database_name (str): + run_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DatabaseMigrationRun | Error] + """ + + + kwargs = request_kwargs( + id=id, +database_name=database_name, +run_id=run_id, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + id: UUID | str, + database_name: str, + run_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> DatabaseMigrationRun | Error | None: + """ Get a migration run + + Returns the run with each file's outcome. Poll this after starting a + run. + + Available whether or not migration runs are. + + Args: + id (UUID): + database_name (str): + run_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DatabaseMigrationRun | Error + """ + + + return sync_detailed( + id=id, +database_name=database_name, +run_id=run_id, +client=client, + + ).parsed + +async def asyncio_detailed( + id: UUID | str, + database_name: str, + run_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Response[DatabaseMigrationRun | Error]: + """ Get a migration run + + Returns the run with each file's outcome. Poll this after starting a + run. + + Available whether or not migration runs are. + + Args: + id (UUID): + database_name (str): + run_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DatabaseMigrationRun | Error] + """ + + + kwargs = request_kwargs( + id=id, +database_name=database_name, +run_id=run_id, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + id: UUID | str, + database_name: str, + run_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> DatabaseMigrationRun | Error | None: + """ Get a migration run + + Returns the run with each file's outcome. Poll this after starting a + run. + + Available whether or not migration runs are. + + Args: + id (UUID): + database_name (str): + run_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DatabaseMigrationRun | Error + """ + + + return (await asyncio_detailed( + id=id, +database_name=database_name, +run_id=run_id, +client=client, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/database_migrations/get_database_migrations.py b/src/volcano_sdk/_generated/api/database_migrations/get_database_migrations.py new file mode 100644 index 00000000..6dab949d --- /dev/null +++ b/src/volcano_sdk/_generated/api/database_migrations/get_database_migrations.py @@ -0,0 +1,291 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.database_migrations import DatabaseMigrations +from ...models.error import Error +from typing import cast +from uuid import UUID + + + +def request_kwargs( + id: UUID | str, + database_name: str, + +) -> dict[str, Any]: + + + + + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/projects/{id}/databases/{database_name}/migrations".format(id=quote(str(id), safe=""),database_name=quote(str(database_name), safe=""),), + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> DatabaseMigrations | Error | None: + if response.status_code == 200: + response_200 = DatabaseMigrations.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 409: + response_409 = Error.from_dict(response.json()) + + + + return response_409 + + if response.status_code == 503: + response_503 = Error.from_dict(response.json()) + + + + return response_503 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[DatabaseMigrations | Error]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID | str, + database_name: str, + *, + client: AuthenticatedClient, + +) -> Response[DatabaseMigrations | Error]: + """ Get a database's migration history + + Returns the migrations the database has recorded, in name order, read + from the database's own `_volcano_migrations.history` table. The history + is empty until a migration run or a baseline first records a file. + + `active_run_id` is the run that is queued or running, if any. + + If the history table is gone from a database where migrations ran, + answers `409` with code `history_missing`, and every run fails with + that code, rather than running files again. Record a baseline of the + files that were already applied to rebuild it. Dropping the whole + `_volcano_migrations` schema is not supported: the database then reads + as new, and the next run applies every file again. + + Volcano reads at most 1,000 history entries, as many files as one run + may carry. A history with more answers `409` with code + `history_too_large`. A baseline is refused with that code, and a run + fails with it. Deleting the entries of files no longer among your + migrations brings the history back under the bound. + + Available whether or not migration runs are. + + Args: + id (UUID): + database_name (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DatabaseMigrations | Error] + """ + + + kwargs = request_kwargs( + id=id, +database_name=database_name, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + id: UUID | str, + database_name: str, + *, + client: AuthenticatedClient, + +) -> DatabaseMigrations | Error | None: + """ Get a database's migration history + + Returns the migrations the database has recorded, in name order, read + from the database's own `_volcano_migrations.history` table. The history + is empty until a migration run or a baseline first records a file. + + `active_run_id` is the run that is queued or running, if any. + + If the history table is gone from a database where migrations ran, + answers `409` with code `history_missing`, and every run fails with + that code, rather than running files again. Record a baseline of the + files that were already applied to rebuild it. Dropping the whole + `_volcano_migrations` schema is not supported: the database then reads + as new, and the next run applies every file again. + + Volcano reads at most 1,000 history entries, as many files as one run + may carry. A history with more answers `409` with code + `history_too_large`. A baseline is refused with that code, and a run + fails with it. Deleting the entries of files no longer among your + migrations brings the history back under the bound. + + Available whether or not migration runs are. + + Args: + id (UUID): + database_name (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DatabaseMigrations | Error + """ + + + return sync_detailed( + id=id, +database_name=database_name, +client=client, + + ).parsed + +async def asyncio_detailed( + id: UUID | str, + database_name: str, + *, + client: AuthenticatedClient, + +) -> Response[DatabaseMigrations | Error]: + """ Get a database's migration history + + Returns the migrations the database has recorded, in name order, read + from the database's own `_volcano_migrations.history` table. The history + is empty until a migration run or a baseline first records a file. + + `active_run_id` is the run that is queued or running, if any. + + If the history table is gone from a database where migrations ran, + answers `409` with code `history_missing`, and every run fails with + that code, rather than running files again. Record a baseline of the + files that were already applied to rebuild it. Dropping the whole + `_volcano_migrations` schema is not supported: the database then reads + as new, and the next run applies every file again. + + Volcano reads at most 1,000 history entries, as many files as one run + may carry. A history with more answers `409` with code + `history_too_large`. A baseline is refused with that code, and a run + fails with it. Deleting the entries of files no longer among your + migrations brings the history back under the bound. + + Available whether or not migration runs are. + + Args: + id (UUID): + database_name (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DatabaseMigrations | Error] + """ + + + kwargs = request_kwargs( + id=id, +database_name=database_name, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + id: UUID | str, + database_name: str, + *, + client: AuthenticatedClient, + +) -> DatabaseMigrations | Error | None: + """ Get a database's migration history + + Returns the migrations the database has recorded, in name order, read + from the database's own `_volcano_migrations.history` table. The history + is empty until a migration run or a baseline first records a file. + + `active_run_id` is the run that is queued or running, if any. + + If the history table is gone from a database where migrations ran, + answers `409` with code `history_missing`, and every run fails with + that code, rather than running files again. Record a baseline of the + files that were already applied to rebuild it. Dropping the whole + `_volcano_migrations` schema is not supported: the database then reads + as new, and the next run applies every file again. + + Volcano reads at most 1,000 history entries, as many files as one run + may carry. A history with more answers `409` with code + `history_too_large`. A baseline is refused with that code, and a run + fails with it. Deleting the entries of files no longer among your + migrations brings the history back under the bound. + + Available whether or not migration runs are. + + Args: + id (UUID): + database_name (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DatabaseMigrations | Error + """ + + + return (await asyncio_detailed( + id=id, +database_name=database_name, +client=client, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/database_migrations/list_database_migration_runs.py b/src/volcano_sdk/_generated/api/database_migrations/list_database_migration_runs.py new file mode 100644 index 00000000..dde5e0ca --- /dev/null +++ b/src/volcano_sdk/_generated/api/database_migrations/list_database_migration_runs.py @@ -0,0 +1,213 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.database_migration_run_list import DatabaseMigrationRunList +from ...models.error import Error +from typing import cast +from uuid import UUID + + + +def request_kwargs( + id: UUID | str, + database_name: str, + +) -> dict[str, Any]: + + + + + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/projects/{id}/databases/{database_name}/migration-runs".format(id=quote(str(id), safe=""),database_name=quote(str(database_name), safe=""),), + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> DatabaseMigrationRunList | Error | None: + if response.status_code == 200: + response_200 = DatabaseMigrationRunList.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[DatabaseMigrationRunList | Error]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID | str, + database_name: str, + *, + client: AuthenticatedClient, + +) -> Response[DatabaseMigrationRunList | Error]: + """ List a database's migration runs + + Returns the database's 50 most recent migration runs, newest first, + without their files; get a run for its files. There is no pagination. + + Available whether or not migration runs are. + + Args: + id (UUID): + database_name (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DatabaseMigrationRunList | Error] + """ + + + kwargs = request_kwargs( + id=id, +database_name=database_name, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + id: UUID | str, + database_name: str, + *, + client: AuthenticatedClient, + +) -> DatabaseMigrationRunList | Error | None: + """ List a database's migration runs + + Returns the database's 50 most recent migration runs, newest first, + without their files; get a run for its files. There is no pagination. + + Available whether or not migration runs are. + + Args: + id (UUID): + database_name (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DatabaseMigrationRunList | Error + """ + + + return sync_detailed( + id=id, +database_name=database_name, +client=client, + + ).parsed + +async def asyncio_detailed( + id: UUID | str, + database_name: str, + *, + client: AuthenticatedClient, + +) -> Response[DatabaseMigrationRunList | Error]: + """ List a database's migration runs + + Returns the database's 50 most recent migration runs, newest first, + without their files; get a run for its files. There is no pagination. + + Available whether or not migration runs are. + + Args: + id (UUID): + database_name (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DatabaseMigrationRunList | Error] + """ + + + kwargs = request_kwargs( + id=id, +database_name=database_name, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + id: UUID | str, + database_name: str, + *, + client: AuthenticatedClient, + +) -> DatabaseMigrationRunList | Error | None: + """ List a database's migration runs + + Returns the database's 50 most recent migration runs, newest first, + without their files; get a run for its files. There is no pagination. + + Available whether or not migration runs are. + + Args: + id (UUID): + database_name (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DatabaseMigrationRunList | Error + """ + + + return (await asyncio_detailed( + id=id, +database_name=database_name, +client=client, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/database_queries/query_database_branch_delete.py b/src/volcano_sdk/_generated/api/database_queries/query_database_branch_delete.py index ea5f8666..259220df 100644 --- a/src/volcano_sdk/_generated/api/database_queries/query_database_branch_delete.py +++ b/src/volcano_sdk/_generated/api/database_queries/query_database_branch_delete.py @@ -79,6 +79,13 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return response_404 + if response.status_code == 413: + response_413 = Error.from_dict(response.json()) + + + + return response_413 + if response.status_code == 429: response_429 = Error.from_dict(response.json()) diff --git a/src/volcano_sdk/_generated/api/database_queries/query_database_branch_insert.py b/src/volcano_sdk/_generated/api/database_queries/query_database_branch_insert.py index dc7065ad..7faf8e4c 100644 --- a/src/volcano_sdk/_generated/api/database_queries/query_database_branch_insert.py +++ b/src/volcano_sdk/_generated/api/database_queries/query_database_branch_insert.py @@ -79,6 +79,13 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return response_404 + if response.status_code == 413: + response_413 = Error.from_dict(response.json()) + + + + return response_413 + if response.status_code == 429: response_429 = Error.from_dict(response.json()) diff --git a/src/volcano_sdk/_generated/api/database_queries/query_database_branch_select.py b/src/volcano_sdk/_generated/api/database_queries/query_database_branch_select.py index cfccc2a6..3c078530 100644 --- a/src/volcano_sdk/_generated/api/database_queries/query_database_branch_select.py +++ b/src/volcano_sdk/_generated/api/database_queries/query_database_branch_select.py @@ -79,6 +79,13 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return response_404 + if response.status_code == 413: + response_413 = Error.from_dict(response.json()) + + + + return response_413 + if response.status_code == 429: response_429 = Error.from_dict(response.json()) @@ -122,7 +129,8 @@ def sync_detailed( **Authentication:** Requires auth user access token (from signup/signin) - **Row-Level Security:** Automatically enforced - you see only data you have access to + **Row-Level Security:** Applied on tables with RLS enabled. A table without RLS returns every row + your role is granted **Use Cases:** - Query from browser/mobile apps @@ -176,7 +184,8 @@ def sync( **Authentication:** Requires auth user access token (from signup/signin) - **Row-Level Security:** Automatically enforced - you see only data you have access to + **Row-Level Security:** Applied on tables with RLS enabled. A table without RLS returns every row + your role is granted **Use Cases:** - Query from browser/mobile apps @@ -225,7 +234,8 @@ async def asyncio_detailed( **Authentication:** Requires auth user access token (from signup/signin) - **Row-Level Security:** Automatically enforced - you see only data you have access to + **Row-Level Security:** Applied on tables with RLS enabled. A table without RLS returns every row + your role is granted **Use Cases:** - Query from browser/mobile apps @@ -279,7 +289,8 @@ async def asyncio( **Authentication:** Requires auth user access token (from signup/signin) - **Row-Level Security:** Automatically enforced - you see only data you have access to + **Row-Level Security:** Applied on tables with RLS enabled. A table without RLS returns every row + your role is granted **Use Cases:** - Query from browser/mobile apps diff --git a/src/volcano_sdk/_generated/api/database_queries/query_database_branch_update.py b/src/volcano_sdk/_generated/api/database_queries/query_database_branch_update.py index 4e2004cc..655b6cec 100644 --- a/src/volcano_sdk/_generated/api/database_queries/query_database_branch_update.py +++ b/src/volcano_sdk/_generated/api/database_queries/query_database_branch_update.py @@ -79,6 +79,13 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return response_404 + if response.status_code == 413: + response_413 = Error.from_dict(response.json()) + + + + return response_413 + if response.status_code == 429: response_429 = Error.from_dict(response.json()) diff --git a/src/volcano_sdk/_generated/api/database_queries/query_database_delete.py b/src/volcano_sdk/_generated/api/database_queries/query_database_delete.py index 42ccc65d..1193a718 100644 --- a/src/volcano_sdk/_generated/api/database_queries/query_database_delete.py +++ b/src/volcano_sdk/_generated/api/database_queries/query_database_delete.py @@ -78,6 +78,13 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return response_404 + if response.status_code == 413: + response_413 = Error.from_dict(response.json()) + + + + return response_413 + if response.status_code == 429: response_429 = Error.from_dict(response.json()) @@ -85,6 +92,13 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return response_429 + if response.status_code == 503: + response_503 = Error.from_dict(response.json()) + + + + return response_503 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/volcano_sdk/_generated/api/database_queries/query_database_insert.py b/src/volcano_sdk/_generated/api/database_queries/query_database_insert.py index a001d158..eabdba8a 100644 --- a/src/volcano_sdk/_generated/api/database_queries/query_database_insert.py +++ b/src/volcano_sdk/_generated/api/database_queries/query_database_insert.py @@ -78,6 +78,13 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return response_404 + if response.status_code == 413: + response_413 = Error.from_dict(response.json()) + + + + return response_413 + if response.status_code == 429: response_429 = Error.from_dict(response.json()) @@ -85,6 +92,13 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return response_429 + if response.status_code == 503: + response_503 = Error.from_dict(response.json()) + + + + return response_503 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/volcano_sdk/_generated/api/database_queries/query_database_ping.py b/src/volcano_sdk/_generated/api/database_queries/query_database_ping.py index e9d75466..ae7ce7b3 100644 --- a/src/volcano_sdk/_generated/api/database_queries/query_database_ping.py +++ b/src/volcano_sdk/_generated/api/database_queries/query_database_ping.py @@ -70,6 +70,13 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return response_429 + if response.status_code == 503: + response_503 = Error.from_dict(response.json()) + + + + return response_503 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/volcano_sdk/_generated/api/database_queries/query_database_select.py b/src/volcano_sdk/_generated/api/database_queries/query_database_select.py index 0c3f9ec9..178c6dce 100644 --- a/src/volcano_sdk/_generated/api/database_queries/query_database_select.py +++ b/src/volcano_sdk/_generated/api/database_queries/query_database_select.py @@ -78,6 +78,13 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return response_404 + if response.status_code == 413: + response_413 = Error.from_dict(response.json()) + + + + return response_413 + if response.status_code == 429: response_429 = Error.from_dict(response.json()) @@ -85,6 +92,13 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return response_429 + if response.status_code == 503: + response_503 = Error.from_dict(response.json()) + + + + return response_503 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -113,7 +127,8 @@ def sync_detailed( **Authentication:** Requires auth user access token (from signup/signin) - **Row-Level Security:** Automatically enforced - you see only data you have access to + **Row-Level Security:** Applied on tables with RLS enabled. A table without RLS returns every row + your role is granted **Use Cases:** - Query from browser/mobile apps @@ -160,7 +175,8 @@ def sync( **Authentication:** Requires auth user access token (from signup/signin) - **Row-Level Security:** Automatically enforced - you see only data you have access to + **Row-Level Security:** Applied on tables with RLS enabled. A table without RLS returns every row + your role is granted **Use Cases:** - Query from browser/mobile apps @@ -202,7 +218,8 @@ async def asyncio_detailed( **Authentication:** Requires auth user access token (from signup/signin) - **Row-Level Security:** Automatically enforced - you see only data you have access to + **Row-Level Security:** Applied on tables with RLS enabled. A table without RLS returns every row + your role is granted **Use Cases:** - Query from browser/mobile apps @@ -249,7 +266,8 @@ async def asyncio( **Authentication:** Requires auth user access token (from signup/signin) - **Row-Level Security:** Automatically enforced - you see only data you have access to + **Row-Level Security:** Applied on tables with RLS enabled. A table without RLS returns every row + your role is granted **Use Cases:** - Query from browser/mobile apps diff --git a/src/volcano_sdk/_generated/api/database_queries/query_database_update.py b/src/volcano_sdk/_generated/api/database_queries/query_database_update.py index 30353942..e1174432 100644 --- a/src/volcano_sdk/_generated/api/database_queries/query_database_update.py +++ b/src/volcano_sdk/_generated/api/database_queries/query_database_update.py @@ -78,6 +78,13 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return response_404 + if response.status_code == 413: + response_413 = Error.from_dict(response.json()) + + + + return response_413 + if response.status_code == 429: response_429 = Error.from_dict(response.json()) @@ -85,6 +92,13 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return response_429 + if response.status_code == 503: + response_503 = Error.from_dict(response.json()) + + + + return response_503 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/volcano_sdk/_generated/api/databases/list_database_regions.py b/src/volcano_sdk/_generated/api/databases/list_database_regions.py index d1823924..8e6cbf56 100644 --- a/src/volcano_sdk/_generated/api/databases/list_database_regions.py +++ b/src/volcano_sdk/_generated/api/databases/list_database_regions.py @@ -68,8 +68,10 @@ def sync_detailed( """ List platform-supported regions for database provisioning Returns the regions enabled for database provisioning in this platform environment. - These are the same regions offered for function deployment, and the only values - the `region` field of a database accepts. + In cloud environments, these are the same regions offered for function deployment, + and the only values the `region` field of a database accepts. + Local mode returns one region, `local` (Local), for its bundled Postgres server; + database creation uses that region regardless of the requested value. This is a public endpoint that doesn't require authentication. Raises: @@ -99,8 +101,10 @@ def sync( """ List platform-supported regions for database provisioning Returns the regions enabled for database provisioning in this platform environment. - These are the same regions offered for function deployment, and the only values - the `region` field of a database accepts. + In cloud environments, these are the same regions offered for function deployment, + and the only values the `region` field of a database accepts. + Local mode returns one region, `local` (Local), for its bundled Postgres server; + database creation uses that region regardless of the requested value. This is a public endpoint that doesn't require authentication. Raises: @@ -125,8 +129,10 @@ async def asyncio_detailed( """ List platform-supported regions for database provisioning Returns the regions enabled for database provisioning in this platform environment. - These are the same regions offered for function deployment, and the only values - the `region` field of a database accepts. + In cloud environments, these are the same regions offered for function deployment, + and the only values the `region` field of a database accepts. + Local mode returns one region, `local` (Local), for its bundled Postgres server; + database creation uses that region regardless of the requested value. This is a public endpoint that doesn't require authentication. Raises: @@ -156,8 +162,10 @@ async def asyncio( """ List platform-supported regions for database provisioning Returns the regions enabled for database provisioning in this platform environment. - These are the same regions offered for function deployment, and the only values - the `region` field of a database accepts. + In cloud environments, these are the same regions offered for function deployment, + and the only values the `region` field of a database accepts. + Local mode returns one region, `local` (Local), for its bundled Postgres server; + database creation uses that region regardless of the requested value. This is a public endpoint that doesn't require authentication. Raises: diff --git a/src/volcano_sdk/_generated/api/databases/update_database_type.py b/src/volcano_sdk/_generated/api/databases/update_database_type.py index cc5d5ba7..a6054f9e 100644 --- a/src/volcano_sdk/_generated/api/databases/update_database_type.py +++ b/src/volcano_sdk/_generated/api/databases/update_database_type.py @@ -44,7 +44,7 @@ def request_kwargs( -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | Database | Error | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Database | Error | None: if response.status_code == 200: response_200 = Database.from_dict(response.json()) @@ -53,11 +53,31 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return response_200 if response.status_code == 400: - response_400 = cast(Any, None) + response_400 = Error.from_dict(response.json()) + + + return response_400 + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + if response.status_code == 404: - response_404 = cast(Any, None) + response_404 = Error.from_dict(response.json()) + + + return response_404 if response.status_code == 409: @@ -67,6 +87,13 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return response_409 + if response.status_code == 500: + response_500 = Error.from_dict(response.json()) + + + + return response_500 + if response.status_code == 503: response_503 = Error.from_dict(response.json()) @@ -80,7 +107,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any | Database | Error]: +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Database | Error]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -96,7 +123,7 @@ def sync_detailed( client: AuthenticatedClient, body: UpdateDatabaseTypeRequest, -) -> Response[Any | Database | Error]: +) -> Response[Database | Error]: """ Update database size Change the size tier of a database. This may briefly interrupt active connections. @@ -119,7 +146,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | Database | Error] + Response[Database | Error] """ @@ -143,7 +170,7 @@ def sync( client: AuthenticatedClient, body: UpdateDatabaseTypeRequest, -) -> Any | Database | Error | None: +) -> Database | Error | None: """ Update database size Change the size tier of a database. This may briefly interrupt active connections. @@ -166,7 +193,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | Database | Error + Database | Error """ @@ -185,7 +212,7 @@ async def asyncio_detailed( client: AuthenticatedClient, body: UpdateDatabaseTypeRequest, -) -> Response[Any | Database | Error]: +) -> Response[Database | Error]: """ Update database size Change the size tier of a database. This may briefly interrupt active connections. @@ -208,7 +235,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | Database | Error] + Response[Database | Error] """ @@ -232,7 +259,7 @@ async def asyncio( client: AuthenticatedClient, body: UpdateDatabaseTypeRequest, -) -> Any | Database | Error | None: +) -> Database | Error | None: """ Update database size Change the size tier of a database. This may briefly interrupt active connections. @@ -255,7 +282,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | Database | Error + Database | Error """ diff --git a/src/volcano_sdk/_generated/api/durable_functions/get_durable_execution_from_application.py b/src/volcano_sdk/_generated/api/durable_functions/get_durable_execution_from_application.py new file mode 100644 index 00000000..f4f26717 --- /dev/null +++ b/src/volcano_sdk/_generated/api/durable_functions/get_durable_execution_from_application.py @@ -0,0 +1,333 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.durable_execution import DurableExecution +from ...models.error import Error +from ...types import UNSET, Unset +from typing import cast +from uuid import UUID + + + +def request_kwargs( + function_id: str, + execution_id: UUID | str, + *, + x_volcano_client_token: str | Unset = UNSET, + +) -> dict[str, Any]: + headers: dict[str, Any] = {} + if not isinstance(x_volcano_client_token, Unset): + headers["X-Volcano-Client-Token"] = x_volcano_client_token + + + + + + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/durable-functions/{function_id}/executions/{execution_id}".format(function_id=quote(str(function_id), safe=""),execution_id=quote(str(execution_id), safe=""),), + } + + + _kwargs["headers"] = headers + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> DurableExecution | Error | None: + if response.status_code == 200: + response_200 = DurableExecution.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 429: + response_429 = Error.from_dict(response.json()) + + + + return response_429 + + if response.status_code == 503: + response_503 = Error.from_dict(response.json()) + + + + return response_503 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[DurableExecution | Error]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + function_id: str, + execution_id: UUID | str, + *, + client: AuthenticatedClient, + x_volcano_client_token: str | Unset = UNSET, + +) -> Response[DurableExecution | Error]: + """ Get a durable execution from an application + + Returns the execution's current state with the credential that started + it, including its `result` once it has succeeded. Poll this to wait for + an execution to finish. + + **With a service key:** any execution in the project when the key holds + `*`, the default. A key scoped to a list without `*` reaches an + execution whose `X-Volcano-Client-Token` the request carries, as an + anon key does; the start returns that token. + + **With an auth user token:** an execution the user started, or one + whose `X-Volcano-Client-Token` the request carries, of a durable + function whose `visibility` is `authenticated` or `public`. + + **With an anon key:** an execution whose `X-Volcano-Client-Token` the + request carries, of a function with `visibility: public`. + + Only a service key holding `*` reaches an execution that is still + `pending`. Any other execution answers `404`, as a missing one does. + + The response is the one `GET + /projects/{id}/durable-functions/{functionId}/executions/{executionId}` + returns. It never carries `client_token`. + + Args: + function_id (str): + execution_id (UUID): + x_volcano_client_token (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DurableExecution | Error] + """ + + + kwargs = request_kwargs( + function_id=function_id, +execution_id=execution_id, +x_volcano_client_token=x_volcano_client_token, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + function_id: str, + execution_id: UUID | str, + *, + client: AuthenticatedClient, + x_volcano_client_token: str | Unset = UNSET, + +) -> DurableExecution | Error | None: + """ Get a durable execution from an application + + Returns the execution's current state with the credential that started + it, including its `result` once it has succeeded. Poll this to wait for + an execution to finish. + + **With a service key:** any execution in the project when the key holds + `*`, the default. A key scoped to a list without `*` reaches an + execution whose `X-Volcano-Client-Token` the request carries, as an + anon key does; the start returns that token. + + **With an auth user token:** an execution the user started, or one + whose `X-Volcano-Client-Token` the request carries, of a durable + function whose `visibility` is `authenticated` or `public`. + + **With an anon key:** an execution whose `X-Volcano-Client-Token` the + request carries, of a function with `visibility: public`. + + Only a service key holding `*` reaches an execution that is still + `pending`. Any other execution answers `404`, as a missing one does. + + The response is the one `GET + /projects/{id}/durable-functions/{functionId}/executions/{executionId}` + returns. It never carries `client_token`. + + Args: + function_id (str): + execution_id (UUID): + x_volcano_client_token (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DurableExecution | Error + """ + + + return sync_detailed( + function_id=function_id, +execution_id=execution_id, +client=client, +x_volcano_client_token=x_volcano_client_token, + + ).parsed + +async def asyncio_detailed( + function_id: str, + execution_id: UUID | str, + *, + client: AuthenticatedClient, + x_volcano_client_token: str | Unset = UNSET, + +) -> Response[DurableExecution | Error]: + """ Get a durable execution from an application + + Returns the execution's current state with the credential that started + it, including its `result` once it has succeeded. Poll this to wait for + an execution to finish. + + **With a service key:** any execution in the project when the key holds + `*`, the default. A key scoped to a list without `*` reaches an + execution whose `X-Volcano-Client-Token` the request carries, as an + anon key does; the start returns that token. + + **With an auth user token:** an execution the user started, or one + whose `X-Volcano-Client-Token` the request carries, of a durable + function whose `visibility` is `authenticated` or `public`. + + **With an anon key:** an execution whose `X-Volcano-Client-Token` the + request carries, of a function with `visibility: public`. + + Only a service key holding `*` reaches an execution that is still + `pending`. Any other execution answers `404`, as a missing one does. + + The response is the one `GET + /projects/{id}/durable-functions/{functionId}/executions/{executionId}` + returns. It never carries `client_token`. + + Args: + function_id (str): + execution_id (UUID): + x_volcano_client_token (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DurableExecution | Error] + """ + + + kwargs = request_kwargs( + function_id=function_id, +execution_id=execution_id, +x_volcano_client_token=x_volcano_client_token, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + function_id: str, + execution_id: UUID | str, + *, + client: AuthenticatedClient, + x_volcano_client_token: str | Unset = UNSET, + +) -> DurableExecution | Error | None: + """ Get a durable execution from an application + + Returns the execution's current state with the credential that started + it, including its `result` once it has succeeded. Poll this to wait for + an execution to finish. + + **With a service key:** any execution in the project when the key holds + `*`, the default. A key scoped to a list without `*` reaches an + execution whose `X-Volcano-Client-Token` the request carries, as an + anon key does; the start returns that token. + + **With an auth user token:** an execution the user started, or one + whose `X-Volcano-Client-Token` the request carries, of a durable + function whose `visibility` is `authenticated` or `public`. + + **With an anon key:** an execution whose `X-Volcano-Client-Token` the + request carries, of a function with `visibility: public`. + + Only a service key holding `*` reaches an execution that is still + `pending`. Any other execution answers `404`, as a missing one does. + + The response is the one `GET + /projects/{id}/durable-functions/{functionId}/executions/{executionId}` + returns. It never carries `client_token`. + + Args: + function_id (str): + execution_id (UUID): + x_volcano_client_token (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DurableExecution | Error + """ + + + return (await asyncio_detailed( + function_id=function_id, +execution_id=execution_id, +client=client, +x_volcano_client_token=x_volcano_client_token, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/durable_functions/register_durable_callback.py b/src/volcano_sdk/_generated/api/durable_functions/register_durable_callback.py index bc734510..c855309f 100644 --- a/src/volcano_sdk/_generated/api/durable_functions/register_durable_callback.py +++ b/src/volcano_sdk/_generated/api/durable_functions/register_durable_callback.py @@ -131,7 +131,9 @@ def sync_detailed( the step's own timeout, and only for that step. Retrying is safe: a request for a step that is already registered - returns the same token with `200`. + returns the same token with `200` while the step still waits. Once + the token is answered, or the step times out or ends, a retry answers + `409` with `callback_closed`. Args: body (RegisterDurableCallbackRequest): @@ -174,7 +176,9 @@ def sync( the step's own timeout, and only for that step. Retrying is safe: a request for a step that is already registered - returns the same token with `200`. + returns the same token with `200` while the step still waits. Once + the token is answered, or the step times out or ends, a retry answers + `409` with `callback_closed`. Args: body (RegisterDurableCallbackRequest): @@ -212,7 +216,9 @@ async def asyncio_detailed( the step's own timeout, and only for that step. Retrying is safe: a request for a step that is already registered - returns the same token with `200`. + returns the same token with `200` while the step still waits. Once + the token is answered, or the step times out or ends, a retry answers + `409` with `callback_closed`. Args: body (RegisterDurableCallbackRequest): @@ -255,7 +261,9 @@ async def asyncio( the step's own timeout, and only for that step. Retrying is safe: a request for a step that is already registered - returns the same token with `200`. + returns the same token with `200` while the step still waits. Once + the token is answered, or the step times out or ends, a retry answers + `409` with `callback_closed`. Args: body (RegisterDurableCallbackRequest): diff --git a/src/volcano_sdk/_generated/api/durable_functions/send_durable_message_from_application.py b/src/volcano_sdk/_generated/api/durable_functions/send_durable_message_from_application.py index bed60a85..c8e2132e 100644 --- a/src/volcano_sdk/_generated/api/durable_functions/send_durable_message_from_application.py +++ b/src/volcano_sdk/_generated/api/durable_functions/send_durable_message_from_application.py @@ -159,7 +159,11 @@ def sync_detailed( Messages never decide an approval: a workflow waiting in `ctx.waitForApproval` is not resumed by one. - **With a service key:** any execution in the project. + **With a service key:** any execution in the project when the key holds + `*`, the default. A key scoped to a list without `*`, such as + `["functions.invoke"]`, reaches an execution whose + `X-Volcano-Client-Token` the request carries, as an anon key does; the + start returns that token. **With an auth user token:** an execution the user started, or one whose `X-Volcano-Client-Token` the request carries, of a durable @@ -225,7 +229,11 @@ def sync( Messages never decide an approval: a workflow waiting in `ctx.waitForApproval` is not resumed by one. - **With a service key:** any execution in the project. + **With a service key:** any execution in the project when the key holds + `*`, the default. A key scoped to a list without `*`, such as + `["functions.invoke"]`, reaches an execution whose + `X-Volcano-Client-Token` the request carries, as an anon key does; the + start returns that token. **With an auth user token:** an execution the user started, or one whose `X-Volcano-Client-Token` the request carries, of a durable @@ -286,7 +294,11 @@ async def asyncio_detailed( Messages never decide an approval: a workflow waiting in `ctx.waitForApproval` is not resumed by one. - **With a service key:** any execution in the project. + **With a service key:** any execution in the project when the key holds + `*`, the default. A key scoped to a list without `*`, such as + `["functions.invoke"]`, reaches an execution whose + `X-Volcano-Client-Token` the request carries, as an anon key does; the + start returns that token. **With an auth user token:** an execution the user started, or one whose `X-Volcano-Client-Token` the request carries, of a durable @@ -352,7 +364,11 @@ async def asyncio( Messages never decide an approval: a workflow waiting in `ctx.waitForApproval` is not resumed by one. - **With a service key:** any execution in the project. + **With a service key:** any execution in the project when the key holds + `*`, the default. A key scoped to a list without `*`, such as + `["functions.invoke"]`, reaches an execution whose + `X-Volcano-Client-Token` the request carries, as an anon key does; the + start returns that token. **With an auth user token:** an execution the user started, or one whose `X-Volcano-Client-Token` the request carries, of a durable diff --git a/src/volcano_sdk/_generated/api/durable_functions/start_durable_execution_from_application.py b/src/volcano_sdk/_generated/api/durable_functions/start_durable_execution_from_application.py index 282b2377..5a8839b1 100644 --- a/src/volcano_sdk/_generated/api/durable_functions/start_durable_execution_from_application.py +++ b/src/volcano_sdk/_generated/api/durable_functions/start_durable_execution_from_application.py @@ -157,10 +157,13 @@ def sync_detailed( A `private` durable function answers every credential but a service key exactly as a missing one, with 404. - Starting is all this endpoint does. Reading a result or stopping an - execution requires the project owner's token, because an anon key is - shared by everyone who loads the page and an execution is addressed by - id alone. + The start returns a `client_token`. An anon key, a service key scoped + to a list without `*`, or a user who did not start the execution, + sends it as `X-Volcano-Client-Token` to read the execution, stop it, + and reach its messages. An anon key is shared by everyone who loads + the page, so the id alone never reaches an + execution. Listing executions takes the project owner's token or a + project access token. Send `X-Volcano-Execution-Name` to make the start idempotent: repeating a start with the same name returns the existing execution instead of @@ -230,10 +233,13 @@ def sync( A `private` durable function answers every credential but a service key exactly as a missing one, with 404. - Starting is all this endpoint does. Reading a result or stopping an - execution requires the project owner's token, because an anon key is - shared by everyone who loads the page and an execution is addressed by - id alone. + The start returns a `client_token`. An anon key, a service key scoped + to a list without `*`, or a user who did not start the execution, + sends it as `X-Volcano-Client-Token` to read the execution, stop it, + and reach its messages. An anon key is shared by everyone who loads + the page, so the id alone never reaches an + execution. Listing executions takes the project owner's token or a + project access token. Send `X-Volcano-Execution-Name` to make the start idempotent: repeating a start with the same name returns the existing execution instead of @@ -298,10 +304,13 @@ async def asyncio_detailed( A `private` durable function answers every credential but a service key exactly as a missing one, with 404. - Starting is all this endpoint does. Reading a result or stopping an - execution requires the project owner's token, because an anon key is - shared by everyone who loads the page and an execution is addressed by - id alone. + The start returns a `client_token`. An anon key, a service key scoped + to a list without `*`, or a user who did not start the execution, + sends it as `X-Volcano-Client-Token` to read the execution, stop it, + and reach its messages. An anon key is shared by everyone who loads + the page, so the id alone never reaches an + execution. Listing executions takes the project owner's token or a + project access token. Send `X-Volcano-Execution-Name` to make the start idempotent: repeating a start with the same name returns the existing execution instead of @@ -371,10 +380,13 @@ async def asyncio( A `private` durable function answers every credential but a service key exactly as a missing one, with 404. - Starting is all this endpoint does. Reading a result or stopping an - execution requires the project owner's token, because an anon key is - shared by everyone who loads the page and an execution is addressed by - id alone. + The start returns a `client_token`. An anon key, a service key scoped + to a list without `*`, or a user who did not start the execution, + sends it as `X-Volcano-Client-Token` to read the execution, stop it, + and reach its messages. An anon key is shared by everyone who loads + the page, so the id alone never reaches an + execution. Listing executions takes the project owner's token or a + project access token. Send `X-Volcano-Execution-Name` to make the start idempotent: repeating a start with the same name returns the existing execution instead of diff --git a/src/volcano_sdk/_generated/api/durable_functions/stop_durable_execution_from_application.py b/src/volcano_sdk/_generated/api/durable_functions/stop_durable_execution_from_application.py new file mode 100644 index 00000000..06387e68 --- /dev/null +++ b/src/volcano_sdk/_generated/api/durable_functions/stop_durable_execution_from_application.py @@ -0,0 +1,300 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.durable_execution import DurableExecution +from ...models.error import Error +from ...types import UNSET, Unset +from typing import cast +from uuid import UUID + + + +def request_kwargs( + function_id: str, + execution_id: UUID | str, + *, + x_volcano_client_token: str | Unset = UNSET, + +) -> dict[str, Any]: + headers: dict[str, Any] = {} + if not isinstance(x_volcano_client_token, Unset): + headers["X-Volcano-Client-Token"] = x_volcano_client_token + + + + + + + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/durable-functions/{function_id}/executions/{execution_id}/stop".format(function_id=quote(str(function_id), safe=""),execution_id=quote(str(execution_id), safe=""),), + } + + + _kwargs["headers"] = headers + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> DurableExecution | Error | None: + if response.status_code == 200: + response_200 = DurableExecution.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 409: + response_409 = Error.from_dict(response.json()) + + + + return response_409 + + if response.status_code == 429: + response_429 = Error.from_dict(response.json()) + + + + return response_429 + + if response.status_code == 503: + response_503 = Error.from_dict(response.json()) + + + + return response_503 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[DurableExecution | Error]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + function_id: str, + execution_id: UUID | str, + *, + client: AuthenticatedClient, + x_volcano_client_token: str | Unset = UNSET, + +) -> Response[DurableExecution | Error]: + """ Stop a durable execution from an application + + Cancels a running execution with the credential that started it. Its + completed steps are not undone. + + Access follows the same rules as reading the execution. + + The call is accepted rather than awaited: the response reports the + execution as it was read back and may still say `running`. Poll + `GET /durable-functions/{functionId}/executions/{executionId}` to see + it settle into `stopped`. + + Stopping an execution that already finished is not an error: the + response carries the state it settled in. + + Args: + function_id (str): + execution_id (UUID): + x_volcano_client_token (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DurableExecution | Error] + """ + + + kwargs = request_kwargs( + function_id=function_id, +execution_id=execution_id, +x_volcano_client_token=x_volcano_client_token, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + function_id: str, + execution_id: UUID | str, + *, + client: AuthenticatedClient, + x_volcano_client_token: str | Unset = UNSET, + +) -> DurableExecution | Error | None: + """ Stop a durable execution from an application + + Cancels a running execution with the credential that started it. Its + completed steps are not undone. + + Access follows the same rules as reading the execution. + + The call is accepted rather than awaited: the response reports the + execution as it was read back and may still say `running`. Poll + `GET /durable-functions/{functionId}/executions/{executionId}` to see + it settle into `stopped`. + + Stopping an execution that already finished is not an error: the + response carries the state it settled in. + + Args: + function_id (str): + execution_id (UUID): + x_volcano_client_token (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DurableExecution | Error + """ + + + return sync_detailed( + function_id=function_id, +execution_id=execution_id, +client=client, +x_volcano_client_token=x_volcano_client_token, + + ).parsed + +async def asyncio_detailed( + function_id: str, + execution_id: UUID | str, + *, + client: AuthenticatedClient, + x_volcano_client_token: str | Unset = UNSET, + +) -> Response[DurableExecution | Error]: + """ Stop a durable execution from an application + + Cancels a running execution with the credential that started it. Its + completed steps are not undone. + + Access follows the same rules as reading the execution. + + The call is accepted rather than awaited: the response reports the + execution as it was read back and may still say `running`. Poll + `GET /durable-functions/{functionId}/executions/{executionId}` to see + it settle into `stopped`. + + Stopping an execution that already finished is not an error: the + response carries the state it settled in. + + Args: + function_id (str): + execution_id (UUID): + x_volcano_client_token (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DurableExecution | Error] + """ + + + kwargs = request_kwargs( + function_id=function_id, +execution_id=execution_id, +x_volcano_client_token=x_volcano_client_token, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + function_id: str, + execution_id: UUID | str, + *, + client: AuthenticatedClient, + x_volcano_client_token: str | Unset = UNSET, + +) -> DurableExecution | Error | None: + """ Stop a durable execution from an application + + Cancels a running execution with the credential that started it. Its + completed steps are not undone. + + Access follows the same rules as reading the execution. + + The call is accepted rather than awaited: the response reports the + execution as it was read back and may still say `running`. Poll + `GET /durable-functions/{functionId}/executions/{executionId}` to see + it settle into `stopped`. + + Stopping an execution that already finished is not an error: the + response carries the state it settled in. + + Args: + function_id (str): + execution_id (UUID): + x_volcano_client_token (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DurableExecution | Error + """ + + + return (await asyncio_detailed( + function_id=function_id, +execution_id=execution_id, +client=client, +x_volcano_client_token=x_volcano_client_token, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/forks/__init__.py b/src/volcano_sdk/_generated/api/forks/__init__.py new file mode 100644 index 00000000..c9921b5f --- /dev/null +++ b/src/volcano_sdk/_generated/api/forks/__init__.py @@ -0,0 +1 @@ +""" Contains endpoint functions for accessing the API """ diff --git a/src/volcano_sdk/_generated/api/forks/create_fork.py b/src/volcano_sdk/_generated/api/forks/create_fork.py new file mode 100644 index 00000000..725de661 --- /dev/null +++ b/src/volcano_sdk/_generated/api/forks/create_fork.py @@ -0,0 +1,338 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from ...models.fork_create_request import ForkCreateRequest +from ...models.project import Project +from ...types import UNSET, Unset +from typing import cast + + + +def request_kwargs( + *, + body: ForkCreateRequest, + idempotency_key: str | Unset = UNSET, + +) -> dict[str, Any]: + headers: dict[str, Any] = {} + if not isinstance(idempotency_key, Unset): + headers["Idempotency-Key"] = idempotency_key + + + + + + + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/forks", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | Project | None: + if response.status_code == 201: + response_201 = Project.from_dict(response.json()) + + + + return response_201 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 409: + response_409 = Error.from_dict(response.json()) + + + + return response_409 + + if response.status_code == 422: + response_422 = Error.from_dict(response.json()) + + + + return response_422 + + if response.status_code == 429: + response_429 = Error.from_dict(response.json()) + + + + return response_429 + + if response.status_code == 451: + response_451 = Error.from_dict(response.json()) + + + + return response_451 + + if response.status_code == 500: + response_500 = Error.from_dict(response.json()) + + + + return response_500 + + if response.status_code == 503: + response_503 = Error.from_dict(response.json()) + + + + return response_503 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | Project]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: ForkCreateRequest, + idempotency_key: str | Unset = UNSET, + +) -> Response[Error | Project]: + """ Fork a share into a project of your own + + Creates a project in the caller's account from the release a share offers, + and queues its install: the release's functions and frontends, never the + owner's data, variable values, keys or sign-in settings. Every variable the + release declares is created; one the visitor gives no value for is created + empty. Installation is asynchronous: poll the project until + `template_installation.status` is `ready`. A `201` without + `template_installation` means nothing is being installed. + + The fork is checked against what the release recorded when it was published + (its functions, frontends and variables, and the plan's room for them); the + release's archive is read and checked by the install. A stored archive that + fails those checks fails the install with `failure_code` `source_invalid` + rather than refusing the request. + + Send the `release_id` that `GET /share-previews/{share_id}` returned. If the + share moved to a new release since, nothing is created and the answer is + `409` with code `release_changed`. + + Args: + idempotency_key (str | Unset): + body (ForkCreateRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | Project] + """ + + + kwargs = request_kwargs( + body=body, +idempotency_key=idempotency_key, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient, + body: ForkCreateRequest, + idempotency_key: str | Unset = UNSET, + +) -> Error | Project | None: + """ Fork a share into a project of your own + + Creates a project in the caller's account from the release a share offers, + and queues its install: the release's functions and frontends, never the + owner's data, variable values, keys or sign-in settings. Every variable the + release declares is created; one the visitor gives no value for is created + empty. Installation is asynchronous: poll the project until + `template_installation.status` is `ready`. A `201` without + `template_installation` means nothing is being installed. + + The fork is checked against what the release recorded when it was published + (its functions, frontends and variables, and the plan's room for them); the + release's archive is read and checked by the install. A stored archive that + fails those checks fails the install with `failure_code` `source_invalid` + rather than refusing the request. + + Send the `release_id` that `GET /share-previews/{share_id}` returned. If the + share moved to a new release since, nothing is created and the answer is + `409` with code `release_changed`. + + Args: + idempotency_key (str | Unset): + body (ForkCreateRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | Project + """ + + + return sync_detailed( + client=client, +body=body, +idempotency_key=idempotency_key, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: ForkCreateRequest, + idempotency_key: str | Unset = UNSET, + +) -> Response[Error | Project]: + """ Fork a share into a project of your own + + Creates a project in the caller's account from the release a share offers, + and queues its install: the release's functions and frontends, never the + owner's data, variable values, keys or sign-in settings. Every variable the + release declares is created; one the visitor gives no value for is created + empty. Installation is asynchronous: poll the project until + `template_installation.status` is `ready`. A `201` without + `template_installation` means nothing is being installed. + + The fork is checked against what the release recorded when it was published + (its functions, frontends and variables, and the plan's room for them); the + release's archive is read and checked by the install. A stored archive that + fails those checks fails the install with `failure_code` `source_invalid` + rather than refusing the request. + + Send the `release_id` that `GET /share-previews/{share_id}` returned. If the + share moved to a new release since, nothing is created and the answer is + `409` with code `release_changed`. + + Args: + idempotency_key (str | Unset): + body (ForkCreateRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | Project] + """ + + + kwargs = request_kwargs( + body=body, +idempotency_key=idempotency_key, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient, + body: ForkCreateRequest, + idempotency_key: str | Unset = UNSET, + +) -> Error | Project | None: + """ Fork a share into a project of your own + + Creates a project in the caller's account from the release a share offers, + and queues its install: the release's functions and frontends, never the + owner's data, variable values, keys or sign-in settings. Every variable the + release declares is created; one the visitor gives no value for is created + empty. Installation is asynchronous: poll the project until + `template_installation.status` is `ready`. A `201` without + `template_installation` means nothing is being installed. + + The fork is checked against what the release recorded when it was published + (its functions, frontends and variables, and the plan's room for them); the + release's archive is read and checked by the install. A stored archive that + fails those checks fails the install with `failure_code` `source_invalid` + rather than refusing the request. + + Send the `release_id` that `GET /share-previews/{share_id}` returned. If the + share moved to a new release since, nothing is created and the answer is + `409` with code `release_changed`. + + Args: + idempotency_key (str | Unset): + body (ForkCreateRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | Project + """ + + + return (await asyncio_detailed( + client=client, +body=body, +idempotency_key=idempotency_key, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/frontends/create_frontend.py b/src/volcano_sdk/_generated/api/frontends/create_frontend.py index 1509d39f..d1c4374c 100644 --- a/src/volcano_sdk/_generated/api/frontends/create_frontend.py +++ b/src/volcano_sdk/_generated/api/frontends/create_frontend.py @@ -149,16 +149,16 @@ def sync_detailed( For monorepos, provide `app_root` as a relative path from the uploaded archive root to the Next.js app that should be built. Omit it for single-app archives. Supported frontend environments are Next.js 15.x and 16.x with Node.js - 22.x or 24.x. The Node.js runtime is inferred from + 22.x, 24.x, or 26.x. The Node.js runtime is inferred from `package.json` `engines.node`; if omitted, Volcano uses Node.js 22.x. The selected Node.js family must also satisfy the installed Next.js package's - `engines.node` constraint. Volcano tests Next 15.5.28 (`^18.18.0 || ^19.8.0 || >=20.0.0`) and Next - 16.4.2 (`>=20.9.0`). + `engines.node` constraint. Volcano tests Next 15.5.29 (`^18.18.0 || ^19.8.0 || >=20.0.0`) and Next + 16.5.0 (`>=20.9.0`). Source archive size is enforced by the API with `SOURCE_ARCHIVE_SIZE_LIMIT_MB`; the CLI does not apply its own source archive size limit. After the final container images are built, the publish build enforces `LAMBDA_TARGET_CONTAINER_SIZE_LIMIT_MB` before pushing. - This operation is limited by plan-based frontend deployment quotas (`FREE_FRONTEND_DEPLOYMENTS`, - `PRO_FRONTEND_DEPLOYMENTS`). + Plans do not limit how many frontends a project has; usage allowances apply across all of a user's + frontends. Each project can contain up to 10,000 frontends regardless of plan. Args: @@ -213,16 +213,16 @@ def sync( For monorepos, provide `app_root` as a relative path from the uploaded archive root to the Next.js app that should be built. Omit it for single-app archives. Supported frontend environments are Next.js 15.x and 16.x with Node.js - 22.x or 24.x. The Node.js runtime is inferred from + 22.x, 24.x, or 26.x. The Node.js runtime is inferred from `package.json` `engines.node`; if omitted, Volcano uses Node.js 22.x. The selected Node.js family must also satisfy the installed Next.js package's - `engines.node` constraint. Volcano tests Next 15.5.28 (`^18.18.0 || ^19.8.0 || >=20.0.0`) and Next - 16.4.2 (`>=20.9.0`). + `engines.node` constraint. Volcano tests Next 15.5.29 (`^18.18.0 || ^19.8.0 || >=20.0.0`) and Next + 16.5.0 (`>=20.9.0`). Source archive size is enforced by the API with `SOURCE_ARCHIVE_SIZE_LIMIT_MB`; the CLI does not apply its own source archive size limit. After the final container images are built, the publish build enforces `LAMBDA_TARGET_CONTAINER_SIZE_LIMIT_MB` before pushing. - This operation is limited by plan-based frontend deployment quotas (`FREE_FRONTEND_DEPLOYMENTS`, - `PRO_FRONTEND_DEPLOYMENTS`). + Plans do not limit how many frontends a project has; usage allowances apply across all of a user's + frontends. Each project can contain up to 10,000 frontends regardless of plan. Args: @@ -272,16 +272,16 @@ async def asyncio_detailed( For monorepos, provide `app_root` as a relative path from the uploaded archive root to the Next.js app that should be built. Omit it for single-app archives. Supported frontend environments are Next.js 15.x and 16.x with Node.js - 22.x or 24.x. The Node.js runtime is inferred from + 22.x, 24.x, or 26.x. The Node.js runtime is inferred from `package.json` `engines.node`; if omitted, Volcano uses Node.js 22.x. The selected Node.js family must also satisfy the installed Next.js package's - `engines.node` constraint. Volcano tests Next 15.5.28 (`^18.18.0 || ^19.8.0 || >=20.0.0`) and Next - 16.4.2 (`>=20.9.0`). + `engines.node` constraint. Volcano tests Next 15.5.29 (`^18.18.0 || ^19.8.0 || >=20.0.0`) and Next + 16.5.0 (`>=20.9.0`). Source archive size is enforced by the API with `SOURCE_ARCHIVE_SIZE_LIMIT_MB`; the CLI does not apply its own source archive size limit. After the final container images are built, the publish build enforces `LAMBDA_TARGET_CONTAINER_SIZE_LIMIT_MB` before pushing. - This operation is limited by plan-based frontend deployment quotas (`FREE_FRONTEND_DEPLOYMENTS`, - `PRO_FRONTEND_DEPLOYMENTS`). + Plans do not limit how many frontends a project has; usage allowances apply across all of a user's + frontends. Each project can contain up to 10,000 frontends regardless of plan. Args: @@ -336,16 +336,16 @@ async def asyncio( For monorepos, provide `app_root` as a relative path from the uploaded archive root to the Next.js app that should be built. Omit it for single-app archives. Supported frontend environments are Next.js 15.x and 16.x with Node.js - 22.x or 24.x. The Node.js runtime is inferred from + 22.x, 24.x, or 26.x. The Node.js runtime is inferred from `package.json` `engines.node`; if omitted, Volcano uses Node.js 22.x. The selected Node.js family must also satisfy the installed Next.js package's - `engines.node` constraint. Volcano tests Next 15.5.28 (`^18.18.0 || ^19.8.0 || >=20.0.0`) and Next - 16.4.2 (`>=20.9.0`). + `engines.node` constraint. Volcano tests Next 15.5.29 (`^18.18.0 || ^19.8.0 || >=20.0.0`) and Next + 16.5.0 (`>=20.9.0`). Source archive size is enforced by the API with `SOURCE_ARCHIVE_SIZE_LIMIT_MB`; the CLI does not apply its own source archive size limit. After the final container images are built, the publish build enforces `LAMBDA_TARGET_CONTAINER_SIZE_LIMIT_MB` before pushing. - This operation is limited by plan-based frontend deployment quotas (`FREE_FRONTEND_DEPLOYMENTS`, - `PRO_FRONTEND_DEPLOYMENTS`). + Plans do not limit how many frontends a project has; usage allowances apply across all of a user's + frontends. Each project can contain up to 10,000 frontends regardless of plan. Args: diff --git a/src/volcano_sdk/_generated/api/frontends/create_frontend_candidate.py b/src/volcano_sdk/_generated/api/frontends/create_frontend_candidate.py new file mode 100644 index 00000000..560b37a5 --- /dev/null +++ b/src/volcano_sdk/_generated/api/frontends/create_frontend_candidate.py @@ -0,0 +1,345 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.create_frontend_candidate_body import CreateFrontendCandidateBody +from ...models.error import Error +from ...models.frontend_candidate import FrontendCandidate +from typing import cast +from uuid import UUID + + + +def request_kwargs( + id: UUID | str, + frontend_id: UUID | str, + *, + body: CreateFrontendCandidateBody, + +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + + + + + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/projects/{id}/frontends/{frontend_id}/candidates".format(id=quote(str(id), safe=""),frontend_id=quote(str(frontend_id), safe=""),), + } + + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data; boundary=+++" + + _kwargs["headers"] = headers + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | FrontendCandidate | None: + if response.status_code == 202: + response_202 = FrontendCandidate.from_dict(response.json()) + + + + return response_202 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 409: + response_409 = Error.from_dict(response.json()) + + + + return response_409 + + if response.status_code == 413: + response_413 = Error.from_dict(response.json()) + + + + return response_413 + + if response.status_code == 429: + response_429 = Error.from_dict(response.json()) + + + + return response_429 + + if response.status_code == 500: + response_500 = Error.from_dict(response.json()) + + + + return response_500 + + if response.status_code == 503: + response_503 = Error.from_dict(response.json()) + + + + return response_503 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | FrontendCandidate]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID | str, + frontend_id: UUID | str, + *, + client: AuthenticatedClient, + body: CreateFrontendCandidateBody, + +) -> Response[Error | FrontendCandidate]: + """ Create a frontend Candidate + + Builds a copy of the frontend from the uploaded archive, with the frontend's own variable + selection, and deploys it to one region: the first region the frontend deploys to, or the + project's first region by name if it has not deployed yet. The Candidate is served at its own + URL, so it can be checked without changing what the frontend serves. The URL is reachable by + anyone who holds it and is not indexed; a Candidate is never public and does not claim to be + private. The response is `202` while the first deployment runs; read the Candidate for its + `status` and `url`. + + Creating a Candidate is available while the `frontends.candidates` capability is. While it is + not, this operation, redeploying, promoting and rolling back to a Candidate answer `404` with + code `feature_unavailable`; reading and deleting existing Candidates, and rolling back to the + frontend's own runtime, keep working. + + A Candidate builds like any deploy and spends the project's build minutes. The project owner's + account holds at most its plan's live Candidates across all of its projects and frontends: 1000 + on HOBBY, 10000 on SUPERAGENT, and one frontend at most 100 whatever the plan. A Candidate counts + until its deletion completes. Each name is unique within + the frontend. Without `ttl_seconds` a Candidate is kept until it is deleted. + + Args: + id (UUID): + frontend_id (UUID): + body (CreateFrontendCandidateBody): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | FrontendCandidate] + """ + + + kwargs = request_kwargs( + id=id, +frontend_id=frontend_id, +body=body, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + id: UUID | str, + frontend_id: UUID | str, + *, + client: AuthenticatedClient, + body: CreateFrontendCandidateBody, + +) -> Error | FrontendCandidate | None: + """ Create a frontend Candidate + + Builds a copy of the frontend from the uploaded archive, with the frontend's own variable + selection, and deploys it to one region: the first region the frontend deploys to, or the + project's first region by name if it has not deployed yet. The Candidate is served at its own + URL, so it can be checked without changing what the frontend serves. The URL is reachable by + anyone who holds it and is not indexed; a Candidate is never public and does not claim to be + private. The response is `202` while the first deployment runs; read the Candidate for its + `status` and `url`. + + Creating a Candidate is available while the `frontends.candidates` capability is. While it is + not, this operation, redeploying, promoting and rolling back to a Candidate answer `404` with + code `feature_unavailable`; reading and deleting existing Candidates, and rolling back to the + frontend's own runtime, keep working. + + A Candidate builds like any deploy and spends the project's build minutes. The project owner's + account holds at most its plan's live Candidates across all of its projects and frontends: 1000 + on HOBBY, 10000 on SUPERAGENT, and one frontend at most 100 whatever the plan. A Candidate counts + until its deletion completes. Each name is unique within + the frontend. Without `ttl_seconds` a Candidate is kept until it is deleted. + + Args: + id (UUID): + frontend_id (UUID): + body (CreateFrontendCandidateBody): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | FrontendCandidate + """ + + + return sync_detailed( + id=id, +frontend_id=frontend_id, +client=client, +body=body, + + ).parsed + +async def asyncio_detailed( + id: UUID | str, + frontend_id: UUID | str, + *, + client: AuthenticatedClient, + body: CreateFrontendCandidateBody, + +) -> Response[Error | FrontendCandidate]: + """ Create a frontend Candidate + + Builds a copy of the frontend from the uploaded archive, with the frontend's own variable + selection, and deploys it to one region: the first region the frontend deploys to, or the + project's first region by name if it has not deployed yet. The Candidate is served at its own + URL, so it can be checked without changing what the frontend serves. The URL is reachable by + anyone who holds it and is not indexed; a Candidate is never public and does not claim to be + private. The response is `202` while the first deployment runs; read the Candidate for its + `status` and `url`. + + Creating a Candidate is available while the `frontends.candidates` capability is. While it is + not, this operation, redeploying, promoting and rolling back to a Candidate answer `404` with + code `feature_unavailable`; reading and deleting existing Candidates, and rolling back to the + frontend's own runtime, keep working. + + A Candidate builds like any deploy and spends the project's build minutes. The project owner's + account holds at most its plan's live Candidates across all of its projects and frontends: 1000 + on HOBBY, 10000 on SUPERAGENT, and one frontend at most 100 whatever the plan. A Candidate counts + until its deletion completes. Each name is unique within + the frontend. Without `ttl_seconds` a Candidate is kept until it is deleted. + + Args: + id (UUID): + frontend_id (UUID): + body (CreateFrontendCandidateBody): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | FrontendCandidate] + """ + + + kwargs = request_kwargs( + id=id, +frontend_id=frontend_id, +body=body, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + id: UUID | str, + frontend_id: UUID | str, + *, + client: AuthenticatedClient, + body: CreateFrontendCandidateBody, + +) -> Error | FrontendCandidate | None: + """ Create a frontend Candidate + + Builds a copy of the frontend from the uploaded archive, with the frontend's own variable + selection, and deploys it to one region: the first region the frontend deploys to, or the + project's first region by name if it has not deployed yet. The Candidate is served at its own + URL, so it can be checked without changing what the frontend serves. The URL is reachable by + anyone who holds it and is not indexed; a Candidate is never public and does not claim to be + private. The response is `202` while the first deployment runs; read the Candidate for its + `status` and `url`. + + Creating a Candidate is available while the `frontends.candidates` capability is. While it is + not, this operation, redeploying, promoting and rolling back to a Candidate answer `404` with + code `feature_unavailable`; reading and deleting existing Candidates, and rolling back to the + frontend's own runtime, keep working. + + A Candidate builds like any deploy and spends the project's build minutes. The project owner's + account holds at most its plan's live Candidates across all of its projects and frontends: 1000 + on HOBBY, 10000 on SUPERAGENT, and one frontend at most 100 whatever the plan. A Candidate counts + until its deletion completes. Each name is unique within + the frontend. Without `ttl_seconds` a Candidate is kept until it is deleted. + + Args: + id (UUID): + frontend_id (UUID): + body (CreateFrontendCandidateBody): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | FrontendCandidate + """ + + + return (await asyncio_detailed( + id=id, +frontend_id=frontend_id, +client=client, +body=body, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/frontends/create_frontend_custom_domain.py b/src/volcano_sdk/_generated/api/frontends/create_frontend_custom_domain.py index 85ce955c..4d1af245 100644 --- a/src/volcano_sdk/_generated/api/frontends/create_frontend_custom_domain.py +++ b/src/volcano_sdk/_generated/api/frontends/create_frontend_custom_domain.py @@ -95,6 +95,13 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return response_409 + if response.status_code == 413: + response_413 = Error.from_dict(response.json()) + + + + return response_413 + if response.status_code == 500: response_500 = Error.from_dict(response.json()) @@ -134,7 +141,10 @@ def sync_detailed( ) -> Response[Error | FrontendCustomDomainConflictError | FrontendCustomDomainResponse]: """ Configure frontend custom domain - Configures one custom domain for a frontend. + Deprecated: use `POST /projects/{id}/frontends/{frontendId}/domains`, which adds a domain beside the + frontend's others. + Configures one custom domain for a frontend. When the frontend already has a domain, a request for + another hostname returns `409`. The default Volcano-generated frontend URL remains active. Wildcard Volcano frontend TLS remains valid and isolated from custom-domain certificate changes. The account must own the hostname: it must have verified the hostname or a domain above it (see @@ -197,7 +207,10 @@ def sync( ) -> Error | FrontendCustomDomainConflictError | FrontendCustomDomainResponse | None: """ Configure frontend custom domain - Configures one custom domain for a frontend. + Deprecated: use `POST /projects/{id}/frontends/{frontendId}/domains`, which adds a domain beside the + frontend's others. + Configures one custom domain for a frontend. When the frontend already has a domain, a request for + another hostname returns `409`. The default Volcano-generated frontend URL remains active. Wildcard Volcano frontend TLS remains valid and isolated from custom-domain certificate changes. The account must own the hostname: it must have verified the hostname or a domain above it (see @@ -255,7 +268,10 @@ async def asyncio_detailed( ) -> Response[Error | FrontendCustomDomainConflictError | FrontendCustomDomainResponse]: """ Configure frontend custom domain - Configures one custom domain for a frontend. + Deprecated: use `POST /projects/{id}/frontends/{frontendId}/domains`, which adds a domain beside the + frontend's others. + Configures one custom domain for a frontend. When the frontend already has a domain, a request for + another hostname returns `409`. The default Volcano-generated frontend URL remains active. Wildcard Volcano frontend TLS remains valid and isolated from custom-domain certificate changes. The account must own the hostname: it must have verified the hostname or a domain above it (see @@ -318,7 +334,10 @@ async def asyncio( ) -> Error | FrontendCustomDomainConflictError | FrontendCustomDomainResponse | None: """ Configure frontend custom domain - Configures one custom domain for a frontend. + Deprecated: use `POST /projects/{id}/frontends/{frontendId}/domains`, which adds a domain beside the + frontend's others. + Configures one custom domain for a frontend. When the frontend already has a domain, a request for + another hostname returns `409`. The default Volcano-generated frontend URL remains active. Wildcard Volcano frontend TLS remains valid and isolated from custom-domain certificate changes. The account must own the hostname: it must have verified the hostname or a domain above it (see diff --git a/src/volcano_sdk/_generated/api/frontends/create_frontend_deployment.py b/src/volcano_sdk/_generated/api/frontends/create_frontend_deployment.py new file mode 100644 index 00000000..440ef049 --- /dev/null +++ b/src/volcano_sdk/_generated/api/frontends/create_frontend_deployment.py @@ -0,0 +1,352 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.create_frontend_deployment_request import CreateFrontendDeploymentRequest +from ...models.error import Error +from ...models.frontend import Frontend +from typing import cast +from uuid import UUID + + + +def request_kwargs( + id: UUID | str, + frontend_id: UUID | str, + *, + body: CreateFrontendDeploymentRequest, + +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + + + + + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/projects/{id}/frontends/{frontend_id}/deployments".format(id=quote(str(id), safe=""),frontend_id=quote(str(frontend_id), safe=""),), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | Frontend | None: + if response.status_code == 200: + response_200 = Frontend.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 409: + response_409 = Error.from_dict(response.json()) + + + + return response_409 + + if response.status_code == 413: + response_413 = Error.from_dict(response.json()) + + + + return response_413 + + if response.status_code == 429: + response_429 = Error.from_dict(response.json()) + + + + return response_429 + + if response.status_code == 500: + response_500 = Error.from_dict(response.json()) + + + + return response_500 + + if response.status_code == 501: + response_501 = Error.from_dict(response.json()) + + + + return response_501 + + if response.status_code == 503: + response_503 = Error.from_dict(response.json()) + + + + return response_503 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | Frontend]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID | str, + frontend_id: UUID | str, + *, + client: AuthenticatedClient, + body: CreateFrontendDeploymentRequest, + +) -> Response[Error | Frontend]: + """ Deploy an existing build to a frontend + + Deploys the build of another frontend's deployment in the same project to this frontend, without + compiling it again. Use it to serve one build from several frontends, such as one per region or + brand. This frontend gets its own copy of the source archive and the build, so later changes to the + source frontend do not reach it, and a later redeploy of this frontend compiles that copied source. + + The build-time variables this frontend would build with must equal those the source build read, + compared by name and value. Volcano records a keyed digest of each value, unique to the build, and + never stores the values. A mismatch returns `409` with `code: build_variables_differ` and the + differing + names in `error`. The source deployment must be `active` or `degraded`, and both frontends must use + the same framework and app root. + + Admission is the redeploy's: the deployment starts with `status: provisioning`, or, while another + deployment is in progress, is exposed through `pending_deployment_id` and supersedes any older + queued deployment. Nothing is compiled: the deployment's build minutes cover publishing the build + alone. The checks run again when a queued deployment starts. A refusal then fails the deployment + without a retry, its `error_message` starting with the refusal's code. + + Args: + id (UUID): + frontend_id (UUID): + body (CreateFrontendDeploymentRequest): Deploys the build of an existing deployment + instead of compiling the frontend's source. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | Frontend] + """ + + + kwargs = request_kwargs( + id=id, +frontend_id=frontend_id, +body=body, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + id: UUID | str, + frontend_id: UUID | str, + *, + client: AuthenticatedClient, + body: CreateFrontendDeploymentRequest, + +) -> Error | Frontend | None: + """ Deploy an existing build to a frontend + + Deploys the build of another frontend's deployment in the same project to this frontend, without + compiling it again. Use it to serve one build from several frontends, such as one per region or + brand. This frontend gets its own copy of the source archive and the build, so later changes to the + source frontend do not reach it, and a later redeploy of this frontend compiles that copied source. + + The build-time variables this frontend would build with must equal those the source build read, + compared by name and value. Volcano records a keyed digest of each value, unique to the build, and + never stores the values. A mismatch returns `409` with `code: build_variables_differ` and the + differing + names in `error`. The source deployment must be `active` or `degraded`, and both frontends must use + the same framework and app root. + + Admission is the redeploy's: the deployment starts with `status: provisioning`, or, while another + deployment is in progress, is exposed through `pending_deployment_id` and supersedes any older + queued deployment. Nothing is compiled: the deployment's build minutes cover publishing the build + alone. The checks run again when a queued deployment starts. A refusal then fails the deployment + without a retry, its `error_message` starting with the refusal's code. + + Args: + id (UUID): + frontend_id (UUID): + body (CreateFrontendDeploymentRequest): Deploys the build of an existing deployment + instead of compiling the frontend's source. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | Frontend + """ + + + return sync_detailed( + id=id, +frontend_id=frontend_id, +client=client, +body=body, + + ).parsed + +async def asyncio_detailed( + id: UUID | str, + frontend_id: UUID | str, + *, + client: AuthenticatedClient, + body: CreateFrontendDeploymentRequest, + +) -> Response[Error | Frontend]: + """ Deploy an existing build to a frontend + + Deploys the build of another frontend's deployment in the same project to this frontend, without + compiling it again. Use it to serve one build from several frontends, such as one per region or + brand. This frontend gets its own copy of the source archive and the build, so later changes to the + source frontend do not reach it, and a later redeploy of this frontend compiles that copied source. + + The build-time variables this frontend would build with must equal those the source build read, + compared by name and value. Volcano records a keyed digest of each value, unique to the build, and + never stores the values. A mismatch returns `409` with `code: build_variables_differ` and the + differing + names in `error`. The source deployment must be `active` or `degraded`, and both frontends must use + the same framework and app root. + + Admission is the redeploy's: the deployment starts with `status: provisioning`, or, while another + deployment is in progress, is exposed through `pending_deployment_id` and supersedes any older + queued deployment. Nothing is compiled: the deployment's build minutes cover publishing the build + alone. The checks run again when a queued deployment starts. A refusal then fails the deployment + without a retry, its `error_message` starting with the refusal's code. + + Args: + id (UUID): + frontend_id (UUID): + body (CreateFrontendDeploymentRequest): Deploys the build of an existing deployment + instead of compiling the frontend's source. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | Frontend] + """ + + + kwargs = request_kwargs( + id=id, +frontend_id=frontend_id, +body=body, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + id: UUID | str, + frontend_id: UUID | str, + *, + client: AuthenticatedClient, + body: CreateFrontendDeploymentRequest, + +) -> Error | Frontend | None: + """ Deploy an existing build to a frontend + + Deploys the build of another frontend's deployment in the same project to this frontend, without + compiling it again. Use it to serve one build from several frontends, such as one per region or + brand. This frontend gets its own copy of the source archive and the build, so later changes to the + source frontend do not reach it, and a later redeploy of this frontend compiles that copied source. + + The build-time variables this frontend would build with must equal those the source build read, + compared by name and value. Volcano records a keyed digest of each value, unique to the build, and + never stores the values. A mismatch returns `409` with `code: build_variables_differ` and the + differing + names in `error`. The source deployment must be `active` or `degraded`, and both frontends must use + the same framework and app root. + + Admission is the redeploy's: the deployment starts with `status: provisioning`, or, while another + deployment is in progress, is exposed through `pending_deployment_id` and supersedes any older + queued deployment. Nothing is compiled: the deployment's build minutes cover publishing the build + alone. The checks run again when a queued deployment starts. A refusal then fails the deployment + without a retry, its `error_message` starting with the refusal's code. + + Args: + id (UUID): + frontend_id (UUID): + body (CreateFrontendDeploymentRequest): Deploys the build of an existing deployment + instead of compiling the frontend's source. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | Frontend + """ + + + return (await asyncio_detailed( + id=id, +frontend_id=frontend_id, +client=client, +body=body, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/frontends/create_frontend_domain.py b/src/volcano_sdk/_generated/api/frontends/create_frontend_domain.py new file mode 100644 index 00000000..152d28f5 --- /dev/null +++ b/src/volcano_sdk/_generated/api/frontends/create_frontend_domain.py @@ -0,0 +1,322 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.create_frontend_domain_request import CreateFrontendDomainRequest +from ...models.error import Error +from ...models.frontend_custom_domain_conflict_error import FrontendCustomDomainConflictError +from ...models.frontend_custom_domain_response import FrontendCustomDomainResponse +from typing import cast +from uuid import UUID + + + +def request_kwargs( + id: UUID | str, + frontend_id: UUID | str, + *, + body: CreateFrontendDomainRequest, + +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + + + + + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/projects/{id}/frontends/{frontend_id}/domains".format(id=quote(str(id), safe=""),frontend_id=quote(str(frontend_id), safe=""),), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | FrontendCustomDomainConflictError | FrontendCustomDomainResponse | None: + if response.status_code == 200: + response_200 = FrontendCustomDomainResponse.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 201: + response_201 = FrontendCustomDomainResponse.from_dict(response.json()) + + + + return response_201 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 409: + response_409 = FrontendCustomDomainConflictError.from_dict(response.json()) + + + + return response_409 + + if response.status_code == 413: + response_413 = Error.from_dict(response.json()) + + + + return response_413 + + if response.status_code == 500: + response_500 = Error.from_dict(response.json()) + + + + return response_500 + + if response.status_code == 503: + response_503 = Error.from_dict(response.json()) + + + + return response_503 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | FrontendCustomDomainConflictError | FrontendCustomDomainResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID | str, + frontend_id: UUID | str, + *, + client: AuthenticatedClient, + body: CreateFrontendDomainRequest, + +) -> Response[Error | FrontendCustomDomainConflictError | FrontendCustomDomainResponse]: + """ Add a custom domain to a frontend + + Adds a custom domain beside the frontend's others, up to the plan's + custom domains per frontend. The domain serves the frontend, or, with + `redirect`, redirects every request to `redirect.to`, another active + domain of the same frontend that serves it, keeping the path and query + string. + A redirecting domain still needs TLS, so it takes `tls` like any other. + + Ownership, verification records, TLS mode switches, and the `409` codes + work as on `POST /projects/{id}/frontends/{frontendId}/domain`. A + request for a hostname the frontend already has returns it with `200`, + or switches its TLS mode in place. When the request's redirect differs + from the domain's, it returns `409`; change a redirect with `PATCH`. + + Args: + id (UUID): + frontend_id (UUID): + body (CreateFrontendDomainRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | FrontendCustomDomainConflictError | FrontendCustomDomainResponse] + """ + + + kwargs = request_kwargs( + id=id, +frontend_id=frontend_id, +body=body, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + id: UUID | str, + frontend_id: UUID | str, + *, + client: AuthenticatedClient, + body: CreateFrontendDomainRequest, + +) -> Error | FrontendCustomDomainConflictError | FrontendCustomDomainResponse | None: + """ Add a custom domain to a frontend + + Adds a custom domain beside the frontend's others, up to the plan's + custom domains per frontend. The domain serves the frontend, or, with + `redirect`, redirects every request to `redirect.to`, another active + domain of the same frontend that serves it, keeping the path and query + string. + A redirecting domain still needs TLS, so it takes `tls` like any other. + + Ownership, verification records, TLS mode switches, and the `409` codes + work as on `POST /projects/{id}/frontends/{frontendId}/domain`. A + request for a hostname the frontend already has returns it with `200`, + or switches its TLS mode in place. When the request's redirect differs + from the domain's, it returns `409`; change a redirect with `PATCH`. + + Args: + id (UUID): + frontend_id (UUID): + body (CreateFrontendDomainRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | FrontendCustomDomainConflictError | FrontendCustomDomainResponse + """ + + + return sync_detailed( + id=id, +frontend_id=frontend_id, +client=client, +body=body, + + ).parsed + +async def asyncio_detailed( + id: UUID | str, + frontend_id: UUID | str, + *, + client: AuthenticatedClient, + body: CreateFrontendDomainRequest, + +) -> Response[Error | FrontendCustomDomainConflictError | FrontendCustomDomainResponse]: + """ Add a custom domain to a frontend + + Adds a custom domain beside the frontend's others, up to the plan's + custom domains per frontend. The domain serves the frontend, or, with + `redirect`, redirects every request to `redirect.to`, another active + domain of the same frontend that serves it, keeping the path and query + string. + A redirecting domain still needs TLS, so it takes `tls` like any other. + + Ownership, verification records, TLS mode switches, and the `409` codes + work as on `POST /projects/{id}/frontends/{frontendId}/domain`. A + request for a hostname the frontend already has returns it with `200`, + or switches its TLS mode in place. When the request's redirect differs + from the domain's, it returns `409`; change a redirect with `PATCH`. + + Args: + id (UUID): + frontend_id (UUID): + body (CreateFrontendDomainRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | FrontendCustomDomainConflictError | FrontendCustomDomainResponse] + """ + + + kwargs = request_kwargs( + id=id, +frontend_id=frontend_id, +body=body, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + id: UUID | str, + frontend_id: UUID | str, + *, + client: AuthenticatedClient, + body: CreateFrontendDomainRequest, + +) -> Error | FrontendCustomDomainConflictError | FrontendCustomDomainResponse | None: + """ Add a custom domain to a frontend + + Adds a custom domain beside the frontend's others, up to the plan's + custom domains per frontend. The domain serves the frontend, or, with + `redirect`, redirects every request to `redirect.to`, another active + domain of the same frontend that serves it, keeping the path and query + string. + A redirecting domain still needs TLS, so it takes `tls` like any other. + + Ownership, verification records, TLS mode switches, and the `409` codes + work as on `POST /projects/{id}/frontends/{frontendId}/domain`. A + request for a hostname the frontend already has returns it with `200`, + or switches its TLS mode in place. When the request's redirect differs + from the domain's, it returns `409`; change a redirect with `PATCH`. + + Args: + id (UUID): + frontend_id (UUID): + body (CreateFrontendDomainRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | FrontendCustomDomainConflictError | FrontendCustomDomainResponse + """ + + + return (await asyncio_detailed( + id=id, +frontend_id=frontend_id, +client=client, +body=body, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/frontends/create_frontend_function_route.py b/src/volcano_sdk/_generated/api/frontends/create_frontend_function_route.py index 793629bd..97267730 100644 --- a/src/volcano_sdk/_generated/api/frontends/create_frontend_function_route.py +++ b/src/volcano_sdk/_generated/api/frontends/create_frontend_function_route.py @@ -87,6 +87,13 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return response_409 + if response.status_code == 413: + response_413 = Error.from_dict(response.json()) + + + + return response_413 + if response.status_code == 500: response_500 = Error.from_dict(response.json()) diff --git a/src/volcano_sdk/_generated/api/frontends/create_frontend_route.py b/src/volcano_sdk/_generated/api/frontends/create_frontend_route.py new file mode 100644 index 00000000..32ade944 --- /dev/null +++ b/src/volcano_sdk/_generated/api/frontends/create_frontend_route.py @@ -0,0 +1,295 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.create_frontend_route_request import CreateFrontendRouteRequest +from ...models.error import Error +from ...models.frontend_route import FrontendRoute +from typing import cast +from uuid import UUID + + + +def request_kwargs( + id: UUID | str, + frontend_id: UUID | str, + *, + body: CreateFrontendRouteRequest, + +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + + + + + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/projects/{id}/frontends/{frontend_id}/frontend-routes".format(id=quote(str(id), safe=""),frontend_id=quote(str(frontend_id), safe=""),), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | FrontendRoute | None: + if response.status_code == 201: + response_201 = FrontendRoute.from_dict(response.json()) + + + + return response_201 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 409: + response_409 = Error.from_dict(response.json()) + + + + return response_409 + + if response.status_code == 413: + response_413 = Error.from_dict(response.json()) + + + + return response_413 + + if response.status_code == 500: + response_500 = Error.from_dict(response.json()) + + + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | FrontendRoute]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID | str, + frontend_id: UUID | str, + *, + client: AuthenticatedClient, + body: CreateFrontendRouteRequest, + +) -> Response[Error | FrontendRoute]: + """ Mount another Frontend at a path + + Serves `path_prefix` and everything under it on this Frontend's hostnames from another + Frontend in the same Project. The path is forwarded unchanged, so the mounted Frontend must + serve its pages under the prefix (page directories or a matching `basePath`). Its root + `/_next/static` files and `/_next/image` requests are sent to it too. A Frontend may be + mounted at several prefixes. Function and Frontend routes share one path namespace and the + 64-route limit; the most specific prefix wins. A mounted Frontend's own routes do not apply + to requests it receives through a route. The route applies to every hostname that resolves + to this Frontend, including generated, custom-domain, and local hostnames. While the mounted + Frontend has no active deployment, its paths answer 502, as its own hostname does. + + Args: + id (UUID): + frontend_id (UUID): + body (CreateFrontendRouteRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | FrontendRoute] + """ + + + kwargs = request_kwargs( + id=id, +frontend_id=frontend_id, +body=body, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + id: UUID | str, + frontend_id: UUID | str, + *, + client: AuthenticatedClient, + body: CreateFrontendRouteRequest, + +) -> Error | FrontendRoute | None: + """ Mount another Frontend at a path + + Serves `path_prefix` and everything under it on this Frontend's hostnames from another + Frontend in the same Project. The path is forwarded unchanged, so the mounted Frontend must + serve its pages under the prefix (page directories or a matching `basePath`). Its root + `/_next/static` files and `/_next/image` requests are sent to it too. A Frontend may be + mounted at several prefixes. Function and Frontend routes share one path namespace and the + 64-route limit; the most specific prefix wins. A mounted Frontend's own routes do not apply + to requests it receives through a route. The route applies to every hostname that resolves + to this Frontend, including generated, custom-domain, and local hostnames. While the mounted + Frontend has no active deployment, its paths answer 502, as its own hostname does. + + Args: + id (UUID): + frontend_id (UUID): + body (CreateFrontendRouteRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | FrontendRoute + """ + + + return sync_detailed( + id=id, +frontend_id=frontend_id, +client=client, +body=body, + + ).parsed + +async def asyncio_detailed( + id: UUID | str, + frontend_id: UUID | str, + *, + client: AuthenticatedClient, + body: CreateFrontendRouteRequest, + +) -> Response[Error | FrontendRoute]: + """ Mount another Frontend at a path + + Serves `path_prefix` and everything under it on this Frontend's hostnames from another + Frontend in the same Project. The path is forwarded unchanged, so the mounted Frontend must + serve its pages under the prefix (page directories or a matching `basePath`). Its root + `/_next/static` files and `/_next/image` requests are sent to it too. A Frontend may be + mounted at several prefixes. Function and Frontend routes share one path namespace and the + 64-route limit; the most specific prefix wins. A mounted Frontend's own routes do not apply + to requests it receives through a route. The route applies to every hostname that resolves + to this Frontend, including generated, custom-domain, and local hostnames. While the mounted + Frontend has no active deployment, its paths answer 502, as its own hostname does. + + Args: + id (UUID): + frontend_id (UUID): + body (CreateFrontendRouteRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | FrontendRoute] + """ + + + kwargs = request_kwargs( + id=id, +frontend_id=frontend_id, +body=body, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + id: UUID | str, + frontend_id: UUID | str, + *, + client: AuthenticatedClient, + body: CreateFrontendRouteRequest, + +) -> Error | FrontendRoute | None: + """ Mount another Frontend at a path + + Serves `path_prefix` and everything under it on this Frontend's hostnames from another + Frontend in the same Project. The path is forwarded unchanged, so the mounted Frontend must + serve its pages under the prefix (page directories or a matching `basePath`). Its root + `/_next/static` files and `/_next/image` requests are sent to it too. A Frontend may be + mounted at several prefixes. Function and Frontend routes share one path namespace and the + 64-route limit; the most specific prefix wins. A mounted Frontend's own routes do not apply + to requests it receives through a route. The route applies to every hostname that resolves + to this Frontend, including generated, custom-domain, and local hostnames. While the mounted + Frontend has no active deployment, its paths answer 502, as its own hostname does. + + Args: + id (UUID): + frontend_id (UUID): + body (CreateFrontendRouteRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | FrontendRoute + """ + + + return (await asyncio_detailed( + id=id, +frontend_id=frontend_id, +client=client, +body=body, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/frontends/delete_frontend.py b/src/volcano_sdk/_generated/api/frontends/delete_frontend.py index 99063d9a..e095bb6a 100644 --- a/src/volcano_sdk/_generated/api/frontends/delete_frontend.py +++ b/src/volcano_sdk/_generated/api/frontends/delete_frontend.py @@ -68,6 +68,13 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return response_404 + if response.status_code == 409: + response_409 = Error.from_dict(response.json()) + + + + return response_409 + if response.status_code == 500: response_500 = Error.from_dict(response.json()) diff --git a/src/volcano_sdk/_generated/api/frontends/delete_frontend_candidate.py b/src/volcano_sdk/_generated/api/frontends/delete_frontend_candidate.py new file mode 100644 index 00000000..4ce5e9f5 --- /dev/null +++ b/src/volcano_sdk/_generated/api/frontends/delete_frontend_candidate.py @@ -0,0 +1,269 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from typing import cast +from uuid import UUID + + + +def request_kwargs( + id: UUID | str, + frontend_id: UUID | str, + candidate_id: UUID | str, + +) -> dict[str, Any]: + + + + + + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/projects/{id}/frontends/{frontend_id}/candidates/{candidate_id}".format(id=quote(str(id), safe=""),frontend_id=quote(str(frontend_id), safe=""),candidate_id=quote(str(candidate_id), safe=""),), + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | Error | None: + if response.status_code == 202: + response_202 = cast(Any, None) + return response_202 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 409: + response_409 = Error.from_dict(response.json()) + + + + return response_409 + + if response.status_code == 500: + response_500 = Error.from_dict(response.json()) + + + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any | Error]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID | str, + frontend_id: UUID | str, + candidate_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Response[Any | Error]: + """ Delete a frontend Candidate + + Starts deleting the Candidate: its regional runtime, images, edge state and stored source are + removed once any running deployment finishes. Asking again for a Candidate that is already being + deleted is the same request. The Candidate answers `404` once it is gone. + + A Candidate the frontend serves cannot be deleted: roll back first. A Candidate the frontend only + keeps as the runtime a rollback returns to can be deleted, and doing so gives up that rollback; + rolling back to the frontend's own runtime stays possible. + + Args: + id (UUID): + frontend_id (UUID): + candidate_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | Error] + """ + + + kwargs = request_kwargs( + id=id, +frontend_id=frontend_id, +candidate_id=candidate_id, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + id: UUID | str, + frontend_id: UUID | str, + candidate_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Any | Error | None: + """ Delete a frontend Candidate + + Starts deleting the Candidate: its regional runtime, images, edge state and stored source are + removed once any running deployment finishes. Asking again for a Candidate that is already being + deleted is the same request. The Candidate answers `404` once it is gone. + + A Candidate the frontend serves cannot be deleted: roll back first. A Candidate the frontend only + keeps as the runtime a rollback returns to can be deleted, and doing so gives up that rollback; + rolling back to the frontend's own runtime stays possible. + + Args: + id (UUID): + frontend_id (UUID): + candidate_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | Error + """ + + + return sync_detailed( + id=id, +frontend_id=frontend_id, +candidate_id=candidate_id, +client=client, + + ).parsed + +async def asyncio_detailed( + id: UUID | str, + frontend_id: UUID | str, + candidate_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Response[Any | Error]: + """ Delete a frontend Candidate + + Starts deleting the Candidate: its regional runtime, images, edge state and stored source are + removed once any running deployment finishes. Asking again for a Candidate that is already being + deleted is the same request. The Candidate answers `404` once it is gone. + + A Candidate the frontend serves cannot be deleted: roll back first. A Candidate the frontend only + keeps as the runtime a rollback returns to can be deleted, and doing so gives up that rollback; + rolling back to the frontend's own runtime stays possible. + + Args: + id (UUID): + frontend_id (UUID): + candidate_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | Error] + """ + + + kwargs = request_kwargs( + id=id, +frontend_id=frontend_id, +candidate_id=candidate_id, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + id: UUID | str, + frontend_id: UUID | str, + candidate_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Any | Error | None: + """ Delete a frontend Candidate + + Starts deleting the Candidate: its regional runtime, images, edge state and stored source are + removed once any running deployment finishes. Asking again for a Candidate that is already being + deleted is the same request. The Candidate answers `404` once it is gone. + + A Candidate the frontend serves cannot be deleted: roll back first. A Candidate the frontend only + keeps as the runtime a rollback returns to can be deleted, and doing so gives up that rollback; + rolling back to the frontend's own runtime stays possible. + + Args: + id (UUID): + frontend_id (UUID): + candidate_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | Error + """ + + + return (await asyncio_detailed( + id=id, +frontend_id=frontend_id, +candidate_id=candidate_id, +client=client, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/frontends/delete_frontend_custom_domain.py b/src/volcano_sdk/_generated/api/frontends/delete_frontend_custom_domain.py index 216768e1..abbcb898 100644 --- a/src/volcano_sdk/_generated/api/frontends/delete_frontend_custom_domain.py +++ b/src/volcano_sdk/_generated/api/frontends/delete_frontend_custom_domain.py @@ -106,6 +106,10 @@ def sync_detailed( ) -> Response[Any | Error]: """ Delete frontend custom domain + Deprecated: use `DELETE /projects/{id}/frontends/{frontendId}/domains/{domain}`. + Deletes the frontend's custom domain. A frontend with several domains + returns `409`; name the one to delete on the collection route. + Args: id (UUID): frontend_id (UUID): @@ -140,6 +144,10 @@ def sync( ) -> Any | Error | None: """ Delete frontend custom domain + Deprecated: use `DELETE /projects/{id}/frontends/{frontendId}/domains/{domain}`. + Deletes the frontend's custom domain. A frontend with several domains + returns `409`; name the one to delete on the collection route. + Args: id (UUID): frontend_id (UUID): @@ -169,6 +177,10 @@ async def asyncio_detailed( ) -> Response[Any | Error]: """ Delete frontend custom domain + Deprecated: use `DELETE /projects/{id}/frontends/{frontendId}/domains/{domain}`. + Deletes the frontend's custom domain. A frontend with several domains + returns `409`; name the one to delete on the collection route. + Args: id (UUID): frontend_id (UUID): @@ -203,6 +215,10 @@ async def asyncio( ) -> Any | Error | None: """ Delete frontend custom domain + Deprecated: use `DELETE /projects/{id}/frontends/{frontendId}/domains/{domain}`. + Deletes the frontend's custom domain. A frontend with several domains + returns `409`; name the one to delete on the collection route. + Args: id (UUID): frontend_id (UUID): diff --git a/src/volcano_sdk/_generated/api/frontends/delete_frontend_domain.py b/src/volcano_sdk/_generated/api/frontends/delete_frontend_domain.py new file mode 100644 index 00000000..26a769f6 --- /dev/null +++ b/src/volcano_sdk/_generated/api/frontends/delete_frontend_domain.py @@ -0,0 +1,242 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from typing import cast +from uuid import UUID + + + +def request_kwargs( + id: UUID | str, + frontend_id: UUID | str, + domain: str, + +) -> dict[str, Any]: + + + + + + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/projects/{id}/frontends/{frontend_id}/domains/{domain}".format(id=quote(str(id), safe=""),frontend_id=quote(str(frontend_id), safe=""),domain=quote(str(domain), safe=""),), + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | Error | None: + if response.status_code == 204: + response_204 = cast(Any, None) + return response_204 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 409: + response_409 = Error.from_dict(response.json()) + + + + return response_409 + + if response.status_code == 500: + response_500 = Error.from_dict(response.json()) + + + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any | Error]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID | str, + frontend_id: UUID | str, + domain: str, + *, + client: AuthenticatedClient, + +) -> Response[Any | Error]: + """ Remove a custom domain from a frontend + + Detaches the domain. A domain other domains redirect to cannot be + removed until those redirects are removed or retargeted. + + Args: + id (UUID): + frontend_id (UUID): + domain (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | Error] + """ + + + kwargs = request_kwargs( + id=id, +frontend_id=frontend_id, +domain=domain, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + id: UUID | str, + frontend_id: UUID | str, + domain: str, + *, + client: AuthenticatedClient, + +) -> Any | Error | None: + """ Remove a custom domain from a frontend + + Detaches the domain. A domain other domains redirect to cannot be + removed until those redirects are removed or retargeted. + + Args: + id (UUID): + frontend_id (UUID): + domain (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | Error + """ + + + return sync_detailed( + id=id, +frontend_id=frontend_id, +domain=domain, +client=client, + + ).parsed + +async def asyncio_detailed( + id: UUID | str, + frontend_id: UUID | str, + domain: str, + *, + client: AuthenticatedClient, + +) -> Response[Any | Error]: + """ Remove a custom domain from a frontend + + Detaches the domain. A domain other domains redirect to cannot be + removed until those redirects are removed or retargeted. + + Args: + id (UUID): + frontend_id (UUID): + domain (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | Error] + """ + + + kwargs = request_kwargs( + id=id, +frontend_id=frontend_id, +domain=domain, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + id: UUID | str, + frontend_id: UUID | str, + domain: str, + *, + client: AuthenticatedClient, + +) -> Any | Error | None: + """ Remove a custom domain from a frontend + + Detaches the domain. A domain other domains redirect to cannot be + removed until those redirects are removed or retargeted. + + Args: + id (UUID): + frontend_id (UUID): + domain (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | Error + """ + + + return (await asyncio_detailed( + id=id, +frontend_id=frontend_id, +domain=domain, +client=client, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/frontends/delete_frontend_route.py b/src/volcano_sdk/_generated/api/frontends/delete_frontend_route.py new file mode 100644 index 00000000..85abf3d7 --- /dev/null +++ b/src/volcano_sdk/_generated/api/frontends/delete_frontend_route.py @@ -0,0 +1,223 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from typing import cast +from uuid import UUID + + + +def request_kwargs( + id: UUID | str, + frontend_id: UUID | str, + route_id: UUID | str, + +) -> dict[str, Any]: + + + + + + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/projects/{id}/frontends/{frontend_id}/frontend-routes/{route_id}".format(id=quote(str(id), safe=""),frontend_id=quote(str(frontend_id), safe=""),route_id=quote(str(route_id), safe=""),), + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | Error | None: + if response.status_code == 204: + response_204 = cast(Any, None) + return response_204 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 500: + response_500 = Error.from_dict(response.json()) + + + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any | Error]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID | str, + frontend_id: UUID | str, + route_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Response[Any | Error]: + """ Delete a Frontend route + + Args: + id (UUID): + frontend_id (UUID): + route_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | Error] + """ + + + kwargs = request_kwargs( + id=id, +frontend_id=frontend_id, +route_id=route_id, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + id: UUID | str, + frontend_id: UUID | str, + route_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Any | Error | None: + """ Delete a Frontend route + + Args: + id (UUID): + frontend_id (UUID): + route_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | Error + """ + + + return sync_detailed( + id=id, +frontend_id=frontend_id, +route_id=route_id, +client=client, + + ).parsed + +async def asyncio_detailed( + id: UUID | str, + frontend_id: UUID | str, + route_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Response[Any | Error]: + """ Delete a Frontend route + + Args: + id (UUID): + frontend_id (UUID): + route_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | Error] + """ + + + kwargs = request_kwargs( + id=id, +frontend_id=frontend_id, +route_id=route_id, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + id: UUID | str, + frontend_id: UUID | str, + route_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Any | Error | None: + """ Delete a Frontend route + + Args: + id (UUID): + frontend_id (UUID): + route_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | Error + """ + + + return (await asyncio_detailed( + id=id, +frontend_id=frontend_id, +route_id=route_id, +client=client, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/frontends/get_frontend_candidate.py b/src/volcano_sdk/_generated/api/frontends/get_frontend_candidate.py new file mode 100644 index 00000000..3ccc3b9f --- /dev/null +++ b/src/volcano_sdk/_generated/api/frontends/get_frontend_candidate.py @@ -0,0 +1,234 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from ...models.frontend_candidate import FrontendCandidate +from typing import cast +from uuid import UUID + + + +def request_kwargs( + id: UUID | str, + frontend_id: UUID | str, + candidate_id: UUID | str, + +) -> dict[str, Any]: + + + + + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/projects/{id}/frontends/{frontend_id}/candidates/{candidate_id}".format(id=quote(str(id), safe=""),frontend_id=quote(str(frontend_id), safe=""),candidate_id=quote(str(candidate_id), safe=""),), + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | FrontendCandidate | None: + if response.status_code == 200: + response_200 = FrontendCandidate.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 500: + response_500 = Error.from_dict(response.json()) + + + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | FrontendCandidate]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID | str, + frontend_id: UUID | str, + candidate_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Response[Error | FrontendCandidate]: + """ Get a frontend Candidate + + Args: + id (UUID): + frontend_id (UUID): + candidate_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | FrontendCandidate] + """ + + + kwargs = request_kwargs( + id=id, +frontend_id=frontend_id, +candidate_id=candidate_id, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + id: UUID | str, + frontend_id: UUID | str, + candidate_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Error | FrontendCandidate | None: + """ Get a frontend Candidate + + Args: + id (UUID): + frontend_id (UUID): + candidate_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | FrontendCandidate + """ + + + return sync_detailed( + id=id, +frontend_id=frontend_id, +candidate_id=candidate_id, +client=client, + + ).parsed + +async def asyncio_detailed( + id: UUID | str, + frontend_id: UUID | str, + candidate_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Response[Error | FrontendCandidate]: + """ Get a frontend Candidate + + Args: + id (UUID): + frontend_id (UUID): + candidate_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | FrontendCandidate] + """ + + + kwargs = request_kwargs( + id=id, +frontend_id=frontend_id, +candidate_id=candidate_id, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + id: UUID | str, + frontend_id: UUID | str, + candidate_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Error | FrontendCandidate | None: + """ Get a frontend Candidate + + Args: + id (UUID): + frontend_id (UUID): + candidate_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | FrontendCandidate + """ + + + return (await asyncio_detailed( + id=id, +frontend_id=frontend_id, +candidate_id=candidate_id, +client=client, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/frontends/get_frontend_custom_domain.py b/src/volcano_sdk/_generated/api/frontends/get_frontend_custom_domain.py index 8f281e76..5cfae9e8 100644 --- a/src/volcano_sdk/_generated/api/frontends/get_frontend_custom_domain.py +++ b/src/volcano_sdk/_generated/api/frontends/get_frontend_custom_domain.py @@ -116,6 +116,9 @@ def sync_detailed( ) -> Response[Error | FrontendCustomDomainResponse | None]: """ Get frontend custom domain status + Deprecated: use `GET /projects/{id}/frontends/{frontendId}/domains`. + Returns the frontend's oldest domain that serves it rather than redirecting. + Args: id (UUID): frontend_id (UUID): @@ -150,6 +153,9 @@ def sync( ) -> Error | FrontendCustomDomainResponse | None | None: """ Get frontend custom domain status + Deprecated: use `GET /projects/{id}/frontends/{frontendId}/domains`. + Returns the frontend's oldest domain that serves it rather than redirecting. + Args: id (UUID): frontend_id (UUID): @@ -179,6 +185,9 @@ async def asyncio_detailed( ) -> Response[Error | FrontendCustomDomainResponse | None]: """ Get frontend custom domain status + Deprecated: use `GET /projects/{id}/frontends/{frontendId}/domains`. + Returns the frontend's oldest domain that serves it rather than redirecting. + Args: id (UUID): frontend_id (UUID): @@ -213,6 +222,9 @@ async def asyncio( ) -> Error | FrontendCustomDomainResponse | None | None: """ Get frontend custom domain status + Deprecated: use `GET /projects/{id}/frontends/{frontendId}/domains`. + Returns the frontend's oldest domain that serves it rather than redirecting. + Args: id (UUID): frontend_id (UUID): diff --git a/src/volcano_sdk/_generated/api/frontends/get_frontend_domain.py b/src/volcano_sdk/_generated/api/frontends/get_frontend_domain.py new file mode 100644 index 00000000..016c7e3d --- /dev/null +++ b/src/volcano_sdk/_generated/api/frontends/get_frontend_domain.py @@ -0,0 +1,227 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from ...models.frontend_custom_domain_response import FrontendCustomDomainResponse +from typing import cast +from uuid import UUID + + + +def request_kwargs( + id: UUID | str, + frontend_id: UUID | str, + domain: str, + +) -> dict[str, Any]: + + + + + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/projects/{id}/frontends/{frontend_id}/domains/{domain}".format(id=quote(str(id), safe=""),frontend_id=quote(str(frontend_id), safe=""),domain=quote(str(domain), safe=""),), + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | FrontendCustomDomainResponse | None: + if response.status_code == 200: + response_200 = FrontendCustomDomainResponse.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 500: + response_500 = Error.from_dict(response.json()) + + + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | FrontendCustomDomainResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID | str, + frontend_id: UUID | str, + domain: str, + *, + client: AuthenticatedClient, + +) -> Response[Error | FrontendCustomDomainResponse]: + """ Get a frontend custom domain + + Args: + id (UUID): + frontend_id (UUID): + domain (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | FrontendCustomDomainResponse] + """ + + + kwargs = request_kwargs( + id=id, +frontend_id=frontend_id, +domain=domain, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + id: UUID | str, + frontend_id: UUID | str, + domain: str, + *, + client: AuthenticatedClient, + +) -> Error | FrontendCustomDomainResponse | None: + """ Get a frontend custom domain + + Args: + id (UUID): + frontend_id (UUID): + domain (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | FrontendCustomDomainResponse + """ + + + return sync_detailed( + id=id, +frontend_id=frontend_id, +domain=domain, +client=client, + + ).parsed + +async def asyncio_detailed( + id: UUID | str, + frontend_id: UUID | str, + domain: str, + *, + client: AuthenticatedClient, + +) -> Response[Error | FrontendCustomDomainResponse]: + """ Get a frontend custom domain + + Args: + id (UUID): + frontend_id (UUID): + domain (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | FrontendCustomDomainResponse] + """ + + + kwargs = request_kwargs( + id=id, +frontend_id=frontend_id, +domain=domain, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + id: UUID | str, + frontend_id: UUID | str, + domain: str, + *, + client: AuthenticatedClient, + +) -> Error | FrontendCustomDomainResponse | None: + """ Get a frontend custom domain + + Args: + id (UUID): + frontend_id (UUID): + domain (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | FrontendCustomDomainResponse + """ + + + return (await asyncio_detailed( + id=id, +frontend_id=frontend_id, +domain=domain, +client=client, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/autofix/delete_autofix_api_key.py b/src/volcano_sdk/_generated/api/frontends/get_frontend_serving.py similarity index 54% rename from src/volcano_sdk/_generated/api/autofix/delete_autofix_api_key.py rename to src/volcano_sdk/_generated/api/frontends/get_frontend_serving.py index 55698d32..d4810c13 100644 --- a/src/volcano_sdk/_generated/api/autofix/delete_autofix_api_key.py +++ b/src/volcano_sdk/_generated/api/frontends/get_frontend_serving.py @@ -8,8 +8,8 @@ from ...types import Response, UNSET from ... import errors -from ...models.autofix_settings import AutofixSettings from ...models.error import Error +from ...models.frontend_serving import FrontendServing from typing import cast from uuid import UUID @@ -17,6 +17,7 @@ def request_kwargs( id: UUID | str, + frontend_id: UUID | str, ) -> dict[str, Any]: @@ -26,8 +27,8 @@ def request_kwargs( _kwargs: dict[str, Any] = { - "method": "delete", - "url": "/projects/{id}/autofix/api-key".format(id=quote(str(id), safe=""),), + "method": "get", + "url": "/projects/{id}/frontends/{frontend_id}/serving".format(id=quote(str(id), safe=""),frontend_id=quote(str(frontend_id), safe=""),), } @@ -35,14 +36,28 @@ def request_kwargs( -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> AutofixSettings | Error | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | FrontendServing | None: if response.status_code == 200: - response_200 = AutofixSettings.from_dict(response.json()) + response_200 = FrontendServing.from_dict(response.json()) return response_200 + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + if response.status_code == 403: response_403 = Error.from_dict(response.json()) @@ -57,12 +72,12 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return response_404 - if response.status_code == 501: - response_501 = Error.from_dict(response.json()) + if response.status_code == 500: + response_500 = Error.from_dict(response.json()) - return response_501 + return response_500 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -70,7 +85,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[AutofixSettings | Error]: +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | FrontendServing]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -81,36 +96,32 @@ def build_response(*, client: AuthenticatedClient | Client, response: httpx.Resp def sync_detailed( id: UUID | str, + frontend_id: UUID | str, *, client: AuthenticatedClient, -) -> Response[AutofixSettings | Error]: - """ Delete the API key +) -> Response[Error | FrontendServing]: + """ Get what a frontend serves - Deletes the project's stored API key and returns the settings. Autofix - on the key's provider runs on that key, so it turns off; on another - provider it stays as it is. Deleting when no key is stored succeeds. - - Turning autofix off or switching providers never deletes the key, and - neither does applying a project configuration. This works where - autofix is not available, for a project that saved settings. - - Project access tokens are refused. + Reports whether the frontend serves its own runtime or a promoted Candidate's, and the + revision a promotion or rollback must name. Args: id (UUID): + frontend_id (UUID): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AutofixSettings | Error] + Response[Error | FrontendServing] """ kwargs = request_kwargs( id=id, +frontend_id=frontend_id, ) @@ -122,72 +133,64 @@ def sync_detailed( def sync( id: UUID | str, + frontend_id: UUID | str, *, client: AuthenticatedClient, -) -> AutofixSettings | Error | None: - """ Delete the API key - - Deletes the project's stored API key and returns the settings. Autofix - on the key's provider runs on that key, so it turns off; on another - provider it stays as it is. Deleting when no key is stored succeeds. - - Turning autofix off or switching providers never deletes the key, and - neither does applying a project configuration. This works where - autofix is not available, for a project that saved settings. +) -> Error | FrontendServing | None: + """ Get what a frontend serves - Project access tokens are refused. + Reports whether the frontend serves its own runtime or a promoted Candidate's, and the + revision a promotion or rollback must name. Args: id (UUID): + frontend_id (UUID): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AutofixSettings | Error + Error | FrontendServing """ return sync_detailed( id=id, +frontend_id=frontend_id, client=client, ).parsed async def asyncio_detailed( id: UUID | str, + frontend_id: UUID | str, *, client: AuthenticatedClient, -) -> Response[AutofixSettings | Error]: - """ Delete the API key +) -> Response[Error | FrontendServing]: + """ Get what a frontend serves - Deletes the project's stored API key and returns the settings. Autofix - on the key's provider runs on that key, so it turns off; on another - provider it stays as it is. Deleting when no key is stored succeeds. - - Turning autofix off or switching providers never deletes the key, and - neither does applying a project configuration. This works where - autofix is not available, for a project that saved settings. - - Project access tokens are refused. + Reports whether the frontend serves its own runtime or a promoted Candidate's, and the + revision a promotion or rollback must name. Args: id (UUID): + frontend_id (UUID): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AutofixSettings | Error] + Response[Error | FrontendServing] """ kwargs = request_kwargs( id=id, +frontend_id=frontend_id, ) @@ -199,36 +202,32 @@ async def asyncio_detailed( async def asyncio( id: UUID | str, + frontend_id: UUID | str, *, client: AuthenticatedClient, -) -> AutofixSettings | Error | None: - """ Delete the API key - - Deletes the project's stored API key and returns the settings. Autofix - on the key's provider runs on that key, so it turns off; on another - provider it stays as it is. Deleting when no key is stored succeeds. - - Turning autofix off or switching providers never deletes the key, and - neither does applying a project configuration. This works where - autofix is not available, for a project that saved settings. +) -> Error | FrontendServing | None: + """ Get what a frontend serves - Project access tokens are refused. + Reports whether the frontend serves its own runtime or a promoted Candidate's, and the + revision a promotion or rollback must name. Args: id (UUID): + frontend_id (UUID): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AutofixSettings | Error + Error | FrontendServing """ return (await asyncio_detailed( id=id, +frontend_id=frontend_id, client=client, )).parsed diff --git a/src/volcano_sdk/_generated/api/frontends/list_frontend_candidates.py b/src/volcano_sdk/_generated/api/frontends/list_frontend_candidates.py new file mode 100644 index 00000000..42fabcd2 --- /dev/null +++ b/src/volcano_sdk/_generated/api/frontends/list_frontend_candidates.py @@ -0,0 +1,241 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from ...models.frontend_candidate_list import FrontendCandidateList +from typing import cast +from uuid import UUID + + + +def request_kwargs( + id: UUID | str, + frontend_id: UUID | str, + +) -> dict[str, Any]: + + + + + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/projects/{id}/frontends/{frontend_id}/candidates".format(id=quote(str(id), safe=""),frontend_id=quote(str(frontend_id), safe=""),), + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | FrontendCandidateList | None: + if response.status_code == 200: + response_200 = FrontendCandidateList.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 500: + response_500 = Error.from_dict(response.json()) + + + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | FrontendCandidateList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID | str, + frontend_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Response[Error | FrontendCandidateList]: + """ List a frontend's Candidates + + Returns the frontend's Candidates, oldest first, each with its latest deployment. A frontend + holds at most 100 live Candidates, so the list is never longer. An account holds at most its + plan's live Candidates across all of its projects and frontends: 1000 on HOBBY, 10000 on + SUPERAGENT. Reading never depends on the `frontends.candidates` capability. + + Args: + id (UUID): + frontend_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | FrontendCandidateList] + """ + + + kwargs = request_kwargs( + id=id, +frontend_id=frontend_id, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + id: UUID | str, + frontend_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Error | FrontendCandidateList | None: + """ List a frontend's Candidates + + Returns the frontend's Candidates, oldest first, each with its latest deployment. A frontend + holds at most 100 live Candidates, so the list is never longer. An account holds at most its + plan's live Candidates across all of its projects and frontends: 1000 on HOBBY, 10000 on + SUPERAGENT. Reading never depends on the `frontends.candidates` capability. + + Args: + id (UUID): + frontend_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | FrontendCandidateList + """ + + + return sync_detailed( + id=id, +frontend_id=frontend_id, +client=client, + + ).parsed + +async def asyncio_detailed( + id: UUID | str, + frontend_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Response[Error | FrontendCandidateList]: + """ List a frontend's Candidates + + Returns the frontend's Candidates, oldest first, each with its latest deployment. A frontend + holds at most 100 live Candidates, so the list is never longer. An account holds at most its + plan's live Candidates across all of its projects and frontends: 1000 on HOBBY, 10000 on + SUPERAGENT. Reading never depends on the `frontends.candidates` capability. + + Args: + id (UUID): + frontend_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | FrontendCandidateList] + """ + + + kwargs = request_kwargs( + id=id, +frontend_id=frontend_id, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + id: UUID | str, + frontend_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Error | FrontendCandidateList | None: + """ List a frontend's Candidates + + Returns the frontend's Candidates, oldest first, each with its latest deployment. A frontend + holds at most 100 live Candidates, so the list is never longer. An account holds at most its + plan's live Candidates across all of its projects and frontends: 1000 on HOBBY, 10000 on + SUPERAGENT. Reading never depends on the `frontends.candidates` capability. + + Args: + id (UUID): + frontend_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | FrontendCandidateList + """ + + + return (await asyncio_detailed( + id=id, +frontend_id=frontend_id, +client=client, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/frontends/list_frontend_domains.py b/src/volcano_sdk/_generated/api/frontends/list_frontend_domains.py new file mode 100644 index 00000000..c727467a --- /dev/null +++ b/src/volcano_sdk/_generated/api/frontends/list_frontend_domains.py @@ -0,0 +1,230 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from ...models.frontend_custom_domain_list import FrontendCustomDomainList +from typing import cast +from uuid import UUID + + + +def request_kwargs( + id: UUID | str, + frontend_id: UUID | str, + +) -> dict[str, Any]: + + + + + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/projects/{id}/frontends/{frontend_id}/domains".format(id=quote(str(id), safe=""),frontend_id=quote(str(frontend_id), safe=""),), + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | FrontendCustomDomainList | None: + if response.status_code == 200: + response_200 = FrontendCustomDomainList.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 500: + response_500 = Error.from_dict(response.json()) + + + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | FrontendCustomDomainList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID | str, + frontend_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Response[Error | FrontendCustomDomainList]: + """ List a frontend's custom domains + + Lists the frontend's custom domains, oldest first. Each domain either + serves the frontend or, with `redirect` set, redirects every request to + another domain of the frontend. + + Args: + id (UUID): + frontend_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | FrontendCustomDomainList] + """ + + + kwargs = request_kwargs( + id=id, +frontend_id=frontend_id, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + id: UUID | str, + frontend_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Error | FrontendCustomDomainList | None: + """ List a frontend's custom domains + + Lists the frontend's custom domains, oldest first. Each domain either + serves the frontend or, with `redirect` set, redirects every request to + another domain of the frontend. + + Args: + id (UUID): + frontend_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | FrontendCustomDomainList + """ + + + return sync_detailed( + id=id, +frontend_id=frontend_id, +client=client, + + ).parsed + +async def asyncio_detailed( + id: UUID | str, + frontend_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Response[Error | FrontendCustomDomainList]: + """ List a frontend's custom domains + + Lists the frontend's custom domains, oldest first. Each domain either + serves the frontend or, with `redirect` set, redirects every request to + another domain of the frontend. + + Args: + id (UUID): + frontend_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | FrontendCustomDomainList] + """ + + + kwargs = request_kwargs( + id=id, +frontend_id=frontend_id, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + id: UUID | str, + frontend_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Error | FrontendCustomDomainList | None: + """ List a frontend's custom domains + + Lists the frontend's custom domains, oldest first. Each domain either + serves the frontend or, with `redirect` set, redirects every request to + another domain of the frontend. + + Args: + id (UUID): + frontend_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | FrontendCustomDomainList + """ + + + return (await asyncio_detailed( + id=id, +frontend_id=frontend_id, +client=client, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/frontends/list_frontend_routes.py b/src/volcano_sdk/_generated/api/frontends/list_frontend_routes.py new file mode 100644 index 00000000..a8bcbae1 --- /dev/null +++ b/src/volcano_sdk/_generated/api/frontends/list_frontend_routes.py @@ -0,0 +1,207 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from ...models.frontend_route_list import FrontendRouteList +from typing import cast +from uuid import UUID + + + +def request_kwargs( + id: UUID | str, + frontend_id: UUID | str, + +) -> dict[str, Any]: + + + + + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/projects/{id}/frontends/{frontend_id}/frontend-routes".format(id=quote(str(id), safe=""),frontend_id=quote(str(frontend_id), safe=""),), + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | FrontendRouteList | None: + if response.status_code == 200: + response_200 = FrontendRouteList.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 500: + response_500 = Error.from_dict(response.json()) + + + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | FrontendRouteList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID | str, + frontend_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Response[Error | FrontendRouteList]: + """ List a Frontend's Frontend routes + + Args: + id (UUID): + frontend_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | FrontendRouteList] + """ + + + kwargs = request_kwargs( + id=id, +frontend_id=frontend_id, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + id: UUID | str, + frontend_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Error | FrontendRouteList | None: + """ List a Frontend's Frontend routes + + Args: + id (UUID): + frontend_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | FrontendRouteList + """ + + + return sync_detailed( + id=id, +frontend_id=frontend_id, +client=client, + + ).parsed + +async def asyncio_detailed( + id: UUID | str, + frontend_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Response[Error | FrontendRouteList]: + """ List a Frontend's Frontend routes + + Args: + id (UUID): + frontend_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | FrontendRouteList] + """ + + + kwargs = request_kwargs( + id=id, +frontend_id=frontend_id, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + id: UUID | str, + frontend_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Error | FrontendRouteList | None: + """ List a Frontend's Frontend routes + + Args: + id (UUID): + frontend_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | FrontendRouteList + """ + + + return (await asyncio_detailed( + id=id, +frontend_id=frontend_id, +client=client, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/frontends/promote_frontend_candidate.py b/src/volcano_sdk/_generated/api/frontends/promote_frontend_candidate.py new file mode 100644 index 00000000..bef7b52f --- /dev/null +++ b/src/volcano_sdk/_generated/api/frontends/promote_frontend_candidate.py @@ -0,0 +1,328 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from ...models.frontend_serving import FrontendServing +from ...models.promote_frontend_candidate_body import PromoteFrontendCandidateBody +from typing import cast +from uuid import UUID + + + +def request_kwargs( + id: UUID | str, + frontend_id: UUID | str, + candidate_id: UUID | str, + *, + body: PromoteFrontendCandidateBody, + +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + + + + + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/projects/{id}/frontends/{frontend_id}/candidates/{candidate_id}/promote".format(id=quote(str(id), safe=""),frontend_id=quote(str(frontend_id), safe=""),candidate_id=quote(str(candidate_id), safe=""),), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | FrontendServing | None: + if response.status_code == 200: + response_200 = FrontendServing.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 409: + response_409 = Error.from_dict(response.json()) + + + + return response_409 + + if response.status_code == 413: + response_413 = Error.from_dict(response.json()) + + + + return response_413 + + if response.status_code == 500: + response_500 = Error.from_dict(response.json()) + + + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | FrontendServing]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID | str, + frontend_id: UUID | str, + candidate_id: UUID | str, + *, + client: AuthenticatedClient, + body: PromoteFrontendCandidateBody, + +) -> Response[Error | FrontendServing]: + """ Promote a frontend Candidate + + Makes the Candidate what the frontend serves. Nothing is rebuilt or copied: the frontend's + traffic is routed to the Candidate's runtime, its own custom domains and metering are + unchanged, and what it served becomes the runtime a rollback returns to. + + The Candidate must be ready and serving an active deployment, and that deployment must have + been built with the variables the frontend selects now. A Candidate that serves stops expiring and + cannot be deleted. While one + serves, deploying the frontend itself answers `409`; roll back to the frontend's own runtime + first. Promotion names the revision the caller read from `serving`; a competing activation + makes it fail with `409`. Once the project's repository is the source of truth, promotion + is refused with `409`, as a direct deploy is, and so is rolling back to a Candidate; rolling + back to the frontend's own runtime is not. While the `frontends.candidates` capability is + unavailable, promotion and rolling back to a Candidate answer `404` with code + `feature_unavailable`; rolling back to the frontend's own runtime does not. + + Args: + id (UUID): + frontend_id (UUID): + candidate_id (UUID): + body (PromoteFrontendCandidateBody): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | FrontendServing] + """ + + + kwargs = request_kwargs( + id=id, +frontend_id=frontend_id, +candidate_id=candidate_id, +body=body, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + id: UUID | str, + frontend_id: UUID | str, + candidate_id: UUID | str, + *, + client: AuthenticatedClient, + body: PromoteFrontendCandidateBody, + +) -> Error | FrontendServing | None: + """ Promote a frontend Candidate + + Makes the Candidate what the frontend serves. Nothing is rebuilt or copied: the frontend's + traffic is routed to the Candidate's runtime, its own custom domains and metering are + unchanged, and what it served becomes the runtime a rollback returns to. + + The Candidate must be ready and serving an active deployment, and that deployment must have + been built with the variables the frontend selects now. A Candidate that serves stops expiring and + cannot be deleted. While one + serves, deploying the frontend itself answers `409`; roll back to the frontend's own runtime + first. Promotion names the revision the caller read from `serving`; a competing activation + makes it fail with `409`. Once the project's repository is the source of truth, promotion + is refused with `409`, as a direct deploy is, and so is rolling back to a Candidate; rolling + back to the frontend's own runtime is not. While the `frontends.candidates` capability is + unavailable, promotion and rolling back to a Candidate answer `404` with code + `feature_unavailable`; rolling back to the frontend's own runtime does not. + + Args: + id (UUID): + frontend_id (UUID): + candidate_id (UUID): + body (PromoteFrontendCandidateBody): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | FrontendServing + """ + + + return sync_detailed( + id=id, +frontend_id=frontend_id, +candidate_id=candidate_id, +client=client, +body=body, + + ).parsed + +async def asyncio_detailed( + id: UUID | str, + frontend_id: UUID | str, + candidate_id: UUID | str, + *, + client: AuthenticatedClient, + body: PromoteFrontendCandidateBody, + +) -> Response[Error | FrontendServing]: + """ Promote a frontend Candidate + + Makes the Candidate what the frontend serves. Nothing is rebuilt or copied: the frontend's + traffic is routed to the Candidate's runtime, its own custom domains and metering are + unchanged, and what it served becomes the runtime a rollback returns to. + + The Candidate must be ready and serving an active deployment, and that deployment must have + been built with the variables the frontend selects now. A Candidate that serves stops expiring and + cannot be deleted. While one + serves, deploying the frontend itself answers `409`; roll back to the frontend's own runtime + first. Promotion names the revision the caller read from `serving`; a competing activation + makes it fail with `409`. Once the project's repository is the source of truth, promotion + is refused with `409`, as a direct deploy is, and so is rolling back to a Candidate; rolling + back to the frontend's own runtime is not. While the `frontends.candidates` capability is + unavailable, promotion and rolling back to a Candidate answer `404` with code + `feature_unavailable`; rolling back to the frontend's own runtime does not. + + Args: + id (UUID): + frontend_id (UUID): + candidate_id (UUID): + body (PromoteFrontendCandidateBody): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | FrontendServing] + """ + + + kwargs = request_kwargs( + id=id, +frontend_id=frontend_id, +candidate_id=candidate_id, +body=body, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + id: UUID | str, + frontend_id: UUID | str, + candidate_id: UUID | str, + *, + client: AuthenticatedClient, + body: PromoteFrontendCandidateBody, + +) -> Error | FrontendServing | None: + """ Promote a frontend Candidate + + Makes the Candidate what the frontend serves. Nothing is rebuilt or copied: the frontend's + traffic is routed to the Candidate's runtime, its own custom domains and metering are + unchanged, and what it served becomes the runtime a rollback returns to. + + The Candidate must be ready and serving an active deployment, and that deployment must have + been built with the variables the frontend selects now. A Candidate that serves stops expiring and + cannot be deleted. While one + serves, deploying the frontend itself answers `409`; roll back to the frontend's own runtime + first. Promotion names the revision the caller read from `serving`; a competing activation + makes it fail with `409`. Once the project's repository is the source of truth, promotion + is refused with `409`, as a direct deploy is, and so is rolling back to a Candidate; rolling + back to the frontend's own runtime is not. While the `frontends.candidates` capability is + unavailable, promotion and rolling back to a Candidate answer `404` with code + `feature_unavailable`; rolling back to the frontend's own runtime does not. + + Args: + id (UUID): + frontend_id (UUID): + candidate_id (UUID): + body (PromoteFrontendCandidateBody): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | FrontendServing + """ + + + return (await asyncio_detailed( + id=id, +frontend_id=frontend_id, +candidate_id=candidate_id, +client=client, +body=body, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/frontends/redeploy_frontend_candidate.py b/src/volcano_sdk/_generated/api/frontends/redeploy_frontend_candidate.py new file mode 100644 index 00000000..f8bc0497 --- /dev/null +++ b/src/volcano_sdk/_generated/api/frontends/redeploy_frontend_candidate.py @@ -0,0 +1,306 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from ...models.frontend_candidate_deployment import FrontendCandidateDeployment +from ...models.redeploy_frontend_candidate_body import RedeployFrontendCandidateBody +from typing import cast +from uuid import UUID + + + +def request_kwargs( + id: UUID | str, + frontend_id: UUID | str, + candidate_id: UUID | str, + *, + body: RedeployFrontendCandidateBody, + +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + + + + + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/projects/{id}/frontends/{frontend_id}/candidates/{candidate_id}/deployments".format(id=quote(str(id), safe=""),frontend_id=quote(str(frontend_id), safe=""),candidate_id=quote(str(candidate_id), safe=""),), + } + + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data; boundary=+++" + + _kwargs["headers"] = headers + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | FrontendCandidateDeployment | None: + if response.status_code == 202: + response_202 = FrontendCandidateDeployment.from_dict(response.json()) + + + + return response_202 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 409: + response_409 = Error.from_dict(response.json()) + + + + return response_409 + + if response.status_code == 413: + response_413 = Error.from_dict(response.json()) + + + + return response_413 + + if response.status_code == 429: + response_429 = Error.from_dict(response.json()) + + + + return response_429 + + if response.status_code == 500: + response_500 = Error.from_dict(response.json()) + + + + return response_500 + + if response.status_code == 503: + response_503 = Error.from_dict(response.json()) + + + + return response_503 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | FrontendCandidateDeployment]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID | str, + frontend_id: UUID | str, + candidate_id: UUID | str, + *, + client: AuthenticatedClient, + body: RedeployFrontendCandidateBody, + +) -> Response[Error | FrontendCandidateDeployment]: + """ Deploy a new archive to a frontend Candidate + + Builds the uploaded archive with the frontend's own variable selection and deploys it to the + Candidate. The Candidate keeps serving its previous deployment until this one succeeds, and a + failed deployment leaves it on the previous one. A Candidate takes one deployment at a time. + While the `frontends.candidates` capability is unavailable, it answers `404` with code + `feature_unavailable`. + + Args: + id (UUID): + frontend_id (UUID): + candidate_id (UUID): + body (RedeployFrontendCandidateBody): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | FrontendCandidateDeployment] + """ + + + kwargs = request_kwargs( + id=id, +frontend_id=frontend_id, +candidate_id=candidate_id, +body=body, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + id: UUID | str, + frontend_id: UUID | str, + candidate_id: UUID | str, + *, + client: AuthenticatedClient, + body: RedeployFrontendCandidateBody, + +) -> Error | FrontendCandidateDeployment | None: + """ Deploy a new archive to a frontend Candidate + + Builds the uploaded archive with the frontend's own variable selection and deploys it to the + Candidate. The Candidate keeps serving its previous deployment until this one succeeds, and a + failed deployment leaves it on the previous one. A Candidate takes one deployment at a time. + While the `frontends.candidates` capability is unavailable, it answers `404` with code + `feature_unavailable`. + + Args: + id (UUID): + frontend_id (UUID): + candidate_id (UUID): + body (RedeployFrontendCandidateBody): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | FrontendCandidateDeployment + """ + + + return sync_detailed( + id=id, +frontend_id=frontend_id, +candidate_id=candidate_id, +client=client, +body=body, + + ).parsed + +async def asyncio_detailed( + id: UUID | str, + frontend_id: UUID | str, + candidate_id: UUID | str, + *, + client: AuthenticatedClient, + body: RedeployFrontendCandidateBody, + +) -> Response[Error | FrontendCandidateDeployment]: + """ Deploy a new archive to a frontend Candidate + + Builds the uploaded archive with the frontend's own variable selection and deploys it to the + Candidate. The Candidate keeps serving its previous deployment until this one succeeds, and a + failed deployment leaves it on the previous one. A Candidate takes one deployment at a time. + While the `frontends.candidates` capability is unavailable, it answers `404` with code + `feature_unavailable`. + + Args: + id (UUID): + frontend_id (UUID): + candidate_id (UUID): + body (RedeployFrontendCandidateBody): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | FrontendCandidateDeployment] + """ + + + kwargs = request_kwargs( + id=id, +frontend_id=frontend_id, +candidate_id=candidate_id, +body=body, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + id: UUID | str, + frontend_id: UUID | str, + candidate_id: UUID | str, + *, + client: AuthenticatedClient, + body: RedeployFrontendCandidateBody, + +) -> Error | FrontendCandidateDeployment | None: + """ Deploy a new archive to a frontend Candidate + + Builds the uploaded archive with the frontend's own variable selection and deploys it to the + Candidate. The Candidate keeps serving its previous deployment until this one succeeds, and a + failed deployment leaves it on the previous one. A Candidate takes one deployment at a time. + While the `frontends.candidates` capability is unavailable, it answers `404` with code + `feature_unavailable`. + + Args: + id (UUID): + frontend_id (UUID): + candidate_id (UUID): + body (RedeployFrontendCandidateBody): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | FrontendCandidateDeployment + """ + + + return (await asyncio_detailed( + id=id, +frontend_id=frontend_id, +candidate_id=candidate_id, +client=client, +body=body, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/frontends/rollback_frontend_serving.py b/src/volcano_sdk/_generated/api/frontends/rollback_frontend_serving.py new file mode 100644 index 00000000..c46de922 --- /dev/null +++ b/src/volcano_sdk/_generated/api/frontends/rollback_frontend_serving.py @@ -0,0 +1,287 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from ...models.frontend_serving import FrontendServing +from ...models.rollback_frontend_serving_body import RollbackFrontendServingBody +from typing import cast +from uuid import UUID + + + +def request_kwargs( + id: UUID | str, + frontend_id: UUID | str, + *, + body: RollbackFrontendServingBody, + +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + + + + + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/projects/{id}/frontends/{frontend_id}/serving/rollback".format(id=quote(str(id), safe=""),frontend_id=quote(str(frontend_id), safe=""),), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | FrontendServing | None: + if response.status_code == 200: + response_200 = FrontendServing.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 409: + response_409 = Error.from_dict(response.json()) + + + + return response_409 + + if response.status_code == 413: + response_413 = Error.from_dict(response.json()) + + + + return response_413 + + if response.status_code == 500: + response_500 = Error.from_dict(response.json()) + + + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | FrontendServing]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID | str, + frontend_id: UUID | str, + *, + client: AuthenticatedClient, + body: RollbackFrontendServingBody, + +) -> Response[Error | FrontendServing]: + """ Roll a frontend back to the runtime it served before + + Returns the frontend's traffic to the runtime it served before the last activation, or to its + own runtime with `to_production`. A rollback is a new activation, so what it leaves becomes the + runtime a further rollback returns to, and it can itself be undone. It names the revision the + caller read; a competing activation makes it fail with `409`. + + Rolling back to a Candidate promotes it again and is refused with `409` when promoting it would + be. Rolling back to the frontend's own runtime is not. + + Args: + id (UUID): + frontend_id (UUID): + body (RollbackFrontendServingBody): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | FrontendServing] + """ + + + kwargs = request_kwargs( + id=id, +frontend_id=frontend_id, +body=body, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + id: UUID | str, + frontend_id: UUID | str, + *, + client: AuthenticatedClient, + body: RollbackFrontendServingBody, + +) -> Error | FrontendServing | None: + """ Roll a frontend back to the runtime it served before + + Returns the frontend's traffic to the runtime it served before the last activation, or to its + own runtime with `to_production`. A rollback is a new activation, so what it leaves becomes the + runtime a further rollback returns to, and it can itself be undone. It names the revision the + caller read; a competing activation makes it fail with `409`. + + Rolling back to a Candidate promotes it again and is refused with `409` when promoting it would + be. Rolling back to the frontend's own runtime is not. + + Args: + id (UUID): + frontend_id (UUID): + body (RollbackFrontendServingBody): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | FrontendServing + """ + + + return sync_detailed( + id=id, +frontend_id=frontend_id, +client=client, +body=body, + + ).parsed + +async def asyncio_detailed( + id: UUID | str, + frontend_id: UUID | str, + *, + client: AuthenticatedClient, + body: RollbackFrontendServingBody, + +) -> Response[Error | FrontendServing]: + """ Roll a frontend back to the runtime it served before + + Returns the frontend's traffic to the runtime it served before the last activation, or to its + own runtime with `to_production`. A rollback is a new activation, so what it leaves becomes the + runtime a further rollback returns to, and it can itself be undone. It names the revision the + caller read; a competing activation makes it fail with `409`. + + Rolling back to a Candidate promotes it again and is refused with `409` when promoting it would + be. Rolling back to the frontend's own runtime is not. + + Args: + id (UUID): + frontend_id (UUID): + body (RollbackFrontendServingBody): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | FrontendServing] + """ + + + kwargs = request_kwargs( + id=id, +frontend_id=frontend_id, +body=body, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + id: UUID | str, + frontend_id: UUID | str, + *, + client: AuthenticatedClient, + body: RollbackFrontendServingBody, + +) -> Error | FrontendServing | None: + """ Roll a frontend back to the runtime it served before + + Returns the frontend's traffic to the runtime it served before the last activation, or to its + own runtime with `to_production`. A rollback is a new activation, so what it leaves becomes the + runtime a further rollback returns to, and it can itself be undone. It names the revision the + caller read; a competing activation makes it fail with `409`. + + Rolling back to a Candidate promotes it again and is refused with `409` when promoting it would + be. Rolling back to the frontend's own runtime is not. + + Args: + id (UUID): + frontend_id (UUID): + body (RollbackFrontendServingBody): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | FrontendServing + """ + + + return (await asyncio_detailed( + id=id, +frontend_id=frontend_id, +client=client, +body=body, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/frontends/update_frontend_domain.py b/src/volcano_sdk/_generated/api/frontends/update_frontend_domain.py new file mode 100644 index 00000000..768f736d --- /dev/null +++ b/src/volcano_sdk/_generated/api/frontends/update_frontend_domain.py @@ -0,0 +1,292 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from ...models.frontend_custom_domain_response import FrontendCustomDomainResponse +from ...models.update_frontend_custom_domain_request import UpdateFrontendCustomDomainRequest +from typing import cast +from uuid import UUID + + + +def request_kwargs( + id: UUID | str, + frontend_id: UUID | str, + domain: str, + *, + body: UpdateFrontendCustomDomainRequest, + +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + + + + + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": "/projects/{id}/frontends/{frontend_id}/domains/{domain}".format(id=quote(str(id), safe=""),frontend_id=quote(str(frontend_id), safe=""),domain=quote(str(domain), safe=""),), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | FrontendCustomDomainResponse | None: + if response.status_code == 200: + response_200 = FrontendCustomDomainResponse.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 409: + response_409 = Error.from_dict(response.json()) + + + + return response_409 + + if response.status_code == 413: + response_413 = Error.from_dict(response.json()) + + + + return response_413 + + if response.status_code == 500: + response_500 = Error.from_dict(response.json()) + + + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | FrontendCustomDomainResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID | str, + frontend_id: UUID | str, + domain: str, + *, + client: AuthenticatedClient, + body: UpdateFrontendCustomDomainRequest, + +) -> Response[Error | FrontendCustomDomainResponse]: + """ Set or clear a custom domain's redirect + + `{"redirect": {"to": "www.example.com", "status": 308}}` makes the + domain redirect to another active domain of the frontend that serves it. + `{"redirect": null}` makes it serve the frontend again. A domain other + domains redirect to cannot become a redirect itself. `status` defaults + to `308`. Proxies apply the change within seconds. + + Args: + id (UUID): + frontend_id (UUID): + domain (str): + body (UpdateFrontendCustomDomainRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | FrontendCustomDomainResponse] + """ + + + kwargs = request_kwargs( + id=id, +frontend_id=frontend_id, +domain=domain, +body=body, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + id: UUID | str, + frontend_id: UUID | str, + domain: str, + *, + client: AuthenticatedClient, + body: UpdateFrontendCustomDomainRequest, + +) -> Error | FrontendCustomDomainResponse | None: + """ Set or clear a custom domain's redirect + + `{"redirect": {"to": "www.example.com", "status": 308}}` makes the + domain redirect to another active domain of the frontend that serves it. + `{"redirect": null}` makes it serve the frontend again. A domain other + domains redirect to cannot become a redirect itself. `status` defaults + to `308`. Proxies apply the change within seconds. + + Args: + id (UUID): + frontend_id (UUID): + domain (str): + body (UpdateFrontendCustomDomainRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | FrontendCustomDomainResponse + """ + + + return sync_detailed( + id=id, +frontend_id=frontend_id, +domain=domain, +client=client, +body=body, + + ).parsed + +async def asyncio_detailed( + id: UUID | str, + frontend_id: UUID | str, + domain: str, + *, + client: AuthenticatedClient, + body: UpdateFrontendCustomDomainRequest, + +) -> Response[Error | FrontendCustomDomainResponse]: + """ Set or clear a custom domain's redirect + + `{"redirect": {"to": "www.example.com", "status": 308}}` makes the + domain redirect to another active domain of the frontend that serves it. + `{"redirect": null}` makes it serve the frontend again. A domain other + domains redirect to cannot become a redirect itself. `status` defaults + to `308`. Proxies apply the change within seconds. + + Args: + id (UUID): + frontend_id (UUID): + domain (str): + body (UpdateFrontendCustomDomainRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | FrontendCustomDomainResponse] + """ + + + kwargs = request_kwargs( + id=id, +frontend_id=frontend_id, +domain=domain, +body=body, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + id: UUID | str, + frontend_id: UUID | str, + domain: str, + *, + client: AuthenticatedClient, + body: UpdateFrontendCustomDomainRequest, + +) -> Error | FrontendCustomDomainResponse | None: + """ Set or clear a custom domain's redirect + + `{"redirect": {"to": "www.example.com", "status": 308}}` makes the + domain redirect to another active domain of the frontend that serves it. + `{"redirect": null}` makes it serve the frontend again. A domain other + domains redirect to cannot become a redirect itself. `status` defaults + to `308`. Proxies apply the change within seconds. + + Args: + id (UUID): + frontend_id (UUID): + domain (str): + body (UpdateFrontendCustomDomainRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | FrontendCustomDomainResponse + """ + + + return (await asyncio_detailed( + id=id, +frontend_id=frontend_id, +domain=domain, +client=client, +body=body, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/frontends/update_frontend_function_route.py b/src/volcano_sdk/_generated/api/frontends/update_frontend_function_route.py index dbc847d5..fcbef2b5 100644 --- a/src/volcano_sdk/_generated/api/frontends/update_frontend_function_route.py +++ b/src/volcano_sdk/_generated/api/frontends/update_frontend_function_route.py @@ -88,6 +88,13 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return response_409 + if response.status_code == 413: + response_413 = Error.from_dict(response.json()) + + + + return response_413 + if response.status_code == 500: response_500 = Error.from_dict(response.json()) diff --git a/src/volcano_sdk/_generated/api/frontends/update_frontend_route.py b/src/volcano_sdk/_generated/api/frontends/update_frontend_route.py new file mode 100644 index 00000000..4a22733e --- /dev/null +++ b/src/volcano_sdk/_generated/api/frontends/update_frontend_route.py @@ -0,0 +1,280 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.create_frontend_route_request import CreateFrontendRouteRequest +from ...models.error import Error +from ...models.frontend_route import FrontendRoute +from typing import cast +from uuid import UUID + + + +def request_kwargs( + id: UUID | str, + frontend_id: UUID | str, + route_id: UUID | str, + *, + body: CreateFrontendRouteRequest, + +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + + + + + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/projects/{id}/frontends/{frontend_id}/frontend-routes/{route_id}".format(id=quote(str(id), safe=""),frontend_id=quote(str(frontend_id), safe=""),route_id=quote(str(route_id), safe=""),), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | FrontendRoute | None: + if response.status_code == 200: + response_200 = FrontendRoute.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 409: + response_409 = Error.from_dict(response.json()) + + + + return response_409 + + if response.status_code == 413: + response_413 = Error.from_dict(response.json()) + + + + return response_413 + + if response.status_code == 500: + response_500 = Error.from_dict(response.json()) + + + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | FrontendRoute]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID | str, + frontend_id: UUID | str, + route_id: UUID | str, + *, + client: AuthenticatedClient, + body: CreateFrontendRouteRequest, + +) -> Response[Error | FrontendRoute]: + """ Replace a Frontend route + + Replaces the route's mounted Frontend and path. The new values must meet the same rules as on + create. + + Args: + id (UUID): + frontend_id (UUID): + route_id (UUID): + body (CreateFrontendRouteRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | FrontendRoute] + """ + + + kwargs = request_kwargs( + id=id, +frontend_id=frontend_id, +route_id=route_id, +body=body, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + id: UUID | str, + frontend_id: UUID | str, + route_id: UUID | str, + *, + client: AuthenticatedClient, + body: CreateFrontendRouteRequest, + +) -> Error | FrontendRoute | None: + """ Replace a Frontend route + + Replaces the route's mounted Frontend and path. The new values must meet the same rules as on + create. + + Args: + id (UUID): + frontend_id (UUID): + route_id (UUID): + body (CreateFrontendRouteRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | FrontendRoute + """ + + + return sync_detailed( + id=id, +frontend_id=frontend_id, +route_id=route_id, +client=client, +body=body, + + ).parsed + +async def asyncio_detailed( + id: UUID | str, + frontend_id: UUID | str, + route_id: UUID | str, + *, + client: AuthenticatedClient, + body: CreateFrontendRouteRequest, + +) -> Response[Error | FrontendRoute]: + """ Replace a Frontend route + + Replaces the route's mounted Frontend and path. The new values must meet the same rules as on + create. + + Args: + id (UUID): + frontend_id (UUID): + route_id (UUID): + body (CreateFrontendRouteRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | FrontendRoute] + """ + + + kwargs = request_kwargs( + id=id, +frontend_id=frontend_id, +route_id=route_id, +body=body, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + id: UUID | str, + frontend_id: UUID | str, + route_id: UUID | str, + *, + client: AuthenticatedClient, + body: CreateFrontendRouteRequest, + +) -> Error | FrontendRoute | None: + """ Replace a Frontend route + + Replaces the route's mounted Frontend and path. The new values must meet the same rules as on + create. + + Args: + id (UUID): + frontend_id (UUID): + route_id (UUID): + body (CreateFrontendRouteRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | FrontendRoute + """ + + + return (await asyncio_detailed( + id=id, +frontend_id=frontend_id, +route_id=route_id, +client=client, +body=body, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/functions/create_function_candidate.py b/src/volcano_sdk/_generated/api/functions/create_function_candidate.py new file mode 100644 index 00000000..7e6c56ee --- /dev/null +++ b/src/volcano_sdk/_generated/api/functions/create_function_candidate.py @@ -0,0 +1,333 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.create_function_candidate_body import CreateFunctionCandidateBody +from ...models.error import Error +from ...models.function_candidate import FunctionCandidate +from typing import cast +from uuid import UUID + + + +def request_kwargs( + id: UUID | str, + function_id: UUID | str, + *, + body: CreateFunctionCandidateBody, + +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + + + + + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/projects/{id}/functions/{function_id}/candidates".format(id=quote(str(id), safe=""),function_id=quote(str(function_id), safe=""),), + } + + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data; boundary=+++" + + _kwargs["headers"] = headers + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | FunctionCandidate | None: + if response.status_code == 202: + response_202 = FunctionCandidate.from_dict(response.json()) + + + + return response_202 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 409: + response_409 = Error.from_dict(response.json()) + + + + return response_409 + + if response.status_code == 413: + response_413 = Error.from_dict(response.json()) + + + + return response_413 + + if response.status_code == 429: + response_429 = Error.from_dict(response.json()) + + + + return response_429 + + if response.status_code == 500: + response_500 = Error.from_dict(response.json()) + + + + return response_500 + + if response.status_code == 503: + response_503 = Error.from_dict(response.json()) + + + + return response_503 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | FunctionCandidate]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID | str, + function_id: UUID | str, + *, + client: AuthenticatedClient, + body: CreateFunctionCandidateBody, + +) -> Response[Error | FunctionCandidate]: + """ Create a function preview + + Builds the uploaded source with the function's runtime, handler and variables, and deploys it to a + runtime of its own in every region the function deploys to. The preview is invoked at + `https://.` and is always private, whatever the function's own + visibility: only the project's service key, with `functions.invoke`, can invoke it, and signed-in + users, anon keys and access tokens are refused. It gets none of the function's schedules or warmers. + The response is `202` while the first deployment runs; read the preview for its `status` and `url`. + + While the `functions.candidates` capability is unavailable, including on the local development + server, it answers `404` with code `feature_unavailable`. Reading and deleting existing previews, + and rolling the function back to its own build, keep + working. + + A preview builds like any deploy and spends the project's build minutes. A function has at most 20 + live previews, and each name is unique within the function. Without `ttl_seconds` a preview is kept + until it is deleted. Durable functions have no previews. + + Args: + id (UUID): + function_id (UUID): + body (CreateFunctionCandidateBody): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | FunctionCandidate] + """ + + + kwargs = request_kwargs( + id=id, +function_id=function_id, +body=body, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + id: UUID | str, + function_id: UUID | str, + *, + client: AuthenticatedClient, + body: CreateFunctionCandidateBody, + +) -> Error | FunctionCandidate | None: + """ Create a function preview + + Builds the uploaded source with the function's runtime, handler and variables, and deploys it to a + runtime of its own in every region the function deploys to. The preview is invoked at + `https://.` and is always private, whatever the function's own + visibility: only the project's service key, with `functions.invoke`, can invoke it, and signed-in + users, anon keys and access tokens are refused. It gets none of the function's schedules or warmers. + The response is `202` while the first deployment runs; read the preview for its `status` and `url`. + + While the `functions.candidates` capability is unavailable, including on the local development + server, it answers `404` with code `feature_unavailable`. Reading and deleting existing previews, + and rolling the function back to its own build, keep + working. + + A preview builds like any deploy and spends the project's build minutes. A function has at most 20 + live previews, and each name is unique within the function. Without `ttl_seconds` a preview is kept + until it is deleted. Durable functions have no previews. + + Args: + id (UUID): + function_id (UUID): + body (CreateFunctionCandidateBody): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | FunctionCandidate + """ + + + return sync_detailed( + id=id, +function_id=function_id, +client=client, +body=body, + + ).parsed + +async def asyncio_detailed( + id: UUID | str, + function_id: UUID | str, + *, + client: AuthenticatedClient, + body: CreateFunctionCandidateBody, + +) -> Response[Error | FunctionCandidate]: + """ Create a function preview + + Builds the uploaded source with the function's runtime, handler and variables, and deploys it to a + runtime of its own in every region the function deploys to. The preview is invoked at + `https://.` and is always private, whatever the function's own + visibility: only the project's service key, with `functions.invoke`, can invoke it, and signed-in + users, anon keys and access tokens are refused. It gets none of the function's schedules or warmers. + The response is `202` while the first deployment runs; read the preview for its `status` and `url`. + + While the `functions.candidates` capability is unavailable, including on the local development + server, it answers `404` with code `feature_unavailable`. Reading and deleting existing previews, + and rolling the function back to its own build, keep + working. + + A preview builds like any deploy and spends the project's build minutes. A function has at most 20 + live previews, and each name is unique within the function. Without `ttl_seconds` a preview is kept + until it is deleted. Durable functions have no previews. + + Args: + id (UUID): + function_id (UUID): + body (CreateFunctionCandidateBody): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | FunctionCandidate] + """ + + + kwargs = request_kwargs( + id=id, +function_id=function_id, +body=body, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + id: UUID | str, + function_id: UUID | str, + *, + client: AuthenticatedClient, + body: CreateFunctionCandidateBody, + +) -> Error | FunctionCandidate | None: + """ Create a function preview + + Builds the uploaded source with the function's runtime, handler and variables, and deploys it to a + runtime of its own in every region the function deploys to. The preview is invoked at + `https://.` and is always private, whatever the function's own + visibility: only the project's service key, with `functions.invoke`, can invoke it, and signed-in + users, anon keys and access tokens are refused. It gets none of the function's schedules or warmers. + The response is `202` while the first deployment runs; read the preview for its `status` and `url`. + + While the `functions.candidates` capability is unavailable, including on the local development + server, it answers `404` with code `feature_unavailable`. Reading and deleting existing previews, + and rolling the function back to its own build, keep + working. + + A preview builds like any deploy and spends the project's build minutes. A function has at most 20 + live previews, and each name is unique within the function. Without `ttl_seconds` a preview is kept + until it is deleted. Durable functions have no previews. + + Args: + id (UUID): + function_id (UUID): + body (CreateFunctionCandidateBody): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | FunctionCandidate + """ + + + return (await asyncio_detailed( + id=id, +function_id=function_id, +client=client, +body=body, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/functions/delete_function_candidate.py b/src/volcano_sdk/_generated/api/functions/delete_function_candidate.py new file mode 100644 index 00000000..e53a34f6 --- /dev/null +++ b/src/volcano_sdk/_generated/api/functions/delete_function_candidate.py @@ -0,0 +1,269 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from typing import cast +from uuid import UUID + + + +def request_kwargs( + id: UUID | str, + function_id: UUID | str, + candidate_id: UUID | str, + +) -> dict[str, Any]: + + + + + + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/projects/{id}/functions/{function_id}/candidates/{candidate_id}".format(id=quote(str(id), safe=""),function_id=quote(str(function_id), safe=""),candidate_id=quote(str(candidate_id), safe=""),), + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | Error | None: + if response.status_code == 202: + response_202 = cast(Any, None) + return response_202 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 409: + response_409 = Error.from_dict(response.json()) + + + + return response_409 + + if response.status_code == 500: + response_500 = Error.from_dict(response.json()) + + + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any | Error]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID | str, + function_id: UUID | str, + candidate_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Response[Any | Error]: + """ Delete a function preview + + Starts removing the preview's runtime, URL, builds and stored source once any running deployment + finishes; the preview reads `deleting` until that is done, and answers `404` once it is gone. Asking + again for a preview that is already being deleted is the same request. + + A preview the function runs cannot be deleted: roll back first. Deleting one the function only keeps + for a rollback gives that rollback up; the function's own build stays one `to_production` rollback + away. Never depends on the `functions.candidates` capability. + + Args: + id (UUID): + function_id (UUID): + candidate_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | Error] + """ + + + kwargs = request_kwargs( + id=id, +function_id=function_id, +candidate_id=candidate_id, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + id: UUID | str, + function_id: UUID | str, + candidate_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Any | Error | None: + """ Delete a function preview + + Starts removing the preview's runtime, URL, builds and stored source once any running deployment + finishes; the preview reads `deleting` until that is done, and answers `404` once it is gone. Asking + again for a preview that is already being deleted is the same request. + + A preview the function runs cannot be deleted: roll back first. Deleting one the function only keeps + for a rollback gives that rollback up; the function's own build stays one `to_production` rollback + away. Never depends on the `functions.candidates` capability. + + Args: + id (UUID): + function_id (UUID): + candidate_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | Error + """ + + + return sync_detailed( + id=id, +function_id=function_id, +candidate_id=candidate_id, +client=client, + + ).parsed + +async def asyncio_detailed( + id: UUID | str, + function_id: UUID | str, + candidate_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Response[Any | Error]: + """ Delete a function preview + + Starts removing the preview's runtime, URL, builds and stored source once any running deployment + finishes; the preview reads `deleting` until that is done, and answers `404` once it is gone. Asking + again for a preview that is already being deleted is the same request. + + A preview the function runs cannot be deleted: roll back first. Deleting one the function only keeps + for a rollback gives that rollback up; the function's own build stays one `to_production` rollback + away. Never depends on the `functions.candidates` capability. + + Args: + id (UUID): + function_id (UUID): + candidate_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | Error] + """ + + + kwargs = request_kwargs( + id=id, +function_id=function_id, +candidate_id=candidate_id, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + id: UUID | str, + function_id: UUID | str, + candidate_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Any | Error | None: + """ Delete a function preview + + Starts removing the preview's runtime, URL, builds and stored source once any running deployment + finishes; the preview reads `deleting` until that is done, and answers `404` once it is gone. Asking + again for a preview that is already being deleted is the same request. + + A preview the function runs cannot be deleted: roll back first. Deleting one the function only keeps + for a rollback gives that rollback up; the function's own build stays one `to_production` rollback + away. Never depends on the `functions.candidates` capability. + + Args: + id (UUID): + function_id (UUID): + candidate_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | Error + """ + + + return (await asyncio_detailed( + id=id, +function_id=function_id, +candidate_id=candidate_id, +client=client, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/functions/get_function_candidate.py b/src/volcano_sdk/_generated/api/functions/get_function_candidate.py new file mode 100644 index 00000000..fac9e94b --- /dev/null +++ b/src/volcano_sdk/_generated/api/functions/get_function_candidate.py @@ -0,0 +1,246 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from ...models.function_candidate import FunctionCandidate +from typing import cast +from uuid import UUID + + + +def request_kwargs( + id: UUID | str, + function_id: UUID | str, + candidate_id: UUID | str, + +) -> dict[str, Any]: + + + + + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/projects/{id}/functions/{function_id}/candidates/{candidate_id}".format(id=quote(str(id), safe=""),function_id=quote(str(function_id), safe=""),candidate_id=quote(str(candidate_id), safe=""),), + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | FunctionCandidate | None: + if response.status_code == 200: + response_200 = FunctionCandidate.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 500: + response_500 = Error.from_dict(response.json()) + + + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | FunctionCandidate]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID | str, + function_id: UUID | str, + candidate_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Response[Error | FunctionCandidate]: + """ Get a function preview + + Returns the preview with its latest deployment. Never depends on the `functions.candidates` + capability. + + Args: + id (UUID): + function_id (UUID): + candidate_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | FunctionCandidate] + """ + + + kwargs = request_kwargs( + id=id, +function_id=function_id, +candidate_id=candidate_id, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + id: UUID | str, + function_id: UUID | str, + candidate_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Error | FunctionCandidate | None: + """ Get a function preview + + Returns the preview with its latest deployment. Never depends on the `functions.candidates` + capability. + + Args: + id (UUID): + function_id (UUID): + candidate_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | FunctionCandidate + """ + + + return sync_detailed( + id=id, +function_id=function_id, +candidate_id=candidate_id, +client=client, + + ).parsed + +async def asyncio_detailed( + id: UUID | str, + function_id: UUID | str, + candidate_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Response[Error | FunctionCandidate]: + """ Get a function preview + + Returns the preview with its latest deployment. Never depends on the `functions.candidates` + capability. + + Args: + id (UUID): + function_id (UUID): + candidate_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | FunctionCandidate] + """ + + + kwargs = request_kwargs( + id=id, +function_id=function_id, +candidate_id=candidate_id, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + id: UUID | str, + function_id: UUID | str, + candidate_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Error | FunctionCandidate | None: + """ Get a function preview + + Returns the preview with its latest deployment. Never depends on the `functions.candidates` + capability. + + Args: + id (UUID): + function_id (UUID): + candidate_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | FunctionCandidate + """ + + + return (await asyncio_detailed( + id=id, +function_id=function_id, +candidate_id=candidate_id, +client=client, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/autofix/get_autofix_settings.py b/src/volcano_sdk/_generated/api/functions/get_function_serving.py similarity index 51% rename from src/volcano_sdk/_generated/api/autofix/get_autofix_settings.py rename to src/volcano_sdk/_generated/api/functions/get_function_serving.py index 35eeeff4..490e2453 100644 --- a/src/volcano_sdk/_generated/api/autofix/get_autofix_settings.py +++ b/src/volcano_sdk/_generated/api/functions/get_function_serving.py @@ -8,8 +8,8 @@ from ...types import Response, UNSET from ... import errors -from ...models.autofix_settings import AutofixSettings from ...models.error import Error +from ...models.function_serving import FunctionServing from typing import cast from uuid import UUID @@ -17,6 +17,7 @@ def request_kwargs( id: UUID | str, + function_id: UUID | str, ) -> dict[str, Any]: @@ -27,7 +28,7 @@ def request_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/projects/{id}/autofix".format(id=quote(str(id), safe=""),), + "url": "/projects/{id}/functions/{function_id}/serving".format(id=quote(str(id), safe=""),function_id=quote(str(function_id), safe=""),), } @@ -35,34 +36,48 @@ def request_kwargs( -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> AutofixSettings | Error | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | FunctionServing | None: if response.status_code == 200: - response_200 = AutofixSettings.from_dict(response.json()) + response_200 = FunctionServing.from_dict(response.json()) return response_200 - if response.status_code == 404: - response_404 = Error.from_dict(response.json()) + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) - return response_404 + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 - if response.status_code == 501: - response_501 = Error.from_dict(response.json()) + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) - return response_501 + return response_404 - if response.status_code == 503: - response_503 = Error.from_dict(response.json()) + if response.status_code == 500: + response_500 = Error.from_dict(response.json()) - return response_503 + return response_500 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -70,7 +85,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[AutofixSettings | Error]: +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | FunctionServing]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -81,37 +96,33 @@ def build_response(*, client: AuthenticatedClient | Client, response: httpx.Resp def sync_detailed( id: UUID | str, + function_id: UUID | str, *, client: AuthenticatedClient, -) -> Response[AutofixSettings | Error]: - """ Get autofix settings +) -> Response[Error | FunctionServing]: + """ Get what a function runs - Returns whether Volcano diagnoses the project's issues with AI, how far - a run may go, and which model it uses. A project that never saved - settings returns the defaults, with autofix off. - - Your API key is never returned. `api_key_configured`, - `api_key_provider`, and `api_key_last4` show whether one is set and - which provider it belongs to. - - Where autofix is not available, saved settings stay readable. A project - that never saved any answers `404` with code `feature_unavailable`. + Returns whether the function runs its own build or a promoted preview's, what a rollback returns + to, and its latest promotion or rollback. Never depends on the `functions.candidates` capability. + A durable function always runs its own build. Args: id (UUID): + function_id (UUID): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AutofixSettings | Error] + Response[Error | FunctionServing] """ kwargs = request_kwargs( id=id, +function_id=function_id, ) @@ -123,74 +134,66 @@ def sync_detailed( def sync( id: UUID | str, + function_id: UUID | str, *, client: AuthenticatedClient, -) -> AutofixSettings | Error | None: - """ Get autofix settings - - Returns whether Volcano diagnoses the project's issues with AI, how far - a run may go, and which model it uses. A project that never saved - settings returns the defaults, with autofix off. +) -> Error | FunctionServing | None: + """ Get what a function runs - Your API key is never returned. `api_key_configured`, - `api_key_provider`, and `api_key_last4` show whether one is set and - which provider it belongs to. - - Where autofix is not available, saved settings stay readable. A project - that never saved any answers `404` with code `feature_unavailable`. + Returns whether the function runs its own build or a promoted preview's, what a rollback returns + to, and its latest promotion or rollback. Never depends on the `functions.candidates` capability. + A durable function always runs its own build. Args: id (UUID): + function_id (UUID): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AutofixSettings | Error + Error | FunctionServing """ return sync_detailed( id=id, +function_id=function_id, client=client, ).parsed async def asyncio_detailed( id: UUID | str, + function_id: UUID | str, *, client: AuthenticatedClient, -) -> Response[AutofixSettings | Error]: - """ Get autofix settings - - Returns whether Volcano diagnoses the project's issues with AI, how far - a run may go, and which model it uses. A project that never saved - settings returns the defaults, with autofix off. - - Your API key is never returned. `api_key_configured`, - `api_key_provider`, and `api_key_last4` show whether one is set and - which provider it belongs to. +) -> Response[Error | FunctionServing]: + """ Get what a function runs - Where autofix is not available, saved settings stay readable. A project - that never saved any answers `404` with code `feature_unavailable`. + Returns whether the function runs its own build or a promoted preview's, what a rollback returns + to, and its latest promotion or rollback. Never depends on the `functions.candidates` capability. + A durable function always runs its own build. Args: id (UUID): + function_id (UUID): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AutofixSettings | Error] + Response[Error | FunctionServing] """ kwargs = request_kwargs( id=id, +function_id=function_id, ) @@ -202,37 +205,33 @@ async def asyncio_detailed( async def asyncio( id: UUID | str, + function_id: UUID | str, *, client: AuthenticatedClient, -) -> AutofixSettings | Error | None: - """ Get autofix settings - - Returns whether Volcano diagnoses the project's issues with AI, how far - a run may go, and which model it uses. A project that never saved - settings returns the defaults, with autofix off. - - Your API key is never returned. `api_key_configured`, - `api_key_provider`, and `api_key_last4` show whether one is set and - which provider it belongs to. +) -> Error | FunctionServing | None: + """ Get what a function runs - Where autofix is not available, saved settings stay readable. A project - that never saved any answers `404` with code `feature_unavailable`. + Returns whether the function runs its own build or a promoted preview's, what a rollback returns + to, and its latest promotion or rollback. Never depends on the `functions.candidates` capability. + A durable function always runs its own build. Args: id (UUID): + function_id (UUID): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AutofixSettings | Error + Error | FunctionServing """ return (await asyncio_detailed( id=id, +function_id=function_id, client=client, )).parsed diff --git a/src/volcano_sdk/_generated/api/functions/invoke_function.py b/src/volcano_sdk/_generated/api/functions/invoke_function.py index bed45f2a..47878346 100644 --- a/src/volcano_sdk/_generated/api/functions/invoke_function.py +++ b/src/volcano_sdk/_generated/api/functions/invoke_function.py @@ -79,6 +79,13 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return response_404 + if response.status_code == 413: + response_413 = Error.from_dict(response.json()) + + + + return response_413 + if response.status_code == 429: response_429 = Error.from_dict(response.json()) @@ -151,11 +158,12 @@ def sync_detailed( - Function must have `visibility: public` - Function receives payload only (no `__volcano_auth`) - **Reserved payload keys:** the top-level `__volcano_auth` and - `__volcano_http` keys are reserved. Volcano removes caller-supplied - values for both before the function runs; only an auth user token adds - a server-built `__volcano_auth`, and only HTTP-mode ingress sets - `__volcano_http: true`. + **Reserved payload keys:** the top-level `__volcano_auth`, + `__volcano_http` and `__volcano_mount` keys are reserved. Volcano + removes caller-supplied values for all three before the function runs; + only an auth user token adds a server-built `__volcano_auth`, and only + HTTP-mode ingress sets `__volcano_http: true`. `__volcano_mount` is set + only by Volcano's first-party app mounts. **Transport and CORS:** - This operation is the authenticated direct RPC endpoint and always uses the @@ -242,11 +250,12 @@ def sync( - Function must have `visibility: public` - Function receives payload only (no `__volcano_auth`) - **Reserved payload keys:** the top-level `__volcano_auth` and - `__volcano_http` keys are reserved. Volcano removes caller-supplied - values for both before the function runs; only an auth user token adds - a server-built `__volcano_auth`, and only HTTP-mode ingress sets - `__volcano_http: true`. + **Reserved payload keys:** the top-level `__volcano_auth`, + `__volcano_http` and `__volcano_mount` keys are reserved. Volcano + removes caller-supplied values for all three before the function runs; + only an auth user token adds a server-built `__volcano_auth`, and only + HTTP-mode ingress sets `__volcano_http: true`. `__volcano_mount` is set + only by Volcano's first-party app mounts. **Transport and CORS:** - This operation is the authenticated direct RPC endpoint and always uses the @@ -328,11 +337,12 @@ async def asyncio_detailed( - Function must have `visibility: public` - Function receives payload only (no `__volcano_auth`) - **Reserved payload keys:** the top-level `__volcano_auth` and - `__volcano_http` keys are reserved. Volcano removes caller-supplied - values for both before the function runs; only an auth user token adds - a server-built `__volcano_auth`, and only HTTP-mode ingress sets - `__volcano_http: true`. + **Reserved payload keys:** the top-level `__volcano_auth`, + `__volcano_http` and `__volcano_mount` keys are reserved. Volcano + removes caller-supplied values for all three before the function runs; + only an auth user token adds a server-built `__volcano_auth`, and only + HTTP-mode ingress sets `__volcano_http: true`. `__volcano_mount` is set + only by Volcano's first-party app mounts. **Transport and CORS:** - This operation is the authenticated direct RPC endpoint and always uses the @@ -419,11 +429,12 @@ async def asyncio( - Function must have `visibility: public` - Function receives payload only (no `__volcano_auth`) - **Reserved payload keys:** the top-level `__volcano_auth` and - `__volcano_http` keys are reserved. Volcano removes caller-supplied - values for both before the function runs; only an auth user token adds - a server-built `__volcano_auth`, and only HTTP-mode ingress sets - `__volcano_http: true`. + **Reserved payload keys:** the top-level `__volcano_auth`, + `__volcano_http` and `__volcano_mount` keys are reserved. Volcano + removes caller-supplied values for all three before the function runs; + only an auth user token adds a server-built `__volcano_auth`, and only + HTTP-mode ingress sets `__volcano_http: true`. `__volcano_mount` is set + only by Volcano's first-party app mounts. **Transport and CORS:** - This operation is the authenticated direct RPC endpoint and always uses the diff --git a/src/volcano_sdk/_generated/api/functions/list_function_candidate_deployments.py b/src/volcano_sdk/_generated/api/functions/list_function_candidate_deployments.py new file mode 100644 index 00000000..d47f3e3b --- /dev/null +++ b/src/volcano_sdk/_generated/api/functions/list_function_candidate_deployments.py @@ -0,0 +1,246 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from ...models.function_candidate_deployment_list import FunctionCandidateDeploymentList +from typing import cast +from uuid import UUID + + + +def request_kwargs( + id: UUID | str, + function_id: UUID | str, + candidate_id: UUID | str, + +) -> dict[str, Any]: + + + + + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/projects/{id}/functions/{function_id}/candidates/{candidate_id}/deployments".format(id=quote(str(id), safe=""),function_id=quote(str(function_id), safe=""),candidate_id=quote(str(candidate_id), safe=""),), + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | FunctionCandidateDeploymentList | None: + if response.status_code == 200: + response_200 = FunctionCandidateDeploymentList.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 500: + response_500 = Error.from_dict(response.json()) + + + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | FunctionCandidateDeploymentList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID | str, + function_id: UUID | str, + candidate_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Response[Error | FunctionCandidateDeploymentList]: + """ List a function preview's deployments + + Returns the preview's deployments, newest first, at most 100. Never depends on the + `functions.candidates` capability. + + Args: + id (UUID): + function_id (UUID): + candidate_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | FunctionCandidateDeploymentList] + """ + + + kwargs = request_kwargs( + id=id, +function_id=function_id, +candidate_id=candidate_id, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + id: UUID | str, + function_id: UUID | str, + candidate_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Error | FunctionCandidateDeploymentList | None: + """ List a function preview's deployments + + Returns the preview's deployments, newest first, at most 100. Never depends on the + `functions.candidates` capability. + + Args: + id (UUID): + function_id (UUID): + candidate_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | FunctionCandidateDeploymentList + """ + + + return sync_detailed( + id=id, +function_id=function_id, +candidate_id=candidate_id, +client=client, + + ).parsed + +async def asyncio_detailed( + id: UUID | str, + function_id: UUID | str, + candidate_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Response[Error | FunctionCandidateDeploymentList]: + """ List a function preview's deployments + + Returns the preview's deployments, newest first, at most 100. Never depends on the + `functions.candidates` capability. + + Args: + id (UUID): + function_id (UUID): + candidate_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | FunctionCandidateDeploymentList] + """ + + + kwargs = request_kwargs( + id=id, +function_id=function_id, +candidate_id=candidate_id, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + id: UUID | str, + function_id: UUID | str, + candidate_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Error | FunctionCandidateDeploymentList | None: + """ List a function preview's deployments + + Returns the preview's deployments, newest first, at most 100. Never depends on the + `functions.candidates` capability. + + Args: + id (UUID): + function_id (UUID): + candidate_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | FunctionCandidateDeploymentList + """ + + + return (await asyncio_detailed( + id=id, +function_id=function_id, +candidate_id=candidate_id, +client=client, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/functions/list_function_candidates.py b/src/volcano_sdk/_generated/api/functions/list_function_candidates.py new file mode 100644 index 00000000..5fe58d9a --- /dev/null +++ b/src/volcano_sdk/_generated/api/functions/list_function_candidates.py @@ -0,0 +1,245 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from ...models.function_candidate_list import FunctionCandidateList +from typing import cast +from uuid import UUID + + + +def request_kwargs( + id: UUID | str, + function_id: UUID | str, + +) -> dict[str, Any]: + + + + + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/projects/{id}/functions/{function_id}/candidates".format(id=quote(str(id), safe=""),function_id=quote(str(function_id), safe=""),), + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | FunctionCandidateList | None: + if response.status_code == 200: + response_200 = FunctionCandidateList.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 500: + response_500 = Error.from_dict(response.json()) + + + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | FunctionCandidateList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID | str, + function_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Response[Error | FunctionCandidateList]: + """ List a function's previews + + Returns the function's previews, oldest first, each with its latest deployment. A function has at + most + 20 live previews. Reading never depends on the `functions.candidates` capability. A durable function + has no previews: reading its previews answers an empty list, and reading its serving state answers + its own build. + + Args: + id (UUID): + function_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | FunctionCandidateList] + """ + + + kwargs = request_kwargs( + id=id, +function_id=function_id, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + id: UUID | str, + function_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Error | FunctionCandidateList | None: + """ List a function's previews + + Returns the function's previews, oldest first, each with its latest deployment. A function has at + most + 20 live previews. Reading never depends on the `functions.candidates` capability. A durable function + has no previews: reading its previews answers an empty list, and reading its serving state answers + its own build. + + Args: + id (UUID): + function_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | FunctionCandidateList + """ + + + return sync_detailed( + id=id, +function_id=function_id, +client=client, + + ).parsed + +async def asyncio_detailed( + id: UUID | str, + function_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Response[Error | FunctionCandidateList]: + """ List a function's previews + + Returns the function's previews, oldest first, each with its latest deployment. A function has at + most + 20 live previews. Reading never depends on the `functions.candidates` capability. A durable function + has no previews: reading its previews answers an empty list, and reading its serving state answers + its own build. + + Args: + id (UUID): + function_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | FunctionCandidateList] + """ + + + kwargs = request_kwargs( + id=id, +function_id=function_id, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + id: UUID | str, + function_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Error | FunctionCandidateList | None: + """ List a function's previews + + Returns the function's previews, oldest first, each with its latest deployment. A function has at + most + 20 live previews. Reading never depends on the `functions.candidates` capability. A durable function + has no previews: reading its previews answers an empty list, and reading its serving state answers + its own build. + + Args: + id (UUID): + function_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | FunctionCandidateList + """ + + + return (await asyncio_detailed( + id=id, +function_id=function_id, +client=client, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/functions/promote_function_candidate.py b/src/volcano_sdk/_generated/api/functions/promote_function_candidate.py new file mode 100644 index 00000000..a4e43ff2 --- /dev/null +++ b/src/volcano_sdk/_generated/api/functions/promote_function_candidate.py @@ -0,0 +1,328 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from ...models.function_promotion_request import FunctionPromotionRequest +from ...models.function_serving import FunctionServing +from typing import cast +from uuid import UUID + + + +def request_kwargs( + id: UUID | str, + function_id: UUID | str, + candidate_id: UUID | str, + *, + body: FunctionPromotionRequest, + +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + + + + + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/projects/{id}/functions/{function_id}/candidates/{candidate_id}/promote".format(id=quote(str(id), safe=""),function_id=quote(str(function_id), safe=""),candidate_id=quote(str(candidate_id), safe=""),), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | FunctionServing | None: + if response.status_code == 200: + response_200 = FunctionServing.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 409: + response_409 = Error.from_dict(response.json()) + + + + return response_409 + + if response.status_code == 413: + response_413 = Error.from_dict(response.json()) + + + + return response_413 + + if response.status_code == 500: + response_500 = Error.from_dict(response.json()) + + + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | FunctionServing]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID | str, + function_id: UUID | str, + candidate_id: UUID | str, + *, + client: AuthenticatedClient, + body: FunctionPromotionRequest, + +) -> Response[Error | FunctionServing]: + """ Promote a function preview + + Points the function's traffic at the preview's runtime. Nothing is deployed or rebuilt, so it + takes effect at once: every call to the function, through its own URL, the invoke route, a + schedule or a frontend route, runs the preview's code, while the function keeps its ID, URL, + visibility, schedules, metering and logs. The function's own build is kept as it is for a + rollback, and what the function ran becomes what a rollback returns to. + + The preview must be serving a successful deployment built with the variables, runtime and handler + the function has now, in every region the function deploys to, and the function must have a + successful deployment of its own. It is refused while a deployment of the function, or a + synchronization of its variables, runs. Promotion names the `revision` the caller read from + `serving`; a competing promotion or rollback makes it fail with `409`. Once the project's + repository is the source of truth, promotion is refused with `409`, as a direct deploy is. + While the `functions.candidates` capability is unavailable, including on the local development + server, it answers `404` with code `feature_unavailable`. + + Args: + id (UUID): + function_id (UUID): + candidate_id (UUID): + body (FunctionPromotionRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | FunctionServing] + """ + + + kwargs = request_kwargs( + id=id, +function_id=function_id, +candidate_id=candidate_id, +body=body, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + id: UUID | str, + function_id: UUID | str, + candidate_id: UUID | str, + *, + client: AuthenticatedClient, + body: FunctionPromotionRequest, + +) -> Error | FunctionServing | None: + """ Promote a function preview + + Points the function's traffic at the preview's runtime. Nothing is deployed or rebuilt, so it + takes effect at once: every call to the function, through its own URL, the invoke route, a + schedule or a frontend route, runs the preview's code, while the function keeps its ID, URL, + visibility, schedules, metering and logs. The function's own build is kept as it is for a + rollback, and what the function ran becomes what a rollback returns to. + + The preview must be serving a successful deployment built with the variables, runtime and handler + the function has now, in every region the function deploys to, and the function must have a + successful deployment of its own. It is refused while a deployment of the function, or a + synchronization of its variables, runs. Promotion names the `revision` the caller read from + `serving`; a competing promotion or rollback makes it fail with `409`. Once the project's + repository is the source of truth, promotion is refused with `409`, as a direct deploy is. + While the `functions.candidates` capability is unavailable, including on the local development + server, it answers `404` with code `feature_unavailable`. + + Args: + id (UUID): + function_id (UUID): + candidate_id (UUID): + body (FunctionPromotionRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | FunctionServing + """ + + + return sync_detailed( + id=id, +function_id=function_id, +candidate_id=candidate_id, +client=client, +body=body, + + ).parsed + +async def asyncio_detailed( + id: UUID | str, + function_id: UUID | str, + candidate_id: UUID | str, + *, + client: AuthenticatedClient, + body: FunctionPromotionRequest, + +) -> Response[Error | FunctionServing]: + """ Promote a function preview + + Points the function's traffic at the preview's runtime. Nothing is deployed or rebuilt, so it + takes effect at once: every call to the function, through its own URL, the invoke route, a + schedule or a frontend route, runs the preview's code, while the function keeps its ID, URL, + visibility, schedules, metering and logs. The function's own build is kept as it is for a + rollback, and what the function ran becomes what a rollback returns to. + + The preview must be serving a successful deployment built with the variables, runtime and handler + the function has now, in every region the function deploys to, and the function must have a + successful deployment of its own. It is refused while a deployment of the function, or a + synchronization of its variables, runs. Promotion names the `revision` the caller read from + `serving`; a competing promotion or rollback makes it fail with `409`. Once the project's + repository is the source of truth, promotion is refused with `409`, as a direct deploy is. + While the `functions.candidates` capability is unavailable, including on the local development + server, it answers `404` with code `feature_unavailable`. + + Args: + id (UUID): + function_id (UUID): + candidate_id (UUID): + body (FunctionPromotionRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | FunctionServing] + """ + + + kwargs = request_kwargs( + id=id, +function_id=function_id, +candidate_id=candidate_id, +body=body, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + id: UUID | str, + function_id: UUID | str, + candidate_id: UUID | str, + *, + client: AuthenticatedClient, + body: FunctionPromotionRequest, + +) -> Error | FunctionServing | None: + """ Promote a function preview + + Points the function's traffic at the preview's runtime. Nothing is deployed or rebuilt, so it + takes effect at once: every call to the function, through its own URL, the invoke route, a + schedule or a frontend route, runs the preview's code, while the function keeps its ID, URL, + visibility, schedules, metering and logs. The function's own build is kept as it is for a + rollback, and what the function ran becomes what a rollback returns to. + + The preview must be serving a successful deployment built with the variables, runtime and handler + the function has now, in every region the function deploys to, and the function must have a + successful deployment of its own. It is refused while a deployment of the function, or a + synchronization of its variables, runs. Promotion names the `revision` the caller read from + `serving`; a competing promotion or rollback makes it fail with `409`. Once the project's + repository is the source of truth, promotion is refused with `409`, as a direct deploy is. + While the `functions.candidates` capability is unavailable, including on the local development + server, it answers `404` with code `feature_unavailable`. + + Args: + id (UUID): + function_id (UUID): + candidate_id (UUID): + body (FunctionPromotionRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | FunctionServing + """ + + + return (await asyncio_detailed( + id=id, +function_id=function_id, +candidate_id=candidate_id, +client=client, +body=body, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/functions/redeploy_function_candidate.py b/src/volcano_sdk/_generated/api/functions/redeploy_function_candidate.py new file mode 100644 index 00000000..510b3cb3 --- /dev/null +++ b/src/volcano_sdk/_generated/api/functions/redeploy_function_candidate.py @@ -0,0 +1,314 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from ...models.function_candidate_deployment import FunctionCandidateDeployment +from ...models.redeploy_function_candidate_body import RedeployFunctionCandidateBody +from typing import cast +from uuid import UUID + + + +def request_kwargs( + id: UUID | str, + function_id: UUID | str, + candidate_id: UUID | str, + *, + body: RedeployFunctionCandidateBody, + +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + + + + + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/projects/{id}/functions/{function_id}/candidates/{candidate_id}/deployments".format(id=quote(str(id), safe=""),function_id=quote(str(function_id), safe=""),candidate_id=quote(str(candidate_id), safe=""),), + } + + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data; boundary=+++" + + _kwargs["headers"] = headers + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | FunctionCandidateDeployment | None: + if response.status_code == 202: + response_202 = FunctionCandidateDeployment.from_dict(response.json()) + + + + return response_202 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 409: + response_409 = Error.from_dict(response.json()) + + + + return response_409 + + if response.status_code == 413: + response_413 = Error.from_dict(response.json()) + + + + return response_413 + + if response.status_code == 429: + response_429 = Error.from_dict(response.json()) + + + + return response_429 + + if response.status_code == 500: + response_500 = Error.from_dict(response.json()) + + + + return response_500 + + if response.status_code == 503: + response_503 = Error.from_dict(response.json()) + + + + return response_503 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | FunctionCandidateDeployment]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID | str, + function_id: UUID | str, + candidate_id: UUID | str, + *, + client: AuthenticatedClient, + body: RedeployFunctionCandidateBody, + +) -> Response[Error | FunctionCandidateDeployment]: + """ Deploy new source to a function preview + + Builds the uploaded source and deploys it to the preview, which keeps serving its previous + deployment until this one succeeds. A preview takes one deployment at a time, and one the function + runs, or keeps for a rollback, takes none. While the `functions.candidates` capability is + unavailable, including on the local development server, it answers `404` with code + `feature_unavailable`. + + A deployment builds like any deploy and spends the project's build minutes. + + Args: + id (UUID): + function_id (UUID): + candidate_id (UUID): + body (RedeployFunctionCandidateBody): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | FunctionCandidateDeployment] + """ + + + kwargs = request_kwargs( + id=id, +function_id=function_id, +candidate_id=candidate_id, +body=body, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + id: UUID | str, + function_id: UUID | str, + candidate_id: UUID | str, + *, + client: AuthenticatedClient, + body: RedeployFunctionCandidateBody, + +) -> Error | FunctionCandidateDeployment | None: + """ Deploy new source to a function preview + + Builds the uploaded source and deploys it to the preview, which keeps serving its previous + deployment until this one succeeds. A preview takes one deployment at a time, and one the function + runs, or keeps for a rollback, takes none. While the `functions.candidates` capability is + unavailable, including on the local development server, it answers `404` with code + `feature_unavailable`. + + A deployment builds like any deploy and spends the project's build minutes. + + Args: + id (UUID): + function_id (UUID): + candidate_id (UUID): + body (RedeployFunctionCandidateBody): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | FunctionCandidateDeployment + """ + + + return sync_detailed( + id=id, +function_id=function_id, +candidate_id=candidate_id, +client=client, +body=body, + + ).parsed + +async def asyncio_detailed( + id: UUID | str, + function_id: UUID | str, + candidate_id: UUID | str, + *, + client: AuthenticatedClient, + body: RedeployFunctionCandidateBody, + +) -> Response[Error | FunctionCandidateDeployment]: + """ Deploy new source to a function preview + + Builds the uploaded source and deploys it to the preview, which keeps serving its previous + deployment until this one succeeds. A preview takes one deployment at a time, and one the function + runs, or keeps for a rollback, takes none. While the `functions.candidates` capability is + unavailable, including on the local development server, it answers `404` with code + `feature_unavailable`. + + A deployment builds like any deploy and spends the project's build minutes. + + Args: + id (UUID): + function_id (UUID): + candidate_id (UUID): + body (RedeployFunctionCandidateBody): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | FunctionCandidateDeployment] + """ + + + kwargs = request_kwargs( + id=id, +function_id=function_id, +candidate_id=candidate_id, +body=body, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + id: UUID | str, + function_id: UUID | str, + candidate_id: UUID | str, + *, + client: AuthenticatedClient, + body: RedeployFunctionCandidateBody, + +) -> Error | FunctionCandidateDeployment | None: + """ Deploy new source to a function preview + + Builds the uploaded source and deploys it to the preview, which keeps serving its previous + deployment until this one succeeds. A preview takes one deployment at a time, and one the function + runs, or keeps for a rollback, takes none. While the `functions.candidates` capability is + unavailable, including on the local development server, it answers `404` with code + `feature_unavailable`. + + A deployment builds like any deploy and spends the project's build minutes. + + Args: + id (UUID): + function_id (UUID): + candidate_id (UUID): + body (RedeployFunctionCandidateBody): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | FunctionCandidateDeployment + """ + + + return (await asyncio_detailed( + id=id, +function_id=function_id, +candidate_id=candidate_id, +client=client, +body=body, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/functions/resolve_function_for_invocation.py b/src/volcano_sdk/_generated/api/functions/resolve_function_for_invocation.py index 72f69adc..e4deebab 100644 --- a/src/volcano_sdk/_generated/api/functions/resolve_function_for_invocation.py +++ b/src/volcano_sdk/_generated/api/functions/resolve_function_for_invocation.py @@ -105,9 +105,10 @@ def sync_detailed( 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`. + built from the API URL will not reach the function. In local development, and when the + deployment serves no public invocation domain, `invoke_url` is omitted and callers invoke + through `POST /functions/{functionId}/invoke`. A local function's own `invoke_url`, for + webhook testing, is on the function resource. **With Service Key**: - Allowed @@ -155,9 +156,10 @@ def sync( 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`. + built from the API URL will not reach the function. In local development, and when the + deployment serves no public invocation domain, `invoke_url` is omitted and callers invoke + through `POST /functions/{functionId}/invoke`. A local function's own `invoke_url`, for + webhook testing, is on the function resource. **With Service Key**: - Allowed @@ -200,9 +202,10 @@ async def asyncio_detailed( 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`. + built from the API URL will not reach the function. In local development, and when the + deployment serves no public invocation domain, `invoke_url` is omitted and callers invoke + through `POST /functions/{functionId}/invoke`. A local function's own `invoke_url`, for + webhook testing, is on the function resource. **With Service Key**: - Allowed @@ -250,9 +253,10 @@ async def asyncio( 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`. + built from the API URL will not reach the function. In local development, and when the + deployment serves no public invocation domain, `invoke_url` is omitted and callers invoke + through `POST /functions/{functionId}/invoke`. A local function's own `invoke_url`, for + webhook testing, is on the function resource. **With Service Key**: - Allowed diff --git a/src/volcano_sdk/_generated/api/functions/rollback_function_serving.py b/src/volcano_sdk/_generated/api/functions/rollback_function_serving.py new file mode 100644 index 00000000..4d96e798 --- /dev/null +++ b/src/volcano_sdk/_generated/api/functions/rollback_function_serving.py @@ -0,0 +1,295 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from ...models.function_rollback_request import FunctionRollbackRequest +from ...models.function_serving import FunctionServing +from typing import cast +from uuid import UUID + + + +def request_kwargs( + id: UUID | str, + function_id: UUID | str, + *, + body: FunctionRollbackRequest, + +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + + + + + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/projects/{id}/functions/{function_id}/serving/rollback".format(id=quote(str(id), safe=""),function_id=quote(str(function_id), safe=""),), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | FunctionServing | None: + if response.status_code == 200: + response_200 = FunctionServing.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 409: + response_409 = Error.from_dict(response.json()) + + + + return response_409 + + if response.status_code == 413: + response_413 = Error.from_dict(response.json()) + + + + return response_413 + + if response.status_code == 500: + response_500 = Error.from_dict(response.json()) + + + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | FunctionServing]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID | str, + function_id: UUID | str, + *, + client: AuthenticatedClient, + body: FunctionRollbackRequest, + +) -> Response[Error | FunctionServing]: + """ Roll back what a function runs + + Points the function's traffic back at what served it before its last promotion or rollback, or at + its own build with `to_production`. A rollback is a new activation, so what it leaves becomes what + a further rollback returns to, and it can itself be undone. Nothing is deployed, so it takes effect + at once. It names the `revision` the caller read; a competing activation makes it fail with `409`. + + Rolling back to a preview promotes it again and is refused with `409` when promoting it would be, + and with `404` code `feature_unavailable` while the capability is unavailable. Rolling back to the + function's own build is not: it never depends on the capability, the project's source mode, or a + running deployment of the function. + + Args: + id (UUID): + function_id (UUID): + body (FunctionRollbackRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | FunctionServing] + """ + + + kwargs = request_kwargs( + id=id, +function_id=function_id, +body=body, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + id: UUID | str, + function_id: UUID | str, + *, + client: AuthenticatedClient, + body: FunctionRollbackRequest, + +) -> Error | FunctionServing | None: + """ Roll back what a function runs + + Points the function's traffic back at what served it before its last promotion or rollback, or at + its own build with `to_production`. A rollback is a new activation, so what it leaves becomes what + a further rollback returns to, and it can itself be undone. Nothing is deployed, so it takes effect + at once. It names the `revision` the caller read; a competing activation makes it fail with `409`. + + Rolling back to a preview promotes it again and is refused with `409` when promoting it would be, + and with `404` code `feature_unavailable` while the capability is unavailable. Rolling back to the + function's own build is not: it never depends on the capability, the project's source mode, or a + running deployment of the function. + + Args: + id (UUID): + function_id (UUID): + body (FunctionRollbackRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | FunctionServing + """ + + + return sync_detailed( + id=id, +function_id=function_id, +client=client, +body=body, + + ).parsed + +async def asyncio_detailed( + id: UUID | str, + function_id: UUID | str, + *, + client: AuthenticatedClient, + body: FunctionRollbackRequest, + +) -> Response[Error | FunctionServing]: + """ Roll back what a function runs + + Points the function's traffic back at what served it before its last promotion or rollback, or at + its own build with `to_production`. A rollback is a new activation, so what it leaves becomes what + a further rollback returns to, and it can itself be undone. Nothing is deployed, so it takes effect + at once. It names the `revision` the caller read; a competing activation makes it fail with `409`. + + Rolling back to a preview promotes it again and is refused with `409` when promoting it would be, + and with `404` code `feature_unavailable` while the capability is unavailable. Rolling back to the + function's own build is not: it never depends on the capability, the project's source mode, or a + running deployment of the function. + + Args: + id (UUID): + function_id (UUID): + body (FunctionRollbackRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | FunctionServing] + """ + + + kwargs = request_kwargs( + id=id, +function_id=function_id, +body=body, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + id: UUID | str, + function_id: UUID | str, + *, + client: AuthenticatedClient, + body: FunctionRollbackRequest, + +) -> Error | FunctionServing | None: + """ Roll back what a function runs + + Points the function's traffic back at what served it before its last promotion or rollback, or at + its own build with `to_production`. A rollback is a new activation, so what it leaves becomes what + a further rollback returns to, and it can itself be undone. Nothing is deployed, so it takes effect + at once. It names the `revision` the caller read; a competing activation makes it fail with `409`. + + Rolling back to a preview promotes it again and is refused with `409` when promoting it would be, + and with `404` code `feature_unavailable` while the capability is unavailable. Rolling back to the + function's own build is not: it never depends on the capability, the project's source mode, or a + running deployment of the function. + + Args: + id (UUID): + function_id (UUID): + body (FunctionRollbackRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | FunctionServing + """ + + + return (await asyncio_detailed( + id=id, +function_id=function_id, +client=client, +body=body, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/git_connections/git_connect_callback.py b/src/volcano_sdk/_generated/api/git_connections/git_connect_callback.py index 99363251..640b3969 100644 --- a/src/volcano_sdk/_generated/api/git_connections/git_connect_callback.py +++ b/src/volcano_sdk/_generated/api/git_connections/git_connect_callback.py @@ -17,8 +17,10 @@ def request_kwargs( *, code: str | Unset = UNSET, - state: str, + state: str | Unset = UNSET, error: str | Unset = UNSET, + installation_id: str | Unset = UNSET, + setup_action: str | Unset = UNSET, ) -> dict[str, Any]: @@ -33,6 +35,10 @@ def request_kwargs( params["error"] = error + params["installation_id"] = installation_id + + params["setup_action"] = setup_action + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} @@ -49,6 +55,10 @@ def request_kwargs( def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | Error | None: + if response.status_code == 302: + response_302 = cast(Any, None) + return response_302 + if response.status_code == 303: response_303 = cast(Any, None) return response_303 @@ -100,8 +110,10 @@ def sync_detailed( *, client: AuthenticatedClient | Client, code: str | Unset = UNSET, - state: str, + state: str | Unset = UNSET, error: str | Unset = UNSET, + installation_id: str | Unset = UNSET, + setup_action: str | Unset = UNSET, ) -> Response[Any | Error]: """ Complete a GitHub App connection callback @@ -109,10 +121,22 @@ def sync_detailed( Public GitHub App callback. The signed state and callback binding cookie bind the provider authorization to the browser that started the flow. + GitHub also sends a browser here without `state` when someone installs + the App, changes its repository access, or asks an organization owner + to install it, on GitHub itself, including from the install page a + completed connection sends an account with no installation to. That + request connects nothing: Volcano + ignores `code` and `installation_id`, and redirects to the dashboard's + Git settings page when `setup_action` is `install`, `update`, or + `request`. Any other request without `state` returns 400. An empty or + invalid `state` is refused as before and never redirects there. + Args: code (str | Unset): - state (str): + state (str | Unset): error (str | Unset): + installation_id (str | Unset): + setup_action (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -127,6 +151,8 @@ def sync_detailed( code=code, state=state, error=error, +installation_id=installation_id, +setup_action=setup_action, ) @@ -140,8 +166,10 @@ def sync( *, client: AuthenticatedClient | Client, code: str | Unset = UNSET, - state: str, + state: str | Unset = UNSET, error: str | Unset = UNSET, + installation_id: str | Unset = UNSET, + setup_action: str | Unset = UNSET, ) -> Any | Error | None: """ Complete a GitHub App connection callback @@ -149,10 +177,22 @@ def sync( Public GitHub App callback. The signed state and callback binding cookie bind the provider authorization to the browser that started the flow. + GitHub also sends a browser here without `state` when someone installs + the App, changes its repository access, or asks an organization owner + to install it, on GitHub itself, including from the install page a + completed connection sends an account with no installation to. That + request connects nothing: Volcano + ignores `code` and `installation_id`, and redirects to the dashboard's + Git settings page when `setup_action` is `install`, `update`, or + `request`. Any other request without `state` returns 400. An empty or + invalid `state` is refused as before and never redirects there. + Args: code (str | Unset): - state (str): + state (str | Unset): error (str | Unset): + installation_id (str | Unset): + setup_action (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -168,6 +208,8 @@ def sync( code=code, state=state, error=error, +installation_id=installation_id, +setup_action=setup_action, ).parsed @@ -175,8 +217,10 @@ async def asyncio_detailed( *, client: AuthenticatedClient | Client, code: str | Unset = UNSET, - state: str, + state: str | Unset = UNSET, error: str | Unset = UNSET, + installation_id: str | Unset = UNSET, + setup_action: str | Unset = UNSET, ) -> Response[Any | Error]: """ Complete a GitHub App connection callback @@ -184,10 +228,22 @@ async def asyncio_detailed( Public GitHub App callback. The signed state and callback binding cookie bind the provider authorization to the browser that started the flow. + GitHub also sends a browser here without `state` when someone installs + the App, changes its repository access, or asks an organization owner + to install it, on GitHub itself, including from the install page a + completed connection sends an account with no installation to. That + request connects nothing: Volcano + ignores `code` and `installation_id`, and redirects to the dashboard's + Git settings page when `setup_action` is `install`, `update`, or + `request`. Any other request without `state` returns 400. An empty or + invalid `state` is refused as before and never redirects there. + Args: code (str | Unset): - state (str): + state (str | Unset): error (str | Unset): + installation_id (str | Unset): + setup_action (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -202,6 +258,8 @@ async def asyncio_detailed( code=code, state=state, error=error, +installation_id=installation_id, +setup_action=setup_action, ) @@ -215,8 +273,10 @@ async def asyncio( *, client: AuthenticatedClient | Client, code: str | Unset = UNSET, - state: str, + state: str | Unset = UNSET, error: str | Unset = UNSET, + installation_id: str | Unset = UNSET, + setup_action: str | Unset = UNSET, ) -> Any | Error | None: """ Complete a GitHub App connection callback @@ -224,10 +284,22 @@ async def asyncio( Public GitHub App callback. The signed state and callback binding cookie bind the provider authorization to the browser that started the flow. + GitHub also sends a browser here without `state` when someone installs + the App, changes its repository access, or asks an organization owner + to install it, on GitHub itself, including from the install page a + completed connection sends an account with no installation to. That + request connects nothing: Volcano + ignores `code` and `installation_id`, and redirects to the dashboard's + Git settings page when `setup_action` is `install`, `update`, or + `request`. Any other request without `state` returns 400. An empty or + invalid `state` is refused as before and never redirects there. + Args: code (str | Unset): - state (str): + state (str | Unset): error (str | Unset): + installation_id (str | Unset): + setup_action (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -243,5 +315,7 @@ async def asyncio( code=code, state=state, error=error, +installation_id=installation_id, +setup_action=setup_action, )).parsed diff --git a/src/volcano_sdk/_generated/api/git_connections/start_git_connect.py b/src/volcano_sdk/_generated/api/git_connections/start_git_connect.py index 8c98181f..3abca7e3 100644 --- a/src/volcano_sdk/_generated/api/git_connections/start_git_connect.py +++ b/src/volcano_sdk/_generated/api/git_connections/start_git_connect.py @@ -117,9 +117,14 @@ def sync_detailed( """ Start a git provider connection Starts a first-party dashboard user's git provider connection flow and - returns the provider authorization URL. The response also sets a - short-lived HttpOnly callback binding cookie tied to the authenticated - user through the signed provider state. + returns the provider authorization URL. For a user with no GitHub + connection, or one whose expired token GitHub refuses to refresh, it is + GitHub's authorization page for the Volcano App; a connection whose + account reaches no installation of the App then continues to the App's + install page. For a user with a working connection, it is the App's + install page, where they change the App's access. The response also + sets a short-lived HttpOnly callback binding cookie tied to the + authenticated user through the signed provider state. Args: provider (StartGitConnectProvider | Unset): Default: 'github'. @@ -159,9 +164,14 @@ def sync( """ Start a git provider connection Starts a first-party dashboard user's git provider connection flow and - returns the provider authorization URL. The response also sets a - short-lived HttpOnly callback binding cookie tied to the authenticated - user through the signed provider state. + returns the provider authorization URL. For a user with no GitHub + connection, or one whose expired token GitHub refuses to refresh, it is + GitHub's authorization page for the Volcano App; a connection whose + account reaches no installation of the App then continues to the App's + install page. For a user with a working connection, it is the App's + install page, where they change the App's access. The response also + sets a short-lived HttpOnly callback binding cookie tied to the + authenticated user through the signed provider state. Args: provider (StartGitConnectProvider | Unset): Default: 'github'. @@ -196,9 +206,14 @@ async def asyncio_detailed( """ Start a git provider connection Starts a first-party dashboard user's git provider connection flow and - returns the provider authorization URL. The response also sets a - short-lived HttpOnly callback binding cookie tied to the authenticated - user through the signed provider state. + returns the provider authorization URL. For a user with no GitHub + connection, or one whose expired token GitHub refuses to refresh, it is + GitHub's authorization page for the Volcano App; a connection whose + account reaches no installation of the App then continues to the App's + install page. For a user with a working connection, it is the App's + install page, where they change the App's access. The response also + sets a short-lived HttpOnly callback binding cookie tied to the + authenticated user through the signed provider state. Args: provider (StartGitConnectProvider | Unset): Default: 'github'. @@ -238,9 +253,14 @@ async def asyncio( """ Start a git provider connection Starts a first-party dashboard user's git provider connection flow and - returns the provider authorization URL. The response also sets a - short-lived HttpOnly callback binding cookie tied to the authenticated - user through the signed provider state. + returns the provider authorization URL. For a user with no GitHub + connection, or one whose expired token GitHub refuses to refresh, it is + GitHub's authorization page for the Volcano App; a connection whose + account reaches no installation of the App then continues to the App's + install page. For a user with a working connection, it is the App's + install page, where they change the App's access. The response also + sets a short-lived HttpOnly callback binding cookie tied to the + authenticated user through the signed provider state. Args: provider (StartGitConnectProvider | Unset): Default: 'github'. diff --git a/src/volcano_sdk/_generated/api/issues/create_issue.py b/src/volcano_sdk/_generated/api/issues/create_issue.py new file mode 100644 index 00000000..ec120d6f --- /dev/null +++ b/src/volcano_sdk/_generated/api/issues/create_issue.py @@ -0,0 +1,345 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.create_issue_request import CreateIssueRequest +from ...models.error import Error +from ...models.issue import Issue +from typing import cast + + + +def request_kwargs( + *, + body: CreateIssueRequest, + +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + + + + + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/issues", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | Issue | None: + if response.status_code == 201: + response_201 = Issue.from_dict(response.json()) + + + + return response_201 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 409: + response_409 = Error.from_dict(response.json()) + + + + return response_409 + + if response.status_code == 413: + response_413 = Error.from_dict(response.json()) + + + + return response_413 + + if response.status_code == 429: + response_429 = Error.from_dict(response.json()) + + + + return response_429 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | Issue]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: CreateIssueRequest, + +) -> Response[Error | Issue]: + """ Create an issue + + Records an issue you write on the project `project_id` names: a + description of what to fix, in your words, and optionally a title. The + issue has `source` `request`, the + project as its resource, and status `open`. With LavaFlow on, LavaFlow + starts a run on it by itself, as on a new error: the run follows the + project's LavaFlow settings and counts toward the run limits. Follow + it with `GET /lavaflow/runs?project_id=…&issue_id=…`. Where none + starts, as with LavaFlow off, start one with `POST /lavaflow/runs`. + + Supply `start_run_idempotency_key` to queue the run and save the original + prompt in the same operation. A successful response includes + `initial_run_id`. Retrying with the same key and prompt returns the same + issue and run. Reusing the key for another prompt returns 409. If + admission refuses the run, the operation creates neither issue nor run. + + The issue counts toward the project's 1,000 open issues, with runtime, + build and reported issues; at that limit it is refused with code + `open_issue_limit_reached`. Resolve or ignore issues to make room. + + Only the project's owner can create an issue, as a person: with + `volcano login`, a live Volcano dashboard sign-in, or a platform token + that expires. A full-scope project access + token, MCP and a never-expiring platform token are refused with code + `person_required`, as starting a run is, and a read-only project access + token or account with an uncoded `403`, because creating one starts a + run, which sends the description to an AI service with the project's + source. A project access token is refused before its `project_id` is + looked up. List, read and update the issue under + `/projects/{id}/issues`. + + Args: + body (CreateIssueRequest): The project, and an issue a person writes on it, describing + what to fix. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | Issue] + """ + + + kwargs = request_kwargs( + body=body, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient, + body: CreateIssueRequest, + +) -> Error | Issue | None: + """ Create an issue + + Records an issue you write on the project `project_id` names: a + description of what to fix, in your words, and optionally a title. The + issue has `source` `request`, the + project as its resource, and status `open`. With LavaFlow on, LavaFlow + starts a run on it by itself, as on a new error: the run follows the + project's LavaFlow settings and counts toward the run limits. Follow + it with `GET /lavaflow/runs?project_id=…&issue_id=…`. Where none + starts, as with LavaFlow off, start one with `POST /lavaflow/runs`. + + Supply `start_run_idempotency_key` to queue the run and save the original + prompt in the same operation. A successful response includes + `initial_run_id`. Retrying with the same key and prompt returns the same + issue and run. Reusing the key for another prompt returns 409. If + admission refuses the run, the operation creates neither issue nor run. + + The issue counts toward the project's 1,000 open issues, with runtime, + build and reported issues; at that limit it is refused with code + `open_issue_limit_reached`. Resolve or ignore issues to make room. + + Only the project's owner can create an issue, as a person: with + `volcano login`, a live Volcano dashboard sign-in, or a platform token + that expires. A full-scope project access + token, MCP and a never-expiring platform token are refused with code + `person_required`, as starting a run is, and a read-only project access + token or account with an uncoded `403`, because creating one starts a + run, which sends the description to an AI service with the project's + source. A project access token is refused before its `project_id` is + looked up. List, read and update the issue under + `/projects/{id}/issues`. + + Args: + body (CreateIssueRequest): The project, and an issue a person writes on it, describing + what to fix. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | Issue + """ + + + return sync_detailed( + client=client, +body=body, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: CreateIssueRequest, + +) -> Response[Error | Issue]: + """ Create an issue + + Records an issue you write on the project `project_id` names: a + description of what to fix, in your words, and optionally a title. The + issue has `source` `request`, the + project as its resource, and status `open`. With LavaFlow on, LavaFlow + starts a run on it by itself, as on a new error: the run follows the + project's LavaFlow settings and counts toward the run limits. Follow + it with `GET /lavaflow/runs?project_id=…&issue_id=…`. Where none + starts, as with LavaFlow off, start one with `POST /lavaflow/runs`. + + Supply `start_run_idempotency_key` to queue the run and save the original + prompt in the same operation. A successful response includes + `initial_run_id`. Retrying with the same key and prompt returns the same + issue and run. Reusing the key for another prompt returns 409. If + admission refuses the run, the operation creates neither issue nor run. + + The issue counts toward the project's 1,000 open issues, with runtime, + build and reported issues; at that limit it is refused with code + `open_issue_limit_reached`. Resolve or ignore issues to make room. + + Only the project's owner can create an issue, as a person: with + `volcano login`, a live Volcano dashboard sign-in, or a platform token + that expires. A full-scope project access + token, MCP and a never-expiring platform token are refused with code + `person_required`, as starting a run is, and a read-only project access + token or account with an uncoded `403`, because creating one starts a + run, which sends the description to an AI service with the project's + source. A project access token is refused before its `project_id` is + looked up. List, read and update the issue under + `/projects/{id}/issues`. + + Args: + body (CreateIssueRequest): The project, and an issue a person writes on it, describing + what to fix. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | Issue] + """ + + + kwargs = request_kwargs( + body=body, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient, + body: CreateIssueRequest, + +) -> Error | Issue | None: + """ Create an issue + + Records an issue you write on the project `project_id` names: a + description of what to fix, in your words, and optionally a title. The + issue has `source` `request`, the + project as its resource, and status `open`. With LavaFlow on, LavaFlow + starts a run on it by itself, as on a new error: the run follows the + project's LavaFlow settings and counts toward the run limits. Follow + it with `GET /lavaflow/runs?project_id=…&issue_id=…`. Where none + starts, as with LavaFlow off, start one with `POST /lavaflow/runs`. + + Supply `start_run_idempotency_key` to queue the run and save the original + prompt in the same operation. A successful response includes + `initial_run_id`. Retrying with the same key and prompt returns the same + issue and run. Reusing the key for another prompt returns 409. If + admission refuses the run, the operation creates neither issue nor run. + + The issue counts toward the project's 1,000 open issues, with runtime, + build and reported issues; at that limit it is refused with code + `open_issue_limit_reached`. Resolve or ignore issues to make room. + + Only the project's owner can create an issue, as a person: with + `volcano login`, a live Volcano dashboard sign-in, or a platform token + that expires. A full-scope project access + token, MCP and a never-expiring platform token are refused with code + `person_required`, as starting a run is, and a read-only project access + token or account with an uncoded `403`, because creating one starts a + run, which sends the description to an AI service with the project's + source. A project access token is refused before its `project_id` is + looked up. List, read and update the issue under + `/projects/{id}/issues`. + + Args: + body (CreateIssueRequest): The project, and an issue a person writes on it, describing + what to fix. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | Issue + """ + + + return (await asyncio_detailed( + client=client, +body=body, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/issues/list_issues.py b/src/volcano_sdk/_generated/api/issues/list_issues.py index cdfbeef0..e7a9ca29 100644 --- a/src/volcano_sdk/_generated/api/issues/list_issues.py +++ b/src/volcano_sdk/_generated/api/issues/list_issues.py @@ -9,6 +9,8 @@ from ... import errors from ...models.error import Error +from ...models.issue_source import check_issue_source +from ...models.issue_source import IssueSource from ...models.issue_status import check_issue_status from ...models.issue_status import IssueStatus from ...models.paginated_issues import PaginatedIssues @@ -25,6 +27,7 @@ def request_kwargs( cursor: str | Unset = UNSET, status: IssueStatus | Unset = UNSET, resource_id: UUID | str | Unset = UNSET, + source: IssueSource | Unset = UNSET, ) -> dict[str, Any]: @@ -48,6 +51,12 @@ def request_kwargs( json_resource_id = str(resource_id) params["resource_id"] = json_resource_id + json_source: str | Unset = UNSET + if not isinstance(source, Unset): + json_source = source + + params["source"] = json_source + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} @@ -108,13 +117,17 @@ def sync_detailed( cursor: str | Unset = UNSET, status: IssueStatus | Unset = UNSET, resource_id: UUID | str | Unset = UNSET, + source: IssueSource | Unset = UNSET, ) -> Response[Error | PaginatedIssues]: """ List issues Lists the project's issues, most recently seen first. An issue groups the runtime errors one function or frontend raised with the same error - type and stack, or the same message when there is no stack. + type and stack, or the same message when there is no stack; the + deploys of one function or frontend whose own build failed with the + same first error (`source` `build`); or one Code Quality finding or + reported problem, or one issue a person wrote (`source` `request`). Project access tokens can list issues, including read-only ones. @@ -124,8 +137,16 @@ def sync_detailed( cursor (str | Unset): status (IssueStatus | Unset): `open` until someone resolves or ignores the issue. A resolved issue - seen again reopens. + seen again reopens. A reported problem resolves when its LavaFlow fix + merges. Volcano ignores one whose report it deleted before any fix + merged, so it no longer counts toward the project's open issues. resource_id (UUID | Unset): + source (IssueSource | Unset): Where the issue came from: `runtime` for errors your code + logged, `code_quality` for a LavaFlow Code Quality finding in code a deploy changed, + `build` for deploys of one function or frontend that failed in its own build step, + `report` for a problem reported for the project, such as through Slack, or `request` for + an issue a person wrote with `POST /issues`. A later deploy that builds resolves a `build` + issue. Deploys Volcano failed, such as a timeout or a refused build, never make one. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -142,6 +163,7 @@ def sync_detailed( cursor=cursor, status=status, resource_id=resource_id, +source=source, ) @@ -159,13 +181,17 @@ def sync( cursor: str | Unset = UNSET, status: IssueStatus | Unset = UNSET, resource_id: UUID | str | Unset = UNSET, + source: IssueSource | Unset = UNSET, ) -> Error | PaginatedIssues | None: """ List issues Lists the project's issues, most recently seen first. An issue groups the runtime errors one function or frontend raised with the same error - type and stack, or the same message when there is no stack. + type and stack, or the same message when there is no stack; the + deploys of one function or frontend whose own build failed with the + same first error (`source` `build`); or one Code Quality finding or + reported problem, or one issue a person wrote (`source` `request`). Project access tokens can list issues, including read-only ones. @@ -175,8 +201,16 @@ def sync( cursor (str | Unset): status (IssueStatus | Unset): `open` until someone resolves or ignores the issue. A resolved issue - seen again reopens. + seen again reopens. A reported problem resolves when its LavaFlow fix + merges. Volcano ignores one whose report it deleted before any fix + merged, so it no longer counts toward the project's open issues. resource_id (UUID | Unset): + source (IssueSource | Unset): Where the issue came from: `runtime` for errors your code + logged, `code_quality` for a LavaFlow Code Quality finding in code a deploy changed, + `build` for deploys of one function or frontend that failed in its own build step, + `report` for a problem reported for the project, such as through Slack, or `request` for + an issue a person wrote with `POST /issues`. A later deploy that builds resolves a `build` + issue. Deploys Volcano failed, such as a timeout or a refused build, never make one. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -194,6 +228,7 @@ def sync( cursor=cursor, status=status, resource_id=resource_id, +source=source, ).parsed @@ -205,13 +240,17 @@ async def asyncio_detailed( cursor: str | Unset = UNSET, status: IssueStatus | Unset = UNSET, resource_id: UUID | str | Unset = UNSET, + source: IssueSource | Unset = UNSET, ) -> Response[Error | PaginatedIssues]: """ List issues Lists the project's issues, most recently seen first. An issue groups the runtime errors one function or frontend raised with the same error - type and stack, or the same message when there is no stack. + type and stack, or the same message when there is no stack; the + deploys of one function or frontend whose own build failed with the + same first error (`source` `build`); or one Code Quality finding or + reported problem, or one issue a person wrote (`source` `request`). Project access tokens can list issues, including read-only ones. @@ -221,8 +260,16 @@ async def asyncio_detailed( cursor (str | Unset): status (IssueStatus | Unset): `open` until someone resolves or ignores the issue. A resolved issue - seen again reopens. + seen again reopens. A reported problem resolves when its LavaFlow fix + merges. Volcano ignores one whose report it deleted before any fix + merged, so it no longer counts toward the project's open issues. resource_id (UUID | Unset): + source (IssueSource | Unset): Where the issue came from: `runtime` for errors your code + logged, `code_quality` for a LavaFlow Code Quality finding in code a deploy changed, + `build` for deploys of one function or frontend that failed in its own build step, + `report` for a problem reported for the project, such as through Slack, or `request` for + an issue a person wrote with `POST /issues`. A later deploy that builds resolves a `build` + issue. Deploys Volcano failed, such as a timeout or a refused build, never make one. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -239,6 +286,7 @@ async def asyncio_detailed( cursor=cursor, status=status, resource_id=resource_id, +source=source, ) @@ -256,13 +304,17 @@ async def asyncio( cursor: str | Unset = UNSET, status: IssueStatus | Unset = UNSET, resource_id: UUID | str | Unset = UNSET, + source: IssueSource | Unset = UNSET, ) -> Error | PaginatedIssues | None: """ List issues Lists the project's issues, most recently seen first. An issue groups the runtime errors one function or frontend raised with the same error - type and stack, or the same message when there is no stack. + type and stack, or the same message when there is no stack; the + deploys of one function or frontend whose own build failed with the + same first error (`source` `build`); or one Code Quality finding or + reported problem, or one issue a person wrote (`source` `request`). Project access tokens can list issues, including read-only ones. @@ -272,8 +324,16 @@ async def asyncio( cursor (str | Unset): status (IssueStatus | Unset): `open` until someone resolves or ignores the issue. A resolved issue - seen again reopens. + seen again reopens. A reported problem resolves when its LavaFlow fix + merges. Volcano ignores one whose report it deleted before any fix + merged, so it no longer counts toward the project's open issues. resource_id (UUID | Unset): + source (IssueSource | Unset): Where the issue came from: `runtime` for errors your code + logged, `code_quality` for a LavaFlow Code Quality finding in code a deploy changed, + `build` for deploys of one function or frontend that failed in its own build step, + `report` for a problem reported for the project, such as through Slack, or `request` for + an issue a person wrote with `POST /issues`. A later deploy that builds resolves a `build` + issue. Deploys Volcano failed, such as a timeout or a refused build, never make one. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -291,5 +351,6 @@ async def asyncio( cursor=cursor, status=status, resource_id=resource_id, +source=source, )).parsed diff --git a/src/volcano_sdk/_generated/api/lava_flow/__init__.py b/src/volcano_sdk/_generated/api/lava_flow/__init__.py new file mode 100644 index 00000000..c9921b5f --- /dev/null +++ b/src/volcano_sdk/_generated/api/lava_flow/__init__.py @@ -0,0 +1 @@ +""" Contains endpoint functions for accessing the API """ diff --git a/src/volcano_sdk/_generated/api/lava_flow/create_lavaflow_connector_binding.py b/src/volcano_sdk/_generated/api/lava_flow/create_lavaflow_connector_binding.py new file mode 100644 index 00000000..4acaebd0 --- /dev/null +++ b/src/volcano_sdk/_generated/api/lava_flow/create_lavaflow_connector_binding.py @@ -0,0 +1,345 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from ...models.lavaflow_connector_binding import LavaflowConnectorBinding +from typing import cast + + + +def request_kwargs( + *, + body: Any, + +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + + + + + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/lavaflow/connector-bindings", + } + + + _kwargs["json"] = body + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | LavaflowConnectorBinding | None: + if response.status_code == 200: + response_200 = LavaflowConnectorBinding.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 201: + response_201 = LavaflowConnectorBinding.from_dict(response.json()) + + + + return response_201 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 502: + response_502 = Error.from_dict(response.json()) + + + + return response_502 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | LavaflowConnectorBinding]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: Any, + +) -> Response[Error | LavaflowConnectorBinding]: + """ Bind a connector to the project + + Binds a place in a connector to the project, so problems reported + there reach LavaFlow for it, and answers `201`. Send `slack` for a + `slack` connector and `aikido` for an `aikido` one. For a `slack` + connector the place is a channel. Binding a channel that is already + bound answers `200` with that binding, and makes the current owner the + one who bound it, so a retry is safe. One of the Slack identities the + caller's sign-in session signed in as must belong to the connector's + workspace and be a member of the channel, so on an account several + people share, each binds only channels they are in. The channel must + be one the picker (`GET /user/slack/channels`) lists: not archived, a + Slack Connect channel, or shared across an organization. The Volcano + app joins a public channel it is not in yet, and stays in it if the + binding then fails; a private channel needs the app invited first. + + For an `aikido` connector the place is the workspace's new code + (SAST) issues on the project's GitHub repository, at or above + `min_severity`. The caller must have + connected the workspace. Binding it again answers `200` and sets the + new minimum. Each issue starts a LavaFlow run that stops at a pull + request for review. + + Only the project's owner can bind, with a platform token or a live + dashboard sign-in session. A session must come from the dashboard's + own configured project; another project's session gets `403`. A project + access token, or a request made through MCP, gets `403` with code + `person_required`. Binding a Slack channel needs the project's + `lavaflow.slack` capability, and binding Aikido its + `lavaflow.aikido` capability: where it is unavailable, this answers + `404` with code `feature_unavailable`, or `403` with code + `plan_required` when the owner's plan does not include LavaFlow. + + Args: + body (Any): Send exactly one of `slack` and `aikido`, matching the connector's type. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | LavaflowConnectorBinding] + """ + + + kwargs = request_kwargs( + body=body, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient, + body: Any, + +) -> Error | LavaflowConnectorBinding | None: + """ Bind a connector to the project + + Binds a place in a connector to the project, so problems reported + there reach LavaFlow for it, and answers `201`. Send `slack` for a + `slack` connector and `aikido` for an `aikido` one. For a `slack` + connector the place is a channel. Binding a channel that is already + bound answers `200` with that binding, and makes the current owner the + one who bound it, so a retry is safe. One of the Slack identities the + caller's sign-in session signed in as must belong to the connector's + workspace and be a member of the channel, so on an account several + people share, each binds only channels they are in. The channel must + be one the picker (`GET /user/slack/channels`) lists: not archived, a + Slack Connect channel, or shared across an organization. The Volcano + app joins a public channel it is not in yet, and stays in it if the + binding then fails; a private channel needs the app invited first. + + For an `aikido` connector the place is the workspace's new code + (SAST) issues on the project's GitHub repository, at or above + `min_severity`. The caller must have + connected the workspace. Binding it again answers `200` and sets the + new minimum. Each issue starts a LavaFlow run that stops at a pull + request for review. + + Only the project's owner can bind, with a platform token or a live + dashboard sign-in session. A session must come from the dashboard's + own configured project; another project's session gets `403`. A project + access token, or a request made through MCP, gets `403` with code + `person_required`. Binding a Slack channel needs the project's + `lavaflow.slack` capability, and binding Aikido its + `lavaflow.aikido` capability: where it is unavailable, this answers + `404` with code `feature_unavailable`, or `403` with code + `plan_required` when the owner's plan does not include LavaFlow. + + Args: + body (Any): Send exactly one of `slack` and `aikido`, matching the connector's type. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | LavaflowConnectorBinding + """ + + + return sync_detailed( + client=client, +body=body, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: Any, + +) -> Response[Error | LavaflowConnectorBinding]: + """ Bind a connector to the project + + Binds a place in a connector to the project, so problems reported + there reach LavaFlow for it, and answers `201`. Send `slack` for a + `slack` connector and `aikido` for an `aikido` one. For a `slack` + connector the place is a channel. Binding a channel that is already + bound answers `200` with that binding, and makes the current owner the + one who bound it, so a retry is safe. One of the Slack identities the + caller's sign-in session signed in as must belong to the connector's + workspace and be a member of the channel, so on an account several + people share, each binds only channels they are in. The channel must + be one the picker (`GET /user/slack/channels`) lists: not archived, a + Slack Connect channel, or shared across an organization. The Volcano + app joins a public channel it is not in yet, and stays in it if the + binding then fails; a private channel needs the app invited first. + + For an `aikido` connector the place is the workspace's new code + (SAST) issues on the project's GitHub repository, at or above + `min_severity`. The caller must have + connected the workspace. Binding it again answers `200` and sets the + new minimum. Each issue starts a LavaFlow run that stops at a pull + request for review. + + Only the project's owner can bind, with a platform token or a live + dashboard sign-in session. A session must come from the dashboard's + own configured project; another project's session gets `403`. A project + access token, or a request made through MCP, gets `403` with code + `person_required`. Binding a Slack channel needs the project's + `lavaflow.slack` capability, and binding Aikido its + `lavaflow.aikido` capability: where it is unavailable, this answers + `404` with code `feature_unavailable`, or `403` with code + `plan_required` when the owner's plan does not include LavaFlow. + + Args: + body (Any): Send exactly one of `slack` and `aikido`, matching the connector's type. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | LavaflowConnectorBinding] + """ + + + kwargs = request_kwargs( + body=body, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient, + body: Any, + +) -> Error | LavaflowConnectorBinding | None: + """ Bind a connector to the project + + Binds a place in a connector to the project, so problems reported + there reach LavaFlow for it, and answers `201`. Send `slack` for a + `slack` connector and `aikido` for an `aikido` one. For a `slack` + connector the place is a channel. Binding a channel that is already + bound answers `200` with that binding, and makes the current owner the + one who bound it, so a retry is safe. One of the Slack identities the + caller's sign-in session signed in as must belong to the connector's + workspace and be a member of the channel, so on an account several + people share, each binds only channels they are in. The channel must + be one the picker (`GET /user/slack/channels`) lists: not archived, a + Slack Connect channel, or shared across an organization. The Volcano + app joins a public channel it is not in yet, and stays in it if the + binding then fails; a private channel needs the app invited first. + + For an `aikido` connector the place is the workspace's new code + (SAST) issues on the project's GitHub repository, at or above + `min_severity`. The caller must have + connected the workspace. Binding it again answers `200` and sets the + new minimum. Each issue starts a LavaFlow run that stops at a pull + request for review. + + Only the project's owner can bind, with a platform token or a live + dashboard sign-in session. A session must come from the dashboard's + own configured project; another project's session gets `403`. A project + access token, or a request made through MCP, gets `403` with code + `person_required`. Binding a Slack channel needs the project's + `lavaflow.slack` capability, and binding Aikido its + `lavaflow.aikido` capability: where it is unavailable, this answers + `404` with code `feature_unavailable`, or `403` with code + `plan_required` when the owner's plan does not include LavaFlow. + + Args: + body (Any): Send exactly one of `slack` and `aikido`, matching the connector's type. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | LavaflowConnectorBinding + """ + + + return (await asyncio_detailed( + client=client, +body=body, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/lava_flow/create_lavaflow_held_fix_open.py b/src/volcano_sdk/_generated/api/lava_flow/create_lavaflow_held_fix_open.py new file mode 100644 index 00000000..124818e0 --- /dev/null +++ b/src/volcano_sdk/_generated/api/lava_flow/create_lavaflow_held_fix_open.py @@ -0,0 +1,403 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from ...models.lavaflow_held_fix_open import LavaflowHeldFixOpen +from ...models.lavaflow_run import LavaflowRun +from typing import cast + + + +def request_kwargs( + *, + body: LavaflowHeldFixOpen, + +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + + + + + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/lavaflow/held-fix-opens", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | LavaflowRun | None: + if response.status_code == 202: + response_202 = LavaflowRun.from_dict(response.json()) + + + + return response_202 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 409: + response_409 = Error.from_dict(response.json()) + + + + return response_409 + + if response.status_code == 413: + response_413 = Error.from_dict(response.json()) + + + + return response_413 + + if response.status_code == 429: + response_429 = Error.from_dict(response.json()) + + + + return response_429 + + if response.status_code == 503: + response_503 = Error.from_dict(response.json()) + + + + return response_503 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | LavaflowRun]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: LavaflowHeldFixOpen, + +) -> Response[Error | LavaflowRun]: + """ Open a held LavaFlow fix + + Opens the pull request for a fix LavaFlow held because the + repository's workflows could run it with the repository's secrets + before a person approves it (`pull_request_skipped: + ungated_workflows`). Read the run first: send its `id` as `run_id`, + with the `diff_sha256` and `held_workflows.jobs_sha256` it served, to + say you read that diff and that list of jobs. LavaFlow opens the fix it + saved, exactly as reviewed, past those jobs only. It writes no new + fix. + + Right before it queues the run, LavaFlow serves the diff again and + reads the workflows again. A diff served differently since you read + it, or a job list or a commit the workflows were read at that changed, + answers `409` with code `run_changed`; read the run again, which lists + what LavaFlow found. The response is the run, `202` while it is + `queued`. LavaFlow reads the workflows again before it opens the pull + request, and once more as it pushes the fix: a job you didn't read, a + new commit on a branch the workflows were read on, even one that + changes no job, or a production branch other than the one you read + them on holds the fix again with a new list. + + Opening a fix lets its pull request open, nothing more. LavaFlow + starts no CI on it and never merges it, as for every fix opened past + ungated workflows; a person pushes to the branch or merges it. The + pull request's description names who opened it and lists the jobs. + One exception: when LavaFlow's read before the pull request opens + finds no job that runs the fix before a person approves it, because + the workflows were gated since you read them, the fix opens as any + other fix and follows the project's merge settings. A run whose + `held_workflows` lists no job opens the same way. + + Only the project's owner can open a fix, as a person, while their + account is active: with a `volcano login` token + whose sign-in is live, or a platform token that expires. Their GitHub + account must be able to push to the project's repository. A project + access token, a request made through MCP, a platform token that never + expires, and a sign-in that ended get `403` with code + `person_required`. Opening a fix uses one of the run's attempts: the + attempt that opens it is one of the run's, so a run held again on its + last attempt can't be opened again. It starts no new run and counts + toward no run limit. + + Args: + body (LavaflowHeldFixOpen): The project, the run, and the diff and jobs of the held fix + you read, by the digests the run served them with. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | LavaflowRun] + """ + + + kwargs = request_kwargs( + body=body, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient, + body: LavaflowHeldFixOpen, + +) -> Error | LavaflowRun | None: + """ Open a held LavaFlow fix + + Opens the pull request for a fix LavaFlow held because the + repository's workflows could run it with the repository's secrets + before a person approves it (`pull_request_skipped: + ungated_workflows`). Read the run first: send its `id` as `run_id`, + with the `diff_sha256` and `held_workflows.jobs_sha256` it served, to + say you read that diff and that list of jobs. LavaFlow opens the fix it + saved, exactly as reviewed, past those jobs only. It writes no new + fix. + + Right before it queues the run, LavaFlow serves the diff again and + reads the workflows again. A diff served differently since you read + it, or a job list or a commit the workflows were read at that changed, + answers `409` with code `run_changed`; read the run again, which lists + what LavaFlow found. The response is the run, `202` while it is + `queued`. LavaFlow reads the workflows again before it opens the pull + request, and once more as it pushes the fix: a job you didn't read, a + new commit on a branch the workflows were read on, even one that + changes no job, or a production branch other than the one you read + them on holds the fix again with a new list. + + Opening a fix lets its pull request open, nothing more. LavaFlow + starts no CI on it and never merges it, as for every fix opened past + ungated workflows; a person pushes to the branch or merges it. The + pull request's description names who opened it and lists the jobs. + One exception: when LavaFlow's read before the pull request opens + finds no job that runs the fix before a person approves it, because + the workflows were gated since you read them, the fix opens as any + other fix and follows the project's merge settings. A run whose + `held_workflows` lists no job opens the same way. + + Only the project's owner can open a fix, as a person, while their + account is active: with a `volcano login` token + whose sign-in is live, or a platform token that expires. Their GitHub + account must be able to push to the project's repository. A project + access token, a request made through MCP, a platform token that never + expires, and a sign-in that ended get `403` with code + `person_required`. Opening a fix uses one of the run's attempts: the + attempt that opens it is one of the run's, so a run held again on its + last attempt can't be opened again. It starts no new run and counts + toward no run limit. + + Args: + body (LavaflowHeldFixOpen): The project, the run, and the diff and jobs of the held fix + you read, by the digests the run served them with. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | LavaflowRun + """ + + + return sync_detailed( + client=client, +body=body, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: LavaflowHeldFixOpen, + +) -> Response[Error | LavaflowRun]: + """ Open a held LavaFlow fix + + Opens the pull request for a fix LavaFlow held because the + repository's workflows could run it with the repository's secrets + before a person approves it (`pull_request_skipped: + ungated_workflows`). Read the run first: send its `id` as `run_id`, + with the `diff_sha256` and `held_workflows.jobs_sha256` it served, to + say you read that diff and that list of jobs. LavaFlow opens the fix it + saved, exactly as reviewed, past those jobs only. It writes no new + fix. + + Right before it queues the run, LavaFlow serves the diff again and + reads the workflows again. A diff served differently since you read + it, or a job list or a commit the workflows were read at that changed, + answers `409` with code `run_changed`; read the run again, which lists + what LavaFlow found. The response is the run, `202` while it is + `queued`. LavaFlow reads the workflows again before it opens the pull + request, and once more as it pushes the fix: a job you didn't read, a + new commit on a branch the workflows were read on, even one that + changes no job, or a production branch other than the one you read + them on holds the fix again with a new list. + + Opening a fix lets its pull request open, nothing more. LavaFlow + starts no CI on it and never merges it, as for every fix opened past + ungated workflows; a person pushes to the branch or merges it. The + pull request's description names who opened it and lists the jobs. + One exception: when LavaFlow's read before the pull request opens + finds no job that runs the fix before a person approves it, because + the workflows were gated since you read them, the fix opens as any + other fix and follows the project's merge settings. A run whose + `held_workflows` lists no job opens the same way. + + Only the project's owner can open a fix, as a person, while their + account is active: with a `volcano login` token + whose sign-in is live, or a platform token that expires. Their GitHub + account must be able to push to the project's repository. A project + access token, a request made through MCP, a platform token that never + expires, and a sign-in that ended get `403` with code + `person_required`. Opening a fix uses one of the run's attempts: the + attempt that opens it is one of the run's, so a run held again on its + last attempt can't be opened again. It starts no new run and counts + toward no run limit. + + Args: + body (LavaflowHeldFixOpen): The project, the run, and the diff and jobs of the held fix + you read, by the digests the run served them with. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | LavaflowRun] + """ + + + kwargs = request_kwargs( + body=body, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient, + body: LavaflowHeldFixOpen, + +) -> Error | LavaflowRun | None: + """ Open a held LavaFlow fix + + Opens the pull request for a fix LavaFlow held because the + repository's workflows could run it with the repository's secrets + before a person approves it (`pull_request_skipped: + ungated_workflows`). Read the run first: send its `id` as `run_id`, + with the `diff_sha256` and `held_workflows.jobs_sha256` it served, to + say you read that diff and that list of jobs. LavaFlow opens the fix it + saved, exactly as reviewed, past those jobs only. It writes no new + fix. + + Right before it queues the run, LavaFlow serves the diff again and + reads the workflows again. A diff served differently since you read + it, or a job list or a commit the workflows were read at that changed, + answers `409` with code `run_changed`; read the run again, which lists + what LavaFlow found. The response is the run, `202` while it is + `queued`. LavaFlow reads the workflows again before it opens the pull + request, and once more as it pushes the fix: a job you didn't read, a + new commit on a branch the workflows were read on, even one that + changes no job, or a production branch other than the one you read + them on holds the fix again with a new list. + + Opening a fix lets its pull request open, nothing more. LavaFlow + starts no CI on it and never merges it, as for every fix opened past + ungated workflows; a person pushes to the branch or merges it. The + pull request's description names who opened it and lists the jobs. + One exception: when LavaFlow's read before the pull request opens + finds no job that runs the fix before a person approves it, because + the workflows were gated since you read them, the fix opens as any + other fix and follows the project's merge settings. A run whose + `held_workflows` lists no job opens the same way. + + Only the project's owner can open a fix, as a person, while their + account is active: with a `volcano login` token + whose sign-in is live, or a platform token that expires. Their GitHub + account must be able to push to the project's repository. A project + access token, a request made through MCP, a platform token that never + expires, and a sign-in that ended get `403` with code + `person_required`. Opening a fix uses one of the run's attempts: the + attempt that opens it is one of the run's, so a run held again on its + last attempt can't be opened again. It starts no new run and counts + toward no run limit. + + Args: + body (LavaflowHeldFixOpen): The project, the run, and the diff and jobs of the held fix + you read, by the digests the run served them with. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | LavaflowRun + """ + + + return (await asyncio_detailed( + client=client, +body=body, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/lava_flow/create_lavaflow_issue_prompt.py b/src/volcano_sdk/_generated/api/lava_flow/create_lavaflow_issue_prompt.py new file mode 100644 index 00000000..6f81aff4 --- /dev/null +++ b/src/volcano_sdk/_generated/api/lava_flow/create_lavaflow_issue_prompt.py @@ -0,0 +1,234 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from ...models.lavaflow_issue_prompt_create import LavaflowIssuePromptCreate +from ...models.lavaflow_issue_prompts import LavaflowIssuePrompts +from typing import cast + + + +def request_kwargs( + *, + body: LavaflowIssuePromptCreate, + +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + + + + + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/lavaflow/issue-prompts", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | LavaflowIssuePrompts | None: + if response.status_code == 201: + response_201 = LavaflowIssuePrompts.from_dict(response.json()) + + + + return response_201 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 409: + response_409 = Error.from_dict(response.json()) + + + + return response_409 + + if response.status_code == 429: + response_429 = Error.from_dict(response.json()) + + + + return response_429 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | LavaflowIssuePrompts]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: LavaflowIssuePromptCreate, + +) -> Response[Error | LavaflowIssuePrompts]: + """ Send a follow-up on a written issue + + Adds a message to the issue. LavaFlow picks it up while working, uses it + to update an open pull request, or starts work again. The conversation + closes when the pull request merges. Use the version you read to guard + against submitting the same message twice. + + Args: + body (LavaflowIssuePromptCreate): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | LavaflowIssuePrompts] + """ + + + kwargs = request_kwargs( + body=body, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient, + body: LavaflowIssuePromptCreate, + +) -> Error | LavaflowIssuePrompts | None: + """ Send a follow-up on a written issue + + Adds a message to the issue. LavaFlow picks it up while working, uses it + to update an open pull request, or starts work again. The conversation + closes when the pull request merges. Use the version you read to guard + against submitting the same message twice. + + Args: + body (LavaflowIssuePromptCreate): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | LavaflowIssuePrompts + """ + + + return sync_detailed( + client=client, +body=body, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: LavaflowIssuePromptCreate, + +) -> Response[Error | LavaflowIssuePrompts]: + """ Send a follow-up on a written issue + + Adds a message to the issue. LavaFlow picks it up while working, uses it + to update an open pull request, or starts work again. The conversation + closes when the pull request merges. Use the version you read to guard + against submitting the same message twice. + + Args: + body (LavaflowIssuePromptCreate): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | LavaflowIssuePrompts] + """ + + + kwargs = request_kwargs( + body=body, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient, + body: LavaflowIssuePromptCreate, + +) -> Error | LavaflowIssuePrompts | None: + """ Send a follow-up on a written issue + + Adds a message to the issue. LavaFlow picks it up while working, uses it + to update an open pull request, or starts work again. The conversation + closes when the pull request merges. Use the version you read to guard + against submitting the same message twice. + + Args: + body (LavaflowIssuePromptCreate): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | LavaflowIssuePrompts + """ + + + return (await asyncio_detailed( + client=client, +body=body, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/lava_flow/create_lavaflow_run.py b/src/volcano_sdk/_generated/api/lava_flow/create_lavaflow_run.py new file mode 100644 index 00000000..76f03b6f --- /dev/null +++ b/src/volcano_sdk/_generated/api/lava_flow/create_lavaflow_run.py @@ -0,0 +1,328 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from ...models.lavaflow_run import LavaflowRun +from ...models.lavaflow_run_create import LavaflowRunCreate +from typing import cast + + + +def request_kwargs( + *, + body: LavaflowRunCreate, + +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + + + + + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/lavaflow/runs", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | LavaflowRun | None: + if response.status_code == 202: + response_202 = LavaflowRun.from_dict(response.json()) + + + + return response_202 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 409: + response_409 = Error.from_dict(response.json()) + + + + return response_409 + + if response.status_code == 413: + response_413 = Error.from_dict(response.json()) + + + + return response_413 + + if response.status_code == 429: + response_429 = Error.from_dict(response.json()) + + + + return response_429 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | LavaflowRun]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: LavaflowRunCreate, + +) -> Response[Error | LavaflowRun]: + """ Start a LavaFlow run + + Starts a run on one of the project's issues. LavaFlow starts runs on + its own only for issues with `exception: true`, and only while it is + on. Start one here for any other issue, or for one recorded before + LavaFlow was turned on. The run follows the project's settings, as + one LavaFlow starts on its own does, and answers `202` while it is + `queued`; read it with `GET /lavaflow/runs/{run_id}`. + + Only the project's owner can start a run, as a person, while their + account is active: with a platform token that expires, `volcano + login`, or a live Volcano dashboard sign-in. A platform token that + never expires, a `volcano login` token + whose sign-in ended, a full-scope project access token, and a request + made through MCP get `403` with code `person_required`; a read-only + project access token is refused as read-only first, without a code, + and so is the owner of a read-only account. + + Every start counts toward the run limits: 5 runs per issue and 200 per + project in any 24 hours. An issue has one run in progress at a time, + so sending the request again while the first run is in progress + answers `409` with code `lavaflow_run_in_progress`. + + A run on a Code Quality issue is a Code Quality run. It starts only + while Code Quality is available to the project, as + `lavaflow.code_quality` in `GET /capabilities` reports, and on for it. + + Args: + body (LavaflowRunCreate): The project, and the issue to start a run on. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | LavaflowRun] + """ + + + kwargs = request_kwargs( + body=body, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient, + body: LavaflowRunCreate, + +) -> Error | LavaflowRun | None: + """ Start a LavaFlow run + + Starts a run on one of the project's issues. LavaFlow starts runs on + its own only for issues with `exception: true`, and only while it is + on. Start one here for any other issue, or for one recorded before + LavaFlow was turned on. The run follows the project's settings, as + one LavaFlow starts on its own does, and answers `202` while it is + `queued`; read it with `GET /lavaflow/runs/{run_id}`. + + Only the project's owner can start a run, as a person, while their + account is active: with a platform token that expires, `volcano + login`, or a live Volcano dashboard sign-in. A platform token that + never expires, a `volcano login` token + whose sign-in ended, a full-scope project access token, and a request + made through MCP get `403` with code `person_required`; a read-only + project access token is refused as read-only first, without a code, + and so is the owner of a read-only account. + + Every start counts toward the run limits: 5 runs per issue and 200 per + project in any 24 hours. An issue has one run in progress at a time, + so sending the request again while the first run is in progress + answers `409` with code `lavaflow_run_in_progress`. + + A run on a Code Quality issue is a Code Quality run. It starts only + while Code Quality is available to the project, as + `lavaflow.code_quality` in `GET /capabilities` reports, and on for it. + + Args: + body (LavaflowRunCreate): The project, and the issue to start a run on. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | LavaflowRun + """ + + + return sync_detailed( + client=client, +body=body, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: LavaflowRunCreate, + +) -> Response[Error | LavaflowRun]: + """ Start a LavaFlow run + + Starts a run on one of the project's issues. LavaFlow starts runs on + its own only for issues with `exception: true`, and only while it is + on. Start one here for any other issue, or for one recorded before + LavaFlow was turned on. The run follows the project's settings, as + one LavaFlow starts on its own does, and answers `202` while it is + `queued`; read it with `GET /lavaflow/runs/{run_id}`. + + Only the project's owner can start a run, as a person, while their + account is active: with a platform token that expires, `volcano + login`, or a live Volcano dashboard sign-in. A platform token that + never expires, a `volcano login` token + whose sign-in ended, a full-scope project access token, and a request + made through MCP get `403` with code `person_required`; a read-only + project access token is refused as read-only first, without a code, + and so is the owner of a read-only account. + + Every start counts toward the run limits: 5 runs per issue and 200 per + project in any 24 hours. An issue has one run in progress at a time, + so sending the request again while the first run is in progress + answers `409` with code `lavaflow_run_in_progress`. + + A run on a Code Quality issue is a Code Quality run. It starts only + while Code Quality is available to the project, as + `lavaflow.code_quality` in `GET /capabilities` reports, and on for it. + + Args: + body (LavaflowRunCreate): The project, and the issue to start a run on. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | LavaflowRun] + """ + + + kwargs = request_kwargs( + body=body, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient, + body: LavaflowRunCreate, + +) -> Error | LavaflowRun | None: + """ Start a LavaFlow run + + Starts a run on one of the project's issues. LavaFlow starts runs on + its own only for issues with `exception: true`, and only while it is + on. Start one here for any other issue, or for one recorded before + LavaFlow was turned on. The run follows the project's settings, as + one LavaFlow starts on its own does, and answers `202` while it is + `queued`; read it with `GET /lavaflow/runs/{run_id}`. + + Only the project's owner can start a run, as a person, while their + account is active: with a platform token that expires, `volcano + login`, or a live Volcano dashboard sign-in. A platform token that + never expires, a `volcano login` token + whose sign-in ended, a full-scope project access token, and a request + made through MCP get `403` with code `person_required`; a read-only + project access token is refused as read-only first, without a code, + and so is the owner of a read-only account. + + Every start counts toward the run limits: 5 runs per issue and 200 per + project in any 24 hours. An issue has one run in progress at a time, + so sending the request again while the first run is in progress + answers `409` with code `lavaflow_run_in_progress`. + + A run on a Code Quality issue is a Code Quality run. It starts only + while Code Quality is available to the project, as + `lavaflow.code_quality` in `GET /capabilities` reports, and on for it. + + Args: + body (LavaflowRunCreate): The project, and the issue to start a run on. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | LavaflowRun + """ + + + return (await asyncio_detailed( + client=client, +body=body, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/lava_flow/delete_lavaflow_connector_binding.py b/src/volcano_sdk/_generated/api/lava_flow/delete_lavaflow_connector_binding.py new file mode 100644 index 00000000..4da73a1c --- /dev/null +++ b/src/volcano_sdk/_generated/api/lava_flow/delete_lavaflow_connector_binding.py @@ -0,0 +1,258 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from ...types import UNSET, Unset +from typing import cast +from uuid import UUID + + + +def request_kwargs( + binding_id: UUID | str, + *, + project_id: UUID | str | Unset = UNSET, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + json_project_id: str | Unset = UNSET + if not isinstance(project_id, Unset): + json_project_id = str(project_id) + params["project_id"] = json_project_id + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/lavaflow/connector-bindings/{binding_id}".format(binding_id=quote(str(binding_id), safe=""),), + "params": params, + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | Error | None: + if response.status_code == 204: + response_204 = cast(Any, None) + return response_204 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any | Error]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + binding_id: UUID | str, + *, + client: AuthenticatedClient, + project_id: UUID | str | Unset = UNSET, + +) -> Response[Any | Error]: + """ Remove a connector binding + + Stops a bound place, such as a Slack channel or an Aikido workspace, + reporting problems for its project. Reports from it still queued are canceled at their next + check. The binding's own project authorizes the request. Only the + project's owner can remove one, with a platform token. A project + access token or MCP gets `403` with code `person_required` for a + binding of its own project, and `404` for another project's, as for an + unknown one. Removing works whether or not the project's + `lavaflow.slack` capability is available. + + Args: + binding_id (UUID): + project_id (UUID | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | Error] + """ + + + kwargs = request_kwargs( + binding_id=binding_id, +project_id=project_id, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + binding_id: UUID | str, + *, + client: AuthenticatedClient, + project_id: UUID | str | Unset = UNSET, + +) -> Any | Error | None: + """ Remove a connector binding + + Stops a bound place, such as a Slack channel or an Aikido workspace, + reporting problems for its project. Reports from it still queued are canceled at their next + check. The binding's own project authorizes the request. Only the + project's owner can remove one, with a platform token. A project + access token or MCP gets `403` with code `person_required` for a + binding of its own project, and `404` for another project's, as for an + unknown one. Removing works whether or not the project's + `lavaflow.slack` capability is available. + + Args: + binding_id (UUID): + project_id (UUID | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | Error + """ + + + return sync_detailed( + binding_id=binding_id, +client=client, +project_id=project_id, + + ).parsed + +async def asyncio_detailed( + binding_id: UUID | str, + *, + client: AuthenticatedClient, + project_id: UUID | str | Unset = UNSET, + +) -> Response[Any | Error]: + """ Remove a connector binding + + Stops a bound place, such as a Slack channel or an Aikido workspace, + reporting problems for its project. Reports from it still queued are canceled at their next + check. The binding's own project authorizes the request. Only the + project's owner can remove one, with a platform token. A project + access token or MCP gets `403` with code `person_required` for a + binding of its own project, and `404` for another project's, as for an + unknown one. Removing works whether or not the project's + `lavaflow.slack` capability is available. + + Args: + binding_id (UUID): + project_id (UUID | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | Error] + """ + + + kwargs = request_kwargs( + binding_id=binding_id, +project_id=project_id, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + binding_id: UUID | str, + *, + client: AuthenticatedClient, + project_id: UUID | str | Unset = UNSET, + +) -> Any | Error | None: + """ Remove a connector binding + + Stops a bound place, such as a Slack channel or an Aikido workspace, + reporting problems for its project. Reports from it still queued are canceled at their next + check. The binding's own project authorizes the request. Only the + project's owner can remove one, with a platform token. A project + access token or MCP gets `403` with code `person_required` for a + binding of its own project, and `404` for another project's, as for an + unknown one. Removing works whether or not the project's + `lavaflow.slack` capability is available. + + Args: + binding_id (UUID): + project_id (UUID | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | Error + """ + + + return (await asyncio_detailed( + binding_id=binding_id, +client=client, +project_id=project_id, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/lava_flow/get_lavaflow_run.py b/src/volcano_sdk/_generated/api/lava_flow/get_lavaflow_run.py new file mode 100644 index 00000000..a78d6f5b --- /dev/null +++ b/src/volcano_sdk/_generated/api/lava_flow/get_lavaflow_run.py @@ -0,0 +1,278 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from ...models.lavaflow_run import LavaflowRun +from ...types import UNSET, Unset +from typing import cast +from uuid import UUID + + + +def request_kwargs( + run_id: UUID | str, + *, + project_id: UUID | str | Unset = UNSET, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + json_project_id: str | Unset = UNSET + if not isinstance(project_id, Unset): + json_project_id = str(project_id) + params["project_id"] = json_project_id + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/lavaflow/runs/{run_id}".format(run_id=quote(str(run_id), safe=""),), + "params": params, + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | LavaflowRun | None: + if response.status_code == 200: + response_200 = LavaflowRun.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | LavaflowRun]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + run_id: UUID | str, + *, + client: AuthenticatedClient, + project_id: UUID | str | Unset = UNSET, + +) -> Response[Error | LavaflowRun]: + """ Get a LavaFlow run + + Returns a run, with its diagnosis, the log lines it cites, its diff, + its review, including the findings the review left open and what it + asks a person to decide, and whether the repository's own checks + passed when LavaFlow ran them on the fix, with the commands they ran. + The run's project authorizes the read, so `project_id` is optional. + The text holds the project's logs and source code, so this endpoint + takes the same access as the project's log endpoints. + + A run held because the repository's workflows could run its fix with + the repository's secrets before a person approves it + (`pull_request_skipped: ungated_workflows`) lists every such job in + `held_workflows`, beside the fix's `diff` and `diff_sha256`. + + Args: + run_id (UUID): + project_id (UUID | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | LavaflowRun] + """ + + + kwargs = request_kwargs( + run_id=run_id, +project_id=project_id, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + run_id: UUID | str, + *, + client: AuthenticatedClient, + project_id: UUID | str | Unset = UNSET, + +) -> Error | LavaflowRun | None: + """ Get a LavaFlow run + + Returns a run, with its diagnosis, the log lines it cites, its diff, + its review, including the findings the review left open and what it + asks a person to decide, and whether the repository's own checks + passed when LavaFlow ran them on the fix, with the commands they ran. + The run's project authorizes the read, so `project_id` is optional. + The text holds the project's logs and source code, so this endpoint + takes the same access as the project's log endpoints. + + A run held because the repository's workflows could run its fix with + the repository's secrets before a person approves it + (`pull_request_skipped: ungated_workflows`) lists every such job in + `held_workflows`, beside the fix's `diff` and `diff_sha256`. + + Args: + run_id (UUID): + project_id (UUID | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | LavaflowRun + """ + + + return sync_detailed( + run_id=run_id, +client=client, +project_id=project_id, + + ).parsed + +async def asyncio_detailed( + run_id: UUID | str, + *, + client: AuthenticatedClient, + project_id: UUID | str | Unset = UNSET, + +) -> Response[Error | LavaflowRun]: + """ Get a LavaFlow run + + Returns a run, with its diagnosis, the log lines it cites, its diff, + its review, including the findings the review left open and what it + asks a person to decide, and whether the repository's own checks + passed when LavaFlow ran them on the fix, with the commands they ran. + The run's project authorizes the read, so `project_id` is optional. + The text holds the project's logs and source code, so this endpoint + takes the same access as the project's log endpoints. + + A run held because the repository's workflows could run its fix with + the repository's secrets before a person approves it + (`pull_request_skipped: ungated_workflows`) lists every such job in + `held_workflows`, beside the fix's `diff` and `diff_sha256`. + + Args: + run_id (UUID): + project_id (UUID | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | LavaflowRun] + """ + + + kwargs = request_kwargs( + run_id=run_id, +project_id=project_id, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + run_id: UUID | str, + *, + client: AuthenticatedClient, + project_id: UUID | str | Unset = UNSET, + +) -> Error | LavaflowRun | None: + """ Get a LavaFlow run + + Returns a run, with its diagnosis, the log lines it cites, its diff, + its review, including the findings the review left open and what it + asks a person to decide, and whether the repository's own checks + passed when LavaFlow ran them on the fix, with the commands they ran. + The run's project authorizes the read, so `project_id` is optional. + The text holds the project's logs and source code, so this endpoint + takes the same access as the project's log endpoints. + + A run held because the repository's workflows could run its fix with + the repository's secrets before a person approves it + (`pull_request_skipped: ungated_workflows`) lists every such job in + `held_workflows`, beside the fix's `diff` and `diff_sha256`. + + Args: + run_id (UUID): + project_id (UUID | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | LavaflowRun + """ + + + return (await asyncio_detailed( + run_id=run_id, +client=client, +project_id=project_id, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/lava_flow/get_lavaflow_settings.py b/src/volcano_sdk/_generated/api/lava_flow/get_lavaflow_settings.py new file mode 100644 index 00000000..52d4047c --- /dev/null +++ b/src/volcano_sdk/_generated/api/lava_flow/get_lavaflow_settings.py @@ -0,0 +1,254 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from ...models.lavaflow_settings import LavaflowSettings +from typing import cast +from uuid import UUID + + + +def request_kwargs( + *, + project_id: UUID | str, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + json_project_id = str(project_id) + params["project_id"] = json_project_id + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/lavaflow/settings", + "params": params, + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | LavaflowSettings | None: + if response.status_code == 200: + response_200 = LavaflowSettings.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | LavaflowSettings]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + project_id: UUID | str, + +) -> Response[Error | LavaflowSettings]: + """ Get LavaFlow settings + + Returns whether LavaFlow works on the project's issues and how far it + goes on its own. LavaFlow takes project guidance from the repository's + AGENTS.md and CLAUDE.md, not from a setting. A project + that never saved settings returns the defaults, with LavaFlow off. + LavaFlow sends this project's logs and source code to an AI service + that Volcano operates. + + `can_update` says whether the caller can save the settings: only the + project's owner can, with a platform token. Project access tokens can + read the settings, including read-only ones. + + Args: + project_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | LavaflowSettings] + """ + + + kwargs = request_kwargs( + project_id=project_id, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient, + project_id: UUID | str, + +) -> Error | LavaflowSettings | None: + """ Get LavaFlow settings + + Returns whether LavaFlow works on the project's issues and how far it + goes on its own. LavaFlow takes project guidance from the repository's + AGENTS.md and CLAUDE.md, not from a setting. A project + that never saved settings returns the defaults, with LavaFlow off. + LavaFlow sends this project's logs and source code to an AI service + that Volcano operates. + + `can_update` says whether the caller can save the settings: only the + project's owner can, with a platform token. Project access tokens can + read the settings, including read-only ones. + + Args: + project_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | LavaflowSettings + """ + + + return sync_detailed( + client=client, +project_id=project_id, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + project_id: UUID | str, + +) -> Response[Error | LavaflowSettings]: + """ Get LavaFlow settings + + Returns whether LavaFlow works on the project's issues and how far it + goes on its own. LavaFlow takes project guidance from the repository's + AGENTS.md and CLAUDE.md, not from a setting. A project + that never saved settings returns the defaults, with LavaFlow off. + LavaFlow sends this project's logs and source code to an AI service + that Volcano operates. + + `can_update` says whether the caller can save the settings: only the + project's owner can, with a platform token. Project access tokens can + read the settings, including read-only ones. + + Args: + project_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | LavaflowSettings] + """ + + + kwargs = request_kwargs( + project_id=project_id, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient, + project_id: UUID | str, + +) -> Error | LavaflowSettings | None: + """ Get LavaFlow settings + + Returns whether LavaFlow works on the project's issues and how far it + goes on its own. LavaFlow takes project guidance from the repository's + AGENTS.md and CLAUDE.md, not from a setting. A project + that never saved settings returns the defaults, with LavaFlow off. + LavaFlow sends this project's logs and source code to an AI service + that Volcano operates. + + `can_update` says whether the caller can save the settings: only the + project's owner can, with a platform token. Project access tokens can + read the settings, including read-only ones. + + Args: + project_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | LavaflowSettings + """ + + + return (await asyncio_detailed( + client=client, +project_id=project_id, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/lava_flow/get_lavaflow_stats.py b/src/volcano_sdk/_generated/api/lava_flow/get_lavaflow_stats.py new file mode 100644 index 00000000..0317a9c4 --- /dev/null +++ b/src/volcano_sdk/_generated/api/lava_flow/get_lavaflow_stats.py @@ -0,0 +1,331 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from ...models.get_lavaflow_stats_category import check_get_lavaflow_stats_category +from ...models.get_lavaflow_stats_category import GetLavaflowStatsCategory +from ...models.lavaflow_stats import LavaflowStats +from ...types import UNSET, Unset +from typing import cast +from uuid import UUID + + + +def request_kwargs( + *, + project_id: UUID | str, + days: int | Unset = 30, + category: GetLavaflowStatsCategory | Unset = UNSET, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + json_project_id = str(project_id) + params["project_id"] = json_project_id + + params["days"] = days + + json_category: str | Unset = UNSET + if not isinstance(category, Unset): + json_category = category + + params["category"] = json_category + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/lavaflow/stats", + "params": params, + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | LavaflowStats | None: + if response.status_code == 200: + response_200 = LavaflowStats.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | LavaflowStats]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + project_id: UUID | str, + days: int | Unset = 30, + category: GetLavaflowStatsCategory | Unset = UNSET, + +) -> Response[Error | LavaflowStats]: + """ Get LavaFlow stats + + The activity counts report issues LavaFlow took on and pull requests it + opened per UTC day, oldest first, with every day in the window present. + Merges do not count toward these activity fields. The window ends + today, which is partial. The activity `totals` equal the sum of the + activity `days` and of the per-resource counts from + `GET /lavaflow/resources` for the same project, `days` and `category`. + + `category` filters these activity counts to runs in that category. + Activity counts measure issues taken on and pull requests opened, + while `GET /lavaflow/runs` counts runs, so the two need not match. + + The optional `outcomes` object separately reports confirmed merges, + improvements observed live and actual automatic issue-resolution + episodes. `category` filters its merge and live counts; its primary + issue-resolution count includes every category. Outcome counts use + their own event dates and do not contribute to the activity totals. + Older servers omit `outcomes`; its absence means unavailable, not + zero. Null outcome counts mean unknown, not zero. Read the per-metric + coverage alongside the counts: partial coverage and retained + confirmations do not establish a complete total. + + Args: + project_id (UUID): + days (int | Unset): Default: 30. + category (GetLavaflowStatsCategory | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | LavaflowStats] + """ + + + kwargs = request_kwargs( + project_id=project_id, +days=days, +category=category, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient, + project_id: UUID | str, + days: int | Unset = 30, + category: GetLavaflowStatsCategory | Unset = UNSET, + +) -> Error | LavaflowStats | None: + """ Get LavaFlow stats + + The activity counts report issues LavaFlow took on and pull requests it + opened per UTC day, oldest first, with every day in the window present. + Merges do not count toward these activity fields. The window ends + today, which is partial. The activity `totals` equal the sum of the + activity `days` and of the per-resource counts from + `GET /lavaflow/resources` for the same project, `days` and `category`. + + `category` filters these activity counts to runs in that category. + Activity counts measure issues taken on and pull requests opened, + while `GET /lavaflow/runs` counts runs, so the two need not match. + + The optional `outcomes` object separately reports confirmed merges, + improvements observed live and actual automatic issue-resolution + episodes. `category` filters its merge and live counts; its primary + issue-resolution count includes every category. Outcome counts use + their own event dates and do not contribute to the activity totals. + Older servers omit `outcomes`; its absence means unavailable, not + zero. Null outcome counts mean unknown, not zero. Read the per-metric + coverage alongside the counts: partial coverage and retained + confirmations do not establish a complete total. + + Args: + project_id (UUID): + days (int | Unset): Default: 30. + category (GetLavaflowStatsCategory | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | LavaflowStats + """ + + + return sync_detailed( + client=client, +project_id=project_id, +days=days, +category=category, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + project_id: UUID | str, + days: int | Unset = 30, + category: GetLavaflowStatsCategory | Unset = UNSET, + +) -> Response[Error | LavaflowStats]: + """ Get LavaFlow stats + + The activity counts report issues LavaFlow took on and pull requests it + opened per UTC day, oldest first, with every day in the window present. + Merges do not count toward these activity fields. The window ends + today, which is partial. The activity `totals` equal the sum of the + activity `days` and of the per-resource counts from + `GET /lavaflow/resources` for the same project, `days` and `category`. + + `category` filters these activity counts to runs in that category. + Activity counts measure issues taken on and pull requests opened, + while `GET /lavaflow/runs` counts runs, so the two need not match. + + The optional `outcomes` object separately reports confirmed merges, + improvements observed live and actual automatic issue-resolution + episodes. `category` filters its merge and live counts; its primary + issue-resolution count includes every category. Outcome counts use + their own event dates and do not contribute to the activity totals. + Older servers omit `outcomes`; its absence means unavailable, not + zero. Null outcome counts mean unknown, not zero. Read the per-metric + coverage alongside the counts: partial coverage and retained + confirmations do not establish a complete total. + + Args: + project_id (UUID): + days (int | Unset): Default: 30. + category (GetLavaflowStatsCategory | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | LavaflowStats] + """ + + + kwargs = request_kwargs( + project_id=project_id, +days=days, +category=category, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient, + project_id: UUID | str, + days: int | Unset = 30, + category: GetLavaflowStatsCategory | Unset = UNSET, + +) -> Error | LavaflowStats | None: + """ Get LavaFlow stats + + The activity counts report issues LavaFlow took on and pull requests it + opened per UTC day, oldest first, with every day in the window present. + Merges do not count toward these activity fields. The window ends + today, which is partial. The activity `totals` equal the sum of the + activity `days` and of the per-resource counts from + `GET /lavaflow/resources` for the same project, `days` and `category`. + + `category` filters these activity counts to runs in that category. + Activity counts measure issues taken on and pull requests opened, + while `GET /lavaflow/runs` counts runs, so the two need not match. + + The optional `outcomes` object separately reports confirmed merges, + improvements observed live and actual automatic issue-resolution + episodes. `category` filters its merge and live counts; its primary + issue-resolution count includes every category. Outcome counts use + their own event dates and do not contribute to the activity totals. + Older servers omit `outcomes`; its absence means unavailable, not + zero. Null outcome counts mean unknown, not zero. Read the per-metric + coverage alongside the counts: partial coverage and retained + confirmations do not establish a complete total. + + Args: + project_id (UUID): + days (int | Unset): Default: 30. + category (GetLavaflowStatsCategory | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | LavaflowStats + """ + + + return (await asyncio_detailed( + client=client, +project_id=project_id, +days=days, +category=category, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/lava_flow/list_lavaflow_connector_bindings.py b/src/volcano_sdk/_generated/api/lava_flow/list_lavaflow_connector_bindings.py new file mode 100644 index 00000000..9350fa28 --- /dev/null +++ b/src/volcano_sdk/_generated/api/lava_flow/list_lavaflow_connector_bindings.py @@ -0,0 +1,235 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from ...models.lavaflow_connector_bindings_response import LavaflowConnectorBindingsResponse +from typing import cast +from uuid import UUID + + + +def request_kwargs( + *, + project_id: UUID | str, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + json_project_id = str(project_id) + params["project_id"] = json_project_id + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/lavaflow/connector-bindings", + "params": params, + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | LavaflowConnectorBindingsResponse | None: + if response.status_code == 200: + response_200 = LavaflowConnectorBindingsResponse.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | LavaflowConnectorBindingsResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + project_id: UUID | str, + +) -> Response[Error | LavaflowConnectorBindingsResponse]: + """ List the project's connector bindings + + Lists where problems are reported to LavaFlow from for the project, + such as Slack channels. In a bound Slack channel, someone whose Slack + identity is connected to the project owner's account can mention the + Volcano app to report a problem. Project access tokens can read the + list, including read-only ones, and so can MCP, as + `get_lavaflow_connector_bindings`. The list answers whether or not the + project's `lavaflow.slack` capability is available. + + Args: + project_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | LavaflowConnectorBindingsResponse] + """ + + + kwargs = request_kwargs( + project_id=project_id, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient, + project_id: UUID | str, + +) -> Error | LavaflowConnectorBindingsResponse | None: + """ List the project's connector bindings + + Lists where problems are reported to LavaFlow from for the project, + such as Slack channels. In a bound Slack channel, someone whose Slack + identity is connected to the project owner's account can mention the + Volcano app to report a problem. Project access tokens can read the + list, including read-only ones, and so can MCP, as + `get_lavaflow_connector_bindings`. The list answers whether or not the + project's `lavaflow.slack` capability is available. + + Args: + project_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | LavaflowConnectorBindingsResponse + """ + + + return sync_detailed( + client=client, +project_id=project_id, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + project_id: UUID | str, + +) -> Response[Error | LavaflowConnectorBindingsResponse]: + """ List the project's connector bindings + + Lists where problems are reported to LavaFlow from for the project, + such as Slack channels. In a bound Slack channel, someone whose Slack + identity is connected to the project owner's account can mention the + Volcano app to report a problem. Project access tokens can read the + list, including read-only ones, and so can MCP, as + `get_lavaflow_connector_bindings`. The list answers whether or not the + project's `lavaflow.slack` capability is available. + + Args: + project_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | LavaflowConnectorBindingsResponse] + """ + + + kwargs = request_kwargs( + project_id=project_id, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient, + project_id: UUID | str, + +) -> Error | LavaflowConnectorBindingsResponse | None: + """ List the project's connector bindings + + Lists where problems are reported to LavaFlow from for the project, + such as Slack channels. In a bound Slack channel, someone whose Slack + identity is connected to the project owner's account can mention the + Volcano app to report a problem. Project access tokens can read the + list, including read-only ones, and so can MCP, as + `get_lavaflow_connector_bindings`. The list answers whether or not the + project's `lavaflow.slack` capability is available. + + Args: + project_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | LavaflowConnectorBindingsResponse + """ + + + return (await asyncio_detailed( + client=client, +project_id=project_id, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/lava_flow/list_lavaflow_issue_prompts.py b/src/volcano_sdk/_generated/api/lava_flow/list_lavaflow_issue_prompts.py new file mode 100644 index 00000000..0be2a882 --- /dev/null +++ b/src/volcano_sdk/_generated/api/lava_flow/list_lavaflow_issue_prompts.py @@ -0,0 +1,236 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from ...models.lavaflow_issue_prompts import LavaflowIssuePrompts +from ...types import UNSET, Unset +from typing import cast +from uuid import UUID + + + +def request_kwargs( + *, + project_id: UUID | str, + issue_id: UUID | str, + after_sequence: int | Unset = UNSET, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + json_project_id = str(project_id) + params["project_id"] = json_project_id + + json_issue_id = str(issue_id) + params["issue_id"] = json_issue_id + + params["after_sequence"] = after_sequence + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/lavaflow/issue-prompts", + "params": params, + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | LavaflowIssuePrompts | None: + if response.status_code == 200: + response_200 = LavaflowIssuePrompts.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | LavaflowIssuePrompts]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + project_id: UUID | str, + issue_id: UUID | str, + after_sequence: int | Unset = UNSET, + +) -> Response[Error | LavaflowIssuePrompts]: + """ Read a written issue's prompt history + + Reads prompts for a written issue, oldest first, with secrets masked. + + Args: + project_id (UUID): + issue_id (UUID): + after_sequence (int | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | LavaflowIssuePrompts] + """ + + + kwargs = request_kwargs( + project_id=project_id, +issue_id=issue_id, +after_sequence=after_sequence, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient, + project_id: UUID | str, + issue_id: UUID | str, + after_sequence: int | Unset = UNSET, + +) -> Error | LavaflowIssuePrompts | None: + """ Read a written issue's prompt history + + Reads prompts for a written issue, oldest first, with secrets masked. + + Args: + project_id (UUID): + issue_id (UUID): + after_sequence (int | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | LavaflowIssuePrompts + """ + + + return sync_detailed( + client=client, +project_id=project_id, +issue_id=issue_id, +after_sequence=after_sequence, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + project_id: UUID | str, + issue_id: UUID | str, + after_sequence: int | Unset = UNSET, + +) -> Response[Error | LavaflowIssuePrompts]: + """ Read a written issue's prompt history + + Reads prompts for a written issue, oldest first, with secrets masked. + + Args: + project_id (UUID): + issue_id (UUID): + after_sequence (int | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | LavaflowIssuePrompts] + """ + + + kwargs = request_kwargs( + project_id=project_id, +issue_id=issue_id, +after_sequence=after_sequence, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient, + project_id: UUID | str, + issue_id: UUID | str, + after_sequence: int | Unset = UNSET, + +) -> Error | LavaflowIssuePrompts | None: + """ Read a written issue's prompt history + + Reads prompts for a written issue, oldest first, with secrets masked. + + Args: + project_id (UUID): + issue_id (UUID): + after_sequence (int | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | LavaflowIssuePrompts + """ + + + return (await asyncio_detailed( + client=client, +project_id=project_id, +issue_id=issue_id, +after_sequence=after_sequence, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/lava_flow/list_lavaflow_issues.py b/src/volcano_sdk/_generated/api/lava_flow/list_lavaflow_issues.py new file mode 100644 index 00000000..efe0fa5d --- /dev/null +++ b/src/volcano_sdk/_generated/api/lava_flow/list_lavaflow_issues.py @@ -0,0 +1,317 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from ...models.paginated_lavaflow_project_issues import PaginatedLavaflowProjectIssues +from ...types import UNSET, Unset +from typing import cast +from uuid import UUID + + + +def request_kwargs( + *, + project_id: UUID | str, + limit: int | Unset = UNSET, + cursor: str | Unset = UNSET, + issue_id: UUID | str | Unset = UNSET, + finished: bool | Unset = UNSET, + live: bool | Unset = UNSET, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + json_project_id = str(project_id) + params["project_id"] = json_project_id + + params["limit"] = limit + + params["cursor"] = cursor + + json_issue_id: str | Unset = UNSET + if not isinstance(issue_id, Unset): + json_issue_id = str(issue_id) + params["issue_id"] = json_issue_id + + params["finished"] = finished + + params["live"] = live + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/lavaflow/issues", + "params": params, + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | PaginatedLavaflowProjectIssues | None: + if response.status_code == 200: + response_200 = PaginatedLavaflowProjectIssues.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | PaginatedLavaflowProjectIssues]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + project_id: UUID | str, + limit: int | Unset = UNSET, + cursor: str | Unset = UNSET, + issue_id: UUID | str | Unset = UNSET, + finished: bool | Unset = UNSET, + live: bool | Unset = UNSET, + +) -> Response[Error | PaginatedLavaflowProjectIssues]: + """ List LavaFlow issues + + Lists a project's issues that LavaFlow has taken on, including written + requests awaiting their first run. Results are ordered by recent workflow + activity. An issue appears once, with its current state and latest run. + Set finished to include only finished issues, or use issue_id to read one + matching issue regardless of state. An authorized user can request a + Realtime grant for issue-change notices with live=true where supported. + + Args: + project_id (UUID): + limit (int | Unset): + cursor (str | Unset): + issue_id (UUID | Unset): + finished (bool | Unset): + live (bool | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | PaginatedLavaflowProjectIssues] + """ + + + kwargs = request_kwargs( + project_id=project_id, +limit=limit, +cursor=cursor, +issue_id=issue_id, +finished=finished, +live=live, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient, + project_id: UUID | str, + limit: int | Unset = UNSET, + cursor: str | Unset = UNSET, + issue_id: UUID | str | Unset = UNSET, + finished: bool | Unset = UNSET, + live: bool | Unset = UNSET, + +) -> Error | PaginatedLavaflowProjectIssues | None: + """ List LavaFlow issues + + Lists a project's issues that LavaFlow has taken on, including written + requests awaiting their first run. Results are ordered by recent workflow + activity. An issue appears once, with its current state and latest run. + Set finished to include only finished issues, or use issue_id to read one + matching issue regardless of state. An authorized user can request a + Realtime grant for issue-change notices with live=true where supported. + + Args: + project_id (UUID): + limit (int | Unset): + cursor (str | Unset): + issue_id (UUID | Unset): + finished (bool | Unset): + live (bool | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | PaginatedLavaflowProjectIssues + """ + + + return sync_detailed( + client=client, +project_id=project_id, +limit=limit, +cursor=cursor, +issue_id=issue_id, +finished=finished, +live=live, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + project_id: UUID | str, + limit: int | Unset = UNSET, + cursor: str | Unset = UNSET, + issue_id: UUID | str | Unset = UNSET, + finished: bool | Unset = UNSET, + live: bool | Unset = UNSET, + +) -> Response[Error | PaginatedLavaflowProjectIssues]: + """ List LavaFlow issues + + Lists a project's issues that LavaFlow has taken on, including written + requests awaiting their first run. Results are ordered by recent workflow + activity. An issue appears once, with its current state and latest run. + Set finished to include only finished issues, or use issue_id to read one + matching issue regardless of state. An authorized user can request a + Realtime grant for issue-change notices with live=true where supported. + + Args: + project_id (UUID): + limit (int | Unset): + cursor (str | Unset): + issue_id (UUID | Unset): + finished (bool | Unset): + live (bool | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | PaginatedLavaflowProjectIssues] + """ + + + kwargs = request_kwargs( + project_id=project_id, +limit=limit, +cursor=cursor, +issue_id=issue_id, +finished=finished, +live=live, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient, + project_id: UUID | str, + limit: int | Unset = UNSET, + cursor: str | Unset = UNSET, + issue_id: UUID | str | Unset = UNSET, + finished: bool | Unset = UNSET, + live: bool | Unset = UNSET, + +) -> Error | PaginatedLavaflowProjectIssues | None: + """ List LavaFlow issues + + Lists a project's issues that LavaFlow has taken on, including written + requests awaiting their first run. Results are ordered by recent workflow + activity. An issue appears once, with its current state and latest run. + Set finished to include only finished issues, or use issue_id to read one + matching issue regardless of state. An authorized user can request a + Realtime grant for issue-change notices with live=true where supported. + + Args: + project_id (UUID): + limit (int | Unset): + cursor (str | Unset): + issue_id (UUID | Unset): + finished (bool | Unset): + live (bool | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | PaginatedLavaflowProjectIssues + """ + + + return (await asyncio_detailed( + client=client, +project_id=project_id, +limit=limit, +cursor=cursor, +issue_id=issue_id, +finished=finished, +live=live, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/lava_flow/list_lavaflow_resources.py b/src/volcano_sdk/_generated/api/lava_flow/list_lavaflow_resources.py new file mode 100644 index 00000000..037351e9 --- /dev/null +++ b/src/volcano_sdk/_generated/api/lava_flow/list_lavaflow_resources.py @@ -0,0 +1,303 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from ...models.lavaflow_resource_list import LavaflowResourceList +from ...models.list_lavaflow_resources_category import check_list_lavaflow_resources_category +from ...models.list_lavaflow_resources_category import ListLavaflowResourcesCategory +from ...types import UNSET, Unset +from typing import cast +from uuid import UUID + + + +def request_kwargs( + *, + project_id: UUID | str, + days: int | Unset = 30, + category: ListLavaflowResourcesCategory | Unset = UNSET, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + json_project_id = str(project_id) + params["project_id"] = json_project_id + + params["days"] = days + + json_category: str | Unset = UNSET + if not isinstance(category, Unset): + json_category = category + + params["category"] = json_category + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/lavaflow/resources", + "params": params, + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | LavaflowResourceList | None: + if response.status_code == 200: + response_200 = LavaflowResourceList.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | LavaflowResourceList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + project_id: UUID | str, + days: int | Unset = 30, + category: ListLavaflowResourcesCategory | Unset = UNSET, + +) -> Response[Error | LavaflowResourceList]: + """ List LavaFlow's resources + + Lists every function, durable function and frontend in the project with + LavaFlow's activity in the window, zeros included, sorted by name. A + removed resource is listed when it has activity in the window (in that + category, with `category` set), so the counts add up to + `GET /lavaflow/stats`. + + `anomaly.flagged` is true when the last 24 hours have at least 3 + issues opened for the resource and at least 3 times its daily average + over the 29 days before, counting that average as at least 1. + + `category` counts, and flags anomalies from, only runs in that + category; every current resource is still listed, and + `last_analyzed_at` counts every run. + + Args: + project_id (UUID): + days (int | Unset): Default: 30. + category (ListLavaflowResourcesCategory | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | LavaflowResourceList] + """ + + + kwargs = request_kwargs( + project_id=project_id, +days=days, +category=category, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient, + project_id: UUID | str, + days: int | Unset = 30, + category: ListLavaflowResourcesCategory | Unset = UNSET, + +) -> Error | LavaflowResourceList | None: + """ List LavaFlow's resources + + Lists every function, durable function and frontend in the project with + LavaFlow's activity in the window, zeros included, sorted by name. A + removed resource is listed when it has activity in the window (in that + category, with `category` set), so the counts add up to + `GET /lavaflow/stats`. + + `anomaly.flagged` is true when the last 24 hours have at least 3 + issues opened for the resource and at least 3 times its daily average + over the 29 days before, counting that average as at least 1. + + `category` counts, and flags anomalies from, only runs in that + category; every current resource is still listed, and + `last_analyzed_at` counts every run. + + Args: + project_id (UUID): + days (int | Unset): Default: 30. + category (ListLavaflowResourcesCategory | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | LavaflowResourceList + """ + + + return sync_detailed( + client=client, +project_id=project_id, +days=days, +category=category, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + project_id: UUID | str, + days: int | Unset = 30, + category: ListLavaflowResourcesCategory | Unset = UNSET, + +) -> Response[Error | LavaflowResourceList]: + """ List LavaFlow's resources + + Lists every function, durable function and frontend in the project with + LavaFlow's activity in the window, zeros included, sorted by name. A + removed resource is listed when it has activity in the window (in that + category, with `category` set), so the counts add up to + `GET /lavaflow/stats`. + + `anomaly.flagged` is true when the last 24 hours have at least 3 + issues opened for the resource and at least 3 times its daily average + over the 29 days before, counting that average as at least 1. + + `category` counts, and flags anomalies from, only runs in that + category; every current resource is still listed, and + `last_analyzed_at` counts every run. + + Args: + project_id (UUID): + days (int | Unset): Default: 30. + category (ListLavaflowResourcesCategory | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | LavaflowResourceList] + """ + + + kwargs = request_kwargs( + project_id=project_id, +days=days, +category=category, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient, + project_id: UUID | str, + days: int | Unset = 30, + category: ListLavaflowResourcesCategory | Unset = UNSET, + +) -> Error | LavaflowResourceList | None: + """ List LavaFlow's resources + + Lists every function, durable function and frontend in the project with + LavaFlow's activity in the window, zeros included, sorted by name. A + removed resource is listed when it has activity in the window (in that + category, with `category` set), so the counts add up to + `GET /lavaflow/stats`. + + `anomaly.flagged` is true when the last 24 hours have at least 3 + issues opened for the resource and at least 3 times its daily average + over the 29 days before, counting that average as at least 1. + + `category` counts, and flags anomalies from, only runs in that + category; every current resource is still listed, and + `last_analyzed_at` counts every run. + + Args: + project_id (UUID): + days (int | Unset): Default: 30. + category (ListLavaflowResourcesCategory | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | LavaflowResourceList + """ + + + return (await asyncio_detailed( + client=client, +project_id=project_id, +days=days, +category=category, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/lava_flow/list_lavaflow_runs.py b/src/volcano_sdk/_generated/api/lava_flow/list_lavaflow_runs.py new file mode 100644 index 00000000..f989f24d --- /dev/null +++ b/src/volcano_sdk/_generated/api/lava_flow/list_lavaflow_runs.py @@ -0,0 +1,479 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from ...models.lavaflow_run_status import check_lavaflow_run_status +from ...models.lavaflow_run_status import LavaflowRunStatus +from ...models.list_lavaflow_runs_category import check_list_lavaflow_runs_category +from ...models.list_lavaflow_runs_category import ListLavaflowRunsCategory +from ...models.list_lavaflow_runs_include_item import check_list_lavaflow_runs_include_item +from ...models.list_lavaflow_runs_include_item import ListLavaflowRunsIncludeItem +from ...models.list_lavaflow_runs_order import check_list_lavaflow_runs_order +from ...models.list_lavaflow_runs_order import ListLavaflowRunsOrder +from ...models.list_lavaflow_runs_pull_request_state import check_list_lavaflow_runs_pull_request_state +from ...models.list_lavaflow_runs_pull_request_state import ListLavaflowRunsPullRequestState +from ...models.paginated_lavaflow_runs import PaginatedLavaflowRuns +from ...types import UNSET, Unset +from typing import cast +from uuid import UUID + + + +def request_kwargs( + *, + project_id: UUID | str, + limit: int | Unset = 25, + cursor: str | Unset = UNSET, + status: LavaflowRunStatus | Unset = UNSET, + resource_id: UUID | str | Unset = UNSET, + category: ListLavaflowRunsCategory | Unset = UNSET, + involved_resource_id: UUID | str | Unset = UNSET, + issue_id: UUID | str | Unset = UNSET, + pull_request_state: ListLavaflowRunsPullRequestState | Unset = UNSET, + days: int | Unset = UNSET, + order: ListLavaflowRunsOrder | Unset = 'created_at.desc', + include: list[ListLavaflowRunsIncludeItem] | Unset = UNSET, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + json_project_id = str(project_id) + params["project_id"] = json_project_id + + params["limit"] = limit + + params["cursor"] = cursor + + json_status: str | Unset = UNSET + if not isinstance(status, Unset): + json_status = status + + params["status"] = json_status + + json_resource_id: str | Unset = UNSET + if not isinstance(resource_id, Unset): + json_resource_id = str(resource_id) + params["resource_id"] = json_resource_id + + json_category: str | Unset = UNSET + if not isinstance(category, Unset): + json_category = category + + params["category"] = json_category + + json_involved_resource_id: str | Unset = UNSET + if not isinstance(involved_resource_id, Unset): + json_involved_resource_id = str(involved_resource_id) + params["involved_resource_id"] = json_involved_resource_id + + json_issue_id: str | Unset = UNSET + if not isinstance(issue_id, Unset): + json_issue_id = str(issue_id) + params["issue_id"] = json_issue_id + + json_pull_request_state: str | Unset = UNSET + if not isinstance(pull_request_state, Unset): + json_pull_request_state = pull_request_state + + params["pull_request_state"] = json_pull_request_state + + params["days"] = days + + json_order: str | Unset = UNSET + if not isinstance(order, Unset): + json_order = order + + params["order"] = json_order + + json_include: list[str] | Unset = UNSET + if not isinstance(include, Unset): + json_include = [] + for include_item_data in include: + include_item: str = include_item_data + json_include.append(include_item) + + + params["include"] = json_include + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/lavaflow/runs", + "params": params, + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | PaginatedLavaflowRuns | None: + if response.status_code == 200: + response_200 = PaginatedLavaflowRuns.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | PaginatedLavaflowRuns]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + project_id: UUID | str, + limit: int | Unset = 25, + cursor: str | Unset = UNSET, + status: LavaflowRunStatus | Unset = UNSET, + resource_id: UUID | str | Unset = UNSET, + category: ListLavaflowRunsCategory | Unset = UNSET, + involved_resource_id: UUID | str | Unset = UNSET, + issue_id: UUID | str | Unset = UNSET, + pull_request_state: ListLavaflowRunsPullRequestState | Unset = UNSET, + days: int | Unset = UNSET, + order: ListLavaflowRunsOrder | Unset = 'created_at.desc', + include: list[ListLavaflowRunsIncludeItem] | Unset = UNSET, + +) -> Response[Error | PaginatedLavaflowRuns]: + """ List LavaFlow runs + + Pages the project's LavaFlow runs, newest first unless `order` says + otherwise. A page carries bounded display text, including the saved + proposed fix's optional `fix_summary`; read a run for its diagnosis, + log lines and diff. Each run names its category, the resources it + involves and its issue. A confirmed Code Quality finding can supply + `issue.severity`, and a recorded pull request can supply `branch`. + Unknown or withheld optional fields are omitted. + + Every filter narrows the list, and filters combine. `include=counts` + adds `counts`, computed from the same filters: ask for them on the + first page, since they don't depend on the cursor. Keep the filters + and `order` while paging. + + Args: + project_id (UUID): + limit (int | Unset): Default: 25. + cursor (str | Unset): + status (LavaflowRunStatus | Unset): Where a run is. `diagnosing`, `fixing` and `reviewing` + are the stages of a running run. `pr_open` means its pull request is open; `completed` + means it finished, with no pull request or one that was merged or closed. + resource_id (UUID | Unset): + category (ListLavaflowRunsCategory | Unset): + involved_resource_id (UUID | Unset): + issue_id (UUID | Unset): + pull_request_state (ListLavaflowRunsPullRequestState | Unset): + days (int | Unset): + order (ListLavaflowRunsOrder | Unset): Default: 'created_at.desc'. + include (list[ListLavaflowRunsIncludeItem] | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | PaginatedLavaflowRuns] + """ + + + kwargs = request_kwargs( + project_id=project_id, +limit=limit, +cursor=cursor, +status=status, +resource_id=resource_id, +category=category, +involved_resource_id=involved_resource_id, +issue_id=issue_id, +pull_request_state=pull_request_state, +days=days, +order=order, +include=include, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient, + project_id: UUID | str, + limit: int | Unset = 25, + cursor: str | Unset = UNSET, + status: LavaflowRunStatus | Unset = UNSET, + resource_id: UUID | str | Unset = UNSET, + category: ListLavaflowRunsCategory | Unset = UNSET, + involved_resource_id: UUID | str | Unset = UNSET, + issue_id: UUID | str | Unset = UNSET, + pull_request_state: ListLavaflowRunsPullRequestState | Unset = UNSET, + days: int | Unset = UNSET, + order: ListLavaflowRunsOrder | Unset = 'created_at.desc', + include: list[ListLavaflowRunsIncludeItem] | Unset = UNSET, + +) -> Error | PaginatedLavaflowRuns | None: + """ List LavaFlow runs + + Pages the project's LavaFlow runs, newest first unless `order` says + otherwise. A page carries bounded display text, including the saved + proposed fix's optional `fix_summary`; read a run for its diagnosis, + log lines and diff. Each run names its category, the resources it + involves and its issue. A confirmed Code Quality finding can supply + `issue.severity`, and a recorded pull request can supply `branch`. + Unknown or withheld optional fields are omitted. + + Every filter narrows the list, and filters combine. `include=counts` + adds `counts`, computed from the same filters: ask for them on the + first page, since they don't depend on the cursor. Keep the filters + and `order` while paging. + + Args: + project_id (UUID): + limit (int | Unset): Default: 25. + cursor (str | Unset): + status (LavaflowRunStatus | Unset): Where a run is. `diagnosing`, `fixing` and `reviewing` + are the stages of a running run. `pr_open` means its pull request is open; `completed` + means it finished, with no pull request or one that was merged or closed. + resource_id (UUID | Unset): + category (ListLavaflowRunsCategory | Unset): + involved_resource_id (UUID | Unset): + issue_id (UUID | Unset): + pull_request_state (ListLavaflowRunsPullRequestState | Unset): + days (int | Unset): + order (ListLavaflowRunsOrder | Unset): Default: 'created_at.desc'. + include (list[ListLavaflowRunsIncludeItem] | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | PaginatedLavaflowRuns + """ + + + return sync_detailed( + client=client, +project_id=project_id, +limit=limit, +cursor=cursor, +status=status, +resource_id=resource_id, +category=category, +involved_resource_id=involved_resource_id, +issue_id=issue_id, +pull_request_state=pull_request_state, +days=days, +order=order, +include=include, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + project_id: UUID | str, + limit: int | Unset = 25, + cursor: str | Unset = UNSET, + status: LavaflowRunStatus | Unset = UNSET, + resource_id: UUID | str | Unset = UNSET, + category: ListLavaflowRunsCategory | Unset = UNSET, + involved_resource_id: UUID | str | Unset = UNSET, + issue_id: UUID | str | Unset = UNSET, + pull_request_state: ListLavaflowRunsPullRequestState | Unset = UNSET, + days: int | Unset = UNSET, + order: ListLavaflowRunsOrder | Unset = 'created_at.desc', + include: list[ListLavaflowRunsIncludeItem] | Unset = UNSET, + +) -> Response[Error | PaginatedLavaflowRuns]: + """ List LavaFlow runs + + Pages the project's LavaFlow runs, newest first unless `order` says + otherwise. A page carries bounded display text, including the saved + proposed fix's optional `fix_summary`; read a run for its diagnosis, + log lines and diff. Each run names its category, the resources it + involves and its issue. A confirmed Code Quality finding can supply + `issue.severity`, and a recorded pull request can supply `branch`. + Unknown or withheld optional fields are omitted. + + Every filter narrows the list, and filters combine. `include=counts` + adds `counts`, computed from the same filters: ask for them on the + first page, since they don't depend on the cursor. Keep the filters + and `order` while paging. + + Args: + project_id (UUID): + limit (int | Unset): Default: 25. + cursor (str | Unset): + status (LavaflowRunStatus | Unset): Where a run is. `diagnosing`, `fixing` and `reviewing` + are the stages of a running run. `pr_open` means its pull request is open; `completed` + means it finished, with no pull request or one that was merged or closed. + resource_id (UUID | Unset): + category (ListLavaflowRunsCategory | Unset): + involved_resource_id (UUID | Unset): + issue_id (UUID | Unset): + pull_request_state (ListLavaflowRunsPullRequestState | Unset): + days (int | Unset): + order (ListLavaflowRunsOrder | Unset): Default: 'created_at.desc'. + include (list[ListLavaflowRunsIncludeItem] | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | PaginatedLavaflowRuns] + """ + + + kwargs = request_kwargs( + project_id=project_id, +limit=limit, +cursor=cursor, +status=status, +resource_id=resource_id, +category=category, +involved_resource_id=involved_resource_id, +issue_id=issue_id, +pull_request_state=pull_request_state, +days=days, +order=order, +include=include, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient, + project_id: UUID | str, + limit: int | Unset = 25, + cursor: str | Unset = UNSET, + status: LavaflowRunStatus | Unset = UNSET, + resource_id: UUID | str | Unset = UNSET, + category: ListLavaflowRunsCategory | Unset = UNSET, + involved_resource_id: UUID | str | Unset = UNSET, + issue_id: UUID | str | Unset = UNSET, + pull_request_state: ListLavaflowRunsPullRequestState | Unset = UNSET, + days: int | Unset = UNSET, + order: ListLavaflowRunsOrder | Unset = 'created_at.desc', + include: list[ListLavaflowRunsIncludeItem] | Unset = UNSET, + +) -> Error | PaginatedLavaflowRuns | None: + """ List LavaFlow runs + + Pages the project's LavaFlow runs, newest first unless `order` says + otherwise. A page carries bounded display text, including the saved + proposed fix's optional `fix_summary`; read a run for its diagnosis, + log lines and diff. Each run names its category, the resources it + involves and its issue. A confirmed Code Quality finding can supply + `issue.severity`, and a recorded pull request can supply `branch`. + Unknown or withheld optional fields are omitted. + + Every filter narrows the list, and filters combine. `include=counts` + adds `counts`, computed from the same filters: ask for them on the + first page, since they don't depend on the cursor. Keep the filters + and `order` while paging. + + Args: + project_id (UUID): + limit (int | Unset): Default: 25. + cursor (str | Unset): + status (LavaflowRunStatus | Unset): Where a run is. `diagnosing`, `fixing` and `reviewing` + are the stages of a running run. `pr_open` means its pull request is open; `completed` + means it finished, with no pull request or one that was merged or closed. + resource_id (UUID | Unset): + category (ListLavaflowRunsCategory | Unset): + involved_resource_id (UUID | Unset): + issue_id (UUID | Unset): + pull_request_state (ListLavaflowRunsPullRequestState | Unset): + days (int | Unset): + order (ListLavaflowRunsOrder | Unset): Default: 'created_at.desc'. + include (list[ListLavaflowRunsIncludeItem] | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | PaginatedLavaflowRuns + """ + + + return (await asyncio_detailed( + client=client, +project_id=project_id, +limit=limit, +cursor=cursor, +status=status, +resource_id=resource_id, +category=category, +involved_resource_id=involved_resource_id, +issue_id=issue_id, +pull_request_state=pull_request_state, +days=days, +order=order, +include=include, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/lava_flow/list_lavaflow_scans.py b/src/volcano_sdk/_generated/api/lava_flow/list_lavaflow_scans.py new file mode 100644 index 00000000..bee248dd --- /dev/null +++ b/src/volcano_sdk/_generated/api/lava_flow/list_lavaflow_scans.py @@ -0,0 +1,301 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from ...models.paginated_lavaflow_scans import PaginatedLavaflowScans +from ...types import UNSET, Unset +from typing import cast +from uuid import UUID + + + +def request_kwargs( + *, + project_id: UUID | str, + limit: int | Unset = 25, + cursor: str | Unset = UNSET, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + json_project_id = str(project_id) + params["project_id"] = json_project_id + + params["limit"] = limit + + params["cursor"] = cursor + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/lavaflow/scans", + "params": params, + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | PaginatedLavaflowScans | None: + if response.status_code == 200: + response_200 = PaginatedLavaflowScans.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | PaginatedLavaflowScans]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + project_id: UUID | str, + limit: int | Unset = 25, + cursor: str | Unset = UNSET, + +) -> Response[Error | PaginatedLavaflowScans]: + """ List LavaFlow Code Quality scans + + Pages the project's Code Quality scans, newest first. The first page + starts with the project's waiting scan, if it has one: the deploys + that went live since the last scan, with `status: waiting` and the + bound it waits at in `waiting_reason`. A bound never drops a deploy: + the waiting scan covers every commit since the last one when it + starts. A platform publication pause is reported as `feature_paused` + and does not spend the scan's retry allowance. With publication enabled, + a separate pause on starting runs is reported as `feature_unavailable`. + + Each scan shows the commits it compared, the resources whose deploys + it covers, what it did with what it found, and the findings whose + runs were billed. Scans stay readable while LavaFlow or Code Quality + is off. Project access tokens can read them, including read-only + ones. + + Args: + project_id (UUID): + limit (int | Unset): Default: 25. + cursor (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | PaginatedLavaflowScans] + """ + + + kwargs = request_kwargs( + project_id=project_id, +limit=limit, +cursor=cursor, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient, + project_id: UUID | str, + limit: int | Unset = 25, + cursor: str | Unset = UNSET, + +) -> Error | PaginatedLavaflowScans | None: + """ List LavaFlow Code Quality scans + + Pages the project's Code Quality scans, newest first. The first page + starts with the project's waiting scan, if it has one: the deploys + that went live since the last scan, with `status: waiting` and the + bound it waits at in `waiting_reason`. A bound never drops a deploy: + the waiting scan covers every commit since the last one when it + starts. A platform publication pause is reported as `feature_paused` + and does not spend the scan's retry allowance. With publication enabled, + a separate pause on starting runs is reported as `feature_unavailable`. + + Each scan shows the commits it compared, the resources whose deploys + it covers, what it did with what it found, and the findings whose + runs were billed. Scans stay readable while LavaFlow or Code Quality + is off. Project access tokens can read them, including read-only + ones. + + Args: + project_id (UUID): + limit (int | Unset): Default: 25. + cursor (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | PaginatedLavaflowScans + """ + + + return sync_detailed( + client=client, +project_id=project_id, +limit=limit, +cursor=cursor, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + project_id: UUID | str, + limit: int | Unset = 25, + cursor: str | Unset = UNSET, + +) -> Response[Error | PaginatedLavaflowScans]: + """ List LavaFlow Code Quality scans + + Pages the project's Code Quality scans, newest first. The first page + starts with the project's waiting scan, if it has one: the deploys + that went live since the last scan, with `status: waiting` and the + bound it waits at in `waiting_reason`. A bound never drops a deploy: + the waiting scan covers every commit since the last one when it + starts. A platform publication pause is reported as `feature_paused` + and does not spend the scan's retry allowance. With publication enabled, + a separate pause on starting runs is reported as `feature_unavailable`. + + Each scan shows the commits it compared, the resources whose deploys + it covers, what it did with what it found, and the findings whose + runs were billed. Scans stay readable while LavaFlow or Code Quality + is off. Project access tokens can read them, including read-only + ones. + + Args: + project_id (UUID): + limit (int | Unset): Default: 25. + cursor (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | PaginatedLavaflowScans] + """ + + + kwargs = request_kwargs( + project_id=project_id, +limit=limit, +cursor=cursor, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient, + project_id: UUID | str, + limit: int | Unset = 25, + cursor: str | Unset = UNSET, + +) -> Error | PaginatedLavaflowScans | None: + """ List LavaFlow Code Quality scans + + Pages the project's Code Quality scans, newest first. The first page + starts with the project's waiting scan, if it has one: the deploys + that went live since the last scan, with `status: waiting` and the + bound it waits at in `waiting_reason`. A bound never drops a deploy: + the waiting scan covers every commit since the last one when it + starts. A platform publication pause is reported as `feature_paused` + and does not spend the scan's retry allowance. With publication enabled, + a separate pause on starting runs is reported as `feature_unavailable`. + + Each scan shows the commits it compared, the resources whose deploys + it covers, what it did with what it found, and the findings whose + runs were billed. Scans stay readable while LavaFlow or Code Quality + is off. Project access tokens can read them, including read-only + ones. + + Args: + project_id (UUID): + limit (int | Unset): Default: 25. + cursor (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | PaginatedLavaflowScans + """ + + + return (await asyncio_detailed( + client=client, +project_id=project_id, +limit=limit, +cursor=cursor, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/lava_flow/patch_lavaflow_settings.py b/src/volcano_sdk/_generated/api/lava_flow/patch_lavaflow_settings.py new file mode 100644 index 00000000..38c31adc --- /dev/null +++ b/src/volcano_sdk/_generated/api/lava_flow/patch_lavaflow_settings.py @@ -0,0 +1,723 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from ...models.lavaflow_settings import LavaflowSettings +from ...models.lavaflow_settings_update import LavaflowSettingsUpdate +from typing import cast + + + +def request_kwargs( + *, + body: LavaflowSettingsUpdate, + +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + + + + + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": "/lavaflow/settings", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | LavaflowSettings | None: + if response.status_code == 200: + response_200 = LavaflowSettings.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 409: + response_409 = Error.from_dict(response.json()) + + + + return response_409 + + if response.status_code == 413: + response_413 = Error.from_dict(response.json()) + + + + return response_413 + + if response.status_code == 429: + response_429 = Error.from_dict(response.json()) + + + + return response_429 + + if response.status_code == 503: + response_503 = Error.from_dict(response.json()) + + + + return response_503 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | LavaflowSettings]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: LavaflowSettingsUpdate, + +) -> Response[Error | LavaflowSettings]: + """ Update LavaFlow settings + + Changes the fields the request names for the project `project_id` + names; an omitted field keeps its saved value, or its default when + nothing is saved. `{"project_id": "…", "enabled": true}` turns LavaFlow + on for every function, frontend and durable function in the project, + and records the repository the project points at as the one LavaFlow + works in. A request carrying `"enabled": true` is a turn-on, even while + LavaFlow is on. When the project points at no repository at a turn-on, + the first repository it connects afterwards is recorded. A request + that omits `enabled` never changes which repository is recorded. + LavaFlow sends this project's logs and source code to an AI service + that Volcano operates. + + Turning LavaFlow on, from off, also starts runs for up to 5 open issues + with `exception: true` and an `event_count` of at least 2, last seen in + the past 7 days, most recently seen first, leaving out any issue + LavaFlow already ran; runs LavaFlow queued on its own and hasn't + started count toward the 5. They start like any run LavaFlow starts on + its own, up to 3 at once per project. Only the owner's save with a + `volcano login` token whose sign-in is live, a live Volcano dashboard + sign-in, or a platform token that expires, starts them; any other save turns LavaFlow on without + them. A save while LavaFlow is on starts none, and neither + does LavaFlow becoming available to the project. + + Only the project's owner can save, with a platform token or a live + Volcano dashboard sign-in, while their account is active. A full-scope project access token can only + turn + settings off: a body with `project_id` and + `"code_quality": {"enabled": false}`, each field spelled exactly and + sent once, and nothing else. Any other + body from a project access token, including one that turns a setting + on, adds a field, sends `null`, or names a field the schema doesn't + have, gets `403` with code `person_required`, as does a request made + through MCP. A read-only project access token is refused as read-only + first, without a code, + and so is the owner of a read-only account. + + `code_quality.enabled: true` turns on LavaFlow Code Quality, which + reviews the lines each production deploy of a frontend changes and + turns what it confirms into issues and pull requests. Function deploys + ask for no scan yet. It needs the project's `lavaflow.code_quality` + capability: while Code Quality isn't released here the save answers + `400` with code `feature_unavailable`, and while the owner's plan + allows no Code Quality findings it answers `403` with code + `plan_required`. Only the owner can turn it on, with the check below. + Turning it off always works, and drops the deploys waiting to be + scanned. + + Under `autonomy: open_pr`, when `lavaflow.repository_ci` is available + and the owner has granted `allow_ungated_workflows` for the connected + repository, LavaFlow opens reviewed fixes ready for review without a CI-skip marker + or checking workflows for approval. The repository controls which CI + runs and which credentials it uses. A person still merges the fix. + A review that did not pass opens a draft without suppressing CI. + Without this permission, LavaFlow retains its guarded publication + policy, including workflow checks and CI-skip markers, and may hold + a fix instead of opening a pull request where CI could run it with + credentials before review. Capability availability alone never grants + repository permission. Changing the repository or GitHub App + installation clears the permission. Revocation affects later writes; + it does not cancel existing pull requests or CI runs. + For consent tied to the repository shown to the owner, send + `expected_repository` with its `repo_id` and `repo_installation_id`. + The save checks both under its transaction lock, including an + idempotent grant. A mismatch returns `409 repository_changed` without + changing settings or audit history. Refresh the connection and ask the + owner again; never automatically retry with the new connection. + The same normal CI policy applies when LavaFlow leaves merging to a + person. In Merge mode, fixes from connected reports can use normal + repository CI after LavaFlow verifies the repository revision and + current source authorization. Without the CI grant, they follow + guarded workflow checks. All fixes must satisfy the project's merge + policy and the repository's required checks and approvals. + Code Quality follows the project's autonomy and opens a pull request + only after its review passes. + + `autonomy: merge` needs the project's `lavaflow.merge` capability. + Without it, a save that sets `autonomy` to `merge`, or changes + `merge_policy`, answers `400` with code `feature_unavailable`. A save + that sends the saved values again passes this check, though it can + still need the owner's check below, and a project at `merge` can + still change to another autonomy. The save doesn't read the + repository's branch rules: LavaFlow merges only into a base branch + that requires at least one status check, and holds every fix with + `no_required_checks` on any other. + + Changing `autonomy` to `merge` lets LavaFlow merge with no one else + looking. So does turning `enabled` on while `autonomy` stays `merge`, + and changing `merge_policy`, to any value, while `autonomy` is, or + becomes, `merge`. Turning `allow_ungated_workflows` on lets LavaFlow + open a fix where a workflow could run it with the repository's + secrets before a person approves it. Turning `code_quality` on starts + work on every frontend production deploy with no incident behind it. + Only the owner can make these changes, with a credential of + their own that expires: a `volcano login` token + whose sign-in is live, a live Volcano dashboard sign-in, or a + platform token with an expiry. The owner's + GitHub account must also be able to push to the project's repository. + A project access token, MCP, a platform token that never expires, a + sign-in that ended, an owner who can't push, and a project with no + repository get `403` with code `person_required`, and nothing is + saved. Turning LavaFlow, `allow_ungated_workflows` or `code_quality` + off needs no check. + Nothing is saved either when the push check can't be answered (`429` + or `503`, with `Retry-After`). When the project points at another + repository, reaches its repository through another Volcano GitHub App + installation, or points at none, `autonomy` changes from `merge` to + `open_pr`; pointing back doesn't change it back. Reconnecting after a + reinstall of the App counts as another installation. + + Turning LavaFlow on needs a plan that includes it (`403`, code + `plan_required`). LavaFlow is available where the project's + `lavaflow` capability is, which includes the owner's plan. Where it is + not, a project with LavaFlow records can still turn LavaFlow, Code + Quality or both off: a save that sends `enabled: false`, + `code_quality: {enabled: false}` or both, and otherwise only + `allow_ungated_workflows: false` sent with `enabled`. Any other save, + and any save for a project without records, answers `404` with code + `feature_unavailable` while LavaFlow is not offered to the project, and + `403` with code `plan_required` when it is but the owner's plan does + not include it. + + Args: + body (LavaflowSettingsUpdate): The project, and at least one field to change. An omitted + field keeps its saved value. A repository precondition alone is not a setting change. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | LavaflowSettings] + """ + + + kwargs = request_kwargs( + body=body, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient, + body: LavaflowSettingsUpdate, + +) -> Error | LavaflowSettings | None: + """ Update LavaFlow settings + + Changes the fields the request names for the project `project_id` + names; an omitted field keeps its saved value, or its default when + nothing is saved. `{"project_id": "…", "enabled": true}` turns LavaFlow + on for every function, frontend and durable function in the project, + and records the repository the project points at as the one LavaFlow + works in. A request carrying `"enabled": true` is a turn-on, even while + LavaFlow is on. When the project points at no repository at a turn-on, + the first repository it connects afterwards is recorded. A request + that omits `enabled` never changes which repository is recorded. + LavaFlow sends this project's logs and source code to an AI service + that Volcano operates. + + Turning LavaFlow on, from off, also starts runs for up to 5 open issues + with `exception: true` and an `event_count` of at least 2, last seen in + the past 7 days, most recently seen first, leaving out any issue + LavaFlow already ran; runs LavaFlow queued on its own and hasn't + started count toward the 5. They start like any run LavaFlow starts on + its own, up to 3 at once per project. Only the owner's save with a + `volcano login` token whose sign-in is live, a live Volcano dashboard + sign-in, or a platform token that expires, starts them; any other save turns LavaFlow on without + them. A save while LavaFlow is on starts none, and neither + does LavaFlow becoming available to the project. + + Only the project's owner can save, with a platform token or a live + Volcano dashboard sign-in, while their account is active. A full-scope project access token can only + turn + settings off: a body with `project_id` and + `"code_quality": {"enabled": false}`, each field spelled exactly and + sent once, and nothing else. Any other + body from a project access token, including one that turns a setting + on, adds a field, sends `null`, or names a field the schema doesn't + have, gets `403` with code `person_required`, as does a request made + through MCP. A read-only project access token is refused as read-only + first, without a code, + and so is the owner of a read-only account. + + `code_quality.enabled: true` turns on LavaFlow Code Quality, which + reviews the lines each production deploy of a frontend changes and + turns what it confirms into issues and pull requests. Function deploys + ask for no scan yet. It needs the project's `lavaflow.code_quality` + capability: while Code Quality isn't released here the save answers + `400` with code `feature_unavailable`, and while the owner's plan + allows no Code Quality findings it answers `403` with code + `plan_required`. Only the owner can turn it on, with the check below. + Turning it off always works, and drops the deploys waiting to be + scanned. + + Under `autonomy: open_pr`, when `lavaflow.repository_ci` is available + and the owner has granted `allow_ungated_workflows` for the connected + repository, LavaFlow opens reviewed fixes ready for review without a CI-skip marker + or checking workflows for approval. The repository controls which CI + runs and which credentials it uses. A person still merges the fix. + A review that did not pass opens a draft without suppressing CI. + Without this permission, LavaFlow retains its guarded publication + policy, including workflow checks and CI-skip markers, and may hold + a fix instead of opening a pull request where CI could run it with + credentials before review. Capability availability alone never grants + repository permission. Changing the repository or GitHub App + installation clears the permission. Revocation affects later writes; + it does not cancel existing pull requests or CI runs. + For consent tied to the repository shown to the owner, send + `expected_repository` with its `repo_id` and `repo_installation_id`. + The save checks both under its transaction lock, including an + idempotent grant. A mismatch returns `409 repository_changed` without + changing settings or audit history. Refresh the connection and ask the + owner again; never automatically retry with the new connection. + The same normal CI policy applies when LavaFlow leaves merging to a + person. In Merge mode, fixes from connected reports can use normal + repository CI after LavaFlow verifies the repository revision and + current source authorization. Without the CI grant, they follow + guarded workflow checks. All fixes must satisfy the project's merge + policy and the repository's required checks and approvals. + Code Quality follows the project's autonomy and opens a pull request + only after its review passes. + + `autonomy: merge` needs the project's `lavaflow.merge` capability. + Without it, a save that sets `autonomy` to `merge`, or changes + `merge_policy`, answers `400` with code `feature_unavailable`. A save + that sends the saved values again passes this check, though it can + still need the owner's check below, and a project at `merge` can + still change to another autonomy. The save doesn't read the + repository's branch rules: LavaFlow merges only into a base branch + that requires at least one status check, and holds every fix with + `no_required_checks` on any other. + + Changing `autonomy` to `merge` lets LavaFlow merge with no one else + looking. So does turning `enabled` on while `autonomy` stays `merge`, + and changing `merge_policy`, to any value, while `autonomy` is, or + becomes, `merge`. Turning `allow_ungated_workflows` on lets LavaFlow + open a fix where a workflow could run it with the repository's + secrets before a person approves it. Turning `code_quality` on starts + work on every frontend production deploy with no incident behind it. + Only the owner can make these changes, with a credential of + their own that expires: a `volcano login` token + whose sign-in is live, a live Volcano dashboard sign-in, or a + platform token with an expiry. The owner's + GitHub account must also be able to push to the project's repository. + A project access token, MCP, a platform token that never expires, a + sign-in that ended, an owner who can't push, and a project with no + repository get `403` with code `person_required`, and nothing is + saved. Turning LavaFlow, `allow_ungated_workflows` or `code_quality` + off needs no check. + Nothing is saved either when the push check can't be answered (`429` + or `503`, with `Retry-After`). When the project points at another + repository, reaches its repository through another Volcano GitHub App + installation, or points at none, `autonomy` changes from `merge` to + `open_pr`; pointing back doesn't change it back. Reconnecting after a + reinstall of the App counts as another installation. + + Turning LavaFlow on needs a plan that includes it (`403`, code + `plan_required`). LavaFlow is available where the project's + `lavaflow` capability is, which includes the owner's plan. Where it is + not, a project with LavaFlow records can still turn LavaFlow, Code + Quality or both off: a save that sends `enabled: false`, + `code_quality: {enabled: false}` or both, and otherwise only + `allow_ungated_workflows: false` sent with `enabled`. Any other save, + and any save for a project without records, answers `404` with code + `feature_unavailable` while LavaFlow is not offered to the project, and + `403` with code `plan_required` when it is but the owner's plan does + not include it. + + Args: + body (LavaflowSettingsUpdate): The project, and at least one field to change. An omitted + field keeps its saved value. A repository precondition alone is not a setting change. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | LavaflowSettings + """ + + + return sync_detailed( + client=client, +body=body, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: LavaflowSettingsUpdate, + +) -> Response[Error | LavaflowSettings]: + """ Update LavaFlow settings + + Changes the fields the request names for the project `project_id` + names; an omitted field keeps its saved value, or its default when + nothing is saved. `{"project_id": "…", "enabled": true}` turns LavaFlow + on for every function, frontend and durable function in the project, + and records the repository the project points at as the one LavaFlow + works in. A request carrying `"enabled": true` is a turn-on, even while + LavaFlow is on. When the project points at no repository at a turn-on, + the first repository it connects afterwards is recorded. A request + that omits `enabled` never changes which repository is recorded. + LavaFlow sends this project's logs and source code to an AI service + that Volcano operates. + + Turning LavaFlow on, from off, also starts runs for up to 5 open issues + with `exception: true` and an `event_count` of at least 2, last seen in + the past 7 days, most recently seen first, leaving out any issue + LavaFlow already ran; runs LavaFlow queued on its own and hasn't + started count toward the 5. They start like any run LavaFlow starts on + its own, up to 3 at once per project. Only the owner's save with a + `volcano login` token whose sign-in is live, a live Volcano dashboard + sign-in, or a platform token that expires, starts them; any other save turns LavaFlow on without + them. A save while LavaFlow is on starts none, and neither + does LavaFlow becoming available to the project. + + Only the project's owner can save, with a platform token or a live + Volcano dashboard sign-in, while their account is active. A full-scope project access token can only + turn + settings off: a body with `project_id` and + `"code_quality": {"enabled": false}`, each field spelled exactly and + sent once, and nothing else. Any other + body from a project access token, including one that turns a setting + on, adds a field, sends `null`, or names a field the schema doesn't + have, gets `403` with code `person_required`, as does a request made + through MCP. A read-only project access token is refused as read-only + first, without a code, + and so is the owner of a read-only account. + + `code_quality.enabled: true` turns on LavaFlow Code Quality, which + reviews the lines each production deploy of a frontend changes and + turns what it confirms into issues and pull requests. Function deploys + ask for no scan yet. It needs the project's `lavaflow.code_quality` + capability: while Code Quality isn't released here the save answers + `400` with code `feature_unavailable`, and while the owner's plan + allows no Code Quality findings it answers `403` with code + `plan_required`. Only the owner can turn it on, with the check below. + Turning it off always works, and drops the deploys waiting to be + scanned. + + Under `autonomy: open_pr`, when `lavaflow.repository_ci` is available + and the owner has granted `allow_ungated_workflows` for the connected + repository, LavaFlow opens reviewed fixes ready for review without a CI-skip marker + or checking workflows for approval. The repository controls which CI + runs and which credentials it uses. A person still merges the fix. + A review that did not pass opens a draft without suppressing CI. + Without this permission, LavaFlow retains its guarded publication + policy, including workflow checks and CI-skip markers, and may hold + a fix instead of opening a pull request where CI could run it with + credentials before review. Capability availability alone never grants + repository permission. Changing the repository or GitHub App + installation clears the permission. Revocation affects later writes; + it does not cancel existing pull requests or CI runs. + For consent tied to the repository shown to the owner, send + `expected_repository` with its `repo_id` and `repo_installation_id`. + The save checks both under its transaction lock, including an + idempotent grant. A mismatch returns `409 repository_changed` without + changing settings or audit history. Refresh the connection and ask the + owner again; never automatically retry with the new connection. + The same normal CI policy applies when LavaFlow leaves merging to a + person. In Merge mode, fixes from connected reports can use normal + repository CI after LavaFlow verifies the repository revision and + current source authorization. Without the CI grant, they follow + guarded workflow checks. All fixes must satisfy the project's merge + policy and the repository's required checks and approvals. + Code Quality follows the project's autonomy and opens a pull request + only after its review passes. + + `autonomy: merge` needs the project's `lavaflow.merge` capability. + Without it, a save that sets `autonomy` to `merge`, or changes + `merge_policy`, answers `400` with code `feature_unavailable`. A save + that sends the saved values again passes this check, though it can + still need the owner's check below, and a project at `merge` can + still change to another autonomy. The save doesn't read the + repository's branch rules: LavaFlow merges only into a base branch + that requires at least one status check, and holds every fix with + `no_required_checks` on any other. + + Changing `autonomy` to `merge` lets LavaFlow merge with no one else + looking. So does turning `enabled` on while `autonomy` stays `merge`, + and changing `merge_policy`, to any value, while `autonomy` is, or + becomes, `merge`. Turning `allow_ungated_workflows` on lets LavaFlow + open a fix where a workflow could run it with the repository's + secrets before a person approves it. Turning `code_quality` on starts + work on every frontend production deploy with no incident behind it. + Only the owner can make these changes, with a credential of + their own that expires: a `volcano login` token + whose sign-in is live, a live Volcano dashboard sign-in, or a + platform token with an expiry. The owner's + GitHub account must also be able to push to the project's repository. + A project access token, MCP, a platform token that never expires, a + sign-in that ended, an owner who can't push, and a project with no + repository get `403` with code `person_required`, and nothing is + saved. Turning LavaFlow, `allow_ungated_workflows` or `code_quality` + off needs no check. + Nothing is saved either when the push check can't be answered (`429` + or `503`, with `Retry-After`). When the project points at another + repository, reaches its repository through another Volcano GitHub App + installation, or points at none, `autonomy` changes from `merge` to + `open_pr`; pointing back doesn't change it back. Reconnecting after a + reinstall of the App counts as another installation. + + Turning LavaFlow on needs a plan that includes it (`403`, code + `plan_required`). LavaFlow is available where the project's + `lavaflow` capability is, which includes the owner's plan. Where it is + not, a project with LavaFlow records can still turn LavaFlow, Code + Quality or both off: a save that sends `enabled: false`, + `code_quality: {enabled: false}` or both, and otherwise only + `allow_ungated_workflows: false` sent with `enabled`. Any other save, + and any save for a project without records, answers `404` with code + `feature_unavailable` while LavaFlow is not offered to the project, and + `403` with code `plan_required` when it is but the owner's plan does + not include it. + + Args: + body (LavaflowSettingsUpdate): The project, and at least one field to change. An omitted + field keeps its saved value. A repository precondition alone is not a setting change. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | LavaflowSettings] + """ + + + kwargs = request_kwargs( + body=body, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient, + body: LavaflowSettingsUpdate, + +) -> Error | LavaflowSettings | None: + """ Update LavaFlow settings + + Changes the fields the request names for the project `project_id` + names; an omitted field keeps its saved value, or its default when + nothing is saved. `{"project_id": "…", "enabled": true}` turns LavaFlow + on for every function, frontend and durable function in the project, + and records the repository the project points at as the one LavaFlow + works in. A request carrying `"enabled": true` is a turn-on, even while + LavaFlow is on. When the project points at no repository at a turn-on, + the first repository it connects afterwards is recorded. A request + that omits `enabled` never changes which repository is recorded. + LavaFlow sends this project's logs and source code to an AI service + that Volcano operates. + + Turning LavaFlow on, from off, also starts runs for up to 5 open issues + with `exception: true` and an `event_count` of at least 2, last seen in + the past 7 days, most recently seen first, leaving out any issue + LavaFlow already ran; runs LavaFlow queued on its own and hasn't + started count toward the 5. They start like any run LavaFlow starts on + its own, up to 3 at once per project. Only the owner's save with a + `volcano login` token whose sign-in is live, a live Volcano dashboard + sign-in, or a platform token that expires, starts them; any other save turns LavaFlow on without + them. A save while LavaFlow is on starts none, and neither + does LavaFlow becoming available to the project. + + Only the project's owner can save, with a platform token or a live + Volcano dashboard sign-in, while their account is active. A full-scope project access token can only + turn + settings off: a body with `project_id` and + `"code_quality": {"enabled": false}`, each field spelled exactly and + sent once, and nothing else. Any other + body from a project access token, including one that turns a setting + on, adds a field, sends `null`, or names a field the schema doesn't + have, gets `403` with code `person_required`, as does a request made + through MCP. A read-only project access token is refused as read-only + first, without a code, + and so is the owner of a read-only account. + + `code_quality.enabled: true` turns on LavaFlow Code Quality, which + reviews the lines each production deploy of a frontend changes and + turns what it confirms into issues and pull requests. Function deploys + ask for no scan yet. It needs the project's `lavaflow.code_quality` + capability: while Code Quality isn't released here the save answers + `400` with code `feature_unavailable`, and while the owner's plan + allows no Code Quality findings it answers `403` with code + `plan_required`. Only the owner can turn it on, with the check below. + Turning it off always works, and drops the deploys waiting to be + scanned. + + Under `autonomy: open_pr`, when `lavaflow.repository_ci` is available + and the owner has granted `allow_ungated_workflows` for the connected + repository, LavaFlow opens reviewed fixes ready for review without a CI-skip marker + or checking workflows for approval. The repository controls which CI + runs and which credentials it uses. A person still merges the fix. + A review that did not pass opens a draft without suppressing CI. + Without this permission, LavaFlow retains its guarded publication + policy, including workflow checks and CI-skip markers, and may hold + a fix instead of opening a pull request where CI could run it with + credentials before review. Capability availability alone never grants + repository permission. Changing the repository or GitHub App + installation clears the permission. Revocation affects later writes; + it does not cancel existing pull requests or CI runs. + For consent tied to the repository shown to the owner, send + `expected_repository` with its `repo_id` and `repo_installation_id`. + The save checks both under its transaction lock, including an + idempotent grant. A mismatch returns `409 repository_changed` without + changing settings or audit history. Refresh the connection and ask the + owner again; never automatically retry with the new connection. + The same normal CI policy applies when LavaFlow leaves merging to a + person. In Merge mode, fixes from connected reports can use normal + repository CI after LavaFlow verifies the repository revision and + current source authorization. Without the CI grant, they follow + guarded workflow checks. All fixes must satisfy the project's merge + policy and the repository's required checks and approvals. + Code Quality follows the project's autonomy and opens a pull request + only after its review passes. + + `autonomy: merge` needs the project's `lavaflow.merge` capability. + Without it, a save that sets `autonomy` to `merge`, or changes + `merge_policy`, answers `400` with code `feature_unavailable`. A save + that sends the saved values again passes this check, though it can + still need the owner's check below, and a project at `merge` can + still change to another autonomy. The save doesn't read the + repository's branch rules: LavaFlow merges only into a base branch + that requires at least one status check, and holds every fix with + `no_required_checks` on any other. + + Changing `autonomy` to `merge` lets LavaFlow merge with no one else + looking. So does turning `enabled` on while `autonomy` stays `merge`, + and changing `merge_policy`, to any value, while `autonomy` is, or + becomes, `merge`. Turning `allow_ungated_workflows` on lets LavaFlow + open a fix where a workflow could run it with the repository's + secrets before a person approves it. Turning `code_quality` on starts + work on every frontend production deploy with no incident behind it. + Only the owner can make these changes, with a credential of + their own that expires: a `volcano login` token + whose sign-in is live, a live Volcano dashboard sign-in, or a + platform token with an expiry. The owner's + GitHub account must also be able to push to the project's repository. + A project access token, MCP, a platform token that never expires, a + sign-in that ended, an owner who can't push, and a project with no + repository get `403` with code `person_required`, and nothing is + saved. Turning LavaFlow, `allow_ungated_workflows` or `code_quality` + off needs no check. + Nothing is saved either when the push check can't be answered (`429` + or `503`, with `Retry-After`). When the project points at another + repository, reaches its repository through another Volcano GitHub App + installation, or points at none, `autonomy` changes from `merge` to + `open_pr`; pointing back doesn't change it back. Reconnecting after a + reinstall of the App counts as another installation. + + Turning LavaFlow on needs a plan that includes it (`403`, code + `plan_required`). LavaFlow is available where the project's + `lavaflow` capability is, which includes the owner's plan. Where it is + not, a project with LavaFlow records can still turn LavaFlow, Code + Quality or both off: a save that sends `enabled: false`, + `code_quality: {enabled: false}` or both, and otherwise only + `allow_ungated_workflows: false` sent with `enabled`. Any other save, + and any save for a project without records, answers `404` with code + `feature_unavailable` while LavaFlow is not offered to the project, and + `403` with code `plan_required` when it is but the owner's plan does + not include it. + + Args: + body (LavaflowSettingsUpdate): The project, and at least one field to change. An omitted + field keeps its saved value. A repository precondition alone is not a setting change. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | LavaflowSettings + """ + + + return (await asyncio_detailed( + client=client, +body=body, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/logs/get_project_log_activity.py b/src/volcano_sdk/_generated/api/logs/get_project_log_activity.py index a764a6b9..89f3fe67 100644 --- a/src/volcano_sdk/_generated/api/logs/get_project_log_activity.py +++ b/src/volcano_sdk/_generated/api/logs/get_project_log_activity.py @@ -79,6 +79,13 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return response_404 + if response.status_code == 413: + response_413 = Error.from_dict(response.json()) + + + + return response_413 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -104,11 +111,16 @@ def sync_detailed( """ Get project log activity Retrieve bucketed log counts for one resource type in the project. Set - `resource.type` to `function`, `frontend`, or `database`. Add + `resource.type` to `function`, `frontend`, `database`, or `app`. Add `resource.ids` to filter to one or more resources, and add `resource.deployments.ids` to count deployment logs instead of runtime logs for functions and frontends. Deployment logs are not supported for - databases. Database logs are a SUPERAGENT feature; `resource.type=database` + databases or apps. `app` counts the entries a first-party app, such as + the Builder, wrote into the project; an app's ID is UUIDv5 of its slug + (see `LogResource.id`). With no entries it answers 200 with none; an unknown app in `resource.ids` + answers 404 `app not found`. The `app_logs` release gate controls new writes only: entries already + written stay readable when it closes. Database logs are a SUPERAGENT feature; + `resource.type=database` from a HOBBY project owner returns 403. The activity window is limited to the plan's retention window (HOBBY: 1 day, SUPERAGENT: 30 days); older start times are clamped to that window. Buckets are aligned to UTC clock @@ -150,11 +162,16 @@ def sync( """ Get project log activity Retrieve bucketed log counts for one resource type in the project. Set - `resource.type` to `function`, `frontend`, or `database`. Add + `resource.type` to `function`, `frontend`, `database`, or `app`. Add `resource.ids` to filter to one or more resources, and add `resource.deployments.ids` to count deployment logs instead of runtime logs for functions and frontends. Deployment logs are not supported for - databases. Database logs are a SUPERAGENT feature; `resource.type=database` + databases or apps. `app` counts the entries a first-party app, such as + the Builder, wrote into the project; an app's ID is UUIDv5 of its slug + (see `LogResource.id`). With no entries it answers 200 with none; an unknown app in `resource.ids` + answers 404 `app not found`. The `app_logs` release gate controls new writes only: entries already + written stay readable when it closes. Database logs are a SUPERAGENT feature; + `resource.type=database` from a HOBBY project owner returns 403. The activity window is limited to the plan's retention window (HOBBY: 1 day, SUPERAGENT: 30 days); older start times are clamped to that window. Buckets are aligned to UTC clock @@ -191,11 +208,16 @@ async def asyncio_detailed( """ Get project log activity Retrieve bucketed log counts for one resource type in the project. Set - `resource.type` to `function`, `frontend`, or `database`. Add + `resource.type` to `function`, `frontend`, `database`, or `app`. Add `resource.ids` to filter to one or more resources, and add `resource.deployments.ids` to count deployment logs instead of runtime logs for functions and frontends. Deployment logs are not supported for - databases. Database logs are a SUPERAGENT feature; `resource.type=database` + databases or apps. `app` counts the entries a first-party app, such as + the Builder, wrote into the project; an app's ID is UUIDv5 of its slug + (see `LogResource.id`). With no entries it answers 200 with none; an unknown app in `resource.ids` + answers 404 `app not found`. The `app_logs` release gate controls new writes only: entries already + written stay readable when it closes. Database logs are a SUPERAGENT feature; + `resource.type=database` from a HOBBY project owner returns 403. The activity window is limited to the plan's retention window (HOBBY: 1 day, SUPERAGENT: 30 days); older start times are clamped to that window. Buckets are aligned to UTC clock @@ -237,11 +259,16 @@ async def asyncio( """ Get project log activity Retrieve bucketed log counts for one resource type in the project. Set - `resource.type` to `function`, `frontend`, or `database`. Add + `resource.type` to `function`, `frontend`, `database`, or `app`. Add `resource.ids` to filter to one or more resources, and add `resource.deployments.ids` to count deployment logs instead of runtime logs for functions and frontends. Deployment logs are not supported for - databases. Database logs are a SUPERAGENT feature; `resource.type=database` + databases or apps. `app` counts the entries a first-party app, such as + the Builder, wrote into the project; an app's ID is UUIDv5 of its slug + (see `LogResource.id`). With no entries it answers 200 with none; an unknown app in `resource.ids` + answers 404 `app not found`. The `app_logs` release gate controls new writes only: entries already + written stay readable when it closes. Database logs are a SUPERAGENT feature; + `resource.type=database` from a HOBBY project owner returns 403. The activity window is limited to the plan's retention window (HOBBY: 1 day, SUPERAGENT: 30 days); older start times are clamped to that window. Buckets are aligned to UTC clock diff --git a/src/volcano_sdk/_generated/api/logs/search_project_logs.py b/src/volcano_sdk/_generated/api/logs/search_project_logs.py index e07dbb38..cf441ae1 100644 --- a/src/volcano_sdk/_generated/api/logs/search_project_logs.py +++ b/src/volcano_sdk/_generated/api/logs/search_project_logs.py @@ -79,6 +79,13 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return response_404 + if response.status_code == 413: + response_413 = Error.from_dict(response.json()) + + + + return response_413 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -104,11 +111,15 @@ def sync_detailed( """ Search project logs Search or filter logs for one resource type in the project. Set - `resource.type` to `function`, `frontend`, or `database`. Add + `resource.type` to `function`, `frontend`, `database`, or `app`. Add `resource.ids` to filter to one or more resources, and add `resource.deployments.ids` to read deployment logs instead of runtime logs for functions and frontends. Deployment logs are not supported for - databases. Database logs are a SUPERAGENT feature; requests for + databases or apps. `app` reads the entries a first-party app, such as + the Builder, wrote into the project; an app's ID is UUIDv5 of its slug + (see `LogResource.id`). With no entries it answers 200 with none; an unknown app in `resource.ids` + answers 404 `app not found`. The `app_logs` release gate controls new writes only: entries already + written stay readable when it closes. Database logs are a SUPERAGENT feature; requests for `resource.type=database` from a HOBBY project owner return 403. Log history (runtime and deployment) is limited to the plan's retention window (HOBBY: 1 day, SUPERAGENT: 30 days); older time ranges are clamped to that @@ -149,11 +160,15 @@ def sync( """ Search project logs Search or filter logs for one resource type in the project. Set - `resource.type` to `function`, `frontend`, or `database`. Add + `resource.type` to `function`, `frontend`, `database`, or `app`. Add `resource.ids` to filter to one or more resources, and add `resource.deployments.ids` to read deployment logs instead of runtime logs for functions and frontends. Deployment logs are not supported for - databases. Database logs are a SUPERAGENT feature; requests for + databases or apps. `app` reads the entries a first-party app, such as + the Builder, wrote into the project; an app's ID is UUIDv5 of its slug + (see `LogResource.id`). With no entries it answers 200 with none; an unknown app in `resource.ids` + answers 404 `app not found`. The `app_logs` release gate controls new writes only: entries already + written stay readable when it closes. Database logs are a SUPERAGENT feature; requests for `resource.type=database` from a HOBBY project owner return 403. Log history (runtime and deployment) is limited to the plan's retention window (HOBBY: 1 day, SUPERAGENT: 30 days); older time ranges are clamped to that @@ -189,11 +204,15 @@ async def asyncio_detailed( """ Search project logs Search or filter logs for one resource type in the project. Set - `resource.type` to `function`, `frontend`, or `database`. Add + `resource.type` to `function`, `frontend`, `database`, or `app`. Add `resource.ids` to filter to one or more resources, and add `resource.deployments.ids` to read deployment logs instead of runtime logs for functions and frontends. Deployment logs are not supported for - databases. Database logs are a SUPERAGENT feature; requests for + databases or apps. `app` reads the entries a first-party app, such as + the Builder, wrote into the project; an app's ID is UUIDv5 of its slug + (see `LogResource.id`). With no entries it answers 200 with none; an unknown app in `resource.ids` + answers 404 `app not found`. The `app_logs` release gate controls new writes only: entries already + written stay readable when it closes. Database logs are a SUPERAGENT feature; requests for `resource.type=database` from a HOBBY project owner return 403. Log history (runtime and deployment) is limited to the plan's retention window (HOBBY: 1 day, SUPERAGENT: 30 days); older time ranges are clamped to that @@ -234,11 +253,15 @@ async def asyncio( """ Search project logs Search or filter logs for one resource type in the project. Set - `resource.type` to `function`, `frontend`, or `database`. Add + `resource.type` to `function`, `frontend`, `database`, or `app`. Add `resource.ids` to filter to one or more resources, and add `resource.deployments.ids` to read deployment logs instead of runtime logs for functions and frontends. Deployment logs are not supported for - databases. Database logs are a SUPERAGENT feature; requests for + databases or apps. `app` reads the entries a first-party app, such as + the Builder, wrote into the project; an app's ID is UUIDv5 of its slug + (see `LogResource.id`). With no entries it answers 200 with none; an unknown app in `resource.ids` + answers 404 `app not found`. The `app_logs` release gate controls new writes only: entries already + written stay readable when it closes. Database logs are a SUPERAGENT feature; requests for `resource.type=database` from a HOBBY project owner return 403. Log history (runtime and deployment) is limited to the plan's retention window (HOBBY: 1 day, SUPERAGENT: 30 days); older time ranges are clamped to that diff --git a/src/volcano_sdk/_generated/api/logs/stream_project_logs.py b/src/volcano_sdk/_generated/api/logs/stream_project_logs.py index eb1d7fed..f1b04b50 100644 --- a/src/volcano_sdk/_generated/api/logs/stream_project_logs.py +++ b/src/volcano_sdk/_generated/api/logs/stream_project_logs.py @@ -88,6 +88,13 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return response_404 + if response.status_code == 413: + response_413 = Error.from_dict(response.json()) + + + + return response_413 + if response.status_code == 500: response_500 = Error.from_dict(response.json()) diff --git a/src/volcano_sdk/_generated/api/notifications/__init__.py b/src/volcano_sdk/_generated/api/notifications/__init__.py new file mode 100644 index 00000000..c9921b5f --- /dev/null +++ b/src/volcano_sdk/_generated/api/notifications/__init__.py @@ -0,0 +1 @@ +""" Contains endpoint functions for accessing the API """ diff --git a/src/volcano_sdk/_generated/api/notifications/get_notification_settings.py b/src/volcano_sdk/_generated/api/notifications/get_notification_settings.py new file mode 100644 index 00000000..d7ff57b0 --- /dev/null +++ b/src/volcano_sdk/_generated/api/notifications/get_notification_settings.py @@ -0,0 +1,223 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from ...models.notification_settings import NotificationSettings +from typing import cast +from uuid import UUID + + + +def request_kwargs( + id: UUID | str, + +) -> dict[str, Any]: + + + + + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/projects/{id}/notifications".format(id=quote(str(id), safe=""),), + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | NotificationSettings | None: + if response.status_code == 200: + response_200 = NotificationSettings.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | NotificationSettings]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Response[Error | NotificationSettings]: + """ Get notification settings + + Returns where the project's alerts go and when a failing scheduler is + announced. A project that never saved settings returns the defaults: + email to the project owner, no webhook, and an alert after 3 failed + runs in a row, followed by one when the scheduler recovers. + + The webhook signing secret is never returned here; `secret_configured` + shows whether one is set. A read-only project access token is refused + with `403`, because the webhook URL can carry the receiver's token. + + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | NotificationSettings] + """ + + + kwargs = request_kwargs( + id=id, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Error | NotificationSettings | None: + """ Get notification settings + + Returns where the project's alerts go and when a failing scheduler is + announced. A project that never saved settings returns the defaults: + email to the project owner, no webhook, and an alert after 3 failed + runs in a row, followed by one when the scheduler recovers. + + The webhook signing secret is never returned here; `secret_configured` + shows whether one is set. A read-only project access token is refused + with `403`, because the webhook URL can carry the receiver's token. + + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | NotificationSettings + """ + + + return sync_detailed( + id=id, +client=client, + + ).parsed + +async def asyncio_detailed( + id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Response[Error | NotificationSettings]: + """ Get notification settings + + Returns where the project's alerts go and when a failing scheduler is + announced. A project that never saved settings returns the defaults: + email to the project owner, no webhook, and an alert after 3 failed + runs in a row, followed by one when the scheduler recovers. + + The webhook signing secret is never returned here; `secret_configured` + shows whether one is set. A read-only project access token is refused + with `403`, because the webhook URL can carry the receiver's token. + + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | NotificationSettings] + """ + + + kwargs = request_kwargs( + id=id, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Error | NotificationSettings | None: + """ Get notification settings + + Returns where the project's alerts go and when a failing scheduler is + announced. A project that never saved settings returns the defaults: + email to the project owner, no webhook, and an alert after 3 failed + runs in a row, followed by one when the scheduler recovers. + + The webhook signing secret is never returned here; `secret_configured` + shows whether one is set. A read-only project access token is refused + with `403`, because the webhook URL can carry the receiver's token. + + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | NotificationSettings + """ + + + return (await asyncio_detailed( + id=id, +client=client, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/notifications/rotate_notification_webhook_secret.py b/src/volcano_sdk/_generated/api/notifications/rotate_notification_webhook_secret.py new file mode 100644 index 00000000..41bff906 --- /dev/null +++ b/src/volcano_sdk/_generated/api/notifications/rotate_notification_webhook_secret.py @@ -0,0 +1,210 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from ...models.notification_settings import NotificationSettings +from typing import cast +from uuid import UUID + + + +def request_kwargs( + id: UUID | str, + +) -> dict[str, Any]: + + + + + + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/projects/{id}/notifications/webhook-secret".format(id=quote(str(id), safe=""),), + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | NotificationSettings | None: + if response.status_code == 200: + response_200 = NotificationSettings.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 409: + response_409 = Error.from_dict(response.json()) + + + + return response_409 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | NotificationSettings]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Response[Error | NotificationSettings]: + """ Rotate the webhook signing secret + + Replaces the webhook signing secret and returns the settings with the + new one in `webhook.secret`, this once. Every delivery from now on is + signed with the new secret, including retries of earlier alerts. + + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | NotificationSettings] + """ + + + kwargs = request_kwargs( + id=id, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Error | NotificationSettings | None: + """ Rotate the webhook signing secret + + Replaces the webhook signing secret and returns the settings with the + new one in `webhook.secret`, this once. Every delivery from now on is + signed with the new secret, including retries of earlier alerts. + + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | NotificationSettings + """ + + + return sync_detailed( + id=id, +client=client, + + ).parsed + +async def asyncio_detailed( + id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Response[Error | NotificationSettings]: + """ Rotate the webhook signing secret + + Replaces the webhook signing secret and returns the settings with the + new one in `webhook.secret`, this once. Every delivery from now on is + signed with the new secret, including retries of earlier alerts. + + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | NotificationSettings] + """ + + + kwargs = request_kwargs( + id=id, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Error | NotificationSettings | None: + """ Rotate the webhook signing secret + + Replaces the webhook signing secret and returns the settings with the + new one in `webhook.secret`, this once. Every delivery from now on is + signed with the new secret, including retries of earlier alerts. + + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | NotificationSettings + """ + + + return (await asyncio_detailed( + id=id, +client=client, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/notifications/send_test_notification.py b/src/volcano_sdk/_generated/api/notifications/send_test_notification.py new file mode 100644 index 00000000..193121c3 --- /dev/null +++ b/src/volcano_sdk/_generated/api/notifications/send_test_notification.py @@ -0,0 +1,225 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from ...models.notification_test_result import NotificationTestResult +from typing import cast +from uuid import UUID + + + +def request_kwargs( + id: UUID | str, + +) -> dict[str, Any]: + + + + + + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/projects/{id}/notifications/test".format(id=quote(str(id), safe=""),), + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | NotificationTestResult | None: + if response.status_code == 200: + response_200 = NotificationTestResult.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 409: + response_409 = Error.from_dict(response.json()) + + + + return response_409 + + if response.status_code == 429: + response_429 = Error.from_dict(response.json()) + + + + return response_429 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | NotificationTestResult]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Response[Error | NotificationTestResult]: + """ Send a test notification + + Sends a `notification.test` event on every channel that delivers + right away and reports how each delivery went. A webhook delivery is + signed like an alert. Enabled email is reported undelivered, without + sending, while the project owner has no verified account email + address. One test per project per minute. + + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | NotificationTestResult] + """ + + + kwargs = request_kwargs( + id=id, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Error | NotificationTestResult | None: + """ Send a test notification + + Sends a `notification.test` event on every channel that delivers + right away and reports how each delivery went. A webhook delivery is + signed like an alert. Enabled email is reported undelivered, without + sending, while the project owner has no verified account email + address. One test per project per minute. + + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | NotificationTestResult + """ + + + return sync_detailed( + id=id, +client=client, + + ).parsed + +async def asyncio_detailed( + id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Response[Error | NotificationTestResult]: + """ Send a test notification + + Sends a `notification.test` event on every channel that delivers + right away and reports how each delivery went. A webhook delivery is + signed like an alert. Enabled email is reported undelivered, without + sending, while the project owner has no verified account email + address. One test per project per minute. + + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | NotificationTestResult] + """ + + + kwargs = request_kwargs( + id=id, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Error | NotificationTestResult | None: + """ Send a test notification + + Sends a `notification.test` event on every channel that delivers + right away and reports how each delivery went. A webhook delivery is + signed like an alert. Enabled email is reported undelivered, without + sending, while the project owner has no verified account email + address. One test per project per minute. + + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | NotificationTestResult + """ + + + return (await asyncio_detailed( + id=id, +client=client, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/notifications/update_notification_settings.py b/src/volcano_sdk/_generated/api/notifications/update_notification_settings.py new file mode 100644 index 00000000..b92f1ac2 --- /dev/null +++ b/src/volcano_sdk/_generated/api/notifications/update_notification_settings.py @@ -0,0 +1,286 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from ...models.notification_settings import NotificationSettings +from ...models.update_notification_settings_request import UpdateNotificationSettingsRequest +from typing import cast +from uuid import UUID + + + +def request_kwargs( + id: UUID | str, + *, + body: UpdateNotificationSettingsRequest, + +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + + + + + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/projects/{id}/notifications".format(id=quote(str(id), safe=""),), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | NotificationSettings | None: + if response.status_code == 200: + response_200 = NotificationSettings.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | NotificationSettings]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID | str, + *, + client: AuthenticatedClient, + body: UpdateNotificationSettingsRequest, + +) -> Response[Error | NotificationSettings]: + """ Update notification settings + + Changes the project's notification settings. Omitted fields keep their + current values, so `{"email": {"enabled": false}}` only turns email off. + + Alert emails go only to the project owner's verified account email + address. `email.recipients` may be empty or name that address; any + other list is refused with `400`, and so is any non-empty list while + the owner has no verified address. `email.status` in the response + says whether alerts are being emailed. + + Setting `webhook.url` on a project without a webhook generates its + signing secret, returned in `webhook.secret` in this response only. + Changing the URL keeps the secret. An empty `webhook.url` removes the + webhook and its secret. + + Outside local mode the webhook must be reachable on the public + internet; a URL naming a private or loopback address is refused, and + so is a delivery to a host name that resolves to one. + + Args: + id (UUID): + body (UpdateNotificationSettingsRequest): Omitted fields keep their current values. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | NotificationSettings] + """ + + + kwargs = request_kwargs( + id=id, +body=body, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + id: UUID | str, + *, + client: AuthenticatedClient, + body: UpdateNotificationSettingsRequest, + +) -> Error | NotificationSettings | None: + """ Update notification settings + + Changes the project's notification settings. Omitted fields keep their + current values, so `{"email": {"enabled": false}}` only turns email off. + + Alert emails go only to the project owner's verified account email + address. `email.recipients` may be empty or name that address; any + other list is refused with `400`, and so is any non-empty list while + the owner has no verified address. `email.status` in the response + says whether alerts are being emailed. + + Setting `webhook.url` on a project without a webhook generates its + signing secret, returned in `webhook.secret` in this response only. + Changing the URL keeps the secret. An empty `webhook.url` removes the + webhook and its secret. + + Outside local mode the webhook must be reachable on the public + internet; a URL naming a private or loopback address is refused, and + so is a delivery to a host name that resolves to one. + + Args: + id (UUID): + body (UpdateNotificationSettingsRequest): Omitted fields keep their current values. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | NotificationSettings + """ + + + return sync_detailed( + id=id, +client=client, +body=body, + + ).parsed + +async def asyncio_detailed( + id: UUID | str, + *, + client: AuthenticatedClient, + body: UpdateNotificationSettingsRequest, + +) -> Response[Error | NotificationSettings]: + """ Update notification settings + + Changes the project's notification settings. Omitted fields keep their + current values, so `{"email": {"enabled": false}}` only turns email off. + + Alert emails go only to the project owner's verified account email + address. `email.recipients` may be empty or name that address; any + other list is refused with `400`, and so is any non-empty list while + the owner has no verified address. `email.status` in the response + says whether alerts are being emailed. + + Setting `webhook.url` on a project without a webhook generates its + signing secret, returned in `webhook.secret` in this response only. + Changing the URL keeps the secret. An empty `webhook.url` removes the + webhook and its secret. + + Outside local mode the webhook must be reachable on the public + internet; a URL naming a private or loopback address is refused, and + so is a delivery to a host name that resolves to one. + + Args: + id (UUID): + body (UpdateNotificationSettingsRequest): Omitted fields keep their current values. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | NotificationSettings] + """ + + + kwargs = request_kwargs( + id=id, +body=body, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + id: UUID | str, + *, + client: AuthenticatedClient, + body: UpdateNotificationSettingsRequest, + +) -> Error | NotificationSettings | None: + """ Update notification settings + + Changes the project's notification settings. Omitted fields keep their + current values, so `{"email": {"enabled": false}}` only turns email off. + + Alert emails go only to the project owner's verified account email + address. `email.recipients` may be empty or name that address; any + other list is refused with `400`, and so is any non-empty list while + the owner has no verified address. `email.status` in the response + says whether alerts are being emailed. + + Setting `webhook.url` on a project without a webhook generates its + signing secret, returned in `webhook.secret` in this response only. + Changing the URL keeps the secret. An empty `webhook.url` removes the + webhook and its secret. + + Outside local mode the webhook must be reachable on the public + internet; a URL naming a private or loopback address is refused, and + so is a delivery to a host name that resolves to one. + + Args: + id (UUID): + body (UpdateNotificationSettingsRequest): Omitted fields keep their current values. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | NotificationSettings + """ + + + return (await asyncio_detailed( + id=id, +client=client, +body=body, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/o_auth_authentication/auth_list_o_auth_providers.py b/src/volcano_sdk/_generated/api/o_auth_authentication/auth_list_o_auth_providers.py index e0b63e04..b3311c1a 100644 --- a/src/volcano_sdk/_generated/api/o_auth_authentication/auth_list_o_auth_providers.py +++ b/src/volcano_sdk/_generated/api/o_auth_authentication/auth_list_o_auth_providers.py @@ -70,7 +70,11 @@ def sync_detailed( ) -> Response[AuthListOAuthProvidersResponse200 | Error]: """ List user's linked providers - Get list of OAuth providers linked to current user + Lists the OAuth providers linked to the signed-in user, with the + user's own account ID at each provider. Match on `provider_user_id`, + which never changes, rather than on the login or email. For + GitHub, it is the numeric user ID that GitHub reports elsewhere, such + as a webhook's `sender.id`. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -98,7 +102,11 @@ def sync( ) -> AuthListOAuthProvidersResponse200 | Error | None: """ List user's linked providers - Get list of OAuth providers linked to current user + Lists the OAuth providers linked to the signed-in user, with the + user's own account ID at each provider. Match on `provider_user_id`, + which never changes, rather than on the login or email. For + GitHub, it is the numeric user ID that GitHub reports elsewhere, such + as a webhook's `sender.id`. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -121,7 +129,11 @@ async def asyncio_detailed( ) -> Response[AuthListOAuthProvidersResponse200 | Error]: """ List user's linked providers - Get list of OAuth providers linked to current user + Lists the OAuth providers linked to the signed-in user, with the + user's own account ID at each provider. Match on `provider_user_id`, + which never changes, rather than on the login or email. For + GitHub, it is the numeric user ID that GitHub reports elsewhere, such + as a webhook's `sender.id`. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -149,7 +161,11 @@ async def asyncio( ) -> AuthListOAuthProvidersResponse200 | Error | None: """ List user's linked providers - Get list of OAuth providers linked to current user + Lists the OAuth providers linked to the signed-in user, with the + user's own account ID at each provider. Match on `provider_user_id`, + which never changes, rather than on the login or email. For + GitHub, it is the numeric user ID that GitHub reports elsewhere, such + as a webhook's `sender.id`. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/volcano_sdk/_generated/api/o_auth_authentication/auth_o_auth_callback.py b/src/volcano_sdk/_generated/api/o_auth_authentication/auth_o_auth_callback.py index 01e3b448..a4e87286 100644 --- a/src/volcano_sdk/_generated/api/o_auth_authentication/auth_o_auth_callback.py +++ b/src/volcano_sdk/_generated/api/o_auth_authentication/auth_o_auth_callback.py @@ -78,6 +78,10 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res response_403 = cast(Any, None) return response_403 + if response.status_code == 404: + response_404 = cast(Any, None) + return response_404 + if response.status_code == 409: response_409 = cast(Any, None) return response_409 diff --git a/src/volcano_sdk/_generated/api/o_auth_authentication/auth_unlink_o_auth_provider.py b/src/volcano_sdk/_generated/api/o_auth_authentication/auth_unlink_o_auth_provider.py index 54011edc..3adfc702 100644 --- a/src/volcano_sdk/_generated/api/o_auth_authentication/auth_unlink_o_auth_provider.py +++ b/src/volcano_sdk/_generated/api/o_auth_authentication/auth_unlink_o_auth_provider.py @@ -84,8 +84,10 @@ def sync_detailed( ) -> Response[Any | Error]: """ Unlink OAuth provider - Remove OAuth provider from user's account. - Cannot unlink if it's the only authentication method. + Remove OAuth provider from user's account. Refused when the account would + have no other way to sign in: another linked OAuth provider that's enabled + for the project, or a password while email/password sign-in is on for the + project (`enable_email_password`). Args: provider (AuthUnlinkOAuthProviderProvider): @@ -118,8 +120,10 @@ def sync( ) -> Any | Error | None: """ Unlink OAuth provider - Remove OAuth provider from user's account. - Cannot unlink if it's the only authentication method. + Remove OAuth provider from user's account. Refused when the account would + have no other way to sign in: another linked OAuth provider that's enabled + for the project, or a password while email/password sign-in is on for the + project (`enable_email_password`). Args: provider (AuthUnlinkOAuthProviderProvider): @@ -147,8 +151,10 @@ async def asyncio_detailed( ) -> Response[Any | Error]: """ Unlink OAuth provider - Remove OAuth provider from user's account. - Cannot unlink if it's the only authentication method. + Remove OAuth provider from user's account. Refused when the account would + have no other way to sign in: another linked OAuth provider that's enabled + for the project, or a password while email/password sign-in is on for the + project (`enable_email_password`). Args: provider (AuthUnlinkOAuthProviderProvider): @@ -181,8 +187,10 @@ async def asyncio( ) -> Any | Error | None: """ Unlink OAuth provider - Remove OAuth provider from user's account. - Cannot unlink if it's the only authentication method. + Remove OAuth provider from user's account. Refused when the account would + have no other way to sign in: another linked OAuth provider that's enabled + for the project, or a password while email/password sign-in is on for the + project (`enable_email_password`). Args: provider (AuthUnlinkOAuthProviderProvider): diff --git a/src/volcano_sdk/_generated/api/o_auth_authentication/call_o_auth_provider_api.py b/src/volcano_sdk/_generated/api/o_auth_authentication/call_o_auth_provider_api.py index dc0faa4f..e7decc69 100644 --- a/src/volcano_sdk/_generated/api/o_auth_authentication/call_o_auth_provider_api.py +++ b/src/volcano_sdk/_generated/api/o_auth_authentication/call_o_auth_provider_api.py @@ -73,6 +73,13 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return response_404 + if response.status_code == 413: + response_413 = Error.from_dict(response.json()) + + + + return response_413 + if response.status_code == 500: response_500 = Error.from_dict(response.json()) diff --git a/src/volcano_sdk/_generated/api/project_access_tokens/list_project_access_tokens.py b/src/volcano_sdk/_generated/api/project_access_tokens/list_project_access_tokens.py index c84f3230..3ce82853 100644 --- a/src/volcano_sdk/_generated/api/project_access_tokens/list_project_access_tokens.py +++ b/src/volcano_sdk/_generated/api/project_access_tokens/list_project_access_tokens.py @@ -23,6 +23,7 @@ def request_kwargs( limit: int | Unset = 10, search: str | Unset = UNSET, include_revoked: bool | Unset = False, + include_delegated: bool | Unset = False, ) -> dict[str, Any]: @@ -39,6 +40,8 @@ def request_kwargs( params["include_revoked"] = include_revoked + params["include_delegated"] = include_delegated + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} @@ -106,6 +109,7 @@ def sync_detailed( limit: int | Unset = 10, search: str | Unset = UNSET, include_revoked: bool | Unset = False, + include_delegated: bool | Unset = False, ) -> Response[Error | PaginatedProjectAccessTokens]: """ List a project's access tokens @@ -118,6 +122,12 @@ def sync_detailed( 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. + Delegated grants are hidden by default too. A first-party app you have + allowed to act on this project mints one every few minutes, and you + revoke the app's access as a whole rather than grant by grant. Pass + `include_delegated=true` to list them; they have scope `delegated`. + They never count toward the project's limit of 100 live tokens. + Requires a platform token. A project access token cannot manage project access tokens, so a leaked credential cannot enumerate or replace itself. @@ -127,6 +137,7 @@ def sync_detailed( limit (int | Unset): Default: 10. search (str | Unset): include_revoked (bool | Unset): Default: False. + include_delegated (bool | Unset): Default: False. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -143,6 +154,7 @@ def sync_detailed( limit=limit, search=search, include_revoked=include_revoked, +include_delegated=include_delegated, ) @@ -160,6 +172,7 @@ def sync( limit: int | Unset = 10, search: str | Unset = UNSET, include_revoked: bool | Unset = False, + include_delegated: bool | Unset = False, ) -> Error | PaginatedProjectAccessTokens | None: """ List a project's access tokens @@ -172,6 +185,12 @@ def sync( 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. + Delegated grants are hidden by default too. A first-party app you have + allowed to act on this project mints one every few minutes, and you + revoke the app's access as a whole rather than grant by grant. Pass + `include_delegated=true` to list them; they have scope `delegated`. + They never count toward the project's limit of 100 live tokens. + Requires a platform token. A project access token cannot manage project access tokens, so a leaked credential cannot enumerate or replace itself. @@ -181,6 +200,7 @@ def sync( limit (int | Unset): Default: 10. search (str | Unset): include_revoked (bool | Unset): Default: False. + include_delegated (bool | Unset): Default: False. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -198,6 +218,7 @@ def sync( limit=limit, search=search, include_revoked=include_revoked, +include_delegated=include_delegated, ).parsed @@ -209,6 +230,7 @@ async def asyncio_detailed( limit: int | Unset = 10, search: str | Unset = UNSET, include_revoked: bool | Unset = False, + include_delegated: bool | Unset = False, ) -> Response[Error | PaginatedProjectAccessTokens]: """ List a project's access tokens @@ -221,6 +243,12 @@ async def asyncio_detailed( 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. + Delegated grants are hidden by default too. A first-party app you have + allowed to act on this project mints one every few minutes, and you + revoke the app's access as a whole rather than grant by grant. Pass + `include_delegated=true` to list them; they have scope `delegated`. + They never count toward the project's limit of 100 live tokens. + Requires a platform token. A project access token cannot manage project access tokens, so a leaked credential cannot enumerate or replace itself. @@ -230,6 +258,7 @@ async def asyncio_detailed( limit (int | Unset): Default: 10. search (str | Unset): include_revoked (bool | Unset): Default: False. + include_delegated (bool | Unset): Default: False. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -246,6 +275,7 @@ async def asyncio_detailed( limit=limit, search=search, include_revoked=include_revoked, +include_delegated=include_delegated, ) @@ -263,6 +293,7 @@ async def asyncio( limit: int | Unset = 10, search: str | Unset = UNSET, include_revoked: bool | Unset = False, + include_delegated: bool | Unset = False, ) -> Error | PaginatedProjectAccessTokens | None: """ List a project's access tokens @@ -275,6 +306,12 @@ async def asyncio( 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. + Delegated grants are hidden by default too. A first-party app you have + allowed to act on this project mints one every few minutes, and you + revoke the app's access as a whole rather than grant by grant. Pass + `include_delegated=true` to list them; they have scope `delegated`. + They never count toward the project's limit of 100 live tokens. + Requires a platform token. A project access token cannot manage project access tokens, so a leaked credential cannot enumerate or replace itself. @@ -284,6 +321,7 @@ async def asyncio( limit (int | Unset): Default: 10. search (str | Unset): include_revoked (bool | Unset): Default: False. + include_delegated (bool | Unset): Default: False. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -301,5 +339,6 @@ async def asyncio( limit=limit, search=search, include_revoked=include_revoked, +include_delegated=include_delegated, )).parsed diff --git a/src/volcano_sdk/_generated/api/project_access_tokens/list_project_access_tokens_usage.py b/src/volcano_sdk/_generated/api/project_access_tokens/list_project_access_tokens_usage.py index 821aeb23..7b17184e 100644 --- a/src/volcano_sdk/_generated/api/project_access_tokens/list_project_access_tokens_usage.py +++ b/src/volcano_sdk/_generated/api/project_access_tokens/list_project_access_tokens_usage.py @@ -115,7 +115,9 @@ def sync_detailed( 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. + revocation is usually the reason you are looking. Delegated grants are + not, as the token list hides them by default; read one grant's usage by + its ID. `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. @@ -163,7 +165,9 @@ def sync( 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. + revocation is usually the reason you are looking. Delegated grants are + not, as the token list hides them by default; read one grant's usage by + its ID. `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. @@ -206,7 +210,9 @@ async def asyncio_detailed( 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. + revocation is usually the reason you are looking. Delegated grants are + not, as the token list hides them by default; read one grant's usage by + its ID. `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. @@ -254,7 +260,9 @@ async def asyncio( 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. + revocation is usually the reason you are looking. Delegated grants are + not, as the token list hides them by default; read one grant's usage by + its ID. `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. diff --git a/src/volcano_sdk/_generated/api/project_imports/complete_import_connect.py b/src/volcano_sdk/_generated/api/project_imports/complete_import_connect.py index fec25459..bcfd10e0 100644 --- a/src/volcano_sdk/_generated/api/project_imports/complete_import_connect.py +++ b/src/volcano_sdk/_generated/api/project_imports/complete_import_connect.py @@ -130,7 +130,10 @@ def sync_detailed( cookie created by startImportConnect. Args: - provider (ImportProvider): + provider (ImportProvider): Where an import comes from. `vercel` imports a Vercel project + through a Vercel Integration connection. `github` imports a GitHub repository through the + caller's own GitHub connection (`GET /user/git/connections`) and one of its Volcano GitHub + App installations; it has no connect flow of its own under `/user/imports`. state (str): code (str | Unset): error (str | Unset): @@ -185,7 +188,10 @@ def sync( cookie created by startImportConnect. Args: - provider (ImportProvider): + provider (ImportProvider): Where an import comes from. `vercel` imports a Vercel project + through a Vercel Integration connection. `github` imports a GitHub repository through the + caller's own GitHub connection (`GET /user/git/connections`) and one of its Volcano GitHub + App installations; it has no connect flow of its own under `/user/imports`. state (str): code (str | Unset): error (str | Unset): @@ -235,7 +241,10 @@ async def asyncio_detailed( cookie created by startImportConnect. Args: - provider (ImportProvider): + provider (ImportProvider): Where an import comes from. `vercel` imports a Vercel project + through a Vercel Integration connection. `github` imports a GitHub repository through the + caller's own GitHub connection (`GET /user/git/connections`) and one of its Volcano GitHub + App installations; it has no connect flow of its own under `/user/imports`. state (str): code (str | Unset): error (str | Unset): @@ -290,7 +299,10 @@ async def asyncio( cookie created by startImportConnect. Args: - provider (ImportProvider): + provider (ImportProvider): Where an import comes from. `vercel` imports a Vercel project + through a Vercel Integration connection. `github` imports a GitHub repository through the + caller's own GitHub connection (`GET /user/git/connections`) and one of its Volcano GitHub + App installations; it has no connect flow of its own under `/user/imports`. state (str): code (str | Unset): error (str | Unset): diff --git a/src/volcano_sdk/_generated/api/project_imports/get_project_import_run.py b/src/volcano_sdk/_generated/api/project_imports/get_project_import_run.py index 30c50e0d..4e6226eb 100644 --- a/src/volcano_sdk/_generated/api/project_imports/get_project_import_run.py +++ b/src/volcano_sdk/_generated/api/project_imports/get_project_import_run.py @@ -99,7 +99,10 @@ def sync_detailed( """ Get a project import run Args: - provider (ImportProvider): + provider (ImportProvider): Where an import comes from. `vercel` imports a Vercel project + through a Vercel Integration connection. `github` imports a GitHub repository through the + caller's own GitHub connection (`GET /user/git/connections`) and one of its Volcano GitHub + App installations; it has no connect flow of its own under `/user/imports`. run_id (UUID): Raises: @@ -133,7 +136,10 @@ def sync( """ Get a project import run Args: - provider (ImportProvider): + provider (ImportProvider): Where an import comes from. `vercel` imports a Vercel project + through a Vercel Integration connection. `github` imports a GitHub repository through the + caller's own GitHub connection (`GET /user/git/connections`) and one of its Volcano GitHub + App installations; it has no connect flow of its own under `/user/imports`. run_id (UUID): Raises: @@ -162,7 +168,10 @@ async def asyncio_detailed( """ Get a project import run Args: - provider (ImportProvider): + provider (ImportProvider): Where an import comes from. `vercel` imports a Vercel project + through a Vercel Integration connection. `github` imports a GitHub repository through the + caller's own GitHub connection (`GET /user/git/connections`) and one of its Volcano GitHub + App installations; it has no connect flow of its own under `/user/imports`. run_id (UUID): Raises: @@ -196,7 +205,10 @@ async def asyncio( """ Get a project import run Args: - provider (ImportProvider): + provider (ImportProvider): Where an import comes from. `vercel` imports a Vercel project + through a Vercel Integration connection. `github` imports a GitHub repository through the + caller's own GitHub connection (`GET /user/git/connections`) and one of its Volcano GitHub + App installations; it has no connect flow of its own under `/user/imports`. run_id (UUID): Raises: diff --git a/src/volcano_sdk/_generated/api/project_imports/list_import_sources.py b/src/volcano_sdk/_generated/api/project_imports/list_import_sources.py index a14b3612..16a6c0dc 100644 --- a/src/volcano_sdk/_generated/api/project_imports/list_import_sources.py +++ b/src/volcano_sdk/_generated/api/project_imports/list_import_sources.py @@ -135,10 +135,15 @@ def sync_detailed( ) -> Response[Error | ImportSourcesResponse]: """ List project sources available from a provider connection - Lists provider projects without changing provider or Volcano resources. + Lists provider projects without changing provider or Volcano resources. For `github`, lists every + repository the GitHub connection reaches through each of its Volcano GitHub App installations, with + its default branch and whether it is empty. Args: - provider (ImportProvider): + provider (ImportProvider): Where an import comes from. `vercel` imports a Vercel project + through a Vercel Integration connection. `github` imports a GitHub repository through the + caller's own GitHub connection (`GET /user/git/connections`) and one of its Volcano GitHub + App installations; it has no connect flow of its own under `/user/imports`. connection_id (UUID): Raises: @@ -171,10 +176,15 @@ def sync( ) -> Error | ImportSourcesResponse | None: """ List project sources available from a provider connection - Lists provider projects without changing provider or Volcano resources. + Lists provider projects without changing provider or Volcano resources. For `github`, lists every + repository the GitHub connection reaches through each of its Volcano GitHub App installations, with + its default branch and whether it is empty. Args: - provider (ImportProvider): + provider (ImportProvider): Where an import comes from. `vercel` imports a Vercel project + through a Vercel Integration connection. `github` imports a GitHub repository through the + caller's own GitHub connection (`GET /user/git/connections`) and one of its Volcano GitHub + App installations; it has no connect flow of its own under `/user/imports`. connection_id (UUID): Raises: @@ -202,10 +212,15 @@ async def asyncio_detailed( ) -> Response[Error | ImportSourcesResponse]: """ List project sources available from a provider connection - Lists provider projects without changing provider or Volcano resources. + Lists provider projects without changing provider or Volcano resources. For `github`, lists every + repository the GitHub connection reaches through each of its Volcano GitHub App installations, with + its default branch and whether it is empty. Args: - provider (ImportProvider): + provider (ImportProvider): Where an import comes from. `vercel` imports a Vercel project + through a Vercel Integration connection. `github` imports a GitHub repository through the + caller's own GitHub connection (`GET /user/git/connections`) and one of its Volcano GitHub + App installations; it has no connect flow of its own under `/user/imports`. connection_id (UUID): Raises: @@ -238,10 +253,15 @@ async def asyncio( ) -> Error | ImportSourcesResponse | None: """ List project sources available from a provider connection - Lists provider projects without changing provider or Volcano resources. + Lists provider projects without changing provider or Volcano resources. For `github`, lists every + repository the GitHub connection reaches through each of its Volcano GitHub App installations, with + its default branch and whether it is empty. Args: - provider (ImportProvider): + provider (ImportProvider): Where an import comes from. `vercel` imports a Vercel project + through a Vercel Integration connection. `github` imports a GitHub repository through the + caller's own GitHub connection (`GET /user/git/connections`) and one of its Volcano GitHub + App installations; it has no connect flow of its own under `/user/imports`. connection_id (UUID): Raises: diff --git a/src/volcano_sdk/_generated/api/project_imports/preflight_project_import.py b/src/volcano_sdk/_generated/api/project_imports/preflight_project_import.py index 591915d4..dc4bf9f4 100644 --- a/src/volcano_sdk/_generated/api/project_imports/preflight_project_import.py +++ b/src/volcano_sdk/_generated/api/project_imports/preflight_project_import.py @@ -87,6 +87,13 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return response_409 + if response.status_code == 422: + response_422 = Error.from_dict(response.json()) + + + + return response_422 + if response.status_code == 429: response_429 = Error.from_dict(response.json()) @@ -132,10 +139,20 @@ def sync_detailed( ) -> Response[Error | ProjectImportReport]: """ Check whether a provider project is ready to import - Produces a deterministic read-only readiness report for a proposed new Volcano project. + Produces a deterministic read-only readiness report for a proposed new Volcano project. For + `github`, resolves the branch head, prepares that commit under `root_directory` the way a deployment + does, and returns what it holds in `source_scan`, with `candidates` below the root directory that a + preflight with other settings would deploy. Unsupported items are reported and left out, including a + frontend `.volcano/source-layout.json` names that Volcano cannot build: the import deploys + everything else. The report is `blocked` when nothing can be deployed, or when an unsupported item + would still fail the first deployment: a function under `volcano/functions` that holds TypeScript + with no entry the build compiles. Args: - provider (ImportProvider): + provider (ImportProvider): Where an import comes from. `vercel` imports a Vercel project + through a Vercel Integration connection. `github` imports a GitHub repository through the + caller's own GitHub connection (`GET /user/git/connections`) and one of its Volcano GitHub + App installations; it has no connect flow of its own under `/user/imports`. body (ProjectImportPreflightRequest): Raises: @@ -168,10 +185,20 @@ def sync( ) -> Error | ProjectImportReport | None: """ Check whether a provider project is ready to import - Produces a deterministic read-only readiness report for a proposed new Volcano project. + Produces a deterministic read-only readiness report for a proposed new Volcano project. For + `github`, resolves the branch head, prepares that commit under `root_directory` the way a deployment + does, and returns what it holds in `source_scan`, with `candidates` below the root directory that a + preflight with other settings would deploy. Unsupported items are reported and left out, including a + frontend `.volcano/source-layout.json` names that Volcano cannot build: the import deploys + everything else. The report is `blocked` when nothing can be deployed, or when an unsupported item + would still fail the first deployment: a function under `volcano/functions` that holds TypeScript + with no entry the build compiles. Args: - provider (ImportProvider): + provider (ImportProvider): Where an import comes from. `vercel` imports a Vercel project + through a Vercel Integration connection. `github` imports a GitHub repository through the + caller's own GitHub connection (`GET /user/git/connections`) and one of its Volcano GitHub + App installations; it has no connect flow of its own under `/user/imports`. body (ProjectImportPreflightRequest): Raises: @@ -199,10 +226,20 @@ async def asyncio_detailed( ) -> Response[Error | ProjectImportReport]: """ Check whether a provider project is ready to import - Produces a deterministic read-only readiness report for a proposed new Volcano project. + Produces a deterministic read-only readiness report for a proposed new Volcano project. For + `github`, resolves the branch head, prepares that commit under `root_directory` the way a deployment + does, and returns what it holds in `source_scan`, with `candidates` below the root directory that a + preflight with other settings would deploy. Unsupported items are reported and left out, including a + frontend `.volcano/source-layout.json` names that Volcano cannot build: the import deploys + everything else. The report is `blocked` when nothing can be deployed, or when an unsupported item + would still fail the first deployment: a function under `volcano/functions` that holds TypeScript + with no entry the build compiles. Args: - provider (ImportProvider): + provider (ImportProvider): Where an import comes from. `vercel` imports a Vercel project + through a Vercel Integration connection. `github` imports a GitHub repository through the + caller's own GitHub connection (`GET /user/git/connections`) and one of its Volcano GitHub + App installations; it has no connect flow of its own under `/user/imports`. body (ProjectImportPreflightRequest): Raises: @@ -235,10 +272,20 @@ async def asyncio( ) -> Error | ProjectImportReport | None: """ Check whether a provider project is ready to import - Produces a deterministic read-only readiness report for a proposed new Volcano project. + Produces a deterministic read-only readiness report for a proposed new Volcano project. For + `github`, resolves the branch head, prepares that commit under `root_directory` the way a deployment + does, and returns what it holds in `source_scan`, with `candidates` below the root directory that a + preflight with other settings would deploy. Unsupported items are reported and left out, including a + frontend `.volcano/source-layout.json` names that Volcano cannot build: the import deploys + everything else. The report is `blocked` when nothing can be deployed, or when an unsupported item + would still fail the first deployment: a function under `volcano/functions` that holds TypeScript + with no entry the build compiles. Args: - provider (ImportProvider): + provider (ImportProvider): Where an import comes from. `vercel` imports a Vercel project + through a Vercel Integration connection. `github` imports a GitHub repository through the + caller's own GitHub connection (`GET /user/git/connections`) and one of its Volcano GitHub + App installations; it has no connect flow of its own under `/user/imports`. body (ProjectImportPreflightRequest): Raises: diff --git a/src/volcano_sdk/_generated/api/project_imports/start_import_connect.py b/src/volcano_sdk/_generated/api/project_imports/start_import_connect.py index d3805830..d27d5109 100644 --- a/src/volcano_sdk/_generated/api/project_imports/start_import_connect.py +++ b/src/volcano_sdk/_generated/api/project_imports/start_import_connect.py @@ -121,7 +121,10 @@ def sync_detailed( public provider callback. Args: - provider (ImportProvider | Unset): + provider (ImportProvider | Unset): Where an import comes from. `vercel` imports a Vercel + project through a Vercel Integration connection. `github` imports a GitHub repository + through the caller's own GitHub connection (`GET /user/git/connections`) and one of its + Volcano GitHub App installations; it has no connect flow of its own under `/user/imports`. redirect (str | Unset): callback_url (str | Unset): @@ -162,7 +165,10 @@ def sync( public provider callback. Args: - provider (ImportProvider | Unset): + provider (ImportProvider | Unset): Where an import comes from. `vercel` imports a Vercel + project through a Vercel Integration connection. `github` imports a GitHub repository + through the caller's own GitHub connection (`GET /user/git/connections`) and one of its + Volcano GitHub App installations; it has no connect flow of its own under `/user/imports`. redirect (str | Unset): callback_url (str | Unset): @@ -198,7 +204,10 @@ async def asyncio_detailed( public provider callback. Args: - provider (ImportProvider | Unset): + provider (ImportProvider | Unset): Where an import comes from. `vercel` imports a Vercel + project through a Vercel Integration connection. `github` imports a GitHub repository + through the caller's own GitHub connection (`GET /user/git/connections`) and one of its + Volcano GitHub App installations; it has no connect flow of its own under `/user/imports`. redirect (str | Unset): callback_url (str | Unset): @@ -239,7 +248,10 @@ async def asyncio( public provider callback. Args: - provider (ImportProvider | Unset): + provider (ImportProvider | Unset): Where an import comes from. `vercel` imports a Vercel + project through a Vercel Integration connection. `github` imports a GitHub repository + through the caller's own GitHub connection (`GET /user/git/connections`) and one of its + Volcano GitHub App installations; it has no connect flow of its own under `/user/imports`. redirect (str | Unset): callback_url (str | Unset): diff --git a/src/volcano_sdk/_generated/api/project_imports/start_project_import.py b/src/volcano_sdk/_generated/api/project_imports/start_project_import.py index 58e22510..a6666635 100644 --- a/src/volcano_sdk/_generated/api/project_imports/start_project_import.py +++ b/src/volcano_sdk/_generated/api/project_imports/start_project_import.py @@ -90,6 +90,13 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return response_409 + if response.status_code == 413: + response_413 = Error.from_dict(response.json()) + + + + return response_413 + if response.status_code == 422: response_422 = Error.from_dict(response.json()) @@ -141,13 +148,20 @@ def sync_detailed( idempotency_key: str, ) -> Response[Error | ProjectImportRun]: - """ Start a Vercel project import + """ Start a project import - Creates a Volcano project from an importable production preflight report. Retrying the same request - with the same Idempotency-Key returns the existing run. + Creates a Volcano project from an importable production preflight report and queues its first + deployment. Retrying the same request with the same Idempotency-Key returns the existing run. For + `github`, the project is connected to the repository and branch, deploys functions and every + supported frontend, stores the request's variables, and is refused with + `import_source_not_importable` when nothing can be deployed. A push to the branch after preflight + makes the request stale. Args: - provider (ImportProvider): + provider (ImportProvider): Where an import comes from. `vercel` imports a Vercel project + through a Vercel Integration connection. `github` imports a GitHub repository through the + caller's own GitHub connection (`GET /user/git/connections`) and one of its Volcano GitHub + App installations; it has no connect flow of its own under `/user/imports`. idempotency_key (str): body (ProjectImportStartRequest): @@ -181,13 +195,20 @@ def sync( idempotency_key: str, ) -> Error | ProjectImportRun | None: - """ Start a Vercel project import + """ Start a project import - Creates a Volcano project from an importable production preflight report. Retrying the same request - with the same Idempotency-Key returns the existing run. + Creates a Volcano project from an importable production preflight report and queues its first + deployment. Retrying the same request with the same Idempotency-Key returns the existing run. For + `github`, the project is connected to the repository and branch, deploys functions and every + supported frontend, stores the request's variables, and is refused with + `import_source_not_importable` when nothing can be deployed. A push to the branch after preflight + makes the request stale. Args: - provider (ImportProvider): + provider (ImportProvider): Where an import comes from. `vercel` imports a Vercel project + through a Vercel Integration connection. `github` imports a GitHub repository through the + caller's own GitHub connection (`GET /user/git/connections`) and one of its Volcano GitHub + App installations; it has no connect flow of its own under `/user/imports`. idempotency_key (str): body (ProjectImportStartRequest): @@ -216,13 +237,20 @@ async def asyncio_detailed( idempotency_key: str, ) -> Response[Error | ProjectImportRun]: - """ Start a Vercel project import + """ Start a project import - Creates a Volcano project from an importable production preflight report. Retrying the same request - with the same Idempotency-Key returns the existing run. + Creates a Volcano project from an importable production preflight report and queues its first + deployment. Retrying the same request with the same Idempotency-Key returns the existing run. For + `github`, the project is connected to the repository and branch, deploys functions and every + supported frontend, stores the request's variables, and is refused with + `import_source_not_importable` when nothing can be deployed. A push to the branch after preflight + makes the request stale. Args: - provider (ImportProvider): + provider (ImportProvider): Where an import comes from. `vercel` imports a Vercel project + through a Vercel Integration connection. `github` imports a GitHub repository through the + caller's own GitHub connection (`GET /user/git/connections`) and one of its Volcano GitHub + App installations; it has no connect flow of its own under `/user/imports`. idempotency_key (str): body (ProjectImportStartRequest): @@ -256,13 +284,20 @@ async def asyncio( idempotency_key: str, ) -> Error | ProjectImportRun | None: - """ Start a Vercel project import + """ Start a project import - Creates a Volcano project from an importable production preflight report. Retrying the same request - with the same Idempotency-Key returns the existing run. + Creates a Volcano project from an importable production preflight report and queues its first + deployment. Retrying the same request with the same Idempotency-Key returns the existing run. For + `github`, the project is connected to the repository and branch, deploys functions and every + supported frontend, stores the request's variables, and is refused with + `import_source_not_importable` when nothing can be deployed. A push to the branch after preflight + makes the request stale. Args: - provider (ImportProvider): + provider (ImportProvider): Where an import comes from. `vercel` imports a Vercel project + through a Vercel Integration connection. `github` imports a GitHub repository through the + caller's own GitHub connection (`GET /user/git/connections`) and one of its Volcano GitHub + App installations; it has no connect flow of its own under `/user/imports`. idempotency_key (str): body (ProjectImportStartRequest): diff --git a/src/volcano_sdk/_generated/api/projects/apply_project_config.py b/src/volcano_sdk/_generated/api/projects/apply_project_config.py index f165d4c8..111f4f65 100644 --- a/src/volcano_sdk/_generated/api/projects/apply_project_config.py +++ b/src/volcano_sdk/_generated/api/projects/apply_project_config.py @@ -89,6 +89,13 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return response_409 + if response.status_code == 413: + response_413 = Error.from_dict(response.json()) + + + + return response_413 + if response.status_code == 422: response_422 = ProjectConfigValidationErrorResponse.from_dict(response.json()) @@ -139,8 +146,15 @@ def sync_detailed( and existing resources missing from a declared section are reported in `missing`. Validation failures (including plan-gate violations) return 422 and nothing is applied. Set `dry_run=true` to get the projected - report without applying changes. Applies are serialized per project; - a concurrent apply returns 409. + report without applying changes. Applies are serialized per project: + an apply that overlaps another apply, a variable write or a deploy + waits up to about 20 seconds for it to finish and then runs against the + project as it stands, and returns 409 only if the project is still busy + after that wait. A function a promoted preview serves + keeps the variables the preview was built with: when the apply's + variable changes would reach it, it is reported as `unchanged` with + `code: function_served_by_candidate` and a `notice`, while every other + resource is applied and synchronized. That entry is not an error. Args: id (UUID): @@ -199,8 +213,15 @@ def sync( and existing resources missing from a declared section are reported in `missing`. Validation failures (including plan-gate violations) return 422 and nothing is applied. Set `dry_run=true` to get the projected - report without applying changes. Applies are serialized per project; - a concurrent apply returns 409. + report without applying changes. Applies are serialized per project: + an apply that overlaps another apply, a variable write or a deploy + waits up to about 20 seconds for it to finish and then runs against the + project as it stands, and returns 409 only if the project is still busy + after that wait. A function a promoted preview serves + keeps the variables the preview was built with: when the apply's + variable changes would reach it, it is reported as `unchanged` with + `code: function_served_by_candidate` and a `notice`, while every other + resource is applied and synchronized. That entry is not an error. Args: id (UUID): @@ -254,8 +275,15 @@ async def asyncio_detailed( and existing resources missing from a declared section are reported in `missing`. Validation failures (including plan-gate violations) return 422 and nothing is applied. Set `dry_run=true` to get the projected - report without applying changes. Applies are serialized per project; - a concurrent apply returns 409. + report without applying changes. Applies are serialized per project: + an apply that overlaps another apply, a variable write or a deploy + waits up to about 20 seconds for it to finish and then runs against the + project as it stands, and returns 409 only if the project is still busy + after that wait. A function a promoted preview serves + keeps the variables the preview was built with: when the apply's + variable changes would reach it, it is reported as `unchanged` with + `code: function_served_by_candidate` and a `notice`, while every other + resource is applied and synchronized. That entry is not an error. Args: id (UUID): @@ -314,8 +342,15 @@ async def asyncio( and existing resources missing from a declared section are reported in `missing`. Validation failures (including plan-gate violations) return 422 and nothing is applied. Set `dry_run=true` to get the projected - report without applying changes. Applies are serialized per project; - a concurrent apply returns 409. + report without applying changes. Applies are serialized per project: + an apply that overlaps another apply, a variable write or a deploy + waits up to about 20 seconds for it to finish and then runs against the + project as it stands, and returns 409 only if the project is still busy + after that wait. A function a promoted preview serves + keeps the variables the preview was built with: when the apply's + variable changes would reach it, it is reported as `unchanged` with + `code: function_served_by_candidate` and a `notice`, while every other + resource is applied and synchronized. That entry is not an error. Args: id (UUID): diff --git a/src/volcano_sdk/_generated/api/projects/connect_project_git.py b/src/volcano_sdk/_generated/api/projects/connect_project_git.py index 16856243..3b8dcad6 100644 --- a/src/volcano_sdk/_generated/api/projects/connect_project_git.py +++ b/src/volcano_sdk/_generated/api/projects/connect_project_git.py @@ -133,6 +133,26 @@ def sync_detailed( user token, then persists repository metadata only from that validated GitHub response. + Omitting production_branch follows the repository's default and + discards a pinned branch. To keep a pin when rebinding the same + repository, read the connection first and send production_branch back + when `production_branch_follows_default` is false. The response reports + the result in the same field. + + Project access tokens are refused. Which repository a project deploys + from is a person's decision, made with a platform token or in the + dashboard. A project access token can still change the root directory + and production branch through PUT + /projects/{id}/git-connection/root-directory and PUT + /projects/{id}/git-connection/production-branch. + + Connecting a repository to a project with none, while LavaFlow is on + and was turned on with no repository, makes it the one LavaFlow works + in, unless the LavaFlow settings' `fix_blocker` asks to turn it on + again after the link. Any later change of repository pauses LavaFlow until the owner + turns it on again; binding the repository LavaFlow works in again + resumes it with no new turn-on. + Args: id (UUID): body (ConnectProjectGitRequest): @@ -176,6 +196,26 @@ def sync( user token, then persists repository metadata only from that validated GitHub response. + Omitting production_branch follows the repository's default and + discards a pinned branch. To keep a pin when rebinding the same + repository, read the connection first and send production_branch back + when `production_branch_follows_default` is false. The response reports + the result in the same field. + + Project access tokens are refused. Which repository a project deploys + from is a person's decision, made with a platform token or in the + dashboard. A project access token can still change the root directory + and production branch through PUT + /projects/{id}/git-connection/root-directory and PUT + /projects/{id}/git-connection/production-branch. + + Connecting a repository to a project with none, while LavaFlow is on + and was turned on with no repository, makes it the one LavaFlow works + in, unless the LavaFlow settings' `fix_blocker` asks to turn it on + again after the link. Any later change of repository pauses LavaFlow until the owner + turns it on again; binding the repository LavaFlow works in again + resumes it with no new turn-on. + Args: id (UUID): body (ConnectProjectGitRequest): @@ -214,6 +254,26 @@ async def asyncio_detailed( user token, then persists repository metadata only from that validated GitHub response. + Omitting production_branch follows the repository's default and + discards a pinned branch. To keep a pin when rebinding the same + repository, read the connection first and send production_branch back + when `production_branch_follows_default` is false. The response reports + the result in the same field. + + Project access tokens are refused. Which repository a project deploys + from is a person's decision, made with a platform token or in the + dashboard. A project access token can still change the root directory + and production branch through PUT + /projects/{id}/git-connection/root-directory and PUT + /projects/{id}/git-connection/production-branch. + + Connecting a repository to a project with none, while LavaFlow is on + and was turned on with no repository, makes it the one LavaFlow works + in, unless the LavaFlow settings' `fix_blocker` asks to turn it on + again after the link. Any later change of repository pauses LavaFlow until the owner + turns it on again; binding the repository LavaFlow works in again + resumes it with no new turn-on. + Args: id (UUID): body (ConnectProjectGitRequest): @@ -257,6 +317,26 @@ async def asyncio( user token, then persists repository metadata only from that validated GitHub response. + Omitting production_branch follows the repository's default and + discards a pinned branch. To keep a pin when rebinding the same + repository, read the connection first and send production_branch back + when `production_branch_follows_default` is false. The response reports + the result in the same field. + + Project access tokens are refused. Which repository a project deploys + from is a person's decision, made with a platform token or in the + dashboard. A project access token can still change the root directory + and production branch through PUT + /projects/{id}/git-connection/root-directory and PUT + /projects/{id}/git-connection/production-branch. + + Connecting a repository to a project with none, while LavaFlow is on + and was turned on with no repository, makes it the one LavaFlow works + in, unless the LavaFlow settings' `fix_blocker` asks to turn it on + again after the link. Any later change of repository pauses LavaFlow until the owner + turns it on again; binding the repository LavaFlow works in again + resumes it with no new turn-on. + Args: id (UUID): body (ConnectProjectGitRequest): diff --git a/src/volcano_sdk/_generated/api/projects/create_git_deployment_run.py b/src/volcano_sdk/_generated/api/projects/create_git_deployment_run.py new file mode 100644 index 00000000..72ce6f5c --- /dev/null +++ b/src/volcano_sdk/_generated/api/projects/create_git_deployment_run.py @@ -0,0 +1,340 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.create_git_deployment_run_request import CreateGitDeploymentRunRequest +from ...models.error import Error +from ...models.git_deployment_run import GitDeploymentRun +from ...types import UNSET, Unset +from typing import cast +from uuid import UUID + + + +def request_kwargs( + id: UUID | str, + *, + body: CreateGitDeploymentRunRequest | Unset = UNSET, + +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + + + + + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/projects/{id}/git-deployment-runs".format(id=quote(str(id), safe=""),), + } + + + if not isinstance(body, Unset): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | GitDeploymentRun | None: + if response.status_code == 202: + response_202 = GitDeploymentRun.from_dict(response.json()) + + + + return response_202 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 409: + response_409 = Error.from_dict(response.json()) + + + + return response_409 + + if response.status_code == 422: + response_422 = Error.from_dict(response.json()) + + + + return response_422 + + if response.status_code == 429: + response_429 = Error.from_dict(response.json()) + + + + return response_429 + + if response.status_code == 503: + response_503 = Error.from_dict(response.json()) + + + + return response_503 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | GitDeploymentRun]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID | str, + *, + client: AuthenticatedClient, + body: CreateGitDeploymentRunRequest | Unset = UNSET, + +) -> Response[Error | GitDeploymentRun]: + """ Deploy the production branch now + + Queues a deployment run of the current head of the project's + production branch, exactly as a push of that commit would: the run + snapshots the project's Git deploy settings, supersedes a queued older + run, and is deployed by the same worker. Volcano reads the head + through the project owner's GitHub connection. + + The run is queued even when `auto_deploy_enabled` is off: that setting + decides whether a push deploys on its own, and this is an explicit + request. + + `force: true` deploys every configured function and frontend, even one + the `skip_unchanged` setting would leave on its current deployment; the + returned run then reports `skip_unchanged: false`. + + Each request reads GitHub with the project owner's token and counts + against the owner-token budget described under `429`. + + Safe to retry. While a run for the same commit is queued or running, + the request queues nothing and returns that run, as a redelivered push + would. A forced request is refused with `git_deployment_run_in_progress` + instead when that run skips unchanged resources; retry once it ends. + + Args: + id (UUID): + body (CreateGitDeploymentRunRequest | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | GitDeploymentRun] + """ + + + kwargs = request_kwargs( + id=id, +body=body, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + id: UUID | str, + *, + client: AuthenticatedClient, + body: CreateGitDeploymentRunRequest | Unset = UNSET, + +) -> Error | GitDeploymentRun | None: + """ Deploy the production branch now + + Queues a deployment run of the current head of the project's + production branch, exactly as a push of that commit would: the run + snapshots the project's Git deploy settings, supersedes a queued older + run, and is deployed by the same worker. Volcano reads the head + through the project owner's GitHub connection. + + The run is queued even when `auto_deploy_enabled` is off: that setting + decides whether a push deploys on its own, and this is an explicit + request. + + `force: true` deploys every configured function and frontend, even one + the `skip_unchanged` setting would leave on its current deployment; the + returned run then reports `skip_unchanged: false`. + + Each request reads GitHub with the project owner's token and counts + against the owner-token budget described under `429`. + + Safe to retry. While a run for the same commit is queued or running, + the request queues nothing and returns that run, as a redelivered push + would. A forced request is refused with `git_deployment_run_in_progress` + instead when that run skips unchanged resources; retry once it ends. + + Args: + id (UUID): + body (CreateGitDeploymentRunRequest | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | GitDeploymentRun + """ + + + return sync_detailed( + id=id, +client=client, +body=body, + + ).parsed + +async def asyncio_detailed( + id: UUID | str, + *, + client: AuthenticatedClient, + body: CreateGitDeploymentRunRequest | Unset = UNSET, + +) -> Response[Error | GitDeploymentRun]: + """ Deploy the production branch now + + Queues a deployment run of the current head of the project's + production branch, exactly as a push of that commit would: the run + snapshots the project's Git deploy settings, supersedes a queued older + run, and is deployed by the same worker. Volcano reads the head + through the project owner's GitHub connection. + + The run is queued even when `auto_deploy_enabled` is off: that setting + decides whether a push deploys on its own, and this is an explicit + request. + + `force: true` deploys every configured function and frontend, even one + the `skip_unchanged` setting would leave on its current deployment; the + returned run then reports `skip_unchanged: false`. + + Each request reads GitHub with the project owner's token and counts + against the owner-token budget described under `429`. + + Safe to retry. While a run for the same commit is queued or running, + the request queues nothing and returns that run, as a redelivered push + would. A forced request is refused with `git_deployment_run_in_progress` + instead when that run skips unchanged resources; retry once it ends. + + Args: + id (UUID): + body (CreateGitDeploymentRunRequest | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | GitDeploymentRun] + """ + + + kwargs = request_kwargs( + id=id, +body=body, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + id: UUID | str, + *, + client: AuthenticatedClient, + body: CreateGitDeploymentRunRequest | Unset = UNSET, + +) -> Error | GitDeploymentRun | None: + """ Deploy the production branch now + + Queues a deployment run of the current head of the project's + production branch, exactly as a push of that commit would: the run + snapshots the project's Git deploy settings, supersedes a queued older + run, and is deployed by the same worker. Volcano reads the head + through the project owner's GitHub connection. + + The run is queued even when `auto_deploy_enabled` is off: that setting + decides whether a push deploys on its own, and this is an explicit + request. + + `force: true` deploys every configured function and frontend, even one + the `skip_unchanged` setting would leave on its current deployment; the + returned run then reports `skip_unchanged: false`. + + Each request reads GitHub with the project owner's token and counts + against the owner-token budget described under `429`. + + Safe to retry. While a run for the same commit is queued or running, + the request queues nothing and returns that run, as a redelivered push + would. A forced request is refused with `git_deployment_run_in_progress` + instead when that run skips unchanged resources; retry once it ends. + + Args: + id (UUID): + body (CreateGitDeploymentRunRequest | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | GitDeploymentRun + """ + + + return (await asyncio_detailed( + id=id, +client=client, +body=body, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/projects/create_project.py b/src/volcano_sdk/_generated/api/projects/create_project.py index b210e651..5a59da7f 100644 --- a/src/volcano_sdk/_generated/api/projects/create_project.py +++ b/src/volcano_sdk/_generated/api/projects/create_project.py @@ -94,7 +94,9 @@ def sync_detailed( """ Create a new project Creates a project for the authenticated user. - Each user can create up to 1,000 projects. Requests over this cap return 403. + Projects have no plan limit; usage allowances apply across all of a user's projects. + Accounts on an older paid pricing revision keep the project cap that revision set, and + requests over it return 403. Args: body (CreateProjectRequest): Request to create a new project @@ -128,7 +130,9 @@ def sync( """ Create a new project Creates a project for the authenticated user. - Each user can create up to 1,000 projects. Requests over this cap return 403. + Projects have no plan limit; usage allowances apply across all of a user's projects. + Accounts on an older paid pricing revision keep the project cap that revision set, and + requests over it return 403. Args: body (CreateProjectRequest): Request to create a new project @@ -157,7 +161,9 @@ async def asyncio_detailed( """ Create a new project Creates a project for the authenticated user. - Each user can create up to 1,000 projects. Requests over this cap return 403. + Projects have no plan limit; usage allowances apply across all of a user's projects. + Accounts on an older paid pricing revision keep the project cap that revision set, and + requests over it return 403. Args: body (CreateProjectRequest): Request to create a new project @@ -191,7 +197,9 @@ async def asyncio( """ Create a new project Creates a project for the authenticated user. - Each user can create up to 1,000 projects. Requests over this cap return 403. + Projects have no plan limit; usage allowances apply across all of a user's projects. + Accounts on an older paid pricing revision keep the project cap that revision set, and + requests over it return 403. Args: body (CreateProjectRequest): Request to create a new project diff --git a/src/volcano_sdk/_generated/api/projects/export_project_source.py b/src/volcano_sdk/_generated/api/projects/export_project_source.py index f577e835..412eea02 100644 --- a/src/volcano_sdk/_generated/api/projects/export_project_source.py +++ b/src/volcano_sdk/_generated/api/projects/export_project_source.py @@ -150,11 +150,12 @@ def sync_detailed( ordinary Git auto-deploy flow. Direct source writes remain frozen until that deployment succeeds and the repository becomes the source of truth. - The caller confirms the production branch shown before export. Starting - export pins that branch: later GitHub default-branch changes do not - repoint the project. If the configured branch changed after the caller - read it, the request fails without exporting so the caller can show and - confirm the new value. + The caller confirms the production branch shown before export, and + optionally the repository by its `repo_id`. Starting export pins that + branch: later GitHub default-branch changes do not repoint the project. + If the connected repository or the configured branch changed after the + caller read it, the request fails without exporting so the caller can + show and confirm the new value. The response lists what the export could not carry: resources with no successful deployment to take source from (`skipped`), and things no @@ -206,11 +207,12 @@ def sync( ordinary Git auto-deploy flow. Direct source writes remain frozen until that deployment succeeds and the repository becomes the source of truth. - The caller confirms the production branch shown before export. Starting - export pins that branch: later GitHub default-branch changes do not - repoint the project. If the configured branch changed after the caller - read it, the request fails without exporting so the caller can show and - confirm the new value. + The caller confirms the production branch shown before export, and + optionally the repository by its `repo_id`. Starting export pins that + branch: later GitHub default-branch changes do not repoint the project. + If the connected repository or the configured branch changed after the + caller read it, the request fails without exporting so the caller can + show and confirm the new value. The response lists what the export could not carry: resources with no successful deployment to take source from (`skipped`), and things no @@ -257,11 +259,12 @@ async def asyncio_detailed( ordinary Git auto-deploy flow. Direct source writes remain frozen until that deployment succeeds and the repository becomes the source of truth. - The caller confirms the production branch shown before export. Starting - export pins that branch: later GitHub default-branch changes do not - repoint the project. If the configured branch changed after the caller - read it, the request fails without exporting so the caller can show and - confirm the new value. + The caller confirms the production branch shown before export, and + optionally the repository by its `repo_id`. Starting export pins that + branch: later GitHub default-branch changes do not repoint the project. + If the connected repository or the configured branch changed after the + caller read it, the request fails without exporting so the caller can + show and confirm the new value. The response lists what the export could not carry: resources with no successful deployment to take source from (`skipped`), and things no @@ -313,11 +316,12 @@ async def asyncio( ordinary Git auto-deploy flow. Direct source writes remain frozen until that deployment succeeds and the repository becomes the source of truth. - The caller confirms the production branch shown before export. Starting - export pins that branch: later GitHub default-branch changes do not - repoint the project. If the configured branch changed after the caller - read it, the request fails without exporting so the caller can show and - confirm the new value. + The caller confirms the production branch shown before export, and + optionally the repository by its `repo_id`. Starting export pins that + branch: later GitHub default-branch changes do not repoint the project. + If the connected repository or the configured branch changed after the + caller read it, the request fails without exporting so the caller can + show and confirm the new value. The response lists what the export could not carry: resources with no successful deployment to take source from (`skipped`), and things no diff --git a/src/volcano_sdk/_generated/api/autofix/get_autofix_run.py b/src/volcano_sdk/_generated/api/projects/get_git_deployment_run.py similarity index 69% rename from src/volcano_sdk/_generated/api/autofix/get_autofix_run.py rename to src/volcano_sdk/_generated/api/projects/get_git_deployment_run.py index d79f218c..64d6bc1b 100644 --- a/src/volcano_sdk/_generated/api/autofix/get_autofix_run.py +++ b/src/volcano_sdk/_generated/api/projects/get_git_deployment_run.py @@ -8,8 +8,8 @@ from ...types import Response, UNSET from ... import errors -from ...models.autofix_run import AutofixRun from ...models.error import Error +from ...models.git_deployment_run import GitDeploymentRun from typing import cast from uuid import UUID @@ -28,7 +28,7 @@ def request_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/projects/{id}/autofix-runs/{run_id}".format(id=quote(str(id), safe=""),run_id=quote(str(run_id), safe=""),), + "url": "/projects/{id}/git-deployment-runs/{run_id}".format(id=quote(str(id), safe=""),run_id=quote(str(run_id), safe=""),), } @@ -36,27 +36,34 @@ def request_kwargs( -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> AutofixRun | Error | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | GitDeploymentRun | None: if response.status_code == 200: - response_200 = AutofixRun.from_dict(response.json()) + response_200 = GitDeploymentRun.from_dict(response.json()) return response_200 - if response.status_code == 404: - response_404 = Error.from_dict(response.json()) + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) - return response_404 + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + - if response.status_code == 501: - response_501 = Error.from_dict(response.json()) + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) - return response_501 + + return response_404 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -64,7 +71,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[AutofixRun | Error]: +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | GitDeploymentRun]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -79,12 +86,11 @@ def sync_detailed( *, client: AuthenticatedClient, -) -> Response[AutofixRun | Error]: - """ Get an autofix run +) -> Response[Error | GitDeploymentRun]: + """ Get a Git deployment run - Returns one run: its status, the diagnosis once it succeeds, why it - failed or was canceled, and the model tokens it used. Runs stay readable - where autofix is not available. + Returns one deployment run: the commit it deployed, its status, the + migration runs it started, and why it failed or was skipped. Project access tokens can read runs, including read-only ones. @@ -97,7 +103,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AutofixRun | Error] + Response[Error | GitDeploymentRun] """ @@ -119,12 +125,11 @@ def sync( *, client: AuthenticatedClient, -) -> AutofixRun | Error | None: - """ Get an autofix run +) -> Error | GitDeploymentRun | None: + """ Get a Git deployment run - Returns one run: its status, the diagnosis once it succeeds, why it - failed or was canceled, and the model tokens it used. Runs stay readable - where autofix is not available. + Returns one deployment run: the commit it deployed, its status, the + migration runs it started, and why it failed or was skipped. Project access tokens can read runs, including read-only ones. @@ -137,7 +142,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AutofixRun | Error + Error | GitDeploymentRun """ @@ -154,12 +159,11 @@ async def asyncio_detailed( *, client: AuthenticatedClient, -) -> Response[AutofixRun | Error]: - """ Get an autofix run +) -> Response[Error | GitDeploymentRun]: + """ Get a Git deployment run - Returns one run: its status, the diagnosis once it succeeds, why it - failed or was canceled, and the model tokens it used. Runs stay readable - where autofix is not available. + Returns one deployment run: the commit it deployed, its status, the + migration runs it started, and why it failed or was skipped. Project access tokens can read runs, including read-only ones. @@ -172,7 +176,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AutofixRun | Error] + Response[Error | GitDeploymentRun] """ @@ -194,12 +198,11 @@ async def asyncio( *, client: AuthenticatedClient, -) -> AutofixRun | Error | None: - """ Get an autofix run +) -> Error | GitDeploymentRun | None: + """ Get a Git deployment run - Returns one run: its status, the diagnosis once it succeeds, why it - failed or was canceled, and the model tokens it used. Runs stay readable - where autofix is not available. + Returns one deployment run: the commit it deployed, its status, the + migration runs it started, and why it failed or was skipped. Project access tokens can read runs, including read-only ones. @@ -212,7 +215,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AutofixRun | Error + Error | GitDeploymentRun """ diff --git a/src/volcano_sdk/_generated/api/projects/get_project_git_connection.py b/src/volcano_sdk/_generated/api/projects/get_project_git_connection.py index f53f7d48..307fdbde 100644 --- a/src/volcano_sdk/_generated/api/projects/get_project_git_connection.py +++ b/src/volcano_sdk/_generated/api/projects/get_project_git_connection.py @@ -94,6 +94,11 @@ def sync_detailed( ) -> Response[Error | ProjectGitConnection]: """ Get a project's repo connection + Returns the repository binding. `production_branch_follows_default` + tells a branch that tracks the repository's default from one the + project pinned: a client rebinding the same repository sends a pinned + branch back to keep it. + Args: id (UUID): @@ -125,6 +130,11 @@ def sync( ) -> Error | ProjectGitConnection | None: """ Get a project's repo connection + Returns the repository binding. `production_branch_follows_default` + tells a branch that tracks the repository's default from one the + project pinned: a client rebinding the same repository sends a pinned + branch back to keep it. + Args: id (UUID): @@ -151,6 +161,11 @@ async def asyncio_detailed( ) -> Response[Error | ProjectGitConnection]: """ Get a project's repo connection + Returns the repository binding. `production_branch_follows_default` + tells a branch that tracks the repository's default from one the + project pinned: a client rebinding the same repository sends a pinned + branch back to keep it. + Args: id (UUID): @@ -182,6 +197,11 @@ async def asyncio( ) -> Error | ProjectGitConnection | None: """ Get a project's repo connection + Returns the repository binding. `production_branch_follows_default` + tells a branch that tracks the repository's default from one the + project pinned: a client rebinding the same repository sends a pinned + branch back to keep it. + Args: id (UUID): diff --git a/src/volcano_sdk/_generated/api/projects/get_project_git_owner_push.py b/src/volcano_sdk/_generated/api/projects/get_project_git_owner_push.py new file mode 100644 index 00000000..39973931 --- /dev/null +++ b/src/volcano_sdk/_generated/api/projects/get_project_git_owner_push.py @@ -0,0 +1,267 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from ...models.project_git_owner_push import ProjectGitOwnerPush +from typing import cast +from uuid import UUID + + + +def request_kwargs( + id: UUID | str, + +) -> dict[str, Any]: + + + + + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/projects/{id}/git-connection/owner-push".format(id=quote(str(id), safe=""),), + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | ProjectGitOwnerPush | None: + if response.status_code == 200: + response_200 = ProjectGitOwnerPush.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 429: + response_429 = Error.from_dict(response.json()) + + + + return response_429 + + if response.status_code == 500: + response_500 = Error.from_dict(response.json()) + + + + return response_500 + + if response.status_code == 503: + response_503 = Error.from_dict(response.json()) + + + + return response_503 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | ProjectGitOwnerPush]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Response[Error | ProjectGitOwnerPush]: + """ Check whether the project owner can push to the connected repository + + Answers whether the project owner's GitHub account can push to the + repository the project is connected to. Volcano makes the same check + before it writes to that repository for the project. The repository is + always the project's connected one; the route takes no repository. + + When `can_push` is false, `reason` says why. The answer can be a few + seconds old: repeated checks within that time are answered without + asking GitHub again. + + Checks that ask GitHub draw on an hourly budget for the project and + another for its owner, shared by all of the owner's projects. Over + either, the route answers `429` with `Retry-After`. + + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | ProjectGitOwnerPush] + """ + + + kwargs = request_kwargs( + id=id, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Error | ProjectGitOwnerPush | None: + """ Check whether the project owner can push to the connected repository + + Answers whether the project owner's GitHub account can push to the + repository the project is connected to. Volcano makes the same check + before it writes to that repository for the project. The repository is + always the project's connected one; the route takes no repository. + + When `can_push` is false, `reason` says why. The answer can be a few + seconds old: repeated checks within that time are answered without + asking GitHub again. + + Checks that ask GitHub draw on an hourly budget for the project and + another for its owner, shared by all of the owner's projects. Over + either, the route answers `429` with `Retry-After`. + + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | ProjectGitOwnerPush + """ + + + return sync_detailed( + id=id, +client=client, + + ).parsed + +async def asyncio_detailed( + id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Response[Error | ProjectGitOwnerPush]: + """ Check whether the project owner can push to the connected repository + + Answers whether the project owner's GitHub account can push to the + repository the project is connected to. Volcano makes the same check + before it writes to that repository for the project. The repository is + always the project's connected one; the route takes no repository. + + When `can_push` is false, `reason` says why. The answer can be a few + seconds old: repeated checks within that time are answered without + asking GitHub again. + + Checks that ask GitHub draw on an hourly budget for the project and + another for its owner, shared by all of the owner's projects. Over + either, the route answers `429` with `Retry-After`. + + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | ProjectGitOwnerPush] + """ + + + kwargs = request_kwargs( + id=id, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Error | ProjectGitOwnerPush | None: + """ Check whether the project owner can push to the connected repository + + Answers whether the project owner's GitHub account can push to the + repository the project is connected to. Volcano makes the same check + before it writes to that repository for the project. The repository is + always the project's connected one; the route takes no repository. + + When `can_push` is false, `reason` says why. The answer can be a few + seconds old: repeated checks within that time are answered without + asking GitHub again. + + Checks that ask GitHub draw on an hourly budget for the project and + another for its owner, shared by all of the owner's projects. Over + either, the route answers `429` with `Retry-After`. + + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | ProjectGitOwnerPush + """ + + + return (await asyncio_detailed( + id=id, +client=client, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/projects/list_git_deployment_runs.py b/src/volcano_sdk/_generated/api/projects/list_git_deployment_runs.py new file mode 100644 index 00000000..f0f2bcbc --- /dev/null +++ b/src/volcano_sdk/_generated/api/projects/list_git_deployment_runs.py @@ -0,0 +1,334 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from ...models.git_deployment_run_status import check_git_deployment_run_status +from ...models.git_deployment_run_status import GitDeploymentRunStatus +from ...models.paginated_git_deployment_runs import PaginatedGitDeploymentRuns +from ...types import UNSET, Unset +from typing import cast +from uuid import UUID + + + +def request_kwargs( + id: UUID | str, + *, + limit: int | Unset = 10, + cursor: str | Unset = UNSET, + status: GitDeploymentRunStatus | Unset = UNSET, + branch: str | Unset = UNSET, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + params["limit"] = limit + + params["cursor"] = cursor + + json_status: str | Unset = UNSET + if not isinstance(status, Unset): + json_status = status + + params["status"] = json_status + + params["branch"] = branch + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/projects/{id}/git-deployment-runs".format(id=quote(str(id), safe=""),), + "params": params, + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | PaginatedGitDeploymentRuns | None: + if response.status_code == 200: + response_200 = PaginatedGitDeploymentRuns.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | PaginatedGitDeploymentRuns]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID | str, + *, + client: AuthenticatedClient, + limit: int | Unset = 10, + cursor: str | Unset = UNSET, + status: GitDeploymentRunStatus | Unset = UNSET, + branch: str | Unset = UNSET, + +) -> Response[Error | PaginatedGitDeploymentRuns]: + """ List a project's Git deployment runs + + Lists the deployment runs Git auto deploy recorded for the project, + newest push first. Each push to the production branch records one run, + as does each `POST /projects/{id}/git-deployment-runs`, and each says + whether the commit deployed and, when it failed or was skipped, why. + + A run that applied migrations names the migration run it started on + each database. Get one at + `GET /projects/{id}/databases/{databaseName}/migration-runs/{runId}` + for its files. + + Project access tokens can list runs, including read-only ones. + + Args: + id (UUID): + limit (int | Unset): Default: 10. + cursor (str | Unset): + status (GitDeploymentRunStatus | Unset): Where a run is. `pending` and `running` have not + ended. `succeeded`: every deployment the run dispatched succeeded, or the commit only had + migrations to apply. `failed`: `error` says why. `superseded`: a newer push replaced the + run before it started. `skipped`: there was nothing to deploy; `error` says why. + branch (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | PaginatedGitDeploymentRuns] + """ + + + kwargs = request_kwargs( + id=id, +limit=limit, +cursor=cursor, +status=status, +branch=branch, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + id: UUID | str, + *, + client: AuthenticatedClient, + limit: int | Unset = 10, + cursor: str | Unset = UNSET, + status: GitDeploymentRunStatus | Unset = UNSET, + branch: str | Unset = UNSET, + +) -> Error | PaginatedGitDeploymentRuns | None: + """ List a project's Git deployment runs + + Lists the deployment runs Git auto deploy recorded for the project, + newest push first. Each push to the production branch records one run, + as does each `POST /projects/{id}/git-deployment-runs`, and each says + whether the commit deployed and, when it failed or was skipped, why. + + A run that applied migrations names the migration run it started on + each database. Get one at + `GET /projects/{id}/databases/{databaseName}/migration-runs/{runId}` + for its files. + + Project access tokens can list runs, including read-only ones. + + Args: + id (UUID): + limit (int | Unset): Default: 10. + cursor (str | Unset): + status (GitDeploymentRunStatus | Unset): Where a run is. `pending` and `running` have not + ended. `succeeded`: every deployment the run dispatched succeeded, or the commit only had + migrations to apply. `failed`: `error` says why. `superseded`: a newer push replaced the + run before it started. `skipped`: there was nothing to deploy; `error` says why. + branch (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | PaginatedGitDeploymentRuns + """ + + + return sync_detailed( + id=id, +client=client, +limit=limit, +cursor=cursor, +status=status, +branch=branch, + + ).parsed + +async def asyncio_detailed( + id: UUID | str, + *, + client: AuthenticatedClient, + limit: int | Unset = 10, + cursor: str | Unset = UNSET, + status: GitDeploymentRunStatus | Unset = UNSET, + branch: str | Unset = UNSET, + +) -> Response[Error | PaginatedGitDeploymentRuns]: + """ List a project's Git deployment runs + + Lists the deployment runs Git auto deploy recorded for the project, + newest push first. Each push to the production branch records one run, + as does each `POST /projects/{id}/git-deployment-runs`, and each says + whether the commit deployed and, when it failed or was skipped, why. + + A run that applied migrations names the migration run it started on + each database. Get one at + `GET /projects/{id}/databases/{databaseName}/migration-runs/{runId}` + for its files. + + Project access tokens can list runs, including read-only ones. + + Args: + id (UUID): + limit (int | Unset): Default: 10. + cursor (str | Unset): + status (GitDeploymentRunStatus | Unset): Where a run is. `pending` and `running` have not + ended. `succeeded`: every deployment the run dispatched succeeded, or the commit only had + migrations to apply. `failed`: `error` says why. `superseded`: a newer push replaced the + run before it started. `skipped`: there was nothing to deploy; `error` says why. + branch (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | PaginatedGitDeploymentRuns] + """ + + + kwargs = request_kwargs( + id=id, +limit=limit, +cursor=cursor, +status=status, +branch=branch, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + id: UUID | str, + *, + client: AuthenticatedClient, + limit: int | Unset = 10, + cursor: str | Unset = UNSET, + status: GitDeploymentRunStatus | Unset = UNSET, + branch: str | Unset = UNSET, + +) -> Error | PaginatedGitDeploymentRuns | None: + """ List a project's Git deployment runs + + Lists the deployment runs Git auto deploy recorded for the project, + newest push first. Each push to the production branch records one run, + as does each `POST /projects/{id}/git-deployment-runs`, and each says + whether the commit deployed and, when it failed or was skipped, why. + + A run that applied migrations names the migration run it started on + each database. Get one at + `GET /projects/{id}/databases/{databaseName}/migration-runs/{runId}` + for its files. + + Project access tokens can list runs, including read-only ones. + + Args: + id (UUID): + limit (int | Unset): Default: 10. + cursor (str | Unset): + status (GitDeploymentRunStatus | Unset): Where a run is. `pending` and `running` have not + ended. `succeeded`: every deployment the run dispatched succeeded, or the commit only had + migrations to apply. `failed`: `error` says why. `superseded`: a newer push replaced the + run before it started. `skipped`: there was nothing to deploy; `error` says why. + branch (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | PaginatedGitDeploymentRuns + """ + + + return (await asyncio_detailed( + id=id, +client=client, +limit=limit, +cursor=cursor, +status=status, +branch=branch, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/projects/list_project_capabilities.py b/src/volcano_sdk/_generated/api/projects/list_project_capabilities.py new file mode 100644 index 00000000..0cc96a3a --- /dev/null +++ b/src/volcano_sdk/_generated/api/projects/list_project_capabilities.py @@ -0,0 +1,311 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.capability_list import CapabilityList +from ...models.error import Error +from typing import cast +from uuid import UUID + + + +def request_kwargs( + id: UUID | str, + +) -> dict[str, Any]: + + + + + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/projects/{id}/capabilities".format(id=quote(str(id), safe=""),), + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> CapabilityList | Error | None: + if response.status_code == 200: + response_200 = CapabilityList.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[CapabilityList | Error]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Response[CapabilityList | Error]: + """ List a project's capabilities + + Lists which product capabilities accept new work for this project. It + has the same entries as `GET /capabilities`, and answers each one as it + does, except for capabilities a project can have when another can't: + + | ID | Available for this project when | + | --- | --- | + | `lavaflow` | LavaFlow is released, offered to the project's owner, and included in the owner's + plan | + | `lavaflow.merge` | `lavaflow` is, and LavaFlow's merging is released in this environment | + | `lavaflow.lineage` | `lavaflow` is, and fix lineage is released in this environment | + | `lavaflow.open_pr_ci_start` | `lavaflow` is, and CI for fixes a person merges is released in this + environment | + | `lavaflow.repository_ci` | `lavaflow` is, and normal repository CI is released; the owner must + separately grant `allow_ungated_workflows` | + | `lavaflow.code_quality` | `lavaflow` is, Code Quality is released in this environment, and the + owner's plan allows Code Quality findings; with an allowance of 0 it is `unavailable` with `code` + `plan_required` | + | `lavaflow.slack` | `lavaflow` is, the Volcano Slack app is set up in this environment, and Slack + reports have launched in it | + | `lavaflow.aikido` | `lavaflow` is, and Aikido reports have launched in this environment | + + Where `lavaflow` isn't available, a project with LavaFlow settings, runs, + or bound Slack channels lists it `read_only`: its LavaFlow reads answer, + and its owner can turn LavaFlow off or remove channel bindings. A project without them lists it + `unavailable`, with + `code` `plan_required` when the owner's plan leaves LavaFlow out. + + Check it to decide what to offer for a project, instead of calling a + route to see whether it fails. Project access tokens can read it, + including read-only ones. + + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CapabilityList | Error] + """ + + + kwargs = request_kwargs( + id=id, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + id: UUID | str, + *, + client: AuthenticatedClient, + +) -> CapabilityList | Error | None: + """ List a project's capabilities + + Lists which product capabilities accept new work for this project. It + has the same entries as `GET /capabilities`, and answers each one as it + does, except for capabilities a project can have when another can't: + + | ID | Available for this project when | + | --- | --- | + | `lavaflow` | LavaFlow is released, offered to the project's owner, and included in the owner's + plan | + | `lavaflow.merge` | `lavaflow` is, and LavaFlow's merging is released in this environment | + | `lavaflow.lineage` | `lavaflow` is, and fix lineage is released in this environment | + | `lavaflow.open_pr_ci_start` | `lavaflow` is, and CI for fixes a person merges is released in this + environment | + | `lavaflow.repository_ci` | `lavaflow` is, and normal repository CI is released; the owner must + separately grant `allow_ungated_workflows` | + | `lavaflow.code_quality` | `lavaflow` is, Code Quality is released in this environment, and the + owner's plan allows Code Quality findings; with an allowance of 0 it is `unavailable` with `code` + `plan_required` | + | `lavaflow.slack` | `lavaflow` is, the Volcano Slack app is set up in this environment, and Slack + reports have launched in it | + | `lavaflow.aikido` | `lavaflow` is, and Aikido reports have launched in this environment | + + Where `lavaflow` isn't available, a project with LavaFlow settings, runs, + or bound Slack channels lists it `read_only`: its LavaFlow reads answer, + and its owner can turn LavaFlow off or remove channel bindings. A project without them lists it + `unavailable`, with + `code` `plan_required` when the owner's plan leaves LavaFlow out. + + Check it to decide what to offer for a project, instead of calling a + route to see whether it fails. Project access tokens can read it, + including read-only ones. + + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CapabilityList | Error + """ + + + return sync_detailed( + id=id, +client=client, + + ).parsed + +async def asyncio_detailed( + id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Response[CapabilityList | Error]: + """ List a project's capabilities + + Lists which product capabilities accept new work for this project. It + has the same entries as `GET /capabilities`, and answers each one as it + does, except for capabilities a project can have when another can't: + + | ID | Available for this project when | + | --- | --- | + | `lavaflow` | LavaFlow is released, offered to the project's owner, and included in the owner's + plan | + | `lavaflow.merge` | `lavaflow` is, and LavaFlow's merging is released in this environment | + | `lavaflow.lineage` | `lavaflow` is, and fix lineage is released in this environment | + | `lavaflow.open_pr_ci_start` | `lavaflow` is, and CI for fixes a person merges is released in this + environment | + | `lavaflow.repository_ci` | `lavaflow` is, and normal repository CI is released; the owner must + separately grant `allow_ungated_workflows` | + | `lavaflow.code_quality` | `lavaflow` is, Code Quality is released in this environment, and the + owner's plan allows Code Quality findings; with an allowance of 0 it is `unavailable` with `code` + `plan_required` | + | `lavaflow.slack` | `lavaflow` is, the Volcano Slack app is set up in this environment, and Slack + reports have launched in it | + | `lavaflow.aikido` | `lavaflow` is, and Aikido reports have launched in this environment | + + Where `lavaflow` isn't available, a project with LavaFlow settings, runs, + or bound Slack channels lists it `read_only`: its LavaFlow reads answer, + and its owner can turn LavaFlow off or remove channel bindings. A project without them lists it + `unavailable`, with + `code` `plan_required` when the owner's plan leaves LavaFlow out. + + Check it to decide what to offer for a project, instead of calling a + route to see whether it fails. Project access tokens can read it, + including read-only ones. + + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CapabilityList | Error] + """ + + + kwargs = request_kwargs( + id=id, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + id: UUID | str, + *, + client: AuthenticatedClient, + +) -> CapabilityList | Error | None: + """ List a project's capabilities + + Lists which product capabilities accept new work for this project. It + has the same entries as `GET /capabilities`, and answers each one as it + does, except for capabilities a project can have when another can't: + + | ID | Available for this project when | + | --- | --- | + | `lavaflow` | LavaFlow is released, offered to the project's owner, and included in the owner's + plan | + | `lavaflow.merge` | `lavaflow` is, and LavaFlow's merging is released in this environment | + | `lavaflow.lineage` | `lavaflow` is, and fix lineage is released in this environment | + | `lavaflow.open_pr_ci_start` | `lavaflow` is, and CI for fixes a person merges is released in this + environment | + | `lavaflow.repository_ci` | `lavaflow` is, and normal repository CI is released; the owner must + separately grant `allow_ungated_workflows` | + | `lavaflow.code_quality` | `lavaflow` is, Code Quality is released in this environment, and the + owner's plan allows Code Quality findings; with an allowance of 0 it is `unavailable` with `code` + `plan_required` | + | `lavaflow.slack` | `lavaflow` is, the Volcano Slack app is set up in this environment, and Slack + reports have launched in it | + | `lavaflow.aikido` | `lavaflow` is, and Aikido reports have launched in this environment | + + Where `lavaflow` isn't available, a project with LavaFlow settings, runs, + or bound Slack channels lists it `read_only`: its LavaFlow reads answer, + and its owner can turn LavaFlow off or remove channel bindings. A project without them lists it + `unavailable`, with + `code` `plan_required` when the owner's plan leaves LavaFlow out. + + Check it to decide what to offer for a project, instead of calling a + route to see whether it fails. Project access tokens can read it, + including read-only ones. + + Args: + id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CapabilityList | Error + """ + + + return (await asyncio_detailed( + id=id, +client=client, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/projects/replace_shared_variables.py b/src/volcano_sdk/_generated/api/projects/replace_shared_variables.py index 4d4857c3..d7416058 100644 --- a/src/volcano_sdk/_generated/api/projects/replace_shared_variables.py +++ b/src/volcano_sdk/_generated/api/projects/replace_shared_variables.py @@ -10,6 +10,7 @@ from ...models.error import Error from ...models.replace_shared_variables_body import ReplaceSharedVariablesBody +from ...models.shared_variables_replace_result import SharedVariablesReplaceResult from typing import cast from uuid import UUID @@ -42,7 +43,14 @@ def request_kwargs( -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | Error | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | Error | SharedVariablesReplaceResult | None: + if response.status_code == 200: + response_200 = SharedVariablesReplaceResult.from_dict(response.json()) + + + + return response_200 + if response.status_code == 204: response_204 = cast(Any, None) return response_204 @@ -93,7 +101,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any | Error]: +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any | Error | SharedVariablesReplaceResult]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -108,7 +116,7 @@ def sync_detailed( client: AuthenticatedClient, body: ReplaceSharedVariablesBody, -) -> Response[Any | Error]: +) -> Response[Any | Error | SharedVariablesReplaceResult]: """ Replace shared variable names Atomically replaces the complete shared function-variable list without @@ -125,7 +133,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | Error] + Response[Any | Error | SharedVariablesReplaceResult] """ @@ -147,7 +155,7 @@ def sync( client: AuthenticatedClient, body: ReplaceSharedVariablesBody, -) -> Any | Error | None: +) -> Any | Error | SharedVariablesReplaceResult | None: """ Replace shared variable names Atomically replaces the complete shared function-variable list without @@ -164,7 +172,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | Error + Any | Error | SharedVariablesReplaceResult """ @@ -181,7 +189,7 @@ async def asyncio_detailed( client: AuthenticatedClient, body: ReplaceSharedVariablesBody, -) -> Response[Any | Error]: +) -> Response[Any | Error | SharedVariablesReplaceResult]: """ Replace shared variable names Atomically replaces the complete shared function-variable list without @@ -198,7 +206,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | Error] + Response[Any | Error | SharedVariablesReplaceResult] """ @@ -220,7 +228,7 @@ async def asyncio( client: AuthenticatedClient, body: ReplaceSharedVariablesBody, -) -> Any | Error | None: +) -> Any | Error | SharedVariablesReplaceResult | None: """ Replace shared variable names Atomically replaces the complete shared function-variable list without @@ -237,7 +245,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | Error + Any | Error | SharedVariablesReplaceResult """ diff --git a/src/volcano_sdk/_generated/api/projects/set_project_git_production_branch.py b/src/volcano_sdk/_generated/api/projects/set_project_git_production_branch.py index 9701fe74..0c737bc8 100644 --- a/src/volcano_sdk/_generated/api/projects/set_project_git_production_branch.py +++ b/src/volcano_sdk/_generated/api/projects/set_project_git_production_branch.py @@ -86,6 +86,13 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return response_409 + if response.status_code == 429: + response_429 = Error.from_dict(response.json()) + + + + return response_429 + if response.status_code == 500: response_500 = Error.from_dict(response.json()) @@ -128,9 +135,16 @@ def sync_detailed( to be pushed — the case a repository created empty depends on. Setting the branch here marks it as the project's own choice, so a later - default-branch rename on GitHub no longer moves it. Projects that never + default-branch rename on GitHub no longer moves it, and the response + reports `production_branch_follows_default: false`. Projects that never set one keep following the repository's default branch. + An empty string undoes that choice: the project deploys from the + repository's default branch again and follows later renames. Volcano + reads the default branch from GitHub through the project owner's + connection, and the response carries it with + `production_branch_follows_default: true`. + Args: id (UUID): body (SetProjectGitProductionBranchRequest): @@ -176,9 +190,16 @@ def sync( to be pushed — the case a repository created empty depends on. Setting the branch here marks it as the project's own choice, so a later - default-branch rename on GitHub no longer moves it. Projects that never + default-branch rename on GitHub no longer moves it, and the response + reports `production_branch_follows_default: false`. Projects that never set one keep following the repository's default branch. + An empty string undoes that choice: the project deploys from the + repository's default branch again and follows later renames. Volcano + reads the default branch from GitHub through the project owner's + connection, and the response carries it with + `production_branch_follows_default: true`. + Args: id (UUID): body (SetProjectGitProductionBranchRequest): @@ -219,9 +240,16 @@ async def asyncio_detailed( to be pushed — the case a repository created empty depends on. Setting the branch here marks it as the project's own choice, so a later - default-branch rename on GitHub no longer moves it. Projects that never + default-branch rename on GitHub no longer moves it, and the response + reports `production_branch_follows_default: false`. Projects that never set one keep following the repository's default branch. + An empty string undoes that choice: the project deploys from the + repository's default branch again and follows later renames. Volcano + reads the default branch from GitHub through the project owner's + connection, and the response carries it with + `production_branch_follows_default: true`. + Args: id (UUID): body (SetProjectGitProductionBranchRequest): @@ -267,9 +295,16 @@ async def asyncio( to be pushed — the case a repository created empty depends on. Setting the branch here marks it as the project's own choice, so a later - default-branch rename on GitHub no longer moves it. Projects that never + default-branch rename on GitHub no longer moves it, and the response + reports `production_branch_follows_default: false`. Projects that never set one keep following the repository's default branch. + An empty string undoes that choice: the project deploys from the + repository's default branch again and follows later renames. Volcano + reads the default branch from GitHub through the project owner's + connection, and the response carries it with + `production_branch_follows_default: true`. + Args: id (UUID): body (SetProjectGitProductionBranchRequest): diff --git a/src/volcano_sdk/_generated/api/projects/set_project_git_root_directory.py b/src/volcano_sdk/_generated/api/projects/set_project_git_root_directory.py new file mode 100644 index 00000000..2827bb20 --- /dev/null +++ b/src/volcano_sdk/_generated/api/projects/set_project_git_root_directory.py @@ -0,0 +1,275 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from ...models.project_git_connection import ProjectGitConnection +from ...models.set_project_git_root_directory_request import SetProjectGitRootDirectoryRequest +from typing import cast +from uuid import UUID + + + +def request_kwargs( + id: UUID | str, + *, + body: SetProjectGitRootDirectoryRequest, + +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + + + + + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/projects/{id}/git-connection/root-directory".format(id=quote(str(id), safe=""),), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | ProjectGitConnection | None: + if response.status_code == 200: + response_200 = ProjectGitConnection.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 409: + response_409 = Error.from_dict(response.json()) + + + + return response_409 + + if response.status_code == 500: + response_500 = Error.from_dict(response.json()) + + + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | ProjectGitConnection]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: UUID | str, + *, + client: AuthenticatedClient, + body: SetProjectGitRootDirectoryRequest, + +) -> Response[Error | ProjectGitConnection]: + """ Set the directory a project builds from + + Changes only the root directory, leaving the repository, the production + branch and `production_branch_follows_default` alone. Unlike PUT /projects/{id}/git-connection, this + accepts a + project access token, so CI or an agent can move a project within its + repository without being able to change the repository. + + The directory is a path relative to the repository root. An empty + string, `.` or `/` means the repository root. The response carries it in + the form a deploy reads it: `./apps/web/` comes back as `apps/web`. + + Args: + id (UUID): + body (SetProjectGitRootDirectoryRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | ProjectGitConnection] + """ + + + kwargs = request_kwargs( + id=id, +body=body, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + id: UUID | str, + *, + client: AuthenticatedClient, + body: SetProjectGitRootDirectoryRequest, + +) -> Error | ProjectGitConnection | None: + """ Set the directory a project builds from + + Changes only the root directory, leaving the repository, the production + branch and `production_branch_follows_default` alone. Unlike PUT /projects/{id}/git-connection, this + accepts a + project access token, so CI or an agent can move a project within its + repository without being able to change the repository. + + The directory is a path relative to the repository root. An empty + string, `.` or `/` means the repository root. The response carries it in + the form a deploy reads it: `./apps/web/` comes back as `apps/web`. + + Args: + id (UUID): + body (SetProjectGitRootDirectoryRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | ProjectGitConnection + """ + + + return sync_detailed( + id=id, +client=client, +body=body, + + ).parsed + +async def asyncio_detailed( + id: UUID | str, + *, + client: AuthenticatedClient, + body: SetProjectGitRootDirectoryRequest, + +) -> Response[Error | ProjectGitConnection]: + """ Set the directory a project builds from + + Changes only the root directory, leaving the repository, the production + branch and `production_branch_follows_default` alone. Unlike PUT /projects/{id}/git-connection, this + accepts a + project access token, so CI or an agent can move a project within its + repository without being able to change the repository. + + The directory is a path relative to the repository root. An empty + string, `.` or `/` means the repository root. The response carries it in + the form a deploy reads it: `./apps/web/` comes back as `apps/web`. + + Args: + id (UUID): + body (SetProjectGitRootDirectoryRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | ProjectGitConnection] + """ + + + kwargs = request_kwargs( + id=id, +body=body, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + id: UUID | str, + *, + client: AuthenticatedClient, + body: SetProjectGitRootDirectoryRequest, + +) -> Error | ProjectGitConnection | None: + """ Set the directory a project builds from + + Changes only the root directory, leaving the repository, the production + branch and `production_branch_follows_default` alone. Unlike PUT /projects/{id}/git-connection, this + accepts a + project access token, so CI or an agent can move a project within its + repository without being able to change the repository. + + The directory is a path relative to the repository root. An empty + string, `.` or `/` means the repository root. The response carries it in + the form a deploy reads it: `./apps/web/` comes back as `apps/web`. + + Args: + id (UUID): + body (SetProjectGitRootDirectoryRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | ProjectGitConnection + """ + + + return (await asyncio_detailed( + id=id, +client=client, +body=body, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/projects/update_project_git_deploy_settings.py b/src/volcano_sdk/_generated/api/projects/update_project_git_deploy_settings.py index b3e1721f..798789cf 100644 --- a/src/volcano_sdk/_generated/api/projects/update_project_git_deploy_settings.py +++ b/src/volcano_sdk/_generated/api/projects/update_project_git_deploy_settings.py @@ -129,10 +129,15 @@ def sync_detailed( until set here; the frontend need not exist when they are saved, since frontend_name is resolved at deploy time. + apply_migrations and skip_unchanged are the exceptions to the full + replace: omitting either leaves its saved value unchanged. + apply_migrations is off until set here; skip_unchanged is on. + Args: id (UUID): body (UpdateProjectGitDeploySettingsRequest): Full replace of a project's Git auto-deploy - settings. + settings, except apply_migrations and skip_unchanged, which keep their saved values when + omitted. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -176,10 +181,15 @@ def sync( until set here; the frontend need not exist when they are saved, since frontend_name is resolved at deploy time. + apply_migrations and skip_unchanged are the exceptions to the full + replace: omitting either leaves its saved value unchanged. + apply_migrations is off until set here; skip_unchanged is on. + Args: id (UUID): body (UpdateProjectGitDeploySettingsRequest): Full replace of a project's Git auto-deploy - settings. + settings, except apply_migrations and skip_unchanged, which keep their saved values when + omitted. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -218,10 +228,15 @@ async def asyncio_detailed( until set here; the frontend need not exist when they are saved, since frontend_name is resolved at deploy time. + apply_migrations and skip_unchanged are the exceptions to the full + replace: omitting either leaves its saved value unchanged. + apply_migrations is off until set here; skip_unchanged is on. + Args: id (UUID): body (UpdateProjectGitDeploySettingsRequest): Full replace of a project's Git auto-deploy - settings. + settings, except apply_migrations and skip_unchanged, which keep their saved values when + omitted. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -265,10 +280,15 @@ async def asyncio( until set here; the frontend need not exist when they are saved, since frontend_name is resolved at deploy time. + apply_migrations and skip_unchanged are the exceptions to the full + replace: omitting either leaves its saved value unchanged. + apply_migrations is off until set here; skip_unchanged is on. + Args: id (UUID): body (UpdateProjectGitDeploySettingsRequest): Full replace of a project's Git auto-deploy - settings. + settings, except apply_migrations and skip_unchanged, which keep their saved values when + omitted. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/volcano_sdk/_generated/api/realtime/publish_realtime_message.py b/src/volcano_sdk/_generated/api/realtime/publish_realtime_message.py new file mode 100644 index 00000000..294bfa3f --- /dev/null +++ b/src/volcano_sdk/_generated/api/realtime/publish_realtime_message.py @@ -0,0 +1,295 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from ...models.realtime_publish_request import RealtimePublishRequest +from ...models.realtime_publish_result import RealtimePublishResult +from typing import cast + + + +def request_kwargs( + *, + body: RealtimePublishRequest, + +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + + + + + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/realtime/v1/publish", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | RealtimePublishResult | None: + if response.status_code == 202: + response_202 = RealtimePublishResult.from_dict(response.json()) + + + + return response_202 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 409: + response_409 = Error.from_dict(response.json()) + + + + return response_409 + + if response.status_code == 413: + response_413 = Error.from_dict(response.json()) + + + + return response_413 + + if response.status_code == 429: + response_429 = Error.from_dict(response.json()) + + + + return response_429 + + if response.status_code == 503: + response_503 = Error.from_dict(response.json()) + + + + return response_503 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | RealtimePublishResult]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: RealtimePublishRequest, + +) -> Response[Error | RealtimePublishResult]: + """ Publish a message to a Realtime channel + + Sends one message to a broadcast or grant channel of the project + embedded in the service-role key, for a backend that holds no + WebSocket, such as a function. The key needs `realtime.publish`. + + `channel` is a client channel: `broadcast:`, or + `grant:` for a channel only Realtime grant holders watch. Every + subscriber receives `{"type": , "payload": }` as the + message data, the shape `channel.on(, ...)` matches. + + The publish is metered like any server publish: the publish plus one + per subscriber it reaches. Messages are not stored; a subscriber that + was not connected misses it. A project's publishes share the rate a + WebSocket client publishes at; over it the answer is 429 + `realtime_publish_rate_limited`. + + Args: + body (RealtimePublishRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | RealtimePublishResult] + """ + + + kwargs = request_kwargs( + body=body, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient, + body: RealtimePublishRequest, + +) -> Error | RealtimePublishResult | None: + """ Publish a message to a Realtime channel + + Sends one message to a broadcast or grant channel of the project + embedded in the service-role key, for a backend that holds no + WebSocket, such as a function. The key needs `realtime.publish`. + + `channel` is a client channel: `broadcast:`, or + `grant:` for a channel only Realtime grant holders watch. Every + subscriber receives `{"type": , "payload": }` as the + message data, the shape `channel.on(, ...)` matches. + + The publish is metered like any server publish: the publish plus one + per subscriber it reaches. Messages are not stored; a subscriber that + was not connected misses it. A project's publishes share the rate a + WebSocket client publishes at; over it the answer is 429 + `realtime_publish_rate_limited`. + + Args: + body (RealtimePublishRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | RealtimePublishResult + """ + + + return sync_detailed( + client=client, +body=body, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: RealtimePublishRequest, + +) -> Response[Error | RealtimePublishResult]: + """ Publish a message to a Realtime channel + + Sends one message to a broadcast or grant channel of the project + embedded in the service-role key, for a backend that holds no + WebSocket, such as a function. The key needs `realtime.publish`. + + `channel` is a client channel: `broadcast:`, or + `grant:` for a channel only Realtime grant holders watch. Every + subscriber receives `{"type": , "payload": }` as the + message data, the shape `channel.on(, ...)` matches. + + The publish is metered like any server publish: the publish plus one + per subscriber it reaches. Messages are not stored; a subscriber that + was not connected misses it. A project's publishes share the rate a + WebSocket client publishes at; over it the answer is 429 + `realtime_publish_rate_limited`. + + Args: + body (RealtimePublishRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | RealtimePublishResult] + """ + + + kwargs = request_kwargs( + body=body, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient, + body: RealtimePublishRequest, + +) -> Error | RealtimePublishResult | None: + """ Publish a message to a Realtime channel + + Sends one message to a broadcast or grant channel of the project + embedded in the service-role key, for a backend that holds no + WebSocket, such as a function. The key needs `realtime.publish`. + + `channel` is a client channel: `broadcast:`, or + `grant:` for a channel only Realtime grant holders watch. Every + subscriber receives `{"type": , "payload": }` as the + message data, the shape `channel.on(, ...)` matches. + + The publish is metered like any server publish: the publish plus one + per subscriber it reaches. Messages are not stored; a subscriber that + was not connected misses it. A project's publishes share the rate a + WebSocket client publishes at; over it the answer is 429 + `realtime_publish_rate_limited`. + + Args: + body (RealtimePublishRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | RealtimePublishResult + """ + + + return (await asyncio_detailed( + client=client, +body=body, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/sandboxes/create_sandbox_file_archive.py b/src/volcano_sdk/_generated/api/sandboxes/create_sandbox_file_archive.py new file mode 100644 index 00000000..283923de --- /dev/null +++ b/src/volcano_sdk/_generated/api/sandboxes/create_sandbox_file_archive.py @@ -0,0 +1,329 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from ...models.sandbox_file_archive import SandboxFileArchive +from ...models.sandbox_file_archive_form import SandboxFileArchiveForm +from typing import cast + + + +def request_kwargs( + *, + body: SandboxFileArchiveForm, + +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + + + + + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/sandbox-file-archives", + } + + _kwargs["files"] = body.to_multipart() + + headers["Content-Type"] = "multipart/form-data; boundary=+++" + + _kwargs["headers"] = headers + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | SandboxFileArchive: + if response.status_code == 201: + response_201 = SandboxFileArchive.from_dict(response.json()) + + + + return response_201 + + response_default = Error.from_dict(response.json()) + + + + return response_default + + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | SandboxFileArchive]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: SandboxFileArchiveForm, + +) -> Response[Error | SandboxFileArchive]: + """ Extract a tar archive into a session's workspace + + Extracts a tar archive into a directory of a session's workspace. Send `multipart/form-data` + with `project_id`, `session_id` and `path`, in any order, then the archive as the file part + `archive`. The archive may be gzip-compressed; Volcano detects compression from its first bytes. + The request streams to the session, so the archive is never held whole in memory. + + Each call accepts at most 32 MiB of archive, 10,000 files and directories, and 256 MiB of + uncompressed archive, counting tar headers, and has 2 minutes to send its archive; a slower + call fails and writes nothing. Split larger trees into several archives and create one after + another. For a single file larger than 8 MiB, use `POST /sandbox-file-parts`. + + `path` must name a directory below the workspace root; a path that resolves to the root or to + `/`, such as `.`, `./`, `/`, `/workspace` or `/workspace/.`, is refused with + `sandbox_archive_invalid`. The archive may contain only regular files and directories. Entry + names are relative to `path`, which is created when missing; an absolute name, a `..` + component, a symbolic link, a + hard link, a sparse file, or a device refuses the whole archive. File and directory modes keep their + permission bits; setuid, setgid and sticky bits are dropped. A file replaces an existing file or + symbolic link at its path. Existing directories keep their modes. A symbolic link in the + destination is never followed. + + The archive is checked and staged before the workspace changes, so a refused archive writes + nothing, and one that fails part way is undone. If a session process moves or removes a + directory while the archive is written, the call answers `409`, a file the archive replaced + there is kept in a `.sandbox-archive-*` directory at the workspace root, and files the + archive already placed can stay. Read-only directories the session user + owns still take new entries and keep their modes. Code `sandbox_archive_invalid` (400) means the + archive or form is malformed or holds an + entry that is not allowed. Code `sandbox_archive_too_large` (413) means it exceeds a limit + above. Code `sandbox_path_conflict` (409) means the destination has a symbolic link or a file + where the archive needs a directory, a directory where it has a file, or a directory the + session user cannot write. Code + `sandbox_disk_full` (409) means the session's disk has no room for it; free space and retry. Code + `sandbox_image_outdated` (409) means the session started from an image that predates archive + writes; start a new session from a current preset, or redeploy the template. A session outside + `project_id`, or a project the caller cannot reach, answers 404 like an unknown session. + + Args: + body (SandboxFileArchiveForm): Send `project_id`, `session_id` and `path`, in any order, + then the `archive` part. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | SandboxFileArchive] + """ + + + kwargs = request_kwargs( + body=body, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient, + body: SandboxFileArchiveForm, + +) -> Error | SandboxFileArchive | None: + """ Extract a tar archive into a session's workspace + + Extracts a tar archive into a directory of a session's workspace. Send `multipart/form-data` + with `project_id`, `session_id` and `path`, in any order, then the archive as the file part + `archive`. The archive may be gzip-compressed; Volcano detects compression from its first bytes. + The request streams to the session, so the archive is never held whole in memory. + + Each call accepts at most 32 MiB of archive, 10,000 files and directories, and 256 MiB of + uncompressed archive, counting tar headers, and has 2 minutes to send its archive; a slower + call fails and writes nothing. Split larger trees into several archives and create one after + another. For a single file larger than 8 MiB, use `POST /sandbox-file-parts`. + + `path` must name a directory below the workspace root; a path that resolves to the root or to + `/`, such as `.`, `./`, `/`, `/workspace` or `/workspace/.`, is refused with + `sandbox_archive_invalid`. The archive may contain only regular files and directories. Entry + names are relative to `path`, which is created when missing; an absolute name, a `..` + component, a symbolic link, a + hard link, a sparse file, or a device refuses the whole archive. File and directory modes keep their + permission bits; setuid, setgid and sticky bits are dropped. A file replaces an existing file or + symbolic link at its path. Existing directories keep their modes. A symbolic link in the + destination is never followed. + + The archive is checked and staged before the workspace changes, so a refused archive writes + nothing, and one that fails part way is undone. If a session process moves or removes a + directory while the archive is written, the call answers `409`, a file the archive replaced + there is kept in a `.sandbox-archive-*` directory at the workspace root, and files the + archive already placed can stay. Read-only directories the session user + owns still take new entries and keep their modes. Code `sandbox_archive_invalid` (400) means the + archive or form is malformed or holds an + entry that is not allowed. Code `sandbox_archive_too_large` (413) means it exceeds a limit + above. Code `sandbox_path_conflict` (409) means the destination has a symbolic link or a file + where the archive needs a directory, a directory where it has a file, or a directory the + session user cannot write. Code + `sandbox_disk_full` (409) means the session's disk has no room for it; free space and retry. Code + `sandbox_image_outdated` (409) means the session started from an image that predates archive + writes; start a new session from a current preset, or redeploy the template. A session outside + `project_id`, or a project the caller cannot reach, answers 404 like an unknown session. + + Args: + body (SandboxFileArchiveForm): Send `project_id`, `session_id` and `path`, in any order, + then the `archive` part. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | SandboxFileArchive + """ + + + return sync_detailed( + client=client, +body=body, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: SandboxFileArchiveForm, + +) -> Response[Error | SandboxFileArchive]: + """ Extract a tar archive into a session's workspace + + Extracts a tar archive into a directory of a session's workspace. Send `multipart/form-data` + with `project_id`, `session_id` and `path`, in any order, then the archive as the file part + `archive`. The archive may be gzip-compressed; Volcano detects compression from its first bytes. + The request streams to the session, so the archive is never held whole in memory. + + Each call accepts at most 32 MiB of archive, 10,000 files and directories, and 256 MiB of + uncompressed archive, counting tar headers, and has 2 minutes to send its archive; a slower + call fails and writes nothing. Split larger trees into several archives and create one after + another. For a single file larger than 8 MiB, use `POST /sandbox-file-parts`. + + `path` must name a directory below the workspace root; a path that resolves to the root or to + `/`, such as `.`, `./`, `/`, `/workspace` or `/workspace/.`, is refused with + `sandbox_archive_invalid`. The archive may contain only regular files and directories. Entry + names are relative to `path`, which is created when missing; an absolute name, a `..` + component, a symbolic link, a + hard link, a sparse file, or a device refuses the whole archive. File and directory modes keep their + permission bits; setuid, setgid and sticky bits are dropped. A file replaces an existing file or + symbolic link at its path. Existing directories keep their modes. A symbolic link in the + destination is never followed. + + The archive is checked and staged before the workspace changes, so a refused archive writes + nothing, and one that fails part way is undone. If a session process moves or removes a + directory while the archive is written, the call answers `409`, a file the archive replaced + there is kept in a `.sandbox-archive-*` directory at the workspace root, and files the + archive already placed can stay. Read-only directories the session user + owns still take new entries and keep their modes. Code `sandbox_archive_invalid` (400) means the + archive or form is malformed or holds an + entry that is not allowed. Code `sandbox_archive_too_large` (413) means it exceeds a limit + above. Code `sandbox_path_conflict` (409) means the destination has a symbolic link or a file + where the archive needs a directory, a directory where it has a file, or a directory the + session user cannot write. Code + `sandbox_disk_full` (409) means the session's disk has no room for it; free space and retry. Code + `sandbox_image_outdated` (409) means the session started from an image that predates archive + writes; start a new session from a current preset, or redeploy the template. A session outside + `project_id`, or a project the caller cannot reach, answers 404 like an unknown session. + + Args: + body (SandboxFileArchiveForm): Send `project_id`, `session_id` and `path`, in any order, + then the `archive` part. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | SandboxFileArchive] + """ + + + kwargs = request_kwargs( + body=body, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient, + body: SandboxFileArchiveForm, + +) -> Error | SandboxFileArchive | None: + """ Extract a tar archive into a session's workspace + + Extracts a tar archive into a directory of a session's workspace. Send `multipart/form-data` + with `project_id`, `session_id` and `path`, in any order, then the archive as the file part + `archive`. The archive may be gzip-compressed; Volcano detects compression from its first bytes. + The request streams to the session, so the archive is never held whole in memory. + + Each call accepts at most 32 MiB of archive, 10,000 files and directories, and 256 MiB of + uncompressed archive, counting tar headers, and has 2 minutes to send its archive; a slower + call fails and writes nothing. Split larger trees into several archives and create one after + another. For a single file larger than 8 MiB, use `POST /sandbox-file-parts`. + + `path` must name a directory below the workspace root; a path that resolves to the root or to + `/`, such as `.`, `./`, `/`, `/workspace` or `/workspace/.`, is refused with + `sandbox_archive_invalid`. The archive may contain only regular files and directories. Entry + names are relative to `path`, which is created when missing; an absolute name, a `..` + component, a symbolic link, a + hard link, a sparse file, or a device refuses the whole archive. File and directory modes keep their + permission bits; setuid, setgid and sticky bits are dropped. A file replaces an existing file or + symbolic link at its path. Existing directories keep their modes. A symbolic link in the + destination is never followed. + + The archive is checked and staged before the workspace changes, so a refused archive writes + nothing, and one that fails part way is undone. If a session process moves or removes a + directory while the archive is written, the call answers `409`, a file the archive replaced + there is kept in a `.sandbox-archive-*` directory at the workspace root, and files the + archive already placed can stay. Read-only directories the session user + owns still take new entries and keep their modes. Code `sandbox_archive_invalid` (400) means the + archive or form is malformed or holds an + entry that is not allowed. Code `sandbox_archive_too_large` (413) means it exceeds a limit + above. Code `sandbox_path_conflict` (409) means the destination has a symbolic link or a file + where the archive needs a directory, a directory where it has a file, or a directory the + session user cannot write. Code + `sandbox_disk_full` (409) means the session's disk has no room for it; free space and retry. Code + `sandbox_image_outdated` (409) means the session started from an image that predates archive + writes; start a new session from a current preset, or redeploy the template. A session outside + `project_id`, or a project the caller cannot reach, answers 404 like an unknown session. + + Args: + body (SandboxFileArchiveForm): Send `project_id`, `session_id` and `path`, in any order, + then the `archive` part. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | SandboxFileArchive + """ + + + return (await asyncio_detailed( + client=client, +body=body, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/sandboxes/create_sandbox_file_part.py b/src/volcano_sdk/_generated/api/sandboxes/create_sandbox_file_part.py new file mode 100644 index 00000000..7101db43 --- /dev/null +++ b/src/volcano_sdk/_generated/api/sandboxes/create_sandbox_file_part.py @@ -0,0 +1,285 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from ...models.sandbox_file_part import SandboxFilePart +from ...models.sandbox_file_part_request import SandboxFilePartRequest +from typing import cast + + + +def request_kwargs( + *, + body: SandboxFilePartRequest, + +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + + + + + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/sandbox-file-parts", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | SandboxFilePart: + if response.status_code == 201: + response_201 = SandboxFilePart.from_dict(response.json()) + + + + return response_201 + + response_default = Error.from_dict(response.json()) + + + + return response_default + + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | SandboxFilePart]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: SandboxFilePartRequest, + +) -> Response[Error | SandboxFilePart]: + """ Write one part of a large workspace file + + Writes a file of up to 1 GiB into a session's workspace in parts of at most 8 MiB. Each part + names its `offset` in the file, the whole file's `size`, and the whole file's lowercase hex + `sha256`. Parts collect in a hidden staging file beside `path`; nothing appears at `path` until + the part that ends at `size` arrives. That part checks the whole file's size and SHA-256, then + moves the file into place in one step, so a partial file is never visible at `path`. The + response's `complete` says which part finished the file. Missing parent directories are created, + and a symbolic link among them is never followed. The finished file is readable and writable + only by the session user. + + A part may start anywhere up to the bytes already received, so a failed part can be resent. A + part at offset 0 starts the file again. Resending the part that finished the file answers the + same completion while the file at `path` still matches `size` and `sha256`. Code + `sandbox_file_part_out_of_order` (409) means the + part starts past the bytes received; resend from the last part that succeeded. Code + `sandbox_file_part_mismatch` (409) means the finished file differs from `size` or `sha256`; its + parts are discarded, so start again at offset 0. Code `sandbox_path_conflict` (409) means a + directory is at `path`, a file or symbolic link is where a parent directory belongs, or the + session user cannot write the parent directory, or, when parents are missing, the nearest + one that exists. Read-only directories the session user owns still take new entries and + keep their modes. Code + `sandbox_disk_full` (409) means the session's disk has no room; free space and retry. Code + `sandbox_image_outdated` (409) means the session started from an image that predates parted + writes. A staging file stays until its file completes, a part at offset 0 restarts it, or the + session ends. A session outside `project_id`, or a project the caller cannot reach, answers 404 + like an unknown session. + + Args: + body (SandboxFilePartRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | SandboxFilePart] + """ + + + kwargs = request_kwargs( + body=body, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient, + body: SandboxFilePartRequest, + +) -> Error | SandboxFilePart | None: + """ Write one part of a large workspace file + + Writes a file of up to 1 GiB into a session's workspace in parts of at most 8 MiB. Each part + names its `offset` in the file, the whole file's `size`, and the whole file's lowercase hex + `sha256`. Parts collect in a hidden staging file beside `path`; nothing appears at `path` until + the part that ends at `size` arrives. That part checks the whole file's size and SHA-256, then + moves the file into place in one step, so a partial file is never visible at `path`. The + response's `complete` says which part finished the file. Missing parent directories are created, + and a symbolic link among them is never followed. The finished file is readable and writable + only by the session user. + + A part may start anywhere up to the bytes already received, so a failed part can be resent. A + part at offset 0 starts the file again. Resending the part that finished the file answers the + same completion while the file at `path` still matches `size` and `sha256`. Code + `sandbox_file_part_out_of_order` (409) means the + part starts past the bytes received; resend from the last part that succeeded. Code + `sandbox_file_part_mismatch` (409) means the finished file differs from `size` or `sha256`; its + parts are discarded, so start again at offset 0. Code `sandbox_path_conflict` (409) means a + directory is at `path`, a file or symbolic link is where a parent directory belongs, or the + session user cannot write the parent directory, or, when parents are missing, the nearest + one that exists. Read-only directories the session user owns still take new entries and + keep their modes. Code + `sandbox_disk_full` (409) means the session's disk has no room; free space and retry. Code + `sandbox_image_outdated` (409) means the session started from an image that predates parted + writes. A staging file stays until its file completes, a part at offset 0 restarts it, or the + session ends. A session outside `project_id`, or a project the caller cannot reach, answers 404 + like an unknown session. + + Args: + body (SandboxFilePartRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | SandboxFilePart + """ + + + return sync_detailed( + client=client, +body=body, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: SandboxFilePartRequest, + +) -> Response[Error | SandboxFilePart]: + """ Write one part of a large workspace file + + Writes a file of up to 1 GiB into a session's workspace in parts of at most 8 MiB. Each part + names its `offset` in the file, the whole file's `size`, and the whole file's lowercase hex + `sha256`. Parts collect in a hidden staging file beside `path`; nothing appears at `path` until + the part that ends at `size` arrives. That part checks the whole file's size and SHA-256, then + moves the file into place in one step, so a partial file is never visible at `path`. The + response's `complete` says which part finished the file. Missing parent directories are created, + and a symbolic link among them is never followed. The finished file is readable and writable + only by the session user. + + A part may start anywhere up to the bytes already received, so a failed part can be resent. A + part at offset 0 starts the file again. Resending the part that finished the file answers the + same completion while the file at `path` still matches `size` and `sha256`. Code + `sandbox_file_part_out_of_order` (409) means the + part starts past the bytes received; resend from the last part that succeeded. Code + `sandbox_file_part_mismatch` (409) means the finished file differs from `size` or `sha256`; its + parts are discarded, so start again at offset 0. Code `sandbox_path_conflict` (409) means a + directory is at `path`, a file or symbolic link is where a parent directory belongs, or the + session user cannot write the parent directory, or, when parents are missing, the nearest + one that exists. Read-only directories the session user owns still take new entries and + keep their modes. Code + `sandbox_disk_full` (409) means the session's disk has no room; free space and retry. Code + `sandbox_image_outdated` (409) means the session started from an image that predates parted + writes. A staging file stays until its file completes, a part at offset 0 restarts it, or the + session ends. A session outside `project_id`, or a project the caller cannot reach, answers 404 + like an unknown session. + + Args: + body (SandboxFilePartRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | SandboxFilePart] + """ + + + kwargs = request_kwargs( + body=body, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient, + body: SandboxFilePartRequest, + +) -> Error | SandboxFilePart | None: + """ Write one part of a large workspace file + + Writes a file of up to 1 GiB into a session's workspace in parts of at most 8 MiB. Each part + names its `offset` in the file, the whole file's `size`, and the whole file's lowercase hex + `sha256`. Parts collect in a hidden staging file beside `path`; nothing appears at `path` until + the part that ends at `size` arrives. That part checks the whole file's size and SHA-256, then + moves the file into place in one step, so a partial file is never visible at `path`. The + response's `complete` says which part finished the file. Missing parent directories are created, + and a symbolic link among them is never followed. The finished file is readable and writable + only by the session user. + + A part may start anywhere up to the bytes already received, so a failed part can be resent. A + part at offset 0 starts the file again. Resending the part that finished the file answers the + same completion while the file at `path` still matches `size` and `sha256`. Code + `sandbox_file_part_out_of_order` (409) means the + part starts past the bytes received; resend from the last part that succeeded. Code + `sandbox_file_part_mismatch` (409) means the finished file differs from `size` or `sha256`; its + parts are discarded, so start again at offset 0. Code `sandbox_path_conflict` (409) means a + directory is at `path`, a file or symbolic link is where a parent directory belongs, or the + session user cannot write the parent directory, or, when parents are missing, the nearest + one that exists. Read-only directories the session user owns still take new entries and + keep their modes. Code + `sandbox_disk_full` (409) means the session's disk has no room; free space and retry. Code + `sandbox_image_outdated` (409) means the session started from an image that predates parted + writes. A staging file stays until its file completes, a part at offset 0 restarts it, or the + session ends. A session outside `project_id`, or a project the caller cannot reach, answers 404 + like an unknown session. + + Args: + body (SandboxFilePartRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | SandboxFilePart + """ + + + return (await asyncio_detailed( + client=client, +body=body, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/sandboxes/list_sandbox_session_files.py b/src/volcano_sdk/_generated/api/sandboxes/list_sandbox_session_files.py new file mode 100644 index 00000000..ca7cd44c --- /dev/null +++ b/src/volcano_sdk/_generated/api/sandboxes/list_sandbox_session_files.py @@ -0,0 +1,296 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from ...models.sandbox_file_list_result import SandboxFileListResult +from ...types import UNSET, Unset +from typing import cast +from uuid import UUID + + + +def request_kwargs( + *, + project_id: UUID | str, + session_id: UUID | str, + path: str | Unset = UNSET, + recursive: bool | Unset = True, + include_sha256: bool | Unset = False, + limit: int | Unset = 10000, + cursor: str | Unset = UNSET, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + json_project_id = str(project_id) + params["project_id"] = json_project_id + + json_session_id = str(session_id) + params["session_id"] = json_session_id + + params["path"] = path + + params["recursive"] = recursive + + params["include_sha256"] = include_sha256 + + params["limit"] = limit + + params["cursor"] = cursor + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/sandbox-session-files", + "params": params, + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | SandboxFileListResult: + if response.status_code == 200: + response_200 = SandboxFileListResult.from_dict(response.json()) + + + + return response_200 + + response_default = Error.from_dict(response.json()) + + + + return response_default + + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | SandboxFileListResult]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + project_id: UUID | str, + session_id: UUID | str, + path: str | Unset = UNSET, + recursive: bool | Unset = True, + include_sha256: bool | Unset = False, + limit: int | Unset = 10000, + cursor: str | Unset = UNSET, + +) -> Response[Error | SandboxFileListResult]: + """ List workspace files + + Lists a directory in a Sandbox session's workspace, one page at a time. The listing never follows a + symlink and never leaves the workspace. It is not a snapshot: a file that changes while it runs can + appear before or after the change. Sessions started on an image built before file listing answer 409 + with code `sandbox_image_outdated`; start a new session, after redeploying a custom template. + + Args: + project_id (UUID): + session_id (UUID): + path (str | Unset): + recursive (bool | Unset): Default: True. + include_sha256 (bool | Unset): Default: False. + limit (int | Unset): Default: 10000. + cursor (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | SandboxFileListResult] + """ + + + kwargs = request_kwargs( + project_id=project_id, +session_id=session_id, +path=path, +recursive=recursive, +include_sha256=include_sha256, +limit=limit, +cursor=cursor, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient, + project_id: UUID | str, + session_id: UUID | str, + path: str | Unset = UNSET, + recursive: bool | Unset = True, + include_sha256: bool | Unset = False, + limit: int | Unset = 10000, + cursor: str | Unset = UNSET, + +) -> Error | SandboxFileListResult | None: + """ List workspace files + + Lists a directory in a Sandbox session's workspace, one page at a time. The listing never follows a + symlink and never leaves the workspace. It is not a snapshot: a file that changes while it runs can + appear before or after the change. Sessions started on an image built before file listing answer 409 + with code `sandbox_image_outdated`; start a new session, after redeploying a custom template. + + Args: + project_id (UUID): + session_id (UUID): + path (str | Unset): + recursive (bool | Unset): Default: True. + include_sha256 (bool | Unset): Default: False. + limit (int | Unset): Default: 10000. + cursor (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | SandboxFileListResult + """ + + + return sync_detailed( + client=client, +project_id=project_id, +session_id=session_id, +path=path, +recursive=recursive, +include_sha256=include_sha256, +limit=limit, +cursor=cursor, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + project_id: UUID | str, + session_id: UUID | str, + path: str | Unset = UNSET, + recursive: bool | Unset = True, + include_sha256: bool | Unset = False, + limit: int | Unset = 10000, + cursor: str | Unset = UNSET, + +) -> Response[Error | SandboxFileListResult]: + """ List workspace files + + Lists a directory in a Sandbox session's workspace, one page at a time. The listing never follows a + symlink and never leaves the workspace. It is not a snapshot: a file that changes while it runs can + appear before or after the change. Sessions started on an image built before file listing answer 409 + with code `sandbox_image_outdated`; start a new session, after redeploying a custom template. + + Args: + project_id (UUID): + session_id (UUID): + path (str | Unset): + recursive (bool | Unset): Default: True. + include_sha256 (bool | Unset): Default: False. + limit (int | Unset): Default: 10000. + cursor (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | SandboxFileListResult] + """ + + + kwargs = request_kwargs( + project_id=project_id, +session_id=session_id, +path=path, +recursive=recursive, +include_sha256=include_sha256, +limit=limit, +cursor=cursor, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient, + project_id: UUID | str, + session_id: UUID | str, + path: str | Unset = UNSET, + recursive: bool | Unset = True, + include_sha256: bool | Unset = False, + limit: int | Unset = 10000, + cursor: str | Unset = UNSET, + +) -> Error | SandboxFileListResult | None: + """ List workspace files + + Lists a directory in a Sandbox session's workspace, one page at a time. The listing never follows a + symlink and never leaves the workspace. It is not a snapshot: a file that changes while it runs can + appear before or after the change. Sessions started on an image built before file listing answer 409 + with code `sandbox_image_outdated`; start a new session, after redeploying a custom template. + + Args: + project_id (UUID): + session_id (UUID): + path (str | Unset): + recursive (bool | Unset): Default: True. + include_sha256 (bool | Unset): Default: False. + limit (int | Unset): Default: 10000. + cursor (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | SandboxFileListResult + """ + + + return (await asyncio_detailed( + client=client, +project_id=project_id, +session_id=session_id, +path=path, +recursive=recursive, +include_sha256=include_sha256, +limit=limit, +cursor=cursor, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/sandboxes/update_sandbox_session_activity.py b/src/volcano_sdk/_generated/api/sandboxes/update_sandbox_session_activity.py new file mode 100644 index 00000000..6127ac72 --- /dev/null +++ b/src/volcano_sdk/_generated/api/sandboxes/update_sandbox_session_activity.py @@ -0,0 +1,231 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from ...models.update_sandbox_session_activity_body import UpdateSandboxSessionActivityBody +from typing import cast +from uuid import UUID + + + +def request_kwargs( + session_id: UUID | str, + *, + body: UpdateSandboxSessionActivityBody, + +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + + + + + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": "/sandbox-sessions/{session_id}".format(session_id=quote(str(session_id), safe=""),), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | Error: + if response.status_code == 204: + response_204 = cast(Any, None) + return response_204 + + response_default = Error.from_dict(response.json()) + + + + return response_default + + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any | Error]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + session_id: UUID | str, + *, + client: AuthenticatedClient, + body: UpdateSandboxSessionActivityBody, + +) -> Response[Any | Error]: + """ Report sandbox session activity + + Updates the session activity with one complete, ordered report. Other session fields keep their + values. A scoped service key needs the `sandboxes.sessions.activity` permission. Send new events + while the session is running, using a strictly increasing sequence per session. For `idle: true`, + send a positive `idle_timeout_seconds` to set or replace the deadline. For `idle: false`, omit + `idle_timeout_seconds`. Accepting this active report clears any existing idle deadline. Before + expiry, an exact retry of the latest event preserves its deadline. Reads leave the timer alone. + Suspension preserves it, and the original session lifetime still applies. At the idle deadline, live + access ends. When Volcano terminates the VM for idle expiry, its local files are lost and the + session records `sandbox_idle_expired` in `last_error_code`. + + Args: + session_id (UUID): + body (UpdateSandboxSessionActivityBody): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | Error] + """ + + + kwargs = request_kwargs( + session_id=session_id, +body=body, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + session_id: UUID | str, + *, + client: AuthenticatedClient, + body: UpdateSandboxSessionActivityBody, + +) -> Any | Error | None: + """ Report sandbox session activity + + Updates the session activity with one complete, ordered report. Other session fields keep their + values. A scoped service key needs the `sandboxes.sessions.activity` permission. Send new events + while the session is running, using a strictly increasing sequence per session. For `idle: true`, + send a positive `idle_timeout_seconds` to set or replace the deadline. For `idle: false`, omit + `idle_timeout_seconds`. Accepting this active report clears any existing idle deadline. Before + expiry, an exact retry of the latest event preserves its deadline. Reads leave the timer alone. + Suspension preserves it, and the original session lifetime still applies. At the idle deadline, live + access ends. When Volcano terminates the VM for idle expiry, its local files are lost and the + session records `sandbox_idle_expired` in `last_error_code`. + + Args: + session_id (UUID): + body (UpdateSandboxSessionActivityBody): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | Error + """ + + + return sync_detailed( + session_id=session_id, +client=client, +body=body, + + ).parsed + +async def asyncio_detailed( + session_id: UUID | str, + *, + client: AuthenticatedClient, + body: UpdateSandboxSessionActivityBody, + +) -> Response[Any | Error]: + """ Report sandbox session activity + + Updates the session activity with one complete, ordered report. Other session fields keep their + values. A scoped service key needs the `sandboxes.sessions.activity` permission. Send new events + while the session is running, using a strictly increasing sequence per session. For `idle: true`, + send a positive `idle_timeout_seconds` to set or replace the deadline. For `idle: false`, omit + `idle_timeout_seconds`. Accepting this active report clears any existing idle deadline. Before + expiry, an exact retry of the latest event preserves its deadline. Reads leave the timer alone. + Suspension preserves it, and the original session lifetime still applies. At the idle deadline, live + access ends. When Volcano terminates the VM for idle expiry, its local files are lost and the + session records `sandbox_idle_expired` in `last_error_code`. + + Args: + session_id (UUID): + body (UpdateSandboxSessionActivityBody): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | Error] + """ + + + kwargs = request_kwargs( + session_id=session_id, +body=body, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + session_id: UUID | str, + *, + client: AuthenticatedClient, + body: UpdateSandboxSessionActivityBody, + +) -> Any | Error | None: + """ Report sandbox session activity + + Updates the session activity with one complete, ordered report. Other session fields keep their + values. A scoped service key needs the `sandboxes.sessions.activity` permission. Send new events + while the session is running, using a strictly increasing sequence per session. For `idle: true`, + send a positive `idle_timeout_seconds` to set or replace the deadline. For `idle: false`, omit + `idle_timeout_seconds`. Accepting this active report clears any existing idle deadline. Before + expiry, an exact retry of the latest event preserves its deadline. Reads leave the timer alone. + Suspension preserves it, and the original session lifetime still applies. At the idle deadline, live + access ends. When Volcano terminates the VM for idle expiry, its local files are lost and the + session records `sandbox_idle_expired` in `last_error_code`. + + Args: + session_id (UUID): + body (UpdateSandboxSessionActivityBody): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | Error + """ + + + return (await asyncio_detailed( + session_id=session_id, +client=client, +body=body, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/service_keys/create_service_key.py b/src/volcano_sdk/_generated/api/service_keys/create_service_key.py index 138d753a..88246b3c 100644 --- a/src/volcano_sdk/_generated/api/service_keys/create_service_key.py +++ b/src/volcano_sdk/_generated/api/service_keys/create_service_key.py @@ -9,6 +9,7 @@ from ... import errors from ...models.create_service_key_body import CreateServiceKeyBody +from ...models.error import Error from ...models.service_key import ServiceKey from typing import cast from uuid import UUID @@ -42,7 +43,7 @@ def request_kwargs( -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | ServiceKey | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | ServiceKey | None: if response.status_code == 201: response_201 = ServiceKey.from_dict(response.json()) @@ -50,8 +51,32 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return response_201 + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + if response.status_code == 409: - response_409 = cast(Any, None) + response_409 = Error.from_dict(response.json()) + + + return response_409 if client.raise_on_unexpected_status: @@ -60,7 +85,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any | ServiceKey]: +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | ServiceKey]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -75,7 +100,7 @@ def sync_detailed( client: AuthenticatedClient, body: CreateServiceKeyBody, -) -> Response[Any | ServiceKey]: +) -> Response[Error | ServiceKey]: """ Create service key Create a new service role key for admin operations. @@ -83,6 +108,33 @@ def sync_detailed( **WARNING:** Service keys bypass all RLS policies! Store securely and NEVER expose in frontend code. + A key that holds `ai.invoke` is an AI key for the Volcano AI gateway, + which calls models on the project's behalf. Volcano pays the model + provider for those calls; the project is not billed for them. It holds `ai.invoke` and nothing else, + and is marked as created + by a person, so the gateway can tell it from every other key: a key + that holds `"*"`, and a key created before AI keys existed, never + count. Only a person creates one: signed in to the dashboard, or with + a `volcano login` token whose sign-in is live. A project access token, + a request made through MCP, a platform token created through the token + API, and a sign-in that ended get `403` with code `person_required`. + On a local server, the local platform token counts as the person. + Reading or regenerating an AI key takes the same person as creating + it, and lists leave its value out. An AI key only mints run tokens: + the database API and realtime refuse it, whether or not service key + scopes apply to them yet. While the `ai_gateway` capability + is unavailable, asking for `ai.invoke` answers `404` with code + `feature_unavailable`; existing keys keep working with the other + service key routes. + + A key that holds `grants.mint` lets a first-party app, such as the + Builder, mint delegated grants. It too holds that permission alone + and takes a person, as an AI key does. Only a registered first-party + app's project may hold one, and only its owner creates it: another + project gets `403` with code + `first_party_app_required`. The `ai_gateway` capability doesn't apply + to it, and it carries no AI marker. + Args: id (UUID): body (CreateServiceKeyBody): @@ -92,7 +144,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | ServiceKey] + Response[Error | ServiceKey] """ @@ -114,7 +166,7 @@ def sync( client: AuthenticatedClient, body: CreateServiceKeyBody, -) -> Any | ServiceKey | None: +) -> Error | ServiceKey | None: """ Create service key Create a new service role key for admin operations. @@ -122,6 +174,33 @@ def sync( **WARNING:** Service keys bypass all RLS policies! Store securely and NEVER expose in frontend code. + A key that holds `ai.invoke` is an AI key for the Volcano AI gateway, + which calls models on the project's behalf. Volcano pays the model + provider for those calls; the project is not billed for them. It holds `ai.invoke` and nothing else, + and is marked as created + by a person, so the gateway can tell it from every other key: a key + that holds `"*"`, and a key created before AI keys existed, never + count. Only a person creates one: signed in to the dashboard, or with + a `volcano login` token whose sign-in is live. A project access token, + a request made through MCP, a platform token created through the token + API, and a sign-in that ended get `403` with code `person_required`. + On a local server, the local platform token counts as the person. + Reading or regenerating an AI key takes the same person as creating + it, and lists leave its value out. An AI key only mints run tokens: + the database API and realtime refuse it, whether or not service key + scopes apply to them yet. While the `ai_gateway` capability + is unavailable, asking for `ai.invoke` answers `404` with code + `feature_unavailable`; existing keys keep working with the other + service key routes. + + A key that holds `grants.mint` lets a first-party app, such as the + Builder, mint delegated grants. It too holds that permission alone + and takes a person, as an AI key does. Only a registered first-party + app's project may hold one, and only its owner creates it: another + project gets `403` with code + `first_party_app_required`. The `ai_gateway` capability doesn't apply + to it, and it carries no AI marker. + Args: id (UUID): body (CreateServiceKeyBody): @@ -131,7 +210,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | ServiceKey + Error | ServiceKey """ @@ -148,7 +227,7 @@ async def asyncio_detailed( client: AuthenticatedClient, body: CreateServiceKeyBody, -) -> Response[Any | ServiceKey]: +) -> Response[Error | ServiceKey]: """ Create service key Create a new service role key for admin operations. @@ -156,6 +235,33 @@ async def asyncio_detailed( **WARNING:** Service keys bypass all RLS policies! Store securely and NEVER expose in frontend code. + A key that holds `ai.invoke` is an AI key for the Volcano AI gateway, + which calls models on the project's behalf. Volcano pays the model + provider for those calls; the project is not billed for them. It holds `ai.invoke` and nothing else, + and is marked as created + by a person, so the gateway can tell it from every other key: a key + that holds `"*"`, and a key created before AI keys existed, never + count. Only a person creates one: signed in to the dashboard, or with + a `volcano login` token whose sign-in is live. A project access token, + a request made through MCP, a platform token created through the token + API, and a sign-in that ended get `403` with code `person_required`. + On a local server, the local platform token counts as the person. + Reading or regenerating an AI key takes the same person as creating + it, and lists leave its value out. An AI key only mints run tokens: + the database API and realtime refuse it, whether or not service key + scopes apply to them yet. While the `ai_gateway` capability + is unavailable, asking for `ai.invoke` answers `404` with code + `feature_unavailable`; existing keys keep working with the other + service key routes. + + A key that holds `grants.mint` lets a first-party app, such as the + Builder, mint delegated grants. It too holds that permission alone + and takes a person, as an AI key does. Only a registered first-party + app's project may hold one, and only its owner creates it: another + project gets `403` with code + `first_party_app_required`. The `ai_gateway` capability doesn't apply + to it, and it carries no AI marker. + Args: id (UUID): body (CreateServiceKeyBody): @@ -165,7 +271,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | ServiceKey] + Response[Error | ServiceKey] """ @@ -187,7 +293,7 @@ async def asyncio( client: AuthenticatedClient, body: CreateServiceKeyBody, -) -> Any | ServiceKey | None: +) -> Error | ServiceKey | None: """ Create service key Create a new service role key for admin operations. @@ -195,6 +301,33 @@ async def asyncio( **WARNING:** Service keys bypass all RLS policies! Store securely and NEVER expose in frontend code. + A key that holds `ai.invoke` is an AI key for the Volcano AI gateway, + which calls models on the project's behalf. Volcano pays the model + provider for those calls; the project is not billed for them. It holds `ai.invoke` and nothing else, + and is marked as created + by a person, so the gateway can tell it from every other key: a key + that holds `"*"`, and a key created before AI keys existed, never + count. Only a person creates one: signed in to the dashboard, or with + a `volcano login` token whose sign-in is live. A project access token, + a request made through MCP, a platform token created through the token + API, and a sign-in that ended get `403` with code `person_required`. + On a local server, the local platform token counts as the person. + Reading or regenerating an AI key takes the same person as creating + it, and lists leave its value out. An AI key only mints run tokens: + the database API and realtime refuse it, whether or not service key + scopes apply to them yet. While the `ai_gateway` capability + is unavailable, asking for `ai.invoke` answers `404` with code + `feature_unavailable`; existing keys keep working with the other + service key routes. + + A key that holds `grants.mint` lets a first-party app, such as the + Builder, mint delegated grants. It too holds that permission alone + and takes a person, as an AI key does. Only a registered first-party + app's project may hold one, and only its owner creates it: another + project gets `403` with code + `first_party_app_required`. The `ai_gateway` capability doesn't apply + to it, and it carries no AI marker. + Args: id (UUID): body (CreateServiceKeyBody): @@ -204,7 +337,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | ServiceKey + Error | ServiceKey """ diff --git a/src/volcano_sdk/_generated/api/service_keys/get_service_key.py b/src/volcano_sdk/_generated/api/service_keys/get_service_key.py index 0ce830c2..f90bf724 100644 --- a/src/volcano_sdk/_generated/api/service_keys/get_service_key.py +++ b/src/volcano_sdk/_generated/api/service_keys/get_service_key.py @@ -8,6 +8,7 @@ from ...types import Response, UNSET from ... import errors +from ...models.error import Error from ...models.service_key import ServiceKey from typing import cast from uuid import UUID @@ -35,7 +36,7 @@ def request_kwargs( -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | ServiceKey | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | Error | ServiceKey | None: if response.status_code == 200: response_200 = ServiceKey.from_dict(response.json()) @@ -43,6 +44,13 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return response_200 + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + if response.status_code == 404: response_404 = cast(Any, None) return response_404 @@ -53,7 +61,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any | ServiceKey]: +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any | Error | ServiceKey]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -68,7 +76,7 @@ def sync_detailed( *, client: AuthenticatedClient, -) -> Response[Any | ServiceKey]: +) -> Response[Any | Error | ServiceKey]: """ Get service key Get details of a specific service key @@ -82,7 +90,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | ServiceKey] + Response[Any | Error | ServiceKey] """ @@ -104,7 +112,7 @@ def sync( *, client: AuthenticatedClient, -) -> Any | ServiceKey | None: +) -> Any | Error | ServiceKey | None: """ Get service key Get details of a specific service key @@ -118,7 +126,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | ServiceKey + Any | Error | ServiceKey """ @@ -135,7 +143,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, -) -> Response[Any | ServiceKey]: +) -> Response[Any | Error | ServiceKey]: """ Get service key Get details of a specific service key @@ -149,7 +157,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | ServiceKey] + Response[Any | Error | ServiceKey] """ @@ -171,7 +179,7 @@ async def asyncio( *, client: AuthenticatedClient, -) -> Any | ServiceKey | None: +) -> Any | Error | ServiceKey | None: """ Get service key Get details of a specific service key @@ -185,7 +193,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | ServiceKey + Any | Error | ServiceKey """ diff --git a/src/volcano_sdk/_generated/api/service_keys/regenerate_service_key.py b/src/volcano_sdk/_generated/api/service_keys/regenerate_service_key.py index 25705f10..e17f59f7 100644 --- a/src/volcano_sdk/_generated/api/service_keys/regenerate_service_key.py +++ b/src/volcano_sdk/_generated/api/service_keys/regenerate_service_key.py @@ -8,6 +8,7 @@ from ...types import Response, UNSET from ... import errors +from ...models.error import Error from ...models.service_key import ServiceKey from typing import cast from uuid import UUID @@ -35,7 +36,7 @@ def request_kwargs( -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> ServiceKey | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | ServiceKey | None: if response.status_code == 200: response_200 = ServiceKey.from_dict(response.json()) @@ -43,13 +44,20 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return response_200 + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: return None -def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[ServiceKey]: +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | ServiceKey]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -64,7 +72,7 @@ def sync_detailed( *, client: AuthenticatedClient, -) -> Response[ServiceKey]: +) -> Response[Error | ServiceKey]: """ Regenerate service key Generate new JWT value for existing key. @@ -80,7 +88,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ServiceKey] + Response[Error | ServiceKey] """ @@ -102,7 +110,7 @@ def sync( *, client: AuthenticatedClient, -) -> ServiceKey | None: +) -> Error | ServiceKey | None: """ Regenerate service key Generate new JWT value for existing key. @@ -118,7 +126,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ServiceKey + Error | ServiceKey """ @@ -135,7 +143,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, -) -> Response[ServiceKey]: +) -> Response[Error | ServiceKey]: """ Regenerate service key Generate new JWT value for existing key. @@ -151,7 +159,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ServiceKey] + Response[Error | ServiceKey] """ @@ -173,7 +181,7 @@ async def asyncio( *, client: AuthenticatedClient, -) -> ServiceKey | None: +) -> Error | ServiceKey | None: """ Regenerate service key Generate new JWT value for existing key. @@ -189,7 +197,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ServiceKey + Error | ServiceKey """ diff --git a/src/volcano_sdk/_generated/api/shares/__init__.py b/src/volcano_sdk/_generated/api/shares/__init__.py new file mode 100644 index 00000000..c9921b5f --- /dev/null +++ b/src/volcano_sdk/_generated/api/shares/__init__.py @@ -0,0 +1 @@ +""" Contains endpoint functions for accessing the API """ diff --git a/src/volcano_sdk/_generated/api/shares/create_share.py b/src/volcano_sdk/_generated/api/shares/create_share.py new file mode 100644 index 00000000..1fc93133 --- /dev/null +++ b/src/volcano_sdk/_generated/api/shares/create_share.py @@ -0,0 +1,241 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from ...models.share import Share +from ...models.share_create_request import ShareCreateRequest +from typing import cast + + + +def request_kwargs( + *, + body: ShareCreateRequest, + +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + + + + + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/shares", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | Share | None: + if response.status_code == 201: + response_201 = Share.from_dict(response.json()) + + + + return response_201 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 409: + response_409 = Error.from_dict(response.json()) + + + + return response_409 + + if response.status_code == 500: + response_500 = Error.from_dict(response.json()) + + + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | Share]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: ShareCreateRequest, + +) -> Response[Error | Share]: + """ Create a deploy link + + Creates a draft link for the project. It offers nothing to visitors, and its + preview answers `404`, until its owner publishes a release to it with + `POST /share-releases`. Any project can have + links, whether it deploys from the CLI, the dashboard or Git. + + Args: + body (ShareCreateRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | Share] + """ + + + kwargs = request_kwargs( + body=body, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient, + body: ShareCreateRequest, + +) -> Error | Share | None: + """ Create a deploy link + + Creates a draft link for the project. It offers nothing to visitors, and its + preview answers `404`, until its owner publishes a release to it with + `POST /share-releases`. Any project can have + links, whether it deploys from the CLI, the dashboard or Git. + + Args: + body (ShareCreateRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | Share + """ + + + return sync_detailed( + client=client, +body=body, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: ShareCreateRequest, + +) -> Response[Error | Share]: + """ Create a deploy link + + Creates a draft link for the project. It offers nothing to visitors, and its + preview answers `404`, until its owner publishes a release to it with + `POST /share-releases`. Any project can have + links, whether it deploys from the CLI, the dashboard or Git. + + Args: + body (ShareCreateRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | Share] + """ + + + kwargs = request_kwargs( + body=body, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient, + body: ShareCreateRequest, + +) -> Error | Share | None: + """ Create a deploy link + + Creates a draft link for the project. It offers nothing to visitors, and its + preview answers `404`, until its owner publishes a release to it with + `POST /share-releases`. Any project can have + links, whether it deploys from the CLI, the dashboard or Git. + + Args: + body (ShareCreateRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | Share + """ + + + return (await asyncio_detailed( + client=client, +body=body, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/shares/delete_share.py b/src/volcano_sdk/_generated/api/shares/delete_share.py new file mode 100644 index 00000000..9dd675e2 --- /dev/null +++ b/src/volcano_sdk/_generated/api/shares/delete_share.py @@ -0,0 +1,257 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from ...types import UNSET, Unset +from typing import cast +from uuid import UUID + + + +def request_kwargs( + share_id: str, + *, + project_id: UUID | str | Unset = UNSET, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + json_project_id: str | Unset = UNSET + if not isinstance(project_id, Unset): + json_project_id = str(project_id) + params["project_id"] = json_project_id + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/shares/{share_id}".format(share_id=quote(str(share_id), safe=""),), + "params": params, + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | Error | None: + if response.status_code == 204: + response_204 = cast(Any, None) + return response_204 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 500: + response_500 = Error.from_dict(response.json()) + + + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any | Error]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + share_id: str, + *, + client: AuthenticatedClient, + project_id: UUID | str | Unset = UNSET, + +) -> Response[Any | Error]: + """ Delete a deploy link + + Deletes the link, its releases and its recorded events. The address stops + working. Installs the link started that have not finished, including ones + still queued, fail at their next step. The visitor keeps the project, with + its installation failed. A link Volcano took down (`disabled_reason` + `operator`) cannot be deleted until that is lifted; deleting its project + still removes it. + + Args: + share_id (str): + project_id (UUID | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | Error] + """ + + + kwargs = request_kwargs( + share_id=share_id, +project_id=project_id, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + share_id: str, + *, + client: AuthenticatedClient, + project_id: UUID | str | Unset = UNSET, + +) -> Any | Error | None: + """ Delete a deploy link + + Deletes the link, its releases and its recorded events. The address stops + working. Installs the link started that have not finished, including ones + still queued, fail at their next step. The visitor keeps the project, with + its installation failed. A link Volcano took down (`disabled_reason` + `operator`) cannot be deleted until that is lifted; deleting its project + still removes it. + + Args: + share_id (str): + project_id (UUID | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | Error + """ + + + return sync_detailed( + share_id=share_id, +client=client, +project_id=project_id, + + ).parsed + +async def asyncio_detailed( + share_id: str, + *, + client: AuthenticatedClient, + project_id: UUID | str | Unset = UNSET, + +) -> Response[Any | Error]: + """ Delete a deploy link + + Deletes the link, its releases and its recorded events. The address stops + working. Installs the link started that have not finished, including ones + still queued, fail at their next step. The visitor keeps the project, with + its installation failed. A link Volcano took down (`disabled_reason` + `operator`) cannot be deleted until that is lifted; deleting its project + still removes it. + + Args: + share_id (str): + project_id (UUID | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | Error] + """ + + + kwargs = request_kwargs( + share_id=share_id, +project_id=project_id, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + share_id: str, + *, + client: AuthenticatedClient, + project_id: UUID | str | Unset = UNSET, + +) -> Any | Error | None: + """ Delete a deploy link + + Deletes the link, its releases and its recorded events. The address stops + working. Installs the link started that have not finished, including ones + still queued, fail at their next step. The visitor keeps the project, with + its installation failed. A link Volcano took down (`disabled_reason` + `operator`) cannot be deleted until that is lifted; deleting its project + still removes it. + + Args: + share_id (str): + project_id (UUID | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | Error + """ + + + return (await asyncio_detailed( + share_id=share_id, +client=client, +project_id=project_id, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/shares/get_share.py b/src/volcano_sdk/_generated/api/shares/get_share.py new file mode 100644 index 00000000..ef18a6ee --- /dev/null +++ b/src/volcano_sdk/_generated/api/shares/get_share.py @@ -0,0 +1,226 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from ...models.share import Share +from ...types import UNSET, Unset +from typing import cast +from uuid import UUID + + + +def request_kwargs( + share_id: str, + *, + project_id: UUID | str | Unset = UNSET, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + json_project_id: str | Unset = UNSET + if not isinstance(project_id, Unset): + json_project_id = str(project_id) + params["project_id"] = json_project_id + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/shares/{share_id}".format(share_id=quote(str(share_id), safe=""),), + "params": params, + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | Share | None: + if response.status_code == 200: + response_200 = Share.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 500: + response_500 = Error.from_dict(response.json()) + + + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | Share]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + share_id: str, + *, + client: AuthenticatedClient, + project_id: UUID | str | Unset = UNSET, + +) -> Response[Error | Share]: + """ Get a deploy link + + Args: + share_id (str): + project_id (UUID | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | Share] + """ + + + kwargs = request_kwargs( + share_id=share_id, +project_id=project_id, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + share_id: str, + *, + client: AuthenticatedClient, + project_id: UUID | str | Unset = UNSET, + +) -> Error | Share | None: + """ Get a deploy link + + Args: + share_id (str): + project_id (UUID | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | Share + """ + + + return sync_detailed( + share_id=share_id, +client=client, +project_id=project_id, + + ).parsed + +async def asyncio_detailed( + share_id: str, + *, + client: AuthenticatedClient, + project_id: UUID | str | Unset = UNSET, + +) -> Response[Error | Share]: + """ Get a deploy link + + Args: + share_id (str): + project_id (UUID | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | Share] + """ + + + kwargs = request_kwargs( + share_id=share_id, +project_id=project_id, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + share_id: str, + *, + client: AuthenticatedClient, + project_id: UUID | str | Unset = UNSET, + +) -> Error | Share | None: + """ Get a deploy link + + Args: + share_id (str): + project_id (UUID | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | Share + """ + + + return (await asyncio_detailed( + share_id=share_id, +client=client, +project_id=project_id, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/shares/get_share_preview.py b/src/volcano_sdk/_generated/api/shares/get_share_preview.py new file mode 100644 index 00000000..c2e710d6 --- /dev/null +++ b/src/volcano_sdk/_generated/api/shares/get_share_preview.py @@ -0,0 +1,265 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from ...models.share_preview import SharePreview +from typing import cast + + + +def request_kwargs( + share_id: str, + +) -> dict[str, Any]: + + + + + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/share-previews/{share_id}".format(share_id=quote(str(share_id), safe=""),), + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | SharePreview | None: + if response.status_code == 200: + response_200 = SharePreview.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 429: + response_429 = Error.from_dict(response.json()) + + + + return response_429 + + if response.status_code == 451: + response_451 = Error.from_dict(response.json()) + + + + return response_451 + + if response.status_code == 500: + response_500 = Error.from_dict(response.json()) + + + + return response_500 + + if response.status_code == 503: + response_503 = Error.from_dict(response.json()) + + + + return response_503 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | SharePreview]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + share_id: str, + *, + client: AuthenticatedClient | Client, + +) -> Response[Error | SharePreview]: + """ Preview what a deploy link deploys + + Public: needs no credential, because the link id is the credential. Answers + the link's current release: when it was published, its digest, the functions + and frontends installing it creates, the variables the visitor supplies, and + the functions that receive the new project's service key. Show it to a + visitor before they confirm, and send its `release.id` when creating the + project. + + Counts the visit for the link's owner, unless the request comes from a + crawler or link preview. A link that does not exist, was switched off, or has + not been published yet all answer the same `404`. + + Args: + share_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | SharePreview] + """ + + + kwargs = request_kwargs( + share_id=share_id, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + share_id: str, + *, + client: AuthenticatedClient | Client, + +) -> Error | SharePreview | None: + """ Preview what a deploy link deploys + + Public: needs no credential, because the link id is the credential. Answers + the link's current release: when it was published, its digest, the functions + and frontends installing it creates, the variables the visitor supplies, and + the functions that receive the new project's service key. Show it to a + visitor before they confirm, and send its `release.id` when creating the + project. + + Counts the visit for the link's owner, unless the request comes from a + crawler or link preview. A link that does not exist, was switched off, or has + not been published yet all answer the same `404`. + + Args: + share_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | SharePreview + """ + + + return sync_detailed( + share_id=share_id, +client=client, + + ).parsed + +async def asyncio_detailed( + share_id: str, + *, + client: AuthenticatedClient | Client, + +) -> Response[Error | SharePreview]: + """ Preview what a deploy link deploys + + Public: needs no credential, because the link id is the credential. Answers + the link's current release: when it was published, its digest, the functions + and frontends installing it creates, the variables the visitor supplies, and + the functions that receive the new project's service key. Show it to a + visitor before they confirm, and send its `release.id` when creating the + project. + + Counts the visit for the link's owner, unless the request comes from a + crawler or link preview. A link that does not exist, was switched off, or has + not been published yet all answer the same `404`. + + Args: + share_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | SharePreview] + """ + + + kwargs = request_kwargs( + share_id=share_id, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + share_id: str, + *, + client: AuthenticatedClient | Client, + +) -> Error | SharePreview | None: + """ Preview what a deploy link deploys + + Public: needs no credential, because the link id is the credential. Answers + the link's current release: when it was published, its digest, the functions + and frontends installing it creates, the variables the visitor supplies, and + the functions that receive the new project's service key. Show it to a + visitor before they confirm, and send its `release.id` when creating the + project. + + Counts the visit for the link's owner, unless the request comes from a + crawler or link preview. A link that does not exist, was switched off, or has + not been published yet all answer the same `404`. + + Args: + share_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | SharePreview + """ + + + return (await asyncio_detailed( + share_id=share_id, +client=client, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/shares/get_share_release_draft.py b/src/volcano_sdk/_generated/api/shares/get_share_release_draft.py new file mode 100644 index 00000000..0f451153 --- /dev/null +++ b/src/volcano_sdk/_generated/api/shares/get_share_release_draft.py @@ -0,0 +1,308 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from ...models.share_release_draft import ShareReleaseDraft +from ...types import UNSET, Unset +from typing import cast +from uuid import UUID + + + +def request_kwargs( + *, + share_id: str, + project_id: UUID | str | Unset = UNSET, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + params["share_id"] = share_id + + json_project_id: str | Unset = UNSET + if not isinstance(project_id, Unset): + json_project_id = str(project_id) + params["project_id"] = json_project_id + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/share-release-drafts", + "params": params, + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | ShareReleaseDraft | None: + if response.status_code == 200: + response_200 = ShareReleaseDraft.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 422: + response_422 = Error.from_dict(response.json()) + + + + return response_422 + + if response.status_code == 429: + response_429 = Error.from_dict(response.json()) + + + + return response_429 + + if response.status_code == 500: + response_500 = Error.from_dict(response.json()) + + + + return response_500 + + if response.status_code == 503: + response_503 = Error.from_dict(response.json()) + + + + return response_503 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | ShareReleaseDraft]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + share_id: str, + project_id: UUID | str | Unset = UNSET, + +) -> Response[Error | ShareReleaseDraft]: + """ Show what publishing a deploy link would release + + Builds the project's deployed functions and frontends the way a release + would, without storing anything, and reports what it would carry: the + functions and frontends, the project variables every project created from + the release gets (empty unless the visitor gives a value), the functions + whose code reads `VOLCANO_SERVICE_KEY`, and what is left out (resources with + no stored source, databases, sandboxes, dotenv and key files). Review it, + then publish with its `draft_id`, and its variables and service key + functions confirmed. + + Every call runs a full build and counts against the account's hourly + release build budget, which drafts and publishes share. Fetch it when the + owner opens the publish step, not on every focus or poll. + + Args: + share_id (str): + project_id (UUID | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | ShareReleaseDraft] + """ + + + kwargs = request_kwargs( + share_id=share_id, +project_id=project_id, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient, + share_id: str, + project_id: UUID | str | Unset = UNSET, + +) -> Error | ShareReleaseDraft | None: + """ Show what publishing a deploy link would release + + Builds the project's deployed functions and frontends the way a release + would, without storing anything, and reports what it would carry: the + functions and frontends, the project variables every project created from + the release gets (empty unless the visitor gives a value), the functions + whose code reads `VOLCANO_SERVICE_KEY`, and what is left out (resources with + no stored source, databases, sandboxes, dotenv and key files). Review it, + then publish with its `draft_id`, and its variables and service key + functions confirmed. + + Every call runs a full build and counts against the account's hourly + release build budget, which drafts and publishes share. Fetch it when the + owner opens the publish step, not on every focus or poll. + + Args: + share_id (str): + project_id (UUID | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | ShareReleaseDraft + """ + + + return sync_detailed( + client=client, +share_id=share_id, +project_id=project_id, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + share_id: str, + project_id: UUID | str | Unset = UNSET, + +) -> Response[Error | ShareReleaseDraft]: + """ Show what publishing a deploy link would release + + Builds the project's deployed functions and frontends the way a release + would, without storing anything, and reports what it would carry: the + functions and frontends, the project variables every project created from + the release gets (empty unless the visitor gives a value), the functions + whose code reads `VOLCANO_SERVICE_KEY`, and what is left out (resources with + no stored source, databases, sandboxes, dotenv and key files). Review it, + then publish with its `draft_id`, and its variables and service key + functions confirmed. + + Every call runs a full build and counts against the account's hourly + release build budget, which drafts and publishes share. Fetch it when the + owner opens the publish step, not on every focus or poll. + + Args: + share_id (str): + project_id (UUID | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | ShareReleaseDraft] + """ + + + kwargs = request_kwargs( + share_id=share_id, +project_id=project_id, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient, + share_id: str, + project_id: UUID | str | Unset = UNSET, + +) -> Error | ShareReleaseDraft | None: + """ Show what publishing a deploy link would release + + Builds the project's deployed functions and frontends the way a release + would, without storing anything, and reports what it would carry: the + functions and frontends, the project variables every project created from + the release gets (empty unless the visitor gives a value), the functions + whose code reads `VOLCANO_SERVICE_KEY`, and what is left out (resources with + no stored source, databases, sandboxes, dotenv and key files). Review it, + then publish with its `draft_id`, and its variables and service key + functions confirmed. + + Every call runs a full build and counts against the account's hourly + release build budget, which drafts and publishes share. Fetch it when the + owner opens the publish step, not on every focus or poll. + + Args: + share_id (str): + project_id (UUID | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | ShareReleaseDraft + """ + + + return (await asyncio_detailed( + client=client, +share_id=share_id, +project_id=project_id, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/shares/get_share_stats.py b/src/volcano_sdk/_generated/api/shares/get_share_stats.py new file mode 100644 index 00000000..11ab1da4 --- /dev/null +++ b/src/volcano_sdk/_generated/api/shares/get_share_stats.py @@ -0,0 +1,263 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from ...models.share_stats import ShareStats +from ...types import UNSET, Unset +from typing import cast +from uuid import UUID + + + +def request_kwargs( + *, + share_id: str, + project_id: UUID | str | Unset = UNSET, + days: int | Unset = 30, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + params["share_id"] = share_id + + json_project_id: str | Unset = UNSET + if not isinstance(project_id, Unset): + json_project_id = str(project_id) + params["project_id"] = json_project_id + + params["days"] = days + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/share-stats", + "params": params, + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | ShareStats | None: + if response.status_code == 200: + response_200 = ShareStats.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 500: + response_500 = Error.from_dict(response.json()) + + + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | ShareStats]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + share_id: str, + project_id: UUID | str | Unset = UNSET, + days: int | Unset = 30, + +) -> Response[Error | ShareStats]: + """ Get a deploy link's click and deploy counts + + Counts what happened at the link: clicks, previews, confirmations, projects + created, and how many became ready or failed. Informational only. Visitors + are counted from a salted hash and no address is stored. Events are kept + for 90 days, so a `days` above 90 is rejected with `400`. + + Args: + share_id (str): + project_id (UUID | Unset): + days (int | Unset): Default: 30. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | ShareStats] + """ + + + kwargs = request_kwargs( + share_id=share_id, +project_id=project_id, +days=days, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient, + share_id: str, + project_id: UUID | str | Unset = UNSET, + days: int | Unset = 30, + +) -> Error | ShareStats | None: + """ Get a deploy link's click and deploy counts + + Counts what happened at the link: clicks, previews, confirmations, projects + created, and how many became ready or failed. Informational only. Visitors + are counted from a salted hash and no address is stored. Events are kept + for 90 days, so a `days` above 90 is rejected with `400`. + + Args: + share_id (str): + project_id (UUID | Unset): + days (int | Unset): Default: 30. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | ShareStats + """ + + + return sync_detailed( + client=client, +share_id=share_id, +project_id=project_id, +days=days, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + share_id: str, + project_id: UUID | str | Unset = UNSET, + days: int | Unset = 30, + +) -> Response[Error | ShareStats]: + """ Get a deploy link's click and deploy counts + + Counts what happened at the link: clicks, previews, confirmations, projects + created, and how many became ready or failed. Informational only. Visitors + are counted from a salted hash and no address is stored. Events are kept + for 90 days, so a `days` above 90 is rejected with `400`. + + Args: + share_id (str): + project_id (UUID | Unset): + days (int | Unset): Default: 30. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | ShareStats] + """ + + + kwargs = request_kwargs( + share_id=share_id, +project_id=project_id, +days=days, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient, + share_id: str, + project_id: UUID | str | Unset = UNSET, + days: int | Unset = 30, + +) -> Error | ShareStats | None: + """ Get a deploy link's click and deploy counts + + Counts what happened at the link: clicks, previews, confirmations, projects + created, and how many became ready or failed. Informational only. Visitors + are counted from a salted hash and no address is stored. Events are kept + for 90 days, so a `days` above 90 is rejected with `400`. + + Args: + share_id (str): + project_id (UUID | Unset): + days (int | Unset): Default: 30. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | ShareStats + """ + + + return (await asyncio_detailed( + client=client, +share_id=share_id, +project_id=project_id, +days=days, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/autofix/list_autofix_runs.py b/src/volcano_sdk/_generated/api/shares/list_share_releases.py similarity index 50% rename from src/volcano_sdk/_generated/api/autofix/list_autofix_runs.py rename to src/volcano_sdk/_generated/api/shares/list_share_releases.py index 0d90897a..0fbc4384 100644 --- a/src/volcano_sdk/_generated/api/autofix/list_autofix_runs.py +++ b/src/volcano_sdk/_generated/api/shares/list_share_releases.py @@ -8,10 +8,8 @@ from ...types import Response, UNSET from ... import errors -from ...models.autofix_run_status import AutofixRunStatus -from ...models.autofix_run_status import check_autofix_run_status from ...models.error import Error -from ...models.paginated_autofix_runs import PaginatedAutofixRuns +from ...models.paginated_share_releases import PaginatedShareReleases from ...types import UNSET, Unset from typing import cast from uuid import UUID @@ -19,12 +17,11 @@ def request_kwargs( - id: UUID | str, *, + share_id: str, + project_id: UUID | str | Unset = UNSET, limit: int | Unset = 10, cursor: str | Unset = UNSET, - issue_id: UUID | str | Unset = UNSET, - status: AutofixRunStatus | Unset = UNSET, ) -> dict[str, Any]: @@ -33,20 +30,16 @@ def request_kwargs( params: dict[str, Any] = {} - params["limit"] = limit - - params["cursor"] = cursor + params["share_id"] = share_id - json_issue_id: str | Unset = UNSET - if not isinstance(issue_id, Unset): - json_issue_id = str(issue_id) - params["issue_id"] = json_issue_id + json_project_id: str | Unset = UNSET + if not isinstance(project_id, Unset): + json_project_id = str(project_id) + params["project_id"] = json_project_id - json_status: str | Unset = UNSET - if not isinstance(status, Unset): - json_status = status + params["limit"] = limit - params["status"] = json_status + params["cursor"] = cursor params = {k: v for k, v in params.items() if v is not UNSET and v is not None} @@ -54,7 +47,7 @@ def request_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/projects/{id}/autofix-runs".format(id=quote(str(id), safe=""),), + "url": "/share-releases", "params": params, } @@ -63,9 +56,9 @@ def request_kwargs( -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | PaginatedAutofixRuns | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | PaginatedShareReleases | None: if response.status_code == 200: - response_200 = PaginatedAutofixRuns.from_dict(response.json()) + response_200 = PaginatedShareReleases.from_dict(response.json()) @@ -78,6 +71,13 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return response_400 + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + if response.status_code == 404: response_404 = Error.from_dict(response.json()) @@ -85,12 +85,12 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return response_404 - if response.status_code == 501: - response_501 = Error.from_dict(response.json()) + if response.status_code == 500: + response_500 = Error.from_dict(response.json()) - return response_501 + return response_500 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -98,7 +98,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return None -def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | PaginatedAutofixRuns]: +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | PaginatedShareReleases]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -108,45 +108,39 @@ def build_response(*, client: AuthenticatedClient | Client, response: httpx.Resp def sync_detailed( - id: UUID | str, *, client: AuthenticatedClient, + share_id: str, + project_id: UUID | str | Unset = UNSET, limit: int | Unset = 10, cursor: str | Unset = UNSET, - issue_id: UUID | str | Unset = UNSET, - status: AutofixRunStatus | Unset = UNSET, - -) -> Response[Error | PaginatedAutofixRuns]: - """ List autofix runs - Lists the project's autofix runs, newest first. Runs stay readable after - autofix is turned off, and where autofix is not available. +) -> Response[Error | PaginatedShareReleases]: + """ List a deploy link's releases - Project access tokens can list runs, including read-only ones. + Pages the link's releases, newest first. Follow `next_cursor` while + `has_more` is true. Args: - id (UUID): + share_id (str): + project_id (UUID | Unset): limit (int | Unset): Default: 10. cursor (str | Unset): - issue_id (UUID | Unset): - status (AutofixRunStatus | Unset): Where a run is. `canceled` means the project's settings - or plan stopped allowing the run before it finished; `failure_code` says which. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Error | PaginatedAutofixRuns] + Response[Error | PaginatedShareReleases] """ kwargs = request_kwargs( - id=id, + share_id=share_id, +project_id=project_id, limit=limit, cursor=cursor, -issue_id=issue_id, -status=status, ) @@ -157,89 +151,77 @@ def sync_detailed( return build_response(client=client, response=response) def sync( - id: UUID | str, *, client: AuthenticatedClient, + share_id: str, + project_id: UUID | str | Unset = UNSET, limit: int | Unset = 10, cursor: str | Unset = UNSET, - issue_id: UUID | str | Unset = UNSET, - status: AutofixRunStatus | Unset = UNSET, -) -> Error | PaginatedAutofixRuns | None: - """ List autofix runs +) -> Error | PaginatedShareReleases | None: + """ List a deploy link's releases - Lists the project's autofix runs, newest first. Runs stay readable after - autofix is turned off, and where autofix is not available. - - Project access tokens can list runs, including read-only ones. + Pages the link's releases, newest first. Follow `next_cursor` while + `has_more` is true. Args: - id (UUID): + share_id (str): + project_id (UUID | Unset): limit (int | Unset): Default: 10. cursor (str | Unset): - issue_id (UUID | Unset): - status (AutofixRunStatus | Unset): Where a run is. `canceled` means the project's settings - or plan stopped allowing the run before it finished; `failure_code` says which. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Error | PaginatedAutofixRuns + Error | PaginatedShareReleases """ return sync_detailed( - id=id, -client=client, + client=client, +share_id=share_id, +project_id=project_id, limit=limit, cursor=cursor, -issue_id=issue_id, -status=status, ).parsed async def asyncio_detailed( - id: UUID | str, *, client: AuthenticatedClient, + share_id: str, + project_id: UUID | str | Unset = UNSET, limit: int | Unset = 10, cursor: str | Unset = UNSET, - issue_id: UUID | str | Unset = UNSET, - status: AutofixRunStatus | Unset = UNSET, - -) -> Response[Error | PaginatedAutofixRuns]: - """ List autofix runs - Lists the project's autofix runs, newest first. Runs stay readable after - autofix is turned off, and where autofix is not available. +) -> Response[Error | PaginatedShareReleases]: + """ List a deploy link's releases - Project access tokens can list runs, including read-only ones. + Pages the link's releases, newest first. Follow `next_cursor` while + `has_more` is true. Args: - id (UUID): + share_id (str): + project_id (UUID | Unset): limit (int | Unset): Default: 10. cursor (str | Unset): - issue_id (UUID | Unset): - status (AutofixRunStatus | Unset): Where a run is. `canceled` means the project's settings - or plan stopped allowing the run before it finished; `failure_code` says which. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Error | PaginatedAutofixRuns] + Response[Error | PaginatedShareReleases] """ kwargs = request_kwargs( - id=id, + share_id=share_id, +project_id=project_id, limit=limit, cursor=cursor, -issue_id=issue_id, -status=status, ) @@ -250,45 +232,39 @@ async def asyncio_detailed( return build_response(client=client, response=response) async def asyncio( - id: UUID | str, *, client: AuthenticatedClient, + share_id: str, + project_id: UUID | str | Unset = UNSET, limit: int | Unset = 10, cursor: str | Unset = UNSET, - issue_id: UUID | str | Unset = UNSET, - status: AutofixRunStatus | Unset = UNSET, - -) -> Error | PaginatedAutofixRuns | None: - """ List autofix runs - Lists the project's autofix runs, newest first. Runs stay readable after - autofix is turned off, and where autofix is not available. +) -> Error | PaginatedShareReleases | None: + """ List a deploy link's releases - Project access tokens can list runs, including read-only ones. + Pages the link's releases, newest first. Follow `next_cursor` while + `has_more` is true. Args: - id (UUID): + share_id (str): + project_id (UUID | Unset): limit (int | Unset): Default: 10. cursor (str | Unset): - issue_id (UUID | Unset): - status (AutofixRunStatus | Unset): Where a run is. `canceled` means the project's settings - or plan stopped allowing the run before it finished; `failure_code` says which. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Error | PaginatedAutofixRuns + Error | PaginatedShareReleases """ return (await asyncio_detailed( - id=id, -client=client, + client=client, +share_id=share_id, +project_id=project_id, limit=limit, cursor=cursor, -issue_id=issue_id, -status=status, )).parsed diff --git a/src/volcano_sdk/_generated/api/shares/list_shares.py b/src/volcano_sdk/_generated/api/shares/list_shares.py new file mode 100644 index 00000000..2f2a74d4 --- /dev/null +++ b/src/volcano_sdk/_generated/api/shares/list_shares.py @@ -0,0 +1,230 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from ...models.shares_response import SharesResponse +from typing import cast +from uuid import UUID + + + +def request_kwargs( + *, + project_id: UUID | str, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + json_project_id = str(project_id) + params["project_id"] = json_project_id + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/shares", + "params": params, + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | SharesResponse | None: + if response.status_code == 200: + response_200 = SharesResponse.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 500: + response_500 = Error.from_dict(response.json()) + + + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | SharesResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + project_id: UUID | str, + +) -> Response[Error | SharesResponse]: + """ List a project's deploy links + + Deploy links let anyone deploy a release the project's owner published as + their own new project. A link's public address is + `https://volcano.dev/deploy/`; the address carries no release, so it + cannot be edited to point at other code. + + Args: + project_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | SharesResponse] + """ + + + kwargs = request_kwargs( + project_id=project_id, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient, + project_id: UUID | str, + +) -> Error | SharesResponse | None: + """ List a project's deploy links + + Deploy links let anyone deploy a release the project's owner published as + their own new project. A link's public address is + `https://volcano.dev/deploy/`; the address carries no release, so it + cannot be edited to point at other code. + + Args: + project_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | SharesResponse + """ + + + return sync_detailed( + client=client, +project_id=project_id, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + project_id: UUID | str, + +) -> Response[Error | SharesResponse]: + """ List a project's deploy links + + Deploy links let anyone deploy a release the project's owner published as + their own new project. A link's public address is + `https://volcano.dev/deploy/`; the address carries no release, so it + cannot be edited to point at other code. + + Args: + project_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | SharesResponse] + """ + + + kwargs = request_kwargs( + project_id=project_id, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient, + project_id: UUID | str, + +) -> Error | SharesResponse | None: + """ List a project's deploy links + + Deploy links let anyone deploy a release the project's owner published as + their own new project. A link's public address is + `https://volcano.dev/deploy/`; the address carries no release, so it + cannot be edited to point at other code. + + Args: + project_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | SharesResponse + """ + + + return (await asyncio_detailed( + client=client, +project_id=project_id, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/shares/publish_share_release.py b/src/volcano_sdk/_generated/api/shares/publish_share_release.py new file mode 100644 index 00000000..777b20c9 --- /dev/null +++ b/src/volcano_sdk/_generated/api/shares/publish_share_release.py @@ -0,0 +1,311 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from ...models.share_draft_changed_error import ShareDraftChangedError +from ...models.share_release import ShareRelease +from ...models.share_release_create_request import ShareReleaseCreateRequest +from typing import cast + + + +def request_kwargs( + *, + body: ShareReleaseCreateRequest, + +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + + + + + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/share-releases", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | ShareDraftChangedError | ShareRelease | None: + if response.status_code == 201: + response_201 = ShareRelease.from_dict(response.json()) + + + + return response_201 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 409: + response_409 = ShareDraftChangedError.from_dict(response.json()) + + + + return response_409 + + if response.status_code == 422: + response_422 = Error.from_dict(response.json()) + + + + return response_422 + + if response.status_code == 429: + response_429 = Error.from_dict(response.json()) + + + + return response_429 + + if response.status_code == 500: + response_500 = Error.from_dict(response.json()) + + + + return response_500 + + if response.status_code == 503: + response_503 = Error.from_dict(response.json()) + + + + return response_503 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | ShareDraftChangedError | ShareRelease]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: ShareReleaseCreateRequest, + +) -> Response[Error | ShareDraftChangedError | ShareRelease]: + """ Publish a deploy link release + + Snapshots the project's deployed functions and frontends into an immutable + release and makes it the link's current release in one step, so visitors see + either the previous release or this one. Visitors install exactly the stored + release; later deploys to the project change nothing until the owner + publishes again. + + Send the reviewed draft's `draft_id`, its variables and the functions that + receive the new project's `VOLCANO_SERVICE_KEY`, as confirmed from the + draft. Both lists must be exactly the draft's: a release carries every + variable, since leaving one out would only break the code that reads it. If + a fresh build is not the reviewed draft, because the project was redeployed + or changed since, or the lists differ from it, nothing is published and the + answer is `409` with code `draft_changed` and the new draft. A + release carries variable names, never values, and no database. A publish is + a full build and counts against the account's hourly release build budget, + which it shares with the draft. + + Args: + body (ShareReleaseCreateRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | ShareDraftChangedError | ShareRelease] + """ + + + kwargs = request_kwargs( + body=body, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient, + body: ShareReleaseCreateRequest, + +) -> Error | ShareDraftChangedError | ShareRelease | None: + """ Publish a deploy link release + + Snapshots the project's deployed functions and frontends into an immutable + release and makes it the link's current release in one step, so visitors see + either the previous release or this one. Visitors install exactly the stored + release; later deploys to the project change nothing until the owner + publishes again. + + Send the reviewed draft's `draft_id`, its variables and the functions that + receive the new project's `VOLCANO_SERVICE_KEY`, as confirmed from the + draft. Both lists must be exactly the draft's: a release carries every + variable, since leaving one out would only break the code that reads it. If + a fresh build is not the reviewed draft, because the project was redeployed + or changed since, or the lists differ from it, nothing is published and the + answer is `409` with code `draft_changed` and the new draft. A + release carries variable names, never values, and no database. A publish is + a full build and counts against the account's hourly release build budget, + which it shares with the draft. + + Args: + body (ShareReleaseCreateRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | ShareDraftChangedError | ShareRelease + """ + + + return sync_detailed( + client=client, +body=body, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: ShareReleaseCreateRequest, + +) -> Response[Error | ShareDraftChangedError | ShareRelease]: + """ Publish a deploy link release + + Snapshots the project's deployed functions and frontends into an immutable + release and makes it the link's current release in one step, so visitors see + either the previous release or this one. Visitors install exactly the stored + release; later deploys to the project change nothing until the owner + publishes again. + + Send the reviewed draft's `draft_id`, its variables and the functions that + receive the new project's `VOLCANO_SERVICE_KEY`, as confirmed from the + draft. Both lists must be exactly the draft's: a release carries every + variable, since leaving one out would only break the code that reads it. If + a fresh build is not the reviewed draft, because the project was redeployed + or changed since, or the lists differ from it, nothing is published and the + answer is `409` with code `draft_changed` and the new draft. A + release carries variable names, never values, and no database. A publish is + a full build and counts against the account's hourly release build budget, + which it shares with the draft. + + Args: + body (ShareReleaseCreateRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | ShareDraftChangedError | ShareRelease] + """ + + + kwargs = request_kwargs( + body=body, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient, + body: ShareReleaseCreateRequest, + +) -> Error | ShareDraftChangedError | ShareRelease | None: + """ Publish a deploy link release + + Snapshots the project's deployed functions and frontends into an immutable + release and makes it the link's current release in one step, so visitors see + either the previous release or this one. Visitors install exactly the stored + release; later deploys to the project change nothing until the owner + publishes again. + + Send the reviewed draft's `draft_id`, its variables and the functions that + receive the new project's `VOLCANO_SERVICE_KEY`, as confirmed from the + draft. Both lists must be exactly the draft's: a release carries every + variable, since leaving one out would only break the code that reads it. If + a fresh build is not the reviewed draft, because the project was redeployed + or changed since, or the lists differ from it, nothing is published and the + answer is `409` with code `draft_changed` and the new draft. A + release carries variable names, never values, and no database. A publish is + a full build and counts against the account's hourly release build budget, + which it shares with the draft. + + Args: + body (ShareReleaseCreateRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | ShareDraftChangedError | ShareRelease + """ + + + return (await asyncio_detailed( + client=client, +body=body, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/shares/update_share.py b/src/volcano_sdk/_generated/api/shares/update_share.py new file mode 100644 index 00000000..8cd3010b --- /dev/null +++ b/src/volcano_sdk/_generated/api/shares/update_share.py @@ -0,0 +1,372 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from ...models.share import Share +from ...models.share_update_request import ShareUpdateRequest +from ...types import UNSET, Unset +from typing import cast +from uuid import UUID + + + +def request_kwargs( + share_id: str, + *, + body: ShareUpdateRequest, + project_id: UUID | str | Unset = UNSET, + +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + + + + params: dict[str, Any] = {} + + json_project_id: str | Unset = UNSET + if not isinstance(project_id, Unset): + json_project_id = str(project_id) + params["project_id"] = json_project_id + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": "/shares/{share_id}".format(share_id=quote(str(share_id), safe=""),), + "params": params, + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | Share | None: + if response.status_code == 200: + response_200 = Share.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 403: + response_403 = Error.from_dict(response.json()) + + + + return response_403 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 500: + response_500 = Error.from_dict(response.json()) + + + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | Share]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + share_id: str, + *, + client: AuthenticatedClient, + body: ShareUpdateRequest, + project_id: UUID | str | Unset = UNSET, + +) -> Response[Error | Share]: + """ Edit or switch a deploy link on or off + + Changes the suggested name, the status, or both. An owner can always switch a + link off: it works even while deploy links are not available in this + environment, and while the owner's account is read-only. Setting + `allow_reshare` to false also works in both cases, alone or with a + switch-off, since like a switch-off it only shares less; for a read-only + account these are the only changes allowed. While deploy links are not + available, a request that sends back the values the link already has, + including `status` `active` on an active link, changes nothing and answers + `200`. + + Switching a link off also stops the installs it started that have not + finished, including ones still queued: each fails at its next step. The + visitor keeps the project, with its installation failed. Switching the link + back on lets only installs that have not failed yet go ahead. + + A link Volcano took down (`disabled_reason` `operator`) cannot be switched + back on; other edits still work, and it stays down. While any of the + project's links is taken down, no link of the project can be switched on or + allowed to be re-shared. + + A request that switches the link off together with an edit while deploy links + are not available, or that also allows re-sharing on a copy whose source does + not allow it, still switches the link off, but answers `400` with code + `edit_dropped`: the link is off and the edit was not applied. While the + account is read-only, a request that switches the link off or sets + `allow_reshare` to false together with another edit is answered the same way: + the switch-off and the re-sharing change are saved, and the other edit is not. + A `status` the link already has is no edit, so sending the fetched link back + with `allow_reshare` false answers `200`; a switch-on is such another edit. + + Args: + share_id (str): + project_id (UUID | Unset): + body (ShareUpdateRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | Share] + """ + + + kwargs = request_kwargs( + share_id=share_id, +body=body, +project_id=project_id, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + share_id: str, + *, + client: AuthenticatedClient, + body: ShareUpdateRequest, + project_id: UUID | str | Unset = UNSET, + +) -> Error | Share | None: + """ Edit or switch a deploy link on or off + + Changes the suggested name, the status, or both. An owner can always switch a + link off: it works even while deploy links are not available in this + environment, and while the owner's account is read-only. Setting + `allow_reshare` to false also works in both cases, alone or with a + switch-off, since like a switch-off it only shares less; for a read-only + account these are the only changes allowed. While deploy links are not + available, a request that sends back the values the link already has, + including `status` `active` on an active link, changes nothing and answers + `200`. + + Switching a link off also stops the installs it started that have not + finished, including ones still queued: each fails at its next step. The + visitor keeps the project, with its installation failed. Switching the link + back on lets only installs that have not failed yet go ahead. + + A link Volcano took down (`disabled_reason` `operator`) cannot be switched + back on; other edits still work, and it stays down. While any of the + project's links is taken down, no link of the project can be switched on or + allowed to be re-shared. + + A request that switches the link off together with an edit while deploy links + are not available, or that also allows re-sharing on a copy whose source does + not allow it, still switches the link off, but answers `400` with code + `edit_dropped`: the link is off and the edit was not applied. While the + account is read-only, a request that switches the link off or sets + `allow_reshare` to false together with another edit is answered the same way: + the switch-off and the re-sharing change are saved, and the other edit is not. + A `status` the link already has is no edit, so sending the fetched link back + with `allow_reshare` false answers `200`; a switch-on is such another edit. + + Args: + share_id (str): + project_id (UUID | Unset): + body (ShareUpdateRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | Share + """ + + + return sync_detailed( + share_id=share_id, +client=client, +body=body, +project_id=project_id, + + ).parsed + +async def asyncio_detailed( + share_id: str, + *, + client: AuthenticatedClient, + body: ShareUpdateRequest, + project_id: UUID | str | Unset = UNSET, + +) -> Response[Error | Share]: + """ Edit or switch a deploy link on or off + + Changes the suggested name, the status, or both. An owner can always switch a + link off: it works even while deploy links are not available in this + environment, and while the owner's account is read-only. Setting + `allow_reshare` to false also works in both cases, alone or with a + switch-off, since like a switch-off it only shares less; for a read-only + account these are the only changes allowed. While deploy links are not + available, a request that sends back the values the link already has, + including `status` `active` on an active link, changes nothing and answers + `200`. + + Switching a link off also stops the installs it started that have not + finished, including ones still queued: each fails at its next step. The + visitor keeps the project, with its installation failed. Switching the link + back on lets only installs that have not failed yet go ahead. + + A link Volcano took down (`disabled_reason` `operator`) cannot be switched + back on; other edits still work, and it stays down. While any of the + project's links is taken down, no link of the project can be switched on or + allowed to be re-shared. + + A request that switches the link off together with an edit while deploy links + are not available, or that also allows re-sharing on a copy whose source does + not allow it, still switches the link off, but answers `400` with code + `edit_dropped`: the link is off and the edit was not applied. While the + account is read-only, a request that switches the link off or sets + `allow_reshare` to false together with another edit is answered the same way: + the switch-off and the re-sharing change are saved, and the other edit is not. + A `status` the link already has is no edit, so sending the fetched link back + with `allow_reshare` false answers `200`; a switch-on is such another edit. + + Args: + share_id (str): + project_id (UUID | Unset): + body (ShareUpdateRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | Share] + """ + + + kwargs = request_kwargs( + share_id=share_id, +body=body, +project_id=project_id, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + share_id: str, + *, + client: AuthenticatedClient, + body: ShareUpdateRequest, + project_id: UUID | str | Unset = UNSET, + +) -> Error | Share | None: + """ Edit or switch a deploy link on or off + + Changes the suggested name, the status, or both. An owner can always switch a + link off: it works even while deploy links are not available in this + environment, and while the owner's account is read-only. Setting + `allow_reshare` to false also works in both cases, alone or with a + switch-off, since like a switch-off it only shares less; for a read-only + account these are the only changes allowed. While deploy links are not + available, a request that sends back the values the link already has, + including `status` `active` on an active link, changes nothing and answers + `200`. + + Switching a link off also stops the installs it started that have not + finished, including ones still queued: each fails at its next step. The + visitor keeps the project, with its installation failed. Switching the link + back on lets only installs that have not failed yet go ahead. + + A link Volcano took down (`disabled_reason` `operator`) cannot be switched + back on; other edits still work, and it stays down. While any of the + project's links is taken down, no link of the project can be switched on or + allowed to be re-shared. + + A request that switches the link off together with an edit while deploy links + are not available, or that also allows re-sharing on a copy whose source does + not allow it, still switches the link off, but answers `400` with code + `edit_dropped`: the link is off and the edit was not applied. While the + account is read-only, a request that switches the link off or sets + `allow_reshare` to false together with another edit is answered the same way: + the switch-off and the re-sharing change are saved, and the other edit is not. + A `status` the link already has is no edit, so sending the fetched link back + with `allow_reshare` false answers `200`; a switch-on is such another edit. + + Args: + share_id (str): + project_id (UUID | Unset): + body (ShareUpdateRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | Share + """ + + + return (await asyncio_detailed( + share_id=share_id, +client=client, +body=body, +project_id=project_id, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/slack_connections/__init__.py b/src/volcano_sdk/_generated/api/slack_connections/__init__.py new file mode 100644 index 00000000..c9921b5f --- /dev/null +++ b/src/volcano_sdk/_generated/api/slack_connections/__init__.py @@ -0,0 +1 @@ +""" Contains endpoint functions for accessing the API """ diff --git a/src/volcano_sdk/_generated/api/slack_connections/delete_slack_connection.py b/src/volcano_sdk/_generated/api/slack_connections/delete_slack_connection.py new file mode 100644 index 00000000..f28ed9b2 --- /dev/null +++ b/src/volcano_sdk/_generated/api/slack_connections/delete_slack_connection.py @@ -0,0 +1,210 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from typing import cast +from uuid import UUID + + + +def request_kwargs( + connection_id: UUID | str, + +) -> dict[str, Any]: + + + + + + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/user/slack/connections/{connection_id}".format(connection_id=quote(str(connection_id), safe=""),), + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | Error | None: + if response.status_code == 204: + response_204 = cast(Any, None) + return response_204 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any | Error]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + connection_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Response[Any | Error]: + """ Disconnect a Slack identity + + Disconnects one Slack identity from the caller's account. LavaFlow + stops acting on its mentions for the account's projects at its next + check, which also cancels reports still queued. It works whether or not + reporting problems from Slack is available in this environment. + + Args: + connection_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | Error] + """ + + + kwargs = request_kwargs( + connection_id=connection_id, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + connection_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Any | Error | None: + """ Disconnect a Slack identity + + Disconnects one Slack identity from the caller's account. LavaFlow + stops acting on its mentions for the account's projects at its next + check, which also cancels reports still queued. It works whether or not + reporting problems from Slack is available in this environment. + + Args: + connection_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | Error + """ + + + return sync_detailed( + connection_id=connection_id, +client=client, + + ).parsed + +async def asyncio_detailed( + connection_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Response[Any | Error]: + """ Disconnect a Slack identity + + Disconnects one Slack identity from the caller's account. LavaFlow + stops acting on its mentions for the account's projects at its next + check, which also cancels reports still queued. It works whether or not + reporting problems from Slack is available in this environment. + + Args: + connection_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | Error] + """ + + + kwargs = request_kwargs( + connection_id=connection_id, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + connection_id: UUID | str, + *, + client: AuthenticatedClient, + +) -> Any | Error | None: + """ Disconnect a Slack identity + + Disconnects one Slack identity from the caller's account. LavaFlow + stops acting on its mentions for the account's projects at its next + check, which also cancels reports still queued. It works whether or not + reporting problems from Slack is available in this environment. + + Args: + connection_id (UUID): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | Error + """ + + + return (await asyncio_detailed( + connection_id=connection_id, +client=client, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/slack_connections/list_slack_channels.py b/src/volcano_sdk/_generated/api/slack_connections/list_slack_channels.py new file mode 100644 index 00000000..2fbcb3b5 --- /dev/null +++ b/src/volcano_sdk/_generated/api/slack_connections/list_slack_channels.py @@ -0,0 +1,236 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from ...models.slack_channels_response import SlackChannelsResponse +from typing import cast + + + +def request_kwargs( + *, + team_id: str, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + params["team_id"] = team_id + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/user/slack/channels", + "params": params, + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | SlackChannelsResponse | None: + if response.status_code == 200: + response_200 = SlackChannelsResponse.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 502: + response_502 = Error.from_dict(response.json()) + + + + return response_502 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | SlackChannelsResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + team_id: str, + +) -> Response[Error | SlackChannelsResponse]: + """ List a workspace's channels for binding + + Lists the channels in a workspace that one of the Slack identities the + caller's sign-in session signed in as is in, to choose which ones + report problems to LavaFlow: their public channels, and the private + channels the Volcano app is in too. Binding a public channel the app is + not in makes it join. Invite the app to a private channel in Slack to + list it. Slack Connect, shared and archived channels are left out. + + Args: + team_id (str): A Slack workspace ID, such as `T0123ABCD`. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | SlackChannelsResponse] + """ + + + kwargs = request_kwargs( + team_id=team_id, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient, + team_id: str, + +) -> Error | SlackChannelsResponse | None: + """ List a workspace's channels for binding + + Lists the channels in a workspace that one of the Slack identities the + caller's sign-in session signed in as is in, to choose which ones + report problems to LavaFlow: their public channels, and the private + channels the Volcano app is in too. Binding a public channel the app is + not in makes it join. Invite the app to a private channel in Slack to + list it. Slack Connect, shared and archived channels are left out. + + Args: + team_id (str): A Slack workspace ID, such as `T0123ABCD`. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | SlackChannelsResponse + """ + + + return sync_detailed( + client=client, +team_id=team_id, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + team_id: str, + +) -> Response[Error | SlackChannelsResponse]: + """ List a workspace's channels for binding + + Lists the channels in a workspace that one of the Slack identities the + caller's sign-in session signed in as is in, to choose which ones + report problems to LavaFlow: their public channels, and the private + channels the Volcano app is in too. Binding a public channel the app is + not in makes it join. Invite the app to a private channel in Slack to + list it. Slack Connect, shared and archived channels are left out. + + Args: + team_id (str): A Slack workspace ID, such as `T0123ABCD`. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | SlackChannelsResponse] + """ + + + kwargs = request_kwargs( + team_id=team_id, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient, + team_id: str, + +) -> Error | SlackChannelsResponse | None: + """ List a workspace's channels for binding + + Lists the channels in a workspace that one of the Slack identities the + caller's sign-in session signed in as is in, to choose which ones + report problems to LavaFlow: their public channels, and the private + channels the Volcano app is in too. Binding a public channel the app is + not in makes it join. Invite the app to a private channel in Slack to + list it. Slack Connect, shared and archived channels are left out. + + Args: + team_id (str): A Slack workspace ID, such as `T0123ABCD`. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | SlackChannelsResponse + """ + + + return (await asyncio_detailed( + client=client, +team_id=team_id, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/slack_connections/list_slack_connections.py b/src/volcano_sdk/_generated/api/slack_connections/list_slack_connections.py new file mode 100644 index 00000000..e142164f --- /dev/null +++ b/src/volcano_sdk/_generated/api/slack_connections/list_slack_connections.py @@ -0,0 +1,174 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from ...models.slack_connections_response import SlackConnectionsResponse +from typing import cast + + + +def request_kwargs( + +) -> dict[str, Any]: + + + + + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/user/slack/connections", + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | SlackConnectionsResponse | None: + if response.status_code == 200: + response_200 = SlackConnectionsResponse.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | SlackConnectionsResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + +) -> Response[Error | SlackConnectionsResponse]: + """ List connected Slack identities + + Lists the caller's connected Slack identities. It answers whether or + not reporting problems from Slack is available in this environment, so + turning it off strands no connection. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | SlackConnectionsResponse] + """ + + + kwargs = request_kwargs( + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient, + +) -> Error | SlackConnectionsResponse | None: + """ List connected Slack identities + + Lists the caller's connected Slack identities. It answers whether or + not reporting problems from Slack is available in this environment, so + turning it off strands no connection. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | SlackConnectionsResponse + """ + + + return sync_detailed( + client=client, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + +) -> Response[Error | SlackConnectionsResponse]: + """ List connected Slack identities + + Lists the caller's connected Slack identities. It answers whether or + not reporting problems from Slack is available in this environment, so + turning it off strands no connection. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | SlackConnectionsResponse] + """ + + + kwargs = request_kwargs( + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient, + +) -> Error | SlackConnectionsResponse | None: + """ List connected Slack identities + + Lists the caller's connected Slack identities. It answers whether or + not reporting problems from Slack is available in this environment, so + turning it off strands no connection. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | SlackConnectionsResponse + """ + + + return (await asyncio_detailed( + client=client, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/slack_connections/slack_callback.py b/src/volcano_sdk/_generated/api/slack_connections/slack_callback.py new file mode 100644 index 00000000..4b25cfd3 --- /dev/null +++ b/src/volcano_sdk/_generated/api/slack_connections/slack_callback.py @@ -0,0 +1,252 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from ...types import UNSET, Unset +from typing import cast + + + +def request_kwargs( + *, + code: str | Unset = UNSET, + state: str, + error: str | Unset = UNSET, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + params["code"] = code + + params["state"] = state + + params["error"] = error + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/slack/callback", + "params": params, + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | Error | None: + if response.status_code == 303: + response_303 = cast(Any, None) + return response_303 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if response.status_code == 429: + response_429 = Error.from_dict(response.json()) + + + + return response_429 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any | Error]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + code: str | Unset = UNSET, + state: str, + error: str | Unset = UNSET, + +) -> Response[Any | Error]: + """ Complete a Slack install or connection + + Public callback Slack sends the browser to after Add to Slack or Sign + in with Slack. The signed `state` names the flow and the Volcano user + who started it, and the callback cookie binds it to the browser that + started it. Redirects to the flow's `redirect`, or to the dashboard, + adding `slack_connect_error=1` when the flow failed. + + Args: + code (str | Unset): + state (str): + error (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | Error] + """ + + + kwargs = request_kwargs( + code=code, +state=state, +error=error, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient | Client, + code: str | Unset = UNSET, + state: str, + error: str | Unset = UNSET, + +) -> Any | Error | None: + """ Complete a Slack install or connection + + Public callback Slack sends the browser to after Add to Slack or Sign + in with Slack. The signed `state` names the flow and the Volcano user + who started it, and the callback cookie binds it to the browser that + started it. Redirects to the flow's `redirect`, or to the dashboard, + adding `slack_connect_error=1` when the flow failed. + + Args: + code (str | Unset): + state (str): + error (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | Error + """ + + + return sync_detailed( + client=client, +code=code, +state=state, +error=error, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + code: str | Unset = UNSET, + state: str, + error: str | Unset = UNSET, + +) -> Response[Any | Error]: + """ Complete a Slack install or connection + + Public callback Slack sends the browser to after Add to Slack or Sign + in with Slack. The signed `state` names the flow and the Volcano user + who started it, and the callback cookie binds it to the browser that + started it. Redirects to the flow's `redirect`, or to the dashboard, + adding `slack_connect_error=1` when the flow failed. + + Args: + code (str | Unset): + state (str): + error (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | Error] + """ + + + kwargs = request_kwargs( + code=code, +state=state, +error=error, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient | Client, + code: str | Unset = UNSET, + state: str, + error: str | Unset = UNSET, + +) -> Any | Error | None: + """ Complete a Slack install or connection + + Public callback Slack sends the browser to after Add to Slack or Sign + in with Slack. The signed `state` names the flow and the Volcano user + who started it, and the callback cookie binds it to the browser that + started it. Redirects to the flow's `redirect`, or to the dashboard, + adding `slack_connect_error=1` when the flow failed. + + Args: + code (str | Unset): + state (str): + error (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | Error + """ + + + return (await asyncio_detailed( + client=client, +code=code, +state=state, +error=error, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/slack_connections/start_slack_connect.py b/src/volcano_sdk/_generated/api/slack_connections/start_slack_connect.py new file mode 100644 index 00000000..4348bd6c --- /dev/null +++ b/src/volcano_sdk/_generated/api/slack_connections/start_slack_connect.py @@ -0,0 +1,274 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from ...models.slack_authorization_response import SlackAuthorizationResponse +from ...types import UNSET, Unset +from typing import cast + + + +def request_kwargs( + *, + redirect: str | Unset = UNSET, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + params["redirect"] = redirect + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/user/slack/connections", + "params": params, + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | SlackAuthorizationResponse | None: + if response.status_code == 200: + response_200 = SlackAuthorizationResponse.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | SlackAuthorizationResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + redirect: str | Unset = UNSET, + +) -> Response[Error | SlackAuthorizationResponse]: + """ Start connecting a Slack identity + + Starts connecting the caller's Slack identity to their Volcano account + and returns its Sign in with Slack URL. LavaFlow acts on a person's + Slack mention only for projects owned by an account their identity is + connected to. The callback finishes only in the browser that started + the connection, so a link forwarded to anyone else connects no one. + One Slack identity may connect to several accounts, and one account may + have several identities connected. The identity is also tied to the + caller's sign-in session: the channel picker and binding act only as + the identities this session signed in as, so on an account several + people share, nobody picks or binds as another person's identity. An + API token has no session, so it can connect an identity that reports, + but not pick or bind channels with it. Volcano stores the workspace and + user IDs, and no Slack token. + + The response also sets a short-lived HttpOnly cookie that binds the + callback to this browser. Installing and connecting each set their + own, so starting one leaves the other's callback working. + + Args: + redirect (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | SlackAuthorizationResponse] + """ + + + kwargs = request_kwargs( + redirect=redirect, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient, + redirect: str | Unset = UNSET, + +) -> Error | SlackAuthorizationResponse | None: + """ Start connecting a Slack identity + + Starts connecting the caller's Slack identity to their Volcano account + and returns its Sign in with Slack URL. LavaFlow acts on a person's + Slack mention only for projects owned by an account their identity is + connected to. The callback finishes only in the browser that started + the connection, so a link forwarded to anyone else connects no one. + One Slack identity may connect to several accounts, and one account may + have several identities connected. The identity is also tied to the + caller's sign-in session: the channel picker and binding act only as + the identities this session signed in as, so on an account several + people share, nobody picks or binds as another person's identity. An + API token has no session, so it can connect an identity that reports, + but not pick or bind channels with it. Volcano stores the workspace and + user IDs, and no Slack token. + + The response also sets a short-lived HttpOnly cookie that binds the + callback to this browser. Installing and connecting each set their + own, so starting one leaves the other's callback working. + + Args: + redirect (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | SlackAuthorizationResponse + """ + + + return sync_detailed( + client=client, +redirect=redirect, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + redirect: str | Unset = UNSET, + +) -> Response[Error | SlackAuthorizationResponse]: + """ Start connecting a Slack identity + + Starts connecting the caller's Slack identity to their Volcano account + and returns its Sign in with Slack URL. LavaFlow acts on a person's + Slack mention only for projects owned by an account their identity is + connected to. The callback finishes only in the browser that started + the connection, so a link forwarded to anyone else connects no one. + One Slack identity may connect to several accounts, and one account may + have several identities connected. The identity is also tied to the + caller's sign-in session: the channel picker and binding act only as + the identities this session signed in as, so on an account several + people share, nobody picks or binds as another person's identity. An + API token has no session, so it can connect an identity that reports, + but not pick or bind channels with it. Volcano stores the workspace and + user IDs, and no Slack token. + + The response also sets a short-lived HttpOnly cookie that binds the + callback to this browser. Installing and connecting each set their + own, so starting one leaves the other's callback working. + + Args: + redirect (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | SlackAuthorizationResponse] + """ + + + kwargs = request_kwargs( + redirect=redirect, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient, + redirect: str | Unset = UNSET, + +) -> Error | SlackAuthorizationResponse | None: + """ Start connecting a Slack identity + + Starts connecting the caller's Slack identity to their Volcano account + and returns its Sign in with Slack URL. LavaFlow acts on a person's + Slack mention only for projects owned by an account their identity is + connected to. The callback finishes only in the browser that started + the connection, so a link forwarded to anyone else connects no one. + One Slack identity may connect to several accounts, and one account may + have several identities connected. The identity is also tied to the + caller's sign-in session: the channel picker and binding act only as + the identities this session signed in as, so on an account several + people share, nobody picks or binds as another person's identity. An + API token has no session, so it can connect an identity that reports, + but not pick or bind channels with it. Volcano stores the workspace and + user IDs, and no Slack token. + + The response also sets a short-lived HttpOnly cookie that binds the + callback to this browser. Installing and connecting each set their + own, so starting one leaves the other's callback working. + + Args: + redirect (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | SlackAuthorizationResponse + """ + + + return (await asyncio_detailed( + client=client, +redirect=redirect, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/slack_connections/start_slack_install.py b/src/volcano_sdk/_generated/api/slack_connections/start_slack_install.py new file mode 100644 index 00000000..067f4cb1 --- /dev/null +++ b/src/volcano_sdk/_generated/api/slack_connections/start_slack_install.py @@ -0,0 +1,250 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...types import Response, UNSET +from ... import errors + +from ...models.error import Error +from ...models.slack_authorization_response import SlackAuthorizationResponse +from ...types import UNSET, Unset +from typing import cast + + + +def request_kwargs( + *, + redirect: str | Unset = UNSET, + +) -> dict[str, Any]: + + + + + params: dict[str, Any] = {} + + params["redirect"] = redirect + + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/user/slack/installations", + "params": params, + } + + + return _kwargs + + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | SlackAuthorizationResponse | None: + if response.status_code == 200: + response_200 = SlackAuthorizationResponse.from_dict(response.json()) + + + + return response_200 + + if response.status_code == 400: + response_400 = Error.from_dict(response.json()) + + + + return response_400 + + if response.status_code == 401: + response_401 = Error.from_dict(response.json()) + + + + return response_401 + + if response.status_code == 404: + response_404 = Error.from_dict(response.json()) + + + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Error | SlackAuthorizationResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + redirect: str | Unset = UNSET, + +) -> Response[Error | SlackAuthorizationResponse]: + """ Start installing the Volcano Slack app + + Starts an installation of the Volcano app in a Slack workspace, so + LavaFlow can take problems reported there, and returns its Add to Slack + URL. Send the browser to it; Slack returns it to `GET /slack/callback`, + which saves the installation as a `slack` connector (`GET /connectors`). + Installing again replaces the workspace's installation. Enterprise Grid org-wide installs are + refused. The + callback finishes only in the browser that started the installation. + + The response also sets a short-lived HttpOnly cookie that binds the + callback to this browser. Installing and connecting each set their + own, so starting one leaves the other's callback working. + + Args: + redirect (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | SlackAuthorizationResponse] + """ + + + kwargs = request_kwargs( + redirect=redirect, + + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return build_response(client=client, response=response) + +def sync( + *, + client: AuthenticatedClient, + redirect: str | Unset = UNSET, + +) -> Error | SlackAuthorizationResponse | None: + """ Start installing the Volcano Slack app + + Starts an installation of the Volcano app in a Slack workspace, so + LavaFlow can take problems reported there, and returns its Add to Slack + URL. Send the browser to it; Slack returns it to `GET /slack/callback`, + which saves the installation as a `slack` connector (`GET /connectors`). + Installing again replaces the workspace's installation. Enterprise Grid org-wide installs are + refused. The + callback finishes only in the browser that started the installation. + + The response also sets a short-lived HttpOnly cookie that binds the + callback to this browser. Installing and connecting each set their + own, so starting one leaves the other's callback working. + + Args: + redirect (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | SlackAuthorizationResponse + """ + + + return sync_detailed( + client=client, +redirect=redirect, + + ).parsed + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + redirect: str | Unset = UNSET, + +) -> Response[Error | SlackAuthorizationResponse]: + """ Start installing the Volcano Slack app + + Starts an installation of the Volcano app in a Slack workspace, so + LavaFlow can take problems reported there, and returns its Add to Slack + URL. Send the browser to it; Slack returns it to `GET /slack/callback`, + which saves the installation as a `slack` connector (`GET /connectors`). + Installing again replaces the workspace's installation. Enterprise Grid org-wide installs are + refused. The + callback finishes only in the browser that started the installation. + + The response also sets a short-lived HttpOnly cookie that binds the + callback to this browser. Installing and connecting each set their + own, so starting one leaves the other's callback working. + + Args: + redirect (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Error | SlackAuthorizationResponse] + """ + + + kwargs = request_kwargs( + redirect=redirect, + + ) + + response = await client.get_async_httpx_client().request( + **kwargs + ) + + return build_response(client=client, response=response) + +async def asyncio( + *, + client: AuthenticatedClient, + redirect: str | Unset = UNSET, + +) -> Error | SlackAuthorizationResponse | None: + """ Start installing the Volcano Slack app + + Starts an installation of the Volcano app in a Slack workspace, so + LavaFlow can take problems reported there, and returns its Add to Slack + URL. Send the browser to it; Slack returns it to `GET /slack/callback`, + which saves the installation as a `slack` connector (`GET /connectors`). + Installing again replaces the workspace's installation. Enterprise Grid org-wide installs are + refused. The + callback finishes only in the browser that started the installation. + + The response also sets a short-lived HttpOnly cookie that binds the + callback to this browser. Installing and connecting each set their + own, so starting one leaves the other's callback working. + + Args: + redirect (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Error | SlackAuthorizationResponse + """ + + + return (await asyncio_detailed( + client=client, +redirect=redirect, + + )).parsed diff --git a/src/volcano_sdk/_generated/api/storage_objects/copy_storage_object.py b/src/volcano_sdk/_generated/api/storage_objects/copy_storage_object.py index a8fbc2b0..d3675f43 100644 --- a/src/volcano_sdk/_generated/api/storage_objects/copy_storage_object.py +++ b/src/volcano_sdk/_generated/api/storage_objects/copy_storage_object.py @@ -54,6 +54,13 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res response_403 = cast(Any, None) return response_403 + if response.status_code == 413: + response_413 = Error.from_dict(response.json()) + + + + return response_413 + if response.status_code == 429: response_429 = Error.from_dict(response.json()) diff --git a/src/volcano_sdk/_generated/api/storage_objects/download_public_file.py b/src/volcano_sdk/_generated/api/storage_objects/download_public_file.py index b51c2764..c99c7ffd 100644 --- a/src/volcano_sdk/_generated/api/storage_objects/download_public_file.py +++ b/src/volcano_sdk/_generated/api/storage_objects/download_public_file.py @@ -56,6 +56,13 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res response_404 = cast(Any, None) return response_404 + if response.status_code == 416: + response_416 = Error.from_dict(response.json()) + + + + return response_416 + if response.status_code == 429: response_429 = Error.from_dict(response.json()) diff --git a/src/volcano_sdk/_generated/api/storage_objects/download_storage_object.py b/src/volcano_sdk/_generated/api/storage_objects/download_storage_object.py index 30647e4f..011b9cbc 100644 --- a/src/volcano_sdk/_generated/api/storage_objects/download_storage_object.py +++ b/src/volcano_sdk/_generated/api/storage_objects/download_storage_object.py @@ -74,6 +74,13 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res response_404 = cast(Any, None) return response_404 + if response.status_code == 416: + response_416 = Error.from_dict(response.json()) + + + + return response_416 + if response.status_code == 429: response_429 = Error.from_dict(response.json()) diff --git a/src/volcano_sdk/_generated/api/storage_objects/move_storage_object.py b/src/volcano_sdk/_generated/api/storage_objects/move_storage_object.py index 53755e65..d6cc4eec 100644 --- a/src/volcano_sdk/_generated/api/storage_objects/move_storage_object.py +++ b/src/volcano_sdk/_generated/api/storage_objects/move_storage_object.py @@ -54,6 +54,13 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res response_403 = cast(Any, None) return response_403 + if response.status_code == 413: + response_413 = Error.from_dict(response.json()) + + + + return response_413 + if response.status_code == 429: response_429 = Error.from_dict(response.json()) diff --git a/src/volcano_sdk/_generated/api/storage_objects/update_storage_object_visibility.py b/src/volcano_sdk/_generated/api/storage_objects/update_storage_object_visibility.py index 3765db9f..649ab793 100644 --- a/src/volcano_sdk/_generated/api/storage_objects/update_storage_object_visibility.py +++ b/src/volcano_sdk/_generated/api/storage_objects/update_storage_object_visibility.py @@ -8,6 +8,7 @@ from ...types import Response, UNSET from ... import errors +from ...models.error import Error from ...models.storage_object import StorageObject from ...models.storage_visibility_request import StorageVisibilityRequest from typing import cast @@ -42,7 +43,7 @@ def request_kwargs( -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | StorageObject | None: +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | Error | StorageObject | None: if response.status_code == 200: response_200 = StorageObject.from_dict(response.json()) @@ -58,13 +59,20 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res response_404 = cast(Any, None) return response_404 + if response.status_code == 413: + response_413 = Error.from_dict(response.json()) + + + + return response_413 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: return None -def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any | StorageObject]: +def build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any | Error | StorageObject]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -80,7 +88,7 @@ def sync_detailed( client: AuthenticatedClient, body: StorageVisibilityRequest, -) -> Response[Any | StorageObject]: +) -> Response[Any | Error | StorageObject]: """ Update file visibility (public/private) Change whether a file is publicly accessible. Only the file owner or a service key can change @@ -101,7 +109,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | StorageObject] + Response[Any | Error | StorageObject] """ @@ -125,7 +133,7 @@ def sync( client: AuthenticatedClient, body: StorageVisibilityRequest, -) -> Any | StorageObject | None: +) -> Any | Error | StorageObject | None: """ Update file visibility (public/private) Change whether a file is publicly accessible. Only the file owner or a service key can change @@ -146,7 +154,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | StorageObject + Any | Error | StorageObject """ @@ -165,7 +173,7 @@ async def asyncio_detailed( client: AuthenticatedClient, body: StorageVisibilityRequest, -) -> Response[Any | StorageObject]: +) -> Response[Any | Error | StorageObject]: """ Update file visibility (public/private) Change whether a file is publicly accessible. Only the file owner or a service key can change @@ -186,7 +194,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | StorageObject] + Response[Any | Error | StorageObject] """ @@ -210,7 +218,7 @@ async def asyncio( client: AuthenticatedClient, body: StorageVisibilityRequest, -) -> Any | StorageObject | None: +) -> Any | Error | StorageObject | None: """ Update file visibility (public/private) Change whether a file is publicly accessible. Only the file owner or a service key can change @@ -231,7 +239,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | StorageObject + Any | Error | StorageObject """ diff --git a/src/volcano_sdk/_generated/api/system/list_capabilities.py b/src/volcano_sdk/_generated/api/system/list_capabilities.py index 32aeb7ad..944d6e0c 100644 --- a/src/volcano_sdk/_generated/api/system/list_capabilities.py +++ b/src/volcano_sdk/_generated/api/system/list_capabilities.py @@ -71,10 +71,53 @@ def sync_detailed( | `sandboxes.sessions` | Starting and resuming sessions, and one-shot executions | | `sandboxes.custom_templates` | Deploying a custom template; its validation waits while `sandboxes.sessions` is unavailable | + | `sandboxes.network_isolation` | Creating sessions and one-shot executions with `network.egress` + `deny_all`; existing `deny_all` sessions work either way | + | `sandboxes.output_not_kept` | Commands that keep no output: `keep_output: false` on a command, and + `executions.keep_output: false` on a session; commands that keep output work either way | | `issues` | The Issues API: listing, reading, and updating grouped runtime errors | - | `autofix` | The Autofix API: a project's AI diagnosis and fix settings | - | `autofix.managed_models` | Turning autofix on with Volcano-managed models instead of your own API - key | + | `issues.create` | Writing an issue with `POST /issues`; written issues already recorded read and + update either way | + | `lavaflow` | LavaFlow, which diagnoses a project's issues and opens pull requests that fix them. + Here it reports cloud deployment readiness. Read `GET /projects/{id}/capabilities` for a project's + eligibility. New projects start with LavaFlow off | + | `lavaflow.merge` | LavaFlow merging its fixes, with `autonomy: merge`. Requires LavaFlow + availability. The project owner chooses merge autonomy | + | `lavaflow.lineage` | LavaFlow following up its fixes: linking a fix's recurrence or a new issue + its deploy caused to the fix, the follow-up runs, and the lineage holds. Requires LavaFlow + availability | + | `lavaflow.open_pr_ci_start` | Compatibility alias for `lavaflow.repository_ci`. The repository + owner must grant permission separately | + | `lavaflow.repository_ci` | Normal repository CI availability specifically. Eligible fixes use it + only after the owner grants `allow_ungated_workflows` for the connected repository and installation. + The repository controls its CI and credential access. This capability does not authorize execution + or prove a workflow ran | + | `lavaflow.code_quality` | LavaFlow Code Quality, which reviews the code each frontend production + deploy changes. Here it reports only whether Code Quality is released in this environment; whether a + project has it comes from `GET /projects/{id}/capabilities` | + | `lavaflow.slack` | Reporting problems to LavaFlow from Slack: installing the Volcano Slack app, + connecting Slack identities, and binding channels to projects. Requires LavaFlow availability and a + configured Slack app | + | `lavaflow.aikido` | LavaFlow fixing the security issues Aikido finds: connecting an Aikido + workspace and binding projects to it. Requires LavaFlow availability | + | `functions.response_streaming` | Streaming an HTTP-mode function's response on its own URL as the + function writes it | + | `frontend_routes` | Creating and changing Frontend routes; listing, deleting, and serving existing + ones work either way | + | `frontends.candidates` | Creating, redeploying, promoting and rolling back to a frontend + Candidate; reading, deleting and rolling back to the frontend's own runtime always work | + | `databases.migrations` | Starting migration runs and recording a baseline; reading history and + runs works either way | + | `shares` | Creating, switching on and publishing shares, and forking one | + | `ai_gateway` | The Volcano AI gateway: creating a key that holds `ai.invoke` with `POST + /projects/{id}/service-keys`, and minting the first run token of a run; reading, regenerating and + deleting existing keys, and reading, extending, revoking and minting again for a run already minted + for, work either way | + | `realtime.http_publish` | Publishing a message with `POST /realtime/v1/publish`; while Realtime is + paused it stays available, and the route answers `503` `feature_paused` | + | `git_deploy.skip_unchanged` | A Git push leaving unchanged functions and frontends on their + current deployments, as a project's `skip_unchanged` Git deploy setting asks; while it is + unavailable every push deploys every function and frontend, and the setting still reads and saves | A capability missing from the list is unavailable, and a capability under another, such as `sandboxes.sessions`, is unavailable whenever its parent is. @@ -82,7 +125,19 @@ def sync_detailed( or `400` with code `feature_unavailable`; refresh this list when you receive that code. Reading, deleting, and terminating what already exists keep working unless the whole feature is absent from the environment. Every caller - in an environment gets the same answer. + in an environment gets the same answer; `GET /projects/{id}/capabilities` + answers for one project. + + `functions.response_streaming` refuses nothing: while it is unavailable, a + function's own URL still answers and sends a streamed response whole, once + the function finishes, up to 6 MiB with headers; a larger one fails the + invocation. Frontend Function routes stream either way. + + After these, the list names each first-party app Volcano runs in this + environment, such as `builder`, by its own ID. Such an app is available + while it accepts new work. When only the app's own release is off, work + it already accepted continues; when first-party app mounts are off, its + mount refuses every request with 404 `feature_unavailable`. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -119,10 +174,53 @@ def sync( | `sandboxes.sessions` | Starting and resuming sessions, and one-shot executions | | `sandboxes.custom_templates` | Deploying a custom template; its validation waits while `sandboxes.sessions` is unavailable | + | `sandboxes.network_isolation` | Creating sessions and one-shot executions with `network.egress` + `deny_all`; existing `deny_all` sessions work either way | + | `sandboxes.output_not_kept` | Commands that keep no output: `keep_output: false` on a command, and + `executions.keep_output: false` on a session; commands that keep output work either way | | `issues` | The Issues API: listing, reading, and updating grouped runtime errors | - | `autofix` | The Autofix API: a project's AI diagnosis and fix settings | - | `autofix.managed_models` | Turning autofix on with Volcano-managed models instead of your own API - key | + | `issues.create` | Writing an issue with `POST /issues`; written issues already recorded read and + update either way | + | `lavaflow` | LavaFlow, which diagnoses a project's issues and opens pull requests that fix them. + Here it reports cloud deployment readiness. Read `GET /projects/{id}/capabilities` for a project's + eligibility. New projects start with LavaFlow off | + | `lavaflow.merge` | LavaFlow merging its fixes, with `autonomy: merge`. Requires LavaFlow + availability. The project owner chooses merge autonomy | + | `lavaflow.lineage` | LavaFlow following up its fixes: linking a fix's recurrence or a new issue + its deploy caused to the fix, the follow-up runs, and the lineage holds. Requires LavaFlow + availability | + | `lavaflow.open_pr_ci_start` | Compatibility alias for `lavaflow.repository_ci`. The repository + owner must grant permission separately | + | `lavaflow.repository_ci` | Normal repository CI availability specifically. Eligible fixes use it + only after the owner grants `allow_ungated_workflows` for the connected repository and installation. + The repository controls its CI and credential access. This capability does not authorize execution + or prove a workflow ran | + | `lavaflow.code_quality` | LavaFlow Code Quality, which reviews the code each frontend production + deploy changes. Here it reports only whether Code Quality is released in this environment; whether a + project has it comes from `GET /projects/{id}/capabilities` | + | `lavaflow.slack` | Reporting problems to LavaFlow from Slack: installing the Volcano Slack app, + connecting Slack identities, and binding channels to projects. Requires LavaFlow availability and a + configured Slack app | + | `lavaflow.aikido` | LavaFlow fixing the security issues Aikido finds: connecting an Aikido + workspace and binding projects to it. Requires LavaFlow availability | + | `functions.response_streaming` | Streaming an HTTP-mode function's response on its own URL as the + function writes it | + | `frontend_routes` | Creating and changing Frontend routes; listing, deleting, and serving existing + ones work either way | + | `frontends.candidates` | Creating, redeploying, promoting and rolling back to a frontend + Candidate; reading, deleting and rolling back to the frontend's own runtime always work | + | `databases.migrations` | Starting migration runs and recording a baseline; reading history and + runs works either way | + | `shares` | Creating, switching on and publishing shares, and forking one | + | `ai_gateway` | The Volcano AI gateway: creating a key that holds `ai.invoke` with `POST + /projects/{id}/service-keys`, and minting the first run token of a run; reading, regenerating and + deleting existing keys, and reading, extending, revoking and minting again for a run already minted + for, work either way | + | `realtime.http_publish` | Publishing a message with `POST /realtime/v1/publish`; while Realtime is + paused it stays available, and the route answers `503` `feature_paused` | + | `git_deploy.skip_unchanged` | A Git push leaving unchanged functions and frontends on their + current deployments, as a project's `skip_unchanged` Git deploy setting asks; while it is + unavailable every push deploys every function and frontend, and the setting still reads and saves | A capability missing from the list is unavailable, and a capability under another, such as `sandboxes.sessions`, is unavailable whenever its parent is. @@ -130,7 +228,19 @@ def sync( or `400` with code `feature_unavailable`; refresh this list when you receive that code. Reading, deleting, and terminating what already exists keep working unless the whole feature is absent from the environment. Every caller - in an environment gets the same answer. + in an environment gets the same answer; `GET /projects/{id}/capabilities` + answers for one project. + + `functions.response_streaming` refuses nothing: while it is unavailable, a + function's own URL still answers and sends a streamed response whole, once + the function finishes, up to 6 MiB with headers; a larger one fails the + invocation. Frontend Function routes stream either way. + + After these, the list names each first-party app Volcano runs in this + environment, such as `builder`, by its own ID. Such an app is available + while it accepts new work. When only the app's own release is off, work + it already accepted continues; when first-party app mounts are off, its + mount refuses every request with 404 `feature_unavailable`. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -162,10 +272,53 @@ async def asyncio_detailed( | `sandboxes.sessions` | Starting and resuming sessions, and one-shot executions | | `sandboxes.custom_templates` | Deploying a custom template; its validation waits while `sandboxes.sessions` is unavailable | + | `sandboxes.network_isolation` | Creating sessions and one-shot executions with `network.egress` + `deny_all`; existing `deny_all` sessions work either way | + | `sandboxes.output_not_kept` | Commands that keep no output: `keep_output: false` on a command, and + `executions.keep_output: false` on a session; commands that keep output work either way | | `issues` | The Issues API: listing, reading, and updating grouped runtime errors | - | `autofix` | The Autofix API: a project's AI diagnosis and fix settings | - | `autofix.managed_models` | Turning autofix on with Volcano-managed models instead of your own API - key | + | `issues.create` | Writing an issue with `POST /issues`; written issues already recorded read and + update either way | + | `lavaflow` | LavaFlow, which diagnoses a project's issues and opens pull requests that fix them. + Here it reports cloud deployment readiness. Read `GET /projects/{id}/capabilities` for a project's + eligibility. New projects start with LavaFlow off | + | `lavaflow.merge` | LavaFlow merging its fixes, with `autonomy: merge`. Requires LavaFlow + availability. The project owner chooses merge autonomy | + | `lavaflow.lineage` | LavaFlow following up its fixes: linking a fix's recurrence or a new issue + its deploy caused to the fix, the follow-up runs, and the lineage holds. Requires LavaFlow + availability | + | `lavaflow.open_pr_ci_start` | Compatibility alias for `lavaflow.repository_ci`. The repository + owner must grant permission separately | + | `lavaflow.repository_ci` | Normal repository CI availability specifically. Eligible fixes use it + only after the owner grants `allow_ungated_workflows` for the connected repository and installation. + The repository controls its CI and credential access. This capability does not authorize execution + or prove a workflow ran | + | `lavaflow.code_quality` | LavaFlow Code Quality, which reviews the code each frontend production + deploy changes. Here it reports only whether Code Quality is released in this environment; whether a + project has it comes from `GET /projects/{id}/capabilities` | + | `lavaflow.slack` | Reporting problems to LavaFlow from Slack: installing the Volcano Slack app, + connecting Slack identities, and binding channels to projects. Requires LavaFlow availability and a + configured Slack app | + | `lavaflow.aikido` | LavaFlow fixing the security issues Aikido finds: connecting an Aikido + workspace and binding projects to it. Requires LavaFlow availability | + | `functions.response_streaming` | Streaming an HTTP-mode function's response on its own URL as the + function writes it | + | `frontend_routes` | Creating and changing Frontend routes; listing, deleting, and serving existing + ones work either way | + | `frontends.candidates` | Creating, redeploying, promoting and rolling back to a frontend + Candidate; reading, deleting and rolling back to the frontend's own runtime always work | + | `databases.migrations` | Starting migration runs and recording a baseline; reading history and + runs works either way | + | `shares` | Creating, switching on and publishing shares, and forking one | + | `ai_gateway` | The Volcano AI gateway: creating a key that holds `ai.invoke` with `POST + /projects/{id}/service-keys`, and minting the first run token of a run; reading, regenerating and + deleting existing keys, and reading, extending, revoking and minting again for a run already minted + for, work either way | + | `realtime.http_publish` | Publishing a message with `POST /realtime/v1/publish`; while Realtime is + paused it stays available, and the route answers `503` `feature_paused` | + | `git_deploy.skip_unchanged` | A Git push leaving unchanged functions and frontends on their + current deployments, as a project's `skip_unchanged` Git deploy setting asks; while it is + unavailable every push deploys every function and frontend, and the setting still reads and saves | A capability missing from the list is unavailable, and a capability under another, such as `sandboxes.sessions`, is unavailable whenever its parent is. @@ -173,7 +326,19 @@ async def asyncio_detailed( or `400` with code `feature_unavailable`; refresh this list when you receive that code. Reading, deleting, and terminating what already exists keep working unless the whole feature is absent from the environment. Every caller - in an environment gets the same answer. + in an environment gets the same answer; `GET /projects/{id}/capabilities` + answers for one project. + + `functions.response_streaming` refuses nothing: while it is unavailable, a + function's own URL still answers and sends a streamed response whole, once + the function finishes, up to 6 MiB with headers; a larger one fails the + invocation. Frontend Function routes stream either way. + + After these, the list names each first-party app Volcano runs in this + environment, such as `builder`, by its own ID. Such an app is available + while it accepts new work. When only the app's own release is off, work + it already accepted continues; when first-party app mounts are off, its + mount refuses every request with 404 `feature_unavailable`. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -210,10 +375,53 @@ async def asyncio( | `sandboxes.sessions` | Starting and resuming sessions, and one-shot executions | | `sandboxes.custom_templates` | Deploying a custom template; its validation waits while `sandboxes.sessions` is unavailable | + | `sandboxes.network_isolation` | Creating sessions and one-shot executions with `network.egress` + `deny_all`; existing `deny_all` sessions work either way | + | `sandboxes.output_not_kept` | Commands that keep no output: `keep_output: false` on a command, and + `executions.keep_output: false` on a session; commands that keep output work either way | | `issues` | The Issues API: listing, reading, and updating grouped runtime errors | - | `autofix` | The Autofix API: a project's AI diagnosis and fix settings | - | `autofix.managed_models` | Turning autofix on with Volcano-managed models instead of your own API - key | + | `issues.create` | Writing an issue with `POST /issues`; written issues already recorded read and + update either way | + | `lavaflow` | LavaFlow, which diagnoses a project's issues and opens pull requests that fix them. + Here it reports cloud deployment readiness. Read `GET /projects/{id}/capabilities` for a project's + eligibility. New projects start with LavaFlow off | + | `lavaflow.merge` | LavaFlow merging its fixes, with `autonomy: merge`. Requires LavaFlow + availability. The project owner chooses merge autonomy | + | `lavaflow.lineage` | LavaFlow following up its fixes: linking a fix's recurrence or a new issue + its deploy caused to the fix, the follow-up runs, and the lineage holds. Requires LavaFlow + availability | + | `lavaflow.open_pr_ci_start` | Compatibility alias for `lavaflow.repository_ci`. The repository + owner must grant permission separately | + | `lavaflow.repository_ci` | Normal repository CI availability specifically. Eligible fixes use it + only after the owner grants `allow_ungated_workflows` for the connected repository and installation. + The repository controls its CI and credential access. This capability does not authorize execution + or prove a workflow ran | + | `lavaflow.code_quality` | LavaFlow Code Quality, which reviews the code each frontend production + deploy changes. Here it reports only whether Code Quality is released in this environment; whether a + project has it comes from `GET /projects/{id}/capabilities` | + | `lavaflow.slack` | Reporting problems to LavaFlow from Slack: installing the Volcano Slack app, + connecting Slack identities, and binding channels to projects. Requires LavaFlow availability and a + configured Slack app | + | `lavaflow.aikido` | LavaFlow fixing the security issues Aikido finds: connecting an Aikido + workspace and binding projects to it. Requires LavaFlow availability | + | `functions.response_streaming` | Streaming an HTTP-mode function's response on its own URL as the + function writes it | + | `frontend_routes` | Creating and changing Frontend routes; listing, deleting, and serving existing + ones work either way | + | `frontends.candidates` | Creating, redeploying, promoting and rolling back to a frontend + Candidate; reading, deleting and rolling back to the frontend's own runtime always work | + | `databases.migrations` | Starting migration runs and recording a baseline; reading history and + runs works either way | + | `shares` | Creating, switching on and publishing shares, and forking one | + | `ai_gateway` | The Volcano AI gateway: creating a key that holds `ai.invoke` with `POST + /projects/{id}/service-keys`, and minting the first run token of a run; reading, regenerating and + deleting existing keys, and reading, extending, revoking and minting again for a run already minted + for, work either way | + | `realtime.http_publish` | Publishing a message with `POST /realtime/v1/publish`; while Realtime is + paused it stays available, and the route answers `503` `feature_paused` | + | `git_deploy.skip_unchanged` | A Git push leaving unchanged functions and frontends on their + current deployments, as a project's `skip_unchanged` Git deploy setting asks; while it is + unavailable every push deploys every function and frontend, and the setting still reads and saves | A capability missing from the list is unavailable, and a capability under another, such as `sandboxes.sessions`, is unavailable whenever its parent is. @@ -221,7 +429,19 @@ async def asyncio( or `400` with code `feature_unavailable`; refresh this list when you receive that code. Reading, deleting, and terminating what already exists keep working unless the whole feature is absent from the environment. Every caller - in an environment gets the same answer. + in an environment gets the same answer; `GET /projects/{id}/capabilities` + answers for one project. + + `functions.response_streaming` refuses nothing: while it is unavailable, a + function's own URL still answers and sends a streamed response whole, once + the function finishes, up to 6 MiB with headers; a larger one fails the + invocation. Frontend Function routes stream either way. + + After these, the list names each first-party app Volcano runs in this + environment, such as `builder`, by its own ID. Such an app is available + while it accepts new work. When only the app's own release is off, work + it already accepted continues; when first-party app mounts are off, its + mount refuses every request with 404 `feature_unavailable`. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/src/volcano_sdk/_generated/api/variables/create_variable.py b/src/volcano_sdk/_generated/api/variables/create_variable.py index 7eba5073..e2fa87ee 100644 --- a/src/volcano_sdk/_generated/api/variables/create_variable.py +++ b/src/volcano_sdk/_generated/api/variables/create_variable.py @@ -58,6 +58,13 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return response_400 + if response.status_code == 409: + response_409 = Error.from_dict(response.json()) + + + + return response_409 + if response.status_code == 503: response_503 = Error.from_dict(response.json()) diff --git a/src/volcano_sdk/_generated/api/variables/delete_variable.py b/src/volcano_sdk/_generated/api/variables/delete_variable.py index 36dabacb..a1fa1383 100644 --- a/src/volcano_sdk/_generated/api/variables/delete_variable.py +++ b/src/volcano_sdk/_generated/api/variables/delete_variable.py @@ -47,6 +47,13 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return response_404 + if response.status_code == 409: + response_409 = Error.from_dict(response.json()) + + + + return response_409 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: diff --git a/src/volcano_sdk/_generated/api/variables/update_variable.py b/src/volcano_sdk/_generated/api/variables/update_variable.py index b905ce0d..615b1bd7 100644 --- a/src/volcano_sdk/_generated/api/variables/update_variable.py +++ b/src/volcano_sdk/_generated/api/variables/update_variable.py @@ -66,6 +66,13 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res return response_404 + if response.status_code == 409: + response_409 = Error.from_dict(response.json()) + + + + return response_409 + if response.status_code == 503: response_503 = Error.from_dict(response.json()) diff --git a/src/volcano_sdk/_generated/models/__init__.py b/src/volcano_sdk/_generated/models/__init__.py index 31ee40ce..e8743eeb 100644 --- a/src/volcano_sdk/_generated/models/__init__.py +++ b/src/volcano_sdk/_generated/models/__init__.py @@ -1,5 +1,12 @@ """ Contains all the data models used in inputs/outputs """ +from .account_session import AccountSession +from .account_session_kind import AccountSessionKind +from .account_session_list import AccountSessionList +from .aikido_connector import AikidoConnector +from .aikido_connector_create import AikidoConnectorCreate +from .aikido_region import AikidoRegion +from .aikido_severity import AikidoSeverity from .anon_key import AnonKey from .auth_cancel_email_change_response_200 import AuthCancelEmailChangeResponse200 from .auth_config import AuthConfig @@ -90,23 +97,6 @@ from .auth_user_app_metadata import AuthUserAppMetadata from .auth_user_status import AuthUserStatus from .auth_user_user_metadata import AuthUserUserMetadata -from .autofix_diagnosis import AutofixDiagnosis -from .autofix_diagnosis_confidence import AutofixDiagnosisConfidence -from .autofix_edit import AutofixEdit -from .autofix_evidence import AutofixEvidence -from .autofix_evidence_kind import AutofixEvidenceKind -from .autofix_model import AutofixModel -from .autofix_patch import AutofixPatch -from .autofix_provider import AutofixProvider -from .autofix_pull_request import AutofixPullRequest -from .autofix_pull_request_skipped import AutofixPullRequestSkipped -from .autofix_pull_request_state import AutofixPullRequestState -from .autofix_run import AutofixRun -from .autofix_run_status import AutofixRunStatus -from .autofix_run_trigger import AutofixRunTrigger -from .autofix_run_usage import AutofixRunUsage -from .autofix_settings import AutofixSettings -from .autofix_stage import AutofixStage from .ban_auth_user_body import BanAuthUserBody from .ban_user_response import BanUserResponse from .ban_user_response_status import BanUserResponseStatus @@ -135,6 +125,11 @@ from .configure_auth_methods_body import ConfigureAuthMethodsBody from .configure_auth_methods_body_oauth_providers_item import ConfigureAuthMethodsBodyOauthProvidersItem from .connect_project_git_request import ConnectProjectGitRequest +from .connector import Connector +from .connector_create import ConnectorCreate +from .connector_create_type import ConnectorCreateType +from .connector_type import ConnectorType +from .connectors_response import ConnectorsResponse from .create_anon_key_body import CreateAnonKeyBody from .create_anon_key_body_permissions_item import CreateAnonKeyBodyPermissionsItem from .create_database_backup_request import CreateDatabaseBackupRequest @@ -151,14 +146,21 @@ from .create_frontend_body import CreateFrontendBody from .create_frontend_body_framework import CreateFrontendBodyFramework from .create_frontend_body_variable_scope import CreateFrontendBodyVariableScope +from .create_frontend_candidate_body import CreateFrontendCandidateBody from .create_frontend_custom_domain_request import CreateFrontendCustomDomainRequest +from .create_frontend_deployment_request import CreateFrontendDeploymentRequest +from .create_frontend_domain_request import CreateFrontendDomainRequest from .create_frontend_function_route_request import CreateFrontendFunctionRouteRequest +from .create_frontend_route_request import CreateFrontendRouteRequest from .create_function_body import CreateFunctionBody from .create_function_body_runtime import CreateFunctionBodyRuntime from .create_function_body_variable_scope import CreateFunctionBodyVariableScope +from .create_function_candidate_body import CreateFunctionCandidateBody from .create_function_scheduler_request import CreateFunctionSchedulerRequest from .create_function_scheduler_request_payload import CreateFunctionSchedulerRequestPayload from .create_functions_batch_body import CreateFunctionsBatchBody +from .create_git_deployment_run_request import CreateGitDeploymentRunRequest +from .create_issue_request import CreateIssueRequest from .create_o_auth_config_request import CreateOAuthConfigRequest from .create_o_auth_config_request_provider import CreateOAuthConfigRequestProvider from .create_project_access_token_request import CreateProjectAccessTokenRequest @@ -190,6 +192,25 @@ from .database_delete_request import DatabaseDeleteRequest from .database_insert_request import DatabaseInsertRequest from .database_insert_request_values import DatabaseInsertRequestValues +from .database_migration_baseline import DatabaseMigrationBaseline +from .database_migration_conflict_error import DatabaseMigrationConflictError +from .database_migration_file import DatabaseMigrationFile +from .database_migration_file_error import DatabaseMigrationFileError +from .database_migration_files_request import DatabaseMigrationFilesRequest +from .database_migration_history_entry import DatabaseMigrationHistoryEntry +from .database_migration_history_entry_status import DatabaseMigrationHistoryEntryStatus +from .database_migration_run import DatabaseMigrationRun +from .database_migration_run_error import DatabaseMigrationRunError +from .database_migration_run_error_code import DatabaseMigrationRunErrorCode +from .database_migration_run_file import DatabaseMigrationRunFile +from .database_migration_run_file_outcome import DatabaseMigrationRunFileOutcome +from .database_migration_run_list import DatabaseMigrationRunList +from .database_migration_run_phase import DatabaseMigrationRunPhase +from .database_migration_run_source import DatabaseMigrationRunSource +from .database_migration_run_status import DatabaseMigrationRunStatus +from .database_migration_warning import DatabaseMigrationWarning +from .database_migration_warning_code import DatabaseMigrationWarningCode +from .database_migrations import DatabaseMigrations from .database_query_filter import DatabaseQueryFilter from .database_query_filter_operator import DatabaseQueryFilterOperator from .database_query_order import DatabaseQueryOrder @@ -199,6 +220,7 @@ from .database_query_result import DatabaseQueryResult from .database_query_result_data_item import DatabaseQueryResultDataItem from .database_restore import DatabaseRestore +from .database_restore_conflict_error import DatabaseRestoreConflictError from .database_restore_kind import DatabaseRestoreKind from .database_restore_list import DatabaseRestoreList from .database_restore_status import DatabaseRestoreStatus @@ -209,6 +231,8 @@ from .database_status import DatabaseStatus from .database_update_request import DatabaseUpdateRequest from .database_update_request_values import DatabaseUpdateRequestValues +from .default_email_template import DefaultEmailTemplate +from .default_email_template_type import DefaultEmailTemplateType from .delete_database_backup_response_200 import DeleteDatabaseBackupResponse200 from .delete_database_branch_response_202 import DeleteDatabaseBranchResponse202 from .delete_database_response_202 import DeleteDatabaseResponse202 @@ -216,6 +240,8 @@ from .delete_o_auth_config_provider import DeleteOAuthConfigProvider from .deploy_sandbox_body import DeploySandboxBody from .deploy_sandbox_body_memory_mb import DeploySandboxBodyMemoryMb +from .deployment_commit import DeploymentCommit +from .deployment_commit_verification import DeploymentCommitVerification from .deployment_phase import DeploymentPhase from .deployment_phase_name import DeploymentPhaseName from .deployment_phase_status import DeploymentPhaseStatus @@ -269,8 +295,21 @@ from .error import Error from .export_project_source_request import ExportProjectSourceRequest from .fail_durable_callback_request import FailDurableCallbackRequest +from .fork_create_request import ForkCreateRequest +from .fork_create_request_variables import ForkCreateRequestVariables from .frontend import Frontend +from .frontend_candidate import FrontendCandidate +from .frontend_candidate_configuration_status import FrontendCandidateConfigurationStatus +from .frontend_candidate_deployment import FrontendCandidateDeployment +from .frontend_candidate_deployment_status import FrontendCandidateDeploymentStatus +from .frontend_candidate_list import FrontendCandidateList +from .frontend_candidate_status import FrontendCandidateStatus from .frontend_custom_domain_conflict_error import FrontendCustomDomainConflictError +from .frontend_custom_domain_list import FrontendCustomDomainList +from .frontend_custom_domain_redirect import FrontendCustomDomainRedirect +from .frontend_custom_domain_redirect_request import FrontendCustomDomainRedirectRequest +from .frontend_custom_domain_redirect_request_status import FrontendCustomDomainRedirectRequestStatus +from .frontend_custom_domain_redirect_status import FrontendCustomDomainRedirectStatus from .frontend_custom_domain_response import FrontendCustomDomainResponse from .frontend_custom_domain_response_domain_status import FrontendCustomDomainResponseDomainStatus from .frontend_custom_domain_response_serving_certificate import FrontendCustomDomainResponseServingCertificate @@ -289,17 +328,30 @@ from .frontend_framework import FrontendFramework from .frontend_function_route import FrontendFunctionRoute from .frontend_function_route_list import FrontendFunctionRouteList +from .frontend_route import FrontendRoute +from .frontend_route_list import FrontendRouteList +from .frontend_serving import FrontendServing from .frontend_status import FrontendStatus from .frontend_usage_daily_entry import FrontendUsageDailyEntry from .frontend_usage_data import FrontendUsageData from .frontend_usage_history_response import FrontendUsageHistoryResponse from .frontend_variable_scope import FrontendVariableScope from .function import Function +from .function_candidate import FunctionCandidate +from .function_candidate_configuration_status import FunctionCandidateConfigurationStatus +from .function_candidate_deployment import FunctionCandidateDeployment +from .function_candidate_deployment_list import FunctionCandidateDeploymentList +from .function_candidate_deployment_operation import FunctionCandidateDeploymentOperation +from .function_candidate_deployment_status import FunctionCandidateDeploymentStatus +from .function_candidate_exposure import FunctionCandidateExposure +from .function_candidate_list import FunctionCandidateList +from .function_candidate_status import FunctionCandidateStatus from .function_deployment import FunctionDeployment from .function_deployment_deploy_source import FunctionDeploymentDeploySource from .function_deployment_operation import FunctionDeploymentOperation from .function_deployment_status import FunctionDeploymentStatus from .function_http_auth_mode import FunctionHTTPAuthMode +from .function_image_digest import FunctionImageDigest from .function_invocation_mode import FunctionInvocationMode from .function_invocation_request import FunctionInvocationRequest from .function_invocation_request_payload import FunctionInvocationRequestPayload @@ -307,14 +359,24 @@ from .function_kind import FunctionKind from .function_kind_filter import FunctionKindFilter from .function_openapi_spec_type_0 import FunctionOpenapiSpecType0 +from .function_production_environment import FunctionProductionEnvironment +from .function_production_environment_status import FunctionProductionEnvironmentStatus +from .function_promotion_request import FunctionPromotionRequest from .function_region import FunctionRegion +from .function_rollback_request import FunctionRollbackRequest from .function_runtime_deployment import FunctionRuntimeDeployment from .function_runtime_option import FunctionRuntimeOption from .function_runtimes_response import FunctionRuntimesResponse from .function_scheduler import FunctionScheduler +from .function_scheduler_health import FunctionSchedulerHealth +from .function_scheduler_last_run_status import FunctionSchedulerLastRunStatus from .function_scheduler_list_response import FunctionSchedulerListResponse from .function_scheduler_payload import FunctionSchedulerPayload from .function_scheduler_schedule_kind import FunctionSchedulerScheduleKind +from .function_serving import FunctionServing +from .function_serving_activation import FunctionServingActivation +from .function_serving_activation_kind import FunctionServingActivationKind +from .function_serving_activation_status import FunctionServingActivationStatus from .function_status import FunctionStatus from .function_visibility import FunctionVisibility from .get_auth_methods_response_200 import GetAuthMethodsResponse200 @@ -325,6 +387,7 @@ from .get_default_email_template_type import GetDefaultEmailTemplateType from .get_default_email_templates_response_200 import GetDefaultEmailTemplatesResponse200 from .get_email_template_type import GetEmailTemplateType +from .get_lavaflow_stats_category import GetLavaflowStatsCategory from .get_o_auth_config_provider import GetOAuthConfigProvider from .get_o_auth_provider_token_provider import GetOAuthProviderTokenProvider from .get_o_auth_provider_token_response_200 import GetOAuthProviderTokenResponse200 @@ -332,10 +395,15 @@ from .git_connect_start_response import GitConnectStartResponse from .git_connection import GitConnection from .git_connections_response import GitConnectionsResponse +from .git_deployment_migration_run import GitDeploymentMigrationRun +from .git_deployment_run import GitDeploymentRun +from .git_deployment_run_error import GitDeploymentRunError +from .git_deployment_run_status import GitDeploymentRunStatus from .git_installation import GitInstallation from .git_installations_response import GitInstallationsResponse from .git_repositories_response import GitRepositoriesResponse from .git_repository import GitRepository +from .git_repository_reference import GitRepositoryReference from .heartbeat_durable_callback_request import HeartbeatDurableCallbackRequest from .hosted_auth_page_type import HostedAuthPageType from .hosted_login_email_check_request import HostedLoginEmailCheckRequest @@ -347,9 +415,124 @@ from .import_connections_response import ImportConnectionsResponse from .import_provider import ImportProvider from .import_source import ImportSource +from .import_source_repository import ImportSourceRepository from .import_sources_response import ImportSourcesResponse from .issue import Issue +from .issue_finding import IssueFinding +from .issue_finding_severity import IssueFindingSeverity +from .issue_source import IssueSource from .issue_status import IssueStatus +from .lavaflow_aikido_binding import LavaflowAikidoBinding +from .lavaflow_aikido_binding_target import LavaflowAikidoBindingTarget +from .lavaflow_allowed_workflow import LavaflowAllowedWorkflow +from .lavaflow_anomaly import LavaflowAnomaly +from .lavaflow_autonomy import LavaflowAutonomy +from .lavaflow_category_counts import LavaflowCategoryCounts +from .lavaflow_code_quality_settings import LavaflowCodeQualitySettings +from .lavaflow_code_quality_update import LavaflowCodeQualityUpdate +from .lavaflow_commit_origin import LavaflowCommitOrigin +from .lavaflow_connector_binding import LavaflowConnectorBinding +from .lavaflow_connector_bindings_response import LavaflowConnectorBindingsResponse +from .lavaflow_day_counts import LavaflowDayCounts +from .lavaflow_delivery import LavaflowDelivery +from .lavaflow_delivery_coverage import LavaflowDeliveryCoverage +from .lavaflow_delivery_coverage_state import LavaflowDeliveryCoverageState +from .lavaflow_delivery_skip import LavaflowDeliverySkip +from .lavaflow_delivery_state import LavaflowDeliveryState +from .lavaflow_delivery_stats import LavaflowDeliveryStats +from .lavaflow_diagnosis import LavaflowDiagnosis +from .lavaflow_draft_reason import LavaflowDraftReason +from .lavaflow_failure import LavaflowFailure +from .lavaflow_fix_outcome import LavaflowFixOutcome +from .lavaflow_fix_outcome_state import LavaflowFixOutcomeState +from .lavaflow_held_fix_open import LavaflowHeldFixOpen +from .lavaflow_held_workflows import LavaflowHeldWorkflows +from .lavaflow_hold_reason import LavaflowHoldReason +from .lavaflow_involved_resource import LavaflowInvolvedResource +from .lavaflow_involved_resource_count import LavaflowInvolvedResourceCount +from .lavaflow_involved_resource_roles_item import LavaflowInvolvedResourceRolesItem +from .lavaflow_issue_prompt import LavaflowIssuePrompt +from .lavaflow_issue_prompt_create import LavaflowIssuePromptCreate +from .lavaflow_issue_prompt_create_mode import LavaflowIssuePromptCreateMode +from .lavaflow_issue_prompt_mode import LavaflowIssuePromptMode +from .lavaflow_issue_prompt_status import LavaflowIssuePromptStatus +from .lavaflow_issue_prompts import LavaflowIssuePrompts +from .lavaflow_issue_summary import LavaflowIssueSummary +from .lavaflow_issue_summary_severity import LavaflowIssueSummarySeverity +from .lavaflow_lineage import LavaflowLineage +from .lavaflow_lineage_confidence import LavaflowLineageConfidence +from .lavaflow_lineage_evidence import LavaflowLineageEvidence +from .lavaflow_lineage_evidence_confidence import LavaflowLineageEvidenceConfidence +from .lavaflow_lineage_evidence_deployment import LavaflowLineageEvidenceDeployment +from .lavaflow_lineage_relation import LavaflowLineageRelation +from .lavaflow_lineage_remedy import LavaflowLineageRemedy +from .lavaflow_lineage_state import LavaflowLineageState +from .lavaflow_log_line import LavaflowLogLine +from .lavaflow_merge import LavaflowMerge +from .lavaflow_merge_policy import LavaflowMergePolicy +from .lavaflow_merge_policy_update import LavaflowMergePolicyUpdate +from .lavaflow_merge_status import LavaflowMergeStatus +from .lavaflow_outcome_counts import LavaflowOutcomeCounts +from .lavaflow_outcome_coverage import LavaflowOutcomeCoverage +from .lavaflow_outcome_coverage_event_time_basis import LavaflowOutcomeCoverageEventTimeBasis +from .lavaflow_outcome_coverage_status import LavaflowOutcomeCoverageStatus +from .lavaflow_outcome_current import LavaflowOutcomeCurrent +from .lavaflow_outcome_current_scope import LavaflowOutcomeCurrentScope +from .lavaflow_outcome_day import LavaflowOutcomeDay +from .lavaflow_outcome_values import LavaflowOutcomeValues +from .lavaflow_outcomes import LavaflowOutcomes +from .lavaflow_outcomes_coverage import LavaflowOutcomesCoverage +from .lavaflow_project_issue import LavaflowProjectIssue +from .lavaflow_project_issue_state import LavaflowProjectIssueState +from .lavaflow_pull_request import LavaflowPullRequest +from .lavaflow_pull_request_state import LavaflowPullRequestState +from .lavaflow_pull_request_state_counts import LavaflowPullRequestStateCounts +from .lavaflow_repository_check_command import LavaflowRepositoryCheckCommand +from .lavaflow_repository_checks import LavaflowRepositoryChecks +from .lavaflow_repository_expectation import LavaflowRepositoryExpectation +from .lavaflow_resource import LavaflowResource +from .lavaflow_resource_list import LavaflowResourceList +from .lavaflow_resource_reference import LavaflowResourceReference +from .lavaflow_resource_reference_type import LavaflowResourceReferenceType +from .lavaflow_review import LavaflowReview +from .lavaflow_review_finding import LavaflowReviewFinding +from .lavaflow_review_finding_severity import LavaflowReviewFindingSeverity +from .lavaflow_review_person_reason import LavaflowReviewPersonReason +from .lavaflow_review_stop import LavaflowReviewStop +from .lavaflow_review_verdict import LavaflowReviewVerdict +from .lavaflow_run import LavaflowRun +from .lavaflow_run_category import LavaflowRunCategory +from .lavaflow_run_counts import LavaflowRunCounts +from .lavaflow_run_create import LavaflowRunCreate +from .lavaflow_run_mode import LavaflowRunMode +from .lavaflow_run_progress import LavaflowRunProgress +from .lavaflow_run_progress_stage import LavaflowRunProgressStage +from .lavaflow_run_reference import LavaflowRunReference +from .lavaflow_run_status import LavaflowRunStatus +from .lavaflow_run_status_counts import LavaflowRunStatusCounts +from .lavaflow_run_summary import LavaflowRunSummary +from .lavaflow_scan import LavaflowScan +from .lavaflow_scan_billed_finding import LavaflowScanBilledFinding +from .lavaflow_scan_billed_finding_billable_events import LavaflowScanBilledFindingBillableEvents +from .lavaflow_scan_counts import LavaflowScanCounts +from .lavaflow_scan_resource import LavaflowScanResource +from .lavaflow_scan_resource_resource_type import LavaflowScanResourceResourceType +from .lavaflow_scan_source import LavaflowScanSource +from .lavaflow_scan_status import LavaflowScanStatus +from .lavaflow_settings import LavaflowSettings +from .lavaflow_settings_update import LavaflowSettingsUpdate +from .lavaflow_skip_reason import LavaflowSkipReason +from .lavaflow_slack_binding import LavaflowSlackBinding +from .lavaflow_slack_binding_target import LavaflowSlackBindingTarget +from .lavaflow_source_commit import LavaflowSourceCommit +from .lavaflow_source_unavailable import LavaflowSourceUnavailable +from .lavaflow_source_unavailable_reason import LavaflowSourceUnavailableReason +from .lavaflow_stats import LavaflowStats +from .lavaflow_stats_totals import LavaflowStatsTotals +from .lavaflow_task_activity import LavaflowTaskActivity +from .lavaflow_workflow_source import LavaflowWorkflowSource +from .list_account_sessions_sort import ListAccountSessionsSort +from .list_account_sessions_status import ListAccountSessionsStatus from .list_anon_keys_response_200 import ListAnonKeysResponse200 from .list_auth_users_status import ListAuthUsersStatus from .list_available_o_auth_providers_response_200 import ListAvailableOAuthProvidersResponse200 @@ -361,6 +544,11 @@ from .list_deployments_resource_type import ListDeploymentsResourceType from .list_deployments_status import ListDeploymentsStatus from .list_email_templates_response_200 import ListEmailTemplatesResponse200 +from .list_lavaflow_resources_category import ListLavaflowResourcesCategory +from .list_lavaflow_runs_category import ListLavaflowRunsCategory +from .list_lavaflow_runs_include_item import ListLavaflowRunsIncludeItem +from .list_lavaflow_runs_order import ListLavaflowRunsOrder +from .list_lavaflow_runs_pull_request_state import ListLavaflowRunsPullRequestState from .list_o_auth_configs_response_200 import ListOAuthConfigsResponse200 from .list_postgres_versions_response_200_item import ListPostgresVersionsResponse200Item from .list_project_deployments_resource_type import ListProjectDeploymentsResourceType @@ -377,6 +565,8 @@ from .log_activity_bucket_counts_resource_ids import LogActivityBucketCountsResourceIds from .log_activity_request import LogActivityRequest from .log_activity_response import LogActivityResponse +from .log_app_request_resource import LogAppRequestResource +from .log_app_request_resource_type import LogAppRequestResourceType from .log_database_request_resource import LogDatabaseRequestResource from .log_database_request_resource_type import LogDatabaseRequestResourceType from .log_deployment import LogDeployment @@ -397,13 +587,19 @@ from .managed_project_config_frontend_custom_domain_tls_config import ManagedProjectConfigFrontendCustomDomainTLSConfig from .managed_project_config_frontend_custom_domain_tls_config_mode import ManagedProjectConfigFrontendCustomDomainTLSConfigMode from .metric_usage_data import MetricUsageData +from .notification_email_settings import NotificationEmailSettings +from .notification_email_status import NotificationEmailStatus +from .notification_settings import NotificationSettings +from .notification_test_delivery import NotificationTestDelivery +from .notification_test_delivery_channel import NotificationTestDeliveryChannel +from .notification_test_result import NotificationTestResult +from .notification_webhook_settings import NotificationWebhookSettings from .o_auth_config import OAuthConfig from .o_auth_config_provider import OAuthConfigProvider from .o_auth_error_response import OAuthErrorResponse from .open_api_spec_document import OpenAPISpecDocument from .open_durable_message_session_request import OpenDurableMessageSessionRequest from .paginated_auth_users import PaginatedAuthUsers -from .paginated_autofix_runs import PaginatedAutofixRuns from .paginated_databases import PaginatedDatabases from .paginated_durable_approvals import PaginatedDurableApprovals from .paginated_durable_executions import PaginatedDurableExecutions @@ -412,13 +608,19 @@ from .paginated_frontends import PaginatedFrontends from .paginated_function_deployments import PaginatedFunctionDeployments from .paginated_functions import PaginatedFunctions +from .paginated_git_deployment_runs import PaginatedGitDeploymentRuns from .paginated_issues import PaginatedIssues +from .paginated_lavaflow_project_issues import PaginatedLavaflowProjectIssues +from .paginated_lavaflow_project_issues_realtime import PaginatedLavaflowProjectIssuesRealtime +from .paginated_lavaflow_runs import PaginatedLavaflowRuns +from .paginated_lavaflow_scans import PaginatedLavaflowScans from .paginated_project_access_tokens import PaginatedProjectAccessTokens from .paginated_project_custom_domains import PaginatedProjectCustomDomains from .paginated_project_deployments import PaginatedProjectDeployments from .paginated_projects import PaginatedProjects from .paginated_projects_status import PaginatedProjectsStatus from .paginated_service_keys import PaginatedServiceKeys +from .paginated_share_releases import PaginatedShareReleases from .paginated_storage_buckets import PaginatedStorageBuckets from .paginated_variables import PaginatedVariables from .platform_exchange_response import PlatformExchangeResponse @@ -426,6 +628,7 @@ from .preview_auth_page_response import PreviewAuthPageResponse from .project import Project from .project_access_token import ProjectAccessToken +from .project_access_token_listed_scope import ProjectAccessTokenListedScope from .project_access_token_scope import ProjectAccessTokenScope from .project_access_token_status import ProjectAccessTokenStatus from .project_access_token_token_source import ProjectAccessTokenTokenSource @@ -455,26 +658,31 @@ from .project_config_auth_signup import ProjectConfigAuthSignup from .project_config_auth_signup_allowed_email_domains_mode import ProjectConfigAuthSignupAllowedEmailDomainsMode from .project_config_auth_tokens import ProjectConfigAuthTokens -from .project_config_autofix import ProjectConfigAutofix from .project_config_bucket import ProjectConfigBucket from .project_config_bucket_policy import ProjectConfigBucketPolicy from .project_config_bucket_policy_operation import ProjectConfigBucketPolicyOperation from .project_config_custom_domain import ProjectConfigCustomDomain +from .project_config_custom_domain_redirect import ProjectConfigCustomDomainRedirect +from .project_config_custom_domain_redirect_status import ProjectConfigCustomDomainRedirectStatus from .project_config_database import ProjectConfigDatabase from .project_config_database_database_type import ProjectConfigDatabaseDatabaseType from .project_config_database_pg_version import ProjectConfigDatabasePgVersion from .project_config_email_template import ProjectConfigEmailTemplate from .project_config_email_templates import ProjectConfigEmailTemplates from .project_config_frontend import ProjectConfigFrontend +from .project_config_frontend_custom_domain import ProjectConfigFrontendCustomDomain from .project_config_frontend_function_route import ProjectConfigFrontendFunctionRoute +from .project_config_frontend_route import ProjectConfigFrontendRoute from .project_config_frontend_variable_scope import ProjectConfigFrontendVariableScope from .project_config_function import ProjectConfigFunction from .project_config_function_openapi_spec_type_0 import ProjectConfigFunctionOpenapiSpecType0 from .project_config_function_variable_scope import ProjectConfigFunctionVariableScope from .project_config_hosted_page import ProjectConfigHostedPage from .project_config_hosted_pages import ProjectConfigHostedPages +from .project_config_lava_flow import ProjectConfigLavaFlow from .project_config_missing_resource import ProjectConfigMissingResource from .project_config_missing_resource_type import ProjectConfigMissingResourceType +from .project_config_notifications import ProjectConfigNotifications from .project_config_o_auth_provider import ProjectConfigOAuthProvider from .project_config_o_auth_provider_provider import ProjectConfigOAuthProviderProvider from .project_config_project import ProjectConfigProject @@ -501,6 +709,8 @@ from .project_git_connection import ProjectGitConnection from .project_git_connection_summary import ProjectGitConnectionSummary from .project_git_deploy_settings import ProjectGitDeploySettings +from .project_git_owner_push import ProjectGitOwnerPush +from .project_git_owner_push_reason import ProjectGitOwnerPushReason from .project_health_category import ProjectHealthCategory from .project_health_check import ProjectHealthCheck from .project_health_data_status import ProjectHealthDataStatus @@ -523,11 +733,20 @@ from .project_import_report import ProjectImportReport from .project_import_resource import ProjectImportResource from .project_import_resource_kind import ProjectImportResourceKind +from .project_import_root_candidate import ProjectImportRootCandidate +from .project_import_root_candidate_reason import ProjectImportRootCandidateReason from .project_import_run import ProjectImportRun from .project_import_run_status import ProjectImportRunStatus +from .project_import_scanned_frontend import ProjectImportScannedFrontend +from .project_import_scanned_function import ProjectImportScannedFunction +from .project_import_scanned_function_kind import ProjectImportScannedFunctionKind +from .project_import_scanned_migrations import ProjectImportScannedMigrations +from .project_import_source_scan import ProjectImportSourceScan from .project_import_start_request import ProjectImportStartRequest from .project_import_summary import ProjectImportSummary from .project_import_target import ProjectImportTarget +from .project_import_unsupported_item import ProjectImportUnsupportedItem +from .project_import_variable import ProjectImportVariable from .project_lock_lease import ProjectLockLease from .project_lock_lease_request import ProjectLockLeaseRequest from .project_lock_state import ProjectLockState @@ -554,15 +773,22 @@ from .project_status import ProjectStatus from .project_template_installation import ProjectTemplateInstallation from .project_template_installation_phase import ProjectTemplateInstallationPhase +from .project_template_installation_source import ProjectTemplateInstallationSource +from .project_template_installation_source_kind import ProjectTemplateInstallationSourceKind from .project_template_installation_status import ProjectTemplateInstallationStatus from .project_usage_response import ProjectUsageResponse +from .promote_frontend_candidate_body import PromoteFrontendCandidateBody from .publish_durable_message_request import PublishDurableMessageRequest from .publish_sandbox_preset_request import PublishSandboxPresetRequest from .publish_sandbox_preset_request_memory_mb import PublishSandboxPresetRequestMemoryMb from .publish_sandbox_preset_request_preset import PublishSandboxPresetRequestPreset from .realtime_config import RealtimeConfig from .realtime_plan_limits import RealtimePlanLimits +from .realtime_publish_request import RealtimePublishRequest +from .realtime_publish_result import RealtimePublishResult from .realtime_stats import RealtimeStats +from .redeploy_frontend_candidate_body import RedeployFrontendCandidateBody +from .redeploy_function_candidate_body import RedeployFunctionCandidateBody from .refresh_o_auth_provider_token_provider import RefreshOAuthProviderTokenProvider from .refresh_o_auth_provider_token_response_200 import RefreshOAuthProviderTokenResponse200 from .register_durable_callback_request import RegisterDurableCallbackRequest @@ -576,6 +802,7 @@ from .resolve_function_response import ResolveFunctionResponse from .resource_reference import ResourceReference from .resource_reference_type import ResourceReferenceType +from .rollback_frontend_serving_body import RollbackFrontendServingBody from .sandbox_access import SandboxAccess from .sandbox_access_request import SandboxAccessRequest from .sandbox_build_log_page import SandboxBuildLogPage @@ -588,15 +815,32 @@ from .sandbox_deployment import SandboxDeployment from .sandbox_deployment_page import SandboxDeploymentPage from .sandbox_execution_result import SandboxExecutionResult +from .sandbox_file_archive import SandboxFileArchive +from .sandbox_file_archive_form import SandboxFileArchiveForm +from .sandbox_file_entry import SandboxFileEntry +from .sandbox_file_entry_sha_256_skipped import SandboxFileEntrySha256Skipped +from .sandbox_file_entry_type import SandboxFileEntryType +from .sandbox_file_list_result import SandboxFileListResult +from .sandbox_file_part import SandboxFilePart +from .sandbox_file_part_request import SandboxFilePartRequest from .sandbox_file_read_request import SandboxFileReadRequest from .sandbox_file_result import SandboxFileResult from .sandbox_file_write_request import SandboxFileWriteRequest +from .sandbox_limits_applied import SandboxLimitsApplied from .sandbox_pagination import SandboxPagination from .sandbox_preset import SandboxPreset from .sandbox_preset_list import SandboxPresetList from .sandbox_preset_memory_mb import SandboxPresetMemoryMb from .sandbox_session import SandboxSession +from .sandbox_session_applied_limits import SandboxSessionAppliedLimits from .sandbox_session_desired_state import SandboxSessionDesiredState +from .sandbox_session_executions import SandboxSessionExecutions +from .sandbox_session_limits import SandboxSessionLimits +from .sandbox_session_network import SandboxSessionNetwork +from .sandbox_session_network_applied import SandboxSessionNetworkApplied +from .sandbox_session_network_egress import SandboxSessionNetworkEgress +from .sandbox_session_network_request import SandboxSessionNetworkRequest +from .sandbox_session_network_request_egress import SandboxSessionNetworkRequestEgress from .sandbox_session_page import SandboxSessionPage from .sandbox_session_state import SandboxSessionState from .sandbox_subject_grant_request import SandboxSubjectGrantRequest @@ -605,9 +849,46 @@ from .sandbox_template_status import SandboxTemplateStatus from .schedule_request import ScheduleRequest from .schedule_request_kind import ScheduleRequestKind +from .scheduler_failure_alert_policy import SchedulerFailureAlertPolicy +from .scheduler_failure_notify_on import SchedulerFailureNotifyOn from .send_durable_message_request import SendDurableMessageRequest from .service_key import ServiceKey from .set_project_git_production_branch_request import SetProjectGitProductionBranchRequest +from .set_project_git_root_directory_request import SetProjectGitRootDirectoryRequest +from .share import Share +from .share_create_request import ShareCreateRequest +from .share_daily_count import ShareDailyCount +from .share_daily_count_kind import ShareDailyCountKind +from .share_draft_changed_error import ShareDraftChangedError +from .share_draft_changed_error_code import ShareDraftChangedErrorCode +from .share_kind_count import ShareKindCount +from .share_kind_count_kind import ShareKindCountKind +from .share_preview import SharePreview +from .share_preview_release import SharePreviewRelease +from .share_release import ShareRelease +from .share_release_create_request import ShareReleaseCreateRequest +from .share_release_draft import ShareReleaseDraft +from .share_release_draft_frontend_variables import ShareReleaseDraftFrontendVariables +from .share_release_function import ShareReleaseFunction +from .share_release_function_kind import ShareReleaseFunctionKind +from .share_release_function_variable_scope import ShareReleaseFunctionVariableScope +from .share_release_omission import ShareReleaseOmission +from .share_release_omission_kind import ShareReleaseOmissionKind +from .share_release_ref import ShareReleaseRef +from .share_stats import ShareStats +from .share_status import ShareStatus +from .share_update_request import ShareUpdateRequest +from .share_update_request_status import ShareUpdateRequestStatus +from .share_variable import ShareVariable +from .shared_variables_replace_result import SharedVariablesReplaceResult +from .shares_response import SharesResponse +from .skipped_served_function import SkippedServedFunction +from .slack_authorization_response import SlackAuthorizationResponse +from .slack_channel import SlackChannel +from .slack_channels_response import SlackChannelsResponse +from .slack_connection import SlackConnection +from .slack_connections_response import SlackConnectionsResponse +from .slack_connector import SlackConnector from .start_git_connect_provider import StartGitConnectProvider from .storage_bucket import StorageBucket from .storage_copy_request import StorageCopyRequest @@ -632,23 +913,29 @@ from .update_auth_hosted_page_request import UpdateAuthHostedPageRequest from .update_auth_page_layout_request import UpdateAuthPageLayoutRequest from .update_auth_page_theme_request import UpdateAuthPageThemeRequest -from .update_autofix_settings_request import UpdateAutofixSettingsRequest from .update_database_branch_request import UpdateDatabaseBranchRequest from .update_database_type_request import UpdateDatabaseTypeRequest from .update_database_type_request_database_type import UpdateDatabaseTypeRequestDatabaseType from .update_email_template_request import UpdateEmailTemplateRequest from .update_email_template_type import UpdateEmailTemplateType +from .update_frontend_custom_domain_request import UpdateFrontendCustomDomainRequest from .update_function_request import UpdateFunctionRequest from .update_function_request_openapi_spec_type_0 import UpdateFunctionRequestOpenapiSpecType0 from .update_function_scheduler_request import UpdateFunctionSchedulerRequest from .update_function_scheduler_request_payload import UpdateFunctionSchedulerRequestPayload from .update_issue_request import UpdateIssueRequest +from .update_notification_email import UpdateNotificationEmail +from .update_notification_settings_request import UpdateNotificationSettingsRequest +from .update_notification_webhook import UpdateNotificationWebhook from .update_o_auth_config_provider import UpdateOAuthConfigProvider from .update_o_auth_config_request import UpdateOAuthConfigRequest from .update_project_git_deploy_settings_request import UpdateProjectGitDeploySettingsRequest from .update_project_request import UpdateProjectRequest from .update_realtime_config_request import UpdateRealtimeConfigRequest +from .update_sandbox_session_activity_body import UpdateSandboxSessionActivityBody +from .update_sandbox_session_activity_body_activity import UpdateSandboxSessionActivityBodyActivity from .update_sandbox_template_request import UpdateSandboxTemplateRequest +from .update_scheduler_failure_alert_policy import UpdateSchedulerFailureAlertPolicy from .update_storage_bucket_request import UpdateStorageBucketRequest from .update_variable_request import UpdateVariableRequest from .upload_project_logo_body import UploadProjectLogoBody @@ -668,6 +955,13 @@ from .verify_domain_request import VerifyDomainRequest __all__ = ( + "AccountSession", + "AccountSessionKind", + "AccountSessionList", + "AikidoConnector", + "AikidoConnectorCreate", + "AikidoRegion", + "AikidoSeverity", "AnonKey", "AuthCancelEmailChangeResponse200", "AuthConfig", @@ -758,23 +1052,6 @@ "AuthUserAppMetadata", "AuthUserStatus", "AuthUserUserMetadata", - "AutofixDiagnosis", - "AutofixDiagnosisConfidence", - "AutofixEdit", - "AutofixEvidence", - "AutofixEvidenceKind", - "AutofixModel", - "AutofixPatch", - "AutofixProvider", - "AutofixPullRequest", - "AutofixPullRequestSkipped", - "AutofixPullRequestState", - "AutofixRun", - "AutofixRunStatus", - "AutofixRunTrigger", - "AutofixRunUsage", - "AutofixSettings", - "AutofixStage", "BanAuthUserBody", "BanUserResponse", "BanUserResponseStatus", @@ -802,6 +1079,11 @@ "CompleteUploadSessionResponse", "ConfigureAuthMethodsBody", "ConfigureAuthMethodsBodyOauthProvidersItem", + "Connector", + "ConnectorCreate", + "ConnectorCreateType", + "ConnectorsResponse", + "ConnectorType", "ConnectProjectGitRequest", "CreateAnonKeyBody", "CreateAnonKeyBodyPermissionsItem", @@ -820,14 +1102,21 @@ "CreateFrontendBody", "CreateFrontendBodyFramework", "CreateFrontendBodyVariableScope", + "CreateFrontendCandidateBody", "CreateFrontendCustomDomainRequest", + "CreateFrontendDeploymentRequest", + "CreateFrontendDomainRequest", "CreateFrontendFunctionRouteRequest", + "CreateFrontendRouteRequest", "CreateFunctionBody", "CreateFunctionBodyRuntime", "CreateFunctionBodyVariableScope", + "CreateFunctionCandidateBody", "CreateFunctionsBatchBody", "CreateFunctionSchedulerRequest", "CreateFunctionSchedulerRequestPayload", + "CreateGitDeploymentRunRequest", + "CreateIssueRequest", "CreateOAuthConfigRequest", "CreateOAuthConfigRequestProvider", "CreateProjectAccessTokenRequest", @@ -858,6 +1147,25 @@ "DatabaseDeleteRequest", "DatabaseInsertRequest", "DatabaseInsertRequestValues", + "DatabaseMigrationBaseline", + "DatabaseMigrationConflictError", + "DatabaseMigrationFile", + "DatabaseMigrationFileError", + "DatabaseMigrationFilesRequest", + "DatabaseMigrationHistoryEntry", + "DatabaseMigrationHistoryEntryStatus", + "DatabaseMigrationRun", + "DatabaseMigrationRunError", + "DatabaseMigrationRunErrorCode", + "DatabaseMigrationRunFile", + "DatabaseMigrationRunFileOutcome", + "DatabaseMigrationRunList", + "DatabaseMigrationRunPhase", + "DatabaseMigrationRunSource", + "DatabaseMigrationRunStatus", + "DatabaseMigrations", + "DatabaseMigrationWarning", + "DatabaseMigrationWarningCode", "DatabaseQueryFilter", "DatabaseQueryFilterOperator", "DatabaseQueryOrder", @@ -867,6 +1175,7 @@ "DatabaseQueryResult", "DatabaseQueryResultDataItem", "DatabaseRestore", + "DatabaseRestoreConflictError", "DatabaseRestoreKind", "DatabaseRestoreList", "DatabaseRestoreStatus", @@ -877,11 +1186,15 @@ "DatabaseStatus", "DatabaseUpdateRequest", "DatabaseUpdateRequestValues", + "DefaultEmailTemplate", + "DefaultEmailTemplateType", "DeleteDatabaseBackupResponse200", "DeleteDatabaseBranchResponse202", "DeleteDatabaseResponse202", "DeleteEmailTemplateType", "DeleteOAuthConfigProvider", + "DeploymentCommit", + "DeploymentCommitVerification", "DeploymentPhase", "DeploymentPhaseName", "DeploymentPhaseStatus", @@ -937,8 +1250,21 @@ "Error", "ExportProjectSourceRequest", "FailDurableCallbackRequest", + "ForkCreateRequest", + "ForkCreateRequestVariables", "Frontend", + "FrontendCandidate", + "FrontendCandidateConfigurationStatus", + "FrontendCandidateDeployment", + "FrontendCandidateDeploymentStatus", + "FrontendCandidateList", + "FrontendCandidateStatus", "FrontendCustomDomainConflictError", + "FrontendCustomDomainList", + "FrontendCustomDomainRedirect", + "FrontendCustomDomainRedirectRequest", + "FrontendCustomDomainRedirectRequestStatus", + "FrontendCustomDomainRedirectStatus", "FrontendCustomDomainResponse", "FrontendCustomDomainResponseDomainStatus", "FrontendCustomDomainResponseServingCertificate", @@ -957,17 +1283,30 @@ "FrontendFramework", "FrontendFunctionRoute", "FrontendFunctionRouteList", + "FrontendRoute", + "FrontendRouteList", + "FrontendServing", "FrontendStatus", "FrontendUsageDailyEntry", "FrontendUsageData", "FrontendUsageHistoryResponse", "FrontendVariableScope", "Function", + "FunctionCandidate", + "FunctionCandidateConfigurationStatus", + "FunctionCandidateDeployment", + "FunctionCandidateDeploymentList", + "FunctionCandidateDeploymentOperation", + "FunctionCandidateDeploymentStatus", + "FunctionCandidateExposure", + "FunctionCandidateList", + "FunctionCandidateStatus", "FunctionDeployment", "FunctionDeploymentDeploySource", "FunctionDeploymentOperation", "FunctionDeploymentStatus", "FunctionHTTPAuthMode", + "FunctionImageDigest", "FunctionInvocationMode", "FunctionInvocationRequest", "FunctionInvocationRequestPayload", @@ -975,14 +1314,24 @@ "FunctionKind", "FunctionKindFilter", "FunctionOpenapiSpecType0", + "FunctionProductionEnvironment", + "FunctionProductionEnvironmentStatus", + "FunctionPromotionRequest", "FunctionRegion", + "FunctionRollbackRequest", "FunctionRuntimeDeployment", "FunctionRuntimeOption", "FunctionRuntimesResponse", "FunctionScheduler", + "FunctionSchedulerHealth", + "FunctionSchedulerLastRunStatus", "FunctionSchedulerListResponse", "FunctionSchedulerPayload", "FunctionSchedulerScheduleKind", + "FunctionServing", + "FunctionServingActivation", + "FunctionServingActivationKind", + "FunctionServingActivationStatus", "FunctionStatus", "FunctionVisibility", "GetAuthMethodsResponse200", @@ -993,6 +1342,7 @@ "GetDefaultEmailTemplatesResponse200", "GetDefaultEmailTemplateType", "GetEmailTemplateType", + "GetLavaflowStatsCategory", "GetOAuthConfigProvider", "GetOAuthProviderTokenProvider", "GetOAuthProviderTokenResponse200", @@ -1000,10 +1350,15 @@ "GitConnection", "GitConnectionsResponse", "GitConnectStartResponse", + "GitDeploymentMigrationRun", + "GitDeploymentRun", + "GitDeploymentRunError", + "GitDeploymentRunStatus", "GitInstallation", "GitInstallationsResponse", "GitRepositoriesResponse", "GitRepository", + "GitRepositoryReference", "HeartbeatDurableCallbackRequest", "HostedAuthPageType", "HostedLoginEmailCheckRequest", @@ -1015,9 +1370,124 @@ "ImportConnectStartResponse", "ImportProvider", "ImportSource", + "ImportSourceRepository", "ImportSourcesResponse", "Issue", + "IssueFinding", + "IssueFindingSeverity", + "IssueSource", "IssueStatus", + "LavaflowAikidoBinding", + "LavaflowAikidoBindingTarget", + "LavaflowAllowedWorkflow", + "LavaflowAnomaly", + "LavaflowAutonomy", + "LavaflowCategoryCounts", + "LavaflowCodeQualitySettings", + "LavaflowCodeQualityUpdate", + "LavaflowCommitOrigin", + "LavaflowConnectorBinding", + "LavaflowConnectorBindingsResponse", + "LavaflowDayCounts", + "LavaflowDelivery", + "LavaflowDeliveryCoverage", + "LavaflowDeliveryCoverageState", + "LavaflowDeliverySkip", + "LavaflowDeliveryState", + "LavaflowDeliveryStats", + "LavaflowDiagnosis", + "LavaflowDraftReason", + "LavaflowFailure", + "LavaflowFixOutcome", + "LavaflowFixOutcomeState", + "LavaflowHeldFixOpen", + "LavaflowHeldWorkflows", + "LavaflowHoldReason", + "LavaflowInvolvedResource", + "LavaflowInvolvedResourceCount", + "LavaflowInvolvedResourceRolesItem", + "LavaflowIssuePrompt", + "LavaflowIssuePromptCreate", + "LavaflowIssuePromptCreateMode", + "LavaflowIssuePromptMode", + "LavaflowIssuePrompts", + "LavaflowIssuePromptStatus", + "LavaflowIssueSummary", + "LavaflowIssueSummarySeverity", + "LavaflowLineage", + "LavaflowLineageConfidence", + "LavaflowLineageEvidence", + "LavaflowLineageEvidenceConfidence", + "LavaflowLineageEvidenceDeployment", + "LavaflowLineageRelation", + "LavaflowLineageRemedy", + "LavaflowLineageState", + "LavaflowLogLine", + "LavaflowMerge", + "LavaflowMergePolicy", + "LavaflowMergePolicyUpdate", + "LavaflowMergeStatus", + "LavaflowOutcomeCounts", + "LavaflowOutcomeCoverage", + "LavaflowOutcomeCoverageEventTimeBasis", + "LavaflowOutcomeCoverageStatus", + "LavaflowOutcomeCurrent", + "LavaflowOutcomeCurrentScope", + "LavaflowOutcomeDay", + "LavaflowOutcomes", + "LavaflowOutcomesCoverage", + "LavaflowOutcomeValues", + "LavaflowProjectIssue", + "LavaflowProjectIssueState", + "LavaflowPullRequest", + "LavaflowPullRequestState", + "LavaflowPullRequestStateCounts", + "LavaflowRepositoryCheckCommand", + "LavaflowRepositoryChecks", + "LavaflowRepositoryExpectation", + "LavaflowResource", + "LavaflowResourceList", + "LavaflowResourceReference", + "LavaflowResourceReferenceType", + "LavaflowReview", + "LavaflowReviewFinding", + "LavaflowReviewFindingSeverity", + "LavaflowReviewPersonReason", + "LavaflowReviewStop", + "LavaflowReviewVerdict", + "LavaflowRun", + "LavaflowRunCategory", + "LavaflowRunCounts", + "LavaflowRunCreate", + "LavaflowRunMode", + "LavaflowRunProgress", + "LavaflowRunProgressStage", + "LavaflowRunReference", + "LavaflowRunStatus", + "LavaflowRunStatusCounts", + "LavaflowRunSummary", + "LavaflowScan", + "LavaflowScanBilledFinding", + "LavaflowScanBilledFindingBillableEvents", + "LavaflowScanCounts", + "LavaflowScanResource", + "LavaflowScanResourceResourceType", + "LavaflowScanSource", + "LavaflowScanStatus", + "LavaflowSettings", + "LavaflowSettingsUpdate", + "LavaflowSkipReason", + "LavaflowSlackBinding", + "LavaflowSlackBindingTarget", + "LavaflowSourceCommit", + "LavaflowSourceUnavailable", + "LavaflowSourceUnavailableReason", + "LavaflowStats", + "LavaflowStatsTotals", + "LavaflowTaskActivity", + "LavaflowWorkflowSource", + "ListAccountSessionsSort", + "ListAccountSessionsStatus", "ListAnonKeysResponse200", "ListAuthUsersStatus", "ListAvailableOAuthProvidersResponse200", @@ -1029,6 +1499,11 @@ "ListDeploymentsResourceType", "ListDeploymentsStatus", "ListEmailTemplatesResponse200", + "ListLavaflowResourcesCategory", + "ListLavaflowRunsCategory", + "ListLavaflowRunsIncludeItem", + "ListLavaflowRunsOrder", + "ListLavaflowRunsPullRequestState", "ListOAuthConfigsResponse200", "ListPostgresVersionsResponse200Item", "ListProjectDeploymentsResourceType", @@ -1045,6 +1520,8 @@ "LogActivityBucketCountsResourceIds", "LogActivityRequest", "LogActivityResponse", + "LogAppRequestResource", + "LogAppRequestResourceType", "LogDatabaseRequestResource", "LogDatabaseRequestResourceType", "LogDeployment", @@ -1065,13 +1542,19 @@ "ManagedProjectConfigFrontendCustomDomainTLSConfig", "ManagedProjectConfigFrontendCustomDomainTLSConfigMode", "MetricUsageData", + "NotificationEmailSettings", + "NotificationEmailStatus", + "NotificationSettings", + "NotificationTestDelivery", + "NotificationTestDeliveryChannel", + "NotificationTestResult", + "NotificationWebhookSettings", "OAuthConfig", "OAuthConfigProvider", "OAuthErrorResponse", "OpenAPISpecDocument", "OpenDurableMessageSessionRequest", "PaginatedAuthUsers", - "PaginatedAutofixRuns", "PaginatedDatabases", "PaginatedDurableApprovals", "PaginatedDurableExecutions", @@ -1080,13 +1563,19 @@ "PaginatedFrontends", "PaginatedFunctionDeployments", "PaginatedFunctions", + "PaginatedGitDeploymentRuns", "PaginatedIssues", + "PaginatedLavaflowProjectIssues", + "PaginatedLavaflowProjectIssuesRealtime", + "PaginatedLavaflowRuns", + "PaginatedLavaflowScans", "PaginatedProjectAccessTokens", "PaginatedProjectCustomDomains", "PaginatedProjectDeployments", "PaginatedProjects", "PaginatedProjectsStatus", "PaginatedServiceKeys", + "PaginatedShareReleases", "PaginatedStorageBuckets", "PaginatedVariables", "PlatformExchangeResponse", @@ -1094,6 +1583,7 @@ "PreviewAuthPageResponse", "Project", "ProjectAccessToken", + "ProjectAccessTokenListedScope", "ProjectAccessTokenScope", "ProjectAccessTokenStatus", "ProjectAccessTokenTokenSource", @@ -1123,26 +1613,31 @@ "ProjectConfigAuthSignup", "ProjectConfigAuthSignupAllowedEmailDomainsMode", "ProjectConfigAuthTokens", - "ProjectConfigAutofix", "ProjectConfigBucket", "ProjectConfigBucketPolicy", "ProjectConfigBucketPolicyOperation", "ProjectConfigCustomDomain", + "ProjectConfigCustomDomainRedirect", + "ProjectConfigCustomDomainRedirectStatus", "ProjectConfigDatabase", "ProjectConfigDatabaseDatabaseType", "ProjectConfigDatabasePgVersion", "ProjectConfigEmailTemplate", "ProjectConfigEmailTemplates", "ProjectConfigFrontend", + "ProjectConfigFrontendCustomDomain", "ProjectConfigFrontendFunctionRoute", + "ProjectConfigFrontendRoute", "ProjectConfigFrontendVariableScope", "ProjectConfigFunction", "ProjectConfigFunctionOpenapiSpecType0", "ProjectConfigFunctionVariableScope", "ProjectConfigHostedPage", "ProjectConfigHostedPages", + "ProjectConfigLavaFlow", "ProjectConfigMissingResource", "ProjectConfigMissingResourceType", + "ProjectConfigNotifications", "ProjectConfigOAuthProvider", "ProjectConfigOAuthProviderProvider", "ProjectConfigProject", @@ -1169,6 +1664,8 @@ "ProjectGitConnection", "ProjectGitConnectionSummary", "ProjectGitDeploySettings", + "ProjectGitOwnerPush", + "ProjectGitOwnerPushReason", "ProjectHealthCategory", "ProjectHealthCheck", "ProjectHealthDataStatus", @@ -1191,11 +1688,20 @@ "ProjectImportReport", "ProjectImportResource", "ProjectImportResourceKind", + "ProjectImportRootCandidate", + "ProjectImportRootCandidateReason", "ProjectImportRun", "ProjectImportRunStatus", + "ProjectImportScannedFrontend", + "ProjectImportScannedFunction", + "ProjectImportScannedFunctionKind", + "ProjectImportScannedMigrations", + "ProjectImportSourceScan", "ProjectImportStartRequest", "ProjectImportSummary", "ProjectImportTarget", + "ProjectImportUnsupportedItem", + "ProjectImportVariable", "ProjectLockLease", "ProjectLockLeaseRequest", "ProjectLockState", @@ -1222,15 +1728,22 @@ "ProjectStatus", "ProjectTemplateInstallation", "ProjectTemplateInstallationPhase", + "ProjectTemplateInstallationSource", + "ProjectTemplateInstallationSourceKind", "ProjectTemplateInstallationStatus", "ProjectUsageResponse", + "PromoteFrontendCandidateBody", "PublishDurableMessageRequest", "PublishSandboxPresetRequest", "PublishSandboxPresetRequestMemoryMb", "PublishSandboxPresetRequestPreset", "RealtimeConfig", "RealtimePlanLimits", + "RealtimePublishRequest", + "RealtimePublishResult", "RealtimeStats", + "RedeployFrontendCandidateBody", + "RedeployFunctionCandidateBody", "RefreshOAuthProviderTokenProvider", "RefreshOAuthProviderTokenResponse200", "RegisterDurableCallbackRequest", @@ -1244,6 +1757,7 @@ "ResolveFunctionResponse", "ResourceReference", "ResourceReferenceType", + "RollbackFrontendServingBody", "SandboxAccess", "SandboxAccessRequest", "SandboxBuildLogPage", @@ -1256,15 +1770,32 @@ "SandboxDeployment", "SandboxDeploymentPage", "SandboxExecutionResult", + "SandboxFileArchive", + "SandboxFileArchiveForm", + "SandboxFileEntry", + "SandboxFileEntrySha256Skipped", + "SandboxFileEntryType", + "SandboxFileListResult", + "SandboxFilePart", + "SandboxFilePartRequest", "SandboxFileReadRequest", "SandboxFileResult", "SandboxFileWriteRequest", + "SandboxLimitsApplied", "SandboxPagination", "SandboxPreset", "SandboxPresetList", "SandboxPresetMemoryMb", "SandboxSession", + "SandboxSessionAppliedLimits", "SandboxSessionDesiredState", + "SandboxSessionExecutions", + "SandboxSessionLimits", + "SandboxSessionNetwork", + "SandboxSessionNetworkApplied", + "SandboxSessionNetworkEgress", + "SandboxSessionNetworkRequest", + "SandboxSessionNetworkRequestEgress", "SandboxSessionPage", "SandboxSessionState", "SandboxSubjectGrantRequest", @@ -1273,9 +1804,46 @@ "SandboxTemplateStatus", "ScheduleRequest", "ScheduleRequestKind", + "SchedulerFailureAlertPolicy", + "SchedulerFailureNotifyOn", "SendDurableMessageRequest", "ServiceKey", "SetProjectGitProductionBranchRequest", + "SetProjectGitRootDirectoryRequest", + "Share", + "ShareCreateRequest", + "ShareDailyCount", + "ShareDailyCountKind", + "ShareDraftChangedError", + "ShareDraftChangedErrorCode", + "SharedVariablesReplaceResult", + "ShareKindCount", + "ShareKindCountKind", + "SharePreview", + "SharePreviewRelease", + "ShareRelease", + "ShareReleaseCreateRequest", + "ShareReleaseDraft", + "ShareReleaseDraftFrontendVariables", + "ShareReleaseFunction", + "ShareReleaseFunctionKind", + "ShareReleaseFunctionVariableScope", + "ShareReleaseOmission", + "ShareReleaseOmissionKind", + "ShareReleaseRef", + "SharesResponse", + "ShareStats", + "ShareStatus", + "ShareUpdateRequest", + "ShareUpdateRequestStatus", + "ShareVariable", + "SkippedServedFunction", + "SlackAuthorizationResponse", + "SlackChannel", + "SlackChannelsResponse", + "SlackConnection", + "SlackConnectionsResponse", + "SlackConnector", "StartGitConnectProvider", "StorageBucket", "StorageCopyRequest", @@ -1300,23 +1868,29 @@ "UpdateAuthHostedPageRequest", "UpdateAuthPageLayoutRequest", "UpdateAuthPageThemeRequest", - "UpdateAutofixSettingsRequest", "UpdateDatabaseBranchRequest", "UpdateDatabaseTypeRequest", "UpdateDatabaseTypeRequestDatabaseType", "UpdateEmailTemplateRequest", "UpdateEmailTemplateType", + "UpdateFrontendCustomDomainRequest", "UpdateFunctionRequest", "UpdateFunctionRequestOpenapiSpecType0", "UpdateFunctionSchedulerRequest", "UpdateFunctionSchedulerRequestPayload", "UpdateIssueRequest", + "UpdateNotificationEmail", + "UpdateNotificationSettingsRequest", + "UpdateNotificationWebhook", "UpdateOAuthConfigProvider", "UpdateOAuthConfigRequest", "UpdateProjectGitDeploySettingsRequest", "UpdateProjectRequest", "UpdateRealtimeConfigRequest", + "UpdateSandboxSessionActivityBody", + "UpdateSandboxSessionActivityBodyActivity", "UpdateSandboxTemplateRequest", + "UpdateSchedulerFailureAlertPolicy", "UpdateStorageBucketRequest", "UpdateVariableRequest", "UploadProjectLogoBody", diff --git a/src/volcano_sdk/_generated/models/account_session.py b/src/volcano_sdk/_generated/models/account_session.py new file mode 100644 index 00000000..953e9f69 --- /dev/null +++ b/src/volcano_sdk/_generated/models/account_session.py @@ -0,0 +1,254 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.account_session_kind import AccountSessionKind +from ..models.account_session_kind import check_account_session_kind +from ..types import UNSET, Unset +from typing import cast +from uuid import UUID +import datetime + + + + + + +T = TypeVar("T", bound="AccountSession") + + + +@_attrs_define +class AccountSession: + """ A sign-in to your Volcano account, from the CLI or a browser. + + Attributes: + id (UUID): Unique session identifier + user_id (UUID): The sign-in identity (auth user) the session belongs to. This is + not your account ID: an identity linked to your account has its + own ID. + provider (str): How the session was created: `email`, `google`, `github`, + `microsoft`, `apple`, or `device:` for a device-code + login such as the `volcano` CLI. More values may be added; use + `kind` to tell CLI logins from browser sign-ins. + Example: github. + kind (AccountSessionKind): `cli` for a device-code login, such as `volcano login`, and + `browser` for every other sign-in. + Example: cli. + expires_at (datetime.datetime): When this session expires + is_active (bool): Whether the session is currently active (not expired) + is_current (bool): Whether this is the session making the current request + user_agent (str | Unset): Browser/device user agent string + ip_address (str | Unset): IP address of the client when the session was created + last_ip_address (str | Unset): IP address of the most recent activity (token refresh) + last_activity_at (datetime.datetime | Unset): Last activity timestamp + session_started_at (datetime.datetime | Unset): When the session was created + created_at (datetime.datetime | Unset): + updated_at (datetime.datetime | Unset): + """ + + id: UUID + user_id: UUID + provider: str + kind: AccountSessionKind + expires_at: datetime.datetime + is_active: bool + is_current: bool + user_agent: str | Unset = UNSET + ip_address: str | Unset = UNSET + last_ip_address: str | Unset = UNSET + last_activity_at: datetime.datetime | Unset = UNSET + session_started_at: datetime.datetime | Unset = UNSET + created_at: datetime.datetime | Unset = UNSET + updated_at: datetime.datetime | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + id = str(self.id) + + user_id = str(self.user_id) + + provider = self.provider + + kind: str = self.kind + + expires_at = self.expires_at.isoformat() + + is_active = self.is_active + + is_current = self.is_current + + user_agent = self.user_agent + + ip_address = self.ip_address + + last_ip_address = self.last_ip_address + + last_activity_at: str | Unset = UNSET + if not isinstance(self.last_activity_at, Unset): + last_activity_at = self.last_activity_at.isoformat() + + session_started_at: str | Unset = UNSET + if not isinstance(self.session_started_at, Unset): + session_started_at = self.session_started_at.isoformat() + + created_at: str | Unset = UNSET + if not isinstance(self.created_at, Unset): + created_at = self.created_at.isoformat() + + updated_at: str | Unset = UNSET + if not isinstance(self.updated_at, Unset): + updated_at = self.updated_at.isoformat() + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "id": id, + "user_id": user_id, + "provider": provider, + "kind": kind, + "expires_at": expires_at, + "is_active": is_active, + "is_current": is_current, + }) + if user_agent is not UNSET: + field_dict["user_agent"] = user_agent + if ip_address is not UNSET: + field_dict["ip_address"] = ip_address + if last_ip_address is not UNSET: + field_dict["last_ip_address"] = last_ip_address + if last_activity_at is not UNSET: + field_dict["last_activity_at"] = last_activity_at + if session_started_at is not UNSET: + field_dict["session_started_at"] = session_started_at + if created_at is not UNSET: + field_dict["created_at"] = created_at + if updated_at is not UNSET: + field_dict["updated_at"] = updated_at + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = UUID(d.pop("id")) + + + + + user_id = UUID(d.pop("user_id")) + + + + + provider = d.pop("provider") + + kind = check_account_session_kind(d.pop("kind")) + + + + + expires_at = datetime.datetime.fromisoformat(d.pop("expires_at")) + + + + + is_active = d.pop("is_active") + + is_current = d.pop("is_current") + + user_agent = d.pop("user_agent", UNSET) + + ip_address = d.pop("ip_address", UNSET) + + last_ip_address = d.pop("last_ip_address", UNSET) + + _last_activity_at = d.pop("last_activity_at", UNSET) + last_activity_at: datetime.datetime | Unset + if isinstance(_last_activity_at, Unset): + last_activity_at = UNSET + else: + last_activity_at = datetime.datetime.fromisoformat(_last_activity_at) + + + + + _session_started_at = d.pop("session_started_at", UNSET) + session_started_at: datetime.datetime | Unset + if isinstance(_session_started_at, Unset): + session_started_at = UNSET + else: + session_started_at = datetime.datetime.fromisoformat(_session_started_at) + + + + + _created_at = d.pop("created_at", UNSET) + created_at: datetime.datetime | Unset + if isinstance(_created_at, Unset): + created_at = UNSET + else: + created_at = datetime.datetime.fromisoformat(_created_at) + + + + + _updated_at = d.pop("updated_at", UNSET) + updated_at: datetime.datetime | Unset + if isinstance(_updated_at, Unset): + updated_at = UNSET + else: + updated_at = datetime.datetime.fromisoformat(_updated_at) + + + + + account_session = cls( + id=id, + user_id=user_id, + provider=provider, + kind=kind, + expires_at=expires_at, + is_active=is_active, + is_current=is_current, + user_agent=user_agent, + ip_address=ip_address, + last_ip_address=last_ip_address, + last_activity_at=last_activity_at, + session_started_at=session_started_at, + created_at=created_at, + updated_at=updated_at, + ) + + + account_session.additional_properties = d + return account_session + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/account_session_kind.py b/src/volcano_sdk/_generated/models/account_session_kind.py new file mode 100644 index 00000000..1971e75d --- /dev/null +++ b/src/volcano_sdk/_generated/models/account_session_kind.py @@ -0,0 +1,10 @@ +from typing import Literal + +AccountSessionKind = Literal['browser', 'cli'] + +ACCOUNT_SESSION_KIND_VALUES: set[AccountSessionKind] = { 'browser', 'cli', } + +def check_account_session_kind(value: str) -> AccountSessionKind: + if value in ACCOUNT_SESSION_KIND_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {ACCOUNT_SESSION_KIND_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/account_session_list.py b/src/volcano_sdk/_generated/models/account_session_list.py new file mode 100644 index 00000000..21a80b9c --- /dev/null +++ b/src/volcano_sdk/_generated/models/account_session_list.py @@ -0,0 +1,193 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.account_session import AccountSession + + + + + +T = TypeVar("T", bound="AccountSessionList") + + + +@_attrs_define +class AccountSessionList: + """ A page of sessions. Without `sort` the body is the legacy + `sessions`/`total`/`page`/`limit`/`total_pages` shape; with + `sort=created_at` and a cursor it is the shared `data` envelope. + + Attributes: + sessions (list[AccountSession] | Unset): + total (int | Unset): Total number of sessions + page (int | Unset): Current page number + limit (int | Unset): Number of sessions per page + total_pages (int | Unset): Total number of pages + data (list[AccountSession] | Unset): Sessions for this page (cursor pagination only) + has_more (bool | Unset): Whether a further page exists (cursor pagination only) + next_cursor (str | Unset): Opaque cursor for the next page (cursor pagination only) + prev_cursor (str | Unset): Opaque cursor for the previous page (cursor pagination only). Send as + `ending_before`. + """ + + sessions: list[AccountSession] | Unset = UNSET + total: int | Unset = UNSET + page: int | Unset = UNSET + limit: int | Unset = UNSET + total_pages: int | Unset = UNSET + data: list[AccountSession] | Unset = UNSET + has_more: bool | Unset = UNSET + next_cursor: str | Unset = UNSET + prev_cursor: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.account_session import AccountSession # noqa: PLC0415 + sessions: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.sessions, Unset): + sessions = [] + for sessions_item_data in self.sessions: + sessions_item = sessions_item_data.to_dict() + sessions.append(sessions_item) + + + + total = self.total + + page = self.page + + limit = self.limit + + total_pages = self.total_pages + + data: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.data, Unset): + data = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + + + has_more = self.has_more + + next_cursor = self.next_cursor + + prev_cursor = self.prev_cursor + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + }) + if sessions is not UNSET: + field_dict["sessions"] = sessions + if total is not UNSET: + field_dict["total"] = total + if page is not UNSET: + field_dict["page"] = page + if limit is not UNSET: + field_dict["limit"] = limit + if total_pages is not UNSET: + field_dict["total_pages"] = total_pages + if data is not UNSET: + field_dict["data"] = data + if has_more is not UNSET: + field_dict["has_more"] = has_more + if next_cursor is not UNSET: + field_dict["next_cursor"] = next_cursor + if prev_cursor is not UNSET: + field_dict["prev_cursor"] = prev_cursor + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.account_session import AccountSession # noqa: PLC0415 + d = dict(src_dict) + _sessions = d.pop("sessions", UNSET) + sessions: list[AccountSession] | Unset = UNSET + if _sessions is not UNSET: + sessions = [] + for sessions_item_data in _sessions: + sessions_item = AccountSession.from_dict(sessions_item_data) + + + + sessions.append(sessions_item) + + + total = d.pop("total", UNSET) + + page = d.pop("page", UNSET) + + limit = d.pop("limit", UNSET) + + total_pages = d.pop("total_pages", UNSET) + + _data = d.pop("data", UNSET) + data: list[AccountSession] | Unset = UNSET + if _data is not UNSET: + data = [] + for data_item_data in _data: + data_item = AccountSession.from_dict(data_item_data) + + + + data.append(data_item) + + + has_more = d.pop("has_more", UNSET) + + next_cursor = d.pop("next_cursor", UNSET) + + prev_cursor = d.pop("prev_cursor", UNSET) + + account_session_list = cls( + sessions=sessions, + total=total, + page=page, + limit=limit, + total_pages=total_pages, + data=data, + has_more=has_more, + next_cursor=next_cursor, + prev_cursor=prev_cursor, + ) + + + account_session_list.additional_properties = d + return account_session_list + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/aikido_connector.py b/src/volcano_sdk/_generated/models/aikido_connector.py new file mode 100644 index 00000000..bfda64e8 --- /dev/null +++ b/src/volcano_sdk/_generated/models/aikido_connector.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.aikido_region import AikidoRegion +from ..models.aikido_region import check_aikido_region +from typing import cast + + + + + + +T = TypeVar("T", bound="AikidoConnector") + + + +@_attrs_define +class AikidoConnector: + """ An `aikido` connector's workspace. Present when `type` is `aikido`. + + Attributes: + region (AikidoRegion): The Aikido region the workspace lives in: `eu` for app.aikido.dev, `us` for + app.us.aikido.dev, `au` for app.au.aikido.dev, and `me` for app.me.aikido.dev. + workspace_id (int): The workspace's ID in Aikido, which its webhook deliveries name. + """ + + region: AikidoRegion + workspace_id: int + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + region: str = self.region + + workspace_id = self.workspace_id + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "region": region, + "workspace_id": workspace_id, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + region = check_aikido_region(d.pop("region")) + + + + + workspace_id = d.pop("workspace_id") + + aikido_connector = cls( + region=region, + workspace_id=workspace_id, + ) + + + aikido_connector.additional_properties = d + return aikido_connector + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/aikido_connector_create.py b/src/volcano_sdk/_generated/models/aikido_connector_create.py new file mode 100644 index 00000000..caec4a70 --- /dev/null +++ b/src/volcano_sdk/_generated/models/aikido_connector_create.py @@ -0,0 +1,90 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.aikido_region import AikidoRegion +from ..models.aikido_region import check_aikido_region +from typing import cast + + + + + + +T = TypeVar("T", bound="AikidoConnectorCreate") + + + +@_attrs_define +class AikidoConnectorCreate: + """ The Aikido workspace's REST API client and webhook signing secret. + + Attributes: + region (AikidoRegion): The Aikido region the workspace lives in: `eu` for app.aikido.dev, `us` for + app.us.aikido.dev, `au` for app.au.aikido.dev, and `me` for app.me.aikido.dev. + client_id (str): + client_secret (str): + webhook_secret (str): The signing secret from Aikido's webhooks page, which verifies its deliveries. + """ + + region: AikidoRegion + client_id: str + client_secret: str + webhook_secret: str + + + + + + def to_dict(self) -> dict[str, Any]: + region: str = self.region + + client_id = self.client_id + + client_secret = self.client_secret + + webhook_secret = self.webhook_secret + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "region": region, + "client_id": client_id, + "client_secret": client_secret, + "webhook_secret": webhook_secret, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + region = check_aikido_region(d.pop("region")) + + + + + client_id = d.pop("client_id") + + client_secret = d.pop("client_secret") + + webhook_secret = d.pop("webhook_secret") + + aikido_connector_create = cls( + region=region, + client_id=client_id, + client_secret=client_secret, + webhook_secret=webhook_secret, + ) + + return aikido_connector_create + diff --git a/src/volcano_sdk/_generated/models/aikido_region.py b/src/volcano_sdk/_generated/models/aikido_region.py new file mode 100644 index 00000000..17a06811 --- /dev/null +++ b/src/volcano_sdk/_generated/models/aikido_region.py @@ -0,0 +1,10 @@ +from typing import Literal + +AikidoRegion = Literal['au', 'eu', 'me', 'us'] + +AIKIDO_REGION_VALUES: set[AikidoRegion] = { 'au', 'eu', 'me', 'us', } + +def check_aikido_region(value: str) -> AikidoRegion: + if value in AIKIDO_REGION_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {AIKIDO_REGION_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/aikido_severity.py b/src/volcano_sdk/_generated/models/aikido_severity.py new file mode 100644 index 00000000..8f5514e5 --- /dev/null +++ b/src/volcano_sdk/_generated/models/aikido_severity.py @@ -0,0 +1,10 @@ +from typing import Literal + +AikidoSeverity = Literal['critical', 'high', 'low', 'medium'] + +AIKIDO_SEVERITY_VALUES: set[AikidoSeverity] = { 'critical', 'high', 'low', 'medium', } + +def check_aikido_severity(value: str) -> AikidoSeverity: + if value in AIKIDO_SEVERITY_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {AIKIDO_SEVERITY_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/auth_config.py b/src/volcano_sdk/_generated/models/auth_config.py index f096393d..c6c80f50 100644 --- a/src/volcano_sdk/_generated/models/auth_config.py +++ b/src/volcano_sdk/_generated/models/auth_config.py @@ -82,6 +82,12 @@ class AuthConfig: max_password_history (int | Unset): Number of previous passwords to remember (0=disabled) Default: 0. cors_allow_credentials (bool | Unset): Allow credentials in CORS requests Default: True. cors_max_age (int | Unset): CORS preflight cache duration (seconds) Default: 86400. + cors_allow_frontend_previews (bool | Unset): Allow the exact origins of the project's own live frontend previews + in its CORS checks, in addition to `cors_allowed_origins`. A preview's origin stops being allowed within seconds + of the preview being deleted or expiring, with no configuration change. Default: False. + frontend_preview_origins (list[str] | Unset): Origins of the project's live frontend previews that its CORS + checks currently allow. Empty unless `cors_allow_frontend_previews` is true. Omitted when the live previews + could not be read; the rest of the response, and any update it answers, is unaffected. require_email_confirmation (bool | Unset): Require users to confirm email before sign-in. Can only be true when email_enabled is true. Default: False. email_confirmation_timeout (int | Unset): Email confirmation token expiry in seconds. Default: 86400. @@ -89,9 +95,16 @@ class AuthConfig: the same email instead of returning a conflict. Requires require_email_confirmation to be true. Default: False. email_enabled (bool | Unset): Enable transactional email sending (confirmation, reset, change notifications). Must be true when require_email_confirmation is true. Default: False. - email_from_address (str | Unset): - email_from_name (str | Unset): - smtp_host (str | Unset): + email_from_address (str | Unset): Sender email address. New or changed values containing carriage returns or + newlines return 400. Unchanged stored or exported values are preserved. Leading and trailing whitespace in + previously saved settings is trimmed in responses and exports, and ignored when sending. + email_from_name (str | Unset): Sender display name; supports punctuation and Unicode. New or changed values + containing carriage returns or newlines return 400. Unchanged stored or exported values are preserved. Leading + and trailing whitespace in previously saved settings is trimmed in responses and exports, and ignored when + sending. + smtp_host (str | Unset): SMTP server host name or IP address. Outside local mode, Volcano connects only to + public internet addresses, and a host that is, or resolves to, a loopback, private, link-local, or other non- + public address fails delivery. smtp_port (int | Unset): Default: 587. smtp_username (str | Unset): smtp_password_configured (bool | Unset): Whether an SMTP password is configured. The password itself is never @@ -144,6 +157,8 @@ class AuthConfig: max_password_history: int | Unset = 0 cors_allow_credentials: bool | Unset = True cors_max_age: int | Unset = 86400 + cors_allow_frontend_previews: bool | Unset = False + frontend_preview_origins: list[str] | Unset = UNSET require_email_confirmation: bool | Unset = False email_confirmation_timeout: int | Unset = 86400 auto_link_verified_oauth: bool | Unset = False @@ -244,6 +259,14 @@ def to_dict(self) -> dict[str, Any]: cors_max_age = self.cors_max_age + cors_allow_frontend_previews = self.cors_allow_frontend_previews + + frontend_preview_origins: list[str] | Unset = UNSET + if not isinstance(self.frontend_preview_origins, Unset): + frontend_preview_origins = self.frontend_preview_origins + + + require_email_confirmation = self.require_email_confirmation email_confirmation_timeout = self.email_confirmation_timeout @@ -356,6 +379,10 @@ def to_dict(self) -> dict[str, Any]: field_dict["cors_allow_credentials"] = cors_allow_credentials if cors_max_age is not UNSET: field_dict["cors_max_age"] = cors_max_age + if cors_allow_frontend_previews is not UNSET: + field_dict["cors_allow_frontend_previews"] = cors_allow_frontend_previews + if frontend_preview_origins is not UNSET: + field_dict["frontend_preview_origins"] = frontend_preview_origins if require_email_confirmation is not UNSET: field_dict["require_email_confirmation"] = require_email_confirmation if email_confirmation_timeout is not UNSET: @@ -486,6 +513,11 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: cors_max_age = d.pop("cors_max_age", UNSET) + cors_allow_frontend_previews = d.pop("cors_allow_frontend_previews", UNSET) + + frontend_preview_origins = cast(list[str], d.pop("frontend_preview_origins", UNSET)) + + require_email_confirmation = d.pop("require_email_confirmation", UNSET) email_confirmation_timeout = d.pop("email_confirmation_timeout", UNSET) @@ -575,6 +607,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: max_password_history=max_password_history, cors_allow_credentials=cors_allow_credentials, cors_max_age=cors_max_age, + cors_allow_frontend_previews=cors_allow_frontend_previews, + frontend_preview_origins=frontend_preview_origins, require_email_confirmation=require_email_confirmation, email_confirmation_timeout=email_confirmation_timeout, auto_link_verified_oauth=auto_link_verified_oauth, diff --git a/src/volcano_sdk/_generated/models/auth_list_o_auth_providers_response_200_providers_item.py b/src/volcano_sdk/_generated/models/auth_list_o_auth_providers_response_200_providers_item.py index 4765141f..ae4ae15e 100644 --- a/src/volcano_sdk/_generated/models/auth_list_o_auth_providers_response_200_providers_item.py +++ b/src/volcano_sdk/_generated/models/auth_list_o_auth_providers_response_200_providers_item.py @@ -25,14 +25,24 @@ class AuthListOAuthProvidersResponse200ProvidersItem: """ Attributes: - provider (str | Unset): - linked_at (datetime.datetime | Unset): - updated_at (datetime.datetime | Unset): + provider (str): + provider_user_id (str): The user's account ID at the provider, as a string. + It stays the same when the user renames the account. + Example: 583231. + linked_at (datetime.datetime): + updated_at (datetime.datetime): + provider_login (str | Unset): The account's login at the provider when it was + linked, such as a GitHub username. It isn't updated + when the user renames the account. Omitted for + providers without logins. + Example: octocat. """ - provider: str | Unset = UNSET - linked_at: datetime.datetime | Unset = UNSET - updated_at: datetime.datetime | Unset = UNSET + provider: str + provider_user_id: str + linked_at: datetime.datetime + updated_at: datetime.datetime + provider_login: str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -42,25 +52,25 @@ class AuthListOAuthProvidersResponse200ProvidersItem: def to_dict(self) -> dict[str, Any]: provider = self.provider - linked_at: str | Unset = UNSET - if not isinstance(self.linked_at, Unset): - linked_at = self.linked_at.isoformat() + provider_user_id = self.provider_user_id - updated_at: str | Unset = UNSET - if not isinstance(self.updated_at, Unset): - updated_at = self.updated_at.isoformat() + linked_at = self.linked_at.isoformat() + + updated_at = self.updated_at.isoformat() + + provider_login = self.provider_login field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({ + "provider": provider, + "provider_user_id": provider_user_id, + "linked_at": linked_at, + "updated_at": updated_at, }) - if provider is not UNSET: - field_dict["provider"] = provider - if linked_at is not UNSET: - field_dict["linked_at"] = linked_at - if updated_at is not UNSET: - field_dict["updated_at"] = updated_at + if provider_login is not UNSET: + field_dict["provider_login"] = provider_login return field_dict @@ -69,32 +79,28 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - provider = d.pop("provider", UNSET) + provider = d.pop("provider") + + provider_user_id = d.pop("provider_user_id") + + linked_at = datetime.datetime.fromisoformat(d.pop("linked_at")) - _linked_at = d.pop("linked_at", UNSET) - linked_at: datetime.datetime | Unset - if isinstance(_linked_at, Unset): - linked_at = UNSET - else: - linked_at = datetime.datetime.fromisoformat(_linked_at) + updated_at = datetime.datetime.fromisoformat(d.pop("updated_at")) - _updated_at = d.pop("updated_at", UNSET) - updated_at: datetime.datetime | Unset - if isinstance(_updated_at, Unset): - updated_at = UNSET - else: - updated_at = datetime.datetime.fromisoformat(_updated_at) + provider_login = d.pop("provider_login", UNSET) auth_list_o_auth_providers_response_200_providers_item = cls( provider=provider, + provider_user_id=provider_user_id, linked_at=linked_at, updated_at=updated_at, + provider_login=provider_login, ) diff --git a/src/volcano_sdk/_generated/models/autofix_diagnosis.py b/src/volcano_sdk/_generated/models/autofix_diagnosis.py deleted file mode 100644 index 26bacf89..00000000 --- a/src/volcano_sdk/_generated/models/autofix_diagnosis.py +++ /dev/null @@ -1,132 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - -from ..models.autofix_diagnosis_confidence import AutofixDiagnosisConfidence -from ..models.autofix_diagnosis_confidence import check_autofix_diagnosis_confidence -from typing import cast - -if TYPE_CHECKING: - from ..models.autofix_evidence import AutofixEvidence - - - - - -T = TypeVar("T", bound="AutofixDiagnosis") - - - -@_attrs_define -class AutofixDiagnosis: - """ - Attributes: - summary (str): One or two sentences on what goes wrong. - root_cause (str): - evidence (list[AutofixEvidence]): - suggested_fix (str): - confidence (AutofixDiagnosisConfidence): - fixable (bool): Whether a change to the project's code would fix the issue. - files (list[str]): Repository paths a fix would change. - """ - - summary: str - root_cause: str - evidence: list[AutofixEvidence] - suggested_fix: str - confidence: AutofixDiagnosisConfidence - fixable: bool - files: list[str] - - - - - - def to_dict(self) -> dict[str, Any]: - from ..models.autofix_evidence import AutofixEvidence # noqa: PLC0415 - summary = self.summary - - root_cause = self.root_cause - - evidence = [] - for evidence_item_data in self.evidence: - evidence_item = evidence_item_data.to_dict() - evidence.append(evidence_item) - - - - suggested_fix = self.suggested_fix - - confidence: str = self.confidence - - fixable = self.fixable - - files = self.files - - - - - field_dict: dict[str, Any] = {} - - field_dict.update({ - "summary": summary, - "root_cause": root_cause, - "evidence": evidence, - "suggested_fix": suggested_fix, - "confidence": confidence, - "fixable": fixable, - "files": files, - }) - - return field_dict - - - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.autofix_evidence import AutofixEvidence # noqa: PLC0415 - d = dict(src_dict) - summary = d.pop("summary") - - root_cause = d.pop("root_cause") - - evidence = [] - _evidence = d.pop("evidence") - for evidence_item_data in (_evidence): - evidence_item = AutofixEvidence.from_dict(evidence_item_data) - - - - evidence.append(evidence_item) - - - suggested_fix = d.pop("suggested_fix") - - confidence = check_autofix_diagnosis_confidence(d.pop("confidence")) - - - - - fixable = d.pop("fixable") - - files = cast(list[str], d.pop("files")) - - - autofix_diagnosis = cls( - summary=summary, - root_cause=root_cause, - evidence=evidence, - suggested_fix=suggested_fix, - confidence=confidence, - fixable=fixable, - files=files, - ) - - return autofix_diagnosis - diff --git a/src/volcano_sdk/_generated/models/autofix_diagnosis_confidence.py b/src/volcano_sdk/_generated/models/autofix_diagnosis_confidence.py deleted file mode 100644 index eeec57dd..00000000 --- a/src/volcano_sdk/_generated/models/autofix_diagnosis_confidence.py +++ /dev/null @@ -1,10 +0,0 @@ -from typing import Literal - -AutofixDiagnosisConfidence = Literal['high', 'low', 'medium'] - -AUTOFIX_DIAGNOSIS_CONFIDENCE_VALUES: set[AutofixDiagnosisConfidence] = { 'high', 'low', 'medium', } - -def check_autofix_diagnosis_confidence(value: str) -> AutofixDiagnosisConfidence: - if value in AUTOFIX_DIAGNOSIS_CONFIDENCE_VALUES: - return value - raise TypeError(f"Unexpected value {value!r}. Expected one of {AUTOFIX_DIAGNOSIS_CONFIDENCE_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/autofix_edit.py b/src/volcano_sdk/_generated/models/autofix_edit.py deleted file mode 100644 index 2bcb071d..00000000 --- a/src/volcano_sdk/_generated/models/autofix_edit.py +++ /dev/null @@ -1,75 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - - - - - - - -T = TypeVar("T", bound="AutofixEdit") - - - -@_attrs_define -class AutofixEdit: - """ One exact text replacement. An empty `old_text` creates the file. - - Attributes: - path (str): - old_text (str): - new_text (str): - """ - - path: str - old_text: str - new_text: str - - - - - - def to_dict(self) -> dict[str, Any]: - path = self.path - - old_text = self.old_text - - new_text = self.new_text - - - field_dict: dict[str, Any] = {} - - field_dict.update({ - "path": path, - "old_text": old_text, - "new_text": new_text, - }) - - return field_dict - - - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - path = d.pop("path") - - old_text = d.pop("old_text") - - new_text = d.pop("new_text") - - autofix_edit = cls( - path=path, - old_text=old_text, - new_text=new_text, - ) - - return autofix_edit - diff --git a/src/volcano_sdk/_generated/models/autofix_evidence.py b/src/volcano_sdk/_generated/models/autofix_evidence.py deleted file mode 100644 index 4acd5a3d..00000000 --- a/src/volcano_sdk/_generated/models/autofix_evidence.py +++ /dev/null @@ -1,82 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - -from ..models.autofix_evidence_kind import AutofixEvidenceKind -from ..models.autofix_evidence_kind import check_autofix_evidence_kind -from ..types import UNSET, Unset -from typing import cast - - - - - - -T = TypeVar("T", bound="AutofixEvidence") - - - -@_attrs_define -class AutofixEvidence: - """ - Attributes: - kind (AutofixEvidenceKind): - detail (str): - location (str | Unset): A file and line, or a log timestamp. Absent when the evidence has none. - """ - - kind: AutofixEvidenceKind - detail: str - location: str | Unset = UNSET - - - - - - def to_dict(self) -> dict[str, Any]: - kind: str = self.kind - - detail = self.detail - - location = self.location - - - field_dict: dict[str, Any] = {} - - field_dict.update({ - "kind": kind, - "detail": detail, - }) - if location is not UNSET: - field_dict["location"] = location - - return field_dict - - - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - kind = check_autofix_evidence_kind(d.pop("kind")) - - - - - detail = d.pop("detail") - - location = d.pop("location", UNSET) - - autofix_evidence = cls( - kind=kind, - detail=detail, - location=location, - ) - - return autofix_evidence - diff --git a/src/volcano_sdk/_generated/models/autofix_evidence_kind.py b/src/volcano_sdk/_generated/models/autofix_evidence_kind.py deleted file mode 100644 index 0723fe78..00000000 --- a/src/volcano_sdk/_generated/models/autofix_evidence_kind.py +++ /dev/null @@ -1,10 +0,0 @@ -from typing import Literal - -AutofixEvidenceKind = Literal['code', 'log', 'other'] - -AUTOFIX_EVIDENCE_KIND_VALUES: set[AutofixEvidenceKind] = { 'code', 'log', 'other', } - -def check_autofix_evidence_kind(value: str) -> AutofixEvidenceKind: - if value in AUTOFIX_EVIDENCE_KIND_VALUES: - return value - raise TypeError(f"Unexpected value {value!r}. Expected one of {AUTOFIX_EVIDENCE_KIND_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/autofix_model.py b/src/volcano_sdk/_generated/models/autofix_model.py deleted file mode 100644 index 55871e52..00000000 --- a/src/volcano_sdk/_generated/models/autofix_model.py +++ /dev/null @@ -1,10 +0,0 @@ -from typing import Literal - -AutofixModel = Literal['claude-fable-5-1', 'claude-haiku-4-5', 'claude-haiku-5-5', 'claude-opus-5', 'claude-opus-5-5', 'claude-sonnet-5', 'claude-sonnet-5-5'] - -AUTOFIX_MODEL_VALUES: set[AutofixModel] = { 'claude-fable-5-1', 'claude-haiku-4-5', 'claude-haiku-5-5', 'claude-opus-5', 'claude-opus-5-5', 'claude-sonnet-5', 'claude-sonnet-5-5', } - -def check_autofix_model(value: str) -> AutofixModel: - if value in AUTOFIX_MODEL_VALUES: - return value - raise TypeError(f"Unexpected value {value!r}. Expected one of {AUTOFIX_MODEL_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/autofix_patch.py b/src/volcano_sdk/_generated/models/autofix_patch.py deleted file mode 100644 index 62ee2b03..00000000 --- a/src/volcano_sdk/_generated/models/autofix_patch.py +++ /dev/null @@ -1,86 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - -from typing import cast - -if TYPE_CHECKING: - from ..models.autofix_edit import AutofixEdit - - - - - -T = TypeVar("T", bound="AutofixPatch") - - - -@_attrs_define -class AutofixPatch: - """ The fix the model proposed, applied to the deployed commit. Present whenever the run opened a pull request, and when - a valid fix could not be published. - - Attributes: - title (str): - edits (list[AutofixEdit]): - """ - - title: str - edits: list[AutofixEdit] - - - - - - def to_dict(self) -> dict[str, Any]: - from ..models.autofix_edit import AutofixEdit # noqa: PLC0415 - title = self.title - - edits = [] - for edits_item_data in self.edits: - edits_item = edits_item_data.to_dict() - edits.append(edits_item) - - - - - field_dict: dict[str, Any] = {} - - field_dict.update({ - "title": title, - "edits": edits, - }) - - return field_dict - - - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.autofix_edit import AutofixEdit # noqa: PLC0415 - d = dict(src_dict) - title = d.pop("title") - - edits = [] - _edits = d.pop("edits") - for edits_item_data in (_edits): - edits_item = AutofixEdit.from_dict(edits_item_data) - - - - edits.append(edits_item) - - - autofix_patch = cls( - title=title, - edits=edits, - ) - - return autofix_patch - diff --git a/src/volcano_sdk/_generated/models/autofix_provider.py b/src/volcano_sdk/_generated/models/autofix_provider.py deleted file mode 100644 index a9c25ca7..00000000 --- a/src/volcano_sdk/_generated/models/autofix_provider.py +++ /dev/null @@ -1,10 +0,0 @@ -from typing import Literal - -AutofixProvider = Literal['anthropic', 'volcano'] - -AUTOFIX_PROVIDER_VALUES: set[AutofixProvider] = { 'anthropic', 'volcano', } - -def check_autofix_provider(value: str) -> AutofixProvider: - if value in AUTOFIX_PROVIDER_VALUES: - return value - raise TypeError(f"Unexpected value {value!r}. Expected one of {AUTOFIX_PROVIDER_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/autofix_pull_request.py b/src/volcano_sdk/_generated/models/autofix_pull_request.py deleted file mode 100644 index a8b58ae9..00000000 --- a/src/volcano_sdk/_generated/models/autofix_pull_request.py +++ /dev/null @@ -1,131 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - -from ..models.autofix_pull_request_state import AutofixPullRequestState -from ..models.autofix_pull_request_state import check_autofix_pull_request_state -from ..types import UNSET, Unset -from typing import cast -import datetime - - - - - - -T = TypeVar("T", bound="AutofixPullRequest") - - - -@_attrs_define -class AutofixPullRequest: - """ The draft pull request the run opened on the connected repository. - - Attributes: - number (int): - url (str): - branch (str): The branch the fix is on, `volcano/autofix/`. - state (AutofixPullRequestState): - closed_at (datetime.datetime | Unset): When the pull request was merged or closed. - deployed_at (datetime.datetime | Unset): When a deployment that includes the merged fix went live. The issue - resolves then, unless it occurred again since. When more than 20 deployments went live after the merge before - Volcano checked, it is the merge time instead. - """ - - number: int - url: str - branch: str - state: AutofixPullRequestState - closed_at: datetime.datetime | Unset = UNSET - deployed_at: datetime.datetime | Unset = UNSET - - - - - - def to_dict(self) -> dict[str, Any]: - number = self.number - - url = self.url - - branch = self.branch - - state: str = self.state - - closed_at: str | Unset = UNSET - if not isinstance(self.closed_at, Unset): - closed_at = self.closed_at.isoformat() - - deployed_at: str | Unset = UNSET - if not isinstance(self.deployed_at, Unset): - deployed_at = self.deployed_at.isoformat() - - - field_dict: dict[str, Any] = {} - - field_dict.update({ - "number": number, - "url": url, - "branch": branch, - "state": state, - }) - if closed_at is not UNSET: - field_dict["closed_at"] = closed_at - if deployed_at is not UNSET: - field_dict["deployed_at"] = deployed_at - - return field_dict - - - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - number = d.pop("number") - - url = d.pop("url") - - branch = d.pop("branch") - - state = check_autofix_pull_request_state(d.pop("state")) - - - - - _closed_at = d.pop("closed_at", UNSET) - closed_at: datetime.datetime | Unset - if isinstance(_closed_at, Unset): - closed_at = UNSET - else: - closed_at = datetime.datetime.fromisoformat(_closed_at) - - - - - _deployed_at = d.pop("deployed_at", UNSET) - deployed_at: datetime.datetime | Unset - if isinstance(_deployed_at, Unset): - deployed_at = UNSET - else: - deployed_at = datetime.datetime.fromisoformat(_deployed_at) - - - - - autofix_pull_request = cls( - number=number, - url=url, - branch=branch, - state=state, - closed_at=closed_at, - deployed_at=deployed_at, - ) - - return autofix_pull_request - diff --git a/src/volcano_sdk/_generated/models/autofix_pull_request_skipped.py b/src/volcano_sdk/_generated/models/autofix_pull_request_skipped.py deleted file mode 100644 index 81b39fad..00000000 --- a/src/volcano_sdk/_generated/models/autofix_pull_request_skipped.py +++ /dev/null @@ -1,10 +0,0 @@ -from typing import Literal - -AutofixPullRequestSkipped = Literal['low_confidence', 'no_patch', 'not_fixable', 'permission_missing', 'publish_failed', 'pull_request_open', 'repository_changed', 'source_unavailable'] - -AUTOFIX_PULL_REQUEST_SKIPPED_VALUES: set[AutofixPullRequestSkipped] = { 'low_confidence', 'no_patch', 'not_fixable', 'permission_missing', 'publish_failed', 'pull_request_open', 'repository_changed', 'source_unavailable', } - -def check_autofix_pull_request_skipped(value: str) -> AutofixPullRequestSkipped: - if value in AUTOFIX_PULL_REQUEST_SKIPPED_VALUES: - return value - raise TypeError(f"Unexpected value {value!r}. Expected one of {AUTOFIX_PULL_REQUEST_SKIPPED_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/autofix_pull_request_state.py b/src/volcano_sdk/_generated/models/autofix_pull_request_state.py deleted file mode 100644 index 5a7764b9..00000000 --- a/src/volcano_sdk/_generated/models/autofix_pull_request_state.py +++ /dev/null @@ -1,10 +0,0 @@ -from typing import Literal - -AutofixPullRequestState = Literal['closed', 'merged', 'open'] - -AUTOFIX_PULL_REQUEST_STATE_VALUES: set[AutofixPullRequestState] = { 'closed', 'merged', 'open', } - -def check_autofix_pull_request_state(value: str) -> AutofixPullRequestState: - if value in AUTOFIX_PULL_REQUEST_STATE_VALUES: - return value - raise TypeError(f"Unexpected value {value!r}. Expected one of {AUTOFIX_PULL_REQUEST_STATE_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/autofix_run.py b/src/volcano_sdk/_generated/models/autofix_run.py deleted file mode 100644 index 4fb1f1cb..00000000 --- a/src/volcano_sdk/_generated/models/autofix_run.py +++ /dev/null @@ -1,362 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - -from ..models.autofix_model import AutofixModel -from ..models.autofix_model import check_autofix_model -from ..models.autofix_provider import AutofixProvider -from ..models.autofix_provider import check_autofix_provider -from ..models.autofix_pull_request_skipped import AutofixPullRequestSkipped -from ..models.autofix_pull_request_skipped import check_autofix_pull_request_skipped -from ..models.autofix_run_status import AutofixRunStatus -from ..models.autofix_run_status import check_autofix_run_status -from ..models.autofix_run_trigger import AutofixRunTrigger -from ..models.autofix_run_trigger import check_autofix_run_trigger -from ..models.autofix_stage import AutofixStage -from ..models.autofix_stage import check_autofix_stage -from ..types import UNSET, Unset -from typing import cast -from uuid import UUID -import datetime - -if TYPE_CHECKING: - from ..models.autofix_diagnosis import AutofixDiagnosis - from ..models.autofix_patch import AutofixPatch - from ..models.autofix_pull_request import AutofixPullRequest - from ..models.autofix_run_usage import AutofixRunUsage - - - - - -T = TypeVar("T", bound="AutofixRun") - - - -@_attrs_define -class AutofixRun: - """ - Attributes: - id (UUID): - project_id (UUID): - issue_id (UUID): - trigger (AutofixRunTrigger): What started the run. `manual` is a request; `new_issue` and `regression` are - automatic runs for an issue that appeared or reopened. - status (AutofixRunStatus): Where a run is. `canceled` means the project's settings or plan stopped allowing the - run before it finished; `failure_code` says which. - max_stage (AutofixStage): How far a run may go. `diagnose` stops at a root-cause diagnosis. `pull_request` may - also open a draft pull request with a fix in the project's connected repository. - provider (AutofixProvider): Who serves the model. `volcano` runs on Volcano's models. `anthropic` runs on your - own Anthropic API key. - model (AutofixModel): The Claude model a run uses. `claude-opus-5-5` is the default. - usage (AutofixRunUsage): Model tokens the run used across every attempt. - created_at (datetime.datetime): - stage_reached (AutofixStage | Unset): How far a run may go. `diagnose` stops at a root-cause diagnosis. - `pull_request` may also open a draft pull request with a fix in the project's connected repository. - diagnosis (AutofixDiagnosis | Unset): - patch (AutofixPatch | Unset): The fix the model proposed, applied to the deployed commit. Present whenever the - run opened a pull request, and when a valid fix could not be published. - pull_request (AutofixPullRequest | Unset): The draft pull request the run opened on the connected repository. - pull_request_skipped (AutofixPullRequestSkipped | Unset): Why a run whose `max_stage` is `pull_request` opened - no pull request. The diagnosis stands either way. - commit_sha (str | Unset): The commit the diagnosis read, when a push to the connected repository deployed the - resource. Absent when the run read logs only. - failure_code (str | Unset): Why the run failed or was canceled, or why its last attempt will be retried. One of - `api_key_rejected`, `model_request_rejected`, `model_unavailable`, `model_refused`, `no_diagnosis`, - `budget_exhausted`, `timed_out`, `attempts_exhausted`, `autofix_disabled`, `plan_required`, - `managed_models_unavailable`, `settings_changed`, `issue_not_found`, or `internal_error`. - failure_message (str | Unset): - started_at (datetime.datetime | Unset): - completed_at (datetime.datetime | Unset): - """ - - id: UUID - project_id: UUID - issue_id: UUID - trigger: AutofixRunTrigger - status: AutofixRunStatus - max_stage: AutofixStage - provider: AutofixProvider - model: AutofixModel - usage: AutofixRunUsage - created_at: datetime.datetime - stage_reached: AutofixStage | Unset = UNSET - diagnosis: AutofixDiagnosis | Unset = UNSET - patch: AutofixPatch | Unset = UNSET - pull_request: AutofixPullRequest | Unset = UNSET - pull_request_skipped: AutofixPullRequestSkipped | Unset = UNSET - commit_sha: str | Unset = UNSET - failure_code: str | Unset = UNSET - failure_message: str | Unset = UNSET - started_at: datetime.datetime | Unset = UNSET - completed_at: datetime.datetime | Unset = UNSET - - - - - - def to_dict(self) -> dict[str, Any]: - from ..models.autofix_diagnosis import AutofixDiagnosis # noqa: PLC0415 - from ..models.autofix_patch import AutofixPatch # noqa: PLC0415 - from ..models.autofix_pull_request import AutofixPullRequest # noqa: PLC0415 - from ..models.autofix_run_usage import AutofixRunUsage # noqa: PLC0415 - id = str(self.id) - - project_id = str(self.project_id) - - issue_id = str(self.issue_id) - - trigger: str = self.trigger - - status: str = self.status - - max_stage: str = self.max_stage - - provider: str = self.provider - - model: str = self.model - - usage = self.usage.to_dict() - - created_at = self.created_at.isoformat() - - stage_reached: str | Unset = UNSET - if not isinstance(self.stage_reached, Unset): - stage_reached = self.stage_reached - - - diagnosis: dict[str, Any] | Unset = UNSET - if not isinstance(self.diagnosis, Unset): - diagnosis = self.diagnosis.to_dict() - - patch: dict[str, Any] | Unset = UNSET - if not isinstance(self.patch, Unset): - patch = self.patch.to_dict() - - pull_request: dict[str, Any] | Unset = UNSET - if not isinstance(self.pull_request, Unset): - pull_request = self.pull_request.to_dict() - - pull_request_skipped: str | Unset = UNSET - if not isinstance(self.pull_request_skipped, Unset): - pull_request_skipped = self.pull_request_skipped - - - commit_sha = self.commit_sha - - failure_code = self.failure_code - - failure_message = self.failure_message - - started_at: str | Unset = UNSET - if not isinstance(self.started_at, Unset): - started_at = self.started_at.isoformat() - - completed_at: str | Unset = UNSET - if not isinstance(self.completed_at, Unset): - completed_at = self.completed_at.isoformat() - - - field_dict: dict[str, Any] = {} - - field_dict.update({ - "id": id, - "project_id": project_id, - "issue_id": issue_id, - "trigger": trigger, - "status": status, - "max_stage": max_stage, - "provider": provider, - "model": model, - "usage": usage, - "created_at": created_at, - }) - if stage_reached is not UNSET: - field_dict["stage_reached"] = stage_reached - if diagnosis is not UNSET: - field_dict["diagnosis"] = diagnosis - if patch is not UNSET: - field_dict["patch"] = patch - if pull_request is not UNSET: - field_dict["pull_request"] = pull_request - if pull_request_skipped is not UNSET: - field_dict["pull_request_skipped"] = pull_request_skipped - if commit_sha is not UNSET: - field_dict["commit_sha"] = commit_sha - if failure_code is not UNSET: - field_dict["failure_code"] = failure_code - if failure_message is not UNSET: - field_dict["failure_message"] = failure_message - if started_at is not UNSET: - field_dict["started_at"] = started_at - if completed_at is not UNSET: - field_dict["completed_at"] = completed_at - - return field_dict - - - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.autofix_diagnosis import AutofixDiagnosis # noqa: PLC0415 - from ..models.autofix_patch import AutofixPatch # noqa: PLC0415 - from ..models.autofix_pull_request import AutofixPullRequest # noqa: PLC0415 - from ..models.autofix_run_usage import AutofixRunUsage # noqa: PLC0415 - d = dict(src_dict) - id = UUID(d.pop("id")) - - - - - project_id = UUID(d.pop("project_id")) - - - - - issue_id = UUID(d.pop("issue_id")) - - - - - trigger = check_autofix_run_trigger(d.pop("trigger")) - - - - - status = check_autofix_run_status(d.pop("status")) - - - - - max_stage = check_autofix_stage(d.pop("max_stage")) - - - - - provider = check_autofix_provider(d.pop("provider")) - - - - - model = check_autofix_model(d.pop("model")) - - - - - usage = AutofixRunUsage.from_dict(d.pop("usage")) - - - - - created_at = datetime.datetime.fromisoformat(d.pop("created_at")) - - - - - _stage_reached = d.pop("stage_reached", UNSET) - stage_reached: AutofixStage | Unset - if isinstance(_stage_reached, Unset): - stage_reached = UNSET - else: - stage_reached = check_autofix_stage(_stage_reached) - - - - - _diagnosis = d.pop("diagnosis", UNSET) - diagnosis: AutofixDiagnosis | Unset - if isinstance(_diagnosis, Unset): - diagnosis = UNSET - else: - diagnosis = AutofixDiagnosis.from_dict(_diagnosis) - - - - - _patch = d.pop("patch", UNSET) - patch: AutofixPatch | Unset - if isinstance(_patch, Unset): - patch = UNSET - else: - patch = AutofixPatch.from_dict(_patch) - - - - - _pull_request = d.pop("pull_request", UNSET) - pull_request: AutofixPullRequest | Unset - if isinstance(_pull_request, Unset): - pull_request = UNSET - else: - pull_request = AutofixPullRequest.from_dict(_pull_request) - - - - - _pull_request_skipped = d.pop("pull_request_skipped", UNSET) - pull_request_skipped: AutofixPullRequestSkipped | Unset - if isinstance(_pull_request_skipped, Unset): - pull_request_skipped = UNSET - else: - pull_request_skipped = check_autofix_pull_request_skipped(_pull_request_skipped) - - - - - commit_sha = d.pop("commit_sha", UNSET) - - failure_code = d.pop("failure_code", UNSET) - - failure_message = d.pop("failure_message", UNSET) - - _started_at = d.pop("started_at", UNSET) - started_at: datetime.datetime | Unset - if isinstance(_started_at, Unset): - started_at = UNSET - else: - started_at = datetime.datetime.fromisoformat(_started_at) - - - - - _completed_at = d.pop("completed_at", UNSET) - completed_at: datetime.datetime | Unset - if isinstance(_completed_at, Unset): - completed_at = UNSET - else: - completed_at = datetime.datetime.fromisoformat(_completed_at) - - - - - autofix_run = cls( - id=id, - project_id=project_id, - issue_id=issue_id, - trigger=trigger, - status=status, - max_stage=max_stage, - provider=provider, - model=model, - usage=usage, - created_at=created_at, - stage_reached=stage_reached, - diagnosis=diagnosis, - patch=patch, - pull_request=pull_request, - pull_request_skipped=pull_request_skipped, - commit_sha=commit_sha, - failure_code=failure_code, - failure_message=failure_message, - started_at=started_at, - completed_at=completed_at, - ) - - return autofix_run - diff --git a/src/volcano_sdk/_generated/models/autofix_run_status.py b/src/volcano_sdk/_generated/models/autofix_run_status.py deleted file mode 100644 index e74d65c8..00000000 --- a/src/volcano_sdk/_generated/models/autofix_run_status.py +++ /dev/null @@ -1,10 +0,0 @@ -from typing import Literal - -AutofixRunStatus = Literal['canceled', 'failed', 'queued', 'running', 'succeeded'] - -AUTOFIX_RUN_STATUS_VALUES: set[AutofixRunStatus] = { 'canceled', 'failed', 'queued', 'running', 'succeeded', } - -def check_autofix_run_status(value: str) -> AutofixRunStatus: - if value in AUTOFIX_RUN_STATUS_VALUES: - return value - raise TypeError(f"Unexpected value {value!r}. Expected one of {AUTOFIX_RUN_STATUS_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/autofix_run_trigger.py b/src/volcano_sdk/_generated/models/autofix_run_trigger.py deleted file mode 100644 index c4a8be9f..00000000 --- a/src/volcano_sdk/_generated/models/autofix_run_trigger.py +++ /dev/null @@ -1,10 +0,0 @@ -from typing import Literal - -AutofixRunTrigger = Literal['manual', 'new_issue', 'regression'] - -AUTOFIX_RUN_TRIGGER_VALUES: set[AutofixRunTrigger] = { 'manual', 'new_issue', 'regression', } - -def check_autofix_run_trigger(value: str) -> AutofixRunTrigger: - if value in AUTOFIX_RUN_TRIGGER_VALUES: - return value - raise TypeError(f"Unexpected value {value!r}. Expected one of {AUTOFIX_RUN_TRIGGER_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/autofix_run_usage.py b/src/volcano_sdk/_generated/models/autofix_run_usage.py deleted file mode 100644 index a93a2e78..00000000 --- a/src/volcano_sdk/_generated/models/autofix_run_usage.py +++ /dev/null @@ -1,83 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - - - - - - - -T = TypeVar("T", bound="AutofixRunUsage") - - - -@_attrs_define -class AutofixRunUsage: - """ Model tokens the run used across every attempt. - - Attributes: - input_tokens (int): - output_tokens (int): - cache_read_input_tokens (int): - cache_creation_input_tokens (int): - """ - - input_tokens: int - output_tokens: int - cache_read_input_tokens: int - cache_creation_input_tokens: int - - - - - - def to_dict(self) -> dict[str, Any]: - input_tokens = self.input_tokens - - output_tokens = self.output_tokens - - cache_read_input_tokens = self.cache_read_input_tokens - - cache_creation_input_tokens = self.cache_creation_input_tokens - - - field_dict: dict[str, Any] = {} - - field_dict.update({ - "input_tokens": input_tokens, - "output_tokens": output_tokens, - "cache_read_input_tokens": cache_read_input_tokens, - "cache_creation_input_tokens": cache_creation_input_tokens, - }) - - return field_dict - - - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - input_tokens = d.pop("input_tokens") - - output_tokens = d.pop("output_tokens") - - cache_read_input_tokens = d.pop("cache_read_input_tokens") - - cache_creation_input_tokens = d.pop("cache_creation_input_tokens") - - autofix_run_usage = cls( - input_tokens=input_tokens, - output_tokens=output_tokens, - cache_read_input_tokens=cache_read_input_tokens, - cache_creation_input_tokens=cache_creation_input_tokens, - ) - - return autofix_run_usage - diff --git a/src/volcano_sdk/_generated/models/autofix_settings.py b/src/volcano_sdk/_generated/models/autofix_settings.py deleted file mode 100644 index 99ff6fbc..00000000 --- a/src/volcano_sdk/_generated/models/autofix_settings.py +++ /dev/null @@ -1,190 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - -from ..models.autofix_model import AutofixModel -from ..models.autofix_model import check_autofix_model -from ..models.autofix_provider import AutofixProvider -from ..models.autofix_provider import check_autofix_provider -from ..models.autofix_stage import AutofixStage -from ..models.autofix_stage import check_autofix_stage -from ..types import UNSET, Unset -from typing import cast -from uuid import UUID -import datetime - - - - - - -T = TypeVar("T", bound="AutofixSettings") - - - -@_attrs_define -class AutofixSettings: - """ - Attributes: - project_id (UUID): - enabled (bool): Whether Volcano diagnoses the project's issues with AI. - max_stage (AutofixStage): How far a run may go. `diagnose` stops at a root-cause diagnosis. `pull_request` may - also open a draft pull request with a fix in the project's connected repository. - auto_trigger (bool): Whether a new or reopened issue starts a run on its own. When false, runs start only on - request. - provider (AutofixProvider): Who serves the model. `volcano` runs on Volcano's models. `anthropic` runs on your - own Anthropic API key. - model (AutofixModel): The Claude model a run uses. `claude-opus-5-5` is the default. - api_key_configured (bool): Whether your own API key is stored. The key itself is never returned. - api_key_provider (AutofixProvider | Unset): Who serves the model. `volcano` runs on Volcano's models. - `anthropic` runs on your own Anthropic API key. - api_key_last4 (str | Unset): The stored key's last four characters, present when one is stored. - plan_includes_autofix (bool | Unset): Whether the owner's plan includes autofix. When false, saved settings stay - stored and no run starts. Absent when a save that needed no plan succeeded but the plan could not be resolved. - updated_at (datetime.datetime | Unset): When the settings were last saved. Absent until the first save. - """ - - project_id: UUID - enabled: bool - max_stage: AutofixStage - auto_trigger: bool - provider: AutofixProvider - model: AutofixModel - api_key_configured: bool - api_key_provider: AutofixProvider | Unset = UNSET - api_key_last4: str | Unset = UNSET - plan_includes_autofix: bool | Unset = UNSET - updated_at: datetime.datetime | Unset = UNSET - - - - - - def to_dict(self) -> dict[str, Any]: - project_id = str(self.project_id) - - enabled = self.enabled - - max_stage: str = self.max_stage - - auto_trigger = self.auto_trigger - - provider: str = self.provider - - model: str = self.model - - api_key_configured = self.api_key_configured - - api_key_provider: str | Unset = UNSET - if not isinstance(self.api_key_provider, Unset): - api_key_provider = self.api_key_provider - - - api_key_last4 = self.api_key_last4 - - plan_includes_autofix = self.plan_includes_autofix - - updated_at: str | Unset = UNSET - if not isinstance(self.updated_at, Unset): - updated_at = self.updated_at.isoformat() - - - field_dict: dict[str, Any] = {} - - field_dict.update({ - "project_id": project_id, - "enabled": enabled, - "max_stage": max_stage, - "auto_trigger": auto_trigger, - "provider": provider, - "model": model, - "api_key_configured": api_key_configured, - }) - if api_key_provider is not UNSET: - field_dict["api_key_provider"] = api_key_provider - if api_key_last4 is not UNSET: - field_dict["api_key_last4"] = api_key_last4 - if plan_includes_autofix is not UNSET: - field_dict["plan_includes_autofix"] = plan_includes_autofix - if updated_at is not UNSET: - field_dict["updated_at"] = updated_at - - return field_dict - - - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - project_id = UUID(d.pop("project_id")) - - - - - enabled = d.pop("enabled") - - max_stage = check_autofix_stage(d.pop("max_stage")) - - - - - auto_trigger = d.pop("auto_trigger") - - provider = check_autofix_provider(d.pop("provider")) - - - - - model = check_autofix_model(d.pop("model")) - - - - - api_key_configured = d.pop("api_key_configured") - - _api_key_provider = d.pop("api_key_provider", UNSET) - api_key_provider: AutofixProvider | Unset - if isinstance(_api_key_provider, Unset): - api_key_provider = UNSET - else: - api_key_provider = check_autofix_provider(_api_key_provider) - - - - - api_key_last4 = d.pop("api_key_last4", UNSET) - - plan_includes_autofix = d.pop("plan_includes_autofix", UNSET) - - _updated_at = d.pop("updated_at", UNSET) - updated_at: datetime.datetime | Unset - if isinstance(_updated_at, Unset): - updated_at = UNSET - else: - updated_at = datetime.datetime.fromisoformat(_updated_at) - - - - - autofix_settings = cls( - project_id=project_id, - enabled=enabled, - max_stage=max_stage, - auto_trigger=auto_trigger, - provider=provider, - model=model, - api_key_configured=api_key_configured, - api_key_provider=api_key_provider, - api_key_last4=api_key_last4, - plan_includes_autofix=plan_includes_autofix, - updated_at=updated_at, - ) - - return autofix_settings - diff --git a/src/volcano_sdk/_generated/models/autofix_stage.py b/src/volcano_sdk/_generated/models/autofix_stage.py deleted file mode 100644 index feec56e0..00000000 --- a/src/volcano_sdk/_generated/models/autofix_stage.py +++ /dev/null @@ -1,10 +0,0 @@ -from typing import Literal - -AutofixStage = Literal['diagnose', 'pull_request'] - -AUTOFIX_STAGE_VALUES: set[AutofixStage] = { 'diagnose', 'pull_request', } - -def check_autofix_stage(value: str) -> AutofixStage: - if value in AUTOFIX_STAGE_VALUES: - return value - raise TypeError(f"Unexpected value {value!r}. Expected one of {AUTOFIX_STAGE_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/capability.py b/src/volcano_sdk/_generated/models/capability.py index da1a7a9d..864773ca 100644 --- a/src/volcano_sdk/_generated/models/capability.py +++ b/src/volcano_sdk/_generated/models/capability.py @@ -10,6 +10,7 @@ from ..models.capability_status import CapabilityStatus from ..models.capability_status import check_capability_status +from ..types import UNSET, Unset from typing import cast @@ -26,15 +27,21 @@ class Capability: """ A product capability and whether it accepts new work in this environment. Attributes: - id (str): Stable capability ID, such as `sandboxes`, `sandboxes.sessions`, `sandboxes.custom_templates`, - `issues`, or `autofix`. New IDs may appear at any time. Example: sandboxes.sessions. + id (str): Stable capability ID, such as `sandboxes`, `sandboxes.sessions`, `sandboxes.custom_templates`, or + `issues`. New IDs may appear at any time. Example: sandboxes.sessions. status (CapabilityStatus): `available` means the capability accepts new work; a temporary outage still answers - `503`. `unavailable` means requests that start new work answer `404` or `400` with code `feature_unavailable`. - Treat any other value as `unavailable`. + `503`. `unavailable` means requests that start new work answer `404` or `400` with code `feature_unavailable`, + or with the capability's `code` when it has one; while the owner's plan can't be read, they answer `403` without + a code. `read_only` means the capability takes no new work for the project, but what the project already has + stays readable; only a project's list reports it. Treat any other value as `unavailable`. + code (str | Unset): Why an `unavailable` capability refuses new work, named like the error code its requests + answer with, such as `plan_required`. Absent on any other status, and when requests answer + `feature_unavailable`. Treat an unknown code as absent. Example: plan_required. """ id: str status: CapabilityStatus + code: str | Unset = UNSET @@ -45,6 +52,8 @@ def to_dict(self) -> dict[str, Any]: status: str = self.status + code = self.code + field_dict: dict[str, Any] = {} @@ -52,6 +61,8 @@ def to_dict(self) -> dict[str, Any]: "id": id, "status": status, }) + if code is not UNSET: + field_dict["code"] = code return field_dict @@ -67,9 +78,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + code = d.pop("code", UNSET) + capability = cls( id=id, status=status, + code=code, ) return capability diff --git a/src/volcano_sdk/_generated/models/capability_status.py b/src/volcano_sdk/_generated/models/capability_status.py index c0e99672..d366b7c5 100644 --- a/src/volcano_sdk/_generated/models/capability_status.py +++ b/src/volcano_sdk/_generated/models/capability_status.py @@ -1,8 +1,8 @@ from typing import Literal -CapabilityStatus = Literal['available', 'unavailable'] +CapabilityStatus = Literal['available', 'read_only', 'unavailable'] -CAPABILITY_STATUS_VALUES: set[CapabilityStatus] = { 'available', 'unavailable', } +CAPABILITY_STATUS_VALUES: set[CapabilityStatus] = { 'available', 'read_only', 'unavailable', } def check_capability_status(value: str) -> CapabilityStatus: if value in CAPABILITY_STATUS_VALUES: diff --git a/src/volcano_sdk/_generated/models/connect_project_git_request.py b/src/volcano_sdk/_generated/models/connect_project_git_request.py index 63fefff6..5b35cd6e 100644 --- a/src/volcano_sdk/_generated/models/connect_project_git_request.py +++ b/src/volcano_sdk/_generated/models/connect_project_git_request.py @@ -30,7 +30,10 @@ class ConnectProjectGitRequest: repository_id or repo_full_name is required; when both are given they must identify the same live repository. repo_full_name (str | Unset): Deprecated selector kept for a compatibility window; prefer repository_id. Either repository_id or repo_full_name is required. - root_directory (str | Unset): Monorepo subdirectory the project builds from. Omit for the repo root. + root_directory (str | Unset): Monorepo subdirectory the project builds from, relative to the repository root. + Omit it, or send an empty string, `.` or `/`, for the repository root. It is stored and returned in the form a + deploy reads it, as PUT /projects/{id}/git-connection/root-directory does: `./apps/web/` comes back as + `apps/web`. production_branch (str | Unset): The branch a push must land on to deploy, with three cases, because this is a full replace and a read-modify-write client sends back whatever it read. Omit it to follow the repository's GitHub default branch, which also discards a branch set earlier. Send back the branch the project already @@ -41,7 +44,9 @@ class ConnectProjectGitRequest: a Git branch name only: it does not have to exist yet, so a project can be pointed at a branch about to be pushed. Changing repository and naming a branch other than the new repository's default in one request is refused with 400, because the branch named is almost always the previous repository's, echoed back — connect - first, then set the branch. + first, then set the branch. A repository that reports no default branch, as one with no commits can, is + connected only by naming a branch, and any branch is accepted for it, including on a rebind. An empty repository + that still reports a default follows the rule above. """ connection_id: UUID diff --git a/src/volcano_sdk/_generated/models/connector.py b/src/volcano_sdk/_generated/models/connector.py new file mode 100644 index 00000000..d184cb74 --- /dev/null +++ b/src/volcano_sdk/_generated/models/connector.py @@ -0,0 +1,172 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.connector_type import check_connector_type +from ..models.connector_type import ConnectorType +from ..types import UNSET, Unset +from typing import cast +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.aikido_connector import AikidoConnector + from ..models.slack_connector import SlackConnector + + + + + +T = TypeVar("T", bound="Connector") + + + +@_attrs_define +class Connector: + """ A link from Volcano to an outside service. A `slack` connector is a Slack workspace the Volcano app is installed in, + shared by every Volcano account with a Slack identity connected there. An `aikido` connector is an Aikido workspace + one Volcano account connected with its own credentials. + + Attributes: + id (UUID): + type_ (ConnectorType): The outside service a connector links to. + name (str): The connector's name in its service, such as the Slack or Aikido workspace's name. + removable (bool): Whether the caller can remove the connector. Only the person who installed the Volcano app in + a Slack workspace can; an `aikido` connector is always the caller's own. + created_at (datetime.datetime): + slack (SlackConnector | Unset): A `slack` connector's workspace. Present when `type` is `slack`. + aikido (AikidoConnector | Unset): An `aikido` connector's workspace. Present when `type` is `aikido`. + """ + + id: UUID + type_: ConnectorType + name: str + removable: bool + created_at: datetime.datetime + slack: SlackConnector | Unset = UNSET + aikido: AikidoConnector | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.aikido_connector import AikidoConnector # noqa: PLC0415 + from ..models.slack_connector import SlackConnector # noqa: PLC0415 + id = str(self.id) + + type_: str = self.type_ + + name = self.name + + removable = self.removable + + created_at = self.created_at.isoformat() + + slack: dict[str, Any] | Unset = UNSET + if not isinstance(self.slack, Unset): + slack = self.slack.to_dict() + + aikido: dict[str, Any] | Unset = UNSET + if not isinstance(self.aikido, Unset): + aikido = self.aikido.to_dict() + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "id": id, + "type": type_, + "name": name, + "removable": removable, + "created_at": created_at, + }) + if slack is not UNSET: + field_dict["slack"] = slack + if aikido is not UNSET: + field_dict["aikido"] = aikido + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.aikido_connector import AikidoConnector # noqa: PLC0415 + from ..models.slack_connector import SlackConnector # noqa: PLC0415 + d = dict(src_dict) + id = UUID(d.pop("id")) + + + + + type_ = check_connector_type(d.pop("type")) + + + + + name = d.pop("name") + + removable = d.pop("removable") + + created_at = datetime.datetime.fromisoformat(d.pop("created_at")) + + + + + _slack = d.pop("slack", UNSET) + slack: SlackConnector | Unset + if isinstance(_slack, Unset): + slack = UNSET + else: + slack = SlackConnector.from_dict(_slack) + + + + + _aikido = d.pop("aikido", UNSET) + aikido: AikidoConnector | Unset + if isinstance(_aikido, Unset): + aikido = UNSET + else: + aikido = AikidoConnector.from_dict(_aikido) + + + + + connector = cls( + id=id, + type_=type_, + name=name, + removable=removable, + created_at=created_at, + slack=slack, + aikido=aikido, + ) + + + connector.additional_properties = d + return connector + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/connector_create.py b/src/volcano_sdk/_generated/models/connector_create.py new file mode 100644 index 00000000..9ff59292 --- /dev/null +++ b/src/volcano_sdk/_generated/models/connector_create.py @@ -0,0 +1,79 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.connector_create_type import check_connector_create_type +from ..models.connector_create_type import ConnectorCreateType +from typing import cast + +if TYPE_CHECKING: + from ..models.aikido_connector_create import AikidoConnectorCreate + + + + + +T = TypeVar("T", bound="ConnectorCreate") + + + +@_attrs_define +class ConnectorCreate: + """ + Attributes: + type_ (ConnectorCreateType): The service to connect. Slack installs with `POST /user/slack/installations`. + aikido (AikidoConnectorCreate): The Aikido workspace's REST API client and webhook signing secret. + """ + + type_: ConnectorCreateType + aikido: AikidoConnectorCreate + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.aikido_connector_create import AikidoConnectorCreate # noqa: PLC0415 + type_: str = self.type_ + + aikido = self.aikido.to_dict() + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "type": type_, + "aikido": aikido, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.aikido_connector_create import AikidoConnectorCreate # noqa: PLC0415 + d = dict(src_dict) + type_ = check_connector_create_type(d.pop("type")) + + + + + aikido = AikidoConnectorCreate.from_dict(d.pop("aikido")) + + + + + connector_create = cls( + type_=type_, + aikido=aikido, + ) + + return connector_create + diff --git a/src/volcano_sdk/_generated/models/connector_create_type.py b/src/volcano_sdk/_generated/models/connector_create_type.py new file mode 100644 index 00000000..8f8b9ba0 --- /dev/null +++ b/src/volcano_sdk/_generated/models/connector_create_type.py @@ -0,0 +1,10 @@ +from typing import Literal + +ConnectorCreateType = Literal['aikido'] + +CONNECTOR_CREATE_TYPE_VALUES: set[ConnectorCreateType] = { 'aikido', } + +def check_connector_create_type(value: str) -> ConnectorCreateType: + if value in CONNECTOR_CREATE_TYPE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {CONNECTOR_CREATE_TYPE_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/connector_type.py b/src/volcano_sdk/_generated/models/connector_type.py new file mode 100644 index 00000000..c7eb46f7 --- /dev/null +++ b/src/volcano_sdk/_generated/models/connector_type.py @@ -0,0 +1,10 @@ +from typing import Literal + +ConnectorType = Literal['aikido', 'slack'] + +CONNECTOR_TYPE_VALUES: set[ConnectorType] = { 'aikido', 'slack', } + +def check_connector_type(value: str) -> ConnectorType: + if value in CONNECTOR_TYPE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {CONNECTOR_TYPE_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/connectors_response.py b/src/volcano_sdk/_generated/models/connectors_response.py new file mode 100644 index 00000000..440f0b1f --- /dev/null +++ b/src/volcano_sdk/_generated/models/connectors_response.py @@ -0,0 +1,94 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast + +if TYPE_CHECKING: + from ..models.connector import Connector + + + + + +T = TypeVar("T", bound="ConnectorsResponse") + + + +@_attrs_define +class ConnectorsResponse: + """ + Attributes: + connectors (list[Connector]): + """ + + connectors: list[Connector] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.connector import Connector # noqa: PLC0415 + connectors = [] + for connectors_item_data in self.connectors: + connectors_item = connectors_item_data.to_dict() + connectors.append(connectors_item) + + + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "connectors": connectors, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.connector import Connector # noqa: PLC0415 + d = dict(src_dict) + connectors = [] + _connectors = d.pop("connectors") + for connectors_item_data in (_connectors): + connectors_item = Connector.from_dict(connectors_item_data) + + + + connectors.append(connectors_item) + + + connectors_response = cls( + connectors=connectors, + ) + + + connectors_response.additional_properties = d + return connectors_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/create_database_backup_request.py b/src/volcano_sdk/_generated/models/create_database_backup_request.py index dc74b54a..5b0d72cc 100644 --- a/src/volcano_sdk/_generated/models/create_database_backup_request.py +++ b/src/volcano_sdk/_generated/models/create_database_backup_request.py @@ -23,7 +23,9 @@ class CreateDatabaseBackupRequest: """ Attributes: name (str): Backup name, unique within the database. Names beginning with - `volcano-` are reserved for the platform's own snapshots. + `volcano-` are reserved for the platform's own snapshots, and names + beginning with `before-migration-` for the backups migration runs + take. Example: before_migration. """ diff --git a/src/volcano_sdk/_generated/models/create_database_branch_request.py b/src/volcano_sdk/_generated/models/create_database_branch_request.py index 785c8813..f8408d51 100644 --- a/src/volcano_sdk/_generated/models/create_database_branch_request.py +++ b/src/volcano_sdk/_generated/models/create_database_branch_request.py @@ -23,7 +23,10 @@ class CreateDatabaseBranchRequest: """ Attributes: - name (str): Branch name (must be unique within the parent database) Example: feature_checkout. + name (str): Branch name, unique within the parent database. Names beginning + with `migration_rehearsal_` are reserved for the branches migration + runs rehearse on. + Example: feature_checkout. ttl_seconds (int | Unset): How long the branch should live, between one hour and 30 days. Defaults to 7 days when omitted. Example: 86400. diff --git a/src/volcano_sdk/_generated/models/create_durable_function_body.py b/src/volcano_sdk/_generated/models/create_durable_function_body.py index 9bac550c..caded640 100644 --- a/src/volcano_sdk/_generated/models/create_durable_function_body.py +++ b/src/volcano_sdk/_generated/models/create_durable_function_body.py @@ -66,6 +66,14 @@ class CreateDurableFunctionBody: detected in its source. A declared name the project does not define is rejected with 400; a detected name it does not define is ignored. Only used when `variable_scope` is `scoped`. Omitting this leaves an existing function's declared names unchanged. + commit (str | Unset): JSON-encoded commit the uploaded source came from: `{"repository": "acme/app", "sha": + "<40-character commit ID>", "dirty": false}`. `repository` is `owner/name` or a github.com remote URL + (`https://github.com/acme/app.git`, `git@github.com:acme/app.git`, or `ssh://git@github.com/acme/app.git`); + Volcano drops any credentials in the URL and records `owner/name`. `dirty` is `true` when the uploaded files + differ from the commit. All three fields are required, and fields Volcano does not know are ignored. An empty + value, `null`, or `""` reports no commit. A malformed commit, or a repository not on GitHub, returns 400 before + anything is deployed. Volcano records a function's commit with `commit.verified: false`; a clean commit of the + project's connected repository that its production branch holds gets `commit.verification: repository`. """ name: str @@ -76,6 +84,7 @@ class CreateDurableFunctionBody: is_public: bool | Unset = UNSET variable_scope: CreateDurableFunctionBodyVariableScope | Unset = UNSET variables: str | Unset = UNSET + commit: str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -106,6 +115,8 @@ def to_dict(self) -> dict[str, Any]: variables = self.variables + commit = self.commit + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -124,6 +135,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["variable_scope"] = variable_scope if variables is not UNSET: field_dict["variables"] = variables + if commit is not UNSET: + field_dict["commit"] = commit return field_dict @@ -168,6 +181,11 @@ def to_multipart(self) -> types.RequestFiles: + if not isinstance(self.commit, Unset): + files.append(("commit", (None, str(self.commit).encode(), "text/plain"))) + + + for prop_name, prop in self.additional_properties.items(): files.append((prop_name, (None, str(prop).encode(), "text/plain"))) @@ -220,6 +238,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: variables = d.pop("variables", UNSET) + commit = d.pop("commit", UNSET) + create_durable_function_body = cls( name=name, code=code, @@ -229,6 +249,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: is_public=is_public, variable_scope=variable_scope, variables=variables, + commit=commit, ) diff --git a/src/volcano_sdk/_generated/models/create_email_template_request.py b/src/volcano_sdk/_generated/models/create_email_template_request.py index 95905f8b..0b5c0a0a 100644 --- a/src/volcano_sdk/_generated/models/create_email_template_request.py +++ b/src/volcano_sdk/_generated/models/create_email_template_request.py @@ -26,7 +26,9 @@ class CreateEmailTemplateRequest: """ Attributes: template_type (CreateEmailTemplateRequestTemplateType): Type of email template - subject (str): Email subject line Example: Confirm your email. + subject (str): Subject template. After Go template whitespace trimming, literal interior carriage returns or + newlines return 400. Outer whitespace and trailing block-scalar newlines are allowed. Example: Confirm your + email. html_body (str): HTML template body. Available placeholders: - {{.Token}} - The confirmation/reset token - {{.ProjectName}} - The project name diff --git a/src/volcano_sdk/_generated/models/create_frontend_body.py b/src/volcano_sdk/_generated/models/create_frontend_body.py index 37d542ac..1163826b 100644 --- a/src/volcano_sdk/_generated/models/create_frontend_body.py +++ b/src/volcano_sdk/_generated/models/create_frontend_body.py @@ -43,6 +43,18 @@ class CreateFrontendBody: default to `scoped`; omitting this field for an existing frontend preserves its current selection. variables (list[str] | Unset): Project variable names selected when `variable_scope` is `scoped`. Submit each name as a repeated multipart field. + commit (str | Unset): JSON-encoded commit the uploaded source came from: `{"repository": "acme/app", "sha": + "<40-character commit ID>", "dirty": false, "root": "apps/web"}`. `repository` is `owner/name` or a github.com + remote URL (`https://github.com/acme/app.git`, `git@github.com:acme/app.git`, or + `ssh://git@github.com/acme/app.git`); Volcano drops any credentials in the URL and records `owner/name`. `dirty` + is `true` when the uploaded files differ from the commit. `root` is the uploaded directory's path from the + repository root, `""` for the root itself. `repository`, `sha`, and `dirty` are required, and fields Volcano + does not know are ignored. An empty value, `null`, or `""` reports no commit. A malformed commit, or a + repository not on GitHub, returns 400 before anything is deployed. Volcano checks the commit against the + project's connected repository and each uploaded file against the commit's file at `root`, and returns the + result in the deployment's `commit.verified`; an uploaded file in the project's root directory that the commit + does not hold sets `commit.dirty`, and one outside it leaves the commit unverified. A commit it cannot verify is + still recorded and never fails the deploy. """ name: str @@ -51,6 +63,7 @@ class CreateFrontendBody: app_root: str | Unset = UNSET variable_scope: CreateFrontendBodyVariableScope | Unset = UNSET variables: list[str] | Unset = UNSET + commit: str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -81,6 +94,8 @@ def to_dict(self) -> dict[str, Any]: + commit = self.commit + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -96,6 +111,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["variable_scope"] = variable_scope if variables is not UNSET: field_dict["variables"] = variables + if commit is not UNSET: + field_dict["commit"] = commit return field_dict @@ -133,6 +150,11 @@ def to_multipart(self) -> types.RequestFiles: + if not isinstance(self.commit, Unset): + files.append(("commit", (None, str(self.commit).encode(), "text/plain"))) + + + for prop_name, prop in self.additional_properties.items(): files.append((prop_name, (None, str(prop).encode(), "text/plain"))) @@ -179,6 +201,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: variables = cast(list[str], d.pop("variables", UNSET)) + commit = d.pop("commit", UNSET) + create_frontend_body = cls( name=name, archive=archive, @@ -186,6 +210,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: app_root=app_root, variable_scope=variable_scope, variables=variables, + commit=commit, ) diff --git a/src/volcano_sdk/_generated/models/create_frontend_candidate_body.py b/src/volcano_sdk/_generated/models/create_frontend_candidate_body.py new file mode 100644 index 00000000..77c8c17b --- /dev/null +++ b/src/volcano_sdk/_generated/models/create_frontend_candidate_body.py @@ -0,0 +1,130 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +import json +from .. import types + +from ..types import UNSET, Unset + +from ..types import File, FileTypes +from ..types import UNSET, Unset +from io import BytesIO + + + + + + +T = TypeVar("T", bound="CreateFrontendCandidateBody") + + + +@_attrs_define +class CreateFrontendCandidateBody: + """ + Attributes: + name (str): Names the Candidate within the frontend. Cannot be `production`. + archive (File): ZIP or tar.gz archive of the frontend project, as for creating a frontend. The API enforces + SOURCE_ARCHIVE_SIZE_LIMIT_MB. + ttl_seconds (int | Unset): Deletes the Candidate this many seconds after it is created, at most 30 days. Omit to + keep it until deleted. + """ + + name: str + archive: File + ttl_seconds: int | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + name = self.name + + archive = self.archive.to_tuple() + + + ttl_seconds = self.ttl_seconds + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "name": name, + "archive": archive, + }) + if ttl_seconds is not UNSET: + field_dict["ttl_seconds"] = ttl_seconds + + return field_dict + + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("name", (None, str(self.name).encode(), "text/plain"))) + + + + files.append(("archive", self.archive.to_tuple())) + + + + if not isinstance(self.ttl_seconds, Unset): + files.append(("ttl_seconds", (None, str(self.ttl_seconds).encode(), "text/plain"))) + + + + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + + + return files + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + name = d.pop("name") + + archive = File( + payload = BytesIO(d.pop("archive")) + ) + + + + + ttl_seconds = d.pop("ttl_seconds", UNSET) + + create_frontend_candidate_body = cls( + name=name, + archive=archive, + ttl_seconds=ttl_seconds, + ) + + + create_frontend_candidate_body.additional_properties = d + return create_frontend_candidate_body + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/create_frontend_deployment_request.py b/src/volcano_sdk/_generated/models/create_frontend_deployment_request.py new file mode 100644 index 00000000..efe49b2e --- /dev/null +++ b/src/volcano_sdk/_generated/models/create_frontend_deployment_request.py @@ -0,0 +1,64 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from uuid import UUID + + + + + + +T = TypeVar("T", bound="CreateFrontendDeploymentRequest") + + + +@_attrs_define +class CreateFrontendDeploymentRequest: + """ Deploys the build of an existing deployment instead of compiling the frontend's source. + + Attributes: + source_deployment_id (UUID): An `active` or `degraded` deployment of another frontend in the same project. Its + build is copied to this frontend and published without compiling it again. + """ + + source_deployment_id: UUID + + + + + + def to_dict(self) -> dict[str, Any]: + source_deployment_id = str(self.source_deployment_id) + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "source_deployment_id": source_deployment_id, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + source_deployment_id = UUID(d.pop("source_deployment_id")) + + + + + create_frontend_deployment_request = cls( + source_deployment_id=source_deployment_id, + ) + + return create_frontend_deployment_request + diff --git a/src/volcano_sdk/_generated/models/create_frontend_domain_request.py b/src/volcano_sdk/_generated/models/create_frontend_domain_request.py new file mode 100644 index 00000000..e69977f4 --- /dev/null +++ b/src/volcano_sdk/_generated/models/create_frontend_domain_request.py @@ -0,0 +1,101 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.frontend_custom_domain_redirect_request import FrontendCustomDomainRedirectRequest + from ..models.frontend_custom_domain_tls_config import FrontendCustomDomainTLSConfig + + + + + +T = TypeVar("T", bound="CreateFrontendDomainRequest") + + + +@_attrs_define +class CreateFrontendDomainRequest: + """ + Attributes: + domain (str): Fully-qualified domain name (hostname only, no scheme/path). Managed TLS (`tls.mode: managed`) + accepts at most 219 characters; BYOC accepts 253. Example: www.example.com. + tls (FrontendCustomDomainTLSConfig): TLS for a new custom domain. With `mode: managed`, Volcano issues and + renews the certificate; omit every PEM field. With `mode: byoc`, send both `certificate_pem` and + `private_key_pem`, plus an optional `certificate_chain_pem`. + redirect (FrontendCustomDomainRedirectRequest | Unset): Redirects every request for the domain to `to`, another + active domain of the same frontend that serves it, keeping the path and query string. + """ + + domain: str + tls: FrontendCustomDomainTLSConfig + redirect: FrontendCustomDomainRedirectRequest | Unset = UNSET + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.frontend_custom_domain_redirect_request import FrontendCustomDomainRedirectRequest # noqa: PLC0415 + from ..models.frontend_custom_domain_tls_config import FrontendCustomDomainTLSConfig # noqa: PLC0415 + domain = self.domain + + tls = self.tls.to_dict() + + redirect: dict[str, Any] | Unset = UNSET + if not isinstance(self.redirect, Unset): + redirect = self.redirect.to_dict() + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "domain": domain, + "tls": tls, + }) + if redirect is not UNSET: + field_dict["redirect"] = redirect + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.frontend_custom_domain_redirect_request import FrontendCustomDomainRedirectRequest # noqa: PLC0415 + from ..models.frontend_custom_domain_tls_config import FrontendCustomDomainTLSConfig # noqa: PLC0415 + d = dict(src_dict) + domain = d.pop("domain") + + tls = FrontendCustomDomainTLSConfig.from_dict(d.pop("tls")) + + + + + _redirect = d.pop("redirect", UNSET) + redirect: FrontendCustomDomainRedirectRequest | Unset + if isinstance(_redirect, Unset): + redirect = UNSET + else: + redirect = FrontendCustomDomainRedirectRequest.from_dict(_redirect) + + + + + create_frontend_domain_request = cls( + domain=domain, + tls=tls, + redirect=redirect, + ) + + return create_frontend_domain_request + diff --git a/src/volcano_sdk/_generated/models/create_frontend_route_request.py b/src/volcano_sdk/_generated/models/create_frontend_route_request.py new file mode 100644 index 00000000..617cb674 --- /dev/null +++ b/src/volcano_sdk/_generated/models/create_frontend_route_request.py @@ -0,0 +1,70 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from uuid import UUID + + + + + + +T = TypeVar("T", bound="CreateFrontendRouteRequest") + + + +@_attrs_define +class CreateFrontendRouteRequest: + """ + Attributes: + target_frontend_id (UUID): The Frontend to mount. It must be another Frontend in the Project. + path_prefix (str): + """ + + target_frontend_id: UUID + path_prefix: str + + + + + + def to_dict(self) -> dict[str, Any]: + target_frontend_id = str(self.target_frontend_id) + + path_prefix = self.path_prefix + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "target_frontend_id": target_frontend_id, + "path_prefix": path_prefix, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + target_frontend_id = UUID(d.pop("target_frontend_id")) + + + + + path_prefix = d.pop("path_prefix") + + create_frontend_route_request = cls( + target_frontend_id=target_frontend_id, + path_prefix=path_prefix, + ) + + return create_frontend_route_request + diff --git a/src/volcano_sdk/_generated/models/create_function_body.py b/src/volcano_sdk/_generated/models/create_function_body.py index b9eac419..b969a2ef 100644 --- a/src/volcano_sdk/_generated/models/create_function_body.py +++ b/src/volcano_sdk/_generated/models/create_function_body.py @@ -43,13 +43,16 @@ class CreateFunctionBody: code (File): ZIP or tar.gz archive containing function source code plus dependency manifests/lockfiles. The API enforces SOURCE_ARCHIVE_SIZE_LIMIT_MB and stores a normalized tar.gz source archive. runtime (CreateFunctionBodyRuntime): Runtime environment. Required. - - Node.js: nodejs22.x, nodejs24.x - - Python: python3.10, python3.11, python3.12, python3.13, python3.14 + - Node.js: nodejs22.x, nodejs24.x, nodejs26.x + - Python: python3.10, python3.11, python3.12, python3.13, python3.14, python3.15 - Ruby: ruby3.3, ruby3.4, ruby4.0 + + python3.10 is deprecated: it still deploys, and Volcano will remove it before 2027-08-31. Example: nodejs24.x. handler (str | Unset): The name of the function to invoke. Defaults to "handler" if not specified. Your code must export/define a function with this name: - - Node.js: exports.handler (in index.js) + - Node.js: exports.handler (in index.js, index.mjs or index.cjs, or in TypeScript in index.ts, index.mts, + index.cts or index.tsx, which the build compiles without type-checking) - Python: def handler() (in main.py) - Ruby: def handler() (in main.rb) Default: 'handler'. Example: handler. @@ -80,6 +83,14 @@ class CreateFunctionBody: detected in its source. A declared name the project does not define is rejected with 400; a detected name it does not define is ignored. Only used when `variable_scope` is `scoped`. Omitting this leaves an existing function's declared names unchanged. + commit (str | Unset): JSON-encoded commit the uploaded source came from: `{"repository": "acme/app", "sha": + "<40-character commit ID>", "dirty": false}`. `repository` is `owner/name` or a github.com remote URL + (`https://github.com/acme/app.git`, `git@github.com:acme/app.git`, or `ssh://git@github.com/acme/app.git`); + Volcano drops any credentials in the URL and records `owner/name`. `dirty` is `true` when the uploaded files + differ from the commit. All three fields are required, and fields Volcano does not know are ignored. An empty + value, `null`, or `""` reports no commit. A malformed commit, or a repository not on GitHub, returns 400 before + anything is deployed. Volcano records a function's commit with `commit.verified: false`; a clean commit of the + project's connected repository that its production branch holds gets `commit.verification: repository`. """ name: str @@ -93,6 +104,7 @@ class CreateFunctionBody: openapi_spec: str | Unset = UNSET variable_scope: CreateFunctionBodyVariableScope | Unset = UNSET variables: str | Unset = UNSET + commit: str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -135,6 +147,8 @@ def to_dict(self) -> dict[str, Any]: variables = self.variables + commit = self.commit + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -159,6 +173,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["variable_scope"] = variable_scope if variables is not UNSET: field_dict["variables"] = variables + if commit is not UNSET: + field_dict["commit"] = commit return field_dict @@ -218,6 +234,11 @@ def to_multipart(self) -> types.RequestFiles: + if not isinstance(self.commit, Unset): + files.append(("commit", (None, str(self.commit).encode(), "text/plain"))) + + + for prop_name, prop in self.additional_properties.items(): files.append((prop_name, (None, str(prop).encode(), "text/plain"))) @@ -292,6 +313,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: variables = d.pop("variables", UNSET) + commit = d.pop("commit", UNSET) + create_function_body = cls( name=name, code=code, @@ -304,6 +327,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: openapi_spec=openapi_spec, variable_scope=variable_scope, variables=variables, + commit=commit, ) diff --git a/src/volcano_sdk/_generated/models/create_function_body_runtime.py b/src/volcano_sdk/_generated/models/create_function_body_runtime.py index e4160834..1ed6bded 100644 --- a/src/volcano_sdk/_generated/models/create_function_body_runtime.py +++ b/src/volcano_sdk/_generated/models/create_function_body_runtime.py @@ -1,8 +1,8 @@ from typing import Literal -CreateFunctionBodyRuntime = Literal['nodejs22.x', 'nodejs24.x', 'python3.10', 'python3.11', 'python3.12', 'python3.13', 'python3.14', 'ruby3.3', 'ruby3.4', 'ruby4.0'] +CreateFunctionBodyRuntime = Literal['nodejs22.x', 'nodejs24.x', 'nodejs26.x', 'python3.10', 'python3.11', 'python3.12', 'python3.13', 'python3.14', 'python3.15', 'ruby3.3', 'ruby3.4', 'ruby4.0'] -CREATE_FUNCTION_BODY_RUNTIME_VALUES: set[CreateFunctionBodyRuntime] = { 'nodejs22.x', 'nodejs24.x', 'python3.10', 'python3.11', 'python3.12', 'python3.13', 'python3.14', 'ruby3.3', 'ruby3.4', 'ruby4.0', } +CREATE_FUNCTION_BODY_RUNTIME_VALUES: set[CreateFunctionBodyRuntime] = { 'nodejs22.x', 'nodejs24.x', 'nodejs26.x', 'python3.10', 'python3.11', 'python3.12', 'python3.13', 'python3.14', 'python3.15', 'ruby3.3', 'ruby3.4', 'ruby4.0', } def check_create_function_body_runtime(value: str) -> CreateFunctionBodyRuntime: if value in CREATE_FUNCTION_BODY_RUNTIME_VALUES: diff --git a/src/volcano_sdk/_generated/models/create_function_candidate_body.py b/src/volcano_sdk/_generated/models/create_function_candidate_body.py new file mode 100644 index 00000000..8aad928c --- /dev/null +++ b/src/volcano_sdk/_generated/models/create_function_candidate_body.py @@ -0,0 +1,130 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +import json +from .. import types + +from ..types import UNSET, Unset + +from ..types import File, FileTypes +from ..types import UNSET, Unset +from io import BytesIO + + + + + + +T = TypeVar("T", bound="CreateFunctionCandidateBody") + + + +@_attrs_define +class CreateFunctionCandidateBody: + """ + Attributes: + name (str): Names the preview within the function. Cannot be `production`. + code (File): The function's source archive, as for deploying the function. Built with the function's runtime and + handler. + ttl_seconds (int | Unset): Deletes the preview this many seconds after it is created, at most 30 days. Omit to + keep it until deleted. + """ + + name: str + code: File + ttl_seconds: int | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + name = self.name + + code = self.code.to_tuple() + + + ttl_seconds = self.ttl_seconds + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "name": name, + "code": code, + }) + if ttl_seconds is not UNSET: + field_dict["ttl_seconds"] = ttl_seconds + + return field_dict + + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("name", (None, str(self.name).encode(), "text/plain"))) + + + + files.append(("code", self.code.to_tuple())) + + + + if not isinstance(self.ttl_seconds, Unset): + files.append(("ttl_seconds", (None, str(self.ttl_seconds).encode(), "text/plain"))) + + + + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + + + return files + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + name = d.pop("name") + + code = File( + payload = BytesIO(d.pop("code")) + ) + + + + + ttl_seconds = d.pop("ttl_seconds", UNSET) + + create_function_candidate_body = cls( + name=name, + code=code, + ttl_seconds=ttl_seconds, + ) + + + create_function_candidate_body.additional_properties = d + return create_function_candidate_body + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/create_functions_batch_body.py b/src/volcano_sdk/_generated/models/create_functions_batch_body.py index eda92542..f1913b12 100644 --- a/src/volcano_sdk/_generated/models/create_functions_batch_body.py +++ b/src/volcano_sdk/_generated/models/create_functions_batch_body.py @@ -40,6 +40,11 @@ class CreateFunctionsBatchBody: it must not deploy without the variable. The request is rejected with 400 before anything is deployed if a scoped function declares a variable the project does not define, or if the resulting environment exceeds 4096 bytes. + + Each entry may also carry `commit`, the commit its source came from, as an object: `{"repository": "acme/app", + "sha": "<40-character commit ID>", "dirty": false}`. It takes the same values as the `commit` field of a single + function upload; `null` or `""` reports no commit. The request is rejected with 400 before anything is deployed + if an entry's commit is malformed or names a repository not on GitHub. code_0 (File | Unset): Function ZIP or tar.gz archive referenced by the first manifest entry's `file_field`; additional code_N file fields may be included. Each archive is subject to SOURCE_ARCHIVE_SIZE_LIMIT_MB. """ diff --git a/src/volcano_sdk/_generated/models/create_git_deployment_run_request.py b/src/volcano_sdk/_generated/models/create_git_deployment_run_request.py new file mode 100644 index 00000000..1489b38d --- /dev/null +++ b/src/volcano_sdk/_generated/models/create_git_deployment_run_request.py @@ -0,0 +1,61 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset + + + + + + +T = TypeVar("T", bound="CreateGitDeploymentRunRequest") + + + +@_attrs_define +class CreateGitDeploymentRunRequest: + """ + Attributes: + force (bool | Unset): Deploy every configured function and frontend, even one the project's `skip_unchanged` + setting would leave on its current deployment. Applies to this run only. Default: False. + """ + + force: bool | Unset = False + + + + + + def to_dict(self) -> dict[str, Any]: + force = self.force + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + }) + if force is not UNSET: + field_dict["force"] = force + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + force = d.pop("force", UNSET) + + create_git_deployment_run_request = cls( + force=force, + ) + + return create_git_deployment_run_request + diff --git a/src/volcano_sdk/_generated/models/create_issue_request.py b/src/volcano_sdk/_generated/models/create_issue_request.py new file mode 100644 index 00000000..f5b3c88c --- /dev/null +++ b/src/volcano_sdk/_generated/models/create_issue_request.py @@ -0,0 +1,103 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset +from uuid import UUID + + + + + + +T = TypeVar("T", bound="CreateIssueRequest") + + + +@_attrs_define +class CreateIssueRequest: + """ The project, and an issue a person writes on it, describing what to fix. + + Attributes: + project_id (UUID): The project to write the issue on. + description (str): What to fix, in your words, up to 4,000 characters. It can span lines. Leading and trailing + whitespace is trimmed, and a description of only whitespace is refused. + start_run_idempotency_key (UUID | Unset): Queue a LavaFlow run with the issue. Reuse this key when retrying the + same submission. + title (str | Unset): A title, on one line, up to 200 characters; whitespace, line breaks included, collapses to + single spaces. Omitted, the title is the description's first line, cut to 80 characters with an ellipsis. + """ + + project_id: UUID + description: str + start_run_idempotency_key: UUID | Unset = UNSET + title: str | Unset = UNSET + + + + + + def to_dict(self) -> dict[str, Any]: + project_id = str(self.project_id) + + description = self.description + + start_run_idempotency_key: str | Unset = UNSET + if not isinstance(self.start_run_idempotency_key, Unset): + start_run_idempotency_key = str(self.start_run_idempotency_key) + + title = self.title + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "project_id": project_id, + "description": description, + }) + if start_run_idempotency_key is not UNSET: + field_dict["start_run_idempotency_key"] = start_run_idempotency_key + if title is not UNSET: + field_dict["title"] = title + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + project_id = UUID(d.pop("project_id")) + + + + + description = d.pop("description") + + _start_run_idempotency_key = d.pop("start_run_idempotency_key", UNSET) + start_run_idempotency_key: UUID | Unset + if isinstance(_start_run_idempotency_key, Unset): + start_run_idempotency_key = UNSET + else: + start_run_idempotency_key = UUID(_start_run_idempotency_key) + + + + + title = d.pop("title", UNSET) + + create_issue_request = cls( + project_id=project_id, + description=description, + start_run_idempotency_key=start_run_idempotency_key, + title=title, + ) + + return create_issue_request + diff --git a/src/volcano_sdk/_generated/models/create_project_request.py b/src/volcano_sdk/_generated/models/create_project_request.py index 1b25095e..803a4bc5 100644 --- a/src/volcano_sdk/_generated/models/create_project_request.py +++ b/src/volcano_sdk/_generated/models/create_project_request.py @@ -27,16 +27,16 @@ class CreateProjectRequest: """ Request to create a new project Attributes: - name (str): Project name (must be unique). + name (str): Project name. A name you already use is not refused: the project is + created with a short random suffix added to it. Can only contain letters, numbers, underscores, and hyphens. Example: my-awesome-app. template_id (CreateProjectRequestTemplateId | Unset): Optional trusted starter template identifier. The server resolves immutable source and database initialization artifacts. Callers cannot supply artifact locations or database credentials. Creation accepts an asynchronous installation; poll the individual project until template_installation.status is ready before using the app. Use pixel-board, trellini, or collab-pad for the - configured starter bundles. The official-starter legacy identifier has environment-specific availability. Cannot - be combined with initialPrompt. Example: pixel-board. - initial_prompt (str | Unset): Optional initial builder prompt. Cannot be combined with template_id. + configured starter bundles. The official-starter legacy identifier has environment-specific availability. + Example: pixel-board. all_regions (bool | Unset): Optional region policy. - `true` (default): project functions deploy to all configured regions - `false`: project deploys only to `selected_regions` @@ -48,7 +48,6 @@ class CreateProjectRequest: name: str template_id: CreateProjectRequestTemplateId | Unset = UNSET - initial_prompt: str | Unset = UNSET all_regions: bool | Unset = True selected_regions: list[str] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -65,8 +64,6 @@ def to_dict(self) -> dict[str, Any]: template_id = self.template_id - initial_prompt = self.initial_prompt - all_regions = self.all_regions selected_regions: list[str] | Unset = UNSET @@ -83,8 +80,6 @@ def to_dict(self) -> dict[str, Any]: }) if template_id is not UNSET: field_dict["template_id"] = template_id - if initial_prompt is not UNSET: - field_dict["initialPrompt"] = initial_prompt if all_regions is not UNSET: field_dict["all_regions"] = all_regions if selected_regions is not UNSET: @@ -109,8 +104,6 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - initial_prompt = d.pop("initialPrompt", UNSET) - all_regions = d.pop("all_regions", UNSET) selected_regions = cast(list[str], d.pop("selected_regions", UNSET)) @@ -119,7 +112,6 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: create_project_request = cls( name=name, template_id=template_id, - initial_prompt=initial_prompt, all_regions=all_regions, selected_regions=selected_regions, ) diff --git a/src/volcano_sdk/_generated/models/create_service_key_body.py b/src/volcano_sdk/_generated/models/create_service_key_body.py index 875d490a..434a3223 100644 --- a/src/volcano_sdk/_generated/models/create_service_key_body.py +++ b/src/volcano_sdk/_generated/models/create_service_key_body.py @@ -32,9 +32,19 @@ class CreateServiceKeyBody: 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, project locks, and server-side auth proxy + storage object operations, project locks, sandboxes, and server-side auth proxy metadata (auth.signin, auth.signup, auth.refresh, auth.logout, - auth.password_reset). + auth.password_reset). A key scoped to a list without "*" reads, stops, + and messages a durable execution only with the `client_token` its + start returned. Today the scope doesn't restrict the database API, and + restricts realtime only on a durable run's channel: every service key + queries every table with RLS bypassed, subscribes to every other channel, + and publishes on broadcast channels. Once Volcano applies scopes to the + database API and realtime, a key without "*" gets 403 from the database + API, needs realtime.subscribe for broadcast and presence channels and + realtime.publish to publish, and needs "*" for table changes. `ai.invoke` + and `grants.mint` are reserved: "*" doesn't include them, only a person + may ask for one, and it must be the key's only permission. Example: ['functions.invoke', 'locks.manage']. """ diff --git a/src/volcano_sdk/_generated/models/created_project_access_token.py b/src/volcano_sdk/_generated/models/created_project_access_token.py index a4c71aec..131db4de 100644 --- a/src/volcano_sdk/_generated/models/created_project_access_token.py +++ b/src/volcano_sdk/_generated/models/created_project_access_token.py @@ -8,8 +8,8 @@ from ..types import UNSET, Unset -from ..models.project_access_token_scope import check_project_access_token_scope -from ..models.project_access_token_scope import ProjectAccessTokenScope +from ..models.project_access_token_listed_scope import check_project_access_token_listed_scope +from ..models.project_access_token_listed_scope import ProjectAccessTokenListedScope from ..models.project_access_token_status import check_project_access_token_status from ..models.project_access_token_status import ProjectAccessTokenStatus from ..models.project_access_token_token_source import check_project_access_token_token_source @@ -36,25 +36,12 @@ class CreatedProjectAccessToken: project_id (UUID): name (str): Unique per project. token_prefix (str): First 12 characters of the secret, for recognising a token in a list. - scope (ProjectAccessTokenScope): 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. + scope (ProjectAccessTokenListedScope): A listed token's scope. `full` and `read_only` are the scopes you + choose when you create a token; see `ProjectAccessTokenScope`. + + `delegated` marks a delegated grant: a `pg-` token a first-party app + minted for one run from the access you allowed it. It is listed only + with `include_delegated=true`, and you cannot create one. status (ProjectAccessTokenStatus): `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 @@ -76,7 +63,7 @@ class CreatedProjectAccessToken: project_id: UUID name: str token_prefix: str - scope: ProjectAccessTokenScope + scope: ProjectAccessTokenListedScope status: ProjectAccessTokenStatus token_source: ProjectAccessTokenTokenSource created_at: datetime.datetime @@ -168,7 +155,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: token_prefix = d.pop("token_prefix") - scope = check_project_access_token_scope(d.pop("scope")) + scope = check_project_access_token_listed_scope(d.pop("scope")) diff --git a/src/volcano_sdk/_generated/models/database_backup.py b/src/volcano_sdk/_generated/models/database_backup.py index 815e688b..1a1a82b7 100644 --- a/src/volcano_sdk/_generated/models/database_backup.py +++ b/src/volcano_sdk/_generated/models/database_backup.py @@ -34,9 +34,9 @@ class DatabaseBackup: Attributes: name (str): Backup name, unique within the database. Backups you create are named by you; scheduled backups are named by the storage provider. - source (DatabaseBackupSource): Whether the backup was requested explicitly or produced by the - backup schedule. Only `manual` backups count against the plan's - backup allowance. + source (DatabaseBackupSource): Whether the backup was requested explicitly, produced by the backup + schedule, or taken before migrations were applied to the database. + Only `manual` backups count against the plan's backup allowance. created_at (datetime.datetime): The point in time the backup captures. size_bytes (int | Unset): Storage the backup occupies. Absent until the provider has costed it, which takes a few minutes after the backup is taken; absent is diff --git a/src/volcano_sdk/_generated/models/database_backup_source.py b/src/volcano_sdk/_generated/models/database_backup_source.py index dc8e5143..334dbde2 100644 --- a/src/volcano_sdk/_generated/models/database_backup_source.py +++ b/src/volcano_sdk/_generated/models/database_backup_source.py @@ -1,8 +1,8 @@ from typing import Literal -DatabaseBackupSource = Literal['manual', 'scheduled'] +DatabaseBackupSource = Literal['manual', 'migration', 'scheduled'] -DATABASE_BACKUP_SOURCE_VALUES: set[DatabaseBackupSource] = { 'manual', 'scheduled', } +DATABASE_BACKUP_SOURCE_VALUES: set[DatabaseBackupSource] = { 'manual', 'migration', 'scheduled', } def check_database_backup_source(value: str) -> DatabaseBackupSource: if value in DATABASE_BACKUP_SOURCE_VALUES: diff --git a/src/volcano_sdk/_generated/models/database_migration_baseline.py b/src/volcano_sdk/_generated/models/database_migration_baseline.py new file mode 100644 index 00000000..7b14d06a --- /dev/null +++ b/src/volcano_sdk/_generated/models/database_migration_baseline.py @@ -0,0 +1,81 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast + + + + + + +T = TypeVar("T", bound="DatabaseMigrationBaseline") + + + +@_attrs_define +class DatabaseMigrationBaseline: + """ + Attributes: + recorded (list[str]): The files this request recorded, in name order. Empty when the + history already recorded every file. + """ + + recorded: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + recorded = self.recorded + + + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "recorded": recorded, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + recorded = cast(list[str], d.pop("recorded")) + + + database_migration_baseline = cls( + recorded=recorded, + ) + + + database_migration_baseline.additional_properties = d + return database_migration_baseline + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/database_migration_conflict_error.py b/src/volcano_sdk/_generated/models/database_migration_conflict_error.py new file mode 100644 index 00000000..49f69a79 --- /dev/null +++ b/src/volcano_sdk/_generated/models/database_migration_conflict_error.py @@ -0,0 +1,115 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset +from uuid import UUID + + + + + + +T = TypeVar("T", bound="DatabaseMigrationConflictError") + + + +@_attrs_define +class DatabaseMigrationConflictError: + """ A migration request refused by the database's state. With code + `migration_run_in_progress`, `run_id` names the run that is queued or + running. + + Attributes: + error (str): + code (str | Unset): Stable machine-readable error code when a specific recovery path is available. + `plan_required` (403) means the project owner's plan does not include the requested feature or option; upgrading + the plan unlocks it. `person_required` (403) means a project access token tried to change LavaFlow settings, + which only the project's owner changes, with a platform token, or that the change needs the owner's own + credential that expires, a project repository, and an owner whose GitHub account can push to it; `error` says + which. A 403 without a code leaves the reason unspecified: it can be an access refusal, a reached limit, or a + plan check that could not read the owner's plan. Match on the code, not the message text. + run_id (UUID | Unset): + """ + + error: str + code: str | Unset = UNSET + run_id: UUID | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + error = self.error + + code = self.code + + run_id: str | Unset = UNSET + if not isinstance(self.run_id, Unset): + run_id = str(self.run_id) + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "error": error, + }) + if code is not UNSET: + field_dict["code"] = code + if run_id is not UNSET: + field_dict["run_id"] = run_id + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + error = d.pop("error") + + code = d.pop("code", UNSET) + + _run_id = d.pop("run_id", UNSET) + run_id: UUID | Unset + if isinstance(_run_id, Unset): + run_id = UNSET + else: + run_id = UUID(_run_id) + + + + + database_migration_conflict_error = cls( + error=error, + code=code, + run_id=run_id, + ) + + + database_migration_conflict_error.additional_properties = d + return database_migration_conflict_error + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/database_migration_file.py b/src/volcano_sdk/_generated/models/database_migration_file.py new file mode 100644 index 00000000..f5797a23 --- /dev/null +++ b/src/volcano_sdk/_generated/models/database_migration_file.py @@ -0,0 +1,100 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="DatabaseMigrationFile") + + + +@_attrs_define +class DatabaseMigrationFile: + """ One migration file and its SQL. + + Attributes: + name (str): The file's path under `volcano/migrations/`: a file name such as + `001_create_users.sql`, or `/001_create_users.sql` in a + project with more than one database, where `` must be + this database. Every file in a request takes the same form. Files + run in byte order of their file name, which the history records. + Example: 001_create_users.sql. + sql (str): The file's SQL, at most 1 MiB. A file may hold several statements + and runs in one transaction. A file cannot commit, roll back, use + savepoints, or `COPY` from the client; such a file fails with + `migration_failed`. A statement that cannot run in a transaction, + such as `CREATE INDEX CONCURRENTLY`, goes alone in a file whose + first line is `-- volcano:no-transaction`. That file runs outside a + transaction and runs again from its start when a run retries it. A + run refuses with `invalid_file`, before anything runs, a file with + the marker on any other line, and a marked file that builds an + unnamed index with `CREATE INDEX CONCURRENTLY` or starts with + `COPY`. + """ + + name: str + sql: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + name = self.name + + sql = self.sql + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "name": name, + "sql": sql, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + name = d.pop("name") + + sql = d.pop("sql") + + database_migration_file = cls( + name=name, + sql=sql, + ) + + + database_migration_file.additional_properties = d + return database_migration_file + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/database_migration_file_error.py b/src/volcano_sdk/_generated/models/database_migration_file_error.py new file mode 100644 index 00000000..fb14bcb2 --- /dev/null +++ b/src/volcano_sdk/_generated/models/database_migration_file_error.py @@ -0,0 +1,104 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset + + + + + + +T = TypeVar("T", bound="DatabaseMigrationFileError") + + + +@_attrs_define +class DatabaseMigrationFileError: + """ The database's error for a `failed` file, or for an `unknown` file + that runs outside a transaction, when a later attempt failed it after + an earlier one may have run it. `message` is the database's own + message and can quote values from the file or the data. + + Attributes: + message (str): At most 8 KiB (8,192 bytes). A longer message is cut and ends with + ` … [truncated]`. Volcano reads each reply the database sends about + the file up to 4 MiB, which leaves room for a reply that quotes the + whole file twice. A larger reply is not read: the file fails, and + this message says so instead. + Example: column "email" of relation "users" already exists. + sqlstate (str | Unset): The Postgres error code, when the database reported one. Example: 42701. + line (int | Unset): The line of the file the database reported, when known. + """ + + message: str + sqlstate: str | Unset = UNSET + line: int | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + message = self.message + + sqlstate = self.sqlstate + + line = self.line + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "message": message, + }) + if sqlstate is not UNSET: + field_dict["sqlstate"] = sqlstate + if line is not UNSET: + field_dict["line"] = line + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + message = d.pop("message") + + sqlstate = d.pop("sqlstate", UNSET) + + line = d.pop("line", UNSET) + + database_migration_file_error = cls( + message=message, + sqlstate=sqlstate, + line=line, + ) + + + database_migration_file_error.additional_properties = d + return database_migration_file_error + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/database_migration_files_request.py b/src/volcano_sdk/_generated/models/database_migration_files_request.py new file mode 100644 index 00000000..41f6ad0f --- /dev/null +++ b/src/volcano_sdk/_generated/models/database_migration_files_request.py @@ -0,0 +1,94 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast + +if TYPE_CHECKING: + from ..models.database_migration_file import DatabaseMigrationFile + + + + + +T = TypeVar("T", bound="DatabaseMigrationFilesRequest") + + + +@_attrs_define +class DatabaseMigrationFilesRequest: + """ + Attributes: + files (list[DatabaseMigrationFile]): + """ + + files: list[DatabaseMigrationFile] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.database_migration_file import DatabaseMigrationFile # noqa: PLC0415 + files = [] + for files_item_data in self.files: + files_item = files_item_data.to_dict() + files.append(files_item) + + + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "files": files, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.database_migration_file import DatabaseMigrationFile # noqa: PLC0415 + d = dict(src_dict) + files = [] + _files = d.pop("files") + for files_item_data in (_files): + files_item = DatabaseMigrationFile.from_dict(files_item_data) + + + + files.append(files_item) + + + database_migration_files_request = cls( + files=files, + ) + + + database_migration_files_request.additional_properties = d + return database_migration_files_request + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/database_migration_history_entry.py b/src/volcano_sdk/_generated/models/database_migration_history_entry.py new file mode 100644 index 00000000..adc60a27 --- /dev/null +++ b/src/volcano_sdk/_generated/models/database_migration_history_entry.py @@ -0,0 +1,136 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.database_migration_history_entry_status import check_database_migration_history_entry_status +from ..models.database_migration_history_entry_status import DatabaseMigrationHistoryEntryStatus +from ..types import UNSET, Unset +from typing import cast +from uuid import UUID +import datetime + + + + + + +T = TypeVar("T", bound="DatabaseMigrationHistoryEntry") + + + +@_attrs_define +class DatabaseMigrationHistoryEntry: + """ One file the database's migration history records. + + Attributes: + name (str): Example: 001_create_users.sql. + checksum (str): `sha256:` and the hex digest of the file as recorded, with a leading + byte order mark removed and CRLF line endings converted to LF. + Example: sha256:9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08. + status (DatabaseMigrationHistoryEntryStatus): `applied`: a run ran the file and it committed. `baselined`: the + file + was recorded as applied without running. + applied_at (datetime.datetime): + run_id (UUID | Unset): The run that recorded the file. Absent for a baseline. + """ + + name: str + checksum: str + status: DatabaseMigrationHistoryEntryStatus + applied_at: datetime.datetime + run_id: UUID | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + name = self.name + + checksum = self.checksum + + status: str = self.status + + applied_at = self.applied_at.isoformat() + + run_id: str | Unset = UNSET + if not isinstance(self.run_id, Unset): + run_id = str(self.run_id) + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "name": name, + "checksum": checksum, + "status": status, + "applied_at": applied_at, + }) + if run_id is not UNSET: + field_dict["run_id"] = run_id + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + name = d.pop("name") + + checksum = d.pop("checksum") + + status = check_database_migration_history_entry_status(d.pop("status")) + + + + + applied_at = datetime.datetime.fromisoformat(d.pop("applied_at")) + + + + + _run_id = d.pop("run_id", UNSET) + run_id: UUID | Unset + if isinstance(_run_id, Unset): + run_id = UNSET + else: + run_id = UUID(_run_id) + + + + + database_migration_history_entry = cls( + name=name, + checksum=checksum, + status=status, + applied_at=applied_at, + run_id=run_id, + ) + + + database_migration_history_entry.additional_properties = d + return database_migration_history_entry + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/database_migration_history_entry_status.py b/src/volcano_sdk/_generated/models/database_migration_history_entry_status.py new file mode 100644 index 00000000..23c13ca8 --- /dev/null +++ b/src/volcano_sdk/_generated/models/database_migration_history_entry_status.py @@ -0,0 +1,10 @@ +from typing import Literal + +DatabaseMigrationHistoryEntryStatus = Literal['applied', 'baselined'] + +DATABASE_MIGRATION_HISTORY_ENTRY_STATUS_VALUES: set[DatabaseMigrationHistoryEntryStatus] = { 'applied', 'baselined', } + +def check_database_migration_history_entry_status(value: str) -> DatabaseMigrationHistoryEntryStatus: + if value in DATABASE_MIGRATION_HISTORY_ENTRY_STATUS_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {DATABASE_MIGRATION_HISTORY_ENTRY_STATUS_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/database_migration_run.py b/src/volcano_sdk/_generated/models/database_migration_run.py new file mode 100644 index 00000000..59bb1f3c --- /dev/null +++ b/src/volcano_sdk/_generated/models/database_migration_run.py @@ -0,0 +1,307 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.database_migration_run_phase import check_database_migration_run_phase +from ..models.database_migration_run_phase import DatabaseMigrationRunPhase +from ..models.database_migration_run_source import check_database_migration_run_source +from ..models.database_migration_run_source import DatabaseMigrationRunSource +from ..models.database_migration_run_status import check_database_migration_run_status +from ..models.database_migration_run_status import DatabaseMigrationRunStatus +from ..types import UNSET, Unset +from typing import cast +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.database_migration_run_error import DatabaseMigrationRunError + from ..models.database_migration_run_file import DatabaseMigrationRunFile + from ..models.database_migration_warning import DatabaseMigrationWarning + from ..models.resource_reference import ResourceReference + + + + + +T = TypeVar("T", bound="DatabaseMigrationRun") + + + +@_attrs_define +class DatabaseMigrationRun: + """ One application of migration files to a database. A run plans the files + against the database's history, rehearses the pending ones on a + short-lived branch, takes a backup, and applies them. + + Attributes: + id (UUID): + database (ResourceReference): Stable reference to a Volcano resource. + status (DatabaseMigrationRunStatus): `queued` and `running` mean the run has not ended; a run waiting + to retry stays `running`. `succeeded`: every pending file was + applied, or none was pending. `failed`: `error` says why. + phase (DatabaseMigrationRunPhase): The step the run is on, or the one it ended on. `plan` compares the + files with the history. `rehearse` applies the pending files to a + short-lived branch of the database, which is deleted afterwards. + `backup` takes the backup named by `backup_name`. `apply` applies + the files to the database. + source (DatabaseMigrationRunSource): What started the run. + warnings (list[DatabaseMigrationWarning]): A run keeps at most 100 warnings, keeping those about the run, such + as a skipped backup, ahead of those about files. A run that raised + more ends the list with a `warnings_truncated` warning. + created_at (datetime.datetime): + updated_at (datetime.datetime): + commit_sha (str | Unset): The commit whose files the run applies. Present for `git_deploy` runs. + backup_name (str | Unset): The backup the run takes before it applies the files, named once + the run starts taking it. It is listed with the database's backups + with `source: migration`. A run that ended in its `backup` phase + may name a backup that was never created. + Example: before-migration-7f3a1c2e-5d4b-4a91-8c6f-2b1e9d0a4c73. + files (list[DatabaseMigrationRunFile] | Unset): The run's files, in the order they run, with what became of + each. + Absent when listing runs. + error (DatabaseMigrationRunError | Unset): Why the run failed, or why its last attempt did. + started_at (datetime.datetime | Unset): When a worker first picked the run up. + completed_at (datetime.datetime | Unset): + """ + + id: UUID + database: ResourceReference + status: DatabaseMigrationRunStatus + phase: DatabaseMigrationRunPhase + source: DatabaseMigrationRunSource + warnings: list[DatabaseMigrationWarning] + created_at: datetime.datetime + updated_at: datetime.datetime + commit_sha: str | Unset = UNSET + backup_name: str | Unset = UNSET + files: list[DatabaseMigrationRunFile] | Unset = UNSET + error: DatabaseMigrationRunError | Unset = UNSET + started_at: datetime.datetime | Unset = UNSET + completed_at: datetime.datetime | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.database_migration_run_error import DatabaseMigrationRunError # noqa: PLC0415 + from ..models.database_migration_run_file import DatabaseMigrationRunFile # noqa: PLC0415 + from ..models.database_migration_warning import DatabaseMigrationWarning # noqa: PLC0415 + from ..models.resource_reference import ResourceReference # noqa: PLC0415 + id = str(self.id) + + database = self.database.to_dict() + + status: str = self.status + + phase: str = self.phase + + source: str = self.source + + warnings = [] + for warnings_item_data in self.warnings: + warnings_item = warnings_item_data.to_dict() + warnings.append(warnings_item) + + + + created_at = self.created_at.isoformat() + + updated_at = self.updated_at.isoformat() + + commit_sha = self.commit_sha + + backup_name = self.backup_name + + files: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.files, Unset): + files = [] + for files_item_data in self.files: + files_item = files_item_data.to_dict() + files.append(files_item) + + + + error: dict[str, Any] | Unset = UNSET + if not isinstance(self.error, Unset): + error = self.error.to_dict() + + started_at: str | Unset = UNSET + if not isinstance(self.started_at, Unset): + started_at = self.started_at.isoformat() + + completed_at: str | Unset = UNSET + if not isinstance(self.completed_at, Unset): + completed_at = self.completed_at.isoformat() + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "id": id, + "database": database, + "status": status, + "phase": phase, + "source": source, + "warnings": warnings, + "created_at": created_at, + "updated_at": updated_at, + }) + if commit_sha is not UNSET: + field_dict["commit_sha"] = commit_sha + if backup_name is not UNSET: + field_dict["backup_name"] = backup_name + if files is not UNSET: + field_dict["files"] = files + if error is not UNSET: + field_dict["error"] = error + if started_at is not UNSET: + field_dict["started_at"] = started_at + if completed_at is not UNSET: + field_dict["completed_at"] = completed_at + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.database_migration_run_error import DatabaseMigrationRunError # noqa: PLC0415 + from ..models.database_migration_run_file import DatabaseMigrationRunFile # noqa: PLC0415 + from ..models.database_migration_warning import DatabaseMigrationWarning # noqa: PLC0415 + from ..models.resource_reference import ResourceReference # noqa: PLC0415 + d = dict(src_dict) + id = UUID(d.pop("id")) + + + + + database = ResourceReference.from_dict(d.pop("database")) + + + + + status = check_database_migration_run_status(d.pop("status")) + + + + + phase = check_database_migration_run_phase(d.pop("phase")) + + + + + source = check_database_migration_run_source(d.pop("source")) + + + + + warnings = [] + _warnings = d.pop("warnings") + for warnings_item_data in (_warnings): + warnings_item = DatabaseMigrationWarning.from_dict(warnings_item_data) + + + + warnings.append(warnings_item) + + + created_at = datetime.datetime.fromisoformat(d.pop("created_at")) + + + + + updated_at = datetime.datetime.fromisoformat(d.pop("updated_at")) + + + + + commit_sha = d.pop("commit_sha", UNSET) + + backup_name = d.pop("backup_name", UNSET) + + _files = d.pop("files", UNSET) + files: list[DatabaseMigrationRunFile] | Unset = UNSET + if _files is not UNSET: + files = [] + for files_item_data in _files: + files_item = DatabaseMigrationRunFile.from_dict(files_item_data) + + + + files.append(files_item) + + + _error = d.pop("error", UNSET) + error: DatabaseMigrationRunError | Unset + if isinstance(_error, Unset): + error = UNSET + else: + error = DatabaseMigrationRunError.from_dict(_error) + + + + + _started_at = d.pop("started_at", UNSET) + started_at: datetime.datetime | Unset + if isinstance(_started_at, Unset): + started_at = UNSET + else: + started_at = datetime.datetime.fromisoformat(_started_at) + + + + + _completed_at = d.pop("completed_at", UNSET) + completed_at: datetime.datetime | Unset + if isinstance(_completed_at, Unset): + completed_at = UNSET + else: + completed_at = datetime.datetime.fromisoformat(_completed_at) + + + + + database_migration_run = cls( + id=id, + database=database, + status=status, + phase=phase, + source=source, + warnings=warnings, + created_at=created_at, + updated_at=updated_at, + commit_sha=commit_sha, + backup_name=backup_name, + files=files, + error=error, + started_at=started_at, + completed_at=completed_at, + ) + + + database_migration_run.additional_properties = d + return database_migration_run + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/database_migration_run_error.py b/src/volcano_sdk/_generated/models/database_migration_run_error.py new file mode 100644 index 00000000..8c169159 --- /dev/null +++ b/src/volcano_sdk/_generated/models/database_migration_run_error.py @@ -0,0 +1,123 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.database_migration_run_error_code import check_database_migration_run_error_code +from ..models.database_migration_run_error_code import DatabaseMigrationRunErrorCode +from typing import cast + + + + + + +T = TypeVar("T", bound="DatabaseMigrationRunError") + + + +@_attrs_define +class DatabaseMigrationRunError: + """ Why the run failed, or why its last attempt did. + + Attributes: + code (DatabaseMigrationRunErrorCode): Stable machine-readable reason. `migration_failed`: a file's SQL, + or its `COMMIT`, failed; `phase` says whether in the rehearsal, + leaving the database untouched, or in the database, where the files + before it stay applied. `checksum_mismatch`: an applied file changed. + `history_missing`: the database's history table is gone though + migrations ran there; record a baseline of the files already + applied. Dropping the whole `_volcano_migrations` schema is not + supported and not detected: the database reads as new, and the run + applies every file again. `history_too_large`: the history has + more than the 1,000 entries Volcano reads. `invalid_file`: a file + Volcano refuses to run. `invalid_layout`: file paths that do not map + to the database. + `plan_changed`: the history changed after the rehearsal. + `branch_limit`: the rehearsal branch would exceed the plan's branch + allowance. `backup_failed` and `rehearsal_unavailable`: Volcano + could not take the backup or prepare the rehearsal. + `restore_in_progress` and `database_unavailable`: the database could + not take the run. `owner_not_active`: the project owner's account + was not `active` when Volcano picked the run up, or before its + `backup` or `apply`, or before a file in `apply` unless held + `read_only` only for the plan's limits, so the run applied nothing + further; files it already applied stay applied. + `locked`: another session held the migration lock, + or a file, or Volcano's drop of a failed build's index, waited too + long for a lock. `connection_failed`: the + database could not be reached, or the connection was lost, + including while a file ran. `internal_error`: Volcano failed for a + reason of its own, such as its own statements around a file. + `timeout` and `attempts_exhausted`: the run could not finish. + `operator_failed`: Volcano ended a run that stopped making + progress; read the history to see which files were applied, then + start a new run. + message (str): What happened, naming files and Postgres error codes. The + database's own message is on the failed file. + """ + + code: DatabaseMigrationRunErrorCode + message: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + code: str = self.code + + message = self.message + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "code": code, + "message": message, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + code = check_database_migration_run_error_code(d.pop("code")) + + + + + message = d.pop("message") + + database_migration_run_error = cls( + code=code, + message=message, + ) + + + database_migration_run_error.additional_properties = d + return database_migration_run_error + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/database_migration_run_error_code.py b/src/volcano_sdk/_generated/models/database_migration_run_error_code.py new file mode 100644 index 00000000..4344ede1 --- /dev/null +++ b/src/volcano_sdk/_generated/models/database_migration_run_error_code.py @@ -0,0 +1,10 @@ +from typing import Literal + +DatabaseMigrationRunErrorCode = Literal['attempts_exhausted', 'backup_failed', 'branch_limit', 'checksum_mismatch', 'connection_failed', 'database_unavailable', 'history_missing', 'history_too_large', 'internal_error', 'invalid_file', 'invalid_layout', 'locked', 'migration_failed', 'operator_failed', 'owner_not_active', 'plan_changed', 'rehearsal_unavailable', 'restore_in_progress', 'timeout'] + +DATABASE_MIGRATION_RUN_ERROR_CODE_VALUES: set[DatabaseMigrationRunErrorCode] = { 'attempts_exhausted', 'backup_failed', 'branch_limit', 'checksum_mismatch', 'connection_failed', 'database_unavailable', 'history_missing', 'history_too_large', 'internal_error', 'invalid_file', 'invalid_layout', 'locked', 'migration_failed', 'operator_failed', 'owner_not_active', 'plan_changed', 'rehearsal_unavailable', 'restore_in_progress', 'timeout', } + +def check_database_migration_run_error_code(value: str) -> DatabaseMigrationRunErrorCode: + if value in DATABASE_MIGRATION_RUN_ERROR_CODE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {DATABASE_MIGRATION_RUN_ERROR_CODE_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/database_migration_run_file.py b/src/volcano_sdk/_generated/models/database_migration_run_file.py new file mode 100644 index 00000000..542fc3a0 --- /dev/null +++ b/src/volcano_sdk/_generated/models/database_migration_run_file.py @@ -0,0 +1,146 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.database_migration_run_file_outcome import check_database_migration_run_file_outcome +from ..models.database_migration_run_file_outcome import DatabaseMigrationRunFileOutcome +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.database_migration_file_error import DatabaseMigrationFileError + + + + + +T = TypeVar("T", bound="DatabaseMigrationRunFile") + + + +@_attrs_define +class DatabaseMigrationRunFile: + """ + Attributes: + name (str): Example: 001_create_users.sql. + outcome (DatabaseMigrationRunFileOutcome): `pending`: not settled yet, including a file the run will try again + on its next attempt. `already_applied`: the history already recorded + it, so it did not run; a file can also end this way in `apply`, when + another session applied or baselined it after the run planned. + `applied`: this run applied it. `failed`: its own SQL failed and + its transaction rolled back, in the rehearsal or in the database as + the run's `phase` says, including when the run's time limit stopped + it; a file whose `COMMIT` failed is `unknown` instead. A file whose + first line is `-- volcano:no-transaction` runs outside a + transaction, so nothing rolls back what it did before failing, such + as the invalid index a failed `CREATE INDEX CONCURRENTLY` leaves. + `not_run`: the run ended before the file committed, without its + SQL failing: before `apply`, after an earlier file failed or lost + its `COMMIT`, or after the connection was lost or Volcano's own + statements around the file failed, which rolled it back. `unknown`: + the run ended in `apply` without confirming whether the file ran, + for example because its attempts ran out, its `COMMIT` failed or + was cut short, or it ran outside a transaction and the connection + was lost or Volcano's own statements after it failed. The file may + have committed. The database's history says whether a file that + ran in a transaction committed, and the next run's plan applies a + file only if the history does not record it. + While the run is `queued` or `running`, each attempt reads the + history again before it runs a file, and sets every file the run + has not applied from it: `already_applied` if the history holds + it, `pending` otherwise. The exception is a file that runs outside + a transaction: it is `unknown` from just before Volcano sends it + until Volcano confirms what became of it. If it may have run, it + stays `unknown` until an attempt applies it or the history holds + it, and keeps the `error` of a later attempt that fails it. + error (DatabaseMigrationFileError | Unset): The database's error for a `failed` file, or for an `unknown` file + that runs outside a transaction, when a later attempt failed it after + an earlier one may have run it. `message` is the database's own + message and can quote values from the file or the data. + """ + + name: str + outcome: DatabaseMigrationRunFileOutcome + error: DatabaseMigrationFileError | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.database_migration_file_error import DatabaseMigrationFileError # noqa: PLC0415 + name = self.name + + outcome: str = self.outcome + + error: dict[str, Any] | Unset = UNSET + if not isinstance(self.error, Unset): + error = self.error.to_dict() + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "name": name, + "outcome": outcome, + }) + if error is not UNSET: + field_dict["error"] = error + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.database_migration_file_error import DatabaseMigrationFileError # noqa: PLC0415 + d = dict(src_dict) + name = d.pop("name") + + outcome = check_database_migration_run_file_outcome(d.pop("outcome")) + + + + + _error = d.pop("error", UNSET) + error: DatabaseMigrationFileError | Unset + if isinstance(_error, Unset): + error = UNSET + else: + error = DatabaseMigrationFileError.from_dict(_error) + + + + + database_migration_run_file = cls( + name=name, + outcome=outcome, + error=error, + ) + + + database_migration_run_file.additional_properties = d + return database_migration_run_file + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/database_migration_run_file_outcome.py b/src/volcano_sdk/_generated/models/database_migration_run_file_outcome.py new file mode 100644 index 00000000..98144a1b --- /dev/null +++ b/src/volcano_sdk/_generated/models/database_migration_run_file_outcome.py @@ -0,0 +1,10 @@ +from typing import Literal + +DatabaseMigrationRunFileOutcome = Literal['already_applied', 'applied', 'failed', 'not_run', 'pending', 'unknown'] + +DATABASE_MIGRATION_RUN_FILE_OUTCOME_VALUES: set[DatabaseMigrationRunFileOutcome] = { 'already_applied', 'applied', 'failed', 'not_run', 'pending', 'unknown', } + +def check_database_migration_run_file_outcome(value: str) -> DatabaseMigrationRunFileOutcome: + if value in DATABASE_MIGRATION_RUN_FILE_OUTCOME_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {DATABASE_MIGRATION_RUN_FILE_OUTCOME_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/database_migration_run_list.py b/src/volcano_sdk/_generated/models/database_migration_run_list.py new file mode 100644 index 00000000..19afefaa --- /dev/null +++ b/src/volcano_sdk/_generated/models/database_migration_run_list.py @@ -0,0 +1,94 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast + +if TYPE_CHECKING: + from ..models.database_migration_run import DatabaseMigrationRun + + + + + +T = TypeVar("T", bound="DatabaseMigrationRunList") + + + +@_attrs_define +class DatabaseMigrationRunList: + """ + Attributes: + data (list[DatabaseMigrationRun]): + """ + + data: list[DatabaseMigrationRun] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.database_migration_run import DatabaseMigrationRun # noqa: PLC0415 + data = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "data": data, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.database_migration_run import DatabaseMigrationRun # noqa: PLC0415 + d = dict(src_dict) + data = [] + _data = d.pop("data") + for data_item_data in (_data): + data_item = DatabaseMigrationRun.from_dict(data_item_data) + + + + data.append(data_item) + + + database_migration_run_list = cls( + data=data, + ) + + + database_migration_run_list.additional_properties = d + return database_migration_run_list + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/database_migration_run_phase.py b/src/volcano_sdk/_generated/models/database_migration_run_phase.py new file mode 100644 index 00000000..2b47f2fd --- /dev/null +++ b/src/volcano_sdk/_generated/models/database_migration_run_phase.py @@ -0,0 +1,10 @@ +from typing import Literal + +DatabaseMigrationRunPhase = Literal['apply', 'backup', 'plan', 'rehearse'] + +DATABASE_MIGRATION_RUN_PHASE_VALUES: set[DatabaseMigrationRunPhase] = { 'apply', 'backup', 'plan', 'rehearse', } + +def check_database_migration_run_phase(value: str) -> DatabaseMigrationRunPhase: + if value in DATABASE_MIGRATION_RUN_PHASE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {DATABASE_MIGRATION_RUN_PHASE_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/database_migration_run_source.py b/src/volcano_sdk/_generated/models/database_migration_run_source.py new file mode 100644 index 00000000..8f4a02f2 --- /dev/null +++ b/src/volcano_sdk/_generated/models/database_migration_run_source.py @@ -0,0 +1,10 @@ +from typing import Literal + +DatabaseMigrationRunSource = Literal['api', 'git_deploy'] + +DATABASE_MIGRATION_RUN_SOURCE_VALUES: set[DatabaseMigrationRunSource] = { 'api', 'git_deploy', } + +def check_database_migration_run_source(value: str) -> DatabaseMigrationRunSource: + if value in DATABASE_MIGRATION_RUN_SOURCE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {DATABASE_MIGRATION_RUN_SOURCE_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/database_migration_run_status.py b/src/volcano_sdk/_generated/models/database_migration_run_status.py new file mode 100644 index 00000000..c43390b0 --- /dev/null +++ b/src/volcano_sdk/_generated/models/database_migration_run_status.py @@ -0,0 +1,10 @@ +from typing import Literal + +DatabaseMigrationRunStatus = Literal['failed', 'queued', 'running', 'succeeded'] + +DATABASE_MIGRATION_RUN_STATUS_VALUES: set[DatabaseMigrationRunStatus] = { 'failed', 'queued', 'running', 'succeeded', } + +def check_database_migration_run_status(value: str) -> DatabaseMigrationRunStatus: + if value in DATABASE_MIGRATION_RUN_STATUS_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {DATABASE_MIGRATION_RUN_STATUS_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/database_migration_warning.py b/src/volcano_sdk/_generated/models/database_migration_warning.py new file mode 100644 index 00000000..8800437e --- /dev/null +++ b/src/volcano_sdk/_generated/models/database_migration_warning.py @@ -0,0 +1,111 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.database_migration_warning_code import check_database_migration_warning_code +from ..models.database_migration_warning_code import DatabaseMigrationWarningCode +from ..types import UNSET, Unset +from typing import cast + + + + + + +T = TypeVar("T", bound="DatabaseMigrationWarning") + + + +@_attrs_define +class DatabaseMigrationWarning: + """ A condition the run reports that did not stop it. + + Attributes: + code (DatabaseMigrationWarningCode): `out_of_order`: a pending file sorts before one the history already + records; it still ran. `missing_file`: the history records a file + the run did not include. `rehearsal_skipped`: the files were not + rehearsed, because branches are not available here or on the plan. + `backup_skipped`: no backup was taken, because backups are not + available here or on the plan. `backup_prune_failed`: Volcano + could not delete older migration backups beyond the 20 it keeps; + the run's outcome is unaffected, and the next run that takes a + backup tries again. `warnings_truncated`: the run raised more than + 100 warnings; it is the last one, and its message says how many + more were not kept. + message (str): + file (str | Unset): The file the warning is about, when it is about one. + """ + + code: DatabaseMigrationWarningCode + message: str + file: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + code: str = self.code + + message = self.message + + file = self.file + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "code": code, + "message": message, + }) + if file is not UNSET: + field_dict["file"] = file + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + code = check_database_migration_warning_code(d.pop("code")) + + + + + message = d.pop("message") + + file = d.pop("file", UNSET) + + database_migration_warning = cls( + code=code, + message=message, + file=file, + ) + + + database_migration_warning.additional_properties = d + return database_migration_warning + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/database_migration_warning_code.py b/src/volcano_sdk/_generated/models/database_migration_warning_code.py new file mode 100644 index 00000000..c683f008 --- /dev/null +++ b/src/volcano_sdk/_generated/models/database_migration_warning_code.py @@ -0,0 +1,10 @@ +from typing import Literal + +DatabaseMigrationWarningCode = Literal['backup_prune_failed', 'backup_skipped', 'missing_file', 'out_of_order', 'rehearsal_skipped', 'warnings_truncated'] + +DATABASE_MIGRATION_WARNING_CODE_VALUES: set[DatabaseMigrationWarningCode] = { 'backup_prune_failed', 'backup_skipped', 'missing_file', 'out_of_order', 'rehearsal_skipped', 'warnings_truncated', } + +def check_database_migration_warning_code(value: str) -> DatabaseMigrationWarningCode: + if value in DATABASE_MIGRATION_WARNING_CODE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {DATABASE_MIGRATION_WARNING_CODE_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/database_migrations.py b/src/volcano_sdk/_generated/models/database_migrations.py new file mode 100644 index 00000000..31715275 --- /dev/null +++ b/src/volcano_sdk/_generated/models/database_migrations.py @@ -0,0 +1,115 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset +from typing import cast +from uuid import UUID + +if TYPE_CHECKING: + from ..models.database_migration_history_entry import DatabaseMigrationHistoryEntry + + + + + +T = TypeVar("T", bound="DatabaseMigrations") + + + +@_attrs_define +class DatabaseMigrations: + """ + Attributes: + history (list[DatabaseMigrationHistoryEntry]): Every file the history records, in name order. + active_run_id (UUID | Unset): The run that is queued or running, if any. + """ + + history: list[DatabaseMigrationHistoryEntry] + active_run_id: UUID | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.database_migration_history_entry import DatabaseMigrationHistoryEntry # noqa: PLC0415 + history = [] + for history_item_data in self.history: + history_item = history_item_data.to_dict() + history.append(history_item) + + + + active_run_id: str | Unset = UNSET + if not isinstance(self.active_run_id, Unset): + active_run_id = str(self.active_run_id) + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "history": history, + }) + if active_run_id is not UNSET: + field_dict["active_run_id"] = active_run_id + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.database_migration_history_entry import DatabaseMigrationHistoryEntry # noqa: PLC0415 + d = dict(src_dict) + history = [] + _history = d.pop("history") + for history_item_data in (_history): + history_item = DatabaseMigrationHistoryEntry.from_dict(history_item_data) + + + + history.append(history_item) + + + _active_run_id = d.pop("active_run_id", UNSET) + active_run_id: UUID | Unset + if isinstance(_active_run_id, Unset): + active_run_id = UNSET + else: + active_run_id = UUID(_active_run_id) + + + + + database_migrations = cls( + history=history, + active_run_id=active_run_id, + ) + + + database_migrations.additional_properties = d + return database_migrations + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/database_restore_conflict_error.py b/src/volcano_sdk/_generated/models/database_restore_conflict_error.py new file mode 100644 index 00000000..cd10e2d1 --- /dev/null +++ b/src/volcano_sdk/_generated/models/database_restore_conflict_error.py @@ -0,0 +1,115 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset +from uuid import UUID + + + + + + +T = TypeVar("T", bound="DatabaseRestoreConflictError") + + + +@_attrs_define +class DatabaseRestoreConflictError: + """ A restore refused by the database's state. With code + `migration_run_in_progress`, `run_id` names the migration run backing up + or applying to the database. + + Attributes: + error (str): + code (str | Unset): Stable machine-readable error code when a specific recovery path is available. + `plan_required` (403) means the project owner's plan does not include the requested feature or option; upgrading + the plan unlocks it. `person_required` (403) means a project access token tried to change LavaFlow settings, + which only the project's owner changes, with a platform token, or that the change needs the owner's own + credential that expires, a project repository, and an owner whose GitHub account can push to it; `error` says + which. A 403 without a code leaves the reason unspecified: it can be an access refusal, a reached limit, or a + plan check that could not read the owner's plan. Match on the code, not the message text. + run_id (UUID | Unset): + """ + + error: str + code: str | Unset = UNSET + run_id: UUID | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + error = self.error + + code = self.code + + run_id: str | Unset = UNSET + if not isinstance(self.run_id, Unset): + run_id = str(self.run_id) + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "error": error, + }) + if code is not UNSET: + field_dict["code"] = code + if run_id is not UNSET: + field_dict["run_id"] = run_id + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + error = d.pop("error") + + code = d.pop("code", UNSET) + + _run_id = d.pop("run_id", UNSET) + run_id: UUID | Unset + if isinstance(_run_id, Unset): + run_id = UNSET + else: + run_id = UUID(_run_id) + + + + + database_restore_conflict_error = cls( + error=error, + code=code, + run_id=run_id, + ) + + + database_restore_conflict_error.additional_properties = d + return database_restore_conflict_error + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/default_email_template.py b/src/volcano_sdk/_generated/models/default_email_template.py new file mode 100644 index 00000000..725f0050 --- /dev/null +++ b/src/volcano_sdk/_generated/models/default_email_template.py @@ -0,0 +1,107 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.default_email_template_type import check_default_email_template_type +from ..models.default_email_template_type import DefaultEmailTemplateType +from typing import cast + + + + + + +T = TypeVar("T", bound="DefaultEmailTemplate") + + + +@_attrs_define +class DefaultEmailTemplate: + """ Built-in email template used when no custom template applies. + + Attributes: + type_ (DefaultEmailTemplateType): + subject (str): + html_body (str): HTML template with placeholders + text_body (str): Plain text template with placeholders + """ + + type_: DefaultEmailTemplateType + subject: str + html_body: str + text_body: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + type_: str = self.type_ + + subject = self.subject + + html_body = self.html_body + + text_body = self.text_body + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "type": type_, + "subject": subject, + "html_body": html_body, + "text_body": text_body, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + type_ = check_default_email_template_type(d.pop("type")) + + + + + subject = d.pop("subject") + + html_body = d.pop("html_body") + + text_body = d.pop("text_body") + + default_email_template = cls( + type_=type_, + subject=subject, + html_body=html_body, + text_body=text_body, + ) + + + default_email_template.additional_properties = d + return default_email_template + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/default_email_template_type.py b/src/volcano_sdk/_generated/models/default_email_template_type.py new file mode 100644 index 00000000..8487643a --- /dev/null +++ b/src/volcano_sdk/_generated/models/default_email_template_type.py @@ -0,0 +1,10 @@ +from typing import Literal + +DefaultEmailTemplateType = Literal['confirmation', 'password_changed', 'password_reset', 'welcome'] + +DEFAULT_EMAIL_TEMPLATE_TYPE_VALUES: set[DefaultEmailTemplateType] = { 'confirmation', 'password_changed', 'password_reset', 'welcome', } + +def check_default_email_template_type(value: str) -> DefaultEmailTemplateType: + if value in DEFAULT_EMAIL_TEMPLATE_TYPE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {DEFAULT_EMAIL_TEMPLATE_TYPE_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/deploy_sandbox_body.py b/src/volcano_sdk/_generated/models/deploy_sandbox_body.py index d38e876a..7ffb8754 100644 --- a/src/volcano_sdk/_generated/models/deploy_sandbox_body.py +++ b/src/volcano_sdk/_generated/models/deploy_sandbox_body.py @@ -31,16 +31,23 @@ class DeploySandboxBody: """ Attributes: name (str): - code (File): Source tar.gz archive, limited to 32 MiB compressed and expanded. + code (File | Unset): Source tar.gz archive, limited to 32 MiB compressed and expanded. Required for customer + templates. Omit for the managed Builder template. memory_mb (DeploySandboxBodyMemoryMb | Unset): Memory in MiB. Defaults to 1024 when omitted. ports (str | Unset): JSON array of application ports that must become ready before activation, for example [8080]. + containers (bool | Unset): Run a rootless container engine (Docker Engine with Compose) in every session of this + template. Commands reach it through `DOCKER_HOST` and keep the same privileges as in any other session. Disabled + by default. Only the operator-authorized Builder caller in local mode can deploy its reserved platform template, + with no code archive or ports. Disabled or unsupported opt-ins answer `400 feature_unavailable`. An unauthorized + caller receives 403; incompatible form fields receive 400. """ name: str - code: File + code: File | Unset = UNSET memory_mb: DeploySandboxBodyMemoryMb | Unset = UNSET ports: str | Unset = UNSET + containers: bool | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -50,7 +57,9 @@ class DeploySandboxBody: def to_dict(self) -> dict[str, Any]: name = self.name - code = self.code.to_tuple() + code: FileTypes | Unset = UNSET + if not isinstance(self.code, Unset): + code = self.code.to_tuple() memory_mb: int | Unset = UNSET @@ -60,17 +69,22 @@ def to_dict(self) -> dict[str, Any]: ports = self.ports + containers = self.containers + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({ "name": name, - "code": code, }) + if code is not UNSET: + field_dict["code"] = code if memory_mb is not UNSET: field_dict["memory_mb"] = memory_mb if ports is not UNSET: field_dict["ports"] = ports + if containers is not UNSET: + field_dict["containers"] = containers return field_dict @@ -82,7 +96,8 @@ def to_multipart(self) -> types.RequestFiles: - files.append(("code", self.code.to_tuple())) + if not isinstance(self.code, Unset): + files.append(("code", self.code.to_tuple())) @@ -96,6 +111,11 @@ def to_multipart(self) -> types.RequestFiles: + if not isinstance(self.containers, Unset): + files.append(("containers", (None, str(self.containers).encode(), "text/plain"))) + + + for prop_name, prop in self.additional_properties.items(): files.append((prop_name, (None, str(prop).encode(), "text/plain"))) @@ -110,8 +130,13 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) name = d.pop("name") - code = File( - payload = BytesIO(d.pop("code")) + _code = d.pop("code", UNSET) + code: File | Unset + if isinstance(_code, Unset): + code = UNSET + else: + code = File( + payload = BytesIO(_code) ) @@ -129,11 +154,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ports = d.pop("ports", UNSET) + containers = d.pop("containers", UNSET) + deploy_sandbox_body = cls( name=name, code=code, memory_mb=memory_mb, ports=ports, + containers=containers, ) diff --git a/src/volcano_sdk/_generated/models/deployment_commit.py b/src/volcano_sdk/_generated/models/deployment_commit.py new file mode 100644 index 00000000..ae9d64af --- /dev/null +++ b/src/volcano_sdk/_generated/models/deployment_commit.py @@ -0,0 +1,141 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.deployment_commit_verification import check_deployment_commit_verification +from ..models.deployment_commit_verification import DeploymentCommitVerification +from ..types import UNSET, Unset +from typing import cast + + + + + + +T = TypeVar("T", bound="DeploymentCommit") + + + +@_attrs_define +class DeploymentCommit: + """ The commit the deployment's source came from: the commit a deploy client reported, or for a deployment a Git + deployment run made, the commit the run deployed. Absent when there is neither. A frontend deployment that publishes + another deployment's build carries the commit that deployment's client reported; one that publishes a Git deployment + run's build has none. + + Attributes: + repository (str): GitHub repository as `owner/name`, normalized from what the client sent. Example: acme/app. + sha (str): Full commit ID. + dirty (bool): `true` when the client reported that the uploaded files differ from the commit, or Volcano found + an uploaded file in the project's root directory that the commit does not hold, so the deployed code may differ + from the commit. + verified (bool): `true` only when `verification` is `files`: Volcano confirmed that the deployed files are the + commit's. A commit verified at the `repository` level is not `verified`. + verification (DeploymentCommitVerification): What Volcano confirmed about the commit, through the project's + GitHub connection, when it recorded the deployment. `files`: `repository` is the project's connected repository, + `sha` is on its production branch, every uploaded file is the commit's file at its path, and the upload holds + the commit's files under its root but those deploy clients leave out. Only a frontend upload is checked this + far. `repository`: `repository` is the project's connected repository and `sha` is on its production branch, but + the uploaded files were not compared with the commit, since a function upload holds build output rather than the + repository's layout. Only a function upload the client reports clean is checked at this level. `none`: Volcano + confirmed nothing, as for a commit the client reports dirty, one from another branch or repository, one from a + project without a connection, or one it couldn't check in time. A Git deployment run's commit is `files`: the + run fetched the commit's files from the connected repository itself. + branch (str | Unset): The branch a Git deployment run deployed the commit from. Absent for a commit a deploy + client reported. Example: main. + """ + + repository: str + sha: str + dirty: bool + verified: bool + verification: DeploymentCommitVerification + branch: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + repository = self.repository + + sha = self.sha + + dirty = self.dirty + + verified = self.verified + + verification: str = self.verification + + branch = self.branch + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "repository": repository, + "sha": sha, + "dirty": dirty, + "verified": verified, + "verification": verification, + }) + if branch is not UNSET: + field_dict["branch"] = branch + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + repository = d.pop("repository") + + sha = d.pop("sha") + + dirty = d.pop("dirty") + + verified = d.pop("verified") + + verification = check_deployment_commit_verification(d.pop("verification")) + + + + + branch = d.pop("branch", UNSET) + + deployment_commit = cls( + repository=repository, + sha=sha, + dirty=dirty, + verified=verified, + verification=verification, + branch=branch, + ) + + + deployment_commit.additional_properties = d + return deployment_commit + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/deployment_commit_verification.py b/src/volcano_sdk/_generated/models/deployment_commit_verification.py new file mode 100644 index 00000000..ccad7a58 --- /dev/null +++ b/src/volcano_sdk/_generated/models/deployment_commit_verification.py @@ -0,0 +1,10 @@ +from typing import Literal + +DeploymentCommitVerification = Literal['files', 'none', 'repository'] + +DEPLOYMENT_COMMIT_VERIFICATION_VALUES: set[DeploymentCommitVerification] = { 'files', 'none', 'repository', } + +def check_deployment_commit_verification(value: str) -> DeploymentCommitVerification: + if value in DEPLOYMENT_COMMIT_VERIFICATION_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {DEPLOYMENT_COMMIT_VERIFICATION_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/durable_callback_error.py b/src/volcano_sdk/_generated/models/durable_callback_error.py index 427d4465..a21e0d53 100644 --- a/src/volcano_sdk/_generated/models/durable_callback_error.py +++ b/src/volcano_sdk/_generated/models/durable_callback_error.py @@ -26,7 +26,10 @@ class DurableCallbackError: Attributes: type_ (str): A name workflows can branch on, such as `PaymentDeclined`. Up to 256 characters, without control characters. - message (str | Unset): A human-readable explanation, up to 32 KiB. + message (str | Unset): A human-readable explanation of up to 32,768 bytes of UTF-8, with + tab and newline as its only control characters. A character + outside ASCII takes more than one byte, so such text reaches the + limit before `maxLength`. """ type_: str diff --git a/src/volcano_sdk/_generated/models/durable_callback_registration.py b/src/volcano_sdk/_generated/models/durable_callback_registration.py index a34633d6..08684463 100644 --- a/src/volcano_sdk/_generated/models/durable_callback_registration.py +++ b/src/volcano_sdk/_generated/models/durable_callback_registration.py @@ -27,9 +27,10 @@ class DurableCallbackRegistration: Attributes: token (str): The `vcb_` token the workflow handed out. It is the only credential the callback operations take, so treat it as a secret. - expires_at (datetime.datetime | None): When the waiting step times out and the token stops working. Null - when the workflow set no timeout, in which case the token works - until the execution ends. + expires_at (datetime.datetime | None): When the waiting step's `timeout` passes and the token stops + working. Null when the workflow set no `timeout`. A step with a + heartbeat timeout also ends once that long passes without a + heartbeat, which can be before this time. """ token: str diff --git a/src/volcano_sdk/_generated/models/durable_execution.py b/src/volcano_sdk/_generated/models/durable_execution.py index c45737cf..e9998a78 100644 --- a/src/volcano_sdk/_generated/models/durable_execution.py +++ b/src/volcano_sdk/_generated/models/durable_execution.py @@ -58,7 +58,8 @@ class DurableExecution: result (Any | Unset): Whatever the function returned, verbatim. Absent while the execution is still running, absent when the result was too large to return and was checkpointed instead, and absent once the retention period has - lapsed. + lapsed. A result Volcano has just read can still be returned for up + to five minutes after that. result_expired (bool | Unset): `true` when the execution is terminal but its result is no longer retained, which distinguishes a discarded result from an empty one. Shortly after that the execution itself is dropped and reads answer @@ -68,9 +69,11 @@ class DurableExecution: unset, so it reads like a function that returned nothing. error (DurableExecutionError | Unset): Why a failed or timed-out execution ended. completed_at (datetime.datetime | Unset): Present once the execution has reached a terminal status. - client_token (str | Unset): Lets a browser read and send the execution's messages. Returned only - by the start whose input the execution runs, never by a repeat under - the same name or by a read. Send it as `X-Volcano-Client-Token`. + client_token (str | Unset): Lets a browser read the execution, stop it, and read and send its + messages, and a service key scoped to a list without `*` do the + same. Returned only by the start whose input the execution runs, + never by a repeat under the same name or by a read. Send it as + `X-Volcano-Client-Token`. """ id: UUID diff --git a/src/volcano_sdk/_generated/models/durable_function_config.py b/src/volcano_sdk/_generated/models/durable_function_config.py index 989ce72d..b4843c31 100644 --- a/src/volcano_sdk/_generated/models/durable_function_config.py +++ b/src/volcano_sdk/_generated/models/durable_function_config.py @@ -36,7 +36,10 @@ class DurableFunctionConfig: timeout is the plan's own, smaller number. retention_days (int): How long a finished execution's result and history are retained, for as long as the function exists. Deleting the function, or its - project, ends retention early and takes the history with it. + project, ends retention early and takes the history with it. A + result or error Volcano has just read is kept in memory for up to + five minutes, so a read can still return it for up to five minutes + after retention ends. """ execution_timeout_seconds: int diff --git a/src/volcano_sdk/_generated/models/email_template.py b/src/volcano_sdk/_generated/models/email_template.py index cbb01b24..1cfd6f96 100644 --- a/src/volcano_sdk/_generated/models/email_template.py +++ b/src/volcano_sdk/_generated/models/email_template.py @@ -30,21 +30,21 @@ class EmailTemplate: Attributes: template_type (EmailTemplateTemplateType): - subject (str): Example: Confirm your email address. - html_body (str): HTML template with placeholders - text_body (str): Plain text template with placeholders id (UUID | Unset): project_id (UUID | Unset): + subject (str | Unset): Example: Confirm your email address. + html_body (str | Unset): HTML template with placeholders + text_body (str | Unset): Plain text template with placeholders created_at (datetime.datetime | Unset): updated_at (datetime.datetime | Unset): """ template_type: EmailTemplateTemplateType - subject: str - html_body: str - text_body: str id: UUID | Unset = UNSET project_id: UUID | Unset = UNSET + subject: str | Unset = UNSET + html_body: str | Unset = UNSET + text_body: str | Unset = UNSET created_at: datetime.datetime | Unset = UNSET updated_at: datetime.datetime | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -56,12 +56,6 @@ class EmailTemplate: def to_dict(self) -> dict[str, Any]: template_type: str = self.template_type - subject = self.subject - - html_body = self.html_body - - text_body = self.text_body - id: str | Unset = UNSET if not isinstance(self.id, Unset): id = str(self.id) @@ -70,6 +64,12 @@ def to_dict(self) -> dict[str, Any]: if not isinstance(self.project_id, Unset): project_id = str(self.project_id) + subject = self.subject + + html_body = self.html_body + + text_body = self.text_body + created_at: str | Unset = UNSET if not isinstance(self.created_at, Unset): created_at = self.created_at.isoformat() @@ -83,14 +83,17 @@ def to_dict(self) -> dict[str, Any]: field_dict.update(self.additional_properties) field_dict.update({ "template_type": template_type, - "subject": subject, - "html_body": html_body, - "text_body": text_body, }) if id is not UNSET: field_dict["id"] = id if project_id is not UNSET: field_dict["project_id"] = project_id + if subject is not UNSET: + field_dict["subject"] = subject + if html_body is not UNSET: + field_dict["html_body"] = html_body + if text_body is not UNSET: + field_dict["text_body"] = text_body if created_at is not UNSET: field_dict["created_at"] = created_at if updated_at is not UNSET: @@ -108,12 +111,6 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - subject = d.pop("subject") - - html_body = d.pop("html_body") - - text_body = d.pop("text_body") - _id = d.pop("id", UNSET) id: UUID | Unset if isinstance(_id, Unset): @@ -134,6 +131,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + subject = d.pop("subject", UNSET) + + html_body = d.pop("html_body", UNSET) + + text_body = d.pop("text_body", UNSET) + _created_at = d.pop("created_at", UNSET) created_at: datetime.datetime | Unset if isinstance(_created_at, Unset): @@ -156,11 +159,11 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: email_template = cls( template_type=template_type, + id=id, + project_id=project_id, subject=subject, html_body=html_body, text_body=text_body, - id=id, - project_id=project_id, created_at=created_at, updated_at=updated_at, ) diff --git a/src/volcano_sdk/_generated/models/error.py b/src/volcano_sdk/_generated/models/error.py index 4595ac6a..fd86f01f 100644 --- a/src/volcano_sdk/_generated/models/error.py +++ b/src/volcano_sdk/_generated/models/error.py @@ -25,6 +25,12 @@ class Error: Attributes: error (str): code (str | Unset): Stable machine-readable error code when a specific recovery path is available. + `plan_required` (403) means the project owner's plan does not include the requested feature or option; upgrading + the plan unlocks it. `person_required` (403) means a project access token tried to change LavaFlow settings, + which only the project's owner changes, with a platform token, or that the change needs the owner's own + credential that expires, a project repository, and an owner whose GitHub account can push to it; `error` says + which. A 403 without a code leaves the reason unspecified: it can be an access refusal, a reached limit, or a + plan check that could not read the owner's plan. Match on the code, not the message text. """ error: str diff --git a/src/volcano_sdk/_generated/models/export_project_source_request.py b/src/volcano_sdk/_generated/models/export_project_source_request.py index 43a0bbcd..b633c071 100644 --- a/src/volcano_sdk/_generated/models/export_project_source_request.py +++ b/src/volcano_sdk/_generated/models/export_project_source_request.py @@ -8,6 +8,7 @@ from ..types import UNSET, Unset +from ..types import UNSET, Unset @@ -23,9 +24,14 @@ class ExportProjectSourceRequest: """ Attributes: production_branch (str): The currently configured production branch the user confirmed for export. + repo_id (int | Unset): The `repo_id` of the connected repository the user confirmed for + export, as the git connection reports it. When set, export answers + `409` if the project is now connected to a different repository, so + source is written only to the repository the user was shown. """ production_branch: str + repo_id: int | Unset = UNSET @@ -34,12 +40,16 @@ class ExportProjectSourceRequest: def to_dict(self) -> dict[str, Any]: production_branch = self.production_branch + repo_id = self.repo_id + field_dict: dict[str, Any] = {} field_dict.update({ "production_branch": production_branch, }) + if repo_id is not UNSET: + field_dict["repo_id"] = repo_id return field_dict @@ -50,8 +60,11 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) production_branch = d.pop("production_branch") + repo_id = d.pop("repo_id", UNSET) + export_project_source_request = cls( production_branch=production_branch, + repo_id=repo_id, ) return export_project_source_request diff --git a/src/volcano_sdk/_generated/models/fork_create_request.py b/src/volcano_sdk/_generated/models/fork_create_request.py new file mode 100644 index 00000000..8a9f29ce --- /dev/null +++ b/src/volcano_sdk/_generated/models/fork_create_request.py @@ -0,0 +1,111 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset +from typing import cast +from uuid import UUID + +if TYPE_CHECKING: + from ..models.fork_create_request_variables import ForkCreateRequestVariables + + + + + +T = TypeVar("T", bound="ForkCreateRequest") + + + +@_attrs_define +class ForkCreateRequest: + """ + Attributes: + share_id (str): The share to fork, the id at the end of its deploy URL. + release_id (UUID): The `release.id` the share's preview returned, so only the release the visitor saw is + installed. + name (str): The new project's name, which may contain only letters, numbers, underscores and hyphens. A name you + already use gets a short random suffix. An invalid name answers `400` before anything is counted against the + share or your hourly fork limit. + variables (ForkCreateRequestVariables | Unset): Values for the variables the preview lists, by name. Any may be + left out + and is then created empty; only listed names are accepted (`422` + otherwise). Each value is at most 4096 bytes of UTF-8, since a function's + environment is limited in bytes; a longer one, or one containing a NUL + character, answers `400`. Values are never logged, and `Idempotency-Key` compares only the names given a value. + """ + + share_id: str + release_id: UUID + name: str + variables: ForkCreateRequestVariables | Unset = UNSET + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.fork_create_request_variables import ForkCreateRequestVariables # noqa: PLC0415 + share_id = self.share_id + + release_id = str(self.release_id) + + name = self.name + + variables: dict[str, Any] | Unset = UNSET + if not isinstance(self.variables, Unset): + variables = self.variables.to_dict() + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "share_id": share_id, + "release_id": release_id, + "name": name, + }) + if variables is not UNSET: + field_dict["variables"] = variables + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.fork_create_request_variables import ForkCreateRequestVariables # noqa: PLC0415 + d = dict(src_dict) + share_id = d.pop("share_id") + + release_id = UUID(d.pop("release_id")) + + + + + name = d.pop("name") + + _variables = d.pop("variables", UNSET) + variables: ForkCreateRequestVariables | Unset + if isinstance(_variables, Unset): + variables = UNSET + else: + variables = ForkCreateRequestVariables.from_dict(_variables) + + + + + fork_create_request = cls( + share_id=share_id, + release_id=release_id, + name=name, + variables=variables, + ) + + return fork_create_request + diff --git a/src/volcano_sdk/_generated/models/fork_create_request_variables.py b/src/volcano_sdk/_generated/models/fork_create_request_variables.py new file mode 100644 index 00000000..6ec30ed3 --- /dev/null +++ b/src/volcano_sdk/_generated/models/fork_create_request_variables.py @@ -0,0 +1,70 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="ForkCreateRequestVariables") + + + +@_attrs_define +class ForkCreateRequestVariables: + """ Values for the variables the preview lists, by name. Any may be left out + and is then created empty; only listed names are accepted (`422` + otherwise). Each value is at most 4096 bytes of UTF-8, since a function's + environment is limited in bytes; a longer one, or one containing a NUL + character, answers `400`. Values are never logged, and `Idempotency-Key` compares only the names given a value. + + """ + + additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + fork_create_request_variables = cls( + ) + + + fork_create_request_variables.additional_properties = d + return fork_create_request_variables + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/frontend.py b/src/volcano_sdk/_generated/models/frontend.py index dc40a193..e62ed9de 100644 --- a/src/volcano_sdk/_generated/models/frontend.py +++ b/src/volcano_sdk/_generated/models/frontend.py @@ -23,6 +23,7 @@ if TYPE_CHECKING: from ..models.frontend_function_route import FrontendFunctionRoute + from ..models.frontend_route import FrontendRoute @@ -48,9 +49,17 @@ class Frontend: frontend stays `active` on the previous deployment, so `failed` means no deployment is serving. deployed_regions (list[str]): + serving_candidate_id (None | UUID): The promoted Candidate whose runtime receives this frontend's traffic, the + same as + `candidate_id` in `serving`. Null when the frontend serves its own runtime. While it is + set, `current_deployment_id` and `status` describe a deployment that receives no traffic, + and deploying the frontend is refused until it is rolled back. function_routes (list[FrontendFunctionRoute]): Paths on this frontend that forward to a public function, ordered from most to least specific. Anyone who can load the frontend can reach the target function at these paths without a credential. + frontend_routes (list[FrontendRoute]): Paths on this frontend served by another frontend in the project, + ordered from most to least specific. Function and Frontend routes + share one path namespace and the 64-route limit. created_at (datetime.datetime): updated_at (datetime.datetime): variable_scope (FrontendVariableScope | Unset): All preserves access to all project variables. Shared includes @@ -78,7 +87,9 @@ class Frontend: framework: FrontendFramework status: FrontendStatus deployed_regions: list[str] + serving_candidate_id: None | UUID function_routes: list[FrontendFunctionRoute] + frontend_routes: list[FrontendRoute] created_at: datetime.datetime updated_at: datetime.datetime variable_scope: FrontendVariableScope | Unset = UNSET @@ -100,6 +111,7 @@ class Frontend: def to_dict(self) -> dict[str, Any]: from ..models.frontend_function_route import FrontendFunctionRoute # noqa: PLC0415 + from ..models.frontend_route import FrontendRoute # noqa: PLC0415 id = str(self.id) project_id = str(self.project_id) @@ -114,6 +126,12 @@ def to_dict(self) -> dict[str, Any]: + serving_candidate_id: None | str + if isinstance(self.serving_candidate_id, UUID): + serving_candidate_id = str(self.serving_candidate_id) + else: + serving_candidate_id = self.serving_candidate_id + function_routes = [] for function_routes_item_data in self.function_routes: function_routes_item = function_routes_item_data.to_dict() @@ -121,6 +139,13 @@ def to_dict(self) -> dict[str, Any]: + frontend_routes = [] + for frontend_routes_item_data in self.frontend_routes: + frontend_routes_item = frontend_routes_item_data.to_dict() + frontend_routes.append(frontend_routes_item) + + + created_at = self.created_at.isoformat() updated_at = self.updated_at.isoformat() @@ -177,7 +202,9 @@ def to_dict(self) -> dict[str, Any]: "framework": framework, "status": status, "deployed_regions": deployed_regions, + "serving_candidate_id": serving_candidate_id, "function_routes": function_routes, + "frontend_routes": frontend_routes, "created_at": created_at, "updated_at": updated_at, }) @@ -211,6 +238,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.frontend_function_route import FrontendFunctionRoute # noqa: PLC0415 + from ..models.frontend_route import FrontendRoute # noqa: PLC0415 d = dict(src_dict) id = UUID(d.pop("id")) @@ -237,6 +265,24 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: deployed_regions = cast(list[str], d.pop("deployed_regions")) + def _parse_serving_candidate_id(data: object) -> None | UUID: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + serving_candidate_id_type_0 = UUID(data) + + + + return serving_candidate_id_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | UUID, data) + + serving_candidate_id = _parse_serving_candidate_id(d.pop("serving_candidate_id")) + + function_routes = [] _function_routes = d.pop("function_routes") for function_routes_item_data in (_function_routes): @@ -247,6 +293,16 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: function_routes.append(function_routes_item) + frontend_routes = [] + _frontend_routes = d.pop("frontend_routes") + for frontend_routes_item_data in (_frontend_routes): + frontend_routes_item = FrontendRoute.from_dict(frontend_routes_item_data) + + + + frontend_routes.append(frontend_routes_item) + + created_at = datetime.datetime.fromisoformat(d.pop("created_at")) @@ -343,7 +399,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: framework=framework, status=status, deployed_regions=deployed_regions, + serving_candidate_id=serving_candidate_id, function_routes=function_routes, + frontend_routes=frontend_routes, created_at=created_at, updated_at=updated_at, variable_scope=variable_scope, diff --git a/src/volcano_sdk/_generated/models/frontend_candidate.py b/src/volcano_sdk/_generated/models/frontend_candidate.py new file mode 100644 index 00000000..7e5b36bc --- /dev/null +++ b/src/volcano_sdk/_generated/models/frontend_candidate.py @@ -0,0 +1,221 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.frontend_candidate_configuration_status import check_frontend_candidate_configuration_status +from ..models.frontend_candidate_configuration_status import FrontendCandidateConfigurationStatus +from ..models.frontend_candidate_status import check_frontend_candidate_status +from ..models.frontend_candidate_status import FrontendCandidateStatus +from ..types import UNSET, Unset +from typing import cast +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.frontend_candidate_deployment import FrontendCandidateDeployment + + + + + +T = TypeVar("T", bound="FrontendCandidate") + + + +@_attrs_define +class FrontendCandidate: + """ A copy of a frontend built from an uploaded archive with the frontend's own configuration, so + it can be checked before anything is promoted. A Candidate is reachable by anyone who holds its + URL and is not indexed or listed; it is never public, and it does not claim to be private. + + Attributes: + id (UUID): + frontend_id (UUID): + name (str): + status (FrontendCandidateStatus): `creating` until its first deployment succeeds, `ready` while it serves, + `deleting` while + its runtime is removed, and `error` when its deletion gave up and needs an operator. + created_at (datetime.datetime): + updated_at (datetime.datetime): + url (str | Unset): Where the Candidate is served. Absent until its first deployment succeeds. + expires_at (datetime.datetime | Unset): When the Candidate is deleted on its own. Absent when it is kept until + deleted. + current_deployment_id (UUID | Unset): The deployment the Candidate serves. Absent until its first + deployment succeeds. It differs from `deployment` while a redeploy runs or after one failed. + deployment (FrontendCandidateDeployment | Unset): + configuration_status (FrontendCandidateConfigurationStatus | Unset): Present while the Candidate serves a + deployment. `current` means that deployment was built + with the variables the frontend selects now; `changed` means they differ, or can no longer + be resolved. Promotion refuses a Candidate whose status is `changed`. + """ + + id: UUID + frontend_id: UUID + name: str + status: FrontendCandidateStatus + created_at: datetime.datetime + updated_at: datetime.datetime + url: str | Unset = UNSET + expires_at: datetime.datetime | Unset = UNSET + current_deployment_id: UUID | Unset = UNSET + deployment: FrontendCandidateDeployment | Unset = UNSET + configuration_status: FrontendCandidateConfigurationStatus | Unset = UNSET + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.frontend_candidate_deployment import FrontendCandidateDeployment # noqa: PLC0415 + id = str(self.id) + + frontend_id = str(self.frontend_id) + + name = self.name + + status: str = self.status + + created_at = self.created_at.isoformat() + + updated_at = self.updated_at.isoformat() + + url = self.url + + expires_at: str | Unset = UNSET + if not isinstance(self.expires_at, Unset): + expires_at = self.expires_at.isoformat() + + current_deployment_id: str | Unset = UNSET + if not isinstance(self.current_deployment_id, Unset): + current_deployment_id = str(self.current_deployment_id) + + deployment: dict[str, Any] | Unset = UNSET + if not isinstance(self.deployment, Unset): + deployment = self.deployment.to_dict() + + configuration_status: str | Unset = UNSET + if not isinstance(self.configuration_status, Unset): + configuration_status = self.configuration_status + + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "id": id, + "frontend_id": frontend_id, + "name": name, + "status": status, + "created_at": created_at, + "updated_at": updated_at, + }) + if url is not UNSET: + field_dict["url"] = url + if expires_at is not UNSET: + field_dict["expires_at"] = expires_at + if current_deployment_id is not UNSET: + field_dict["current_deployment_id"] = current_deployment_id + if deployment is not UNSET: + field_dict["deployment"] = deployment + if configuration_status is not UNSET: + field_dict["configuration_status"] = configuration_status + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.frontend_candidate_deployment import FrontendCandidateDeployment # noqa: PLC0415 + d = dict(src_dict) + id = UUID(d.pop("id")) + + + + + frontend_id = UUID(d.pop("frontend_id")) + + + + + name = d.pop("name") + + status = check_frontend_candidate_status(d.pop("status")) + + + + + created_at = datetime.datetime.fromisoformat(d.pop("created_at")) + + + + + updated_at = datetime.datetime.fromisoformat(d.pop("updated_at")) + + + + + url = d.pop("url", UNSET) + + _expires_at = d.pop("expires_at", UNSET) + expires_at: datetime.datetime | Unset + if isinstance(_expires_at, Unset): + expires_at = UNSET + else: + expires_at = datetime.datetime.fromisoformat(_expires_at) + + + + + _current_deployment_id = d.pop("current_deployment_id", UNSET) + current_deployment_id: UUID | Unset + if isinstance(_current_deployment_id, Unset): + current_deployment_id = UNSET + else: + current_deployment_id = UUID(_current_deployment_id) + + + + + _deployment = d.pop("deployment", UNSET) + deployment: FrontendCandidateDeployment | Unset + if isinstance(_deployment, Unset): + deployment = UNSET + else: + deployment = FrontendCandidateDeployment.from_dict(_deployment) + + + + + _configuration_status = d.pop("configuration_status", UNSET) + configuration_status: FrontendCandidateConfigurationStatus | Unset + if isinstance(_configuration_status, Unset): + configuration_status = UNSET + else: + configuration_status = check_frontend_candidate_configuration_status(_configuration_status) + + + + + frontend_candidate = cls( + id=id, + frontend_id=frontend_id, + name=name, + status=status, + created_at=created_at, + updated_at=updated_at, + url=url, + expires_at=expires_at, + current_deployment_id=current_deployment_id, + deployment=deployment, + configuration_status=configuration_status, + ) + + return frontend_candidate + diff --git a/src/volcano_sdk/_generated/models/frontend_candidate_configuration_status.py b/src/volcano_sdk/_generated/models/frontend_candidate_configuration_status.py new file mode 100644 index 00000000..d75743c9 --- /dev/null +++ b/src/volcano_sdk/_generated/models/frontend_candidate_configuration_status.py @@ -0,0 +1,10 @@ +from typing import Literal + +FrontendCandidateConfigurationStatus = Literal['changed', 'current'] + +FRONTEND_CANDIDATE_CONFIGURATION_STATUS_VALUES: set[FrontendCandidateConfigurationStatus] = { 'changed', 'current', } + +def check_frontend_candidate_configuration_status(value: str) -> FrontendCandidateConfigurationStatus: + if value in FRONTEND_CANDIDATE_CONFIGURATION_STATUS_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {FRONTEND_CANDIDATE_CONFIGURATION_STATUS_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/frontend_candidate_deployment.py b/src/volcano_sdk/_generated/models/frontend_candidate_deployment.py new file mode 100644 index 00000000..ffa9f602 --- /dev/null +++ b/src/volcano_sdk/_generated/models/frontend_candidate_deployment.py @@ -0,0 +1,129 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.frontend_candidate_deployment_status import check_frontend_candidate_deployment_status +from ..models.frontend_candidate_deployment_status import FrontendCandidateDeploymentStatus +from ..types import UNSET, Unset +from typing import cast +from uuid import UUID +import datetime + + + + + + +T = TypeVar("T", bound="FrontendCandidateDeployment") + + + +@_attrs_define +class FrontendCandidateDeployment: + """ + Attributes: + id (UUID): + status (FrontendCandidateDeploymentStatus): `provisioning` while the build and deploy run, `active` once the + Candidate serves this + deployment, and `failed` when it could not be built or deployed. A failed deployment of a + Candidate that already served keeps the previous deployment serving. + configuration_digest (str): Identifies the resolved configuration the deployment was built with. It carries no + value. + created_at (datetime.datetime): + error_message (str | Unset): Why a failed deployment failed. + completed_at (datetime.datetime | Unset): Set once the deployment is no longer provisioning. + """ + + id: UUID + status: FrontendCandidateDeploymentStatus + configuration_digest: str + created_at: datetime.datetime + error_message: str | Unset = UNSET + completed_at: datetime.datetime | Unset = UNSET + + + + + + def to_dict(self) -> dict[str, Any]: + id = str(self.id) + + status: str = self.status + + configuration_digest = self.configuration_digest + + created_at = self.created_at.isoformat() + + error_message = self.error_message + + completed_at: str | Unset = UNSET + if not isinstance(self.completed_at, Unset): + completed_at = self.completed_at.isoformat() + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "id": id, + "status": status, + "configuration_digest": configuration_digest, + "created_at": created_at, + }) + if error_message is not UNSET: + field_dict["error_message"] = error_message + if completed_at is not UNSET: + field_dict["completed_at"] = completed_at + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = UUID(d.pop("id")) + + + + + status = check_frontend_candidate_deployment_status(d.pop("status")) + + + + + configuration_digest = d.pop("configuration_digest") + + created_at = datetime.datetime.fromisoformat(d.pop("created_at")) + + + + + error_message = d.pop("error_message", UNSET) + + _completed_at = d.pop("completed_at", UNSET) + completed_at: datetime.datetime | Unset + if isinstance(_completed_at, Unset): + completed_at = UNSET + else: + completed_at = datetime.datetime.fromisoformat(_completed_at) + + + + + frontend_candidate_deployment = cls( + id=id, + status=status, + configuration_digest=configuration_digest, + created_at=created_at, + error_message=error_message, + completed_at=completed_at, + ) + + return frontend_candidate_deployment + diff --git a/src/volcano_sdk/_generated/models/frontend_candidate_deployment_status.py b/src/volcano_sdk/_generated/models/frontend_candidate_deployment_status.py new file mode 100644 index 00000000..86e7bee9 --- /dev/null +++ b/src/volcano_sdk/_generated/models/frontend_candidate_deployment_status.py @@ -0,0 +1,10 @@ +from typing import Literal + +FrontendCandidateDeploymentStatus = Literal['active', 'failed', 'provisioning'] + +FRONTEND_CANDIDATE_DEPLOYMENT_STATUS_VALUES: set[FrontendCandidateDeploymentStatus] = { 'active', 'failed', 'provisioning', } + +def check_frontend_candidate_deployment_status(value: str) -> FrontendCandidateDeploymentStatus: + if value in FRONTEND_CANDIDATE_DEPLOYMENT_STATUS_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {FRONTEND_CANDIDATE_DEPLOYMENT_STATUS_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/frontend_candidate_list.py b/src/volcano_sdk/_generated/models/frontend_candidate_list.py new file mode 100644 index 00000000..4f285561 --- /dev/null +++ b/src/volcano_sdk/_generated/models/frontend_candidate_list.py @@ -0,0 +1,76 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast + +if TYPE_CHECKING: + from ..models.frontend_candidate import FrontendCandidate + + + + + +T = TypeVar("T", bound="FrontendCandidateList") + + + +@_attrs_define +class FrontendCandidateList: + """ + Attributes: + data (list[FrontendCandidate]): + """ + + data: list[FrontendCandidate] + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.frontend_candidate import FrontendCandidate # noqa: PLC0415 + data = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "data": data, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.frontend_candidate import FrontendCandidate # noqa: PLC0415 + d = dict(src_dict) + data = [] + _data = d.pop("data") + for data_item_data in (_data): + data_item = FrontendCandidate.from_dict(data_item_data) + + + + data.append(data_item) + + + frontend_candidate_list = cls( + data=data, + ) + + return frontend_candidate_list + diff --git a/src/volcano_sdk/_generated/models/frontend_candidate_status.py b/src/volcano_sdk/_generated/models/frontend_candidate_status.py new file mode 100644 index 00000000..36f1c9c4 --- /dev/null +++ b/src/volcano_sdk/_generated/models/frontend_candidate_status.py @@ -0,0 +1,10 @@ +from typing import Literal + +FrontendCandidateStatus = Literal['creating', 'deleting', 'error', 'ready'] + +FRONTEND_CANDIDATE_STATUS_VALUES: set[FrontendCandidateStatus] = { 'creating', 'deleting', 'error', 'ready', } + +def check_frontend_candidate_status(value: str) -> FrontendCandidateStatus: + if value in FRONTEND_CANDIDATE_STATUS_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {FRONTEND_CANDIDATE_STATUS_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/frontend_custom_domain_conflict_error.py b/src/volcano_sdk/_generated/models/frontend_custom_domain_conflict_error.py index 48324ad0..c4c07e89 100644 --- a/src/volcano_sdk/_generated/models/frontend_custom_domain_conflict_error.py +++ b/src/volcano_sdk/_generated/models/frontend_custom_domain_conflict_error.py @@ -33,6 +33,12 @@ class FrontendCustomDomainConflictError: Attributes: error (str): code (str | Unset): Stable machine-readable error code when a specific recovery path is available. + `plan_required` (403) means the project owner's plan does not include the requested feature or option; upgrading + the plan unlocks it. `person_required` (403) means a project access token tried to change LavaFlow settings, + which only the project's owner changes, with a platform token, or that the change needs the owner's own + credential that expires, a project repository, and an owner whose GitHub account can push to it; `error` says + which. A 403 without a code leaves the reason unspecified: it can be an access refusal, a reached limit, or a + plan check that could not read the owner's plan. Match on the code, not the message text. required_record (FrontendDomainVerificationRecord | Unset): The DNS records currently required. Volcano may require an account-specific TXT ownership record for the hostname's domain before returning a CNAME that authorizes managed certificate issuance and renewal. Clients must follow the records returned for the current diff --git a/src/volcano_sdk/_generated/models/frontend_custom_domain_list.py b/src/volcano_sdk/_generated/models/frontend_custom_domain_list.py new file mode 100644 index 00000000..3cdafb4b --- /dev/null +++ b/src/volcano_sdk/_generated/models/frontend_custom_domain_list.py @@ -0,0 +1,94 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast + +if TYPE_CHECKING: + from ..models.frontend_custom_domain_response import FrontendCustomDomainResponse + + + + + +T = TypeVar("T", bound="FrontendCustomDomainList") + + + +@_attrs_define +class FrontendCustomDomainList: + """ + Attributes: + data (list[FrontendCustomDomainResponse]): + """ + + data: list[FrontendCustomDomainResponse] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.frontend_custom_domain_response import FrontendCustomDomainResponse # noqa: PLC0415 + data = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "data": data, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.frontend_custom_domain_response import FrontendCustomDomainResponse # noqa: PLC0415 + d = dict(src_dict) + data = [] + _data = d.pop("data") + for data_item_data in (_data): + data_item = FrontendCustomDomainResponse.from_dict(data_item_data) + + + + data.append(data_item) + + + frontend_custom_domain_list = cls( + data=data, + ) + + + frontend_custom_domain_list.additional_properties = d + return frontend_custom_domain_list + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/frontend_custom_domain_redirect.py b/src/volcano_sdk/_generated/models/frontend_custom_domain_redirect.py new file mode 100644 index 00000000..04146df6 --- /dev/null +++ b/src/volcano_sdk/_generated/models/frontend_custom_domain_redirect.py @@ -0,0 +1,90 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.frontend_custom_domain_redirect_status import check_frontend_custom_domain_redirect_status +from ..models.frontend_custom_domain_redirect_status import FrontendCustomDomainRedirectStatus +from typing import cast + + + + + + +T = TypeVar("T", bound="FrontendCustomDomainRedirect") + + + +@_attrs_define +class FrontendCustomDomainRedirect: + """ + Attributes: + to (str): Hostname the domain redirects to. + status (FrontendCustomDomainRedirectStatus): + """ + + to: str + status: FrontendCustomDomainRedirectStatus + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + to = self.to + + status: int = self.status + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "to": to, + "status": status, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + to = d.pop("to") + + status = check_frontend_custom_domain_redirect_status(d.pop("status")) + + + + + frontend_custom_domain_redirect = cls( + to=to, + status=status, + ) + + + frontend_custom_domain_redirect.additional_properties = d + return frontend_custom_domain_redirect + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/frontend_custom_domain_redirect_request.py b/src/volcano_sdk/_generated/models/frontend_custom_domain_redirect_request.py new file mode 100644 index 00000000..4e80b6cc --- /dev/null +++ b/src/volcano_sdk/_generated/models/frontend_custom_domain_redirect_request.py @@ -0,0 +1,85 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.frontend_custom_domain_redirect_request_status import check_frontend_custom_domain_redirect_request_status +from ..models.frontend_custom_domain_redirect_request_status import FrontendCustomDomainRedirectRequestStatus +from ..types import UNSET, Unset +from typing import cast + + + + + + +T = TypeVar("T", bound="FrontendCustomDomainRedirectRequest") + + + +@_attrs_define +class FrontendCustomDomainRedirectRequest: + """ Redirects every request for the domain to `to`, another active domain of the same frontend that serves it, keeping + the path and query string. + + Attributes: + to (str): Hostname of an active domain of the same frontend that serves it. Example: www.example.com. + status (FrontendCustomDomainRedirectRequestStatus | Unset): Redirect status. 301 and 308 are permanent, 302 and + 307 temporary; 307 and 308 keep the request method and body. Default: 308. + """ + + to: str + status: FrontendCustomDomainRedirectRequestStatus | Unset = 308 + + + + + + def to_dict(self) -> dict[str, Any]: + to = self.to + + status: int | Unset = UNSET + if not isinstance(self.status, Unset): + status = self.status + + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "to": to, + }) + if status is not UNSET: + field_dict["status"] = status + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + to = d.pop("to") + + _status = d.pop("status", UNSET) + status: FrontendCustomDomainRedirectRequestStatus | Unset + if isinstance(_status, Unset): + status = UNSET + else: + status = check_frontend_custom_domain_redirect_request_status(_status) + + + + + frontend_custom_domain_redirect_request = cls( + to=to, + status=status, + ) + + return frontend_custom_domain_redirect_request + diff --git a/src/volcano_sdk/_generated/models/frontend_custom_domain_redirect_request_status.py b/src/volcano_sdk/_generated/models/frontend_custom_domain_redirect_request_status.py new file mode 100644 index 00000000..7a118903 --- /dev/null +++ b/src/volcano_sdk/_generated/models/frontend_custom_domain_redirect_request_status.py @@ -0,0 +1,10 @@ +from typing import Literal + +FrontendCustomDomainRedirectRequestStatus = Literal[301, 302, 307, 308] + +FRONTEND_CUSTOM_DOMAIN_REDIRECT_REQUEST_STATUS_VALUES: set[FrontendCustomDomainRedirectRequestStatus] = { 301, 302, 307, 308, } + +def check_frontend_custom_domain_redirect_request_status(value: int) -> FrontendCustomDomainRedirectRequestStatus: + if value in FRONTEND_CUSTOM_DOMAIN_REDIRECT_REQUEST_STATUS_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {FRONTEND_CUSTOM_DOMAIN_REDIRECT_REQUEST_STATUS_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/frontend_custom_domain_redirect_status.py b/src/volcano_sdk/_generated/models/frontend_custom_domain_redirect_status.py new file mode 100644 index 00000000..ed85622b --- /dev/null +++ b/src/volcano_sdk/_generated/models/frontend_custom_domain_redirect_status.py @@ -0,0 +1,10 @@ +from typing import Literal + +FrontendCustomDomainRedirectStatus = Literal[301, 302, 307, 308] + +FRONTEND_CUSTOM_DOMAIN_REDIRECT_STATUS_VALUES: set[FrontendCustomDomainRedirectStatus] = { 301, 302, 307, 308, } + +def check_frontend_custom_domain_redirect_status(value: int) -> FrontendCustomDomainRedirectStatus: + if value in FRONTEND_CUSTOM_DOMAIN_REDIRECT_STATUS_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {FRONTEND_CUSTOM_DOMAIN_REDIRECT_STATUS_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/frontend_custom_domain_response.py b/src/volcano_sdk/_generated/models/frontend_custom_domain_response.py index 7a58f669..b6c12d66 100644 --- a/src/volcano_sdk/_generated/models/frontend_custom_domain_response.py +++ b/src/volcano_sdk/_generated/models/frontend_custom_domain_response.py @@ -21,6 +21,7 @@ import datetime if TYPE_CHECKING: + from ..models.frontend_custom_domain_redirect import FrontendCustomDomainRedirect from ..models.frontend_domain_routing_record import FrontendDomainRoutingRecord from ..models.frontend_domain_verification_record import FrontendDomainVerificationRecord @@ -44,6 +45,8 @@ class FrontendCustomDomainResponse: withdrawn, or Volcano is retrying after a failure. `failed`: a failure left the domain unserved, alongside `domain_status: failed`; managed domains report the cause in `failure_reason`. effective_urls (list[str]): + redirect (FrontendCustomDomainRedirect | None): Where the domain redirects every request, or null when it serves + the frontend. created_at (datetime.datetime): updated_at (datetime.datetime): serving_certificate (FrontendCustomDomainResponseServingCertificate | Unset): Certificate the domain serves, @@ -69,6 +72,7 @@ class FrontendCustomDomainResponse: domain_status: FrontendCustomDomainResponseDomainStatus verification_status: FrontendCustomDomainResponseVerificationStatus effective_urls: list[str] + redirect: FrontendCustomDomainRedirect | None created_at: datetime.datetime updated_at: datetime.datetime serving_certificate: FrontendCustomDomainResponseServingCertificate | Unset = UNSET @@ -83,6 +87,7 @@ class FrontendCustomDomainResponse: def to_dict(self) -> dict[str, Any]: + from ..models.frontend_custom_domain_redirect import FrontendCustomDomainRedirect # noqa: PLC0415 from ..models.frontend_domain_routing_record import FrontendDomainRoutingRecord # noqa: PLC0415 from ..models.frontend_domain_verification_record import FrontendDomainVerificationRecord # noqa: PLC0415 domain = self.domain @@ -97,6 +102,12 @@ def to_dict(self) -> dict[str, Any]: + redirect: dict[str, Any] | None + if isinstance(self.redirect, FrontendCustomDomainRedirect): + redirect = self.redirect.to_dict() + else: + redirect = self.redirect + created_at = self.created_at.isoformat() updated_at = self.updated_at.isoformat() @@ -132,6 +143,7 @@ def to_dict(self) -> dict[str, Any]: "domain_status": domain_status, "verification_status": verification_status, "effective_urls": effective_urls, + "redirect": redirect, "created_at": created_at, "updated_at": updated_at, }) @@ -152,6 +164,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.frontend_custom_domain_redirect import FrontendCustomDomainRedirect # noqa: PLC0415 from ..models.frontend_domain_routing_record import FrontendDomainRoutingRecord # noqa: PLC0415 from ..models.frontend_domain_verification_record import FrontendDomainVerificationRecord # noqa: PLC0415 d = dict(src_dict) @@ -175,6 +188,24 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: effective_urls = cast(list[str], d.pop("effective_urls")) + def _parse_redirect(data: object) -> FrontendCustomDomainRedirect | None: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + redirect_type_1 = FrontendCustomDomainRedirect.from_dict(data) + + + + return redirect_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(FrontendCustomDomainRedirect | None, data) + + redirect = _parse_redirect(d.pop("redirect")) + + created_at = datetime.datetime.fromisoformat(d.pop("created_at")) @@ -227,6 +258,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: domain_status=domain_status, verification_status=verification_status, effective_urls=effective_urls, + redirect=redirect, created_at=created_at, updated_at=updated_at, serving_certificate=serving_certificate, diff --git a/src/volcano_sdk/_generated/models/frontend_deployment.py b/src/volcano_sdk/_generated/models/frontend_deployment.py index e1619381..8190029d 100644 --- a/src/volcano_sdk/_generated/models/frontend_deployment.py +++ b/src/volcano_sdk/_generated/models/frontend_deployment.py @@ -20,6 +20,7 @@ import datetime if TYPE_CHECKING: + from ..models.deployment_commit import DeploymentCommit from ..models.deployment_progress import DeploymentProgress @@ -46,6 +47,14 @@ class FrontendDeployment: updated_at (datetime.datetime): initiated_by (str | Unset): Platform user that triggered a request-initiated deployment; absent for git and system deployments. + commit (DeploymentCommit | Unset): The commit the deployment's source came from: the commit a deploy client + reported, or for a deployment a Git deployment run made, the commit the run deployed. Absent when there is + neither. A frontend deployment that publishes another deployment's build carries the commit that deployment's + client reported; one that publishes a Git deployment run's build has none. + git_deployment_run_id (UUID | Unset): The Git deployment run that made this deployment. Absent for a deployment + no Git deployment run made. + source_deployment_id (UUID | Unset): The deployment whose build this deployment published instead of compiling + its own source. Absent when the deployment compiled. site_url (str | Unset): build_duration_seconds (int | Unset): Total build time recorded for this deployment, in seconds. build_count (int | Unset): Number of completed builds included in build_duration_seconds. @@ -64,6 +73,9 @@ class FrontendDeployment: created_at: datetime.datetime updated_at: datetime.datetime initiated_by: str | Unset = UNSET + commit: DeploymentCommit | Unset = UNSET + git_deployment_run_id: UUID | Unset = UNSET + source_deployment_id: UUID | Unset = UNSET site_url: str | Unset = UNSET build_duration_seconds: int | Unset = UNSET build_count: int | Unset = UNSET @@ -77,6 +89,7 @@ class FrontendDeployment: def to_dict(self) -> dict[str, Any]: + from ..models.deployment_commit import DeploymentCommit # noqa: PLC0415 from ..models.deployment_progress import DeploymentProgress # noqa: PLC0415 id = str(self.id) @@ -96,6 +109,18 @@ def to_dict(self) -> dict[str, Any]: initiated_by = self.initiated_by + commit: dict[str, Any] | Unset = UNSET + if not isinstance(self.commit, Unset): + commit = self.commit.to_dict() + + git_deployment_run_id: str | Unset = UNSET + if not isinstance(self.git_deployment_run_id, Unset): + git_deployment_run_id = str(self.git_deployment_run_id) + + source_deployment_id: str | Unset = UNSET + if not isinstance(self.source_deployment_id, Unset): + source_deployment_id = str(self.source_deployment_id) + site_url = self.site_url build_duration_seconds = self.build_duration_seconds @@ -127,6 +152,12 @@ def to_dict(self) -> dict[str, Any]: }) if initiated_by is not UNSET: field_dict["initiated_by"] = initiated_by + if commit is not UNSET: + field_dict["commit"] = commit + if git_deployment_run_id is not UNSET: + field_dict["git_deployment_run_id"] = git_deployment_run_id + if source_deployment_id is not UNSET: + field_dict["source_deployment_id"] = source_deployment_id if site_url is not UNSET: field_dict["site_url"] = site_url if build_duration_seconds is not UNSET: @@ -146,6 +177,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.deployment_commit import DeploymentCommit # noqa: PLC0415 from ..models.deployment_progress import DeploymentProgress # noqa: PLC0415 d = dict(src_dict) id = UUID(d.pop("id")) @@ -190,6 +222,36 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: initiated_by = d.pop("initiated_by", UNSET) + _commit = d.pop("commit", UNSET) + commit: DeploymentCommit | Unset + if isinstance(_commit, Unset): + commit = UNSET + else: + commit = DeploymentCommit.from_dict(_commit) + + + + + _git_deployment_run_id = d.pop("git_deployment_run_id", UNSET) + git_deployment_run_id: UUID | Unset + if isinstance(_git_deployment_run_id, Unset): + git_deployment_run_id = UNSET + else: + git_deployment_run_id = UUID(_git_deployment_run_id) + + + + + _source_deployment_id = d.pop("source_deployment_id", UNSET) + source_deployment_id: UUID | Unset + if isinstance(_source_deployment_id, Unset): + source_deployment_id = UNSET + else: + source_deployment_id = UUID(_source_deployment_id) + + + + site_url = d.pop("site_url", UNSET) build_duration_seconds = d.pop("build_duration_seconds", UNSET) @@ -228,6 +290,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: created_at=created_at, updated_at=updated_at, initiated_by=initiated_by, + commit=commit, + git_deployment_run_id=git_deployment_run_id, + source_deployment_id=source_deployment_id, site_url=site_url, build_duration_seconds=build_duration_seconds, build_count=build_count, diff --git a/src/volcano_sdk/_generated/models/frontend_route.py b/src/volcano_sdk/_generated/models/frontend_route.py new file mode 100644 index 00000000..390d2714 --- /dev/null +++ b/src/volcano_sdk/_generated/models/frontend_route.py @@ -0,0 +1,130 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast +from uuid import UUID +import datetime + + + + + + +T = TypeVar("T", bound="FrontendRoute") + + + +@_attrs_define +class FrontendRoute: + """ A path prefix on this Frontend's hostnames served by another Frontend in the Project, the + mounted Frontend. Paths are forwarded unchanged, so the mounted Frontend serves its prefix + as real pages (page directories or a matching `basePath`). + + Attributes: + id (UUID): + project_id (UUID): + frontend_id (UUID): The Frontend whose hostnames serve the route + target_frontend_id (UUID): The mounted Frontend + path_prefix (str): + created_at (datetime.datetime): + updated_at (datetime.datetime): + """ + + id: UUID + project_id: UUID + frontend_id: UUID + target_frontend_id: UUID + path_prefix: str + created_at: datetime.datetime + updated_at: datetime.datetime + + + + + + def to_dict(self) -> dict[str, Any]: + id = str(self.id) + + project_id = str(self.project_id) + + frontend_id = str(self.frontend_id) + + target_frontend_id = str(self.target_frontend_id) + + path_prefix = self.path_prefix + + created_at = self.created_at.isoformat() + + updated_at = self.updated_at.isoformat() + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "id": id, + "project_id": project_id, + "frontend_id": frontend_id, + "target_frontend_id": target_frontend_id, + "path_prefix": path_prefix, + "created_at": created_at, + "updated_at": updated_at, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = UUID(d.pop("id")) + + + + + project_id = UUID(d.pop("project_id")) + + + + + frontend_id = UUID(d.pop("frontend_id")) + + + + + target_frontend_id = UUID(d.pop("target_frontend_id")) + + + + + path_prefix = d.pop("path_prefix") + + created_at = datetime.datetime.fromisoformat(d.pop("created_at")) + + + + + updated_at = datetime.datetime.fromisoformat(d.pop("updated_at")) + + + + + frontend_route = cls( + id=id, + project_id=project_id, + frontend_id=frontend_id, + target_frontend_id=target_frontend_id, + path_prefix=path_prefix, + created_at=created_at, + updated_at=updated_at, + ) + + return frontend_route + diff --git a/src/volcano_sdk/_generated/models/frontend_route_list.py b/src/volcano_sdk/_generated/models/frontend_route_list.py new file mode 100644 index 00000000..50975964 --- /dev/null +++ b/src/volcano_sdk/_generated/models/frontend_route_list.py @@ -0,0 +1,76 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast + +if TYPE_CHECKING: + from ..models.frontend_route import FrontendRoute + + + + + +T = TypeVar("T", bound="FrontendRouteList") + + + +@_attrs_define +class FrontendRouteList: + """ + Attributes: + data (list[FrontendRoute]): + """ + + data: list[FrontendRoute] + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.frontend_route import FrontendRoute # noqa: PLC0415 + data = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "data": data, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.frontend_route import FrontendRoute # noqa: PLC0415 + d = dict(src_dict) + data = [] + _data = d.pop("data") + for data_item_data in (_data): + data_item = FrontendRoute.from_dict(data_item_data) + + + + data.append(data_item) + + + frontend_route_list = cls( + data=data, + ) + + return frontend_route_list + diff --git a/src/volcano_sdk/_generated/models/frontend_serving.py b/src/volcano_sdk/_generated/models/frontend_serving.py new file mode 100644 index 00000000..2d59fb1a --- /dev/null +++ b/src/volcano_sdk/_generated/models/frontend_serving.py @@ -0,0 +1,125 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast +from uuid import UUID + + + + + + +T = TypeVar("T", bound="FrontendServing") + + + +@_attrs_define +class FrontendServing: + """ What a frontend serves. Until a Candidate is promoted it serves its own runtime and + `candidate_id` is null. After a promotion, the frontend's traffic is routed to that + Candidate's runtime, nothing is rebuilt or copied, and `previous_candidate_id` is the runtime a + rollback returns to (null when that is the frontend's own). A Candidate that serves cannot be + deleted and does not expire. One kept only as the runtime a rollback returns to does not + expire either, but it can be deleted, which gives up that rollback; the frontend's own + runtime stays one `to_production` rollback away. + + Attributes: + revision (int): Counts changes to what the frontend serves or can roll back to — promotions, rollbacks, and + deleting the Candidate kept for a rollback. A promotion or rollback names the revision it read, so one that read + before such a change fails with `409` instead of overwriting it; read the serving state again and retry. + candidate_id (None | UUID): + previous_candidate_id (None | UUID): + """ + + revision: int + candidate_id: None | UUID + previous_candidate_id: None | UUID + + + + + + def to_dict(self) -> dict[str, Any]: + revision = self.revision + + candidate_id: None | str + if isinstance(self.candidate_id, UUID): + candidate_id = str(self.candidate_id) + else: + candidate_id = self.candidate_id + + previous_candidate_id: None | str + if isinstance(self.previous_candidate_id, UUID): + previous_candidate_id = str(self.previous_candidate_id) + else: + previous_candidate_id = self.previous_candidate_id + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "revision": revision, + "candidate_id": candidate_id, + "previous_candidate_id": previous_candidate_id, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + revision = d.pop("revision") + + def _parse_candidate_id(data: object) -> None | UUID: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + candidate_id_type_0 = UUID(data) + + + + return candidate_id_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | UUID, data) + + candidate_id = _parse_candidate_id(d.pop("candidate_id")) + + + def _parse_previous_candidate_id(data: object) -> None | UUID: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + previous_candidate_id_type_0 = UUID(data) + + + + return previous_candidate_id_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | UUID, data) + + previous_candidate_id = _parse_previous_candidate_id(d.pop("previous_candidate_id")) + + + frontend_serving = cls( + revision=revision, + candidate_id=candidate_id, + previous_candidate_id=previous_candidate_id, + ) + + return frontend_serving + diff --git a/src/volcano_sdk/_generated/models/function.py b/src/volcano_sdk/_generated/models/function.py index bfe46bc2..24ae511f 100644 --- a/src/volcano_sdk/_generated/models/function.py +++ b/src/volcano_sdk/_generated/models/function.py @@ -60,13 +60,18 @@ class Function: function. has_openapi_spec (bool): Whether OpenAPI metadata is configured; list responses omit the document itself. deployed_regions (list[str]): Regions where this function is currently deployed + serving_candidate_id (None | UUID): The promoted preview whose runtime receives this function's traffic, the + same as + `candidate_id` in `serving`. Null when the function runs its own build. While it is set, + `current_deployment_id` and `status` describe the function's own build, which receives no + traffic until the function is rolled back. created_at (datetime.datetime): updated_at (datetime.datetime): provisioning_started_at (datetime.datetime | Unset): Timestamp when the current provisioning phase started invoke_url (str | Unset): 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. + not share a domain with the API, so a host derived from the API URL will not reach the function. In local + development it is `http://{id}.functions.localhost:8000/`, served by the local API. Omitted when the deployment + serves no function invocation domain, so a client testing for an empty string never matches. runtime (str | Unset): handler (str | Unset): current_deployment_id (UUID | Unset): Identifier of the latest function deployment operation @@ -85,6 +90,7 @@ class Function: openapi_spec: FunctionOpenapiSpecType0 | None has_openapi_spec: bool deployed_regions: list[str] + serving_candidate_id: None | UUID created_at: datetime.datetime updated_at: datetime.datetime provisioning_started_at: datetime.datetime | Unset = UNSET @@ -130,6 +136,12 @@ def to_dict(self) -> dict[str, Any]: + serving_candidate_id: None | str + if isinstance(self.serving_candidate_id, UUID): + serving_candidate_id = str(self.serving_candidate_id) + else: + serving_candidate_id = self.serving_candidate_id + created_at = self.created_at.isoformat() updated_at = self.updated_at.isoformat() @@ -171,6 +183,7 @@ def to_dict(self) -> dict[str, Any]: "openapi_spec": openapi_spec, "has_openapi_spec": has_openapi_spec, "deployed_regions": deployed_regions, + "serving_candidate_id": serving_candidate_id, "created_at": created_at, "updated_at": updated_at, }) @@ -254,6 +267,24 @@ def _parse_openapi_spec(data: object) -> FunctionOpenapiSpecType0 | None: deployed_regions = cast(list[str], d.pop("deployed_regions")) + def _parse_serving_candidate_id(data: object) -> None | UUID: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + serving_candidate_id_type_0 = UUID(data) + + + + return serving_candidate_id_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | UUID, data) + + serving_candidate_id = _parse_serving_candidate_id(d.pop("serving_candidate_id")) + + created_at = datetime.datetime.fromisoformat(d.pop("created_at")) @@ -322,6 +353,7 @@ def _parse_openapi_spec(data: object) -> FunctionOpenapiSpecType0 | None: openapi_spec=openapi_spec, has_openapi_spec=has_openapi_spec, deployed_regions=deployed_regions, + serving_candidate_id=serving_candidate_id, created_at=created_at, updated_at=updated_at, provisioning_started_at=provisioning_started_at, diff --git a/src/volcano_sdk/_generated/models/function_candidate.py b/src/volcano_sdk/_generated/models/function_candidate.py new file mode 100644 index 00000000..d53c777a --- /dev/null +++ b/src/volcano_sdk/_generated/models/function_candidate.py @@ -0,0 +1,273 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.function_candidate_configuration_status import check_function_candidate_configuration_status +from ..models.function_candidate_configuration_status import FunctionCandidateConfigurationStatus +from ..models.function_candidate_exposure import check_function_candidate_exposure +from ..models.function_candidate_exposure import FunctionCandidateExposure +from ..models.function_candidate_status import check_function_candidate_status +from ..models.function_candidate_status import FunctionCandidateStatus +from ..types import UNSET, Unset +from typing import cast +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.function_candidate_deployment import FunctionCandidateDeployment + + + + + +T = TypeVar("T", bound="FunctionCandidate") + + + +@_attrs_define +class FunctionCandidate: + """ A copy of an ordinary function built from an uploaded source with the function's own variables, + run on a runtime of its own and invoked at its own host with the project's service key only, so it + can be checked before it is promoted. It has none of the function's schedules or warmers. Fields + that do not apply yet are absent. + + Attributes: + id (UUID): + function_id (UUID): + name (str): + slug (str): + status (FunctionCandidateStatus): `creating` until its first deployment succeeds, `ready` while it serves, + `deleting` while its + runtime is removed, and `error` when its deletion gave up and needs an operator. A deleted + preview answers `404`. + exposure (FunctionCandidateExposure): A function preview is always private. Only the project's service key, with + `functions.invoke`, can invoke it; signed-in users, anon keys and access tokens are refused. + created_at (datetime.datetime): + updated_at (datetime.datetime): + serving (bool): The function runs this preview's build. + kept_for_rollback (bool): A rollback of the function returns to this preview's build. + url (str | Unset): Where the preview is invoked. Absent until its first deployment succeeds. + expires_at (datetime.datetime | Unset): When the preview is deleted on its own. Absent when it is kept until + deleted. A preview the function runs, or keeps for a rollback, is not deleted then; it expires once it is + neither. + created_by (str | Unset): The user who created the preview, when a user did. + current_deployment_id (UUID | Unset): The deployment the preview serves. Absent until its first deployment + succeeds. It differs from + `deployment` while a redeploy runs or after one failed. + deployment (FunctionCandidateDeployment | Unset): + configuration_status (FunctionCandidateConfigurationStatus | Unset): Present while the preview serves a + deployment. `current` means that deployment was built with + the variables, runtime and handler the function would give that source now; `changed` means + they differ, or can no longer be resolved. Promotion refuses a preview whose status is + `changed`. + """ + + id: UUID + function_id: UUID + name: str + slug: str + status: FunctionCandidateStatus + exposure: FunctionCandidateExposure + created_at: datetime.datetime + updated_at: datetime.datetime + serving: bool + kept_for_rollback: bool + url: str | Unset = UNSET + expires_at: datetime.datetime | Unset = UNSET + created_by: str | Unset = UNSET + current_deployment_id: UUID | Unset = UNSET + deployment: FunctionCandidateDeployment | Unset = UNSET + configuration_status: FunctionCandidateConfigurationStatus | Unset = UNSET + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.function_candidate_deployment import FunctionCandidateDeployment # noqa: PLC0415 + id = str(self.id) + + function_id = str(self.function_id) + + name = self.name + + slug = self.slug + + status: str = self.status + + exposure: str = self.exposure + + created_at = self.created_at.isoformat() + + updated_at = self.updated_at.isoformat() + + serving = self.serving + + kept_for_rollback = self.kept_for_rollback + + url = self.url + + expires_at: str | Unset = UNSET + if not isinstance(self.expires_at, Unset): + expires_at = self.expires_at.isoformat() + + created_by = self.created_by + + current_deployment_id: str | Unset = UNSET + if not isinstance(self.current_deployment_id, Unset): + current_deployment_id = str(self.current_deployment_id) + + deployment: dict[str, Any] | Unset = UNSET + if not isinstance(self.deployment, Unset): + deployment = self.deployment.to_dict() + + configuration_status: str | Unset = UNSET + if not isinstance(self.configuration_status, Unset): + configuration_status = self.configuration_status + + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "id": id, + "function_id": function_id, + "name": name, + "slug": slug, + "status": status, + "exposure": exposure, + "created_at": created_at, + "updated_at": updated_at, + "serving": serving, + "kept_for_rollback": kept_for_rollback, + }) + if url is not UNSET: + field_dict["url"] = url + if expires_at is not UNSET: + field_dict["expires_at"] = expires_at + if created_by is not UNSET: + field_dict["created_by"] = created_by + if current_deployment_id is not UNSET: + field_dict["current_deployment_id"] = current_deployment_id + if deployment is not UNSET: + field_dict["deployment"] = deployment + if configuration_status is not UNSET: + field_dict["configuration_status"] = configuration_status + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.function_candidate_deployment import FunctionCandidateDeployment # noqa: PLC0415 + d = dict(src_dict) + id = UUID(d.pop("id")) + + + + + function_id = UUID(d.pop("function_id")) + + + + + name = d.pop("name") + + slug = d.pop("slug") + + status = check_function_candidate_status(d.pop("status")) + + + + + exposure = check_function_candidate_exposure(d.pop("exposure")) + + + + + created_at = datetime.datetime.fromisoformat(d.pop("created_at")) + + + + + updated_at = datetime.datetime.fromisoformat(d.pop("updated_at")) + + + + + serving = d.pop("serving") + + kept_for_rollback = d.pop("kept_for_rollback") + + url = d.pop("url", UNSET) + + _expires_at = d.pop("expires_at", UNSET) + expires_at: datetime.datetime | Unset + if isinstance(_expires_at, Unset): + expires_at = UNSET + else: + expires_at = datetime.datetime.fromisoformat(_expires_at) + + + + + created_by = d.pop("created_by", UNSET) + + _current_deployment_id = d.pop("current_deployment_id", UNSET) + current_deployment_id: UUID | Unset + if isinstance(_current_deployment_id, Unset): + current_deployment_id = UNSET + else: + current_deployment_id = UUID(_current_deployment_id) + + + + + _deployment = d.pop("deployment", UNSET) + deployment: FunctionCandidateDeployment | Unset + if isinstance(_deployment, Unset): + deployment = UNSET + else: + deployment = FunctionCandidateDeployment.from_dict(_deployment) + + + + + _configuration_status = d.pop("configuration_status", UNSET) + configuration_status: FunctionCandidateConfigurationStatus | Unset + if isinstance(_configuration_status, Unset): + configuration_status = UNSET + else: + configuration_status = check_function_candidate_configuration_status(_configuration_status) + + + + + function_candidate = cls( + id=id, + function_id=function_id, + name=name, + slug=slug, + status=status, + exposure=exposure, + created_at=created_at, + updated_at=updated_at, + serving=serving, + kept_for_rollback=kept_for_rollback, + url=url, + expires_at=expires_at, + created_by=created_by, + current_deployment_id=current_deployment_id, + deployment=deployment, + configuration_status=configuration_status, + ) + + return function_candidate + diff --git a/src/volcano_sdk/_generated/models/function_candidate_configuration_status.py b/src/volcano_sdk/_generated/models/function_candidate_configuration_status.py new file mode 100644 index 00000000..5e4a39b5 --- /dev/null +++ b/src/volcano_sdk/_generated/models/function_candidate_configuration_status.py @@ -0,0 +1,10 @@ +from typing import Literal + +FunctionCandidateConfigurationStatus = Literal['changed', 'current'] + +FUNCTION_CANDIDATE_CONFIGURATION_STATUS_VALUES: set[FunctionCandidateConfigurationStatus] = { 'changed', 'current', } + +def check_function_candidate_configuration_status(value: str) -> FunctionCandidateConfigurationStatus: + if value in FUNCTION_CANDIDATE_CONFIGURATION_STATUS_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {FUNCTION_CANDIDATE_CONFIGURATION_STATUS_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/function_candidate_deployment.py b/src/volcano_sdk/_generated/models/function_candidate_deployment.py new file mode 100644 index 00000000..8b2e742c --- /dev/null +++ b/src/volcano_sdk/_generated/models/function_candidate_deployment.py @@ -0,0 +1,184 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.function_candidate_deployment_operation import check_function_candidate_deployment_operation +from ..models.function_candidate_deployment_operation import FunctionCandidateDeploymentOperation +from ..models.function_candidate_deployment_status import check_function_candidate_deployment_status +from ..models.function_candidate_deployment_status import FunctionCandidateDeploymentStatus +from ..types import UNSET, Unset +from typing import cast +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.function_image_digest import FunctionImageDigest + + + + + +T = TypeVar("T", bound="FunctionCandidateDeployment") + + + +@_attrs_define +class FunctionCandidateDeployment: + """ + Attributes: + id (UUID): + status (FunctionCandidateDeploymentStatus): `provisioning` while the build and deploy run, `active` once the + preview serves this + deployment, and `failed` when it could not be built or deployed. A failed deployment of a + preview that already served keeps the previous deployment serving. + operation (FunctionCandidateDeploymentOperation): + configuration_digest (str): Identifies the variables the build used without carrying any value. + regions (list[str]): + created_at (datetime.datetime): + image_digests (list[FunctionImageDigest] | Unset): The digest of the image this deployment published, per + region. Present once the deployment + succeeded. A promotion points the function at this image and deploys nothing. + error_message (str | Unset): Why a failed deployment failed. + completed_at (datetime.datetime | Unset): Set once the deployment is no longer provisioning. + """ + + id: UUID + status: FunctionCandidateDeploymentStatus + operation: FunctionCandidateDeploymentOperation + configuration_digest: str + regions: list[str] + created_at: datetime.datetime + image_digests: list[FunctionImageDigest] | Unset = UNSET + error_message: str | Unset = UNSET + completed_at: datetime.datetime | Unset = UNSET + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.function_image_digest import FunctionImageDigest # noqa: PLC0415 + id = str(self.id) + + status: str = self.status + + operation: str = self.operation + + configuration_digest = self.configuration_digest + + regions = self.regions + + + + created_at = self.created_at.isoformat() + + image_digests: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.image_digests, Unset): + image_digests = [] + for image_digests_item_data in self.image_digests: + image_digests_item = image_digests_item_data.to_dict() + image_digests.append(image_digests_item) + + + + error_message = self.error_message + + completed_at: str | Unset = UNSET + if not isinstance(self.completed_at, Unset): + completed_at = self.completed_at.isoformat() + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "id": id, + "status": status, + "operation": operation, + "configuration_digest": configuration_digest, + "regions": regions, + "created_at": created_at, + }) + if image_digests is not UNSET: + field_dict["image_digests"] = image_digests + if error_message is not UNSET: + field_dict["error_message"] = error_message + if completed_at is not UNSET: + field_dict["completed_at"] = completed_at + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.function_image_digest import FunctionImageDigest # noqa: PLC0415 + d = dict(src_dict) + id = UUID(d.pop("id")) + + + + + status = check_function_candidate_deployment_status(d.pop("status")) + + + + + operation = check_function_candidate_deployment_operation(d.pop("operation")) + + + + + configuration_digest = d.pop("configuration_digest") + + regions = cast(list[str], d.pop("regions")) + + + created_at = datetime.datetime.fromisoformat(d.pop("created_at")) + + + + + _image_digests = d.pop("image_digests", UNSET) + image_digests: list[FunctionImageDigest] | Unset = UNSET + if _image_digests is not UNSET: + image_digests = [] + for image_digests_item_data in _image_digests: + image_digests_item = FunctionImageDigest.from_dict(image_digests_item_data) + + + + image_digests.append(image_digests_item) + + + error_message = d.pop("error_message", UNSET) + + _completed_at = d.pop("completed_at", UNSET) + completed_at: datetime.datetime | Unset + if isinstance(_completed_at, Unset): + completed_at = UNSET + else: + completed_at = datetime.datetime.fromisoformat(_completed_at) + + + + + function_candidate_deployment = cls( + id=id, + status=status, + operation=operation, + configuration_digest=configuration_digest, + regions=regions, + created_at=created_at, + image_digests=image_digests, + error_message=error_message, + completed_at=completed_at, + ) + + return function_candidate_deployment + diff --git a/src/volcano_sdk/_generated/models/function_candidate_deployment_list.py b/src/volcano_sdk/_generated/models/function_candidate_deployment_list.py new file mode 100644 index 00000000..256d41df --- /dev/null +++ b/src/volcano_sdk/_generated/models/function_candidate_deployment_list.py @@ -0,0 +1,76 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast + +if TYPE_CHECKING: + from ..models.function_candidate_deployment import FunctionCandidateDeployment + + + + + +T = TypeVar("T", bound="FunctionCandidateDeploymentList") + + + +@_attrs_define +class FunctionCandidateDeploymentList: + """ + Attributes: + data (list[FunctionCandidateDeployment]): + """ + + data: list[FunctionCandidateDeployment] + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.function_candidate_deployment import FunctionCandidateDeployment # noqa: PLC0415 + data = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "data": data, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.function_candidate_deployment import FunctionCandidateDeployment # noqa: PLC0415 + d = dict(src_dict) + data = [] + _data = d.pop("data") + for data_item_data in (_data): + data_item = FunctionCandidateDeployment.from_dict(data_item_data) + + + + data.append(data_item) + + + function_candidate_deployment_list = cls( + data=data, + ) + + return function_candidate_deployment_list + diff --git a/src/volcano_sdk/_generated/models/function_candidate_deployment_operation.py b/src/volcano_sdk/_generated/models/function_candidate_deployment_operation.py new file mode 100644 index 00000000..be9de51d --- /dev/null +++ b/src/volcano_sdk/_generated/models/function_candidate_deployment_operation.py @@ -0,0 +1,10 @@ +from typing import Literal + +FunctionCandidateDeploymentOperation = Literal['deploy', 'redeploy'] + +FUNCTION_CANDIDATE_DEPLOYMENT_OPERATION_VALUES: set[FunctionCandidateDeploymentOperation] = { 'deploy', 'redeploy', } + +def check_function_candidate_deployment_operation(value: str) -> FunctionCandidateDeploymentOperation: + if value in FUNCTION_CANDIDATE_DEPLOYMENT_OPERATION_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {FUNCTION_CANDIDATE_DEPLOYMENT_OPERATION_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/function_candidate_deployment_status.py b/src/volcano_sdk/_generated/models/function_candidate_deployment_status.py new file mode 100644 index 00000000..1235043b --- /dev/null +++ b/src/volcano_sdk/_generated/models/function_candidate_deployment_status.py @@ -0,0 +1,10 @@ +from typing import Literal + +FunctionCandidateDeploymentStatus = Literal['active', 'failed', 'provisioning'] + +FUNCTION_CANDIDATE_DEPLOYMENT_STATUS_VALUES: set[FunctionCandidateDeploymentStatus] = { 'active', 'failed', 'provisioning', } + +def check_function_candidate_deployment_status(value: str) -> FunctionCandidateDeploymentStatus: + if value in FUNCTION_CANDIDATE_DEPLOYMENT_STATUS_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {FUNCTION_CANDIDATE_DEPLOYMENT_STATUS_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/function_candidate_exposure.py b/src/volcano_sdk/_generated/models/function_candidate_exposure.py new file mode 100644 index 00000000..66134e0d --- /dev/null +++ b/src/volcano_sdk/_generated/models/function_candidate_exposure.py @@ -0,0 +1,10 @@ +from typing import Literal + +FunctionCandidateExposure = Literal['private'] + +FUNCTION_CANDIDATE_EXPOSURE_VALUES: set[FunctionCandidateExposure] = { 'private', } + +def check_function_candidate_exposure(value: str) -> FunctionCandidateExposure: + if value in FUNCTION_CANDIDATE_EXPOSURE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {FUNCTION_CANDIDATE_EXPOSURE_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/function_candidate_list.py b/src/volcano_sdk/_generated/models/function_candidate_list.py new file mode 100644 index 00000000..e4d30ec7 --- /dev/null +++ b/src/volcano_sdk/_generated/models/function_candidate_list.py @@ -0,0 +1,76 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast + +if TYPE_CHECKING: + from ..models.function_candidate import FunctionCandidate + + + + + +T = TypeVar("T", bound="FunctionCandidateList") + + + +@_attrs_define +class FunctionCandidateList: + """ + Attributes: + data (list[FunctionCandidate]): + """ + + data: list[FunctionCandidate] + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.function_candidate import FunctionCandidate # noqa: PLC0415 + data = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "data": data, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.function_candidate import FunctionCandidate # noqa: PLC0415 + d = dict(src_dict) + data = [] + _data = d.pop("data") + for data_item_data in (_data): + data_item = FunctionCandidate.from_dict(data_item_data) + + + + data.append(data_item) + + + function_candidate_list = cls( + data=data, + ) + + return function_candidate_list + diff --git a/src/volcano_sdk/_generated/models/function_candidate_status.py b/src/volcano_sdk/_generated/models/function_candidate_status.py new file mode 100644 index 00000000..c8197505 --- /dev/null +++ b/src/volcano_sdk/_generated/models/function_candidate_status.py @@ -0,0 +1,10 @@ +from typing import Literal + +FunctionCandidateStatus = Literal['creating', 'deleting', 'error', 'ready'] + +FUNCTION_CANDIDATE_STATUS_VALUES: set[FunctionCandidateStatus] = { 'creating', 'deleting', 'error', 'ready', } + +def check_function_candidate_status(value: str) -> FunctionCandidateStatus: + if value in FUNCTION_CANDIDATE_STATUS_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {FUNCTION_CANDIDATE_STATUS_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/function_deployment.py b/src/volcano_sdk/_generated/models/function_deployment.py index 7f7c87b2..7c5290e3 100644 --- a/src/volcano_sdk/_generated/models/function_deployment.py +++ b/src/volcano_sdk/_generated/models/function_deployment.py @@ -20,6 +20,7 @@ import datetime if TYPE_CHECKING: + from ..models.deployment_commit import DeploymentCommit from ..models.deployment_progress import DeploymentProgress @@ -45,6 +46,12 @@ class FunctionDeployment: batch_id (UUID | Unset): initiated_by (str | Unset): Platform user that triggered a request-initiated deployment; absent for git and system deployments. + commit (DeploymentCommit | Unset): The commit the deployment's source came from: the commit a deploy client + reported, or for a deployment a Git deployment run made, the commit the run deployed. Absent when there is + neither. A frontend deployment that publishes another deployment's build carries the commit that deployment's + client reported; one that publishes a Git deployment run's build has none. + git_deployment_run_id (UUID | Unset): The Git deployment run that made this deployment. Absent for a deployment + no Git deployment run made. build_duration_seconds (int | Unset): Total build time recorded for this deployment, in seconds. build_count (int | Unset): Number of completed builds included in build_duration_seconds. build_duration_recorded_at (datetime.datetime | Unset): When the build time was last recorded. @@ -64,6 +71,8 @@ class FunctionDeployment: updated_at: datetime.datetime batch_id: UUID | Unset = UNSET initiated_by: str | Unset = UNSET + commit: DeploymentCommit | Unset = UNSET + git_deployment_run_id: UUID | Unset = UNSET build_duration_seconds: int | Unset = UNSET build_count: int | Unset = UNSET build_duration_recorded_at: datetime.datetime | Unset = UNSET @@ -77,6 +86,7 @@ class FunctionDeployment: def to_dict(self) -> dict[str, Any]: + from ..models.deployment_commit import DeploymentCommit # noqa: PLC0415 from ..models.deployment_progress import DeploymentProgress # noqa: PLC0415 id = str(self.id) @@ -100,6 +110,14 @@ def to_dict(self) -> dict[str, Any]: initiated_by = self.initiated_by + commit: dict[str, Any] | Unset = UNSET + if not isinstance(self.commit, Unset): + commit = self.commit.to_dict() + + git_deployment_run_id: str | Unset = UNSET + if not isinstance(self.git_deployment_run_id, Unset): + git_deployment_run_id = str(self.git_deployment_run_id) + build_duration_seconds = self.build_duration_seconds build_count = self.build_count @@ -135,6 +153,10 @@ def to_dict(self) -> dict[str, Any]: field_dict["batch_id"] = batch_id if initiated_by is not UNSET: field_dict["initiated_by"] = initiated_by + if commit is not UNSET: + field_dict["commit"] = commit + if git_deployment_run_id is not UNSET: + field_dict["git_deployment_run_id"] = git_deployment_run_id if build_duration_seconds is not UNSET: field_dict["build_duration_seconds"] = build_duration_seconds if build_count is not UNSET: @@ -154,6 +176,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.deployment_commit import DeploymentCommit # noqa: PLC0415 from ..models.deployment_progress import DeploymentProgress # noqa: PLC0415 d = dict(src_dict) id = UUID(d.pop("id")) @@ -208,6 +231,26 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: initiated_by = d.pop("initiated_by", UNSET) + _commit = d.pop("commit", UNSET) + commit: DeploymentCommit | Unset + if isinstance(_commit, Unset): + commit = UNSET + else: + commit = DeploymentCommit.from_dict(_commit) + + + + + _git_deployment_run_id = d.pop("git_deployment_run_id", UNSET) + git_deployment_run_id: UUID | Unset + if isinstance(_git_deployment_run_id, Unset): + git_deployment_run_id = UNSET + else: + git_deployment_run_id = UUID(_git_deployment_run_id) + + + + build_duration_seconds = d.pop("build_duration_seconds", UNSET) build_count = d.pop("build_count", UNSET) @@ -255,6 +298,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at=updated_at, batch_id=batch_id, initiated_by=initiated_by, + commit=commit, + git_deployment_run_id=git_deployment_run_id, build_duration_seconds=build_duration_seconds, build_count=build_count, build_duration_recorded_at=build_duration_recorded_at, diff --git a/src/volcano_sdk/_generated/models/function_image_digest.py b/src/volcano_sdk/_generated/models/function_image_digest.py new file mode 100644 index 00000000..c3f75507 --- /dev/null +++ b/src/volcano_sdk/_generated/models/function_image_digest.py @@ -0,0 +1,70 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset + + + + + + +T = TypeVar("T", bound="FunctionImageDigest") + + + +@_attrs_define +class FunctionImageDigest: + """ The content digest of a function image in one region. It names no registry or account. + + Attributes: + digest (str): + region (str | Unset): The region the image was published to. Absent when the build published one image for every + region. + """ + + digest: str + region: str | Unset = UNSET + + + + + + def to_dict(self) -> dict[str, Any]: + digest = self.digest + + region = self.region + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "digest": digest, + }) + if region is not UNSET: + field_dict["region"] = region + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + digest = d.pop("digest") + + region = d.pop("region", UNSET) + + function_image_digest = cls( + digest=digest, + region=region, + ) + + return function_image_digest + diff --git a/src/volcano_sdk/_generated/models/function_invocation_request.py b/src/volcano_sdk/_generated/models/function_invocation_request.py index 2853a9af..bb9be977 100644 --- a/src/volcano_sdk/_generated/models/function_invocation_request.py +++ b/src/volcano_sdk/_generated/models/function_invocation_request.py @@ -41,8 +41,8 @@ class FunctionInvocationRequest: } ``` - The top-level `__volcano_auth` and `__volcano_http` keys are reserved; - Volcano removes caller-supplied values for both. + The top-level `__volcano_auth`, `__volcano_http` and `__volcano_mount` + keys are reserved; Volcano removes caller-supplied values for all three. """ payload: FunctionInvocationRequestPayload | Unset = UNSET diff --git a/src/volcano_sdk/_generated/models/function_invocation_request_payload.py b/src/volcano_sdk/_generated/models/function_invocation_request_payload.py index 7457d0fd..db5acbf5 100644 --- a/src/volcano_sdk/_generated/models/function_invocation_request_payload.py +++ b/src/volcano_sdk/_generated/models/function_invocation_request_payload.py @@ -35,8 +35,8 @@ class FunctionInvocationRequestPayload: } ``` - The top-level `__volcano_auth` and `__volcano_http` keys are reserved; - Volcano removes caller-supplied values for both. + The top-level `__volcano_auth`, `__volcano_http` and `__volcano_mount` + keys are reserved; Volcano removes caller-supplied values for all three. """ diff --git a/src/volcano_sdk/_generated/models/function_production_environment.py b/src/volcano_sdk/_generated/models/function_production_environment.py new file mode 100644 index 00000000..9e9cd0dd --- /dev/null +++ b/src/volcano_sdk/_generated/models/function_production_environment.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.function_production_environment_status import check_function_production_environment_status +from ..models.function_production_environment_status import FunctionProductionEnvironmentStatus +from ..types import UNSET, Unset +from typing import cast +import datetime + + + + + + +T = TypeVar("T", bound="FunctionProductionEnvironment") + + + +@_attrs_define +class FunctionProductionEnvironment: + """ Whether the function's own build has the project's current variables. While a preview serves the + function, `volcano config deploy` and replacing the shared variable list skip the function, so its + own build keeps the values it had. A rollback to the function's own build starts synchronizing them + as it returns the traffic, and the status reads `current` once that synchronization completes or a + deployment of the function activates. A synchronization that fails leaves it `out_of_date`. + + Attributes: + status (FunctionProductionEnvironmentStatus): `out_of_date`: a stored variable change skipped the function while + a preview served it. + out_of_date_since (datetime.datetime | Unset): When the latest skipped change was stored. Absent while `status` + is `current`. + """ + + status: FunctionProductionEnvironmentStatus + out_of_date_since: datetime.datetime | Unset = UNSET + + + + + + def to_dict(self) -> dict[str, Any]: + status: str = self.status + + out_of_date_since: str | Unset = UNSET + if not isinstance(self.out_of_date_since, Unset): + out_of_date_since = self.out_of_date_since.isoformat() + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "status": status, + }) + if out_of_date_since is not UNSET: + field_dict["out_of_date_since"] = out_of_date_since + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + status = check_function_production_environment_status(d.pop("status")) + + + + + _out_of_date_since = d.pop("out_of_date_since", UNSET) + out_of_date_since: datetime.datetime | Unset + if isinstance(_out_of_date_since, Unset): + out_of_date_since = UNSET + else: + out_of_date_since = datetime.datetime.fromisoformat(_out_of_date_since) + + + + + function_production_environment = cls( + status=status, + out_of_date_since=out_of_date_since, + ) + + return function_production_environment + diff --git a/src/volcano_sdk/_generated/models/function_production_environment_status.py b/src/volcano_sdk/_generated/models/function_production_environment_status.py new file mode 100644 index 00000000..7280e41c --- /dev/null +++ b/src/volcano_sdk/_generated/models/function_production_environment_status.py @@ -0,0 +1,10 @@ +from typing import Literal + +FunctionProductionEnvironmentStatus = Literal['current', 'out_of_date'] + +FUNCTION_PRODUCTION_ENVIRONMENT_STATUS_VALUES: set[FunctionProductionEnvironmentStatus] = { 'current', 'out_of_date', } + +def check_function_production_environment_status(value: str) -> FunctionProductionEnvironmentStatus: + if value in FUNCTION_PRODUCTION_ENVIRONMENT_STATUS_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {FUNCTION_PRODUCTION_ENVIRONMENT_STATUS_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/function_promotion_request.py b/src/volcano_sdk/_generated/models/function_promotion_request.py new file mode 100644 index 00000000..035f9209 --- /dev/null +++ b/src/volcano_sdk/_generated/models/function_promotion_request.py @@ -0,0 +1,59 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="FunctionPromotionRequest") + + + +@_attrs_define +class FunctionPromotionRequest: + """ + Attributes: + expected_revision (int): The `revision` the caller read from `serving`. Refuses the promotion with + `stale_revision` unless what the function runs is still at this revision. + """ + + expected_revision: int + + + + + + def to_dict(self) -> dict[str, Any]: + expected_revision = self.expected_revision + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "expected_revision": expected_revision, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + expected_revision = d.pop("expected_revision") + + function_promotion_request = cls( + expected_revision=expected_revision, + ) + + return function_promotion_request + diff --git a/src/volcano_sdk/_generated/models/function_rollback_request.py b/src/volcano_sdk/_generated/models/function_rollback_request.py new file mode 100644 index 00000000..ef829c5a --- /dev/null +++ b/src/volcano_sdk/_generated/models/function_rollback_request.py @@ -0,0 +1,70 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset + + + + + + +T = TypeVar("T", bound="FunctionRollbackRequest") + + + +@_attrs_define +class FunctionRollbackRequest: + """ + Attributes: + expected_revision (int): The `revision` the caller read from `serving`. Refuses the rollback with + `stale_revision` unless what the function runs is still at this revision, so a retried rollback cannot undo + itself. + to_production (bool | Unset): Return to the function's own build whatever it ran before. Default: False. + """ + + expected_revision: int + to_production: bool | Unset = False + + + + + + def to_dict(self) -> dict[str, Any]: + expected_revision = self.expected_revision + + to_production = self.to_production + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "expected_revision": expected_revision, + }) + if to_production is not UNSET: + field_dict["to_production"] = to_production + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + expected_revision = d.pop("expected_revision") + + to_production = d.pop("to_production", UNSET) + + function_rollback_request = cls( + expected_revision=expected_revision, + to_production=to_production, + ) + + return function_rollback_request + diff --git a/src/volcano_sdk/_generated/models/function_scheduler.py b/src/volcano_sdk/_generated/models/function_scheduler.py index 54036e1c..ad459fe8 100644 --- a/src/volcano_sdk/_generated/models/function_scheduler.py +++ b/src/volcano_sdk/_generated/models/function_scheduler.py @@ -10,6 +10,10 @@ from ..models.function_kind import check_function_kind from ..models.function_kind import FunctionKind +from ..models.function_scheduler_health import check_function_scheduler_health +from ..models.function_scheduler_health import FunctionSchedulerHealth +from ..models.function_scheduler_last_run_status import check_function_scheduler_last_run_status +from ..models.function_scheduler_last_run_status import FunctionSchedulerLastRunStatus from ..models.function_scheduler_schedule_kind import check_function_scheduler_schedule_kind from ..models.function_scheduler_schedule_kind import FunctionSchedulerScheduleKind from ..types import UNSET, Unset @@ -53,6 +57,16 @@ class FunctionScheduler: last_error (str | Unset): run_count (int | Unset): Total number of times this scheduler has executed. 0 for a scheduler that has never run. + health (FunctionSchedulerHealth | Unset): `failing` while `consecutive_failures` is above 0; `healthy` + otherwise, including before its first run in the region the scheduler runs in now. A run from a region it moved + away from does not count. For a durable function a run finishes when its execution does, so a run that starts + but then fails counts as failed. + consecutive_failures (int | Unset): How many runs in a row have failed in the region the scheduler runs in now. + Resets to 0 when a run succeeds, and starts at 0 in a region it moves to. + last_run_status (FunctionSchedulerLastRunStatus | Unset): Outcome of the most recent finished run. Absent before + the first. + last_success_at (datetime.datetime | Unset): When the most recent successful run finished. + last_failure_at (datetime.datetime | Unset): When the most recent failed run finished. created_at (datetime.datetime | Unset): updated_at (datetime.datetime | Unset): """ @@ -73,6 +87,11 @@ class FunctionScheduler: last_completed_at: datetime.datetime | Unset = UNSET last_error: str | Unset = UNSET run_count: int | Unset = UNSET + health: FunctionSchedulerHealth | Unset = UNSET + consecutive_failures: int | Unset = UNSET + last_run_status: FunctionSchedulerLastRunStatus | Unset = UNSET + last_success_at: datetime.datetime | Unset = UNSET + last_failure_at: datetime.datetime | Unset = UNSET created_at: datetime.datetime | Unset = UNSET updated_at: datetime.datetime | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -139,6 +158,26 @@ def to_dict(self) -> dict[str, Any]: run_count = self.run_count + health: str | Unset = UNSET + if not isinstance(self.health, Unset): + health = self.health + + + consecutive_failures = self.consecutive_failures + + last_run_status: str | Unset = UNSET + if not isinstance(self.last_run_status, Unset): + last_run_status = self.last_run_status + + + last_success_at: str | Unset = UNSET + if not isinstance(self.last_success_at, Unset): + last_success_at = self.last_success_at.isoformat() + + last_failure_at: str | Unset = UNSET + if not isinstance(self.last_failure_at, Unset): + last_failure_at = self.last_failure_at.isoformat() + created_at: str | Unset = UNSET if not isinstance(self.created_at, Unset): created_at = self.created_at.isoformat() @@ -184,6 +223,16 @@ def to_dict(self) -> dict[str, Any]: field_dict["last_error"] = last_error if run_count is not UNSET: field_dict["run_count"] = run_count + if health is not UNSET: + field_dict["health"] = health + if consecutive_failures is not UNSET: + field_dict["consecutive_failures"] = consecutive_failures + if last_run_status is not UNSET: + field_dict["last_run_status"] = last_run_status + if last_success_at is not UNSET: + field_dict["last_success_at"] = last_success_at + if last_failure_at is not UNSET: + field_dict["last_failure_at"] = last_failure_at if created_at is not UNSET: field_dict["created_at"] = created_at if updated_at is not UNSET: @@ -302,6 +351,48 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: run_count = d.pop("run_count", UNSET) + _health = d.pop("health", UNSET) + health: FunctionSchedulerHealth | Unset + if isinstance(_health, Unset): + health = UNSET + else: + health = check_function_scheduler_health(_health) + + + + + consecutive_failures = d.pop("consecutive_failures", UNSET) + + _last_run_status = d.pop("last_run_status", UNSET) + last_run_status: FunctionSchedulerLastRunStatus | Unset + if isinstance(_last_run_status, Unset): + last_run_status = UNSET + else: + last_run_status = check_function_scheduler_last_run_status(_last_run_status) + + + + + _last_success_at = d.pop("last_success_at", UNSET) + last_success_at: datetime.datetime | Unset + if isinstance(_last_success_at, Unset): + last_success_at = UNSET + else: + last_success_at = datetime.datetime.fromisoformat(_last_success_at) + + + + + _last_failure_at = d.pop("last_failure_at", UNSET) + last_failure_at: datetime.datetime | Unset + if isinstance(_last_failure_at, Unset): + last_failure_at = UNSET + else: + last_failure_at = datetime.datetime.fromisoformat(_last_failure_at) + + + + _created_at = d.pop("created_at", UNSET) created_at: datetime.datetime | Unset if isinstance(_created_at, Unset): @@ -339,6 +430,11 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: last_completed_at=last_completed_at, last_error=last_error, run_count=run_count, + health=health, + consecutive_failures=consecutive_failures, + last_run_status=last_run_status, + last_success_at=last_success_at, + last_failure_at=last_failure_at, created_at=created_at, updated_at=updated_at, ) diff --git a/src/volcano_sdk/_generated/models/function_scheduler_health.py b/src/volcano_sdk/_generated/models/function_scheduler_health.py new file mode 100644 index 00000000..4b66932a --- /dev/null +++ b/src/volcano_sdk/_generated/models/function_scheduler_health.py @@ -0,0 +1,10 @@ +from typing import Literal + +FunctionSchedulerHealth = Literal['failing', 'healthy'] + +FUNCTION_SCHEDULER_HEALTH_VALUES: set[FunctionSchedulerHealth] = { 'failing', 'healthy', } + +def check_function_scheduler_health(value: str) -> FunctionSchedulerHealth: + if value in FUNCTION_SCHEDULER_HEALTH_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {FUNCTION_SCHEDULER_HEALTH_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/function_scheduler_last_run_status.py b/src/volcano_sdk/_generated/models/function_scheduler_last_run_status.py new file mode 100644 index 00000000..6f62a935 --- /dev/null +++ b/src/volcano_sdk/_generated/models/function_scheduler_last_run_status.py @@ -0,0 +1,10 @@ +from typing import Literal + +FunctionSchedulerLastRunStatus = Literal['failed', 'succeeded'] + +FUNCTION_SCHEDULER_LAST_RUN_STATUS_VALUES: set[FunctionSchedulerLastRunStatus] = { 'failed', 'succeeded', } + +def check_function_scheduler_last_run_status(value: str) -> FunctionSchedulerLastRunStatus: + if value in FUNCTION_SCHEDULER_LAST_RUN_STATUS_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {FUNCTION_SCHEDULER_LAST_RUN_STATUS_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/function_serving.py b/src/volcano_sdk/_generated/models/function_serving.py new file mode 100644 index 00000000..068a227b --- /dev/null +++ b/src/volcano_sdk/_generated/models/function_serving.py @@ -0,0 +1,171 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset +from typing import cast +from uuid import UUID + +if TYPE_CHECKING: + from ..models.function_production_environment import FunctionProductionEnvironment + from ..models.function_serving_activation import FunctionServingActivation + + + + + +T = TypeVar("T", bound="FunctionServing") + + + +@_attrs_define +class FunctionServing: + """ What a function runs. Until a preview is promoted it runs its own build and `candidate_id` is + null. After a promotion, the function's traffic runs on that preview's runtime, nothing is rebuilt + or deployed, and `previous_candidate_id` is what a rollback returns to (null when that is the + function's own build). A preview the function runs cannot be deleted and does not expire. One kept + only as what a rollback returns to does not expire either, but it can be deleted, which gives up + that rollback; the function's own build stays one `to_production` rollback away. + + Attributes: + revision (int): Counts changes to what the function runs or can roll back to — promotions, rollbacks, a + deployment that returns the traffic to the function's own build, and deleting the preview kept for a rollback. A + promotion or rollback names the revision it read, so one that read before such a change fails with `409` + (`stale_revision`) instead of overwriting it; read the serving state again and retry. + candidate_id (None | UUID): The preview whose build the function runs; null for its own. + previous_candidate_id (None | UUID): The preview a rollback returns to; null for the function's own build. + production_environment (FunctionProductionEnvironment): Whether the function's own build has the project's + current variables. While a preview serves the + function, `volcano config deploy` and replacing the shared variable list skip the function, so its + own build keeps the values it had. A rollback to the function's own build starts synchronizing them + as it returns the traffic, and the status reads `current` once that synchronization completes or a + deployment of the function activates. A synchronization that fails leaves it `out_of_date`. + activation (FunctionServingActivation | Unset): The latest change to what serves the function's traffic: a + promotion, a rollback, or a deployment + of the function that returned its traffic to its own build. Each takes effect at once. Absent until + the function's first promotion. + """ + + revision: int + candidate_id: None | UUID + previous_candidate_id: None | UUID + production_environment: FunctionProductionEnvironment + activation: FunctionServingActivation | Unset = UNSET + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.function_production_environment import FunctionProductionEnvironment # noqa: PLC0415 + from ..models.function_serving_activation import FunctionServingActivation # noqa: PLC0415 + revision = self.revision + + candidate_id: None | str + if isinstance(self.candidate_id, UUID): + candidate_id = str(self.candidate_id) + else: + candidate_id = self.candidate_id + + previous_candidate_id: None | str + if isinstance(self.previous_candidate_id, UUID): + previous_candidate_id = str(self.previous_candidate_id) + else: + previous_candidate_id = self.previous_candidate_id + + production_environment = self.production_environment.to_dict() + + activation: dict[str, Any] | Unset = UNSET + if not isinstance(self.activation, Unset): + activation = self.activation.to_dict() + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "revision": revision, + "candidate_id": candidate_id, + "previous_candidate_id": previous_candidate_id, + "production_environment": production_environment, + }) + if activation is not UNSET: + field_dict["activation"] = activation + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.function_production_environment import FunctionProductionEnvironment # noqa: PLC0415 + from ..models.function_serving_activation import FunctionServingActivation # noqa: PLC0415 + d = dict(src_dict) + revision = d.pop("revision") + + def _parse_candidate_id(data: object) -> None | UUID: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + candidate_id_type_0 = UUID(data) + + + + return candidate_id_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | UUID, data) + + candidate_id = _parse_candidate_id(d.pop("candidate_id")) + + + def _parse_previous_candidate_id(data: object) -> None | UUID: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + previous_candidate_id_type_0 = UUID(data) + + + + return previous_candidate_id_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | UUID, data) + + previous_candidate_id = _parse_previous_candidate_id(d.pop("previous_candidate_id")) + + + production_environment = FunctionProductionEnvironment.from_dict(d.pop("production_environment")) + + + + + _activation = d.pop("activation", UNSET) + activation: FunctionServingActivation | Unset + if isinstance(_activation, Unset): + activation = UNSET + else: + activation = FunctionServingActivation.from_dict(_activation) + + + + + function_serving = cls( + revision=revision, + candidate_id=candidate_id, + previous_candidate_id=previous_candidate_id, + production_environment=production_environment, + activation=activation, + ) + + return function_serving + diff --git a/src/volcano_sdk/_generated/models/function_serving_activation.py b/src/volcano_sdk/_generated/models/function_serving_activation.py new file mode 100644 index 00000000..572639d3 --- /dev/null +++ b/src/volcano_sdk/_generated/models/function_serving_activation.py @@ -0,0 +1,153 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.function_serving_activation_kind import check_function_serving_activation_kind +from ..models.function_serving_activation_kind import FunctionServingActivationKind +from ..models.function_serving_activation_status import check_function_serving_activation_status +from ..models.function_serving_activation_status import FunctionServingActivationStatus +from ..types import UNSET, Unset +from typing import cast +from uuid import UUID + +if TYPE_CHECKING: + from ..models.function_image_digest import FunctionImageDigest + + + + + +T = TypeVar("T", bound="FunctionServingActivation") + + + +@_attrs_define +class FunctionServingActivation: + """ The latest change to what serves the function's traffic: a promotion, a rollback, or a deployment + of the function that returned its traffic to its own build. Each takes effect at once. Absent until + the function's first promotion. + + Attributes: + id (UUID): + kind (FunctionServingActivationKind): `deploy`: a successful deployment of the function cleared the preview + pointers. + status (FunctionServingActivationStatus): `applied`: the change takes effect when it is recorded. + revision (int): + candidate_id (UUID | Unset): The preview the activation pointed the function at. Absent for the function's own + build. + image_digests (list[FunctionImageDigest] | Unset): The digests of the image the activation pointed the function + at. Absent for the function's own build. + """ + + id: UUID + kind: FunctionServingActivationKind + status: FunctionServingActivationStatus + revision: int + candidate_id: UUID | Unset = UNSET + image_digests: list[FunctionImageDigest] | Unset = UNSET + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.function_image_digest import FunctionImageDigest # noqa: PLC0415 + id = str(self.id) + + kind: str = self.kind + + status: str = self.status + + revision = self.revision + + candidate_id: str | Unset = UNSET + if not isinstance(self.candidate_id, Unset): + candidate_id = str(self.candidate_id) + + image_digests: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.image_digests, Unset): + image_digests = [] + for image_digests_item_data in self.image_digests: + image_digests_item = image_digests_item_data.to_dict() + image_digests.append(image_digests_item) + + + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "id": id, + "kind": kind, + "status": status, + "revision": revision, + }) + if candidate_id is not UNSET: + field_dict["candidate_id"] = candidate_id + if image_digests is not UNSET: + field_dict["image_digests"] = image_digests + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.function_image_digest import FunctionImageDigest # noqa: PLC0415 + d = dict(src_dict) + id = UUID(d.pop("id")) + + + + + kind = check_function_serving_activation_kind(d.pop("kind")) + + + + + status = check_function_serving_activation_status(d.pop("status")) + + + + + revision = d.pop("revision") + + _candidate_id = d.pop("candidate_id", UNSET) + candidate_id: UUID | Unset + if isinstance(_candidate_id, Unset): + candidate_id = UNSET + else: + candidate_id = UUID(_candidate_id) + + + + + _image_digests = d.pop("image_digests", UNSET) + image_digests: list[FunctionImageDigest] | Unset = UNSET + if _image_digests is not UNSET: + image_digests = [] + for image_digests_item_data in _image_digests: + image_digests_item = FunctionImageDigest.from_dict(image_digests_item_data) + + + + image_digests.append(image_digests_item) + + + function_serving_activation = cls( + id=id, + kind=kind, + status=status, + revision=revision, + candidate_id=candidate_id, + image_digests=image_digests, + ) + + return function_serving_activation + diff --git a/src/volcano_sdk/_generated/models/function_serving_activation_kind.py b/src/volcano_sdk/_generated/models/function_serving_activation_kind.py new file mode 100644 index 00000000..a247a187 --- /dev/null +++ b/src/volcano_sdk/_generated/models/function_serving_activation_kind.py @@ -0,0 +1,10 @@ +from typing import Literal + +FunctionServingActivationKind = Literal['deploy', 'promotion', 'rollback'] + +FUNCTION_SERVING_ACTIVATION_KIND_VALUES: set[FunctionServingActivationKind] = { 'deploy', 'promotion', 'rollback', } + +def check_function_serving_activation_kind(value: str) -> FunctionServingActivationKind: + if value in FUNCTION_SERVING_ACTIVATION_KIND_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {FUNCTION_SERVING_ACTIVATION_KIND_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/function_serving_activation_status.py b/src/volcano_sdk/_generated/models/function_serving_activation_status.py new file mode 100644 index 00000000..db121a3f --- /dev/null +++ b/src/volcano_sdk/_generated/models/function_serving_activation_status.py @@ -0,0 +1,10 @@ +from typing import Literal + +FunctionServingActivationStatus = Literal['applied'] + +FUNCTION_SERVING_ACTIVATION_STATUS_VALUES: set[FunctionServingActivationStatus] = { 'applied', } + +def check_function_serving_activation_status(value: str) -> FunctionServingActivationStatus: + if value in FUNCTION_SERVING_ACTIVATION_STATUS_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {FUNCTION_SERVING_ACTIVATION_STATUS_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/get_default_email_templates_response_200.py b/src/volcano_sdk/_generated/models/get_default_email_templates_response_200.py index 7dfeab71..5d4909ec 100644 --- a/src/volcano_sdk/_generated/models/get_default_email_templates_response_200.py +++ b/src/volcano_sdk/_generated/models/get_default_email_templates_response_200.py @@ -12,7 +12,7 @@ from typing import cast if TYPE_CHECKING: - from ..models.email_template import EmailTemplate + from ..models.default_email_template import DefaultEmailTemplate @@ -26,10 +26,10 @@ class GetDefaultEmailTemplatesResponse200: """ Attributes: - data (list[EmailTemplate] | Unset): + data (list[DefaultEmailTemplate] | Unset): """ - data: list[EmailTemplate] | Unset = UNSET + data: list[DefaultEmailTemplate] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -37,7 +37,7 @@ class GetDefaultEmailTemplatesResponse200: def to_dict(self) -> dict[str, Any]: - from ..models.email_template import EmailTemplate # noqa: PLC0415 + from ..models.default_email_template import DefaultEmailTemplate # noqa: PLC0415 data: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.data, Unset): data = [] @@ -61,14 +61,14 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.email_template import EmailTemplate # noqa: PLC0415 + from ..models.default_email_template import DefaultEmailTemplate # noqa: PLC0415 d = dict(src_dict) _data = d.pop("data", UNSET) - data: list[EmailTemplate] | Unset = UNSET + data: list[DefaultEmailTemplate] | Unset = UNSET if _data is not UNSET: data = [] for data_item_data in _data: - data_item = EmailTemplate.from_dict(data_item_data) + data_item = DefaultEmailTemplate.from_dict(data_item_data) diff --git a/src/volcano_sdk/_generated/models/get_lavaflow_stats_category.py b/src/volcano_sdk/_generated/models/get_lavaflow_stats_category.py new file mode 100644 index 00000000..8d37dec2 --- /dev/null +++ b/src/volcano_sdk/_generated/models/get_lavaflow_stats_category.py @@ -0,0 +1,10 @@ +from typing import Literal + +GetLavaflowStatsCategory = Literal['bug', 'configuration', 'dependency', 'external', 'improvement', 'performance', 'security', 'uncategorized'] + +GET_LAVAFLOW_STATS_CATEGORY_VALUES: set[GetLavaflowStatsCategory] = { 'bug', 'configuration', 'dependency', 'external', 'improvement', 'performance', 'security', 'uncategorized', } + +def check_get_lavaflow_stats_category(value: str) -> GetLavaflowStatsCategory: + if value in GET_LAVAFLOW_STATS_CATEGORY_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {GET_LAVAFLOW_STATS_CATEGORY_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/git_deployment_migration_run.py b/src/volcano_sdk/_generated/models/git_deployment_migration_run.py new file mode 100644 index 00000000..37fcf007 --- /dev/null +++ b/src/volcano_sdk/_generated/models/git_deployment_migration_run.py @@ -0,0 +1,98 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast +from uuid import UUID + +if TYPE_CHECKING: + from ..models.resource_reference import ResourceReference + + + + + +T = TypeVar("T", bound="GitDeploymentMigrationRun") + + + +@_attrs_define +class GitDeploymentMigrationRun: + """ A migration run a deployment run started. Get it at `GET /projects/{id}/databases/{databaseName}/migration- + runs/{runId}` with `database.name` and `id`. + + Attributes: + id (UUID): + database (ResourceReference): Stable reference to a Volcano resource. + """ + + id: UUID + database: ResourceReference + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.resource_reference import ResourceReference # noqa: PLC0415 + id = str(self.id) + + database = self.database.to_dict() + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "id": id, + "database": database, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.resource_reference import ResourceReference # noqa: PLC0415 + d = dict(src_dict) + id = UUID(d.pop("id")) + + + + + database = ResourceReference.from_dict(d.pop("database")) + + + + + git_deployment_migration_run = cls( + id=id, + database=database, + ) + + + git_deployment_migration_run.additional_properties = d + return git_deployment_migration_run + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/git_deployment_run.py b/src/volcano_sdk/_generated/models/git_deployment_run.py new file mode 100644 index 00000000..fe8faf0a --- /dev/null +++ b/src/volcano_sdk/_generated/models/git_deployment_run.py @@ -0,0 +1,235 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.git_deployment_run_status import check_git_deployment_run_status +from ..models.git_deployment_run_status import GitDeploymentRunStatus +from ..types import UNSET, Unset +from typing import cast +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.git_deployment_migration_run import GitDeploymentMigrationRun + from ..models.git_deployment_run_error import GitDeploymentRunError + + + + + +T = TypeVar("T", bound="GitDeploymentRun") + + + +@_attrs_define +class GitDeploymentRun: + """ One commit's deployment through Git auto deploy, from a push to the production branch or a `POST /projects/{id}/git- + deployment-runs`. + + Attributes: + id (UUID): + status (GitDeploymentRunStatus): Where a run is. `pending` and `running` have not ended. `succeeded`: every + deployment the run dispatched succeeded, or the commit only had migrations to apply. `failed`: `error` says why. + `superseded`: a newer push replaced the run before it started. `skipped`: there was nothing to deploy; `error` + says why. + branch (str): The branch the push updated, the project's production branch at the time. + commit_sha (str): The commit the run deploys. + apply_migrations (bool): Whether the run applies the commit's migrations: the project's `apply_migrations` Git + deploy setting when the push arrived. + skip_unchanged (bool): Whether the push asked to leave unchanged functions and frontends on their current + deployments: the project's `skip_unchanged` Git deploy setting when the push arrived, and false for a run + requested with `force: true`. It took effect only where the `git_deploy.skip_unchanged` capability was available + when the run deployed; otherwise the run deployed every function and frontend. False for runs recorded before + the setting existed. + migration_runs (list[GitDeploymentMigrationRun]): The migration runs the run started, one per database, ordered + by database name. Empty when it started none. + created_at (datetime.datetime): When the push was recorded. + error (GitDeploymentRunError | Unset): Why a run failed or was skipped. + started_at (datetime.datetime | Unset): When a worker first picked the run up. + completed_at (datetime.datetime | Unset): When the run ended. + """ + + id: UUID + status: GitDeploymentRunStatus + branch: str + commit_sha: str + apply_migrations: bool + skip_unchanged: bool + migration_runs: list[GitDeploymentMigrationRun] + created_at: datetime.datetime + error: GitDeploymentRunError | Unset = UNSET + started_at: datetime.datetime | Unset = UNSET + completed_at: datetime.datetime | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.git_deployment_migration_run import GitDeploymentMigrationRun # noqa: PLC0415 + from ..models.git_deployment_run_error import GitDeploymentRunError # noqa: PLC0415 + id = str(self.id) + + status: str = self.status + + branch = self.branch + + commit_sha = self.commit_sha + + apply_migrations = self.apply_migrations + + skip_unchanged = self.skip_unchanged + + migration_runs = [] + for migration_runs_item_data in self.migration_runs: + migration_runs_item = migration_runs_item_data.to_dict() + migration_runs.append(migration_runs_item) + + + + created_at = self.created_at.isoformat() + + error: dict[str, Any] | Unset = UNSET + if not isinstance(self.error, Unset): + error = self.error.to_dict() + + started_at: str | Unset = UNSET + if not isinstance(self.started_at, Unset): + started_at = self.started_at.isoformat() + + completed_at: str | Unset = UNSET + if not isinstance(self.completed_at, Unset): + completed_at = self.completed_at.isoformat() + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "id": id, + "status": status, + "branch": branch, + "commit_sha": commit_sha, + "apply_migrations": apply_migrations, + "skip_unchanged": skip_unchanged, + "migration_runs": migration_runs, + "created_at": created_at, + }) + if error is not UNSET: + field_dict["error"] = error + if started_at is not UNSET: + field_dict["started_at"] = started_at + if completed_at is not UNSET: + field_dict["completed_at"] = completed_at + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.git_deployment_migration_run import GitDeploymentMigrationRun # noqa: PLC0415 + from ..models.git_deployment_run_error import GitDeploymentRunError # noqa: PLC0415 + d = dict(src_dict) + id = UUID(d.pop("id")) + + + + + status = check_git_deployment_run_status(d.pop("status")) + + + + + branch = d.pop("branch") + + commit_sha = d.pop("commit_sha") + + apply_migrations = d.pop("apply_migrations") + + skip_unchanged = d.pop("skip_unchanged") + + migration_runs = [] + _migration_runs = d.pop("migration_runs") + for migration_runs_item_data in (_migration_runs): + migration_runs_item = GitDeploymentMigrationRun.from_dict(migration_runs_item_data) + + + + migration_runs.append(migration_runs_item) + + + created_at = datetime.datetime.fromisoformat(d.pop("created_at")) + + + + + _error = d.pop("error", UNSET) + error: GitDeploymentRunError | Unset + if isinstance(_error, Unset): + error = UNSET + else: + error = GitDeploymentRunError.from_dict(_error) + + + + + _started_at = d.pop("started_at", UNSET) + started_at: datetime.datetime | Unset + if isinstance(_started_at, Unset): + started_at = UNSET + else: + started_at = datetime.datetime.fromisoformat(_started_at) + + + + + _completed_at = d.pop("completed_at", UNSET) + completed_at: datetime.datetime | Unset + if isinstance(_completed_at, Unset): + completed_at = UNSET + else: + completed_at = datetime.datetime.fromisoformat(_completed_at) + + + + + git_deployment_run = cls( + id=id, + status=status, + branch=branch, + commit_sha=commit_sha, + apply_migrations=apply_migrations, + skip_unchanged=skip_unchanged, + migration_runs=migration_runs, + created_at=created_at, + error=error, + started_at=started_at, + completed_at=completed_at, + ) + + + git_deployment_run.additional_properties = d + return git_deployment_run + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/git_deployment_run_error.py b/src/volcano_sdk/_generated/models/git_deployment_run_error.py new file mode 100644 index 00000000..5123a1ea --- /dev/null +++ b/src/volcano_sdk/_generated/models/git_deployment_run_error.py @@ -0,0 +1,95 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="GitDeploymentRunError") + + + +@_attrs_define +class GitDeploymentRunError: + """ Why a run failed or was skipped. + + Attributes: + code (str): Stable machine-readable reason. For a failed run: `migration_failed`, `migration_invalid_layout`, + `migration_timeout`, `feature_unavailable`, `source_invalid`, `child_deploy_failed`, `child_deploy_not_started`, + `deploy_refused`, `typescript_not_compiled`, `deploy_failed`, `max_attempts_exhausted`, `owner_not_active`, or + `project_deleting`. `source_invalid`, `deploy_refused`, and `typescript_not_compiled` fail the same way if the + same commit is pushed again; `child_deploy_not_started`, `deploy_failed`, and `max_attempts_exhausted` may + succeed on another push; for `owner_not_active`, reactivating the owner's account restores deployment + eligibility; push again to deploy. `project_deleting` means the project is being deleted. For a skipped run: + `auto_deploy_disabled`, `binding_changed`, `disconnected`, `project_missing`, or `nothing_to_deploy`. Treat a + code you do not know as a failure. + message (str): What happened. For `migration_failed`, `migration_invalid_layout`, `source_invalid`, + `deploy_refused`, `child_deploy_not_started`, and `typescript_not_compiled` it names the database, files, + resource, or setting at fault when Volcano has them. + """ + + code: str + message: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + code = self.code + + message = self.message + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "code": code, + "message": message, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + code = d.pop("code") + + message = d.pop("message") + + git_deployment_run_error = cls( + code=code, + message=message, + ) + + + git_deployment_run_error.additional_properties = d + return git_deployment_run_error + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/git_deployment_run_status.py b/src/volcano_sdk/_generated/models/git_deployment_run_status.py new file mode 100644 index 00000000..3a41b212 --- /dev/null +++ b/src/volcano_sdk/_generated/models/git_deployment_run_status.py @@ -0,0 +1,10 @@ +from typing import Literal + +GitDeploymentRunStatus = Literal['failed', 'pending', 'running', 'skipped', 'succeeded', 'superseded'] + +GIT_DEPLOYMENT_RUN_STATUS_VALUES: set[GitDeploymentRunStatus] = { 'failed', 'pending', 'running', 'skipped', 'succeeded', 'superseded', } + +def check_git_deployment_run_status(value: str) -> GitDeploymentRunStatus: + if value in GIT_DEPLOYMENT_RUN_STATUS_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {GIT_DEPLOYMENT_RUN_STATUS_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/git_repository.py b/src/volcano_sdk/_generated/models/git_repository.py index b0d3878b..be535f6b 100644 --- a/src/volcano_sdk/_generated/models/git_repository.py +++ b/src/volcano_sdk/_generated/models/git_repository.py @@ -22,8 +22,8 @@ class GitRepository: """ Attributes: - id (int): Stable GitHub repository id (repository.id), unchanged by renames. - full_name (str): + id (int): GitHub's repository id. It stays the same through a rename or a transfer. + full_name (str): The repository's owner and name, such as `acme/shop`. default_branch (str): private (bool): is_empty (bool): Whether the repository has no commits and can receive an initial source export. diff --git a/src/volcano_sdk/_generated/models/git_repository_reference.py b/src/volcano_sdk/_generated/models/git_repository_reference.py new file mode 100644 index 00000000..f60bb8c6 --- /dev/null +++ b/src/volcano_sdk/_generated/models/git_repository_reference.py @@ -0,0 +1,85 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="GitRepositoryReference") + + + +@_attrs_define +class GitRepositoryReference: + """ A GitHub repository, by its stable id and its name. + + Attributes: + id (int): GitHub's repository id. It stays the same through a rename or a transfer. + full_name (str): The repository's owner and name, such as `acme/shop`. + """ + + id: int + full_name: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + id = self.id + + full_name = self.full_name + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "id": id, + "full_name": full_name, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + full_name = d.pop("full_name") + + git_repository_reference = cls( + id=id, + full_name=full_name, + ) + + + git_repository_reference.additional_properties = d + return git_repository_reference + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/import_connection.py b/src/volcano_sdk/_generated/models/import_connection.py index 40e43341..9226f432 100644 --- a/src/volcano_sdk/_generated/models/import_connection.py +++ b/src/volcano_sdk/_generated/models/import_connection.py @@ -29,7 +29,10 @@ class ImportConnection: """ Attributes: id (UUID): - provider (ImportProvider): + provider (ImportProvider): Where an import comes from. `vercel` imports a Vercel project through a Vercel + Integration connection. `github` imports a GitHub repository through the caller's own GitHub connection (`GET + /user/git/connections`) and one of its Volcano GitHub App installations; it has no connect flow of its own under + `/user/imports`. account_id (str): account_name (str): configuration_id (str): diff --git a/src/volcano_sdk/_generated/models/import_provider.py b/src/volcano_sdk/_generated/models/import_provider.py index 92fc3553..6fff5951 100644 --- a/src/volcano_sdk/_generated/models/import_provider.py +++ b/src/volcano_sdk/_generated/models/import_provider.py @@ -1,8 +1,8 @@ from typing import Literal -ImportProvider = Literal['vercel'] +ImportProvider = Literal['github', 'vercel'] -IMPORT_PROVIDER_VALUES: set[ImportProvider] = { 'vercel', } +IMPORT_PROVIDER_VALUES: set[ImportProvider] = { 'github', 'vercel', } def check_import_provider(value: str) -> ImportProvider: if value in IMPORT_PROVIDER_VALUES: diff --git a/src/volcano_sdk/_generated/models/import_source.py b/src/volcano_sdk/_generated/models/import_source.py index 959c8c79..4cc44e3b 100644 --- a/src/volcano_sdk/_generated/models/import_source.py +++ b/src/volcano_sdk/_generated/models/import_source.py @@ -8,7 +8,11 @@ from ..types import UNSET, Unset +from ..types import UNSET, Unset +from typing import cast +if TYPE_CHECKING: + from ..models.import_source_repository import ImportSourceRepository @@ -22,16 +26,20 @@ class ImportSource: """ Attributes: - id (str): - name (str): - account_id (str): - framework (str): + id (str): Provider identifier. For `github`, the repository's stable numeric GitHub ID. + name (str): For `github`, the repository's `owner/name`. + account_id (str): For `github`, the login of the account that owns the repository. + framework (str): For `github`, empty in the source list and `nextjs` in a preflight report when the commit holds + a supported frontend. + repository (ImportSourceRepository | Unset): A GitHub repository the caller reaches through one of its Volcano + GitHub App installations. Only `github` sources have one. """ id: str name: str account_id: str framework: str + repository: ImportSourceRepository | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -39,6 +47,7 @@ class ImportSource: def to_dict(self) -> dict[str, Any]: + from ..models.import_source_repository import ImportSourceRepository # noqa: PLC0415 id = self.id name = self.name @@ -47,6 +56,10 @@ def to_dict(self) -> dict[str, Any]: framework = self.framework + repository: dict[str, Any] | Unset = UNSET + if not isinstance(self.repository, Unset): + repository = self.repository.to_dict() + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -56,6 +69,8 @@ def to_dict(self) -> dict[str, Any]: "account_id": account_id, "framework": framework, }) + if repository is not UNSET: + field_dict["repository"] = repository return field_dict @@ -63,6 +78,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.import_source_repository import ImportSourceRepository # noqa: PLC0415 d = dict(src_dict) id = d.pop("id") @@ -72,11 +88,22 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: framework = d.pop("framework") + _repository = d.pop("repository", UNSET) + repository: ImportSourceRepository | Unset + if isinstance(_repository, Unset): + repository = UNSET + else: + repository = ImportSourceRepository.from_dict(_repository) + + + + import_source = cls( id=id, name=name, account_id=account_id, framework=framework, + repository=repository, ) diff --git a/src/volcano_sdk/_generated/models/import_source_repository.py b/src/volcano_sdk/_generated/models/import_source_repository.py new file mode 100644 index 00000000..2e5cc4bf --- /dev/null +++ b/src/volcano_sdk/_generated/models/import_source_repository.py @@ -0,0 +1,118 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="ImportSourceRepository") + + + +@_attrs_define +class ImportSourceRepository: + """ A GitHub repository the caller reaches through one of its Volcano GitHub App installations. Only `github` sources + have one. + + Attributes: + installation_id (int): + account_login (str): + full_name (str): + default_branch (str): The branch an import deploys when the request names none. + private (bool): + empty (bool): True when the repository has no commits. An empty repository cannot be imported. + """ + + installation_id: int + account_login: str + full_name: str + default_branch: str + private: bool + empty: bool + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + installation_id = self.installation_id + + account_login = self.account_login + + full_name = self.full_name + + default_branch = self.default_branch + + private = self.private + + empty = self.empty + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "installation_id": installation_id, + "account_login": account_login, + "full_name": full_name, + "default_branch": default_branch, + "private": private, + "empty": empty, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + installation_id = d.pop("installation_id") + + account_login = d.pop("account_login") + + full_name = d.pop("full_name") + + default_branch = d.pop("default_branch") + + private = d.pop("private") + + empty = d.pop("empty") + + import_source_repository = cls( + installation_id=installation_id, + account_login=account_login, + full_name=full_name, + default_branch=default_branch, + private=private, + empty=empty, + ) + + + import_source_repository.additional_properties = d + return import_source_repository + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/issue.py b/src/volcano_sdk/_generated/models/issue.py index 18eddb2d..10dcf88c 100644 --- a/src/volcano_sdk/_generated/models/issue.py +++ b/src/volcano_sdk/_generated/models/issue.py @@ -8,6 +8,8 @@ from ..types import UNSET, Unset +from ..models.issue_source import check_issue_source +from ..models.issue_source import IssueSource from ..models.issue_status import check_issue_status from ..models.issue_status import IssueStatus from ..types import UNSET, Unset @@ -16,6 +18,7 @@ import datetime if TYPE_CHECKING: + from ..models.issue_finding import IssueFinding from ..models.resource_reference import ResourceReference @@ -28,7 +31,10 @@ @_attrs_define class Issue: - """ Runtime errors from one function or frontend, grouped by error type and stack. + """ Runtime errors from one function or frontend, grouped by error type and stack, one LavaFlow Code Quality finding, + failed builds of one function or frontend with the same first error, a user-reported project problem, or an issue a + person wrote. A report or a written issue has a project resource, zero runtime occurrences, and the time it was made + as its first and last seen times. Attributes: id (UUID): @@ -37,16 +43,38 @@ class Issue: title (str): The error type and message, with values such as IDs, numbers, and URLs replaced by placeholders like `` and ``. status (IssueStatus): `open` until someone resolves or ignores the issue. A resolved issue - seen again reopens. + seen again reopens. A reported problem resolves when its LavaFlow fix + merges. Volcano ignores one whose report it deleted before any fix + merged, so it no longer counts toward the project's open issues. + source (IssueSource): Where the issue came from: `runtime` for errors your code logged, `code_quality` for a + LavaFlow Code Quality finding in code a deploy changed, `build` for deploys of one function or frontend that + failed in its own build step, `report` for a problem reported for the project, such as through Slack, or + `request` for an issue a person wrote with `POST /issues`. A later deploy that builds resolves a `build` issue. + Deploys Volcano failed, such as a timeout or a refused build, never make one. + exception (bool): Whether the issue holds an exception: one your code threw, or one it + logged with `console.error(err)` or Python's `logger.exception()`. + `false` for an error logged any other way, such as a structured log + line, a logger's error line, or a printed traceback, and for every + `code_quality` issue. `true` for every `build` issue: a failed build + stops its deploy as an exception stops a request. Once `true`, it + stays `true`. event_count (int): Errors counted in this issue. A retried delivery can count an error twice. first_seen_at (datetime.datetime): last_seen_at (datetime.datetime): created_at (datetime.datetime): updated_at (datetime.datetime): + initial_run_id (UUID | Unset): The queued run returned when creating an issue with a start key. error_type (str | Unset): The exception class, such as `TypeError`. Omitted when the error has none. - culprit (str | Unset): The innermost frame of your code in the stack, as `function (file)`. Omitted without a - stack. + culprit (str | Unset): The innermost frame of your code in the stack, as `function (file)`. For a frontend's + Next.js build output, the outermost route or page file of the build in the stack, such as + `.next/server/app/checkout/route.js`, or without one, the outermost file of the build. For a minified file of a + function's own bundle, the file alone. Omitted without a stack. + finding (IssueFinding | Unset): The LavaFlow Code Quality finding behind a `code_quality` issue. + description (str | Unset): What the person who wrote a `request` issue asked for, as they wrote it, trimmed. + Omitted for every other source. last_region (str | Unset): The region that served the latest error, such as `us-east-1`. + last_deployment_id (UUID | Unset): For a `build` issue, the latest deployment that failed in its build step. + Omitted for every other issue: runtime errors are not tied to a deployment. sample_event_id (str | Unset): The ID of the latest error's log event, while logs retain it. sample_event_at (datetime.datetime | Unset): When the latest error's log event was written. resolved_at (datetime.datetime | Unset): When the issue was resolved. Present only while it is resolved. @@ -58,14 +86,20 @@ class Issue: resource: ResourceReference title: str status: IssueStatus + source: IssueSource + exception: bool event_count: int first_seen_at: datetime.datetime last_seen_at: datetime.datetime created_at: datetime.datetime updated_at: datetime.datetime + initial_run_id: UUID | Unset = UNSET error_type: str | Unset = UNSET culprit: str | Unset = UNSET + finding: IssueFinding | Unset = UNSET + description: str | Unset = UNSET last_region: str | Unset = UNSET + last_deployment_id: UUID | Unset = UNSET sample_event_id: str | Unset = UNSET sample_event_at: datetime.datetime | Unset = UNSET resolved_at: datetime.datetime | Unset = UNSET @@ -77,6 +111,7 @@ class Issue: def to_dict(self) -> dict[str, Any]: + from ..models.issue_finding import IssueFinding # noqa: PLC0415 from ..models.resource_reference import ResourceReference # noqa: PLC0415 id = str(self.id) @@ -88,6 +123,10 @@ def to_dict(self) -> dict[str, Any]: status: str = self.status + source: str = self.source + + exception = self.exception + event_count = self.event_count first_seen_at = self.first_seen_at.isoformat() @@ -98,12 +137,26 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at.isoformat() + initial_run_id: str | Unset = UNSET + if not isinstance(self.initial_run_id, Unset): + initial_run_id = str(self.initial_run_id) + error_type = self.error_type culprit = self.culprit + finding: dict[str, Any] | Unset = UNSET + if not isinstance(self.finding, Unset): + finding = self.finding.to_dict() + + description = self.description + last_region = self.last_region + last_deployment_id: str | Unset = UNSET + if not isinstance(self.last_deployment_id, Unset): + last_deployment_id = str(self.last_deployment_id) + sample_event_id = self.sample_event_id sample_event_at: str | Unset = UNSET @@ -127,18 +180,28 @@ def to_dict(self) -> dict[str, Any]: "resource": resource, "title": title, "status": status, + "source": source, + "exception": exception, "event_count": event_count, "first_seen_at": first_seen_at, "last_seen_at": last_seen_at, "created_at": created_at, "updated_at": updated_at, }) + if initial_run_id is not UNSET: + field_dict["initial_run_id"] = initial_run_id if error_type is not UNSET: field_dict["error_type"] = error_type if culprit is not UNSET: field_dict["culprit"] = culprit + if finding is not UNSET: + field_dict["finding"] = finding + if description is not UNSET: + field_dict["description"] = description if last_region is not UNSET: field_dict["last_region"] = last_region + if last_deployment_id is not UNSET: + field_dict["last_deployment_id"] = last_deployment_id if sample_event_id is not UNSET: field_dict["sample_event_id"] = sample_event_id if sample_event_at is not UNSET: @@ -154,6 +217,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.issue_finding import IssueFinding # noqa: PLC0415 from ..models.resource_reference import ResourceReference # noqa: PLC0415 d = dict(src_dict) id = UUID(d.pop("id")) @@ -178,6 +242,13 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + source = check_issue_source(d.pop("source")) + + + + + exception = d.pop("exception") + event_count = d.pop("event_count") first_seen_at = datetime.datetime.fromisoformat(d.pop("first_seen_at")) @@ -200,12 +271,44 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + _initial_run_id = d.pop("initial_run_id", UNSET) + initial_run_id: UUID | Unset + if isinstance(_initial_run_id, Unset): + initial_run_id = UNSET + else: + initial_run_id = UUID(_initial_run_id) + + + + error_type = d.pop("error_type", UNSET) culprit = d.pop("culprit", UNSET) + _finding = d.pop("finding", UNSET) + finding: IssueFinding | Unset + if isinstance(_finding, Unset): + finding = UNSET + else: + finding = IssueFinding.from_dict(_finding) + + + + + description = d.pop("description", UNSET) + last_region = d.pop("last_region", UNSET) + _last_deployment_id = d.pop("last_deployment_id", UNSET) + last_deployment_id: UUID | Unset + if isinstance(_last_deployment_id, Unset): + last_deployment_id = UNSET + else: + last_deployment_id = UUID(_last_deployment_id) + + + + sample_event_id = d.pop("sample_event_id", UNSET) _sample_event_at = d.pop("sample_event_at", UNSET) @@ -244,14 +347,20 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: resource=resource, title=title, status=status, + source=source, + exception=exception, event_count=event_count, first_seen_at=first_seen_at, last_seen_at=last_seen_at, created_at=created_at, updated_at=updated_at, + initial_run_id=initial_run_id, error_type=error_type, culprit=culprit, + finding=finding, + description=description, last_region=last_region, + last_deployment_id=last_deployment_id, sample_event_id=sample_event_id, sample_event_at=sample_event_at, resolved_at=resolved_at, diff --git a/src/volcano_sdk/_generated/models/issue_finding.py b/src/volcano_sdk/_generated/models/issue_finding.py new file mode 100644 index 00000000..f2fbc5ea --- /dev/null +++ b/src/volcano_sdk/_generated/models/issue_finding.py @@ -0,0 +1,133 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.issue_finding_severity import check_issue_finding_severity +from ..models.issue_finding_severity import IssueFindingSeverity +from typing import cast + + + + + + +T = TypeVar("T", bound="IssueFinding") + + + +@_attrs_define +class IssueFinding: + """ The LavaFlow Code Quality finding behind a `code_quality` issue. + + Attributes: + rule (str): The rule the finding names, such as `null-dereference`. + severity (IssueFindingSeverity): How much the problem matters, as the finding was confirmed. + commit_sha (str): The deployed commit the scan found the problem in. + path (str): The file, from the repository root. + start_line (int): The first line of the problem in that commit, from 1. + end_line (int): The last line of the problem in that commit. + explanation (str): What fails and on which input, as plain text. When it holds one of the project's secret + values or a secret gitleaks' default rules detect, it reads `Hidden: this field matched a secret.` in place of + all of it. + """ + + rule: str + severity: IssueFindingSeverity + commit_sha: str + path: str + start_line: int + end_line: int + explanation: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + rule = self.rule + + severity: str = self.severity + + commit_sha = self.commit_sha + + path = self.path + + start_line = self.start_line + + end_line = self.end_line + + explanation = self.explanation + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "rule": rule, + "severity": severity, + "commit_sha": commit_sha, + "path": path, + "start_line": start_line, + "end_line": end_line, + "explanation": explanation, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + rule = d.pop("rule") + + severity = check_issue_finding_severity(d.pop("severity")) + + + + + commit_sha = d.pop("commit_sha") + + path = d.pop("path") + + start_line = d.pop("start_line") + + end_line = d.pop("end_line") + + explanation = d.pop("explanation") + + issue_finding = cls( + rule=rule, + severity=severity, + commit_sha=commit_sha, + path=path, + start_line=start_line, + end_line=end_line, + explanation=explanation, + ) + + + issue_finding.additional_properties = d + return issue_finding + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/issue_finding_severity.py b/src/volcano_sdk/_generated/models/issue_finding_severity.py new file mode 100644 index 00000000..91b079c5 --- /dev/null +++ b/src/volcano_sdk/_generated/models/issue_finding_severity.py @@ -0,0 +1,10 @@ +from typing import Literal + +IssueFindingSeverity = Literal['critical', 'major', 'minor', 'nit'] + +ISSUE_FINDING_SEVERITY_VALUES: set[IssueFindingSeverity] = { 'critical', 'major', 'minor', 'nit', } + +def check_issue_finding_severity(value: str) -> IssueFindingSeverity: + if value in ISSUE_FINDING_SEVERITY_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {ISSUE_FINDING_SEVERITY_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/issue_source.py b/src/volcano_sdk/_generated/models/issue_source.py new file mode 100644 index 00000000..56bc8caf --- /dev/null +++ b/src/volcano_sdk/_generated/models/issue_source.py @@ -0,0 +1,10 @@ +from typing import Literal + +IssueSource = Literal['build', 'code_quality', 'report', 'request', 'runtime'] + +ISSUE_SOURCE_VALUES: set[IssueSource] = { 'build', 'code_quality', 'report', 'request', 'runtime', } + +def check_issue_source(value: str) -> IssueSource: + if value in ISSUE_SOURCE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {ISSUE_SOURCE_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/lavaflow_aikido_binding.py b/src/volcano_sdk/_generated/models/lavaflow_aikido_binding.py new file mode 100644 index 00000000..4a25790f --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_aikido_binding.py @@ -0,0 +1,91 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.aikido_severity import AikidoSeverity +from ..models.aikido_severity import check_aikido_severity +from typing import cast + + + + + + +T = TypeVar("T", bound="LavaflowAikidoBinding") + + + +@_attrs_define +class LavaflowAikidoBinding: + """ The Aikido workspace a binding reports issues from. Present when `connector_type` is `aikido`. + + Attributes: + workspace_name (str): + min_severity (AikidoSeverity): An Aikido issue severity, lowest first. + """ + + workspace_name: str + min_severity: AikidoSeverity + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + workspace_name = self.workspace_name + + min_severity: str = self.min_severity + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "workspace_name": workspace_name, + "min_severity": min_severity, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + workspace_name = d.pop("workspace_name") + + min_severity = check_aikido_severity(d.pop("min_severity")) + + + + + lavaflow_aikido_binding = cls( + workspace_name=workspace_name, + min_severity=min_severity, + ) + + + lavaflow_aikido_binding.additional_properties = d + return lavaflow_aikido_binding + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_aikido_binding_target.py b/src/volcano_sdk/_generated/models/lavaflow_aikido_binding_target.py new file mode 100644 index 00000000..3d4480e7 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_aikido_binding_target.py @@ -0,0 +1,75 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.aikido_severity import AikidoSeverity +from ..models.aikido_severity import check_aikido_severity +from ..types import UNSET, Unset +from typing import cast + + + + + + +T = TypeVar("T", bound="LavaflowAikidoBindingTarget") + + + +@_attrs_define +class LavaflowAikidoBindingTarget: + """ What an `aikido` connector reports for the project. Send `aikido`, not `slack`, for an `aikido` connector. + + Attributes: + min_severity (AikidoSeverity | Unset): An Aikido issue severity, lowest first. + """ + + min_severity: AikidoSeverity | Unset = UNSET + + + + + + def to_dict(self) -> dict[str, Any]: + min_severity: str | Unset = UNSET + if not isinstance(self.min_severity, Unset): + min_severity = self.min_severity + + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + }) + if min_severity is not UNSET: + field_dict["min_severity"] = min_severity + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + _min_severity = d.pop("min_severity", UNSET) + min_severity: AikidoSeverity | Unset + if isinstance(_min_severity, Unset): + min_severity = UNSET + else: + min_severity = check_aikido_severity(_min_severity) + + + + + lavaflow_aikido_binding_target = cls( + min_severity=min_severity, + ) + + return lavaflow_aikido_binding_target + diff --git a/src/volcano_sdk/_generated/models/lavaflow_allowed_workflow.py b/src/volcano_sdk/_generated/models/lavaflow_allowed_workflow.py new file mode 100644 index 00000000..a306c59d --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_allowed_workflow.py @@ -0,0 +1,105 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset + + + + + + +T = TypeVar("T", bound="LavaflowAllowedWorkflow") + + + +@_attrs_define +class LavaflowAllowedWorkflow: + """ A workflow job that could run a fix's pull request with the repository's secrets before a person approves it. + + Attributes: + source (str): The branch or commit whose workflows run it. Example: main. + path (str): Example: .github/workflows/preview.yml. + job (str | Unset): The job, absent for a workflow that could not be read. Example: deploy-preview. + trigger (str | Unset): The event that runs it, absent for a workflow that could not be read. Example: + pull_request_target. + """ + + source: str + path: str + job: str | Unset = UNSET + trigger: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + source = self.source + + path = self.path + + job = self.job + + trigger = self.trigger + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "source": source, + "path": path, + }) + if job is not UNSET: + field_dict["job"] = job + if trigger is not UNSET: + field_dict["trigger"] = trigger + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + source = d.pop("source") + + path = d.pop("path") + + job = d.pop("job", UNSET) + + trigger = d.pop("trigger", UNSET) + + lavaflow_allowed_workflow = cls( + source=source, + path=path, + job=job, + trigger=trigger, + ) + + + lavaflow_allowed_workflow.additional_properties = d + return lavaflow_allowed_workflow + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_anomaly.py b/src/volcano_sdk/_generated/models/lavaflow_anomaly.py new file mode 100644 index 00000000..6f46f88c --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_anomaly.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast + + + + + + +T = TypeVar("T", bound="LavaflowAnomaly") + + + +@_attrs_define +class LavaflowAnomaly: + """ + Attributes: + flagged (bool): + reason (None | str): Why the resource is flagged, null when it is not. + """ + + flagged: bool + reason: None | str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + flagged = self.flagged + + reason: None | str + reason = self.reason + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "flagged": flagged, + "reason": reason, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + flagged = d.pop("flagged") + + def _parse_reason(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + reason = _parse_reason(d.pop("reason")) + + + lavaflow_anomaly = cls( + flagged=flagged, + reason=reason, + ) + + + lavaflow_anomaly.additional_properties = d + return lavaflow_anomaly + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_autonomy.py b/src/volcano_sdk/_generated/models/lavaflow_autonomy.py new file mode 100644 index 00000000..b3573aa3 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_autonomy.py @@ -0,0 +1,10 @@ +from typing import Literal + +LavaflowAutonomy = Literal['diagnose_only', 'merge', 'open_pr'] + +LAVAFLOW_AUTONOMY_VALUES: set[LavaflowAutonomy] = { 'diagnose_only', 'merge', 'open_pr', } + +def check_lavaflow_autonomy(value: str) -> LavaflowAutonomy: + if value in LAVAFLOW_AUTONOMY_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {LAVAFLOW_AUTONOMY_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/lavaflow_category_counts.py b/src/volcano_sdk/_generated/models/lavaflow_category_counts.py new file mode 100644 index 00000000..642d9ba1 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_category_counts.py @@ -0,0 +1,133 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="LavaflowCategoryCounts") + + + +@_attrs_define +class LavaflowCategoryCounts: + """ Matching runs in each category, zeros included. `uncategorized` counts runs whose `category` is null. + + Attributes: + bug (int): + performance (int): + security (int): + improvement (int): + configuration (int): + dependency (int): + external (int): + uncategorized (int): + """ + + bug: int + performance: int + security: int + improvement: int + configuration: int + dependency: int + external: int + uncategorized: int + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + bug = self.bug + + performance = self.performance + + security = self.security + + improvement = self.improvement + + configuration = self.configuration + + dependency = self.dependency + + external = self.external + + uncategorized = self.uncategorized + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "bug": bug, + "performance": performance, + "security": security, + "improvement": improvement, + "configuration": configuration, + "dependency": dependency, + "external": external, + "uncategorized": uncategorized, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + bug = d.pop("bug") + + performance = d.pop("performance") + + security = d.pop("security") + + improvement = d.pop("improvement") + + configuration = d.pop("configuration") + + dependency = d.pop("dependency") + + external = d.pop("external") + + uncategorized = d.pop("uncategorized") + + lavaflow_category_counts = cls( + bug=bug, + performance=performance, + security=security, + improvement=improvement, + configuration=configuration, + dependency=dependency, + external=external, + uncategorized=uncategorized, + ) + + + lavaflow_category_counts.additional_properties = d + return lavaflow_category_counts + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_code_quality_settings.py b/src/volcano_sdk/_generated/models/lavaflow_code_quality_settings.py new file mode 100644 index 00000000..6f5f4d19 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_code_quality_settings.py @@ -0,0 +1,79 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="LavaflowCodeQualitySettings") + + + +@_attrs_define +class LavaflowCodeQualitySettings: + """ LavaFlow Code Quality: whether LavaFlow reviews the code each production deploy changes and opens pull requests that + fix what it confirms. + + Attributes: + enabled (bool): Whether Code Quality reviews the project's deploys. Off by default. It reads as off while the + project points at another repository than the one it was turned on for, and works only while LavaFlow is on. + """ + + enabled: bool + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + enabled = self.enabled + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "enabled": enabled, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + enabled = d.pop("enabled") + + lavaflow_code_quality_settings = cls( + enabled=enabled, + ) + + + lavaflow_code_quality_settings.additional_properties = d + return lavaflow_code_quality_settings + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_code_quality_update.py b/src/volcano_sdk/_generated/models/lavaflow_code_quality_update.py new file mode 100644 index 00000000..25c6277f --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_code_quality_update.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="LavaflowCodeQualityUpdate") + + + +@_attrs_define +class LavaflowCodeQualityUpdate: + """ Turns Code Quality on or off. Only the project's owner, signed in, can turn it on; any credential that can save the + settings can turn it off. + + Attributes: + enabled (bool): + """ + + enabled: bool + + + + + + def to_dict(self) -> dict[str, Any]: + enabled = self.enabled + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "enabled": enabled, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + enabled = d.pop("enabled") + + lavaflow_code_quality_update = cls( + enabled=enabled, + ) + + return lavaflow_code_quality_update + diff --git a/src/volcano_sdk/_generated/models/lavaflow_commit_origin.py b/src/volcano_sdk/_generated/models/lavaflow_commit_origin.py new file mode 100644 index 00000000..87ee4947 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_commit_origin.py @@ -0,0 +1,10 @@ +from typing import Literal + +LavaflowCommitOrigin = Literal['client_reported', 'client_reported_repository', 'push', 'repository'] + +LAVAFLOW_COMMIT_ORIGIN_VALUES: set[LavaflowCommitOrigin] = { 'client_reported', 'client_reported_repository', 'push', 'repository', } + +def check_lavaflow_commit_origin(value: str) -> LavaflowCommitOrigin: + if value in LAVAFLOW_COMMIT_ORIGIN_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {LAVAFLOW_COMMIT_ORIGIN_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/lavaflow_connector_binding.py b/src/volcano_sdk/_generated/models/lavaflow_connector_binding.py new file mode 100644 index 00000000..5688f764 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_connector_binding.py @@ -0,0 +1,187 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.connector_type import check_connector_type +from ..models.connector_type import ConnectorType +from ..types import UNSET, Unset +from typing import cast +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.lavaflow_aikido_binding import LavaflowAikidoBinding + from ..models.lavaflow_slack_binding import LavaflowSlackBinding + + + + + +T = TypeVar("T", bound="LavaflowConnectorBinding") + + + +@_attrs_define +class LavaflowConnectorBinding: + """ A place in a connector that reports problems to LavaFlow for a project: a Slack channel, or an Aikido workspace's + issues on the project's repository. + + Attributes: + id (UUID): The binding's ID, which removing it takes. + project_id (UUID): + connector_type (ConnectorType): The outside service a connector links to. + created_at (datetime.datetime): + connector_id (UUID | Unset): The connector the binding reports through. Omitted while the Volcano app is not + installed in the binding's Slack workspace; the binding reports again once it is. + slack (LavaflowSlackBinding | Unset): The Slack channel a binding reports from. Present when `connector_type` is + `slack`. + aikido (LavaflowAikidoBinding | Unset): The Aikido workspace a binding reports issues from. Present when + `connector_type` is `aikido`. + """ + + id: UUID + project_id: UUID + connector_type: ConnectorType + created_at: datetime.datetime + connector_id: UUID | Unset = UNSET + slack: LavaflowSlackBinding | Unset = UNSET + aikido: LavaflowAikidoBinding | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.lavaflow_aikido_binding import LavaflowAikidoBinding # noqa: PLC0415 + from ..models.lavaflow_slack_binding import LavaflowSlackBinding # noqa: PLC0415 + id = str(self.id) + + project_id = str(self.project_id) + + connector_type: str = self.connector_type + + created_at = self.created_at.isoformat() + + connector_id: str | Unset = UNSET + if not isinstance(self.connector_id, Unset): + connector_id = str(self.connector_id) + + slack: dict[str, Any] | Unset = UNSET + if not isinstance(self.slack, Unset): + slack = self.slack.to_dict() + + aikido: dict[str, Any] | Unset = UNSET + if not isinstance(self.aikido, Unset): + aikido = self.aikido.to_dict() + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "id": id, + "project_id": project_id, + "connector_type": connector_type, + "created_at": created_at, + }) + if connector_id is not UNSET: + field_dict["connector_id"] = connector_id + if slack is not UNSET: + field_dict["slack"] = slack + if aikido is not UNSET: + field_dict["aikido"] = aikido + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.lavaflow_aikido_binding import LavaflowAikidoBinding # noqa: PLC0415 + from ..models.lavaflow_slack_binding import LavaflowSlackBinding # noqa: PLC0415 + d = dict(src_dict) + id = UUID(d.pop("id")) + + + + + project_id = UUID(d.pop("project_id")) + + + + + connector_type = check_connector_type(d.pop("connector_type")) + + + + + created_at = datetime.datetime.fromisoformat(d.pop("created_at")) + + + + + _connector_id = d.pop("connector_id", UNSET) + connector_id: UUID | Unset + if isinstance(_connector_id, Unset): + connector_id = UNSET + else: + connector_id = UUID(_connector_id) + + + + + _slack = d.pop("slack", UNSET) + slack: LavaflowSlackBinding | Unset + if isinstance(_slack, Unset): + slack = UNSET + else: + slack = LavaflowSlackBinding.from_dict(_slack) + + + + + _aikido = d.pop("aikido", UNSET) + aikido: LavaflowAikidoBinding | Unset + if isinstance(_aikido, Unset): + aikido = UNSET + else: + aikido = LavaflowAikidoBinding.from_dict(_aikido) + + + + + lavaflow_connector_binding = cls( + id=id, + project_id=project_id, + connector_type=connector_type, + created_at=created_at, + connector_id=connector_id, + slack=slack, + aikido=aikido, + ) + + + lavaflow_connector_binding.additional_properties = d + return lavaflow_connector_binding + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_connector_bindings_response.py b/src/volcano_sdk/_generated/models/lavaflow_connector_bindings_response.py new file mode 100644 index 00000000..251481ba --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_connector_bindings_response.py @@ -0,0 +1,94 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast + +if TYPE_CHECKING: + from ..models.lavaflow_connector_binding import LavaflowConnectorBinding + + + + + +T = TypeVar("T", bound="LavaflowConnectorBindingsResponse") + + + +@_attrs_define +class LavaflowConnectorBindingsResponse: + """ + Attributes: + bindings (list[LavaflowConnectorBinding]): + """ + + bindings: list[LavaflowConnectorBinding] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.lavaflow_connector_binding import LavaflowConnectorBinding # noqa: PLC0415 + bindings = [] + for bindings_item_data in self.bindings: + bindings_item = bindings_item_data.to_dict() + bindings.append(bindings_item) + + + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "bindings": bindings, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.lavaflow_connector_binding import LavaflowConnectorBinding # noqa: PLC0415 + d = dict(src_dict) + bindings = [] + _bindings = d.pop("bindings") + for bindings_item_data in (_bindings): + bindings_item = LavaflowConnectorBinding.from_dict(bindings_item_data) + + + + bindings.append(bindings_item) + + + lavaflow_connector_bindings_response = cls( + bindings=bindings, + ) + + + lavaflow_connector_bindings_response.additional_properties = d + return lavaflow_connector_bindings_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_day_counts.py b/src/volcano_sdk/_generated/models/lavaflow_day_counts.py new file mode 100644 index 00000000..8c1ec676 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_day_counts.py @@ -0,0 +1,97 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast +import datetime + + + + + + +T = TypeVar("T", bound="LavaflowDayCounts") + + + +@_attrs_define +class LavaflowDayCounts: + """ + Attributes: + date (datetime.date): + issues_opened (int): Issues LavaFlow took on that UTC day. + pull_requests_opened (int): Pull requests with a fix LavaFlow opened that UTC day. + """ + + date: datetime.date + issues_opened: int + pull_requests_opened: int + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + date = self.date.isoformat() + + issues_opened = self.issues_opened + + pull_requests_opened = self.pull_requests_opened + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "date": date, + "issues_opened": issues_opened, + "pull_requests_opened": pull_requests_opened, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + date = datetime.date.fromisoformat(d.pop("date")) + + + + + issues_opened = d.pop("issues_opened") + + pull_requests_opened = d.pop("pull_requests_opened") + + lavaflow_day_counts = cls( + date=date, + issues_opened=issues_opened, + pull_requests_opened=pull_requests_opened, + ) + + + lavaflow_day_counts.additional_properties = d + return lavaflow_day_counts + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_delivery.py b/src/volcano_sdk/_generated/models/lavaflow_delivery.py new file mode 100644 index 00000000..90ff852d --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_delivery.py @@ -0,0 +1,184 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.lavaflow_delivery_state import check_lavaflow_delivery_state +from ..models.lavaflow_delivery_state import LavaflowDeliveryState +from ..types import UNSET, Unset +from typing import cast +import datetime + +if TYPE_CHECKING: + from ..models.lavaflow_delivery_coverage import LavaflowDeliveryCoverage + from ..models.lavaflow_delivery_skip import LavaflowDeliverySkip + + + + + +T = TypeVar("T", bound="LavaflowDelivery") + + + +@_attrs_define +class LavaflowDelivery: + """ Pull request delivery recorded independently of run execution and live recovery. + + Attributes: + state (LavaflowDeliveryState): Where pull request delivery stands. `pending` means LavaFlow is still working. + `pr_created` includes drafts. `covered` means another run owns the verified pull request. + `waiting_for_prerequisite` means delivery can resume on this run. `terminal_miss` means this run ended without + delivery and can include guidance for future work. `stopped` includes runs deliberately limited to diagnosis. + recorded_at (datetime.datetime | None): When the current delivery result was recorded, if known. + prior_skips (list[LavaflowDeliverySkip]): Reasons recorded before the run resumed, in order. + reason (str | Unset): Recorded skip or failure code, `no_recorded_pr` if none was recorded, or + `external_prerequisite` for an open proposal that still needs external action. New codes may appear. + next_action (str | Unset): Action to resume delivery, address an undelivered issue, or complete the setup for a + draft proposal, when known. + coverage (LavaflowDeliveryCoverage | Unset): Another run's verified covering pull request. That run owns the + pull request. + """ + + state: LavaflowDeliveryState + recorded_at: datetime.datetime | None + prior_skips: list[LavaflowDeliverySkip] + reason: str | Unset = UNSET + next_action: str | Unset = UNSET + coverage: LavaflowDeliveryCoverage | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.lavaflow_delivery_coverage import LavaflowDeliveryCoverage # noqa: PLC0415 + from ..models.lavaflow_delivery_skip import LavaflowDeliverySkip # noqa: PLC0415 + state: str = self.state + + recorded_at: None | str + if isinstance(self.recorded_at, datetime.datetime): + recorded_at = self.recorded_at.isoformat() + else: + recorded_at = self.recorded_at + + prior_skips = [] + for prior_skips_item_data in self.prior_skips: + prior_skips_item = prior_skips_item_data.to_dict() + prior_skips.append(prior_skips_item) + + + + reason = self.reason + + next_action = self.next_action + + coverage: dict[str, Any] | Unset = UNSET + if not isinstance(self.coverage, Unset): + coverage = self.coverage.to_dict() + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "state": state, + "recorded_at": recorded_at, + "prior_skips": prior_skips, + }) + if reason is not UNSET: + field_dict["reason"] = reason + if next_action is not UNSET: + field_dict["next_action"] = next_action + if coverage is not UNSET: + field_dict["coverage"] = coverage + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.lavaflow_delivery_coverage import LavaflowDeliveryCoverage # noqa: PLC0415 + from ..models.lavaflow_delivery_skip import LavaflowDeliverySkip # noqa: PLC0415 + d = dict(src_dict) + state = check_lavaflow_delivery_state(d.pop("state")) + + + + + def _parse_recorded_at(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + recorded_at_type_0 = datetime.datetime.fromisoformat(data) + + + + return recorded_at_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + recorded_at = _parse_recorded_at(d.pop("recorded_at")) + + + prior_skips = [] + _prior_skips = d.pop("prior_skips") + for prior_skips_item_data in (_prior_skips): + prior_skips_item = LavaflowDeliverySkip.from_dict(prior_skips_item_data) + + + + prior_skips.append(prior_skips_item) + + + reason = d.pop("reason", UNSET) + + next_action = d.pop("next_action", UNSET) + + _coverage = d.pop("coverage", UNSET) + coverage: LavaflowDeliveryCoverage | Unset + if isinstance(_coverage, Unset): + coverage = UNSET + else: + coverage = LavaflowDeliveryCoverage.from_dict(_coverage) + + + + + lavaflow_delivery = cls( + state=state, + recorded_at=recorded_at, + prior_skips=prior_skips, + reason=reason, + next_action=next_action, + coverage=coverage, + ) + + + lavaflow_delivery.additional_properties = d + return lavaflow_delivery + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_delivery_coverage.py b/src/volcano_sdk/_generated/models/lavaflow_delivery_coverage.py new file mode 100644 index 00000000..aa18adb3 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_delivery_coverage.py @@ -0,0 +1,206 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.lavaflow_delivery_coverage_state import check_lavaflow_delivery_coverage_state +from ..models.lavaflow_delivery_coverage_state import LavaflowDeliveryCoverageState +from ..types import UNSET, Unset +from typing import cast +from uuid import UUID +import datetime + + + + + + +T = TypeVar("T", bound="LavaflowDeliveryCoverage") + + + +@_attrs_define +class LavaflowDeliveryCoverage: + """ Another run's verified covering pull request. That run owns the pull request. + + Attributes: + run_id (UUID): + number (int): + url (str): + state (LavaflowDeliveryCoverageState): + opened_at (datetime.datetime | None): + merged_at (datetime.datetime | None): + deployed_at (datetime.datetime | None): + repository_id (int | Unset): Repository ID recorded for the pull request. Omitted if unknown. + """ + + run_id: UUID + number: int + url: str + state: LavaflowDeliveryCoverageState + opened_at: datetime.datetime | None + merged_at: datetime.datetime | None + deployed_at: datetime.datetime | None + repository_id: int | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + run_id = str(self.run_id) + + number = self.number + + url = self.url + + state: str = self.state + + opened_at: None | str + if isinstance(self.opened_at, datetime.datetime): + opened_at = self.opened_at.isoformat() + else: + opened_at = self.opened_at + + merged_at: None | str + if isinstance(self.merged_at, datetime.datetime): + merged_at = self.merged_at.isoformat() + else: + merged_at = self.merged_at + + deployed_at: None | str + if isinstance(self.deployed_at, datetime.datetime): + deployed_at = self.deployed_at.isoformat() + else: + deployed_at = self.deployed_at + + repository_id = self.repository_id + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "run_id": run_id, + "number": number, + "url": url, + "state": state, + "opened_at": opened_at, + "merged_at": merged_at, + "deployed_at": deployed_at, + }) + if repository_id is not UNSET: + field_dict["repository_id"] = repository_id + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + run_id = UUID(d.pop("run_id")) + + + + + number = d.pop("number") + + url = d.pop("url") + + state = check_lavaflow_delivery_coverage_state(d.pop("state")) + + + + + def _parse_opened_at(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + opened_at_type_0 = datetime.datetime.fromisoformat(data) + + + + return opened_at_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + opened_at = _parse_opened_at(d.pop("opened_at")) + + + def _parse_merged_at(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + merged_at_type_0 = datetime.datetime.fromisoformat(data) + + + + return merged_at_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + merged_at = _parse_merged_at(d.pop("merged_at")) + + + def _parse_deployed_at(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + deployed_at_type_0 = datetime.datetime.fromisoformat(data) + + + + return deployed_at_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + deployed_at = _parse_deployed_at(d.pop("deployed_at")) + + + repository_id = d.pop("repository_id", UNSET) + + lavaflow_delivery_coverage = cls( + run_id=run_id, + number=number, + url=url, + state=state, + opened_at=opened_at, + merged_at=merged_at, + deployed_at=deployed_at, + repository_id=repository_id, + ) + + + lavaflow_delivery_coverage.additional_properties = d + return lavaflow_delivery_coverage + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_delivery_coverage_state.py b/src/volcano_sdk/_generated/models/lavaflow_delivery_coverage_state.py new file mode 100644 index 00000000..8e6d46c7 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_delivery_coverage_state.py @@ -0,0 +1,10 @@ +from typing import Literal + +LavaflowDeliveryCoverageState = Literal['merged', 'open'] + +LAVAFLOW_DELIVERY_COVERAGE_STATE_VALUES: set[LavaflowDeliveryCoverageState] = { 'merged', 'open', } + +def check_lavaflow_delivery_coverage_state(value: str) -> LavaflowDeliveryCoverageState: + if value in LAVAFLOW_DELIVERY_COVERAGE_STATE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {LAVAFLOW_DELIVERY_COVERAGE_STATE_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/lavaflow_delivery_skip.py b/src/volcano_sdk/_generated/models/lavaflow_delivery_skip.py new file mode 100644 index 00000000..c3d4136f --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_delivery_skip.py @@ -0,0 +1,143 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.lavaflow_skip_reason import check_lavaflow_skip_reason +from ..models.lavaflow_skip_reason import LavaflowSkipReason +from typing import cast +import datetime + + + + + + +T = TypeVar("T", bound="LavaflowDeliverySkip") + + + +@_attrs_define +class LavaflowDeliverySkip: + """ + Attributes: + reason (LavaflowSkipReason): Why a finished run opened no pull request, with what you can do next. + `diagnose_only`: the project's `autonomy` was `diagnose_only` when the run was queued, or became it before the + pull request opened, so LavaFlow only diagnosed the issue; read the diagnosis. For later runs to open pull + requests, send `"autonomy": "open_pr"` to `PATCH /lavaflow/settings`, or run `volcano cloud lavaflow settings + set --autonomy open_pr`. `not_fixable`: the diagnosis found no change in the code that fixes the error, for + example because the cause is outside it; read the diagnosis. `low_confidence`: the diagnosis is not confident + enough to propose a fix; read the diagnosis. `no_patch`: LavaFlow proposed no change; read the diagnosis. + `possible_credential`: the fix held what looks like a credential or a project secret, so LavaFlow pushed + nothing; apply the fix yourself from the diagnosis. `possible_personal_data`: the fix adds an email address the + repository lacks, and the repository isn't private, so LavaFlow pushed nothing; apply the fix yourself. + `ungated_workflows`: on the earlier publication path or under automatic merging, a workflow could run the fix + with the repository's secrets before a person approves it; gate the workflow on a label a person adds, or turn + on `allow_ungated_workflows`. `convention_unsatisfiable`: LavaFlow would merge the fix, but no title can meet + the repository's commit convention, so it kept the fix on the run; apply the fix yourself, or relax the + convention. `pull_request_open`: when the run checked, before opening a pull request, another LavaFlow pull + request for the issue was open, or merged and not yet deployed, so this run opened none; a fix it wrote stays on + the run. That pull request may have closed since; find it with `GET /lavaflow/runs?project_id=…&issue_id=…`, + whose runs carry their `pull_request`. Review it, or close it if you don't want it. `source_unavailable`: + LavaFlow couldn't read, or open a fix on, the code that served the error; the run's `source_unavailable` says + why and what to do. `permission_missing`: the Volcano GitHub App, or the project owner's GitHub account, lacks a + permission LavaFlow needs; grant the App's requested permissions and make sure the owner can push to the + repository. `repository_changed`: the project no longer deploys from the repository the run read; a new run uses + the current one. `publish_failed`: opening the pull request failed; a new run tries again. `draft_unavailable`: + GitHub refused a draft required for a proposal with outstanding external work. Check that the base branch exists + and that the repository supports draft pull requests before trying again. `lineage_cap`: LavaFlow opened as many + pull requests in this fix's lineage as it may; review the lineage's pull requests and fix the rest yourself. + `lineage_held`: an earlier pull request in this fix's lineage was held, stopped or closed (one a person merges + holds it only when closed), so LavaFlow opens no more in it; apply the fix yourself from the diagnosis. + `review_unresolved`: LavaFlow's review didn't pass a Code Quality fix; read the diagnosis. + `duplicate_in_repository`: when the run checked, another project on the repository already had the Code Quality + pull request for the same finding; review that pull request in the repository. `security_finding`: the finding + has security impact and the repository isn't private, so the fix would disclose it; fix it yourself. New reasons + may appear. + recorded_at (datetime.datetime | None): + """ + + reason: LavaflowSkipReason + recorded_at: datetime.datetime | None + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + reason: str = self.reason + + recorded_at: None | str + if isinstance(self.recorded_at, datetime.datetime): + recorded_at = self.recorded_at.isoformat() + else: + recorded_at = self.recorded_at + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "reason": reason, + "recorded_at": recorded_at, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + reason = check_lavaflow_skip_reason(d.pop("reason")) + + + + + def _parse_recorded_at(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + recorded_at_type_0 = datetime.datetime.fromisoformat(data) + + + + return recorded_at_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + recorded_at = _parse_recorded_at(d.pop("recorded_at")) + + + lavaflow_delivery_skip = cls( + reason=reason, + recorded_at=recorded_at, + ) + + + lavaflow_delivery_skip.additional_properties = d + return lavaflow_delivery_skip + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_delivery_state.py b/src/volcano_sdk/_generated/models/lavaflow_delivery_state.py new file mode 100644 index 00000000..d39727b2 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_delivery_state.py @@ -0,0 +1,10 @@ +from typing import Literal + +LavaflowDeliveryState = Literal['covered', 'pending', 'pr_created', 'stopped', 'terminal_miss', 'waiting_for_prerequisite'] + +LAVAFLOW_DELIVERY_STATE_VALUES: set[LavaflowDeliveryState] = { 'covered', 'pending', 'pr_created', 'stopped', 'terminal_miss', 'waiting_for_prerequisite', } + +def check_lavaflow_delivery_state(value: str) -> LavaflowDeliveryState: + if value in LAVAFLOW_DELIVERY_STATE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {LAVAFLOW_DELIVERY_STATE_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/lavaflow_delivery_stats.py b/src/volcano_sdk/_generated/models/lavaflow_delivery_stats.py new file mode 100644 index 00000000..3cde809b --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_delivery_stats.py @@ -0,0 +1,176 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast +import datetime + + + + + + +T = TypeVar("T", bound="LavaflowDeliveryStats") + + + +@_attrs_define +class LavaflowDeliveryStats: + """ Delivery for retained runs created in the requested UTC window and category, evaluated at as_of. + + Attributes: + as_of (datetime.datetime): + runs (int): + runs_without_owned_pr (int): All runs in the cohort without a pull request of their own, including active, + stopped, and covered runs. + finished_without_owned_pr (int): Runs without a pull request of their own that were no longer queued or running + at as_of. + issues_with_runs (int): Distinct issues represented by runs in the cohort. + issues_with_pr_coverage (int): Distinct issues with a pull request on the project's current repository. For + owned pull requests and verified duplicate-run links, counts open pull requests, merges with a recorded + deployment, and merges within the past seven days still awaiting deployment. Verified fix-lineage links count + while their pull request is open or merged. + time_to_pr_samples (int): Runs with a recorded opening time at or after run creation. + mean_time_to_pr_seconds (int | None): Mean seconds from run creation to opening its own pull request. Null when + there are no samples. + time_to_coverage_samples (int): Runs with a recorded duplicate-PR observation or lineage attribution time at or + after run creation. + mean_time_to_coverage_seconds (int | None): Mean seconds from run creation to recorded coverage by another pull + request. Null when there are no samples. + """ + + as_of: datetime.datetime + runs: int + runs_without_owned_pr: int + finished_without_owned_pr: int + issues_with_runs: int + issues_with_pr_coverage: int + time_to_pr_samples: int + mean_time_to_pr_seconds: int | None + time_to_coverage_samples: int + mean_time_to_coverage_seconds: int | None + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + as_of = self.as_of.isoformat() + + runs = self.runs + + runs_without_owned_pr = self.runs_without_owned_pr + + finished_without_owned_pr = self.finished_without_owned_pr + + issues_with_runs = self.issues_with_runs + + issues_with_pr_coverage = self.issues_with_pr_coverage + + time_to_pr_samples = self.time_to_pr_samples + + mean_time_to_pr_seconds: int | None + mean_time_to_pr_seconds = self.mean_time_to_pr_seconds + + time_to_coverage_samples = self.time_to_coverage_samples + + mean_time_to_coverage_seconds: int | None + mean_time_to_coverage_seconds = self.mean_time_to_coverage_seconds + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "as_of": as_of, + "runs": runs, + "runs_without_owned_pr": runs_without_owned_pr, + "finished_without_owned_pr": finished_without_owned_pr, + "issues_with_runs": issues_with_runs, + "issues_with_pr_coverage": issues_with_pr_coverage, + "time_to_pr_samples": time_to_pr_samples, + "mean_time_to_pr_seconds": mean_time_to_pr_seconds, + "time_to_coverage_samples": time_to_coverage_samples, + "mean_time_to_coverage_seconds": mean_time_to_coverage_seconds, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + as_of = datetime.datetime.fromisoformat(d.pop("as_of")) + + + + + runs = d.pop("runs") + + runs_without_owned_pr = d.pop("runs_without_owned_pr") + + finished_without_owned_pr = d.pop("finished_without_owned_pr") + + issues_with_runs = d.pop("issues_with_runs") + + issues_with_pr_coverage = d.pop("issues_with_pr_coverage") + + time_to_pr_samples = d.pop("time_to_pr_samples") + + def _parse_mean_time_to_pr_seconds(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + mean_time_to_pr_seconds = _parse_mean_time_to_pr_seconds(d.pop("mean_time_to_pr_seconds")) + + + time_to_coverage_samples = d.pop("time_to_coverage_samples") + + def _parse_mean_time_to_coverage_seconds(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + mean_time_to_coverage_seconds = _parse_mean_time_to_coverage_seconds(d.pop("mean_time_to_coverage_seconds")) + + + lavaflow_delivery_stats = cls( + as_of=as_of, + runs=runs, + runs_without_owned_pr=runs_without_owned_pr, + finished_without_owned_pr=finished_without_owned_pr, + issues_with_runs=issues_with_runs, + issues_with_pr_coverage=issues_with_pr_coverage, + time_to_pr_samples=time_to_pr_samples, + mean_time_to_pr_seconds=mean_time_to_pr_seconds, + time_to_coverage_samples=time_to_coverage_samples, + mean_time_to_coverage_seconds=mean_time_to_coverage_seconds, + ) + + + lavaflow_delivery_stats.additional_properties = d + return lavaflow_delivery_stats + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_diagnosis.py b/src/volcano_sdk/_generated/models/lavaflow_diagnosis.py new file mode 100644 index 00000000..e64e4f3e --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_diagnosis.py @@ -0,0 +1,134 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast + +if TYPE_CHECKING: + from ..models.lavaflow_log_line import LavaflowLogLine + + + + + +T = TypeVar("T", bound="LavaflowDiagnosis") + + + +@_attrs_define +class LavaflowDiagnosis: + """ Each text reads `Hidden: this field matched a secret.` in place of all of it when it holds one of the project's + secret values or a secret gitleaks' default rules detect; the other texts are served as written. A log line's + `level` reads `""` then. + + Attributes: + summary (str): + root_cause (str): + evidence (list[str]): + log_lines (list[LavaflowLogLine]): Empty for now. `evidence` cites the log lines the diagnosis relies on. + requested (bool): Whether the run makes a change its report's reporter asked for in their own words, such as new + content or functionality, rather than fixing a defect. Only a reported problem's run can set it, and only from + what the person who mentioned LavaFlow wrote. + """ + + summary: str + root_cause: str + evidence: list[str] + log_lines: list[LavaflowLogLine] + requested: bool + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.lavaflow_log_line import LavaflowLogLine # noqa: PLC0415 + summary = self.summary + + root_cause = self.root_cause + + evidence = self.evidence + + + + log_lines = [] + for log_lines_item_data in self.log_lines: + log_lines_item = log_lines_item_data.to_dict() + log_lines.append(log_lines_item) + + + + requested = self.requested + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "summary": summary, + "root_cause": root_cause, + "evidence": evidence, + "log_lines": log_lines, + "requested": requested, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.lavaflow_log_line import LavaflowLogLine # noqa: PLC0415 + d = dict(src_dict) + summary = d.pop("summary") + + root_cause = d.pop("root_cause") + + evidence = cast(list[str], d.pop("evidence")) + + + log_lines = [] + _log_lines = d.pop("log_lines") + for log_lines_item_data in (_log_lines): + log_lines_item = LavaflowLogLine.from_dict(log_lines_item_data) + + + + log_lines.append(log_lines_item) + + + requested = d.pop("requested") + + lavaflow_diagnosis = cls( + summary=summary, + root_cause=root_cause, + evidence=evidence, + log_lines=log_lines, + requested=requested, + ) + + + lavaflow_diagnosis.additional_properties = d + return lavaflow_diagnosis + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_draft_reason.py b/src/volcano_sdk/_generated/models/lavaflow_draft_reason.py new file mode 100644 index 00000000..e292990b --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_draft_reason.py @@ -0,0 +1,10 @@ +from typing import Literal + +LavaflowDraftReason = Literal['converted_to_draft', 'open_pr', 'review_unresolved'] + +LAVAFLOW_DRAFT_REASON_VALUES: set[LavaflowDraftReason] = { 'converted_to_draft', 'open_pr', 'review_unresolved', } + +def check_lavaflow_draft_reason(value: str) -> LavaflowDraftReason: + if value in LAVAFLOW_DRAFT_REASON_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {LAVAFLOW_DRAFT_REASON_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/lavaflow_failure.py b/src/volcano_sdk/_generated/models/lavaflow_failure.py new file mode 100644 index 00000000..32121d78 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_failure.py @@ -0,0 +1,87 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="LavaflowFailure") + + + +@_attrs_define +class LavaflowFailure: + """ + Attributes: + code (str): Stable code, such as `timed_out` or `feature_paused`. `lavaflow_allowance_exhausted`: the run was + canceled before it asked a model anything, because the project owner's plan stops at its allowance of LavaFlow + runs and the owner used it this billing cycle. A queued run waits with `free_spend_limit` while LavaFlow's daily + spend limit for the owner's plan is reached. + message (str): Text to show for the code. + """ + + code: str + message: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + code = self.code + + message = self.message + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "code": code, + "message": message, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + code = d.pop("code") + + message = d.pop("message") + + lavaflow_failure = cls( + code=code, + message=message, + ) + + + lavaflow_failure.additional_properties = d + return lavaflow_failure + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_fix_outcome.py b/src/volcano_sdk/_generated/models/lavaflow_fix_outcome.py new file mode 100644 index 00000000..0bd9bd76 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_fix_outcome.py @@ -0,0 +1,150 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.lavaflow_fix_outcome_state import check_lavaflow_fix_outcome_state +from ..models.lavaflow_fix_outcome_state import LavaflowFixOutcomeState +from typing import cast +import datetime + + + + + + +T = TypeVar("T", bound="LavaflowFixOutcome") + + + +@_attrs_define +class LavaflowFixOutcome: + """ How a merged LavaFlow fix fared once it went live. + + Attributes: + state (LavaflowFixOutcomeState): `watching` for 14 days after the fix goes live, then `effective` unless its + issue came back (`ineffective`) or a new issue was traced to its deploy (`regressed`). An outcome never moves + back. `reverted` is reserved and not produced yet. + live_at (datetime.datetime | None): + watch_until (datetime.datetime | None): + follow_ups (int): Runs linked to this fix. + """ + + state: LavaflowFixOutcomeState + live_at: datetime.datetime | None + watch_until: datetime.datetime | None + follow_ups: int + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + state: str = self.state + + live_at: None | str + if isinstance(self.live_at, datetime.datetime): + live_at = self.live_at.isoformat() + else: + live_at = self.live_at + + watch_until: None | str + if isinstance(self.watch_until, datetime.datetime): + watch_until = self.watch_until.isoformat() + else: + watch_until = self.watch_until + + follow_ups = self.follow_ups + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "state": state, + "live_at": live_at, + "watch_until": watch_until, + "follow_ups": follow_ups, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + state = check_lavaflow_fix_outcome_state(d.pop("state")) + + + + + def _parse_live_at(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + live_at_type_0 = datetime.datetime.fromisoformat(data) + + + + return live_at_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + live_at = _parse_live_at(d.pop("live_at")) + + + def _parse_watch_until(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + watch_until_type_0 = datetime.datetime.fromisoformat(data) + + + + return watch_until_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + watch_until = _parse_watch_until(d.pop("watch_until")) + + + follow_ups = d.pop("follow_ups") + + lavaflow_fix_outcome = cls( + state=state, + live_at=live_at, + watch_until=watch_until, + follow_ups=follow_ups, + ) + + + lavaflow_fix_outcome.additional_properties = d + return lavaflow_fix_outcome + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_fix_outcome_state.py b/src/volcano_sdk/_generated/models/lavaflow_fix_outcome_state.py new file mode 100644 index 00000000..ab321fb4 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_fix_outcome_state.py @@ -0,0 +1,10 @@ +from typing import Literal + +LavaflowFixOutcomeState = Literal['awaiting_deploy', 'effective', 'ineffective', 'regressed', 'reverted', 'watching'] + +LAVAFLOW_FIX_OUTCOME_STATE_VALUES: set[LavaflowFixOutcomeState] = { 'awaiting_deploy', 'effective', 'ineffective', 'regressed', 'reverted', 'watching', } + +def check_lavaflow_fix_outcome_state(value: str) -> LavaflowFixOutcomeState: + if value in LAVAFLOW_FIX_OUTCOME_STATE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {LAVAFLOW_FIX_OUTCOME_STATE_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/lavaflow_held_fix_open.py b/src/volcano_sdk/_generated/models/lavaflow_held_fix_open.py new file mode 100644 index 00000000..cfa4d86a --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_held_fix_open.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from uuid import UUID + + + + + + +T = TypeVar("T", bound="LavaflowHeldFixOpen") + + + +@_attrs_define +class LavaflowHeldFixOpen: + """ The project, the run, and the diff and jobs of the held fix you read, by the digests the run served them with. + + Attributes: + project_id (UUID): The project the run belongs to. + run_id (UUID): The run whose held fix to open. + diff_sha256 (str): The run's `diff_sha256`, as it served it. Example: + 9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08. + jobs_sha256 (str): The run's `held_workflows.jobs_sha256`, as it served it. Example: + 2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae. + """ + + project_id: UUID + run_id: UUID + diff_sha256: str + jobs_sha256: str + + + + + + def to_dict(self) -> dict[str, Any]: + project_id = str(self.project_id) + + run_id = str(self.run_id) + + diff_sha256 = self.diff_sha256 + + jobs_sha256 = self.jobs_sha256 + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "project_id": project_id, + "run_id": run_id, + "diff_sha256": diff_sha256, + "jobs_sha256": jobs_sha256, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + project_id = UUID(d.pop("project_id")) + + + + + run_id = UUID(d.pop("run_id")) + + + + + diff_sha256 = d.pop("diff_sha256") + + jobs_sha256 = d.pop("jobs_sha256") + + lavaflow_held_fix_open = cls( + project_id=project_id, + run_id=run_id, + diff_sha256=diff_sha256, + jobs_sha256=jobs_sha256, + ) + + return lavaflow_held_fix_open + diff --git a/src/volcano_sdk/_generated/models/lavaflow_held_workflows.py b/src/volcano_sdk/_generated/models/lavaflow_held_workflows.py new file mode 100644 index 00000000..8bbcdf0e --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_held_workflows.py @@ -0,0 +1,132 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast + +if TYPE_CHECKING: + from ..models.lavaflow_allowed_workflow import LavaflowAllowedWorkflow + from ..models.lavaflow_workflow_source import LavaflowWorkflowSource + + + + + +T = TypeVar("T", bound="LavaflowHeldWorkflows") + + + +@_attrs_define +class LavaflowHeldWorkflows: + """ Every workflow job that could run a held fix's pull request with the repository's secrets before a person approves + it, as LavaFlow found them when it held the fix, and the commits it read the workflows at. + + Attributes: + read_at (list[LavaflowWorkflowSource]): Each branch or commit whose workflows LavaFlow read: the project's + production branch, the repository's default branch, and the commit the fix is cut from. + jobs (list[LavaflowAllowedWorkflow]): Every such job, at most 256, sorted by source, path and job. Empty when + LavaFlow read every workflow to the end and found none, such as when they changed between the hold and the read. + jobs_sha256 (str): Identifies `read_at` and `jobs` together. Treat it as opaque: it changes when a listed job, + or a commit the workflows were read at, does. Example: + 2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae. + """ + + read_at: list[LavaflowWorkflowSource] + jobs: list[LavaflowAllowedWorkflow] + jobs_sha256: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.lavaflow_allowed_workflow import LavaflowAllowedWorkflow # noqa: PLC0415 + from ..models.lavaflow_workflow_source import LavaflowWorkflowSource # noqa: PLC0415 + read_at = [] + for read_at_item_data in self.read_at: + read_at_item = read_at_item_data.to_dict() + read_at.append(read_at_item) + + + + jobs = [] + for jobs_item_data in self.jobs: + jobs_item = jobs_item_data.to_dict() + jobs.append(jobs_item) + + + + jobs_sha256 = self.jobs_sha256 + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "read_at": read_at, + "jobs": jobs, + "jobs_sha256": jobs_sha256, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.lavaflow_allowed_workflow import LavaflowAllowedWorkflow # noqa: PLC0415 + from ..models.lavaflow_workflow_source import LavaflowWorkflowSource # noqa: PLC0415 + d = dict(src_dict) + read_at = [] + _read_at = d.pop("read_at") + for read_at_item_data in (_read_at): + read_at_item = LavaflowWorkflowSource.from_dict(read_at_item_data) + + + + read_at.append(read_at_item) + + + jobs = [] + _jobs = d.pop("jobs") + for jobs_item_data in (_jobs): + jobs_item = LavaflowAllowedWorkflow.from_dict(jobs_item_data) + + + + jobs.append(jobs_item) + + + jobs_sha256 = d.pop("jobs_sha256") + + lavaflow_held_workflows = cls( + read_at=read_at, + jobs=jobs, + jobs_sha256=jobs_sha256, + ) + + + lavaflow_held_workflows.additional_properties = d + return lavaflow_held_workflows + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_hold_reason.py b/src/volcano_sdk/_generated/models/lavaflow_hold_reason.py new file mode 100644 index 00000000..0157a3e4 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_hold_reason.py @@ -0,0 +1,148 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast + + + + + + +T = TypeVar("T", bound="LavaflowHoldReason") + + + +@_attrs_define +class LavaflowHoldReason: + """ One reason LavaFlow holds the fix for a person. + + Attributes: + code (str): Why the fix is held. `client_reported_commit`: the fix's deployed source could not be independently + verified. `report_admission_lost`: LavaFlow could no longer verify the report's base or merge authorization. + `path`: it changes a path in `human_review_paths`, or deploy or infrastructure configuration Volcano always + holds, such as `volcano-config.yaml`, Terraform files, a YAML or JSON file that declares a resource, a YAML + template that mentions `apiVersion` or `kind`, a file in a Helm chart or Kustomize directory, or, in a + repository too large to read in full, any file no other path reason holds. `sensitive_path`: it changes another + path Volcano always holds: authentication or authorization code, Next.js middleware included; secret, key, + certificate or cryptography files; a coding agent's instructions or settings, or Git hook configuration; CI + configuration; a dependency manifest or lockfile, or a `package.json` change to what installs or its install + scripts; or runtime, container or other configuration files. `label`: the pull request has the `needs-human- + review` label. `no_checks`: no CI ran on it. `required_check_skipped`: a required check was skipped. + `no_required_checks`: the base branch requires no check, so passing checks alone don't vouch for the fix. + `changes_requested`: a reviewer requested changes. `repository_requires_approval`: a legacy run was handed off + because the repository required an approving review. That final hold stays final; new merge watches use + `waiting_for_approval` instead. `person_commits`: someone other than LavaFlow pushed to the fix's branch. + `rules_bypass`: the Volcano GitHub App can bypass a ruleset on the base branch. `unchecked_rules`: the base + branch has a rule LavaFlow doesn't check, such as required signatures. On a fix a person merges it names only + rules that kept LavaFlow from starting the fix's CI, such as `code_scanning` or `workflows`, or that LavaFlow + couldn't read them. `commit_convention`: no title can meet the repository's commit convention. + `ungated_workflows`: the fix opened past workflows that can run it with the repository's secrets before a person + approves it, as the project's owner allowed, or LavaFlow couldn't check its workflows, or, when LavaFlow was + about to start its CI or add it to a merge queue, a workflow could run it with those secrets before a person + approves it or couldn't be read, so LavaFlow takes it no further and never merges it. A fix held for another + reason before its CI starts lists it too when that check, run without starting CI, finds such a workflow or + can't finish. `ci_outside_actions`: when LavaFlow was about to start the fix's CI, the repository could run CI, + a build or a preview outside GitHub Actions: the root of the fix's tree or its base branch's holds another + service's configuration, such as `.travis.yml`, `.circleci/` or `netlify.toml`, which `paths` names, another app + reported checks or statuses on the base branch, or LavaFlow couldn't read them in full. LavaFlow starts CI only + when it finds no sign of CI outside GitHub Actions, so it never starts this fix's CI or merges it. + `lineage_undoes_parent`: the fix follows up an earlier LavaFlow fix and deletes or changes lines that fix added, + which could undo it. `lineage_cap`: the fix's lineage opened as many pull requests as it may. `lineage_held`: an + earlier pull request in the fix's lineage was held, stopped or closed; one a person merges holds it only when + closed. `recent_regressions`: fixes LavaFlow merged in the project recently caused new errors. `no_test`: the + fix changes code the repository tests and adds no test, because testing it needs test infrastructure the + repository doesn't have or the change has no effect a test can observe. `choices_to_confirm`: the review did not + clear every stated choice and did not record a more specific review question. The run lists the choices and + private pull requests include them under Choices to confirm. This reason applies when LavaFlow was asked to + merge the fix. `risky_change`: the fix adds or removes a line that converts a value, such as with `float()` or + `parseInt()`, in a file that names a rate limit or quota, authentication or authorization, or money, so values + such as NaN, Infinity or a negative number could get past a check there; `paths` names the files. + `review_notes`: LavaFlow's reviewers passed the fix, but its review's last round left notes, findings below + `major` that a later round no longer sends back for revision, such as a decision the fix makes without stating + it. `person_merges`: a person reviews and merges the fix, because the project's autonomy is `open_pr`, merging + was unavailable when it opened, or its run may only open a pull request; LavaFlow ran the fix's CI once first + unless another reason, or the CI start's own checks, stopped it. Other codes name a concern LavaFlow's reviewers + raised. New codes may appear. + question (str): Why LavaFlow holds the fix and what to check before you merge it, in one or two sentences to + show as given. A reviewer's reason is a question for you to answer. Reads `Hidden: this field matched a secret.` + when it holds one of the project's secret values or a secret gitleaks detects, or when one of its `paths` reads + `""`. Every question reads `Hidden: the fix may add a credential.`, LavaFlow's fixed sentences too, on a run + whose `pull_request_skipped` is `possible_credential`. + paths (list[str]): The changed paths that matched, for a path code. For `ci_outside_actions`, the entries at the + repository's root that another CI or preview service reads, whether or not the fix changes them. `""` for a path + that holds a control character, one of the project's secret values or a secret gitleaks detects. + """ + + code: str + question: str + paths: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + code = self.code + + question = self.question + + paths = self.paths + + + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "code": code, + "question": question, + "paths": paths, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + code = d.pop("code") + + question = d.pop("question") + + paths = cast(list[str], d.pop("paths")) + + + lavaflow_hold_reason = cls( + code=code, + question=question, + paths=paths, + ) + + + lavaflow_hold_reason.additional_properties = d + return lavaflow_hold_reason + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_involved_resource.py b/src/volcano_sdk/_generated/models/lavaflow_involved_resource.py new file mode 100644 index 00000000..0b8858a3 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_involved_resource.py @@ -0,0 +1,111 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.lavaflow_involved_resource_roles_item import check_lavaflow_involved_resource_roles_item +from ..models.lavaflow_involved_resource_roles_item import LavaflowInvolvedResourceRolesItem +from typing import cast + +if TYPE_CHECKING: + from ..models.lavaflow_resource_reference import LavaflowResourceReference + + + + + +T = TypeVar("T", bound="LavaflowInvolvedResource") + + + +@_attrs_define +class LavaflowInvolvedResource: + """ A resource a run involves, and how. + + Attributes: + resource (LavaflowResourceReference): A function, durable function or frontend in the project, or the project of + a user-reported problem. + roles (list[LavaflowInvolvedResourceRolesItem]): `issue`: the issue came from it. `cause`: the issue came from + it, or code the diagnosis cites as evidence is in its source. `fix`: the diagnosis proposes changing its source, + or the fix changes it; a change to code that every function shares involves every function. + """ + + resource: LavaflowResourceReference + roles: list[LavaflowInvolvedResourceRolesItem] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.lavaflow_resource_reference import LavaflowResourceReference # noqa: PLC0415 + resource = self.resource.to_dict() + + roles = [] + for roles_item_data in self.roles: + roles_item: str = roles_item_data + roles.append(roles_item) + + + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "resource": resource, + "roles": roles, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.lavaflow_resource_reference import LavaflowResourceReference # noqa: PLC0415 + d = dict(src_dict) + resource = LavaflowResourceReference.from_dict(d.pop("resource")) + + + + + roles = [] + _roles = d.pop("roles") + for roles_item_data in (_roles): + roles_item = check_lavaflow_involved_resource_roles_item(roles_item_data) + + + + roles.append(roles_item) + + + lavaflow_involved_resource = cls( + resource=resource, + roles=roles, + ) + + + lavaflow_involved_resource.additional_properties = d + return lavaflow_involved_resource + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_involved_resource_count.py b/src/volcano_sdk/_generated/models/lavaflow_involved_resource_count.py new file mode 100644 index 00000000..59a6693b --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_involved_resource_count.py @@ -0,0 +1,94 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast + +if TYPE_CHECKING: + from ..models.lavaflow_resource_reference import LavaflowResourceReference + + + + + +T = TypeVar("T", bound="LavaflowInvolvedResourceCount") + + + +@_attrs_define +class LavaflowInvolvedResourceCount: + """ A resource and how many matching runs involve it. + + Attributes: + resource (LavaflowResourceReference): A function, durable function or frontend in the project, or the project of + a user-reported problem. + runs (int): + """ + + resource: LavaflowResourceReference + runs: int + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.lavaflow_resource_reference import LavaflowResourceReference # noqa: PLC0415 + resource = self.resource.to_dict() + + runs = self.runs + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "resource": resource, + "runs": runs, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.lavaflow_resource_reference import LavaflowResourceReference # noqa: PLC0415 + d = dict(src_dict) + resource = LavaflowResourceReference.from_dict(d.pop("resource")) + + + + + runs = d.pop("runs") + + lavaflow_involved_resource_count = cls( + resource=resource, + runs=runs, + ) + + + lavaflow_involved_resource_count.additional_properties = d + return lavaflow_involved_resource_count + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_involved_resource_roles_item.py b/src/volcano_sdk/_generated/models/lavaflow_involved_resource_roles_item.py new file mode 100644 index 00000000..512830b6 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_involved_resource_roles_item.py @@ -0,0 +1,10 @@ +from typing import Literal + +LavaflowInvolvedResourceRolesItem = Literal['cause', 'fix', 'issue'] + +LAVAFLOW_INVOLVED_RESOURCE_ROLES_ITEM_VALUES: set[LavaflowInvolvedResourceRolesItem] = { 'cause', 'fix', 'issue', } + +def check_lavaflow_involved_resource_roles_item(value: str) -> LavaflowInvolvedResourceRolesItem: + if value in LAVAFLOW_INVOLVED_RESOURCE_ROLES_ITEM_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {LAVAFLOW_INVOLVED_RESOURCE_ROLES_ITEM_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/lavaflow_issue_prompt.py b/src/volcano_sdk/_generated/models/lavaflow_issue_prompt.py new file mode 100644 index 00000000..ca3e7a30 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_issue_prompt.py @@ -0,0 +1,181 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.lavaflow_issue_prompt_mode import check_lavaflow_issue_prompt_mode +from ..models.lavaflow_issue_prompt_mode import LavaflowIssuePromptMode +from ..models.lavaflow_issue_prompt_status import check_lavaflow_issue_prompt_status +from ..models.lavaflow_issue_prompt_status import LavaflowIssuePromptStatus +from ..types import UNSET, Unset +from typing import cast +from uuid import UUID +import datetime + + + + + + +T = TypeVar("T", bound="LavaflowIssuePrompt") + + + +@_attrs_define +class LavaflowIssuePrompt: + """ + Attributes: + version (int): + mode (LavaflowIssuePromptMode): + description (str): + created_at (datetime.datetime): + status (LavaflowIssuePromptStatus): + author (str | Unset): + redacted (bool | Unset): + applied_at (datetime.datetime | Unset): + run_id (UUID | Unset): + """ + + version: int + mode: LavaflowIssuePromptMode + description: str + created_at: datetime.datetime + status: LavaflowIssuePromptStatus + author: str | Unset = UNSET + redacted: bool | Unset = UNSET + applied_at: datetime.datetime | Unset = UNSET + run_id: UUID | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + version = self.version + + mode: str = self.mode + + description = self.description + + created_at = self.created_at.isoformat() + + status: str = self.status + + author = self.author + + redacted = self.redacted + + applied_at: str | Unset = UNSET + if not isinstance(self.applied_at, Unset): + applied_at = self.applied_at.isoformat() + + run_id: str | Unset = UNSET + if not isinstance(self.run_id, Unset): + run_id = str(self.run_id) + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "version": version, + "mode": mode, + "description": description, + "created_at": created_at, + "status": status, + }) + if author is not UNSET: + field_dict["author"] = author + if redacted is not UNSET: + field_dict["redacted"] = redacted + if applied_at is not UNSET: + field_dict["applied_at"] = applied_at + if run_id is not UNSET: + field_dict["run_id"] = run_id + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + version = d.pop("version") + + mode = check_lavaflow_issue_prompt_mode(d.pop("mode")) + + + + + description = d.pop("description") + + created_at = datetime.datetime.fromisoformat(d.pop("created_at")) + + + + + status = check_lavaflow_issue_prompt_status(d.pop("status")) + + + + + author = d.pop("author", UNSET) + + redacted = d.pop("redacted", UNSET) + + _applied_at = d.pop("applied_at", UNSET) + applied_at: datetime.datetime | Unset + if isinstance(_applied_at, Unset): + applied_at = UNSET + else: + applied_at = datetime.datetime.fromisoformat(_applied_at) + + + + + _run_id = d.pop("run_id", UNSET) + run_id: UUID | Unset + if isinstance(_run_id, Unset): + run_id = UNSET + else: + run_id = UUID(_run_id) + + + + + lavaflow_issue_prompt = cls( + version=version, + mode=mode, + description=description, + created_at=created_at, + status=status, + author=author, + redacted=redacted, + applied_at=applied_at, + run_id=run_id, + ) + + + lavaflow_issue_prompt.additional_properties = d + return lavaflow_issue_prompt + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_issue_prompt_create.py b/src/volcano_sdk/_generated/models/lavaflow_issue_prompt_create.py new file mode 100644 index 00000000..7dafcb7b --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_issue_prompt_create.py @@ -0,0 +1,121 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.lavaflow_issue_prompt_create_mode import check_lavaflow_issue_prompt_create_mode +from ..models.lavaflow_issue_prompt_create_mode import LavaflowIssuePromptCreateMode +from typing import cast +from uuid import UUID + + + + + + +T = TypeVar("T", bound="LavaflowIssuePromptCreate") + + + +@_attrs_define +class LavaflowIssuePromptCreate: + """ + Attributes: + project_id (UUID): + issue_id (UUID): + expected_version (int): + mode (LavaflowIssuePromptCreateMode): + description (str): + """ + + project_id: UUID + issue_id: UUID + expected_version: int + mode: LavaflowIssuePromptCreateMode + description: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + project_id = str(self.project_id) + + issue_id = str(self.issue_id) + + expected_version = self.expected_version + + mode: str = self.mode + + description = self.description + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "project_id": project_id, + "issue_id": issue_id, + "expected_version": expected_version, + "mode": mode, + "description": description, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + project_id = UUID(d.pop("project_id")) + + + + + issue_id = UUID(d.pop("issue_id")) + + + + + expected_version = d.pop("expected_version") + + mode = check_lavaflow_issue_prompt_create_mode(d.pop("mode")) + + + + + description = d.pop("description") + + lavaflow_issue_prompt_create = cls( + project_id=project_id, + issue_id=issue_id, + expected_version=expected_version, + mode=mode, + description=description, + ) + + + lavaflow_issue_prompt_create.additional_properties = d + return lavaflow_issue_prompt_create + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_issue_prompt_create_mode.py b/src/volcano_sdk/_generated/models/lavaflow_issue_prompt_create_mode.py new file mode 100644 index 00000000..49b24920 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_issue_prompt_create_mode.py @@ -0,0 +1,10 @@ +from typing import Literal + +LavaflowIssuePromptCreateMode = Literal['follow_up'] + +LAVAFLOW_ISSUE_PROMPT_CREATE_MODE_VALUES: set[LavaflowIssuePromptCreateMode] = { 'follow_up', } + +def check_lavaflow_issue_prompt_create_mode(value: str) -> LavaflowIssuePromptCreateMode: + if value in LAVAFLOW_ISSUE_PROMPT_CREATE_MODE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {LAVAFLOW_ISSUE_PROMPT_CREATE_MODE_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/lavaflow_issue_prompt_mode.py b/src/volcano_sdk/_generated/models/lavaflow_issue_prompt_mode.py new file mode 100644 index 00000000..df5bbe7a --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_issue_prompt_mode.py @@ -0,0 +1,10 @@ +from typing import Literal + +LavaflowIssuePromptMode = Literal['follow_up', 'original', 'replace'] + +LAVAFLOW_ISSUE_PROMPT_MODE_VALUES: set[LavaflowIssuePromptMode] = { 'follow_up', 'original', 'replace', } + +def check_lavaflow_issue_prompt_mode(value: str) -> LavaflowIssuePromptMode: + if value in LAVAFLOW_ISSUE_PROMPT_MODE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {LAVAFLOW_ISSUE_PROMPT_MODE_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/lavaflow_issue_prompt_status.py b/src/volcano_sdk/_generated/models/lavaflow_issue_prompt_status.py new file mode 100644 index 00000000..4d7bf735 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_issue_prompt_status.py @@ -0,0 +1,10 @@ +from typing import Literal + +LavaflowIssuePromptStatus = Literal['applied', 'failed', 'queued', 'saved', 'superseded'] + +LAVAFLOW_ISSUE_PROMPT_STATUS_VALUES: set[LavaflowIssuePromptStatus] = { 'applied', 'failed', 'queued', 'saved', 'superseded', } + +def check_lavaflow_issue_prompt_status(value: str) -> LavaflowIssuePromptStatus: + if value in LAVAFLOW_ISSUE_PROMPT_STATUS_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {LAVAFLOW_ISSUE_PROMPT_STATUS_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/lavaflow_issue_prompts.py b/src/volcano_sdk/_generated/models/lavaflow_issue_prompts.py new file mode 100644 index 00000000..ab863a63 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_issue_prompts.py @@ -0,0 +1,141 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.lavaflow_issue_prompt import LavaflowIssuePrompt + from ..models.lavaflow_task_activity import LavaflowTaskActivity + + + + + +T = TypeVar("T", bound="LavaflowIssuePrompts") + + + +@_attrs_define +class LavaflowIssuePrompts: + """ + Attributes: + data (list[LavaflowIssuePrompt]): + version (int): + activity (list[LavaflowTaskActivity] | Unset): + more_activity (bool | Unset): + """ + + data: list[LavaflowIssuePrompt] + version: int + activity: list[LavaflowTaskActivity] | Unset = UNSET + more_activity: bool | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.lavaflow_issue_prompt import LavaflowIssuePrompt # noqa: PLC0415 + from ..models.lavaflow_task_activity import LavaflowTaskActivity # noqa: PLC0415 + data = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + + + version = self.version + + activity: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.activity, Unset): + activity = [] + for activity_item_data in self.activity: + activity_item = activity_item_data.to_dict() + activity.append(activity_item) + + + + more_activity = self.more_activity + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "data": data, + "version": version, + }) + if activity is not UNSET: + field_dict["activity"] = activity + if more_activity is not UNSET: + field_dict["more_activity"] = more_activity + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.lavaflow_issue_prompt import LavaflowIssuePrompt # noqa: PLC0415 + from ..models.lavaflow_task_activity import LavaflowTaskActivity # noqa: PLC0415 + d = dict(src_dict) + data = [] + _data = d.pop("data") + for data_item_data in (_data): + data_item = LavaflowIssuePrompt.from_dict(data_item_data) + + + + data.append(data_item) + + + version = d.pop("version") + + _activity = d.pop("activity", UNSET) + activity: list[LavaflowTaskActivity] | Unset = UNSET + if _activity is not UNSET: + activity = [] + for activity_item_data in _activity: + activity_item = LavaflowTaskActivity.from_dict(activity_item_data) + + + + activity.append(activity_item) + + + more_activity = d.pop("more_activity", UNSET) + + lavaflow_issue_prompts = cls( + data=data, + version=version, + activity=activity, + more_activity=more_activity, + ) + + + lavaflow_issue_prompts.additional_properties = d + return lavaflow_issue_prompts + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_issue_summary.py b/src/volcano_sdk/_generated/models/lavaflow_issue_summary.py new file mode 100644 index 00000000..50541365 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_issue_summary.py @@ -0,0 +1,261 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.issue_source import check_issue_source +from ..models.issue_source import IssueSource +from ..models.issue_status import check_issue_status +from ..models.issue_status import IssueStatus +from ..models.lavaflow_issue_summary_severity import check_lavaflow_issue_summary_severity +from ..models.lavaflow_issue_summary_severity import LavaflowIssueSummarySeverity +from ..types import UNSET, Unset +from typing import cast +from uuid import UUID +import datetime + + + + + + +T = TypeVar("T", bound="LavaflowIssueSummary") + + + +@_attrs_define +class LavaflowIssueSummary: + """ The project issue a run works on. + + Attributes: + id (UUID): + title (str): The issue's title: the error type and message, a Code Quality finding's title, or a reported + problem's title. + culprit (None | str): The innermost frame of your code, as `function (file)`; for a Code Quality finding, the + symbol and file it is in, as `symbol (file)`, or the file alone; for a failed build, its first error's + `file:line`. Null for an error without a stack and for a reported problem. + status (IssueStatus): `open` until someone resolves or ignores the issue. A resolved issue + seen again reopens. A reported problem resolves when its LavaFlow fix + merges. Volcano ignores one whose report it deleted before any fix + merged, so it no longer counts toward the project's open issues. + event_count (int): Errors the issue has grouped so far; for a Code Quality finding, the scans that saw it; for a + failed build, the failed deploys; 0 for a reported problem. + last_seen_at (datetime.datetime): + resolved_at (datetime.datetime | None): When the issue was resolved; null unless it is resolved now. + regressed_at (datetime.datetime | None): When the issue was last seen again after it was resolved, and reopened; + null if it never was. + run_count (int): LavaFlow runs on this issue, this one included. + source (IssueSource | Unset): Where the issue came from: `runtime` for errors your code logged, `code_quality` + for a LavaFlow Code Quality finding in code a deploy changed, `build` for deploys of one function or frontend + that failed in its own build step, `report` for a problem reported for the project, such as through Slack, or + `request` for an issue a person wrote with `POST /issues`. A later deploy that builds resolves a `build` issue. + Deploys Volcano failed, such as a timeout or a refused build, never make one. + severity (LavaflowIssueSummarySeverity | Unset): The confirmed Code Quality finding's recorded severity. Omitted + for other issue sources and when no canonical severity is known; absence does not mean the issue has low + severity. + """ + + id: UUID + title: str + culprit: None | str + status: IssueStatus + event_count: int + last_seen_at: datetime.datetime + resolved_at: datetime.datetime | None + regressed_at: datetime.datetime | None + run_count: int + source: IssueSource | Unset = UNSET + severity: LavaflowIssueSummarySeverity | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + id = str(self.id) + + title = self.title + + culprit: None | str + culprit = self.culprit + + status: str = self.status + + event_count = self.event_count + + last_seen_at = self.last_seen_at.isoformat() + + resolved_at: None | str + if isinstance(self.resolved_at, datetime.datetime): + resolved_at = self.resolved_at.isoformat() + else: + resolved_at = self.resolved_at + + regressed_at: None | str + if isinstance(self.regressed_at, datetime.datetime): + regressed_at = self.regressed_at.isoformat() + else: + regressed_at = self.regressed_at + + run_count = self.run_count + + source: str | Unset = UNSET + if not isinstance(self.source, Unset): + source = self.source + + + severity: str | Unset = UNSET + if not isinstance(self.severity, Unset): + severity = self.severity + + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "id": id, + "title": title, + "culprit": culprit, + "status": status, + "event_count": event_count, + "last_seen_at": last_seen_at, + "resolved_at": resolved_at, + "regressed_at": regressed_at, + "run_count": run_count, + }) + if source is not UNSET: + field_dict["source"] = source + if severity is not UNSET: + field_dict["severity"] = severity + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = UUID(d.pop("id")) + + + + + title = d.pop("title") + + def _parse_culprit(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + culprit = _parse_culprit(d.pop("culprit")) + + + status = check_issue_status(d.pop("status")) + + + + + event_count = d.pop("event_count") + + last_seen_at = datetime.datetime.fromisoformat(d.pop("last_seen_at")) + + + + + def _parse_resolved_at(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + resolved_at_type_0 = datetime.datetime.fromisoformat(data) + + + + return resolved_at_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + resolved_at = _parse_resolved_at(d.pop("resolved_at")) + + + def _parse_regressed_at(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + regressed_at_type_0 = datetime.datetime.fromisoformat(data) + + + + return regressed_at_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + regressed_at = _parse_regressed_at(d.pop("regressed_at")) + + + run_count = d.pop("run_count") + + _source = d.pop("source", UNSET) + source: IssueSource | Unset + if isinstance(_source, Unset): + source = UNSET + else: + source = check_issue_source(_source) + + + + + _severity = d.pop("severity", UNSET) + severity: LavaflowIssueSummarySeverity | Unset + if isinstance(_severity, Unset): + severity = UNSET + else: + severity = check_lavaflow_issue_summary_severity(_severity) + + + + + lavaflow_issue_summary = cls( + id=id, + title=title, + culprit=culprit, + status=status, + event_count=event_count, + last_seen_at=last_seen_at, + resolved_at=resolved_at, + regressed_at=regressed_at, + run_count=run_count, + source=source, + severity=severity, + ) + + + lavaflow_issue_summary.additional_properties = d + return lavaflow_issue_summary + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_issue_summary_severity.py b/src/volcano_sdk/_generated/models/lavaflow_issue_summary_severity.py new file mode 100644 index 00000000..13bd03b5 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_issue_summary_severity.py @@ -0,0 +1,10 @@ +from typing import Literal + +LavaflowIssueSummarySeverity = Literal['critical', 'major', 'minor', 'nit'] + +LAVAFLOW_ISSUE_SUMMARY_SEVERITY_VALUES: set[LavaflowIssueSummarySeverity] = { 'critical', 'major', 'minor', 'nit', } + +def check_lavaflow_issue_summary_severity(value: str) -> LavaflowIssueSummarySeverity: + if value in LAVAFLOW_ISSUE_SUMMARY_SEVERITY_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {LAVAFLOW_ISSUE_SUMMARY_SEVERITY_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/lavaflow_lineage.py b/src/volcano_sdk/_generated/models/lavaflow_lineage.py new file mode 100644 index 00000000..3bc7cd68 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_lineage.py @@ -0,0 +1,237 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.lavaflow_lineage_confidence import check_lavaflow_lineage_confidence +from ..models.lavaflow_lineage_confidence import LavaflowLineageConfidence +from ..models.lavaflow_lineage_relation import check_lavaflow_lineage_relation +from ..models.lavaflow_lineage_relation import LavaflowLineageRelation +from ..models.lavaflow_lineage_remedy import check_lavaflow_lineage_remedy +from ..models.lavaflow_lineage_remedy import LavaflowLineageRemedy +from ..models.lavaflow_lineage_state import check_lavaflow_lineage_state +from ..models.lavaflow_lineage_state import LavaflowLineageState +from typing import cast +from uuid import UUID + +if TYPE_CHECKING: + from ..models.lavaflow_run_reference import LavaflowRunReference + + + + + +T = TypeVar("T", bound="LavaflowLineage") + + + +@_attrs_define +class LavaflowLineage: + """ A chain of LavaFlow fixes: a merged fix, and the runs that followed up an issue traced to it or to a fix after it. + + Attributes: + id (UUID): The lineage's root run. + depth (int): 0 for the root fix. + relation (LavaflowLineageRelation): `regression` for an issue traced to the parent's deploy, `recurrence` for an + issue that came back after the parent went live. Null for the root. + confidence (LavaflowLineageConfidence): Null for the root, and otherwise `strong`. `weak` is reserved: nothing + writes it. + parent (LavaflowRunReference | None): The fix this run follows up. Null for the root. + covered_by (LavaflowRunReference | None): The run whose fix also covers this issue, so this run opened nothing. + remedy (LavaflowLineageRemedy): How the run follows up its parent. Currently always `fix`: a regression gets a + follow-up fix. `revert` and `none` are reserved. + state (LavaflowLineageState): + hold_reason (None | str): Why the lineage holds: `lineage_cap`, `lineage_held` or `repository_changed`. New + values may appear. Null unless `state` is `held`. + pull_requests_opened (int): Pull requests the lineage opened, counting the root's. + pull_request_cap (int): The most pull requests a lineage opens before it holds. + """ + + id: UUID + depth: int + relation: LavaflowLineageRelation + confidence: LavaflowLineageConfidence + parent: LavaflowRunReference | None + covered_by: LavaflowRunReference | None + remedy: LavaflowLineageRemedy + state: LavaflowLineageState + hold_reason: None | str + pull_requests_opened: int + pull_request_cap: int + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.lavaflow_run_reference import LavaflowRunReference # noqa: PLC0415 + id = str(self.id) + + depth = self.depth + + relation: str = self.relation + + confidence: str = self.confidence + + parent: dict[str, Any] | None + if isinstance(self.parent, LavaflowRunReference): + parent = self.parent.to_dict() + else: + parent = self.parent + + covered_by: dict[str, Any] | None + if isinstance(self.covered_by, LavaflowRunReference): + covered_by = self.covered_by.to_dict() + else: + covered_by = self.covered_by + + remedy: str = self.remedy + + state: str = self.state + + hold_reason: None | str + hold_reason = self.hold_reason + + pull_requests_opened = self.pull_requests_opened + + pull_request_cap = self.pull_request_cap + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "id": id, + "depth": depth, + "relation": relation, + "confidence": confidence, + "parent": parent, + "covered_by": covered_by, + "remedy": remedy, + "state": state, + "hold_reason": hold_reason, + "pull_requests_opened": pull_requests_opened, + "pull_request_cap": pull_request_cap, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.lavaflow_run_reference import LavaflowRunReference # noqa: PLC0415 + d = dict(src_dict) + id = UUID(d.pop("id")) + + + + + depth = d.pop("depth") + + relation = check_lavaflow_lineage_relation(d.pop("relation")) + + + + + confidence = check_lavaflow_lineage_confidence(d.pop("confidence")) + + + + + def _parse_parent(data: object) -> LavaflowRunReference | None: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + parent_type_1 = LavaflowRunReference.from_dict(data) + + + + return parent_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(LavaflowRunReference | None, data) + + parent = _parse_parent(d.pop("parent")) + + + def _parse_covered_by(data: object) -> LavaflowRunReference | None: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + covered_by_type_1 = LavaflowRunReference.from_dict(data) + + + + return covered_by_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(LavaflowRunReference | None, data) + + covered_by = _parse_covered_by(d.pop("covered_by")) + + + remedy = check_lavaflow_lineage_remedy(d.pop("remedy")) + + + + + state = check_lavaflow_lineage_state(d.pop("state")) + + + + + def _parse_hold_reason(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + hold_reason = _parse_hold_reason(d.pop("hold_reason")) + + + pull_requests_opened = d.pop("pull_requests_opened") + + pull_request_cap = d.pop("pull_request_cap") + + lavaflow_lineage = cls( + id=id, + depth=depth, + relation=relation, + confidence=confidence, + parent=parent, + covered_by=covered_by, + remedy=remedy, + state=state, + hold_reason=hold_reason, + pull_requests_opened=pull_requests_opened, + pull_request_cap=pull_request_cap, + ) + + + lavaflow_lineage.additional_properties = d + return lavaflow_lineage + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_lineage_confidence.py b/src/volcano_sdk/_generated/models/lavaflow_lineage_confidence.py new file mode 100644 index 00000000..fabebb60 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_lineage_confidence.py @@ -0,0 +1,10 @@ +from typing import Literal + +LavaflowLineageConfidence = Literal['strong', 'weak'] + +LAVAFLOW_LINEAGE_CONFIDENCE_VALUES: set[LavaflowLineageConfidence] = { 'strong', 'weak', } + +def check_lavaflow_lineage_confidence(value: str) -> LavaflowLineageConfidence: + if value in LAVAFLOW_LINEAGE_CONFIDENCE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {LAVAFLOW_LINEAGE_CONFIDENCE_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/lavaflow_lineage_evidence.py b/src/volcano_sdk/_generated/models/lavaflow_lineage_evidence.py new file mode 100644 index 00000000..5837715f --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_lineage_evidence.py @@ -0,0 +1,173 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.lavaflow_lineage_evidence_confidence import check_lavaflow_lineage_evidence_confidence +from ..models.lavaflow_lineage_evidence_confidence import LavaflowLineageEvidenceConfidence +from typing import cast +import datetime + +if TYPE_CHECKING: + from ..models.lavaflow_lineage_evidence_deployment import LavaflowLineageEvidenceDeployment + from ..models.lavaflow_run_reference import LavaflowRunReference + + + + + +T = TypeVar("T", bound="LavaflowLineageEvidence") + + + +@_attrs_define +class LavaflowLineageEvidence: + """ What tied the run's issue to a recent LavaFlow fix. A `display` link rests on less than a strong one and joins no + lineage. + + Attributes: + confidence (LavaflowLineageEvidenceConfidence): `strong` or `display`. `weak` is reserved: nothing writes it. + parent (LavaflowRunReference): Another LavaFlow run of the same project. + deployment (LavaflowLineageEvidenceDeployment): + previous_commit_sha (None | str): The commit of the deployment before it. + fix_live_at (datetime.datetime): + opened_at (datetime.datetime): The occurrence attribution judged. + overlapping_functions (list[str]): + overlapping_files (list[str]): + """ + + confidence: LavaflowLineageEvidenceConfidence + parent: LavaflowRunReference + deployment: LavaflowLineageEvidenceDeployment + previous_commit_sha: None | str + fix_live_at: datetime.datetime + opened_at: datetime.datetime + overlapping_functions: list[str] + overlapping_files: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.lavaflow_lineage_evidence_deployment import LavaflowLineageEvidenceDeployment # noqa: PLC0415 + from ..models.lavaflow_run_reference import LavaflowRunReference # noqa: PLC0415 + confidence: str = self.confidence + + parent = self.parent.to_dict() + + deployment = self.deployment.to_dict() + + previous_commit_sha: None | str + previous_commit_sha = self.previous_commit_sha + + fix_live_at = self.fix_live_at.isoformat() + + opened_at = self.opened_at.isoformat() + + overlapping_functions = self.overlapping_functions + + + + overlapping_files = self.overlapping_files + + + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "confidence": confidence, + "parent": parent, + "deployment": deployment, + "previous_commit_sha": previous_commit_sha, + "fix_live_at": fix_live_at, + "opened_at": opened_at, + "overlapping_functions": overlapping_functions, + "overlapping_files": overlapping_files, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.lavaflow_lineage_evidence_deployment import LavaflowLineageEvidenceDeployment # noqa: PLC0415 + from ..models.lavaflow_run_reference import LavaflowRunReference # noqa: PLC0415 + d = dict(src_dict) + confidence = check_lavaflow_lineage_evidence_confidence(d.pop("confidence")) + + + + + parent = LavaflowRunReference.from_dict(d.pop("parent")) + + + + + deployment = LavaflowLineageEvidenceDeployment.from_dict(d.pop("deployment")) + + + + + def _parse_previous_commit_sha(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + previous_commit_sha = _parse_previous_commit_sha(d.pop("previous_commit_sha")) + + + fix_live_at = datetime.datetime.fromisoformat(d.pop("fix_live_at")) + + + + + opened_at = datetime.datetime.fromisoformat(d.pop("opened_at")) + + + + + overlapping_functions = cast(list[str], d.pop("overlapping_functions")) + + + overlapping_files = cast(list[str], d.pop("overlapping_files")) + + + lavaflow_lineage_evidence = cls( + confidence=confidence, + parent=parent, + deployment=deployment, + previous_commit_sha=previous_commit_sha, + fix_live_at=fix_live_at, + opened_at=opened_at, + overlapping_functions=overlapping_functions, + overlapping_files=overlapping_files, + ) + + + lavaflow_lineage_evidence.additional_properties = d + return lavaflow_lineage_evidence + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_lineage_evidence_confidence.py b/src/volcano_sdk/_generated/models/lavaflow_lineage_evidence_confidence.py new file mode 100644 index 00000000..c3e98c37 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_lineage_evidence_confidence.py @@ -0,0 +1,10 @@ +from typing import Literal + +LavaflowLineageEvidenceConfidence = Literal['display', 'strong', 'weak'] + +LAVAFLOW_LINEAGE_EVIDENCE_CONFIDENCE_VALUES: set[LavaflowLineageEvidenceConfidence] = { 'display', 'strong', 'weak', } + +def check_lavaflow_lineage_evidence_confidence(value: str) -> LavaflowLineageEvidenceConfidence: + if value in LAVAFLOW_LINEAGE_EVIDENCE_CONFIDENCE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {LAVAFLOW_LINEAGE_EVIDENCE_CONFIDENCE_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/lavaflow_lineage_evidence_deployment.py b/src/volcano_sdk/_generated/models/lavaflow_lineage_evidence_deployment.py new file mode 100644 index 00000000..99237cb9 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_lineage_evidence_deployment.py @@ -0,0 +1,85 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="LavaflowLineageEvidenceDeployment") + + + +@_attrs_define +class LavaflowLineageEvidenceDeployment: + """ + Attributes: + commit_sha (str): The commit of the deployment that served the occurrence attribution judged (`opened_at`). + commit_origin (str): `push` for a commit Volcano built from a push, `client_reported` for one the deploy client + reported. New values may appear. + """ + + commit_sha: str + commit_origin: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + commit_sha = self.commit_sha + + commit_origin = self.commit_origin + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "commit_sha": commit_sha, + "commit_origin": commit_origin, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + commit_sha = d.pop("commit_sha") + + commit_origin = d.pop("commit_origin") + + lavaflow_lineage_evidence_deployment = cls( + commit_sha=commit_sha, + commit_origin=commit_origin, + ) + + + lavaflow_lineage_evidence_deployment.additional_properties = d + return lavaflow_lineage_evidence_deployment + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_lineage_relation.py b/src/volcano_sdk/_generated/models/lavaflow_lineage_relation.py new file mode 100644 index 00000000..c7ec9cd9 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_lineage_relation.py @@ -0,0 +1,10 @@ +from typing import Literal + +LavaflowLineageRelation = Literal['recurrence', 'regression'] + +LAVAFLOW_LINEAGE_RELATION_VALUES: set[LavaflowLineageRelation] = { 'recurrence', 'regression', } + +def check_lavaflow_lineage_relation(value: str) -> LavaflowLineageRelation: + if value in LAVAFLOW_LINEAGE_RELATION_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {LAVAFLOW_LINEAGE_RELATION_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/lavaflow_lineage_remedy.py b/src/volcano_sdk/_generated/models/lavaflow_lineage_remedy.py new file mode 100644 index 00000000..0b8c9e28 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_lineage_remedy.py @@ -0,0 +1,10 @@ +from typing import Literal + +LavaflowLineageRemedy = Literal['fix', 'none', 'revert'] + +LAVAFLOW_LINEAGE_REMEDY_VALUES: set[LavaflowLineageRemedy] = { 'fix', 'none', 'revert', } + +def check_lavaflow_lineage_remedy(value: str) -> LavaflowLineageRemedy: + if value in LAVAFLOW_LINEAGE_REMEDY_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {LAVAFLOW_LINEAGE_REMEDY_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/lavaflow_lineage_state.py b/src/volcano_sdk/_generated/models/lavaflow_lineage_state.py new file mode 100644 index 00000000..3acd4309 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_lineage_state.py @@ -0,0 +1,10 @@ +from typing import Literal + +LavaflowLineageState = Literal['active', 'held', 'settled'] + +LAVAFLOW_LINEAGE_STATE_VALUES: set[LavaflowLineageState] = { 'active', 'held', 'settled', } + +def check_lavaflow_lineage_state(value: str) -> LavaflowLineageState: + if value in LAVAFLOW_LINEAGE_STATE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {LAVAFLOW_LINEAGE_STATE_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/lavaflow_log_line.py b/src/volcano_sdk/_generated/models/lavaflow_log_line.py new file mode 100644 index 00000000..0fce3aa2 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_log_line.py @@ -0,0 +1,114 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast +import datetime + + + + + + +T = TypeVar("T", bound="LavaflowLogLine") + + + +@_attrs_define +class LavaflowLogLine: + """ + Attributes: + timestamp (datetime.datetime | None): + level (str): + message (str): + """ + + timestamp: datetime.datetime | None + level: str + message: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + timestamp: None | str + if isinstance(self.timestamp, datetime.datetime): + timestamp = self.timestamp.isoformat() + else: + timestamp = self.timestamp + + level = self.level + + message = self.message + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "timestamp": timestamp, + "level": level, + "message": message, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + def _parse_timestamp(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + timestamp_type_0 = datetime.datetime.fromisoformat(data) + + + + return timestamp_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + timestamp = _parse_timestamp(d.pop("timestamp")) + + + level = d.pop("level") + + message = d.pop("message") + + lavaflow_log_line = cls( + timestamp=timestamp, + level=level, + message=message, + ) + + + lavaflow_log_line.additional_properties = d + return lavaflow_log_line + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_merge.py b/src/volcano_sdk/_generated/models/lavaflow_merge.py new file mode 100644 index 00000000..65462d3f --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_merge.py @@ -0,0 +1,154 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.lavaflow_merge_status import check_lavaflow_merge_status +from ..models.lavaflow_merge_status import LavaflowMergeStatus +from typing import cast + +if TYPE_CHECKING: + from ..models.lavaflow_hold_reason import LavaflowHoldReason + + + + + +T = TypeVar("T", bound="LavaflowMerge") + + + +@_attrs_define +class LavaflowMerge: + """ Where the run's merge stands. Present for a run that may merge its fix, once its pull request opens, and for a run + whose fix a person merges (its autonomy is `open_pr`, merging was unavailable when it opened, or the run may only + open a pull request) that opened ready for review: LavaFlow starts that fix's CI once, then holds it for + `person_merges` and never merges it. + + Attributes: + status (LavaflowMergeStatus): `waiting_for_checks`: LavaFlow waits for the checks on the fix's commit. A pending + status published by a GitHub user is advisory when LavaFlow verifies that the pull request and base branch do + not require it. `waiting_for_approval`: checks passed and GitHub still requires an approving review. LavaFlow + keeps watching and merges or queues the fix once GitHub reports required reviews satisfied and checks still + pass. A new or dismissed approval is noticed on the next read, normally within five minutes initially, slowing + to at most one hour for unattended waits older than a day. This wait does not consume the CI timeout. `queued`: + the fix is in the repository's merge queue. `merged`: the pull request merged. `held`: something in + `hold_reasons` needs a person. LavaFlow commented on the pull request once and never merges, pushes to, rebases + or dequeues it again; review it and merge it yourself if you want it. A fix a person merges (its autonomy is + `open_pr`, merging was unavailable when it opened, or its run may only open a pull request) is always `held` for + `person_merges` once LavaFlow has started its CI, or found it may not. `stopped`: LavaFlow left the pull request + open for you, for `reason`. + reason (None | str): + hold_reasons (list[LavaflowHoldReason]): Why LavaFlow holds the fix. Empty unless `status` is `held`. + merged_by_lavaflow (bool | None): Whether LavaFlow made the merge: `true` when it merged the fix's commit itself + or through the merge queue, `false` when someone else merged the pull request while LavaFlow waited. `null` + unless `status` is `merged`. + """ + + status: LavaflowMergeStatus + reason: None | str + hold_reasons: list[LavaflowHoldReason] + merged_by_lavaflow: bool | None + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.lavaflow_hold_reason import LavaflowHoldReason # noqa: PLC0415 + status: str = self.status + + reason: None | str + reason = self.reason + + hold_reasons = [] + for hold_reasons_item_data in self.hold_reasons: + hold_reasons_item = hold_reasons_item_data.to_dict() + hold_reasons.append(hold_reasons_item) + + + + merged_by_lavaflow: bool | None + merged_by_lavaflow = self.merged_by_lavaflow + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "status": status, + "reason": reason, + "hold_reasons": hold_reasons, + "merged_by_lavaflow": merged_by_lavaflow, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.lavaflow_hold_reason import LavaflowHoldReason # noqa: PLC0415 + d = dict(src_dict) + status = check_lavaflow_merge_status(d.pop("status")) + + + + + def _parse_reason(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + reason = _parse_reason(d.pop("reason")) + + + hold_reasons = [] + _hold_reasons = d.pop("hold_reasons") + for hold_reasons_item_data in (_hold_reasons): + hold_reasons_item = LavaflowHoldReason.from_dict(hold_reasons_item_data) + + + + hold_reasons.append(hold_reasons_item) + + + def _parse_merged_by_lavaflow(data: object) -> bool | None: + if data is None: + return data + return cast(bool | None, data) + + merged_by_lavaflow = _parse_merged_by_lavaflow(d.pop("merged_by_lavaflow")) + + + lavaflow_merge = cls( + status=status, + reason=reason, + hold_reasons=hold_reasons, + merged_by_lavaflow=merged_by_lavaflow, + ) + + + lavaflow_merge.additional_properties = d + return lavaflow_merge + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_merge_policy.py b/src/volcano_sdk/_generated/models/lavaflow_merge_policy.py new file mode 100644 index 00000000..4c38e493 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_merge_policy.py @@ -0,0 +1,87 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast + + + + + + +T = TypeVar("T", bound="LavaflowMergePolicy") + + + +@_attrs_define +class LavaflowMergePolicy: + """ Your rules for fixes LavaFlow must never merge. They apply with `autonomy: merge`; at another autonomy they are + saved and do nothing. + + Attributes: + human_review_paths (list[str]): Globs of paths whose change LavaFlow never merges: a fix that changes one is + held and handed to you. Paths are relative to the repository root, such as `db/migrations/**`. `*` and `?` match + within one directory, `**/` spans any number of directories, and a final `**` matches the rest. A pattern that + starts with `/`, `./` or `../`, ends with `/`, holds an empty, `.` or `..` segment, or holds a NUL character + answers `400`. Volcano's own held paths, such as deploy configuration and authentication code, are always held + too. Defaults to none. + """ + + human_review_paths: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + human_review_paths = self.human_review_paths + + + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "human_review_paths": human_review_paths, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + human_review_paths = cast(list[str], d.pop("human_review_paths")) + + + lavaflow_merge_policy = cls( + human_review_paths=human_review_paths, + ) + + + lavaflow_merge_policy.additional_properties = d + return lavaflow_merge_policy + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_merge_policy_update.py b/src/volcano_sdk/_generated/models/lavaflow_merge_policy_update.py new file mode 100644 index 00000000..7ed04919 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_merge_policy_update.py @@ -0,0 +1,68 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset +from typing import cast + + + + + + +T = TypeVar("T", bound="LavaflowMergePolicyUpdate") + + + +@_attrs_define +class LavaflowMergePolicyUpdate: + """ The merge policy fields to change. An omitted field keeps its saved value. Send `human_review_paths: []` to clear + the paths. + + Attributes: + human_review_paths (list[str] | Unset): + """ + + human_review_paths: list[str] | Unset = UNSET + + + + + + def to_dict(self) -> dict[str, Any]: + human_review_paths: list[str] | Unset = UNSET + if not isinstance(self.human_review_paths, Unset): + human_review_paths = self.human_review_paths + + + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + }) + if human_review_paths is not UNSET: + field_dict["human_review_paths"] = human_review_paths + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + human_review_paths = cast(list[str], d.pop("human_review_paths", UNSET)) + + + lavaflow_merge_policy_update = cls( + human_review_paths=human_review_paths, + ) + + return lavaflow_merge_policy_update + diff --git a/src/volcano_sdk/_generated/models/lavaflow_merge_status.py b/src/volcano_sdk/_generated/models/lavaflow_merge_status.py new file mode 100644 index 00000000..b9965860 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_merge_status.py @@ -0,0 +1,10 @@ +from typing import Literal + +LavaflowMergeStatus = Literal['held', 'merged', 'queued', 'stopped', 'waiting_for_approval', 'waiting_for_checks'] + +LAVAFLOW_MERGE_STATUS_VALUES: set[LavaflowMergeStatus] = { 'held', 'merged', 'queued', 'stopped', 'waiting_for_approval', 'waiting_for_checks', } + +def check_lavaflow_merge_status(value: str) -> LavaflowMergeStatus: + if value in LAVAFLOW_MERGE_STATUS_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {LAVAFLOW_MERGE_STATUS_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/lavaflow_outcome_counts.py b/src/volcano_sdk/_generated/models/lavaflow_outcome_counts.py new file mode 100644 index 00000000..a20b4a4a --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_outcome_counts.py @@ -0,0 +1,93 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="LavaflowOutcomeCounts") + + + +@_attrs_define +class LavaflowOutcomeCounts: + """ Retained confirmations in the requested interval. These are lower bounds when collection coverage is incomplete. + + Attributes: + pull_requests_merged (int): + improvements_observed_live (int): + issue_resolutions (int): + """ + + pull_requests_merged: int + improvements_observed_live: int + issue_resolutions: int + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + pull_requests_merged = self.pull_requests_merged + + improvements_observed_live = self.improvements_observed_live + + issue_resolutions = self.issue_resolutions + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "pull_requests_merged": pull_requests_merged, + "improvements_observed_live": improvements_observed_live, + "issue_resolutions": issue_resolutions, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + pull_requests_merged = d.pop("pull_requests_merged") + + improvements_observed_live = d.pop("improvements_observed_live") + + issue_resolutions = d.pop("issue_resolutions") + + lavaflow_outcome_counts = cls( + pull_requests_merged=pull_requests_merged, + improvements_observed_live=improvements_observed_live, + issue_resolutions=issue_resolutions, + ) + + + lavaflow_outcome_counts.additional_properties = d + return lavaflow_outcome_counts + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_outcome_coverage.py b/src/volcano_sdk/_generated/models/lavaflow_outcome_coverage.py new file mode 100644 index 00000000..325d8fd5 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_outcome_coverage.py @@ -0,0 +1,181 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.lavaflow_outcome_coverage_event_time_basis import check_lavaflow_outcome_coverage_event_time_basis +from ..models.lavaflow_outcome_coverage_event_time_basis import LavaflowOutcomeCoverageEventTimeBasis +from ..models.lavaflow_outcome_coverage_status import check_lavaflow_outcome_coverage_status +from ..models.lavaflow_outcome_coverage_status import LavaflowOutcomeCoverageStatus +from typing import cast +import datetime + + + + + + +T = TypeVar("T", bound="LavaflowOutcomeCoverage") + + + +@_attrs_define +class LavaflowOutcomeCoverage: + """ Collection coverage for one metric. A migration or the earliest retained event establishes no complete interval. + Undated observations are not assigned to the requested dates or totals. + + Attributes: + status (LavaflowOutcomeCoverageStatus): + complete_from (datetime.datetime | None): + complete_through (datetime.datetime | None): + reason (str): + event_time_basis (LavaflowOutcomeCoverageEventTimeBasis): + supported_sources (list[str]): + undated_confirmed_events (int): + """ + + status: LavaflowOutcomeCoverageStatus + complete_from: datetime.datetime | None + complete_through: datetime.datetime | None + reason: str + event_time_basis: LavaflowOutcomeCoverageEventTimeBasis + supported_sources: list[str] + undated_confirmed_events: int + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + status: str = self.status + + complete_from: None | str + if isinstance(self.complete_from, datetime.datetime): + complete_from = self.complete_from.isoformat() + else: + complete_from = self.complete_from + + complete_through: None | str + if isinstance(self.complete_through, datetime.datetime): + complete_through = self.complete_through.isoformat() + else: + complete_through = self.complete_through + + reason = self.reason + + event_time_basis: str = self.event_time_basis + + supported_sources = self.supported_sources + + + + undated_confirmed_events = self.undated_confirmed_events + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "status": status, + "complete_from": complete_from, + "complete_through": complete_through, + "reason": reason, + "event_time_basis": event_time_basis, + "supported_sources": supported_sources, + "undated_confirmed_events": undated_confirmed_events, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + status = check_lavaflow_outcome_coverage_status(d.pop("status")) + + + + + def _parse_complete_from(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + complete_from_type_0 = datetime.datetime.fromisoformat(data) + + + + return complete_from_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + complete_from = _parse_complete_from(d.pop("complete_from")) + + + def _parse_complete_through(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + complete_through_type_0 = datetime.datetime.fromisoformat(data) + + + + return complete_through_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + complete_through = _parse_complete_through(d.pop("complete_through")) + + + reason = d.pop("reason") + + event_time_basis = check_lavaflow_outcome_coverage_event_time_basis(d.pop("event_time_basis")) + + + + + supported_sources = cast(list[str], d.pop("supported_sources")) + + + undated_confirmed_events = d.pop("undated_confirmed_events") + + lavaflow_outcome_coverage = cls( + status=status, + complete_from=complete_from, + complete_through=complete_through, + reason=reason, + event_time_basis=event_time_basis, + supported_sources=supported_sources, + undated_confirmed_events=undated_confirmed_events, + ) + + + lavaflow_outcome_coverage.additional_properties = d + return lavaflow_outcome_coverage + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_outcome_coverage_event_time_basis.py b/src/volcano_sdk/_generated/models/lavaflow_outcome_coverage_event_time_basis.py new file mode 100644 index 00000000..491ebc79 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_outcome_coverage_event_time_basis.py @@ -0,0 +1,10 @@ +from typing import Literal + +LavaflowOutcomeCoverageEventTimeBasis = Literal['confirmed_merge_time', 'first_recorded_live_confirmation', 'recorded_automatic_resolution'] + +LAVAFLOW_OUTCOME_COVERAGE_EVENT_TIME_BASIS_VALUES: set[LavaflowOutcomeCoverageEventTimeBasis] = { 'confirmed_merge_time', 'first_recorded_live_confirmation', 'recorded_automatic_resolution', } + +def check_lavaflow_outcome_coverage_event_time_basis(value: str) -> LavaflowOutcomeCoverageEventTimeBasis: + if value in LAVAFLOW_OUTCOME_COVERAGE_EVENT_TIME_BASIS_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {LAVAFLOW_OUTCOME_COVERAGE_EVENT_TIME_BASIS_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/lavaflow_outcome_coverage_status.py b/src/volcano_sdk/_generated/models/lavaflow_outcome_coverage_status.py new file mode 100644 index 00000000..9c0e9427 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_outcome_coverage_status.py @@ -0,0 +1,10 @@ +from typing import Literal + +LavaflowOutcomeCoverageStatus = Literal['complete', 'partial', 'unavailable'] + +LAVAFLOW_OUTCOME_COVERAGE_STATUS_VALUES: set[LavaflowOutcomeCoverageStatus] = { 'complete', 'partial', 'unavailable', } + +def check_lavaflow_outcome_coverage_status(value: str) -> LavaflowOutcomeCoverageStatus: + if value in LAVAFLOW_OUTCOME_COVERAGE_STATUS_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {LAVAFLOW_OUTCOME_COVERAGE_STATUS_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/lavaflow_outcome_current.py b/src/volcano_sdk/_generated/models/lavaflow_outcome_current.py new file mode 100644 index 00000000..bad4c89e --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_outcome_current.py @@ -0,0 +1,108 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.lavaflow_outcome_current_scope import check_lavaflow_outcome_current_scope +from ..models.lavaflow_outcome_current_scope import LavaflowOutcomeCurrentScope +from typing import cast + + + + + + +T = TypeVar("T", bound="LavaflowOutcomeCurrent") + + + +@_attrs_define +class LavaflowOutcomeCurrent: + """ Current known open critical Code Quality findings, including findings without a fix run. The historical window and + run-category filter do not narrow this inventory. Zero is not an exhaustive security assessment. + + Attributes: + known_open_critical_count (int): + scope (LavaflowOutcomeCurrentScope): + inventory_not_exhaustive (bool): + category_filter_applied (bool): + """ + + known_open_critical_count: int + scope: LavaflowOutcomeCurrentScope + inventory_not_exhaustive: bool + category_filter_applied: bool + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + known_open_critical_count = self.known_open_critical_count + + scope: str = self.scope + + inventory_not_exhaustive = self.inventory_not_exhaustive + + category_filter_applied = self.category_filter_applied + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "known_open_critical_count": known_open_critical_count, + "scope": scope, + "inventory_not_exhaustive": inventory_not_exhaustive, + "category_filter_applied": category_filter_applied, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + known_open_critical_count = d.pop("known_open_critical_count") + + scope = check_lavaflow_outcome_current_scope(d.pop("scope")) + + + + + inventory_not_exhaustive = d.pop("inventory_not_exhaustive") + + category_filter_applied = d.pop("category_filter_applied") + + lavaflow_outcome_current = cls( + known_open_critical_count=known_open_critical_count, + scope=scope, + inventory_not_exhaustive=inventory_not_exhaustive, + category_filter_applied=category_filter_applied, + ) + + + lavaflow_outcome_current.additional_properties = d + return lavaflow_outcome_current + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_outcome_current_scope.py b/src/volcano_sdk/_generated/models/lavaflow_outcome_current_scope.py new file mode 100644 index 00000000..95fad071 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_outcome_current_scope.py @@ -0,0 +1,10 @@ +from typing import Literal + +LavaflowOutcomeCurrentScope = Literal['confirmed_code_quality'] + +LAVAFLOW_OUTCOME_CURRENT_SCOPE_VALUES: set[LavaflowOutcomeCurrentScope] = { 'confirmed_code_quality', } + +def check_lavaflow_outcome_current_scope(value: str) -> LavaflowOutcomeCurrentScope: + if value in LAVAFLOW_OUTCOME_CURRENT_SCOPE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {LAVAFLOW_OUTCOME_CURRENT_SCOPE_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/lavaflow_outcome_day.py b/src/volcano_sdk/_generated/models/lavaflow_outcome_day.py new file mode 100644 index 00000000..2b35ac36 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_outcome_day.py @@ -0,0 +1,112 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast +import datetime + +if TYPE_CHECKING: + from ..models.lavaflow_outcome_counts import LavaflowOutcomeCounts + from ..models.lavaflow_outcome_values import LavaflowOutcomeValues + + + + + +T = TypeVar("T", bound="LavaflowOutcomeDay") + + + +@_attrs_define +class LavaflowOutcomeDay: + """ + Attributes: + date (datetime.date): + counts (LavaflowOutcomeValues): Exact counts only when collection coverage is complete. Null means unknown, + including days with no retained observations. + confirmed_counts (LavaflowOutcomeCounts): Retained confirmations in the requested interval. These are lower + bounds when collection coverage is incomplete. + """ + + date: datetime.date + counts: LavaflowOutcomeValues + confirmed_counts: LavaflowOutcomeCounts + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.lavaflow_outcome_counts import LavaflowOutcomeCounts # noqa: PLC0415 + from ..models.lavaflow_outcome_values import LavaflowOutcomeValues # noqa: PLC0415 + date = self.date.isoformat() + + counts = self.counts.to_dict() + + confirmed_counts = self.confirmed_counts.to_dict() + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "date": date, + "counts": counts, + "confirmed_counts": confirmed_counts, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.lavaflow_outcome_counts import LavaflowOutcomeCounts # noqa: PLC0415 + from ..models.lavaflow_outcome_values import LavaflowOutcomeValues # noqa: PLC0415 + d = dict(src_dict) + date = datetime.date.fromisoformat(d.pop("date")) + + + + + counts = LavaflowOutcomeValues.from_dict(d.pop("counts")) + + + + + confirmed_counts = LavaflowOutcomeCounts.from_dict(d.pop("confirmed_counts")) + + + + + lavaflow_outcome_day = cls( + date=date, + counts=counts, + confirmed_counts=confirmed_counts, + ) + + + lavaflow_outcome_day.additional_properties = d + return lavaflow_outcome_day + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_outcome_values.py b/src/volcano_sdk/_generated/models/lavaflow_outcome_values.py new file mode 100644 index 00000000..c698951d --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_outcome_values.py @@ -0,0 +1,116 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast + + + + + + +T = TypeVar("T", bound="LavaflowOutcomeValues") + + + +@_attrs_define +class LavaflowOutcomeValues: + """ Exact counts only when collection coverage is complete. Null means unknown, including days with no retained + observations. + + Attributes: + pull_requests_merged (int | None): + improvements_observed_live (int | None): + issue_resolutions (int | None): + """ + + pull_requests_merged: int | None + improvements_observed_live: int | None + issue_resolutions: int | None + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + pull_requests_merged: int | None + pull_requests_merged = self.pull_requests_merged + + improvements_observed_live: int | None + improvements_observed_live = self.improvements_observed_live + + issue_resolutions: int | None + issue_resolutions = self.issue_resolutions + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "pull_requests_merged": pull_requests_merged, + "improvements_observed_live": improvements_observed_live, + "issue_resolutions": issue_resolutions, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + def _parse_pull_requests_merged(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + pull_requests_merged = _parse_pull_requests_merged(d.pop("pull_requests_merged")) + + + def _parse_improvements_observed_live(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + improvements_observed_live = _parse_improvements_observed_live(d.pop("improvements_observed_live")) + + + def _parse_issue_resolutions(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + issue_resolutions = _parse_issue_resolutions(d.pop("issue_resolutions")) + + + lavaflow_outcome_values = cls( + pull_requests_merged=pull_requests_merged, + improvements_observed_live=improvements_observed_live, + issue_resolutions=issue_resolutions, + ) + + + lavaflow_outcome_values.additional_properties = d + return lavaflow_outcome_values + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_outcomes.py b/src/volcano_sdk/_generated/models/lavaflow_outcomes.py new file mode 100644 index 00000000..addc7a3b --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_outcomes.py @@ -0,0 +1,175 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast +import datetime + +if TYPE_CHECKING: + from ..models.lavaflow_outcome_counts import LavaflowOutcomeCounts + from ..models.lavaflow_outcome_current import LavaflowOutcomeCurrent + from ..models.lavaflow_outcome_day import LavaflowOutcomeDay + from ..models.lavaflow_outcome_values import LavaflowOutcomeValues + from ..models.lavaflow_outcomes_coverage import LavaflowOutcomesCoverage + + + + + +T = TypeVar("T", bound="LavaflowOutcomes") + + + +@_attrs_define +class LavaflowOutcomes: + """ Separate confirmed merges, live improvements and actual automatic issue-resolution episodes. A live improvement is + counted once per project, repository and pull request when inclusion is first durably confirmed on a tracked + function or frontend. Resolution includes automatic open or ignored to resolved transitions, preserves the reason + and category, and excludes manual actions. The primary issue resolution count includes every category, even when a + category filter narrows merge and live counts. Only the first qualifying automatic resolution of a metric episode + contributes a count. Recurrence and manual reopen start new metric episodes without erasing previous resolutions; + moving resolved to ignored does not start an episode. Existing activity counts remain separate. Older servers omit + this object; absence is unavailable, never zero. + + Attributes: + as_of (datetime.datetime): The UTC timestamp of the consistent database snapshot. + days (list[LavaflowOutcomeDay]): The same ordered UTC date domain as the activity series, with unknown counts + distinct from zero retained confirmations. + totals (LavaflowOutcomeValues): Exact counts only when collection coverage is complete. Null means unknown, + including days with no retained observations. + confirmed_totals (LavaflowOutcomeCounts): Retained confirmations in the requested interval. These are lower + bounds when collection coverage is incomplete. + coverage (LavaflowOutcomesCoverage): + current (LavaflowOutcomeCurrent): Current known open critical Code Quality findings, including findings without + a fix run. The historical window and run-category filter do not narrow this inventory. Zero is not an exhaustive + security assessment. + """ + + as_of: datetime.datetime + days: list[LavaflowOutcomeDay] + totals: LavaflowOutcomeValues + confirmed_totals: LavaflowOutcomeCounts + coverage: LavaflowOutcomesCoverage + current: LavaflowOutcomeCurrent + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.lavaflow_outcome_counts import LavaflowOutcomeCounts # noqa: PLC0415 + from ..models.lavaflow_outcome_current import LavaflowOutcomeCurrent # noqa: PLC0415 + from ..models.lavaflow_outcome_day import LavaflowOutcomeDay # noqa: PLC0415 + from ..models.lavaflow_outcome_values import LavaflowOutcomeValues # noqa: PLC0415 + from ..models.lavaflow_outcomes_coverage import LavaflowOutcomesCoverage # noqa: PLC0415 + as_of = self.as_of.isoformat() + + days = [] + for days_item_data in self.days: + days_item = days_item_data.to_dict() + days.append(days_item) + + + + totals = self.totals.to_dict() + + confirmed_totals = self.confirmed_totals.to_dict() + + coverage = self.coverage.to_dict() + + current = self.current.to_dict() + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "as_of": as_of, + "days": days, + "totals": totals, + "confirmed_totals": confirmed_totals, + "coverage": coverage, + "current": current, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.lavaflow_outcome_counts import LavaflowOutcomeCounts # noqa: PLC0415 + from ..models.lavaflow_outcome_current import LavaflowOutcomeCurrent # noqa: PLC0415 + from ..models.lavaflow_outcome_day import LavaflowOutcomeDay # noqa: PLC0415 + from ..models.lavaflow_outcome_values import LavaflowOutcomeValues # noqa: PLC0415 + from ..models.lavaflow_outcomes_coverage import LavaflowOutcomesCoverage # noqa: PLC0415 + d = dict(src_dict) + as_of = datetime.datetime.fromisoformat(d.pop("as_of")) + + + + + days = [] + _days = d.pop("days") + for days_item_data in (_days): + days_item = LavaflowOutcomeDay.from_dict(days_item_data) + + + + days.append(days_item) + + + totals = LavaflowOutcomeValues.from_dict(d.pop("totals")) + + + + + confirmed_totals = LavaflowOutcomeCounts.from_dict(d.pop("confirmed_totals")) + + + + + coverage = LavaflowOutcomesCoverage.from_dict(d.pop("coverage")) + + + + + current = LavaflowOutcomeCurrent.from_dict(d.pop("current")) + + + + + lavaflow_outcomes = cls( + as_of=as_of, + days=days, + totals=totals, + confirmed_totals=confirmed_totals, + coverage=coverage, + current=current, + ) + + + lavaflow_outcomes.additional_properties = d + return lavaflow_outcomes + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_outcomes_coverage.py b/src/volcano_sdk/_generated/models/lavaflow_outcomes_coverage.py new file mode 100644 index 00000000..ce34352f --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_outcomes_coverage.py @@ -0,0 +1,112 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast + +if TYPE_CHECKING: + from ..models.lavaflow_outcome_coverage import LavaflowOutcomeCoverage + + + + + +T = TypeVar("T", bound="LavaflowOutcomesCoverage") + + + +@_attrs_define +class LavaflowOutcomesCoverage: + """ + Attributes: + pull_requests_merged (LavaflowOutcomeCoverage): Collection coverage for one metric. A migration or the earliest + retained event establishes no complete interval. Undated observations are not assigned to the requested dates or + totals. + improvements_observed_live (LavaflowOutcomeCoverage): Collection coverage for one metric. A migration or the + earliest retained event establishes no complete interval. Undated observations are not assigned to the requested + dates or totals. + issue_resolutions (LavaflowOutcomeCoverage): Collection coverage for one metric. A migration or the earliest + retained event establishes no complete interval. Undated observations are not assigned to the requested dates or + totals. + """ + + pull_requests_merged: LavaflowOutcomeCoverage + improvements_observed_live: LavaflowOutcomeCoverage + issue_resolutions: LavaflowOutcomeCoverage + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.lavaflow_outcome_coverage import LavaflowOutcomeCoverage # noqa: PLC0415 + pull_requests_merged = self.pull_requests_merged.to_dict() + + improvements_observed_live = self.improvements_observed_live.to_dict() + + issue_resolutions = self.issue_resolutions.to_dict() + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "pull_requests_merged": pull_requests_merged, + "improvements_observed_live": improvements_observed_live, + "issue_resolutions": issue_resolutions, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.lavaflow_outcome_coverage import LavaflowOutcomeCoverage # noqa: PLC0415 + d = dict(src_dict) + pull_requests_merged = LavaflowOutcomeCoverage.from_dict(d.pop("pull_requests_merged")) + + + + + improvements_observed_live = LavaflowOutcomeCoverage.from_dict(d.pop("improvements_observed_live")) + + + + + issue_resolutions = LavaflowOutcomeCoverage.from_dict(d.pop("issue_resolutions")) + + + + + lavaflow_outcomes_coverage = cls( + pull_requests_merged=pull_requests_merged, + improvements_observed_live=improvements_observed_live, + issue_resolutions=issue_resolutions, + ) + + + lavaflow_outcomes_coverage.additional_properties = d + return lavaflow_outcomes_coverage + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_project_issue.py b/src/volcano_sdk/_generated/models/lavaflow_project_issue.py new file mode 100644 index 00000000..4d366a00 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_project_issue.py @@ -0,0 +1,215 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.issue_source import check_issue_source +from ..models.issue_source import IssueSource +from ..models.lavaflow_project_issue_state import check_lavaflow_project_issue_state +from ..models.lavaflow_project_issue_state import LavaflowProjectIssueState +from ..types import UNSET, Unset +from typing import cast +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.lavaflow_resource_reference import LavaflowResourceReference + + + + + +T = TypeVar("T", bound="LavaflowProjectIssue") + + + +@_attrs_define +class LavaflowProjectIssue: + """ An issue LavaFlow has taken on, or a written request waiting for its first run. + + Attributes: + id (UUID): + project_id (UUID): + title (str): + resource (LavaflowResourceReference): A function, durable function or frontend in the project, or the project of + a user-reported problem. + activity_at (datetime.datetime): + state (LavaflowProjectIssueState): + description (str | Unset): The text of a written request. + slack_thread_url (str | Unset): A link to the original Slack thread when its source record is available. + source (IssueSource | Unset): Where the issue came from: `runtime` for errors your code logged, `code_quality` + for a LavaFlow Code Quality finding in code a deploy changed, `build` for deploys of one function or frontend + that failed in its own build step, `report` for a problem reported for the project, such as through Slack, or + `request` for an issue a person wrote with `POST /issues`. A later deploy that builds resolves a `build` issue. + Deploys Volcano failed, such as a timeout or a refused build, never make one. + run_id (UUID | Unset): The latest run for this issue. + latest_activity (str | Unset): Latest action in the active run. + """ + + id: UUID + project_id: UUID + title: str + resource: LavaflowResourceReference + activity_at: datetime.datetime + state: LavaflowProjectIssueState + description: str | Unset = UNSET + slack_thread_url: str | Unset = UNSET + source: IssueSource | Unset = UNSET + run_id: UUID | Unset = UNSET + latest_activity: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.lavaflow_resource_reference import LavaflowResourceReference # noqa: PLC0415 + id = str(self.id) + + project_id = str(self.project_id) + + title = self.title + + resource = self.resource.to_dict() + + activity_at = self.activity_at.isoformat() + + state: str = self.state + + description = self.description + + slack_thread_url = self.slack_thread_url + + source: str | Unset = UNSET + if not isinstance(self.source, Unset): + source = self.source + + + run_id: str | Unset = UNSET + if not isinstance(self.run_id, Unset): + run_id = str(self.run_id) + + latest_activity = self.latest_activity + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "id": id, + "project_id": project_id, + "title": title, + "resource": resource, + "activity_at": activity_at, + "state": state, + }) + if description is not UNSET: + field_dict["description"] = description + if slack_thread_url is not UNSET: + field_dict["slack_thread_url"] = slack_thread_url + if source is not UNSET: + field_dict["source"] = source + if run_id is not UNSET: + field_dict["run_id"] = run_id + if latest_activity is not UNSET: + field_dict["latest_activity"] = latest_activity + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.lavaflow_resource_reference import LavaflowResourceReference # noqa: PLC0415 + d = dict(src_dict) + id = UUID(d.pop("id")) + + + + + project_id = UUID(d.pop("project_id")) + + + + + title = d.pop("title") + + resource = LavaflowResourceReference.from_dict(d.pop("resource")) + + + + + activity_at = datetime.datetime.fromisoformat(d.pop("activity_at")) + + + + + state = check_lavaflow_project_issue_state(d.pop("state")) + + + + + description = d.pop("description", UNSET) + + slack_thread_url = d.pop("slack_thread_url", UNSET) + + _source = d.pop("source", UNSET) + source: IssueSource | Unset + if isinstance(_source, Unset): + source = UNSET + else: + source = check_issue_source(_source) + + + + + _run_id = d.pop("run_id", UNSET) + run_id: UUID | Unset + if isinstance(_run_id, Unset): + run_id = UNSET + else: + run_id = UUID(_run_id) + + + + + latest_activity = d.pop("latest_activity", UNSET) + + lavaflow_project_issue = cls( + id=id, + project_id=project_id, + title=title, + resource=resource, + activity_at=activity_at, + state=state, + description=description, + slack_thread_url=slack_thread_url, + source=source, + run_id=run_id, + latest_activity=latest_activity, + ) + + + lavaflow_project_issue.additional_properties = d + return lavaflow_project_issue + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_project_issue_state.py b/src/volcano_sdk/_generated/models/lavaflow_project_issue_state.py new file mode 100644 index 00000000..1ea04209 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_project_issue_state.py @@ -0,0 +1,10 @@ +from typing import Literal + +LavaflowProjectIssueState = Literal['awaiting_pickup', 'cancelled', 'diagnosis_complete', 'failed', 'fix_merged', 'fix_unavailable', 'fixing', 'ignored', 'investigating', 'merge_queued', 'needs_review', 'pull_request_closed', 'queued', 'resolved', 'reviewing', 'waiting_for_approval', 'waiting_for_checks'] + +LAVAFLOW_PROJECT_ISSUE_STATE_VALUES: set[LavaflowProjectIssueState] = { 'awaiting_pickup', 'cancelled', 'diagnosis_complete', 'failed', 'fix_merged', 'fix_unavailable', 'fixing', 'ignored', 'investigating', 'merge_queued', 'needs_review', 'pull_request_closed', 'queued', 'resolved', 'reviewing', 'waiting_for_approval', 'waiting_for_checks', } + +def check_lavaflow_project_issue_state(value: str) -> LavaflowProjectIssueState: + if value in LAVAFLOW_PROJECT_ISSUE_STATE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {LAVAFLOW_PROJECT_ISSUE_STATE_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/lavaflow_pull_request.py b/src/volcano_sdk/_generated/models/lavaflow_pull_request.py new file mode 100644 index 00000000..c047132e --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_pull_request.py @@ -0,0 +1,247 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.lavaflow_draft_reason import check_lavaflow_draft_reason +from ..models.lavaflow_draft_reason import LavaflowDraftReason +from ..models.lavaflow_pull_request_state import check_lavaflow_pull_request_state +from ..models.lavaflow_pull_request_state import LavaflowPullRequestState +from ..types import UNSET, Unset +from typing import cast +import datetime + + + + + + +T = TypeVar("T", bound="LavaflowPullRequest") + + + +@_attrs_define +class LavaflowPullRequest: + """ + Attributes: + number (int): + url (str): + state (LavaflowPullRequestState): + opened_at (datetime.datetime | None): When the run opened the pull request, null for one opened before LavaFlow + recorded the time. + merged_at (datetime.datetime | None): When the pull request merged; null unless `state` is `merged`. + deployed_at (datetime.datetime | None): When the merged fix went live: the first live deployment of the issue's + resource that includes it finished. When more than 20 deployments went live between the merge and the one + LavaFlow found the fix in, LavaFlow can't tell which first included it, and this is the merge time. Null until + LavaFlow finds the fix live, and for a pull request that didn't merge. A later live deployment can be verified + even more than a week after the merge. Unverifiable or exhausted evidence remains unknown. + draft (bool | None): Whether the pull request is a draft, as GitHub last reported it to LavaFlow. Null for one + opened before LavaFlow recorded it. + draft_reason (LavaflowDraftReason | None): Why a finished run's pull request is a draft. Null while the run is + still reviewing its initial draft, or when `draft` is not true. + branch (str | Unset): The recorded pull request branch. Omitted when it was not recorded, the run's fix is + withheld because it may add a credential, or the branch name holds one of the project's secret values or a + secret gitleaks detects. It is never shortened. + """ + + number: int + url: str + state: LavaflowPullRequestState + opened_at: datetime.datetime | None + merged_at: datetime.datetime | None + deployed_at: datetime.datetime | None + draft: bool | None + draft_reason: LavaflowDraftReason | None + branch: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + number = self.number + + url = self.url + + state: str = self.state + + opened_at: None | str + if isinstance(self.opened_at, datetime.datetime): + opened_at = self.opened_at.isoformat() + else: + opened_at = self.opened_at + + merged_at: None | str + if isinstance(self.merged_at, datetime.datetime): + merged_at = self.merged_at.isoformat() + else: + merged_at = self.merged_at + + deployed_at: None | str + if isinstance(self.deployed_at, datetime.datetime): + deployed_at = self.deployed_at.isoformat() + else: + deployed_at = self.deployed_at + + draft: bool | None + draft = self.draft + + draft_reason: None | str + if isinstance(self.draft_reason, str): + draft_reason = self.draft_reason + else: + draft_reason = self.draft_reason + + branch = self.branch + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "number": number, + "url": url, + "state": state, + "opened_at": opened_at, + "merged_at": merged_at, + "deployed_at": deployed_at, + "draft": draft, + "draft_reason": draft_reason, + }) + if branch is not UNSET: + field_dict["branch"] = branch + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + number = d.pop("number") + + url = d.pop("url") + + state = check_lavaflow_pull_request_state(d.pop("state")) + + + + + def _parse_opened_at(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + opened_at_type_0 = datetime.datetime.fromisoformat(data) + + + + return opened_at_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + opened_at = _parse_opened_at(d.pop("opened_at")) + + + def _parse_merged_at(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + merged_at_type_0 = datetime.datetime.fromisoformat(data) + + + + return merged_at_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + merged_at = _parse_merged_at(d.pop("merged_at")) + + + def _parse_deployed_at(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + deployed_at_type_0 = datetime.datetime.fromisoformat(data) + + + + return deployed_at_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + deployed_at = _parse_deployed_at(d.pop("deployed_at")) + + + def _parse_draft(data: object) -> bool | None: + if data is None: + return data + return cast(bool | None, data) + + draft = _parse_draft(d.pop("draft")) + + + def _parse_draft_reason(data: object) -> LavaflowDraftReason | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + draft_reason_type_1 = check_lavaflow_draft_reason(data) + + + + return draft_reason_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(LavaflowDraftReason | None, data) + + draft_reason = _parse_draft_reason(d.pop("draft_reason")) + + + branch = d.pop("branch", UNSET) + + lavaflow_pull_request = cls( + number=number, + url=url, + state=state, + opened_at=opened_at, + merged_at=merged_at, + deployed_at=deployed_at, + draft=draft, + draft_reason=draft_reason, + branch=branch, + ) + + + lavaflow_pull_request.additional_properties = d + return lavaflow_pull_request + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_pull_request_state.py b/src/volcano_sdk/_generated/models/lavaflow_pull_request_state.py new file mode 100644 index 00000000..fb42c5cf --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_pull_request_state.py @@ -0,0 +1,10 @@ +from typing import Literal + +LavaflowPullRequestState = Literal['closed', 'merged', 'open'] + +LAVAFLOW_PULL_REQUEST_STATE_VALUES: set[LavaflowPullRequestState] = { 'closed', 'merged', 'open', } + +def check_lavaflow_pull_request_state(value: str) -> LavaflowPullRequestState: + if value in LAVAFLOW_PULL_REQUEST_STATE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {LAVAFLOW_PULL_REQUEST_STATE_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/lavaflow_pull_request_state_counts.py b/src/volcano_sdk/_generated/models/lavaflow_pull_request_state_counts.py new file mode 100644 index 00000000..64119ab9 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_pull_request_state_counts.py @@ -0,0 +1,101 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="LavaflowPullRequestStateCounts") + + + +@_attrs_define +class LavaflowPullRequestStateCounts: + """ Matching runs by the state of their pull request, zeros included. `none` counts runs without one. + + Attributes: + open_ (int): + merged (int): + closed (int): + none (int): + """ + + open_: int + merged: int + closed: int + none: int + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + open_ = self.open_ + + merged = self.merged + + closed = self.closed + + none = self.none + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "open": open_, + "merged": merged, + "closed": closed, + "none": none, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + open_ = d.pop("open") + + merged = d.pop("merged") + + closed = d.pop("closed") + + none = d.pop("none") + + lavaflow_pull_request_state_counts = cls( + open_=open_, + merged=merged, + closed=closed, + none=none, + ) + + + lavaflow_pull_request_state_counts.additional_properties = d + return lavaflow_pull_request_state_counts + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_repository_check_command.py b/src/volcano_sdk/_generated/models/lavaflow_repository_check_command.py new file mode 100644 index 00000000..634ef9d0 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_repository_check_command.py @@ -0,0 +1,117 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset +from typing import cast + + + + + + +T = TypeVar("T", bound="LavaflowRepositoryCheckCommand") + + + +@_attrs_define +class LavaflowRepositoryCheckCommand: + """ One command the repository's checks ran. `command` and `output` are the repository's own text, served as LavaFlow + recorded it. Each reads `Hidden: this field matched a secret.` when it holds one of the project's secret values or a + secret gitleaks detects, and `Hidden: the fix may add a credential.` when the run is held with + `possible_credential`. + + Attributes: + command (str): The command as LavaFlow ran it. + status (str): `passed`: the command succeeded. `failed`: it exited with an error. `timed_out`: it ran past its + time limit, and LavaFlow stopped it. Treat a status you don't know as `failed`. + exit_code (int | None): The code the command exited with, null when it gave none, as a command that timed out + may not. + output (str | Unset): The end of what the command printed, present only when `status` is `failed` or `timed_out` + and LavaFlow kept it; `""` when it printed nothing. + """ + + command: str + status: str + exit_code: int | None + output: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + command = self.command + + status = self.status + + exit_code: int | None + exit_code = self.exit_code + + output = self.output + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "command": command, + "status": status, + "exit_code": exit_code, + }) + if output is not UNSET: + field_dict["output"] = output + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + command = d.pop("command") + + status = d.pop("status") + + def _parse_exit_code(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + exit_code = _parse_exit_code(d.pop("exit_code")) + + + output = d.pop("output", UNSET) + + lavaflow_repository_check_command = cls( + command=command, + status=status, + exit_code=exit_code, + output=output, + ) + + + lavaflow_repository_check_command.additional_properties = d + return lavaflow_repository_check_command + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_repository_checks.py b/src/volcano_sdk/_generated/models/lavaflow_repository_checks.py new file mode 100644 index 00000000..2dede443 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_repository_checks.py @@ -0,0 +1,155 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.lavaflow_repository_check_command import LavaflowRepositoryCheckCommand + + + + + +T = TypeVar("T", bound="LavaflowRepositoryChecks") + + + +@_attrs_define +class LavaflowRepositoryChecks: + """ Whether LavaFlow ran the repository's own checks, such as its tests, on a fix itself, before it opened a pull + request or held the fix, and what they found. When LavaFlow ran them more than once, this is the last time the run's + last attempt ran them; `not_run` when that attempt didn't, or while the run is queued or running. CI that runs on + the pull request afterwards is the repository's own. + + Attributes: + status (str): `passed`: every command the checks ran passed. `failed`: a command failed or timed out; `commands` + shows which. `no_checks_found`: LavaFlow found no checks in the repository to run. `not_run`: LavaFlow did not + run the repository's checks on the fix, for the reason `reason` names. Treat a status you don't know as + `not_run`. + message (str): Text to show for the status and reason. It names the pull request when one opened. For `not_run` + on a fix whose pull request opened, a second sentence says what became of the repository's CI there, as the run + stands when read: whether LavaFlow started it, tried to, may still, or won't. + reason (str | Unset): Stable code for why the checks did not run, present only when `status` is `not_run`. + `dependencies_changed`: the fix changes the repository's dependencies. `dependencies_not_installed`: LavaFlow + couldn't install the repository's dependencies. `run_deadline`: the run reached its time limit. + `sandbox_capacity`: no sandbox slot was free in time to run them. `sandbox_budget`: LavaFlow's sandbox allowance + for checks was used up. `sandbox_not_isolated`: LavaFlow couldn't confirm the sandbox was isolated. + `sandbox_plan_limit`: LavaFlow couldn't start a sandbox large enough to run them. `sandbox_unavailable`: + LavaFlow couldn't run them itself. `source_too_large`: the repository is too large to copy into a sandbox. + `source_unavailable`: LavaFlow couldn't fetch the fix's source to check it, as when the repository was + disconnected or changed during the run. `tool_unavailable`: a tool the checks need isn't available. New reasons + may appear; treat one you don't know like any other `not_run`. + revised (bool | Unset): Present and `true` only when `status` is `failed` and LavaFlow then revised the fix once + without running the checks again. `status` and `commands` describe that earlier version, not the fix as saved, + which the checks never ran on. + commands (list[LavaflowRepositoryCheckCommand] | Unset): The commands the checks ran, in order. Absent when + LavaFlow recorded none, as for `no_checks_found` and `not_run`. + """ + + status: str + message: str + reason: str | Unset = UNSET + revised: bool | Unset = UNSET + commands: list[LavaflowRepositoryCheckCommand] | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.lavaflow_repository_check_command import LavaflowRepositoryCheckCommand # noqa: PLC0415 + status = self.status + + message = self.message + + reason = self.reason + + revised = self.revised + + commands: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.commands, Unset): + commands = [] + for commands_item_data in self.commands: + commands_item = commands_item_data.to_dict() + commands.append(commands_item) + + + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "status": status, + "message": message, + }) + if reason is not UNSET: + field_dict["reason"] = reason + if revised is not UNSET: + field_dict["revised"] = revised + if commands is not UNSET: + field_dict["commands"] = commands + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.lavaflow_repository_check_command import LavaflowRepositoryCheckCommand # noqa: PLC0415 + d = dict(src_dict) + status = d.pop("status") + + message = d.pop("message") + + reason = d.pop("reason", UNSET) + + revised = d.pop("revised", UNSET) + + _commands = d.pop("commands", UNSET) + commands: list[LavaflowRepositoryCheckCommand] | Unset = UNSET + if _commands is not UNSET: + commands = [] + for commands_item_data in _commands: + commands_item = LavaflowRepositoryCheckCommand.from_dict(commands_item_data) + + + + commands.append(commands_item) + + + lavaflow_repository_checks = cls( + status=status, + message=message, + reason=reason, + revised=revised, + commands=commands, + ) + + + lavaflow_repository_checks.additional_properties = d + return lavaflow_repository_checks + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_repository_expectation.py b/src/volcano_sdk/_generated/models/lavaflow_repository_expectation.py new file mode 100644 index 00000000..8de036d7 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_repository_expectation.py @@ -0,0 +1,68 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="LavaflowRepositoryExpectation") + + + +@_attrs_define +class LavaflowRepositoryExpectation: + """ The repository connection the caller expects. This is a save precondition, not an instruction to change the + connection. + + Attributes: + repo_id (int): + repo_installation_id (int): + """ + + repo_id: int + repo_installation_id: int + + + + + + def to_dict(self) -> dict[str, Any]: + repo_id = self.repo_id + + repo_installation_id = self.repo_installation_id + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "repo_id": repo_id, + "repo_installation_id": repo_installation_id, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + repo_id = d.pop("repo_id") + + repo_installation_id = d.pop("repo_installation_id") + + lavaflow_repository_expectation = cls( + repo_id=repo_id, + repo_installation_id=repo_installation_id, + ) + + return lavaflow_repository_expectation + diff --git a/src/volcano_sdk/_generated/models/lavaflow_resource.py b/src/volcano_sdk/_generated/models/lavaflow_resource.py new file mode 100644 index 00000000..e2f91d29 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_resource.py @@ -0,0 +1,156 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.lavaflow_anomaly import LavaflowAnomaly + from ..models.lavaflow_resource_reference import LavaflowResourceReference + + + + + +T = TypeVar("T", bound="LavaflowResource") + + + +@_attrs_define +class LavaflowResource: + """ + Attributes: + project_id (UUID): The project the resource belongs to. + resource (LavaflowResourceReference): A function, durable function or frontend in the project, or the project of + a user-reported problem. + last_analyzed_at (datetime.datetime | None): When a LavaFlow run last started on the resource, null if never. + issues_opened (int): Issues LavaFlow took on in the window. + pull_requests_opened (int): Pull requests with a fix LavaFlow opened in the window. + anomaly (LavaflowAnomaly): + """ + + project_id: UUID + resource: LavaflowResourceReference + last_analyzed_at: datetime.datetime | None + issues_opened: int + pull_requests_opened: int + anomaly: LavaflowAnomaly + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.lavaflow_anomaly import LavaflowAnomaly # noqa: PLC0415 + from ..models.lavaflow_resource_reference import LavaflowResourceReference # noqa: PLC0415 + project_id = str(self.project_id) + + resource = self.resource.to_dict() + + last_analyzed_at: None | str + if isinstance(self.last_analyzed_at, datetime.datetime): + last_analyzed_at = self.last_analyzed_at.isoformat() + else: + last_analyzed_at = self.last_analyzed_at + + issues_opened = self.issues_opened + + pull_requests_opened = self.pull_requests_opened + + anomaly = self.anomaly.to_dict() + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "project_id": project_id, + "resource": resource, + "last_analyzed_at": last_analyzed_at, + "issues_opened": issues_opened, + "pull_requests_opened": pull_requests_opened, + "anomaly": anomaly, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.lavaflow_anomaly import LavaflowAnomaly # noqa: PLC0415 + from ..models.lavaflow_resource_reference import LavaflowResourceReference # noqa: PLC0415 + d = dict(src_dict) + project_id = UUID(d.pop("project_id")) + + + + + resource = LavaflowResourceReference.from_dict(d.pop("resource")) + + + + + def _parse_last_analyzed_at(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + last_analyzed_at_type_0 = datetime.datetime.fromisoformat(data) + + + + return last_analyzed_at_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + last_analyzed_at = _parse_last_analyzed_at(d.pop("last_analyzed_at")) + + + issues_opened = d.pop("issues_opened") + + pull_requests_opened = d.pop("pull_requests_opened") + + anomaly = LavaflowAnomaly.from_dict(d.pop("anomaly")) + + + + + lavaflow_resource = cls( + project_id=project_id, + resource=resource, + last_analyzed_at=last_analyzed_at, + issues_opened=issues_opened, + pull_requests_opened=pull_requests_opened, + anomaly=anomaly, + ) + + + lavaflow_resource.additional_properties = d + return lavaflow_resource + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_resource_list.py b/src/volcano_sdk/_generated/models/lavaflow_resource_list.py new file mode 100644 index 00000000..6ae7e9c9 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_resource_list.py @@ -0,0 +1,94 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast + +if TYPE_CHECKING: + from ..models.lavaflow_resource import LavaflowResource + + + + + +T = TypeVar("T", bound="LavaflowResourceList") + + + +@_attrs_define +class LavaflowResourceList: + """ + Attributes: + data (list[LavaflowResource]): + """ + + data: list[LavaflowResource] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.lavaflow_resource import LavaflowResource # noqa: PLC0415 + data = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "data": data, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.lavaflow_resource import LavaflowResource # noqa: PLC0415 + d = dict(src_dict) + data = [] + _data = d.pop("data") + for data_item_data in (_data): + data_item = LavaflowResource.from_dict(data_item_data) + + + + data.append(data_item) + + + lavaflow_resource_list = cls( + data=data, + ) + + + lavaflow_resource_list.additional_properties = d + return lavaflow_resource_list + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_resource_reference.py b/src/volcano_sdk/_generated/models/lavaflow_resource_reference.py new file mode 100644 index 00000000..b2ded67c --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_resource_reference.py @@ -0,0 +1,103 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.lavaflow_resource_reference_type import check_lavaflow_resource_reference_type +from ..models.lavaflow_resource_reference_type import LavaflowResourceReferenceType +from typing import cast +from uuid import UUID + + + + + + +T = TypeVar("T", bound="LavaflowResourceReference") + + + +@_attrs_define +class LavaflowResourceReference: + """ A function, durable function or frontend in the project, or the project of a user-reported problem. + + Attributes: + type_ (LavaflowResourceReferenceType): + id (UUID): + name (str): + """ + + type_: LavaflowResourceReferenceType + id: UUID + name: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + type_: str = self.type_ + + id = str(self.id) + + name = self.name + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "type": type_, + "id": id, + "name": name, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + type_ = check_lavaflow_resource_reference_type(d.pop("type")) + + + + + id = UUID(d.pop("id")) + + + + + name = d.pop("name") + + lavaflow_resource_reference = cls( + type_=type_, + id=id, + name=name, + ) + + + lavaflow_resource_reference.additional_properties = d + return lavaflow_resource_reference + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_resource_reference_type.py b/src/volcano_sdk/_generated/models/lavaflow_resource_reference_type.py new file mode 100644 index 00000000..2155be4e --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_resource_reference_type.py @@ -0,0 +1,10 @@ +from typing import Literal + +LavaflowResourceReferenceType = Literal['durable_function', 'frontend', 'function', 'project'] + +LAVAFLOW_RESOURCE_REFERENCE_TYPE_VALUES: set[LavaflowResourceReferenceType] = { 'durable_function', 'frontend', 'function', 'project', } + +def check_lavaflow_resource_reference_type(value: str) -> LavaflowResourceReferenceType: + if value in LAVAFLOW_RESOURCE_REFERENCE_TYPE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {LAVAFLOW_RESOURCE_REFERENCE_TYPE_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/lavaflow_review.py b/src/volcano_sdk/_generated/models/lavaflow_review.py new file mode 100644 index 00000000..40b0b43e --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_review.py @@ -0,0 +1,205 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.lavaflow_review_stop import check_lavaflow_review_stop +from ..models.lavaflow_review_stop import LavaflowReviewStop +from ..models.lavaflow_review_verdict import check_lavaflow_review_verdict +from ..models.lavaflow_review_verdict import LavaflowReviewVerdict +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.lavaflow_review_finding import LavaflowReviewFinding + from ..models.lavaflow_review_person_reason import LavaflowReviewPersonReason + + + + + +T = TypeVar("T", bound="LavaflowReview") + + + +@_attrs_define +class LavaflowReview: + """ + Attributes: + verdict (LavaflowReviewVerdict): The last review round's verdict. `blocked` means a critical or major finding + stops the fix; `changes_requested` means only minor findings do; `error` means a reviewer failed without a + blocking finding, or no reviewer could run. + rounds (int): The review rounds that ran, 0 when no reviewer could run. + stopped (LavaflowReviewStop | None): Why the review ended without passing the fix, null when it passed the fix + or when the run saved no fix. + open_findings (list[LavaflowReviewFinding] | Unset): The findings the review saved with the fix left open. When + the review passed the fix, the notes its last round left: findings below `major` that a later round no longer + sends back, which hold a fix under `autonomy: merge` with `review_notes`. Absent when the review left none open, + or the run saved no fix. + person_reasons (list[LavaflowReviewPersonReason] | Unset): What the review saved with the fix asks a person to + decide before the fix merges. Absent when it asks nothing or the run saved no fix. + observations (list[str] | Unset): The reviewers' observations on the fix saved with the run: follow-ups that + don't hold the fix, such as bad data stored before it or a related problem elsewhere. They aren't findings, + unlike a minor finding that blocks nothing. Each reads `Hidden: this field matched a secret.` when it holds one + of the project's secret values or a secret gitleaks detects, and `Hidden: the fix may add a credential.` when + the run is held with `possible_credential`. Absent when there are none or the run saved no fix. + """ + + verdict: LavaflowReviewVerdict + rounds: int + stopped: LavaflowReviewStop | None + open_findings: list[LavaflowReviewFinding] | Unset = UNSET + person_reasons: list[LavaflowReviewPersonReason] | Unset = UNSET + observations: list[str] | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.lavaflow_review_finding import LavaflowReviewFinding # noqa: PLC0415 + from ..models.lavaflow_review_person_reason import LavaflowReviewPersonReason # noqa: PLC0415 + verdict: str = self.verdict + + rounds = self.rounds + + stopped: None | str + if isinstance(self.stopped, str): + stopped = self.stopped + else: + stopped = self.stopped + + open_findings: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.open_findings, Unset): + open_findings = [] + for open_findings_item_data in self.open_findings: + open_findings_item = open_findings_item_data.to_dict() + open_findings.append(open_findings_item) + + + + person_reasons: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.person_reasons, Unset): + person_reasons = [] + for person_reasons_item_data in self.person_reasons: + person_reasons_item = person_reasons_item_data.to_dict() + person_reasons.append(person_reasons_item) + + + + observations: list[str] | Unset = UNSET + if not isinstance(self.observations, Unset): + observations = self.observations + + + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "verdict": verdict, + "rounds": rounds, + "stopped": stopped, + }) + if open_findings is not UNSET: + field_dict["open_findings"] = open_findings + if person_reasons is not UNSET: + field_dict["person_reasons"] = person_reasons + if observations is not UNSET: + field_dict["observations"] = observations + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.lavaflow_review_finding import LavaflowReviewFinding # noqa: PLC0415 + from ..models.lavaflow_review_person_reason import LavaflowReviewPersonReason # noqa: PLC0415 + d = dict(src_dict) + verdict = check_lavaflow_review_verdict(d.pop("verdict")) + + + + + rounds = d.pop("rounds") + + def _parse_stopped(data: object) -> LavaflowReviewStop | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + stopped_type_1 = check_lavaflow_review_stop(data) + + + + return stopped_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(LavaflowReviewStop | None, data) + + stopped = _parse_stopped(d.pop("stopped")) + + + _open_findings = d.pop("open_findings", UNSET) + open_findings: list[LavaflowReviewFinding] | Unset = UNSET + if _open_findings is not UNSET: + open_findings = [] + for open_findings_item_data in _open_findings: + open_findings_item = LavaflowReviewFinding.from_dict(open_findings_item_data) + + + + open_findings.append(open_findings_item) + + + _person_reasons = d.pop("person_reasons", UNSET) + person_reasons: list[LavaflowReviewPersonReason] | Unset = UNSET + if _person_reasons is not UNSET: + person_reasons = [] + for person_reasons_item_data in _person_reasons: + person_reasons_item = LavaflowReviewPersonReason.from_dict(person_reasons_item_data) + + + + person_reasons.append(person_reasons_item) + + + observations = cast(list[str], d.pop("observations", UNSET)) + + + lavaflow_review = cls( + verdict=verdict, + rounds=rounds, + stopped=stopped, + open_findings=open_findings, + person_reasons=person_reasons, + observations=observations, + ) + + + lavaflow_review.additional_properties = d + return lavaflow_review + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_review_finding.py b/src/volcano_sdk/_generated/models/lavaflow_review_finding.py new file mode 100644 index 00000000..e711dbbd --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_review_finding.py @@ -0,0 +1,124 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.lavaflow_review_finding_severity import check_lavaflow_review_finding_severity +from ..models.lavaflow_review_finding_severity import LavaflowReviewFindingSeverity +from typing import cast + + + + + + +T = TypeVar("T", bound="LavaflowReviewFinding") + + + +@_attrs_define +class LavaflowReviewFinding: + """ A finding the review left open, in the reviewer's words. `explanation` reads `Hidden: this field matched a secret.` + when it holds one of the project's secret values or a secret gitleaks detects, or when `file` reads `""`, and + `Hidden: the fix may add a credential.` when the run is held with `possible_credential`. + + Attributes: + severity (LavaflowReviewFindingSeverity): + file (None | str): The file the finding is about, null when it is about no file. `""` when the path holds a + control character, one of the project's secret values or a secret gitleaks detects. + line (int | None): The line of `file` the finding is about, null when it is about no one line. + explanation (str): + """ + + severity: LavaflowReviewFindingSeverity + file: None | str + line: int | None + explanation: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + severity: str = self.severity + + file: None | str + file = self.file + + line: int | None + line = self.line + + explanation = self.explanation + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "severity": severity, + "file": file, + "line": line, + "explanation": explanation, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + severity = check_lavaflow_review_finding_severity(d.pop("severity")) + + + + + def _parse_file(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + file = _parse_file(d.pop("file")) + + + def _parse_line(data: object) -> int | None: + if data is None: + return data + return cast(int | None, data) + + line = _parse_line(d.pop("line")) + + + explanation = d.pop("explanation") + + lavaflow_review_finding = cls( + severity=severity, + file=file, + line=line, + explanation=explanation, + ) + + + lavaflow_review_finding.additional_properties = d + return lavaflow_review_finding + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_review_finding_severity.py b/src/volcano_sdk/_generated/models/lavaflow_review_finding_severity.py new file mode 100644 index 00000000..fd9f71d1 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_review_finding_severity.py @@ -0,0 +1,10 @@ +from typing import Literal + +LavaflowReviewFindingSeverity = Literal['critical', 'major', 'minor', 'nit'] + +LAVAFLOW_REVIEW_FINDING_SEVERITY_VALUES: set[LavaflowReviewFindingSeverity] = { 'critical', 'major', 'minor', 'nit', } + +def check_lavaflow_review_finding_severity(value: str) -> LavaflowReviewFindingSeverity: + if value in LAVAFLOW_REVIEW_FINDING_SEVERITY_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {LAVAFLOW_REVIEW_FINDING_SEVERITY_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/lavaflow_review_person_reason.py b/src/volcano_sdk/_generated/models/lavaflow_review_person_reason.py new file mode 100644 index 00000000..4e7ac0c1 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_review_person_reason.py @@ -0,0 +1,95 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="LavaflowReviewPersonReason") + + + +@_attrs_define +class LavaflowReviewPersonReason: + """ One decision the review leaves to a person. `question` reads `Hidden: this field matched a secret.` when it holds + one of the project's secret values or a secret gitleaks detects, and `Hidden: the fix may add a credential.` when + the run is held with `possible_credential`. + + Attributes: + kind (str): `irreversible`: merging the fix itself does what a revert can't undo, such as deleting or migrating + stored data. `trust_boundary`: it changes authentication, authorization, secrets, who can reach what, or rate + limits, quotas or other abuse controls, including whether they fail open. `breaks_contract`: it removes or + renames an existing field, status, event, or accepted input that other code or users rely on, or changes what + one means, or it newly rejects a request the code could serve before it, or input it served even when its + documentation marks that input invalid, with a client error, validation error, or limit, or drops or skips + records the code handled. `billing`: it touches payments, pricing, metering, or charges. `unexplained`: it + changes behavior that neither the diagnosis nor the fix's stated choices justify, and that the code doesn't + support. `not_reviewable`: it couldn't be reviewed closely. New kinds may appear. + question (str): What the person decides, written to show as given. + """ + + kind: str + question: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + kind = self.kind + + question = self.question + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "kind": kind, + "question": question, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + kind = d.pop("kind") + + question = d.pop("question") + + lavaflow_review_person_reason = cls( + kind=kind, + question=question, + ) + + + lavaflow_review_person_reason.additional_properties = d + return lavaflow_review_person_reason + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_review_stop.py b/src/volcano_sdk/_generated/models/lavaflow_review_stop.py new file mode 100644 index 00000000..8b9bed47 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_review_stop.py @@ -0,0 +1,10 @@ +from typing import Literal + +LavaflowReviewStop = Literal['budget_exhausted', 'context_limit', 'no_revision', 'reviewers_failed', 'rounds', 'timed_out', 'too_few_reviewers', 'unreadable'] + +LAVAFLOW_REVIEW_STOP_VALUES: set[LavaflowReviewStop] = { 'budget_exhausted', 'context_limit', 'no_revision', 'reviewers_failed', 'rounds', 'timed_out', 'too_few_reviewers', 'unreadable', } + +def check_lavaflow_review_stop(value: str) -> LavaflowReviewStop: + if value in LAVAFLOW_REVIEW_STOP_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {LAVAFLOW_REVIEW_STOP_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/lavaflow_review_verdict.py b/src/volcano_sdk/_generated/models/lavaflow_review_verdict.py new file mode 100644 index 00000000..2ac837c9 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_review_verdict.py @@ -0,0 +1,10 @@ +from typing import Literal + +LavaflowReviewVerdict = Literal['blocked', 'changes_requested', 'error', 'passed'] + +LAVAFLOW_REVIEW_VERDICT_VALUES: set[LavaflowReviewVerdict] = { 'blocked', 'changes_requested', 'error', 'passed', } + +def check_lavaflow_review_verdict(value: str) -> LavaflowReviewVerdict: + if value in LAVAFLOW_REVIEW_VERDICT_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {LAVAFLOW_REVIEW_VERDICT_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/lavaflow_run.py b/src/volcano_sdk/_generated/models/lavaflow_run.py new file mode 100644 index 00000000..917533f6 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_run.py @@ -0,0 +1,934 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.lavaflow_run_category import check_lavaflow_run_category +from ..models.lavaflow_run_category import LavaflowRunCategory +from ..models.lavaflow_run_mode import check_lavaflow_run_mode +from ..models.lavaflow_run_mode import LavaflowRunMode +from ..models.lavaflow_run_status import check_lavaflow_run_status +from ..models.lavaflow_run_status import LavaflowRunStatus +from ..models.lavaflow_skip_reason import check_lavaflow_skip_reason +from ..models.lavaflow_skip_reason import LavaflowSkipReason +from ..types import UNSET, Unset +from typing import cast +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.lavaflow_allowed_workflow import LavaflowAllowedWorkflow + from ..models.lavaflow_delivery import LavaflowDelivery + from ..models.lavaflow_diagnosis import LavaflowDiagnosis + from ..models.lavaflow_failure import LavaflowFailure + from ..models.lavaflow_fix_outcome import LavaflowFixOutcome + from ..models.lavaflow_held_workflows import LavaflowHeldWorkflows + from ..models.lavaflow_involved_resource import LavaflowInvolvedResource + from ..models.lavaflow_issue_summary import LavaflowIssueSummary + from ..models.lavaflow_lineage import LavaflowLineage + from ..models.lavaflow_lineage_evidence import LavaflowLineageEvidence + from ..models.lavaflow_merge import LavaflowMerge + from ..models.lavaflow_pull_request import LavaflowPullRequest + from ..models.lavaflow_repository_checks import LavaflowRepositoryChecks + from ..models.lavaflow_resource_reference import LavaflowResourceReference + from ..models.lavaflow_review import LavaflowReview + from ..models.lavaflow_run_progress import LavaflowRunProgress + from ..models.lavaflow_source_commit import LavaflowSourceCommit + from ..models.lavaflow_source_unavailable import LavaflowSourceUnavailable + + + + + +T = TypeVar("T", bound="LavaflowRun") + + + +@_attrs_define +class LavaflowRun: + """ + Attributes: + id (UUID): + project_id (UUID): The project the run belongs to. + status (LavaflowRunStatus): Where a run is. `diagnosing`, `fixing` and `reviewing` are the stages of a running + run. `pr_open` means its pull request is open; `completed` means it finished, with no pull request or one that + was merged or closed. + resource (LavaflowResourceReference): A function, durable function or frontend in the project, or the project of + a user-reported problem. + issue_id (UUID): + title (None | str): Names the problem the run worked on, in at most 80 characters: its diagnosis' title, else + the title of the fix it proposed, else the first line or sentence of its diagnosis' summary. A sentence too long + for a title ends at its last clause that fits, or, with none, is cut at a word and ends with `…`. Null while + none is known. Reads `Hidden: this field matched a secret.` when it or the text it comes from holds one of the + project's secret values or a secret gitleaks detects. + created_at (datetime.datetime): + finished_at (datetime.datetime | None): + pull_request (LavaflowPullRequest | None): + merge (LavaflowMerge | None): + mode (LavaflowRunMode): What the run works on: `live` for an issue seen in the project's logs, `code_quality` + for a Code Quality finding. + category (LavaflowRunCategory | None): A Code Quality run carries its finding's from the start. Any other run's + is null until LavaFlow records a diagnosis. Runs from before categories get one when their diagnosis names one + or their saved fix's paths imply one, and stay null only when neither does. + resources (list[LavaflowInvolvedResource]): Every resource the run involves: the issue's first, then by name. A + run without a recorded diagnosis lists only the issue's. For a run whose report came from what it saved rather + than its source, such as one from before involved resources were recorded, the list may leave out frontends and + the functions involved through shared code or the build root's dependency files. + issue (LavaflowIssueSummary | None): Null only for a run that works on no issue. + progress (LavaflowRunProgress | None): Where a run LavaFlow is still working on stands; null once it has nothing + left to do. + pull_request_skipped (LavaflowSkipReason | None): Why a finished run opened no pull request. A `completed` run + without `pull_request` always has one; it is `diagnose_only` when the project's `autonomy` stopped the run at + its diagnosis. Null when the run opened a pull request, while it is queued or runs, and when it failed or was + cancelled. + lineage (LavaflowLineage | None): The fix lineage the run belongs to. Null for a run in no lineage. + fix_outcome (LavaflowFixOutcome | None): How the run's merged fix fared once it went live. Null until a merged + fix goes live with the `lavaflow.lineage` capability on. Also null, meaning unknown, when the fix is first found + live only after its 14-day watch ended and its issue neither resolved as of go-live nor was last seen inside the + watch. + source_commit (LavaflowSourceCommit | None): The commit the run read the code at. Null when it read none, as for + a run that diagnosed from the logs alone. + diagnosis (LavaflowDiagnosis | None): + diff (None | str): The fix LavaFlow saved, as the unified diff its reviewers read, cut short past 256 KiB as + they read it, with a last line that starts with `[diff truncated`. When a file's changes hold one of the + project's secret values or a secret gitleaks detects, every change to that file is left out, with one line in + their place that starts with `# LavaFlow withheld` and names the file; an older fix also keeps the files it was + saved with as withheld. A run held with `possible_credential` leaves out every file. Null for a run with no + saved fix, or one saved before LavaFlow kept its diff. + diff_sha256 (None | str): The SHA-256, in hex, of `diff` exactly as served, its UTF-8 bytes. Null whenever + `diff` is. Example: 9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08. + diff_truncated (bool): `diff` was cut short, so it does not show the whole fix. False when `diff` is null. + diff_withheld (list[str]): The files whose changes `diff` leaves out, by path, as its `# LavaFlow withheld` + lines name them; an empty string for a file whose path holds a secret. Empty when `diff` shows every file, or is + null. + not_fixed (None | str): Where the saved fix says the defect starts outside its changes, such as code that writes + records in the wrong shape, and why the fix leaves it, in one plain sentence. Masked as `choices` is. Null when + the fix says nothing is left or the run saved no fix. + review (LavaflowReview | None): The review of the run's fix. When no reviewer could run, it still says why in + `stopped`. Null when no review ran. + repository_checks (LavaflowRepositoryChecks | None): Whether LavaFlow ran the repository's own checks on the fix + itself. Null for a run with no fix. + failure (LavaflowFailure | None): Why the run stopped or waits, null when nothing went wrong. + changed_files (list[str]): Repository paths the fix changes, sorted; empty without a fix. A path that holds a + secret is listed as "", as `diff_withheld` lists it, and so is every path when `diff` can't tell the fix's files + apart. A file past a truncated `diff`'s cut is listed. + ungated_workflows (list[LavaflowAllowedWorkflow] | None): The workflow jobs the run's pull request opened past + because the project's owner allowed ungated workflows, the first one on each branch or commit checked. Empty + when none or when the run opened no pull request. Null when there is no record of the workflows its pull request + opened past, as for pull requests opened before LavaFlow recorded them. Under the merge stage, LavaFlow holds + such a fix as unchecked, with `ungated_workflows`. + lineage_evidence (LavaflowLineageEvidence | None): What tied the run's issue to a recent LavaFlow fix's deploy. + Null when nothing did, and for a recurrence, whose issue came back after the fix. + held_workflows (LavaflowHeldWorkflows | None): For a run whose `pull_request_skipped` is `ungated_workflows`, + every workflow job that held its fix. Null for any other run, and for a held run whose workflows LavaFlow + couldn't read to the end, such as one with a workflow it couldn't parse, or more than 256 such jobs. + source_unavailable (LavaflowSourceUnavailable | None): Why LavaFlow couldn't read, or open a fix on, the code + that served the error. Available when LavaFlow records a source blocker, including `source_unavailable`, + `diagnose_only`, and `repository_changed` skips and verified source reads awaiting retry. Null when no source + failure reason was recorded. + fix_summary (str | Unset): The saved proposed fix's title, on one line of at most 80 characters. This describes + a proposal, not a verified fix, successful review, merge or deployment. It never falls back to the diagnosis. + Omitted when no saved patch title is known. Reads `Hidden: this field matched a secret.` when the full title or + the shortened one holds one of the project's secret values or a secret gitleaks detects, and `Hidden: the fix + may add a credential.` when the fix is held for one. A shortened value ends with `…`. + delivery (LavaflowDelivery | Unset): Pull request delivery recorded independently of run execution and live + recovery. + choices (list[str] | Unset): Material behavior decisions the saved fix proposes, one plain sentence each. + LavaFlow reviews these as part of the patch. An authorized implementation decision may proceed through merge + with a complete review. A reviewer can ask for a specific decision, and incomplete choice review can leave + `choices_to_confirm`. Each reads `Hidden: this field matched a secret.` when it holds one of the project's + secret values or a secret gitleaks detects, and `Hidden: the fix may add a credential.` when the run is held + with `possible_credential`. Absent when the fix states none or the run saved no fix. + """ + + id: UUID + project_id: UUID + status: LavaflowRunStatus + resource: LavaflowResourceReference + issue_id: UUID + title: None | str + created_at: datetime.datetime + finished_at: datetime.datetime | None + pull_request: LavaflowPullRequest | None + merge: LavaflowMerge | None + mode: LavaflowRunMode + category: LavaflowRunCategory | None + resources: list[LavaflowInvolvedResource] + issue: LavaflowIssueSummary | None + progress: LavaflowRunProgress | None + pull_request_skipped: LavaflowSkipReason | None + lineage: LavaflowLineage | None + fix_outcome: LavaflowFixOutcome | None + source_commit: LavaflowSourceCommit | None + diagnosis: LavaflowDiagnosis | None + diff: None | str + diff_sha256: None | str + diff_truncated: bool + diff_withheld: list[str] + not_fixed: None | str + review: LavaflowReview | None + repository_checks: LavaflowRepositoryChecks | None + failure: LavaflowFailure | None + changed_files: list[str] + ungated_workflows: list[LavaflowAllowedWorkflow] | None + lineage_evidence: LavaflowLineageEvidence | None + held_workflows: LavaflowHeldWorkflows | None + source_unavailable: LavaflowSourceUnavailable | None + fix_summary: str | Unset = UNSET + delivery: LavaflowDelivery | Unset = UNSET + choices: list[str] | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.lavaflow_allowed_workflow import LavaflowAllowedWorkflow # noqa: PLC0415 + from ..models.lavaflow_delivery import LavaflowDelivery # noqa: PLC0415 + from ..models.lavaflow_diagnosis import LavaflowDiagnosis # noqa: PLC0415 + from ..models.lavaflow_failure import LavaflowFailure # noqa: PLC0415 + from ..models.lavaflow_fix_outcome import LavaflowFixOutcome # noqa: PLC0415 + from ..models.lavaflow_held_workflows import LavaflowHeldWorkflows # noqa: PLC0415 + from ..models.lavaflow_involved_resource import LavaflowInvolvedResource # noqa: PLC0415 + from ..models.lavaflow_issue_summary import LavaflowIssueSummary # noqa: PLC0415 + from ..models.lavaflow_lineage import LavaflowLineage # noqa: PLC0415 + from ..models.lavaflow_lineage_evidence import LavaflowLineageEvidence # noqa: PLC0415 + from ..models.lavaflow_merge import LavaflowMerge # noqa: PLC0415 + from ..models.lavaflow_pull_request import LavaflowPullRequest # noqa: PLC0415 + from ..models.lavaflow_repository_checks import LavaflowRepositoryChecks # noqa: PLC0415 + from ..models.lavaflow_resource_reference import LavaflowResourceReference # noqa: PLC0415 + from ..models.lavaflow_review import LavaflowReview # noqa: PLC0415 + from ..models.lavaflow_run_progress import LavaflowRunProgress # noqa: PLC0415 + from ..models.lavaflow_source_commit import LavaflowSourceCommit # noqa: PLC0415 + from ..models.lavaflow_source_unavailable import LavaflowSourceUnavailable # noqa: PLC0415 + id = str(self.id) + + project_id = str(self.project_id) + + status: str = self.status + + resource = self.resource.to_dict() + + issue_id = str(self.issue_id) + + title: None | str + title = self.title + + created_at = self.created_at.isoformat() + + finished_at: None | str + if isinstance(self.finished_at, datetime.datetime): + finished_at = self.finished_at.isoformat() + else: + finished_at = self.finished_at + + pull_request: dict[str, Any] | None + if isinstance(self.pull_request, LavaflowPullRequest): + pull_request = self.pull_request.to_dict() + else: + pull_request = self.pull_request + + merge: dict[str, Any] | None + if isinstance(self.merge, LavaflowMerge): + merge = self.merge.to_dict() + else: + merge = self.merge + + mode: str = self.mode + + category: None | str + if isinstance(self.category, str): + category = self.category + else: + category = self.category + + resources = [] + for resources_item_data in self.resources: + resources_item = resources_item_data.to_dict() + resources.append(resources_item) + + + + issue: dict[str, Any] | None + if isinstance(self.issue, LavaflowIssueSummary): + issue = self.issue.to_dict() + else: + issue = self.issue + + progress: dict[str, Any] | None + if isinstance(self.progress, LavaflowRunProgress): + progress = self.progress.to_dict() + else: + progress = self.progress + + pull_request_skipped: None | str + if isinstance(self.pull_request_skipped, str): + pull_request_skipped = self.pull_request_skipped + else: + pull_request_skipped = self.pull_request_skipped + + lineage: dict[str, Any] | None + if isinstance(self.lineage, LavaflowLineage): + lineage = self.lineage.to_dict() + else: + lineage = self.lineage + + fix_outcome: dict[str, Any] | None + if isinstance(self.fix_outcome, LavaflowFixOutcome): + fix_outcome = self.fix_outcome.to_dict() + else: + fix_outcome = self.fix_outcome + + source_commit: dict[str, Any] | None + if isinstance(self.source_commit, LavaflowSourceCommit): + source_commit = self.source_commit.to_dict() + else: + source_commit = self.source_commit + + diagnosis: dict[str, Any] | None + if isinstance(self.diagnosis, LavaflowDiagnosis): + diagnosis = self.diagnosis.to_dict() + else: + diagnosis = self.diagnosis + + diff: None | str + diff = self.diff + + diff_sha256: None | str + diff_sha256 = self.diff_sha256 + + diff_truncated = self.diff_truncated + + diff_withheld = self.diff_withheld + + + + not_fixed: None | str + not_fixed = self.not_fixed + + review: dict[str, Any] | None + if isinstance(self.review, LavaflowReview): + review = self.review.to_dict() + else: + review = self.review + + repository_checks: dict[str, Any] | None + if isinstance(self.repository_checks, LavaflowRepositoryChecks): + repository_checks = self.repository_checks.to_dict() + else: + repository_checks = self.repository_checks + + failure: dict[str, Any] | None + if isinstance(self.failure, LavaflowFailure): + failure = self.failure.to_dict() + else: + failure = self.failure + + changed_files = self.changed_files + + + + ungated_workflows: list[dict[str, Any]] | None + if isinstance(self.ungated_workflows, list): + ungated_workflows = [] + for ungated_workflows_type_0_item_data in self.ungated_workflows: + ungated_workflows_type_0_item = ungated_workflows_type_0_item_data.to_dict() + ungated_workflows.append(ungated_workflows_type_0_item) + + + else: + ungated_workflows = self.ungated_workflows + + lineage_evidence: dict[str, Any] | None + if isinstance(self.lineage_evidence, LavaflowLineageEvidence): + lineage_evidence = self.lineage_evidence.to_dict() + else: + lineage_evidence = self.lineage_evidence + + held_workflows: dict[str, Any] | None + if isinstance(self.held_workflows, LavaflowHeldWorkflows): + held_workflows = self.held_workflows.to_dict() + else: + held_workflows = self.held_workflows + + source_unavailable: dict[str, Any] | None + if isinstance(self.source_unavailable, LavaflowSourceUnavailable): + source_unavailable = self.source_unavailable.to_dict() + else: + source_unavailable = self.source_unavailable + + fix_summary = self.fix_summary + + delivery: dict[str, Any] | Unset = UNSET + if not isinstance(self.delivery, Unset): + delivery = self.delivery.to_dict() + + choices: list[str] | Unset = UNSET + if not isinstance(self.choices, Unset): + choices = self.choices + + + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "id": id, + "project_id": project_id, + "status": status, + "resource": resource, + "issue_id": issue_id, + "title": title, + "created_at": created_at, + "finished_at": finished_at, + "pull_request": pull_request, + "merge": merge, + "mode": mode, + "category": category, + "resources": resources, + "issue": issue, + "progress": progress, + "pull_request_skipped": pull_request_skipped, + "lineage": lineage, + "fix_outcome": fix_outcome, + "source_commit": source_commit, + "diagnosis": diagnosis, + "diff": diff, + "diff_sha256": diff_sha256, + "diff_truncated": diff_truncated, + "diff_withheld": diff_withheld, + "not_fixed": not_fixed, + "review": review, + "repository_checks": repository_checks, + "failure": failure, + "changed_files": changed_files, + "ungated_workflows": ungated_workflows, + "lineage_evidence": lineage_evidence, + "held_workflows": held_workflows, + "source_unavailable": source_unavailable, + }) + if fix_summary is not UNSET: + field_dict["fix_summary"] = fix_summary + if delivery is not UNSET: + field_dict["delivery"] = delivery + if choices is not UNSET: + field_dict["choices"] = choices + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.lavaflow_allowed_workflow import LavaflowAllowedWorkflow # noqa: PLC0415 + from ..models.lavaflow_delivery import LavaflowDelivery # noqa: PLC0415 + from ..models.lavaflow_diagnosis import LavaflowDiagnosis # noqa: PLC0415 + from ..models.lavaflow_failure import LavaflowFailure # noqa: PLC0415 + from ..models.lavaflow_fix_outcome import LavaflowFixOutcome # noqa: PLC0415 + from ..models.lavaflow_held_workflows import LavaflowHeldWorkflows # noqa: PLC0415 + from ..models.lavaflow_involved_resource import LavaflowInvolvedResource # noqa: PLC0415 + from ..models.lavaflow_issue_summary import LavaflowIssueSummary # noqa: PLC0415 + from ..models.lavaflow_lineage import LavaflowLineage # noqa: PLC0415 + from ..models.lavaflow_lineage_evidence import LavaflowLineageEvidence # noqa: PLC0415 + from ..models.lavaflow_merge import LavaflowMerge # noqa: PLC0415 + from ..models.lavaflow_pull_request import LavaflowPullRequest # noqa: PLC0415 + from ..models.lavaflow_repository_checks import LavaflowRepositoryChecks # noqa: PLC0415 + from ..models.lavaflow_resource_reference import LavaflowResourceReference # noqa: PLC0415 + from ..models.lavaflow_review import LavaflowReview # noqa: PLC0415 + from ..models.lavaflow_run_progress import LavaflowRunProgress # noqa: PLC0415 + from ..models.lavaflow_source_commit import LavaflowSourceCommit # noqa: PLC0415 + from ..models.lavaflow_source_unavailable import LavaflowSourceUnavailable # noqa: PLC0415 + d = dict(src_dict) + id = UUID(d.pop("id")) + + + + + project_id = UUID(d.pop("project_id")) + + + + + status = check_lavaflow_run_status(d.pop("status")) + + + + + resource = LavaflowResourceReference.from_dict(d.pop("resource")) + + + + + issue_id = UUID(d.pop("issue_id")) + + + + + def _parse_title(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + title = _parse_title(d.pop("title")) + + + created_at = datetime.datetime.fromisoformat(d.pop("created_at")) + + + + + def _parse_finished_at(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + finished_at_type_0 = datetime.datetime.fromisoformat(data) + + + + return finished_at_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + finished_at = _parse_finished_at(d.pop("finished_at")) + + + def _parse_pull_request(data: object) -> LavaflowPullRequest | None: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + pull_request_type_1 = LavaflowPullRequest.from_dict(data) + + + + return pull_request_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(LavaflowPullRequest | None, data) + + pull_request = _parse_pull_request(d.pop("pull_request")) + + + def _parse_merge(data: object) -> LavaflowMerge | None: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + merge_type_1 = LavaflowMerge.from_dict(data) + + + + return merge_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(LavaflowMerge | None, data) + + merge = _parse_merge(d.pop("merge")) + + + mode = check_lavaflow_run_mode(d.pop("mode")) + + + + + def _parse_category(data: object) -> LavaflowRunCategory | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + category_type_1 = check_lavaflow_run_category(data) + + + + return category_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(LavaflowRunCategory | None, data) + + category = _parse_category(d.pop("category")) + + + resources = [] + _resources = d.pop("resources") + for resources_item_data in (_resources): + resources_item = LavaflowInvolvedResource.from_dict(resources_item_data) + + + + resources.append(resources_item) + + + def _parse_issue(data: object) -> LavaflowIssueSummary | None: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + issue_type_1 = LavaflowIssueSummary.from_dict(data) + + + + return issue_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(LavaflowIssueSummary | None, data) + + issue = _parse_issue(d.pop("issue")) + + + def _parse_progress(data: object) -> LavaflowRunProgress | None: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + progress_type_1 = LavaflowRunProgress.from_dict(data) + + + + return progress_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(LavaflowRunProgress | None, data) + + progress = _parse_progress(d.pop("progress")) + + + def _parse_pull_request_skipped(data: object) -> LavaflowSkipReason | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + pull_request_skipped_type_1 = check_lavaflow_skip_reason(data) + + + + return pull_request_skipped_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(LavaflowSkipReason | None, data) + + pull_request_skipped = _parse_pull_request_skipped(d.pop("pull_request_skipped")) + + + def _parse_lineage(data: object) -> LavaflowLineage | None: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + lineage_type_1 = LavaflowLineage.from_dict(data) + + + + return lineage_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(LavaflowLineage | None, data) + + lineage = _parse_lineage(d.pop("lineage")) + + + def _parse_fix_outcome(data: object) -> LavaflowFixOutcome | None: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + fix_outcome_type_1 = LavaflowFixOutcome.from_dict(data) + + + + return fix_outcome_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(LavaflowFixOutcome | None, data) + + fix_outcome = _parse_fix_outcome(d.pop("fix_outcome")) + + + def _parse_source_commit(data: object) -> LavaflowSourceCommit | None: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + source_commit_type_1 = LavaflowSourceCommit.from_dict(data) + + + + return source_commit_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(LavaflowSourceCommit | None, data) + + source_commit = _parse_source_commit(d.pop("source_commit")) + + + def _parse_diagnosis(data: object) -> LavaflowDiagnosis | None: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + diagnosis_type_1 = LavaflowDiagnosis.from_dict(data) + + + + return diagnosis_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(LavaflowDiagnosis | None, data) + + diagnosis = _parse_diagnosis(d.pop("diagnosis")) + + + def _parse_diff(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + diff = _parse_diff(d.pop("diff")) + + + def _parse_diff_sha256(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + diff_sha256 = _parse_diff_sha256(d.pop("diff_sha256")) + + + diff_truncated = d.pop("diff_truncated") + + diff_withheld = cast(list[str], d.pop("diff_withheld")) + + + def _parse_not_fixed(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + not_fixed = _parse_not_fixed(d.pop("not_fixed")) + + + def _parse_review(data: object) -> LavaflowReview | None: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + review_type_1 = LavaflowReview.from_dict(data) + + + + return review_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(LavaflowReview | None, data) + + review = _parse_review(d.pop("review")) + + + def _parse_repository_checks(data: object) -> LavaflowRepositoryChecks | None: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + repository_checks_type_1 = LavaflowRepositoryChecks.from_dict(data) + + + + return repository_checks_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(LavaflowRepositoryChecks | None, data) + + repository_checks = _parse_repository_checks(d.pop("repository_checks")) + + + def _parse_failure(data: object) -> LavaflowFailure | None: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + failure_type_1 = LavaflowFailure.from_dict(data) + + + + return failure_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(LavaflowFailure | None, data) + + failure = _parse_failure(d.pop("failure")) + + + changed_files = cast(list[str], d.pop("changed_files")) + + + def _parse_ungated_workflows(data: object) -> list[LavaflowAllowedWorkflow] | None: + if data is None: + return data + try: + if not isinstance(data, list): + raise TypeError() + ungated_workflows_type_0 = [] + _ungated_workflows_type_0 = data + for ungated_workflows_type_0_item_data in (_ungated_workflows_type_0): + ungated_workflows_type_0_item = LavaflowAllowedWorkflow.from_dict(ungated_workflows_type_0_item_data) + + + + ungated_workflows_type_0.append(ungated_workflows_type_0_item) + + return ungated_workflows_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(list[LavaflowAllowedWorkflow] | None, data) + + ungated_workflows = _parse_ungated_workflows(d.pop("ungated_workflows")) + + + def _parse_lineage_evidence(data: object) -> LavaflowLineageEvidence | None: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + lineage_evidence_type_1 = LavaflowLineageEvidence.from_dict(data) + + + + return lineage_evidence_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(LavaflowLineageEvidence | None, data) + + lineage_evidence = _parse_lineage_evidence(d.pop("lineage_evidence")) + + + def _parse_held_workflows(data: object) -> LavaflowHeldWorkflows | None: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + held_workflows_type_1 = LavaflowHeldWorkflows.from_dict(data) + + + + return held_workflows_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(LavaflowHeldWorkflows | None, data) + + held_workflows = _parse_held_workflows(d.pop("held_workflows")) + + + def _parse_source_unavailable(data: object) -> LavaflowSourceUnavailable | None: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + source_unavailable_type_1 = LavaflowSourceUnavailable.from_dict(data) + + + + return source_unavailable_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(LavaflowSourceUnavailable | None, data) + + source_unavailable = _parse_source_unavailable(d.pop("source_unavailable")) + + + fix_summary = d.pop("fix_summary", UNSET) + + _delivery = d.pop("delivery", UNSET) + delivery: LavaflowDelivery | Unset + if isinstance(_delivery, Unset): + delivery = UNSET + else: + delivery = LavaflowDelivery.from_dict(_delivery) + + + + + choices = cast(list[str], d.pop("choices", UNSET)) + + + lavaflow_run = cls( + id=id, + project_id=project_id, + status=status, + resource=resource, + issue_id=issue_id, + title=title, + created_at=created_at, + finished_at=finished_at, + pull_request=pull_request, + merge=merge, + mode=mode, + category=category, + resources=resources, + issue=issue, + progress=progress, + pull_request_skipped=pull_request_skipped, + lineage=lineage, + fix_outcome=fix_outcome, + source_commit=source_commit, + diagnosis=diagnosis, + diff=diff, + diff_sha256=diff_sha256, + diff_truncated=diff_truncated, + diff_withheld=diff_withheld, + not_fixed=not_fixed, + review=review, + repository_checks=repository_checks, + failure=failure, + changed_files=changed_files, + ungated_workflows=ungated_workflows, + lineage_evidence=lineage_evidence, + held_workflows=held_workflows, + source_unavailable=source_unavailable, + fix_summary=fix_summary, + delivery=delivery, + choices=choices, + ) + + + lavaflow_run.additional_properties = d + return lavaflow_run + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_run_category.py b/src/volcano_sdk/_generated/models/lavaflow_run_category.py new file mode 100644 index 00000000..c3e9f773 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_run_category.py @@ -0,0 +1,10 @@ +from typing import Literal + +LavaflowRunCategory = Literal['bug', 'configuration', 'dependency', 'external', 'improvement', 'performance', 'security'] + +LAVAFLOW_RUN_CATEGORY_VALUES: set[LavaflowRunCategory] = { 'bug', 'configuration', 'dependency', 'external', 'improvement', 'performance', 'security', } + +def check_lavaflow_run_category(value: str) -> LavaflowRunCategory: + if value in LAVAFLOW_RUN_CATEGORY_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {LAVAFLOW_RUN_CATEGORY_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/lavaflow_run_counts.py b/src/volcano_sdk/_generated/models/lavaflow_run_counts.py new file mode 100644 index 00000000..099789fe --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_run_counts.py @@ -0,0 +1,152 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast + +if TYPE_CHECKING: + from ..models.lavaflow_category_counts import LavaflowCategoryCounts + from ..models.lavaflow_involved_resource_count import LavaflowInvolvedResourceCount + from ..models.lavaflow_pull_request_state_counts import LavaflowPullRequestStateCounts + from ..models.lavaflow_run_status_counts import LavaflowRunStatusCounts + + + + + +T = TypeVar("T", bound="LavaflowRunCounts") + + + +@_attrs_define +class LavaflowRunCounts: + """ Runs that match the request. `total` applies every filter. Each breakdown applies every filter but its own, so it + shows what picking another value would return. + + Attributes: + total (int): + status (LavaflowRunStatusCounts): Matching runs in each status, zeros included. + category (LavaflowCategoryCounts): Matching runs in each category, zeros included. `uncategorized` counts runs + whose `category` is null. + pull_request_state (LavaflowPullRequestStateCounts): Matching runs by the state of their pull request, zeros + included. `none` counts runs without one. + involved_resources (list[LavaflowInvolvedResourceCount]): Resources involved in at least one matching run, most + runs first, then by name; at most 50. A run counts once per resource it involves. A run whose report came from + what it saved rather than its source, such as one from before involved resources were recorded, may leave out + frontends and the functions involved through shared code or the build root's dependency files, so these counts + can undercount them. + """ + + total: int + status: LavaflowRunStatusCounts + category: LavaflowCategoryCounts + pull_request_state: LavaflowPullRequestStateCounts + involved_resources: list[LavaflowInvolvedResourceCount] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.lavaflow_category_counts import LavaflowCategoryCounts # noqa: PLC0415 + from ..models.lavaflow_involved_resource_count import LavaflowInvolvedResourceCount # noqa: PLC0415 + from ..models.lavaflow_pull_request_state_counts import LavaflowPullRequestStateCounts # noqa: PLC0415 + from ..models.lavaflow_run_status_counts import LavaflowRunStatusCounts # noqa: PLC0415 + total = self.total + + status = self.status.to_dict() + + category = self.category.to_dict() + + pull_request_state = self.pull_request_state.to_dict() + + involved_resources = [] + for involved_resources_item_data in self.involved_resources: + involved_resources_item = involved_resources_item_data.to_dict() + involved_resources.append(involved_resources_item) + + + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "total": total, + "status": status, + "category": category, + "pull_request_state": pull_request_state, + "involved_resources": involved_resources, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.lavaflow_category_counts import LavaflowCategoryCounts # noqa: PLC0415 + from ..models.lavaflow_involved_resource_count import LavaflowInvolvedResourceCount # noqa: PLC0415 + from ..models.lavaflow_pull_request_state_counts import LavaflowPullRequestStateCounts # noqa: PLC0415 + from ..models.lavaflow_run_status_counts import LavaflowRunStatusCounts # noqa: PLC0415 + d = dict(src_dict) + total = d.pop("total") + + status = LavaflowRunStatusCounts.from_dict(d.pop("status")) + + + + + category = LavaflowCategoryCounts.from_dict(d.pop("category")) + + + + + pull_request_state = LavaflowPullRequestStateCounts.from_dict(d.pop("pull_request_state")) + + + + + involved_resources = [] + _involved_resources = d.pop("involved_resources") + for involved_resources_item_data in (_involved_resources): + involved_resources_item = LavaflowInvolvedResourceCount.from_dict(involved_resources_item_data) + + + + involved_resources.append(involved_resources_item) + + + lavaflow_run_counts = cls( + total=total, + status=status, + category=category, + pull_request_state=pull_request_state, + involved_resources=involved_resources, + ) + + + lavaflow_run_counts.additional_properties = d + return lavaflow_run_counts + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_run_create.py b/src/volcano_sdk/_generated/models/lavaflow_run_create.py new file mode 100644 index 00000000..c6790ce9 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_run_create.py @@ -0,0 +1,95 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset +from uuid import UUID + + + + + + +T = TypeVar("T", bound="LavaflowRunCreate") + + + +@_attrs_define +class LavaflowRunCreate: + """ The project, and the issue to start a run on. + + Attributes: + project_id (UUID): The project the issue belongs to. + issue_id (UUID): The issue to start a run on. + after_run_id (UUID | Unset): The preceding run on a written issue. If a later run already exists, return that + run. + """ + + project_id: UUID + issue_id: UUID + after_run_id: UUID | Unset = UNSET + + + + + + def to_dict(self) -> dict[str, Any]: + project_id = str(self.project_id) + + issue_id = str(self.issue_id) + + after_run_id: str | Unset = UNSET + if not isinstance(self.after_run_id, Unset): + after_run_id = str(self.after_run_id) + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "project_id": project_id, + "issue_id": issue_id, + }) + if after_run_id is not UNSET: + field_dict["after_run_id"] = after_run_id + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + project_id = UUID(d.pop("project_id")) + + + + + issue_id = UUID(d.pop("issue_id")) + + + + + _after_run_id = d.pop("after_run_id", UNSET) + after_run_id: UUID | Unset + if isinstance(_after_run_id, Unset): + after_run_id = UNSET + else: + after_run_id = UUID(_after_run_id) + + + + + lavaflow_run_create = cls( + project_id=project_id, + issue_id=issue_id, + after_run_id=after_run_id, + ) + + return lavaflow_run_create + diff --git a/src/volcano_sdk/_generated/models/lavaflow_run_mode.py b/src/volcano_sdk/_generated/models/lavaflow_run_mode.py new file mode 100644 index 00000000..c4a55cf1 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_run_mode.py @@ -0,0 +1,10 @@ +from typing import Literal + +LavaflowRunMode = Literal['code_quality', 'live'] + +LAVAFLOW_RUN_MODE_VALUES: set[LavaflowRunMode] = { 'code_quality', 'live', } + +def check_lavaflow_run_mode(value: str) -> LavaflowRunMode: + if value in LAVAFLOW_RUN_MODE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {LAVAFLOW_RUN_MODE_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/lavaflow_run_progress.py b/src/volcano_sdk/_generated/models/lavaflow_run_progress.py new file mode 100644 index 00000000..afba71b4 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_run_progress.py @@ -0,0 +1,103 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.lavaflow_run_progress_stage import check_lavaflow_run_progress_stage +from ..models.lavaflow_run_progress_stage import LavaflowRunProgressStage +from typing import cast + + + + + + +T = TypeVar("T", bound="LavaflowRunProgress") + + + +@_attrs_define +class LavaflowRunProgress: + """ How far an active run has come. The steps are `queued`, `diagnosing`, `fixing`, `reviewing`, `waiting_for_checks` + and `merge_queued`, in that order, and a run takes as many as its autonomy when it was queued allows: 2 for + `diagnose_only`, 4 for `open_pr` (opening the pull request ends it, unless LavaFlow starts the fix's CI once, when + it shows `waiting_for_checks` as step 5 until LavaFlow has), 6 for `merge` (the merge ends it). Step 5 also covers + required approval: `merge.status` is `waiting_for_approval` once checks passed but a required review is missing. + + Attributes: + stage (LavaflowRunProgressStage): New stages may appear. + step (int): The stage's place among the run's steps, from 1. + steps (int): How many steps the run takes. + """ + + stage: LavaflowRunProgressStage + step: int + steps: int + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + stage: str = self.stage + + step = self.step + + steps = self.steps + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "stage": stage, + "step": step, + "steps": steps, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + stage = check_lavaflow_run_progress_stage(d.pop("stage")) + + + + + step = d.pop("step") + + steps = d.pop("steps") + + lavaflow_run_progress = cls( + stage=stage, + step=step, + steps=steps, + ) + + + lavaflow_run_progress.additional_properties = d + return lavaflow_run_progress + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_run_progress_stage.py b/src/volcano_sdk/_generated/models/lavaflow_run_progress_stage.py new file mode 100644 index 00000000..5f50ea74 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_run_progress_stage.py @@ -0,0 +1,10 @@ +from typing import Literal + +LavaflowRunProgressStage = Literal['diagnosing', 'fixing', 'merge_queued', 'queued', 'reviewing', 'waiting_for_checks'] + +LAVAFLOW_RUN_PROGRESS_STAGE_VALUES: set[LavaflowRunProgressStage] = { 'diagnosing', 'fixing', 'merge_queued', 'queued', 'reviewing', 'waiting_for_checks', } + +def check_lavaflow_run_progress_stage(value: str) -> LavaflowRunProgressStage: + if value in LAVAFLOW_RUN_PROGRESS_STAGE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {LAVAFLOW_RUN_PROGRESS_STAGE_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/lavaflow_run_reference.py b/src/volcano_sdk/_generated/models/lavaflow_run_reference.py new file mode 100644 index 00000000..7110bcf5 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_run_reference.py @@ -0,0 +1,97 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast +from uuid import UUID + + + + + + +T = TypeVar("T", bound="LavaflowRunReference") + + + +@_attrs_define +class LavaflowRunReference: + """ Another LavaFlow run of the same project. + + Attributes: + id (UUID): + title (None | str): The run's title, as `LavaflowRunSummary.title` gives it. + """ + + id: UUID + title: None | str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + id = str(self.id) + + title: None | str + title = self.title + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "id": id, + "title": title, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = UUID(d.pop("id")) + + + + + def _parse_title(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + title = _parse_title(d.pop("title")) + + + lavaflow_run_reference = cls( + id=id, + title=title, + ) + + + lavaflow_run_reference.additional_properties = d + return lavaflow_run_reference + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_run_status.py b/src/volcano_sdk/_generated/models/lavaflow_run_status.py new file mode 100644 index 00000000..2e5d3028 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_run_status.py @@ -0,0 +1,10 @@ +from typing import Literal + +LavaflowRunStatus = Literal['cancelled', 'completed', 'diagnosing', 'failed', 'fixing', 'pr_open', 'queued', 'reviewing'] + +LAVAFLOW_RUN_STATUS_VALUES: set[LavaflowRunStatus] = { 'cancelled', 'completed', 'diagnosing', 'failed', 'fixing', 'pr_open', 'queued', 'reviewing', } + +def check_lavaflow_run_status(value: str) -> LavaflowRunStatus: + if value in LAVAFLOW_RUN_STATUS_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {LAVAFLOW_RUN_STATUS_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/lavaflow_run_status_counts.py b/src/volcano_sdk/_generated/models/lavaflow_run_status_counts.py new file mode 100644 index 00000000..94cd25b7 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_run_status_counts.py @@ -0,0 +1,133 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="LavaflowRunStatusCounts") + + + +@_attrs_define +class LavaflowRunStatusCounts: + """ Matching runs in each status, zeros included. + + Attributes: + queued (int): + diagnosing (int): + fixing (int): + reviewing (int): + pr_open (int): + completed (int): + failed (int): + cancelled (int): + """ + + queued: int + diagnosing: int + fixing: int + reviewing: int + pr_open: int + completed: int + failed: int + cancelled: int + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + queued = self.queued + + diagnosing = self.diagnosing + + fixing = self.fixing + + reviewing = self.reviewing + + pr_open = self.pr_open + + completed = self.completed + + failed = self.failed + + cancelled = self.cancelled + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "queued": queued, + "diagnosing": diagnosing, + "fixing": fixing, + "reviewing": reviewing, + "pr_open": pr_open, + "completed": completed, + "failed": failed, + "cancelled": cancelled, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + queued = d.pop("queued") + + diagnosing = d.pop("diagnosing") + + fixing = d.pop("fixing") + + reviewing = d.pop("reviewing") + + pr_open = d.pop("pr_open") + + completed = d.pop("completed") + + failed = d.pop("failed") + + cancelled = d.pop("cancelled") + + lavaflow_run_status_counts = cls( + queued=queued, + diagnosing=diagnosing, + fixing=fixing, + reviewing=reviewing, + pr_open=pr_open, + completed=completed, + failed=failed, + cancelled=cancelled, + ) + + + lavaflow_run_status_counts.additional_properties = d + return lavaflow_run_status_counts + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_run_summary.py b/src/volcano_sdk/_generated/models/lavaflow_run_summary.py new file mode 100644 index 00000000..2d2e7f22 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_run_summary.py @@ -0,0 +1,526 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.lavaflow_run_category import check_lavaflow_run_category +from ..models.lavaflow_run_category import LavaflowRunCategory +from ..models.lavaflow_run_mode import check_lavaflow_run_mode +from ..models.lavaflow_run_mode import LavaflowRunMode +from ..models.lavaflow_run_status import check_lavaflow_run_status +from ..models.lavaflow_run_status import LavaflowRunStatus +from ..models.lavaflow_skip_reason import check_lavaflow_skip_reason +from ..models.lavaflow_skip_reason import LavaflowSkipReason +from ..types import UNSET, Unset +from typing import cast +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.lavaflow_delivery import LavaflowDelivery + from ..models.lavaflow_fix_outcome import LavaflowFixOutcome + from ..models.lavaflow_involved_resource import LavaflowInvolvedResource + from ..models.lavaflow_issue_summary import LavaflowIssueSummary + from ..models.lavaflow_lineage import LavaflowLineage + from ..models.lavaflow_merge import LavaflowMerge + from ..models.lavaflow_pull_request import LavaflowPullRequest + from ..models.lavaflow_resource_reference import LavaflowResourceReference + from ..models.lavaflow_run_progress import LavaflowRunProgress + + + + + +T = TypeVar("T", bound="LavaflowRunSummary") + + + +@_attrs_define +class LavaflowRunSummary: + """ + Attributes: + id (UUID): + project_id (UUID): The project the run belongs to. + status (LavaflowRunStatus): Where a run is. `diagnosing`, `fixing` and `reviewing` are the stages of a running + run. `pr_open` means its pull request is open; `completed` means it finished, with no pull request or one that + was merged or closed. + resource (LavaflowResourceReference): A function, durable function or frontend in the project, or the project of + a user-reported problem. + issue_id (UUID): + title (None | str): Names the problem the run worked on, in at most 80 characters: its diagnosis' title, else + the title of the fix it proposed, else the first line or sentence of its diagnosis' summary. A sentence too long + for a title ends at its last clause that fits, or, with none, is cut at a word and ends with `…`. Null while + none is known. Reads `Hidden: this field matched a secret.` when it or the text it comes from holds one of the + project's secret values or a secret gitleaks detects. + created_at (datetime.datetime): + finished_at (datetime.datetime | None): + pull_request (LavaflowPullRequest | None): + merge (LavaflowMerge | None): + mode (LavaflowRunMode): What the run works on: `live` for an issue seen in the project's logs, `code_quality` + for a Code Quality finding. + category (LavaflowRunCategory | None): A Code Quality run carries its finding's from the start. Any other run's + is null until LavaFlow records a diagnosis. Runs from before categories get one when their diagnosis names one + or their saved fix's paths imply one, and stay null only when neither does. + resources (list[LavaflowInvolvedResource]): Every resource the run involves: the issue's first, then by name. A + run without a recorded diagnosis lists only the issue's. For a run whose report came from what it saved rather + than its source, such as one from before involved resources were recorded, the list may leave out frontends and + the functions involved through shared code or the build root's dependency files. + issue (LavaflowIssueSummary | None): Null only for a run that works on no issue. + progress (LavaflowRunProgress | None): Where a run LavaFlow is still working on stands; null once it has nothing + left to do. + pull_request_skipped (LavaflowSkipReason | None): Why a finished run opened no pull request. A `completed` run + without `pull_request` always has one; it is `diagnose_only` when the project's `autonomy` stopped the run at + its diagnosis. Null when the run opened a pull request, while it is queued or runs, and when it failed or was + cancelled. + lineage (LavaflowLineage | None): The fix lineage the run belongs to. Null for a run in no lineage. + fix_outcome (LavaflowFixOutcome | None): How the run's merged fix fared once it went live. Null until a merged + fix goes live with the `lavaflow.lineage` capability on. Also null, meaning unknown, when the fix is first found + live only after its 14-day watch ended and its issue neither resolved as of go-live nor was last seen inside the + watch. + fix_summary (str | Unset): The saved proposed fix's title, on one line of at most 80 characters. This describes + a proposal, not a verified fix, successful review, merge or deployment. It never falls back to the diagnosis. + Omitted when no saved patch title is known. Reads `Hidden: this field matched a secret.` when the full title or + the shortened one holds one of the project's secret values or a secret gitleaks detects, and `Hidden: the fix + may add a credential.` when the fix is held for one. A shortened value ends with `…`. + delivery (LavaflowDelivery | Unset): Pull request delivery recorded independently of run execution and live + recovery. + """ + + id: UUID + project_id: UUID + status: LavaflowRunStatus + resource: LavaflowResourceReference + issue_id: UUID + title: None | str + created_at: datetime.datetime + finished_at: datetime.datetime | None + pull_request: LavaflowPullRequest | None + merge: LavaflowMerge | None + mode: LavaflowRunMode + category: LavaflowRunCategory | None + resources: list[LavaflowInvolvedResource] + issue: LavaflowIssueSummary | None + progress: LavaflowRunProgress | None + pull_request_skipped: LavaflowSkipReason | None + lineage: LavaflowLineage | None + fix_outcome: LavaflowFixOutcome | None + fix_summary: str | Unset = UNSET + delivery: LavaflowDelivery | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.lavaflow_delivery import LavaflowDelivery # noqa: PLC0415 + from ..models.lavaflow_fix_outcome import LavaflowFixOutcome # noqa: PLC0415 + from ..models.lavaflow_involved_resource import LavaflowInvolvedResource # noqa: PLC0415 + from ..models.lavaflow_issue_summary import LavaflowIssueSummary # noqa: PLC0415 + from ..models.lavaflow_lineage import LavaflowLineage # noqa: PLC0415 + from ..models.lavaflow_merge import LavaflowMerge # noqa: PLC0415 + from ..models.lavaflow_pull_request import LavaflowPullRequest # noqa: PLC0415 + from ..models.lavaflow_resource_reference import LavaflowResourceReference # noqa: PLC0415 + from ..models.lavaflow_run_progress import LavaflowRunProgress # noqa: PLC0415 + id = str(self.id) + + project_id = str(self.project_id) + + status: str = self.status + + resource = self.resource.to_dict() + + issue_id = str(self.issue_id) + + title: None | str + title = self.title + + created_at = self.created_at.isoformat() + + finished_at: None | str + if isinstance(self.finished_at, datetime.datetime): + finished_at = self.finished_at.isoformat() + else: + finished_at = self.finished_at + + pull_request: dict[str, Any] | None + if isinstance(self.pull_request, LavaflowPullRequest): + pull_request = self.pull_request.to_dict() + else: + pull_request = self.pull_request + + merge: dict[str, Any] | None + if isinstance(self.merge, LavaflowMerge): + merge = self.merge.to_dict() + else: + merge = self.merge + + mode: str = self.mode + + category: None | str + if isinstance(self.category, str): + category = self.category + else: + category = self.category + + resources = [] + for resources_item_data in self.resources: + resources_item = resources_item_data.to_dict() + resources.append(resources_item) + + + + issue: dict[str, Any] | None + if isinstance(self.issue, LavaflowIssueSummary): + issue = self.issue.to_dict() + else: + issue = self.issue + + progress: dict[str, Any] | None + if isinstance(self.progress, LavaflowRunProgress): + progress = self.progress.to_dict() + else: + progress = self.progress + + pull_request_skipped: None | str + if isinstance(self.pull_request_skipped, str): + pull_request_skipped = self.pull_request_skipped + else: + pull_request_skipped = self.pull_request_skipped + + lineage: dict[str, Any] | None + if isinstance(self.lineage, LavaflowLineage): + lineage = self.lineage.to_dict() + else: + lineage = self.lineage + + fix_outcome: dict[str, Any] | None + if isinstance(self.fix_outcome, LavaflowFixOutcome): + fix_outcome = self.fix_outcome.to_dict() + else: + fix_outcome = self.fix_outcome + + fix_summary = self.fix_summary + + delivery: dict[str, Any] | Unset = UNSET + if not isinstance(self.delivery, Unset): + delivery = self.delivery.to_dict() + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "id": id, + "project_id": project_id, + "status": status, + "resource": resource, + "issue_id": issue_id, + "title": title, + "created_at": created_at, + "finished_at": finished_at, + "pull_request": pull_request, + "merge": merge, + "mode": mode, + "category": category, + "resources": resources, + "issue": issue, + "progress": progress, + "pull_request_skipped": pull_request_skipped, + "lineage": lineage, + "fix_outcome": fix_outcome, + }) + if fix_summary is not UNSET: + field_dict["fix_summary"] = fix_summary + if delivery is not UNSET: + field_dict["delivery"] = delivery + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.lavaflow_delivery import LavaflowDelivery # noqa: PLC0415 + from ..models.lavaflow_fix_outcome import LavaflowFixOutcome # noqa: PLC0415 + from ..models.lavaflow_involved_resource import LavaflowInvolvedResource # noqa: PLC0415 + from ..models.lavaflow_issue_summary import LavaflowIssueSummary # noqa: PLC0415 + from ..models.lavaflow_lineage import LavaflowLineage # noqa: PLC0415 + from ..models.lavaflow_merge import LavaflowMerge # noqa: PLC0415 + from ..models.lavaflow_pull_request import LavaflowPullRequest # noqa: PLC0415 + from ..models.lavaflow_resource_reference import LavaflowResourceReference # noqa: PLC0415 + from ..models.lavaflow_run_progress import LavaflowRunProgress # noqa: PLC0415 + d = dict(src_dict) + id = UUID(d.pop("id")) + + + + + project_id = UUID(d.pop("project_id")) + + + + + status = check_lavaflow_run_status(d.pop("status")) + + + + + resource = LavaflowResourceReference.from_dict(d.pop("resource")) + + + + + issue_id = UUID(d.pop("issue_id")) + + + + + def _parse_title(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + title = _parse_title(d.pop("title")) + + + created_at = datetime.datetime.fromisoformat(d.pop("created_at")) + + + + + def _parse_finished_at(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + finished_at_type_0 = datetime.datetime.fromisoformat(data) + + + + return finished_at_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + finished_at = _parse_finished_at(d.pop("finished_at")) + + + def _parse_pull_request(data: object) -> LavaflowPullRequest | None: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + pull_request_type_1 = LavaflowPullRequest.from_dict(data) + + + + return pull_request_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(LavaflowPullRequest | None, data) + + pull_request = _parse_pull_request(d.pop("pull_request")) + + + def _parse_merge(data: object) -> LavaflowMerge | None: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + merge_type_1 = LavaflowMerge.from_dict(data) + + + + return merge_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(LavaflowMerge | None, data) + + merge = _parse_merge(d.pop("merge")) + + + mode = check_lavaflow_run_mode(d.pop("mode")) + + + + + def _parse_category(data: object) -> LavaflowRunCategory | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + category_type_1 = check_lavaflow_run_category(data) + + + + return category_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(LavaflowRunCategory | None, data) + + category = _parse_category(d.pop("category")) + + + resources = [] + _resources = d.pop("resources") + for resources_item_data in (_resources): + resources_item = LavaflowInvolvedResource.from_dict(resources_item_data) + + + + resources.append(resources_item) + + + def _parse_issue(data: object) -> LavaflowIssueSummary | None: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + issue_type_1 = LavaflowIssueSummary.from_dict(data) + + + + return issue_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(LavaflowIssueSummary | None, data) + + issue = _parse_issue(d.pop("issue")) + + + def _parse_progress(data: object) -> LavaflowRunProgress | None: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + progress_type_1 = LavaflowRunProgress.from_dict(data) + + + + return progress_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(LavaflowRunProgress | None, data) + + progress = _parse_progress(d.pop("progress")) + + + def _parse_pull_request_skipped(data: object) -> LavaflowSkipReason | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + pull_request_skipped_type_1 = check_lavaflow_skip_reason(data) + + + + return pull_request_skipped_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(LavaflowSkipReason | None, data) + + pull_request_skipped = _parse_pull_request_skipped(d.pop("pull_request_skipped")) + + + def _parse_lineage(data: object) -> LavaflowLineage | None: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + lineage_type_1 = LavaflowLineage.from_dict(data) + + + + return lineage_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(LavaflowLineage | None, data) + + lineage = _parse_lineage(d.pop("lineage")) + + + def _parse_fix_outcome(data: object) -> LavaflowFixOutcome | None: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + fix_outcome_type_1 = LavaflowFixOutcome.from_dict(data) + + + + return fix_outcome_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(LavaflowFixOutcome | None, data) + + fix_outcome = _parse_fix_outcome(d.pop("fix_outcome")) + + + fix_summary = d.pop("fix_summary", UNSET) + + _delivery = d.pop("delivery", UNSET) + delivery: LavaflowDelivery | Unset + if isinstance(_delivery, Unset): + delivery = UNSET + else: + delivery = LavaflowDelivery.from_dict(_delivery) + + + + + lavaflow_run_summary = cls( + id=id, + project_id=project_id, + status=status, + resource=resource, + issue_id=issue_id, + title=title, + created_at=created_at, + finished_at=finished_at, + pull_request=pull_request, + merge=merge, + mode=mode, + category=category, + resources=resources, + issue=issue, + progress=progress, + pull_request_skipped=pull_request_skipped, + lineage=lineage, + fix_outcome=fix_outcome, + fix_summary=fix_summary, + delivery=delivery, + ) + + + lavaflow_run_summary.additional_properties = d + return lavaflow_run_summary + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_scan.py b/src/volcano_sdk/_generated/models/lavaflow_scan.py new file mode 100644 index 00000000..29ae0b3a --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_scan.py @@ -0,0 +1,345 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.lavaflow_scan_source import check_lavaflow_scan_source +from ..models.lavaflow_scan_source import LavaflowScanSource +from ..models.lavaflow_scan_status import check_lavaflow_scan_status +from ..models.lavaflow_scan_status import LavaflowScanStatus +from typing import cast +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.lavaflow_scan_billed_finding import LavaflowScanBilledFinding + from ..models.lavaflow_scan_counts import LavaflowScanCounts + from ..models.lavaflow_scan_resource import LavaflowScanResource + + + + + +T = TypeVar("T", bound="LavaflowScan") + + + +@_attrs_define +class LavaflowScan: + """ One Code Quality scan of the code a project's deploys changed. + + Attributes: + id (None | UUID): The scan's ID, null while it is waiting. + project_id (UUID): + source (LavaflowScanSource): What asked for the scan. + status (LavaflowScanStatus): Where the scan stands. `waiting` is the project's next scan: deploys that went live + since the last one, waiting out a short settle window or a bound named by `waiting_reason`. + outcome (None | str): How a finished scan ended: `scanned`; `no_changes` when the deploy changed nothing since + the last scan, as after a redeploy or a rollback; `no_base` when there was no earlier commit to compare against, + so the head became the starting point; `unreachable` when the head commit is on neither the project's production + branch nor the repository's default branch; `repository_changed`; `failed`; or `cancelled`. Null until it ends. + waiting_reason (None | str): The bound a waiting scan waits at: `findings_limit`, `pull_request_limit`, + `spend_limit`, `scan_limit` or `feature_unavailable`; `feature_paused` means a platform publication pause is + holding the scan without spending its retry allowance. Null while it only waits out its settle window, and for a + scan that started. A waiting scan skips no deploy: it covers every commit since the last scan when it starts. + repository_id (int): The GitHub repository the scan reads. + base_sha (None | str): The commit the scan compares against, null while waiting or when there was none. + head_sha (str): The newest deployed commit the scan covers. + resources (list[LavaflowScanResource]): + truncated (bool): Whether the scan reviewed only part of the change. A change too large to review whole keeps + the files with the most changed lines, a review that stops early keeps what it found, and a repository too large + to read whole skips the files past what it read. No later scan covers the rest. + counts (LavaflowScanCounts): What the scan did with the problems it found. + billed (list[LavaflowScanBilledFinding]): The scan's findings whose runs were billed. + requested_at (datetime.datetime): When the first deploy the scan covers asked for it. + started_at (datetime.datetime | None): + completed_at (datetime.datetime | None): + """ + + id: None | UUID + project_id: UUID + source: LavaflowScanSource + status: LavaflowScanStatus + outcome: None | str + waiting_reason: None | str + repository_id: int + base_sha: None | str + head_sha: str + resources: list[LavaflowScanResource] + truncated: bool + counts: LavaflowScanCounts + billed: list[LavaflowScanBilledFinding] + requested_at: datetime.datetime + started_at: datetime.datetime | None + completed_at: datetime.datetime | None + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.lavaflow_scan_billed_finding import LavaflowScanBilledFinding # noqa: PLC0415 + from ..models.lavaflow_scan_counts import LavaflowScanCounts # noqa: PLC0415 + from ..models.lavaflow_scan_resource import LavaflowScanResource # noqa: PLC0415 + id: None | str + if isinstance(self.id, UUID): + id = str(self.id) + else: + id = self.id + + project_id = str(self.project_id) + + source: str = self.source + + status: str = self.status + + outcome: None | str + outcome = self.outcome + + waiting_reason: None | str + waiting_reason = self.waiting_reason + + repository_id = self.repository_id + + base_sha: None | str + base_sha = self.base_sha + + head_sha = self.head_sha + + resources = [] + for resources_item_data in self.resources: + resources_item = resources_item_data.to_dict() + resources.append(resources_item) + + + + truncated = self.truncated + + counts = self.counts.to_dict() + + billed = [] + for billed_item_data in self.billed: + billed_item = billed_item_data.to_dict() + billed.append(billed_item) + + + + requested_at = self.requested_at.isoformat() + + started_at: None | str + if isinstance(self.started_at, datetime.datetime): + started_at = self.started_at.isoformat() + else: + started_at = self.started_at + + completed_at: None | str + if isinstance(self.completed_at, datetime.datetime): + completed_at = self.completed_at.isoformat() + else: + completed_at = self.completed_at + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "id": id, + "project_id": project_id, + "source": source, + "status": status, + "outcome": outcome, + "waiting_reason": waiting_reason, + "repository_id": repository_id, + "base_sha": base_sha, + "head_sha": head_sha, + "resources": resources, + "truncated": truncated, + "counts": counts, + "billed": billed, + "requested_at": requested_at, + "started_at": started_at, + "completed_at": completed_at, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.lavaflow_scan_billed_finding import LavaflowScanBilledFinding # noqa: PLC0415 + from ..models.lavaflow_scan_counts import LavaflowScanCounts # noqa: PLC0415 + from ..models.lavaflow_scan_resource import LavaflowScanResource # noqa: PLC0415 + d = dict(src_dict) + def _parse_id(data: object) -> None | UUID: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + id_type_0 = UUID(data) + + + + return id_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | UUID, data) + + id = _parse_id(d.pop("id")) + + + project_id = UUID(d.pop("project_id")) + + + + + source = check_lavaflow_scan_source(d.pop("source")) + + + + + status = check_lavaflow_scan_status(d.pop("status")) + + + + + def _parse_outcome(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + outcome = _parse_outcome(d.pop("outcome")) + + + def _parse_waiting_reason(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + waiting_reason = _parse_waiting_reason(d.pop("waiting_reason")) + + + repository_id = d.pop("repository_id") + + def _parse_base_sha(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + base_sha = _parse_base_sha(d.pop("base_sha")) + + + head_sha = d.pop("head_sha") + + resources = [] + _resources = d.pop("resources") + for resources_item_data in (_resources): + resources_item = LavaflowScanResource.from_dict(resources_item_data) + + + + resources.append(resources_item) + + + truncated = d.pop("truncated") + + counts = LavaflowScanCounts.from_dict(d.pop("counts")) + + + + + billed = [] + _billed = d.pop("billed") + for billed_item_data in (_billed): + billed_item = LavaflowScanBilledFinding.from_dict(billed_item_data) + + + + billed.append(billed_item) + + + requested_at = datetime.datetime.fromisoformat(d.pop("requested_at")) + + + + + def _parse_started_at(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + started_at_type_0 = datetime.datetime.fromisoformat(data) + + + + return started_at_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + started_at = _parse_started_at(d.pop("started_at")) + + + def _parse_completed_at(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + completed_at_type_0 = datetime.datetime.fromisoformat(data) + + + + return completed_at_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + completed_at = _parse_completed_at(d.pop("completed_at")) + + + lavaflow_scan = cls( + id=id, + project_id=project_id, + source=source, + status=status, + outcome=outcome, + waiting_reason=waiting_reason, + repository_id=repository_id, + base_sha=base_sha, + head_sha=head_sha, + resources=resources, + truncated=truncated, + counts=counts, + billed=billed, + requested_at=requested_at, + started_at=started_at, + completed_at=completed_at, + ) + + + lavaflow_scan.additional_properties = d + return lavaflow_scan + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_scan_billed_finding.py b/src/volcano_sdk/_generated/models/lavaflow_scan_billed_finding.py new file mode 100644 index 00000000..8077d4b2 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_scan_billed_finding.py @@ -0,0 +1,114 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast +from uuid import UUID + +if TYPE_CHECKING: + from ..models.lavaflow_scan_billed_finding_billable_events import LavaflowScanBilledFindingBillableEvents + + + + + +T = TypeVar("T", bound="LavaflowScanBilledFinding") + + + +@_attrs_define +class LavaflowScanBilledFinding: + """ A finding of the scan whose Code Quality runs were billed. + + Attributes: + issue_id (UUID): The finding's issue. Its `finding` says where the problem is and why. + rule (str): The rule the finding is about. + title (str): + billable_events (LavaflowScanBilledFindingBillableEvents): How many billable events of each kind the finding's + runs recorded, keyed by kind, such as `issue_diagnosed` and `pull_request_opened`. + """ + + issue_id: UUID + rule: str + title: str + billable_events: LavaflowScanBilledFindingBillableEvents + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.lavaflow_scan_billed_finding_billable_events import LavaflowScanBilledFindingBillableEvents # noqa: PLC0415 + issue_id = str(self.issue_id) + + rule = self.rule + + title = self.title + + billable_events = self.billable_events.to_dict() + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "issue_id": issue_id, + "rule": rule, + "title": title, + "billable_events": billable_events, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.lavaflow_scan_billed_finding_billable_events import LavaflowScanBilledFindingBillableEvents # noqa: PLC0415 + d = dict(src_dict) + issue_id = UUID(d.pop("issue_id")) + + + + + rule = d.pop("rule") + + title = d.pop("title") + + billable_events = LavaflowScanBilledFindingBillableEvents.from_dict(d.pop("billable_events")) + + + + + lavaflow_scan_billed_finding = cls( + issue_id=issue_id, + rule=rule, + title=title, + billable_events=billable_events, + ) + + + lavaflow_scan_billed_finding.additional_properties = d + return lavaflow_scan_billed_finding + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_scan_billed_finding_billable_events.py b/src/volcano_sdk/_generated/models/lavaflow_scan_billed_finding_billable_events.py new file mode 100644 index 00000000..179324d4 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_scan_billed_finding_billable_events.py @@ -0,0 +1,67 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="LavaflowScanBilledFindingBillableEvents") + + + +@_attrs_define +class LavaflowScanBilledFindingBillableEvents: + """ How many billable events of each kind the finding's runs recorded, keyed by kind, such as `issue_diagnosed` and + `pull_request_opened`. + + """ + + additional_properties: dict[str, int] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + lavaflow_scan_billed_finding_billable_events = cls( + ) + + + lavaflow_scan_billed_finding_billable_events.additional_properties = d + return lavaflow_scan_billed_finding_billable_events + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> int: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: int) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_scan_counts.py b/src/volcano_sdk/_generated/models/lavaflow_scan_counts.py new file mode 100644 index 00000000..677435e0 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_scan_counts.py @@ -0,0 +1,118 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="LavaflowScanCounts") + + + +@_attrs_define +class LavaflowScanCounts: + """ What the scan did with the problems it found. + + Attributes: + found (int): Candidates the scan found in the changed lines. + created (int): New issues the scan opened. + duplicate (int): Candidates that matched an issue the project already has, or a finding the scan already kept. + suppressed (int): Candidates a person had already turned down, by closing their pull request or ignoring their + issue. + capped (int): Confirmed findings past the plan's findings per scan, which no later scan reports again. + rejected (int): Candidates LavaFlow's second check didn't confirm, or that it couldn't report. + """ + + found: int + created: int + duplicate: int + suppressed: int + capped: int + rejected: int + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + found = self.found + + created = self.created + + duplicate = self.duplicate + + suppressed = self.suppressed + + capped = self.capped + + rejected = self.rejected + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "found": found, + "created": created, + "duplicate": duplicate, + "suppressed": suppressed, + "capped": capped, + "rejected": rejected, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + found = d.pop("found") + + created = d.pop("created") + + duplicate = d.pop("duplicate") + + suppressed = d.pop("suppressed") + + capped = d.pop("capped") + + rejected = d.pop("rejected") + + lavaflow_scan_counts = cls( + found=found, + created=created, + duplicate=duplicate, + suppressed=suppressed, + capped=capped, + rejected=rejected, + ) + + + lavaflow_scan_counts.additional_properties = d + return lavaflow_scan_counts + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_scan_resource.py b/src/volcano_sdk/_generated/models/lavaflow_scan_resource.py new file mode 100644 index 00000000..0d950aa4 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_scan_resource.py @@ -0,0 +1,106 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.lavaflow_scan_resource_resource_type import check_lavaflow_scan_resource_resource_type +from ..models.lavaflow_scan_resource_resource_type import LavaflowScanResourceResourceType +from typing import cast +from uuid import UUID + + + + + + +T = TypeVar("T", bound="LavaflowScanResource") + + + +@_attrs_define +class LavaflowScanResource: + """ A resource whose production deploy the scan covers. Only frontend deploys ask for a scan for now. + + Attributes: + resource_type (LavaflowScanResourceResourceType): + resource_id (UUID): + deployment_id (UUID): + """ + + resource_type: LavaflowScanResourceResourceType + resource_id: UUID + deployment_id: UUID + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + resource_type: str = self.resource_type + + resource_id = str(self.resource_id) + + deployment_id = str(self.deployment_id) + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "resource_type": resource_type, + "resource_id": resource_id, + "deployment_id": deployment_id, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + resource_type = check_lavaflow_scan_resource_resource_type(d.pop("resource_type")) + + + + + resource_id = UUID(d.pop("resource_id")) + + + + + deployment_id = UUID(d.pop("deployment_id")) + + + + + lavaflow_scan_resource = cls( + resource_type=resource_type, + resource_id=resource_id, + deployment_id=deployment_id, + ) + + + lavaflow_scan_resource.additional_properties = d + return lavaflow_scan_resource + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_scan_resource_resource_type.py b/src/volcano_sdk/_generated/models/lavaflow_scan_resource_resource_type.py new file mode 100644 index 00000000..fb71bc16 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_scan_resource_resource_type.py @@ -0,0 +1,10 @@ +from typing import Literal + +LavaflowScanResourceResourceType = Literal['frontend', 'function'] + +LAVAFLOW_SCAN_RESOURCE_RESOURCE_TYPE_VALUES: set[LavaflowScanResourceResourceType] = { 'frontend', 'function', } + +def check_lavaflow_scan_resource_resource_type(value: str) -> LavaflowScanResourceResourceType: + if value in LAVAFLOW_SCAN_RESOURCE_RESOURCE_TYPE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {LAVAFLOW_SCAN_RESOURCE_RESOURCE_TYPE_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/lavaflow_scan_source.py b/src/volcano_sdk/_generated/models/lavaflow_scan_source.py new file mode 100644 index 00000000..7fd78a87 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_scan_source.py @@ -0,0 +1,10 @@ +from typing import Literal + +LavaflowScanSource = Literal['deployment'] + +LAVAFLOW_SCAN_SOURCE_VALUES: set[LavaflowScanSource] = { 'deployment', } + +def check_lavaflow_scan_source(value: str) -> LavaflowScanSource: + if value in LAVAFLOW_SCAN_SOURCE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {LAVAFLOW_SCAN_SOURCE_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/lavaflow_scan_status.py b/src/volcano_sdk/_generated/models/lavaflow_scan_status.py new file mode 100644 index 00000000..924ad7be --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_scan_status.py @@ -0,0 +1,10 @@ +from typing import Literal + +LavaflowScanStatus = Literal['cancelled', 'completed', 'failed', 'running', 'waiting'] + +LAVAFLOW_SCAN_STATUS_VALUES: set[LavaflowScanStatus] = { 'cancelled', 'completed', 'failed', 'running', 'waiting', } + +def check_lavaflow_scan_status(value: str) -> LavaflowScanStatus: + if value in LAVAFLOW_SCAN_STATUS_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {LAVAFLOW_SCAN_STATUS_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/lavaflow_settings.py b/src/volcano_sdk/_generated/models/lavaflow_settings.py new file mode 100644 index 00000000..64e1b376 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_settings.py @@ -0,0 +1,290 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.lavaflow_autonomy import check_lavaflow_autonomy +from ..models.lavaflow_autonomy import LavaflowAutonomy +from typing import cast +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.lavaflow_code_quality_settings import LavaflowCodeQualitySettings + from ..models.lavaflow_failure import LavaflowFailure + from ..models.lavaflow_merge_policy import LavaflowMergePolicy + from ..models.project_git_connection_summary import ProjectGitConnectionSummary + + + + + +T = TypeVar("T", bound="LavaflowSettings") + + + +@_attrs_define +class LavaflowSettings: + """ A project's LavaFlow settings. LavaFlow sends this project's logs and source code to an AI service that Volcano + operates. + + Attributes: + project_id (UUID): The project the settings belong to. + enabled (bool): Whether LavaFlow works on the project's issues. Off by default. + autonomy (LavaflowAutonomy): How far LavaFlow goes on its own. `diagnose_only` stops at a diagnosis. `open_pr` + also opens a pull request with a fix, and never merges it. `merge` also merges the fix once LavaFlow's reviewers + pass it, its required checks pass, and nothing holds it; a held fix is handed to you for good. LavaFlow merges + only into a base branch that requires at least one status check, through branch protection or a ruleset; on any + other branch it holds every fix with `no_required_checks`. Turning on merge lets LavaFlow's fixes, including + those from runs it starts on its own, run your CI with the secrets your pull request workflows get. Choosing + `merge` needs the project's `lavaflow.merge` capability. + merge_policy (LavaflowMergePolicy): Your rules for fixes LavaFlow must never merge. They apply with `autonomy: + merge`; at another autonomy they are saved and do nothing. + code_quality (LavaflowCodeQualitySettings): LavaFlow Code Quality: whether LavaFlow reviews the code each + production deploy changes and opens pull requests that fix what it confirms. + allow_ungated_workflows (bool): The owner's repository-bound permission for LavaFlow fixes to run workflows with + the repository's configured credentials before human review. Normal repository CI requires this permission in + addition to the lavaflow.repository_ci capability. Off by default; without permission, the existing guarded + workflow policy applies and a fix may be held instead of opening a pull request. Only the project's owner, + signed in with a live login credential or an expiring platform token, can grant permission for a repository + their GitHub account can push to. Changing or disconnecting the repository, or changing its GitHub App + installation, clears the permission. A rename with the same repository and installation IDs retains it. + Reconnecting an earlier binding does not restore a revoked grant. Workflows may run generated code influenced by + issue and log input, with their configured credentials, before review. This includes draft PRs, fixes whose + LavaFlow review did not pass, and fixes held for a person to review. In Merge mode, eligible fixes from + connected issue sources can use this grant while LavaFlow takes the reviewed pull request through the + repository's required checks and approvals. Revocation stops later unrestricted publication writes; existing PRs + and CI runs remain. + updated_at (datetime.datetime | None): When the settings were last saved, or last changed by connecting a + repository. Null until they first are. + updated_by (None | str): The user ID of the person who made the last save; null when no person made it, such as + a project access token. + can_update (bool): Whether the caller can save the settings: true only for the project's owner with a platform + token while the owner's account is active; false for any project access token and for a read-only account. + repository (None | ProjectGitConnectionSummary): The GitHub repository the project is linked to, as `GET + /projects/{id}/git-connection` reports it. LavaFlow opens fix pull requests there, against `production_branch`. + Null when the project has none. + fix_blocker (LavaflowFailure | None): What in the project's repository setup stops LavaFlow from fixing issues + although it is on. Null when the repository setup doesn't, and while the project's `lavaflow` capability isn't + available; null doesn't mean nothing else stops LavaFlow. `message` is text to show as given. + `repository_required`: the project has no linked repository. With `autonomy` `open_pr` or `merge`, LavaFlow + diagnoses issues but fixes none; turned on for a repository the project no longer links, it starts no runs. Link + a repository with `PUT /projects/{id}/git-connection` or `volcano git connect `. Turned on with none, + LavaFlow fixes issues in the first one linked, unless `message` asks to turn it on again after the link; linking + the one it was turned on for resumes it. `repository_changed`: the project is linked to a repository LavaFlow + wasn't turned on for. LavaFlow starts no runs until the owner turns it on again, with `{"enabled": true}` or + `volcano cloud lavaflow enable`, which makes the linked repository the one it fixes. New codes may appear; show + the `message` of one you don't know. + """ + + project_id: UUID + enabled: bool + autonomy: LavaflowAutonomy + merge_policy: LavaflowMergePolicy + code_quality: LavaflowCodeQualitySettings + allow_ungated_workflows: bool + updated_at: datetime.datetime | None + updated_by: None | str + can_update: bool + repository: None | ProjectGitConnectionSummary + fix_blocker: LavaflowFailure | None + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.lavaflow_code_quality_settings import LavaflowCodeQualitySettings # noqa: PLC0415 + from ..models.lavaflow_failure import LavaflowFailure # noqa: PLC0415 + from ..models.lavaflow_merge_policy import LavaflowMergePolicy # noqa: PLC0415 + from ..models.project_git_connection_summary import ProjectGitConnectionSummary # noqa: PLC0415 + project_id = str(self.project_id) + + enabled = self.enabled + + autonomy: str = self.autonomy + + merge_policy = self.merge_policy.to_dict() + + code_quality = self.code_quality.to_dict() + + allow_ungated_workflows = self.allow_ungated_workflows + + updated_at: None | str + if isinstance(self.updated_at, datetime.datetime): + updated_at = self.updated_at.isoformat() + else: + updated_at = self.updated_at + + updated_by: None | str + updated_by = self.updated_by + + can_update = self.can_update + + repository: dict[str, Any] | None + if isinstance(self.repository, ProjectGitConnectionSummary): + repository = self.repository.to_dict() + else: + repository = self.repository + + fix_blocker: dict[str, Any] | None + if isinstance(self.fix_blocker, LavaflowFailure): + fix_blocker = self.fix_blocker.to_dict() + else: + fix_blocker = self.fix_blocker + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "project_id": project_id, + "enabled": enabled, + "autonomy": autonomy, + "merge_policy": merge_policy, + "code_quality": code_quality, + "allow_ungated_workflows": allow_ungated_workflows, + "updated_at": updated_at, + "updated_by": updated_by, + "can_update": can_update, + "repository": repository, + "fix_blocker": fix_blocker, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.lavaflow_code_quality_settings import LavaflowCodeQualitySettings # noqa: PLC0415 + from ..models.lavaflow_failure import LavaflowFailure # noqa: PLC0415 + from ..models.lavaflow_merge_policy import LavaflowMergePolicy # noqa: PLC0415 + from ..models.project_git_connection_summary import ProjectGitConnectionSummary # noqa: PLC0415 + d = dict(src_dict) + project_id = UUID(d.pop("project_id")) + + + + + enabled = d.pop("enabled") + + autonomy = check_lavaflow_autonomy(d.pop("autonomy")) + + + + + merge_policy = LavaflowMergePolicy.from_dict(d.pop("merge_policy")) + + + + + code_quality = LavaflowCodeQualitySettings.from_dict(d.pop("code_quality")) + + + + + allow_ungated_workflows = d.pop("allow_ungated_workflows") + + def _parse_updated_at(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + updated_at_type_0 = datetime.datetime.fromisoformat(data) + + + + return updated_at_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + updated_at = _parse_updated_at(d.pop("updated_at")) + + + def _parse_updated_by(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + updated_by = _parse_updated_by(d.pop("updated_by")) + + + can_update = d.pop("can_update") + + def _parse_repository(data: object) -> None | ProjectGitConnectionSummary: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + repository_type_1 = ProjectGitConnectionSummary.from_dict(data) + + + + return repository_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | ProjectGitConnectionSummary, data) + + repository = _parse_repository(d.pop("repository")) + + + def _parse_fix_blocker(data: object) -> LavaflowFailure | None: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + fix_blocker_type_1 = LavaflowFailure.from_dict(data) + + + + return fix_blocker_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(LavaflowFailure | None, data) + + fix_blocker = _parse_fix_blocker(d.pop("fix_blocker")) + + + lavaflow_settings = cls( + project_id=project_id, + enabled=enabled, + autonomy=autonomy, + merge_policy=merge_policy, + code_quality=code_quality, + allow_ungated_workflows=allow_ungated_workflows, + updated_at=updated_at, + updated_by=updated_by, + can_update=can_update, + repository=repository, + fix_blocker=fix_blocker, + ) + + + lavaflow_settings.additional_properties = d + return lavaflow_settings + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_settings_update.py b/src/volcano_sdk/_generated/models/lavaflow_settings_update.py new file mode 100644 index 00000000..3323cc67 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_settings_update.py @@ -0,0 +1,193 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.lavaflow_autonomy import check_lavaflow_autonomy +from ..models.lavaflow_autonomy import LavaflowAutonomy +from ..types import UNSET, Unset +from typing import cast +from uuid import UUID + +if TYPE_CHECKING: + from ..models.lavaflow_code_quality_update import LavaflowCodeQualityUpdate + from ..models.lavaflow_merge_policy_update import LavaflowMergePolicyUpdate + from ..models.lavaflow_repository_expectation import LavaflowRepositoryExpectation + + + + + +T = TypeVar("T", bound="LavaflowSettingsUpdate") + + + +@_attrs_define +class LavaflowSettingsUpdate: + """ The project, and at least one field to change. An omitted field keeps its saved value. A repository precondition + alone is not a setting change. + + Attributes: + project_id (UUID): The project whose settings to change. + enabled (bool | Unset): + autonomy (LavaflowAutonomy | Unset): How far LavaFlow goes on its own. `diagnose_only` stops at a diagnosis. + `open_pr` also opens a pull request with a fix, and never merges it. `merge` also merges the fix once LavaFlow's + reviewers pass it, its required checks pass, and nothing holds it; a held fix is handed to you for good. + LavaFlow merges only into a base branch that requires at least one status check, through branch protection or a + ruleset; on any other branch it holds every fix with `no_required_checks`. Turning on merge lets LavaFlow's + fixes, including those from runs it starts on its own, run your CI with the secrets your pull request workflows + get. Choosing `merge` needs the project's `lavaflow.merge` capability. + merge_policy (LavaflowMergePolicyUpdate | Unset): The merge policy fields to change. An omitted field keeps its + saved value. Send `human_review_paths: []` to clear the paths. + code_quality (LavaflowCodeQualityUpdate | Unset): Turns Code Quality on or off. Only the project's owner, signed + in, can turn it on; any credential that can save the settings can turn it off. + expected_repository (LavaflowRepositoryExpectation | Unset): The repository connection the caller expects. This + is a save precondition, not an instruction to change the connection. + allow_ungated_workflows (bool | Unset): Grants or revokes repository CI permission for the current repository + and GitHub App installation. Normal repository CI requires both this permission and lavaflow.repository_ci + availability. Only the project owner can grant it, using a live login credential or an expiring platform token; + their GitHub account must have push access to the connected repository. Project tokens, non-expiring platform + tokens, and other users cannot grant it (403 person_required). Any owner credential can revoke it. Generated + fixes may be influenced by untrusted issue and log input, and configured CI and previews may execute those fixes + with their credentials before human review. This includes draft PRs, fixes whose LavaFlow review did not pass, + and fixes held for a person to review. In Merge mode, eligible fixes from connected issue sources can use this + grant while LavaFlow follows them through the repository's required reviews and checks. Changing or + disconnecting the repository or installation revokes the grant; returning to an earlier binding does not restore + it. Revocation does not cancel existing PRs or CI runs. While LavaFlow is unavailable, only false is saved, + together with enabled: false. + """ + + project_id: UUID + enabled: bool | Unset = UNSET + autonomy: LavaflowAutonomy | Unset = UNSET + merge_policy: LavaflowMergePolicyUpdate | Unset = UNSET + code_quality: LavaflowCodeQualityUpdate | Unset = UNSET + expected_repository: LavaflowRepositoryExpectation | Unset = UNSET + allow_ungated_workflows: bool | Unset = UNSET + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.lavaflow_code_quality_update import LavaflowCodeQualityUpdate # noqa: PLC0415 + from ..models.lavaflow_merge_policy_update import LavaflowMergePolicyUpdate # noqa: PLC0415 + from ..models.lavaflow_repository_expectation import LavaflowRepositoryExpectation # noqa: PLC0415 + project_id = str(self.project_id) + + enabled = self.enabled + + autonomy: str | Unset = UNSET + if not isinstance(self.autonomy, Unset): + autonomy = self.autonomy + + + merge_policy: dict[str, Any] | Unset = UNSET + if not isinstance(self.merge_policy, Unset): + merge_policy = self.merge_policy.to_dict() + + code_quality: dict[str, Any] | Unset = UNSET + if not isinstance(self.code_quality, Unset): + code_quality = self.code_quality.to_dict() + + expected_repository: dict[str, Any] | Unset = UNSET + if not isinstance(self.expected_repository, Unset): + expected_repository = self.expected_repository.to_dict() + + allow_ungated_workflows = self.allow_ungated_workflows + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "project_id": project_id, + }) + if enabled is not UNSET: + field_dict["enabled"] = enabled + if autonomy is not UNSET: + field_dict["autonomy"] = autonomy + if merge_policy is not UNSET: + field_dict["merge_policy"] = merge_policy + if code_quality is not UNSET: + field_dict["code_quality"] = code_quality + if expected_repository is not UNSET: + field_dict["expected_repository"] = expected_repository + if allow_ungated_workflows is not UNSET: + field_dict["allow_ungated_workflows"] = allow_ungated_workflows + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.lavaflow_code_quality_update import LavaflowCodeQualityUpdate # noqa: PLC0415 + from ..models.lavaflow_merge_policy_update import LavaflowMergePolicyUpdate # noqa: PLC0415 + from ..models.lavaflow_repository_expectation import LavaflowRepositoryExpectation # noqa: PLC0415 + d = dict(src_dict) + project_id = UUID(d.pop("project_id")) + + + + + enabled = d.pop("enabled", UNSET) + + _autonomy = d.pop("autonomy", UNSET) + autonomy: LavaflowAutonomy | Unset + if isinstance(_autonomy, Unset): + autonomy = UNSET + else: + autonomy = check_lavaflow_autonomy(_autonomy) + + + + + _merge_policy = d.pop("merge_policy", UNSET) + merge_policy: LavaflowMergePolicyUpdate | Unset + if isinstance(_merge_policy, Unset): + merge_policy = UNSET + else: + merge_policy = LavaflowMergePolicyUpdate.from_dict(_merge_policy) + + + + + _code_quality = d.pop("code_quality", UNSET) + code_quality: LavaflowCodeQualityUpdate | Unset + if isinstance(_code_quality, Unset): + code_quality = UNSET + else: + code_quality = LavaflowCodeQualityUpdate.from_dict(_code_quality) + + + + + _expected_repository = d.pop("expected_repository", UNSET) + expected_repository: LavaflowRepositoryExpectation | Unset + if isinstance(_expected_repository, Unset): + expected_repository = UNSET + else: + expected_repository = LavaflowRepositoryExpectation.from_dict(_expected_repository) + + + + + allow_ungated_workflows = d.pop("allow_ungated_workflows", UNSET) + + lavaflow_settings_update = cls( + project_id=project_id, + enabled=enabled, + autonomy=autonomy, + merge_policy=merge_policy, + code_quality=code_quality, + expected_repository=expected_repository, + allow_ungated_workflows=allow_ungated_workflows, + ) + + return lavaflow_settings_update + diff --git a/src/volcano_sdk/_generated/models/lavaflow_skip_reason.py b/src/volcano_sdk/_generated/models/lavaflow_skip_reason.py new file mode 100644 index 00000000..8645a207 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_skip_reason.py @@ -0,0 +1,10 @@ +from typing import Literal + +LavaflowSkipReason = Literal['convention_unsatisfiable', 'diagnose_only', 'draft_unavailable', 'duplicate_in_repository', 'lineage_cap', 'lineage_held', 'low_confidence', 'no_patch', 'not_fixable', 'permission_missing', 'possible_credential', 'possible_personal_data', 'publish_failed', 'pull_request_open', 'repository_changed', 'review_unresolved', 'security_finding', 'source_unavailable', 'ungated_workflows'] + +LAVAFLOW_SKIP_REASON_VALUES: set[LavaflowSkipReason] = { 'convention_unsatisfiable', 'diagnose_only', 'draft_unavailable', 'duplicate_in_repository', 'lineage_cap', 'lineage_held', 'low_confidence', 'no_patch', 'not_fixable', 'permission_missing', 'possible_credential', 'possible_personal_data', 'publish_failed', 'pull_request_open', 'repository_changed', 'review_unresolved', 'security_finding', 'source_unavailable', 'ungated_workflows', } + +def check_lavaflow_skip_reason(value: str) -> LavaflowSkipReason: + if value in LAVAFLOW_SKIP_REASON_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {LAVAFLOW_SKIP_REASON_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/lavaflow_slack_binding.py b/src/volcano_sdk/_generated/models/lavaflow_slack_binding.py new file mode 100644 index 00000000..8f036118 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_slack_binding.py @@ -0,0 +1,93 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="LavaflowSlackBinding") + + + +@_attrs_define +class LavaflowSlackBinding: + """ The Slack channel a binding reports from. Present when `connector_type` is `slack`. + + Attributes: + team_id (str): A Slack workspace ID, such as `T0123ABCD`. + team_name (str): The workspace's name, or empty while the Volcano app is not installed in it. + channel_id (str): A Slack channel ID, such as `C0123ABCD`. + """ + + team_id: str + team_name: str + channel_id: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + team_id = self.team_id + + team_name = self.team_name + + channel_id = self.channel_id + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "team_id": team_id, + "team_name": team_name, + "channel_id": channel_id, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + team_id = d.pop("team_id") + + team_name = d.pop("team_name") + + channel_id = d.pop("channel_id") + + lavaflow_slack_binding = cls( + team_id=team_id, + team_name=team_name, + channel_id=channel_id, + ) + + + lavaflow_slack_binding.additional_properties = d + return lavaflow_slack_binding + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_slack_binding_target.py b/src/volcano_sdk/_generated/models/lavaflow_slack_binding_target.py new file mode 100644 index 00000000..a405a85f --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_slack_binding_target.py @@ -0,0 +1,59 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="LavaflowSlackBindingTarget") + + + +@_attrs_define +class LavaflowSlackBindingTarget: + """ The channel to bind, for a `slack` connector. + + Attributes: + channel_id (str): A Slack channel ID, such as `C0123ABCD`. + """ + + channel_id: str + + + + + + def to_dict(self) -> dict[str, Any]: + channel_id = self.channel_id + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "channel_id": channel_id, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + channel_id = d.pop("channel_id") + + lavaflow_slack_binding_target = cls( + channel_id=channel_id, + ) + + return lavaflow_slack_binding_target + diff --git a/src/volcano_sdk/_generated/models/lavaflow_source_commit.py b/src/volcano_sdk/_generated/models/lavaflow_source_commit.py new file mode 100644 index 00000000..6d8a98f1 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_source_commit.py @@ -0,0 +1,109 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.lavaflow_commit_origin import check_lavaflow_commit_origin +from ..models.lavaflow_commit_origin import LavaflowCommitOrigin +from typing import cast + + + + + + +T = TypeVar("T", bound="LavaflowSourceCommit") + + + +@_attrs_define +class LavaflowSourceCommit: + """ The commit a run read its source at. + + Attributes: + sha (str): The commit's full SHA. + origin (LavaflowCommitOrigin | None): Where the commit came from. Null for a run recorded before Volcano kept + it. + """ + + sha: str + origin: LavaflowCommitOrigin | None + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + sha = self.sha + + origin: None | str + if isinstance(self.origin, str): + origin = self.origin + else: + origin = self.origin + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "sha": sha, + "origin": origin, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + sha = d.pop("sha") + + def _parse_origin(data: object) -> LavaflowCommitOrigin | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + origin_type_1 = check_lavaflow_commit_origin(data) + + + + return origin_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(LavaflowCommitOrigin | None, data) + + origin = _parse_origin(d.pop("origin")) + + + lavaflow_source_commit = cls( + sha=sha, + origin=origin, + ) + + + lavaflow_source_commit.additional_properties = d + return lavaflow_source_commit + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_source_unavailable.py b/src/volcano_sdk/_generated/models/lavaflow_source_unavailable.py new file mode 100644 index 00000000..fcb0291c --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_source_unavailable.py @@ -0,0 +1,145 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.lavaflow_source_unavailable_reason import check_lavaflow_source_unavailable_reason +from ..models.lavaflow_source_unavailable_reason import LavaflowSourceUnavailableReason +from typing import cast +from uuid import UUID + + + + + + +T = TypeVar("T", bound="LavaflowSourceUnavailable") + + + +@_attrs_define +class LavaflowSourceUnavailable: + """ Why LavaFlow couldn't read, or open a fix on, the code that served a run's error. The run can still be awaiting a + retry. + + Attributes: + reason (LavaflowSourceUnavailableReason): Why LavaFlow couldn't read, or open a fix on, the code that served the + error, with what you can do. LavaFlow reads the deployment that served the error, so once you deploy code it can + read, it starts a new run when the error happens again. `no_repository`: LavaFlow is on for no repository; link + one. `no_commit`: the deployment recorded no commit, nor did the build a redeploy serves, or no deployment was + serving; deploy by pushing to the linked repository's production branch, or with the CLI from a clean checkout + of a commit on that branch. `uncommitted_changes`: the deployment's files differ from its commit (`dirty: + true`), as when the checkout had uncommitted changes; commit and push them, then deploy from the clean checkout. + `unverified_commit`: Volcano couldn't verify the deployment's commit against the linked repository + (`verification: none`), for example because the commit isn't on the production branch, or the deployment is a + function redeploy, which doesn't carry its upload's `verification: repository` commit; push the commit to the + production branch and deploy it again. `other_repository`: the commit LavaFlow would read is from a repository + other than the one LavaFlow is on for, Volcano checked it under an earlier repository link, or the project no + longer links that repository. For a deployment, deploy again from the linked repository; for a reported problem + or a Code Quality finding, start a new run while the project links the repository LavaFlow is on for. + `repository_unreadable`: LavaFlow couldn't read the repository at the commit, for example because the Volcano + GitHub App lost access to it; check the project's repository link and the App's access. + `repository_rate_limited`: GitHub throttled reads of the verified commit. `repository_provider_unavailable`: + GitHub did not complete the read. `repository_download_interrupted`: the source archive could not finish + downloading. For these three reasons, a queued or running retry may recover automatically. If the run has + finished, check that GitHub can serve the exact commit archive before starting a new run. + `repository_access_denied`: GitHub refused access to the repository or archive. Restore the project's GitHub + connection and read access to the verified commit. `repository_source_invalid`: the verified commit or its + archive could not be read as valid repository source. Verify that the linked repository serves a valid archive + for that commit, or deploy from a verified commit. `commit_not_on_production_branch`: the production branch no + longer holds the commit the fix is on, so LavaFlow opened no pull request; deploy from the production branch. + `deployment_unattributed`: a newer deployment that may have changed the code was going live when the error + happened, so LavaFlow couldn't tell which one threw it; if the error happens again, LavaFlow starts a new run + once; if that run also ends `deployment_unattributed`, the next waits for a new deploy. A + `deployment_unattributed` run right after another one, even one a deploy started, gets no such run. New reasons + may appear. + deployment_id (None | UUID): The deployment of the run's `resource` that served the error, for `no_commit`, + `uncommitted_changes`, `unverified_commit` and `other_repository`, or for a repository read failure after + LavaFlow verified the serving deployment. Null when no deployment can be identified. Example: + 7c2e5a1f-3b8d-4e6a-9f0c-1d2e3f4a5b6c. + """ + + reason: LavaflowSourceUnavailableReason + deployment_id: None | UUID + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + reason: str = self.reason + + deployment_id: None | str + if isinstance(self.deployment_id, UUID): + deployment_id = str(self.deployment_id) + else: + deployment_id = self.deployment_id + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "reason": reason, + "deployment_id": deployment_id, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + reason = check_lavaflow_source_unavailable_reason(d.pop("reason")) + + + + + def _parse_deployment_id(data: object) -> None | UUID: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + deployment_id_type_0 = UUID(data) + + + + return deployment_id_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | UUID, data) + + deployment_id = _parse_deployment_id(d.pop("deployment_id")) + + + lavaflow_source_unavailable = cls( + reason=reason, + deployment_id=deployment_id, + ) + + + lavaflow_source_unavailable.additional_properties = d + return lavaflow_source_unavailable + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_source_unavailable_reason.py b/src/volcano_sdk/_generated/models/lavaflow_source_unavailable_reason.py new file mode 100644 index 00000000..ccb663d5 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_source_unavailable_reason.py @@ -0,0 +1,10 @@ +from typing import Literal + +LavaflowSourceUnavailableReason = Literal['commit_not_on_production_branch', 'deployment_unattributed', 'no_commit', 'no_repository', 'other_repository', 'repository_access_denied', 'repository_download_interrupted', 'repository_provider_unavailable', 'repository_rate_limited', 'repository_source_invalid', 'repository_unreadable', 'uncommitted_changes', 'unverified_commit'] + +LAVAFLOW_SOURCE_UNAVAILABLE_REASON_VALUES: set[LavaflowSourceUnavailableReason] = { 'commit_not_on_production_branch', 'deployment_unattributed', 'no_commit', 'no_repository', 'other_repository', 'repository_access_denied', 'repository_download_interrupted', 'repository_provider_unavailable', 'repository_rate_limited', 'repository_source_invalid', 'repository_unreadable', 'uncommitted_changes', 'unverified_commit', } + +def check_lavaflow_source_unavailable_reason(value: str) -> LavaflowSourceUnavailableReason: + if value in LAVAFLOW_SOURCE_UNAVAILABLE_REASON_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {LAVAFLOW_SOURCE_UNAVAILABLE_REASON_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/lavaflow_stats.py b/src/volcano_sdk/_generated/models/lavaflow_stats.py new file mode 100644 index 00000000..d314de7b --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_stats.py @@ -0,0 +1,197 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset +from typing import cast +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.lavaflow_day_counts import LavaflowDayCounts + from ..models.lavaflow_delivery_stats import LavaflowDeliveryStats + from ..models.lavaflow_outcomes import LavaflowOutcomes + from ..models.lavaflow_stats_totals import LavaflowStatsTotals + + + + + +T = TypeVar("T", bound="LavaflowStats") + + + +@_attrs_define +class LavaflowStats: + """ + Attributes: + project_id (UUID): The project the counts are for. + window_start (datetime.date): The first UTC day in the window. + window_end (datetime.date): The last UTC day in the window, today. + days (list[LavaflowDayCounts]): One entry per UTC day, oldest first, zeros included. + totals (LavaflowStatsTotals): + outcomes (LavaflowOutcomes | Unset): Separate confirmed merges, live improvements and actual automatic issue- + resolution episodes. A live improvement is counted once per project, repository and pull request when inclusion + is first durably confirmed on a tracked function or frontend. Resolution includes automatic open or ignored to + resolved transitions, preserves the reason and category, and excludes manual actions. The primary issue + resolution count includes every category, even when a category filter narrows merge and live counts. Only the + first qualifying automatic resolution of a metric episode contributes a count. Recurrence and manual reopen + start new metric episodes without erasing previous resolutions; moving resolved to ignored does not start an + episode. Existing activity counts remain separate. Older servers omit this object; absence is unavailable, never + zero. + delivery (LavaflowDeliveryStats | Unset): Delivery for retained runs created in the requested UTC window and + category, evaluated at as_of. + """ + + project_id: UUID + window_start: datetime.date + window_end: datetime.date + days: list[LavaflowDayCounts] + totals: LavaflowStatsTotals + outcomes: LavaflowOutcomes | Unset = UNSET + delivery: LavaflowDeliveryStats | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.lavaflow_day_counts import LavaflowDayCounts # noqa: PLC0415 + from ..models.lavaflow_delivery_stats import LavaflowDeliveryStats # noqa: PLC0415 + from ..models.lavaflow_outcomes import LavaflowOutcomes # noqa: PLC0415 + from ..models.lavaflow_stats_totals import LavaflowStatsTotals # noqa: PLC0415 + project_id = str(self.project_id) + + window_start = self.window_start.isoformat() + + window_end = self.window_end.isoformat() + + days = [] + for days_item_data in self.days: + days_item = days_item_data.to_dict() + days.append(days_item) + + + + totals = self.totals.to_dict() + + outcomes: dict[str, Any] | Unset = UNSET + if not isinstance(self.outcomes, Unset): + outcomes = self.outcomes.to_dict() + + delivery: dict[str, Any] | Unset = UNSET + if not isinstance(self.delivery, Unset): + delivery = self.delivery.to_dict() + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "project_id": project_id, + "window_start": window_start, + "window_end": window_end, + "days": days, + "totals": totals, + }) + if outcomes is not UNSET: + field_dict["outcomes"] = outcomes + if delivery is not UNSET: + field_dict["delivery"] = delivery + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.lavaflow_day_counts import LavaflowDayCounts # noqa: PLC0415 + from ..models.lavaflow_delivery_stats import LavaflowDeliveryStats # noqa: PLC0415 + from ..models.lavaflow_outcomes import LavaflowOutcomes # noqa: PLC0415 + from ..models.lavaflow_stats_totals import LavaflowStatsTotals # noqa: PLC0415 + d = dict(src_dict) + project_id = UUID(d.pop("project_id")) + + + + + window_start = datetime.date.fromisoformat(d.pop("window_start")) + + + + + window_end = datetime.date.fromisoformat(d.pop("window_end")) + + + + + days = [] + _days = d.pop("days") + for days_item_data in (_days): + days_item = LavaflowDayCounts.from_dict(days_item_data) + + + + days.append(days_item) + + + totals = LavaflowStatsTotals.from_dict(d.pop("totals")) + + + + + _outcomes = d.pop("outcomes", UNSET) + outcomes: LavaflowOutcomes | Unset + if isinstance(_outcomes, Unset): + outcomes = UNSET + else: + outcomes = LavaflowOutcomes.from_dict(_outcomes) + + + + + _delivery = d.pop("delivery", UNSET) + delivery: LavaflowDeliveryStats | Unset + if isinstance(_delivery, Unset): + delivery = UNSET + else: + delivery = LavaflowDeliveryStats.from_dict(_delivery) + + + + + lavaflow_stats = cls( + project_id=project_id, + window_start=window_start, + window_end=window_end, + days=days, + totals=totals, + outcomes=outcomes, + delivery=delivery, + ) + + + lavaflow_stats.additional_properties = d + return lavaflow_stats + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_stats_totals.py b/src/volcano_sdk/_generated/models/lavaflow_stats_totals.py new file mode 100644 index 00000000..ad0c8262 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_stats_totals.py @@ -0,0 +1,84 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="LavaflowStatsTotals") + + + +@_attrs_define +class LavaflowStatsTotals: + """ + Attributes: + issues_opened (int): + pull_requests_opened (int): + """ + + issues_opened: int + pull_requests_opened: int + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + issues_opened = self.issues_opened + + pull_requests_opened = self.pull_requests_opened + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "issues_opened": issues_opened, + "pull_requests_opened": pull_requests_opened, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + issues_opened = d.pop("issues_opened") + + pull_requests_opened = d.pop("pull_requests_opened") + + lavaflow_stats_totals = cls( + issues_opened=issues_opened, + pull_requests_opened=pull_requests_opened, + ) + + + lavaflow_stats_totals.additional_properties = d + return lavaflow_stats_totals + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_task_activity.py b/src/volcano_sdk/_generated/models/lavaflow_task_activity.py new file mode 100644 index 00000000..9b310e64 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_task_activity.py @@ -0,0 +1,117 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast +from uuid import UUID +import datetime + + + + + + +T = TypeVar("T", bound="LavaflowTaskActivity") + + + +@_attrs_define +class LavaflowTaskActivity: + """ + Attributes: + sequence (int): + occurred_at (datetime.datetime): + actor (str): + message (str): + run_id (UUID): + """ + + sequence: int + occurred_at: datetime.datetime + actor: str + message: str + run_id: UUID + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + sequence = self.sequence + + occurred_at = self.occurred_at.isoformat() + + actor = self.actor + + message = self.message + + run_id = str(self.run_id) + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "sequence": sequence, + "occurred_at": occurred_at, + "actor": actor, + "message": message, + "run_id": run_id, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + sequence = d.pop("sequence") + + occurred_at = datetime.datetime.fromisoformat(d.pop("occurred_at")) + + + + + actor = d.pop("actor") + + message = d.pop("message") + + run_id = UUID(d.pop("run_id")) + + + + + lavaflow_task_activity = cls( + sequence=sequence, + occurred_at=occurred_at, + actor=actor, + message=message, + run_id=run_id, + ) + + + lavaflow_task_activity.additional_properties = d + return lavaflow_task_activity + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/lavaflow_workflow_source.py b/src/volcano_sdk/_generated/models/lavaflow_workflow_source.py new file mode 100644 index 00000000..ba44f2c5 --- /dev/null +++ b/src/volcano_sdk/_generated/models/lavaflow_workflow_source.py @@ -0,0 +1,85 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="LavaflowWorkflowSource") + + + +@_attrs_define +class LavaflowWorkflowSource: + """ A branch or commit whose workflows LavaFlow read, and the commit it read them at. + + Attributes: + source (str): The branch, or the commit SHA for a commit. Example: main. + commit_sha (str): The commit LavaFlow read the workflows at. Example: 3f786850e387550fdab836ed7e6dc881de23001b. + """ + + source: str + commit_sha: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + source = self.source + + commit_sha = self.commit_sha + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "source": source, + "commit_sha": commit_sha, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + source = d.pop("source") + + commit_sha = d.pop("commit_sha") + + lavaflow_workflow_source = cls( + source=source, + commit_sha=commit_sha, + ) + + + lavaflow_workflow_source.additional_properties = d + return lavaflow_workflow_source + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/list_account_sessions_sort.py b/src/volcano_sdk/_generated/models/list_account_sessions_sort.py new file mode 100644 index 00000000..9489ad46 --- /dev/null +++ b/src/volcano_sdk/_generated/models/list_account_sessions_sort.py @@ -0,0 +1,10 @@ +from typing import Literal + +ListAccountSessionsSort = Literal['created_at', 'last_activity'] + +LIST_ACCOUNT_SESSIONS_SORT_VALUES: set[ListAccountSessionsSort] = { 'created_at', 'last_activity', } + +def check_list_account_sessions_sort(value: str) -> ListAccountSessionsSort: + if value in LIST_ACCOUNT_SESSIONS_SORT_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {LIST_ACCOUNT_SESSIONS_SORT_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/list_account_sessions_status.py b/src/volcano_sdk/_generated/models/list_account_sessions_status.py new file mode 100644 index 00000000..e35b562c --- /dev/null +++ b/src/volcano_sdk/_generated/models/list_account_sessions_status.py @@ -0,0 +1,10 @@ +from typing import Literal + +ListAccountSessionsStatus = Literal['active', 'expired'] + +LIST_ACCOUNT_SESSIONS_STATUS_VALUES: set[ListAccountSessionsStatus] = { 'active', 'expired', } + +def check_list_account_sessions_status(value: str) -> ListAccountSessionsStatus: + if value in LIST_ACCOUNT_SESSIONS_STATUS_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {LIST_ACCOUNT_SESSIONS_STATUS_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/list_lavaflow_resources_category.py b/src/volcano_sdk/_generated/models/list_lavaflow_resources_category.py new file mode 100644 index 00000000..f13bfe42 --- /dev/null +++ b/src/volcano_sdk/_generated/models/list_lavaflow_resources_category.py @@ -0,0 +1,10 @@ +from typing import Literal + +ListLavaflowResourcesCategory = Literal['bug', 'configuration', 'dependency', 'external', 'improvement', 'performance', 'security', 'uncategorized'] + +LIST_LAVAFLOW_RESOURCES_CATEGORY_VALUES: set[ListLavaflowResourcesCategory] = { 'bug', 'configuration', 'dependency', 'external', 'improvement', 'performance', 'security', 'uncategorized', } + +def check_list_lavaflow_resources_category(value: str) -> ListLavaflowResourcesCategory: + if value in LIST_LAVAFLOW_RESOURCES_CATEGORY_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {LIST_LAVAFLOW_RESOURCES_CATEGORY_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/list_lavaflow_runs_category.py b/src/volcano_sdk/_generated/models/list_lavaflow_runs_category.py new file mode 100644 index 00000000..6dedaa80 --- /dev/null +++ b/src/volcano_sdk/_generated/models/list_lavaflow_runs_category.py @@ -0,0 +1,10 @@ +from typing import Literal + +ListLavaflowRunsCategory = Literal['bug', 'configuration', 'dependency', 'external', 'improvement', 'performance', 'security', 'uncategorized'] + +LIST_LAVAFLOW_RUNS_CATEGORY_VALUES: set[ListLavaflowRunsCategory] = { 'bug', 'configuration', 'dependency', 'external', 'improvement', 'performance', 'security', 'uncategorized', } + +def check_list_lavaflow_runs_category(value: str) -> ListLavaflowRunsCategory: + if value in LIST_LAVAFLOW_RUNS_CATEGORY_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {LIST_LAVAFLOW_RUNS_CATEGORY_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/list_lavaflow_runs_include_item.py b/src/volcano_sdk/_generated/models/list_lavaflow_runs_include_item.py new file mode 100644 index 00000000..1782e384 --- /dev/null +++ b/src/volcano_sdk/_generated/models/list_lavaflow_runs_include_item.py @@ -0,0 +1,10 @@ +from typing import Literal + +ListLavaflowRunsIncludeItem = Literal['counts'] + +LIST_LAVAFLOW_RUNS_INCLUDE_ITEM_VALUES: set[ListLavaflowRunsIncludeItem] = { 'counts', } + +def check_list_lavaflow_runs_include_item(value: str) -> ListLavaflowRunsIncludeItem: + if value in LIST_LAVAFLOW_RUNS_INCLUDE_ITEM_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {LIST_LAVAFLOW_RUNS_INCLUDE_ITEM_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/list_lavaflow_runs_order.py b/src/volcano_sdk/_generated/models/list_lavaflow_runs_order.py new file mode 100644 index 00000000..a9bfd36d --- /dev/null +++ b/src/volcano_sdk/_generated/models/list_lavaflow_runs_order.py @@ -0,0 +1,10 @@ +from typing import Literal + +ListLavaflowRunsOrder = Literal['created_at.asc', 'created_at.desc', 'issue_events.desc'] + +LIST_LAVAFLOW_RUNS_ORDER_VALUES: set[ListLavaflowRunsOrder] = { 'created_at.asc', 'created_at.desc', 'issue_events.desc', } + +def check_list_lavaflow_runs_order(value: str) -> ListLavaflowRunsOrder: + if value in LIST_LAVAFLOW_RUNS_ORDER_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {LIST_LAVAFLOW_RUNS_ORDER_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/list_lavaflow_runs_pull_request_state.py b/src/volcano_sdk/_generated/models/list_lavaflow_runs_pull_request_state.py new file mode 100644 index 00000000..047cbb4e --- /dev/null +++ b/src/volcano_sdk/_generated/models/list_lavaflow_runs_pull_request_state.py @@ -0,0 +1,10 @@ +from typing import Literal + +ListLavaflowRunsPullRequestState = Literal['closed', 'merged', 'none', 'open'] + +LIST_LAVAFLOW_RUNS_PULL_REQUEST_STATE_VALUES: set[ListLavaflowRunsPullRequestState] = { 'closed', 'merged', 'none', 'open', } + +def check_list_lavaflow_runs_pull_request_state(value: str) -> ListLavaflowRunsPullRequestState: + if value in LIST_LAVAFLOW_RUNS_PULL_REQUEST_STATE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {LIST_LAVAFLOW_RUNS_PULL_REQUEST_STATE_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/log_activity_request.py b/src/volcano_sdk/_generated/models/log_activity_request.py index 9d5bb5b6..304ef003 100644 --- a/src/volcano_sdk/_generated/models/log_activity_request.py +++ b/src/volcano_sdk/_generated/models/log_activity_request.py @@ -13,6 +13,7 @@ import datetime if TYPE_CHECKING: + from ..models.log_app_request_resource import LogAppRequestResource from ..models.log_database_request_resource import LogDatabaseRequestResource from ..models.log_frontend_request_resource import LogFrontendRequestResource from ..models.log_function_request_resource import LogFunctionRequestResource @@ -30,8 +31,8 @@ class LogActivityRequest: """ Activity request for bucketed log counts. Attributes: - resource (LogDatabaseRequestResource | LogFrontendRequestResource | LogFunctionRequestResource): Resource - selectors for project log reads. + resource (LogAppRequestResource | LogDatabaseRequestResource | LogFrontendRequestResource | + LogFunctionRequestResource): Resource selectors for project log reads. q (str | Unset): Optional activity query. Supports quoted text, implicit AND, AND/OR/NOT, parentheses, and fields such as `level`, `region`, `invocation.id`, `resource.id`, `resource.name`, `function`, `frontend`, `database`, and `body`. @@ -44,7 +45,7 @@ class LogActivityRequest: exactly the window. """ - resource: LogDatabaseRequestResource | LogFrontendRequestResource | LogFunctionRequestResource + resource: LogAppRequestResource | LogDatabaseRequestResource | LogFrontendRequestResource | LogFunctionRequestResource q: str | Unset = UNSET start_time: datetime.datetime | Unset = UNSET end_time: datetime.datetime | Unset = UNSET @@ -55,6 +56,7 @@ class LogActivityRequest: def to_dict(self) -> dict[str, Any]: + from ..models.log_app_request_resource import LogAppRequestResource # noqa: PLC0415 from ..models.log_database_request_resource import LogDatabaseRequestResource # noqa: PLC0415 from ..models.log_frontend_request_resource import LogFrontendRequestResource # noqa: PLC0415 from ..models.log_function_request_resource import LogFunctionRequestResource # noqa: PLC0415 @@ -63,6 +65,8 @@ def to_dict(self) -> dict[str, Any]: resource = self.resource.to_dict() elif isinstance(self.resource, LogFrontendRequestResource): resource = self.resource.to_dict() + elif isinstance(self.resource, LogDatabaseRequestResource): + resource = self.resource.to_dict() else: resource = self.resource.to_dict() @@ -100,11 +104,12 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.log_app_request_resource import LogAppRequestResource # noqa: PLC0415 from ..models.log_database_request_resource import LogDatabaseRequestResource # noqa: PLC0415 from ..models.log_frontend_request_resource import LogFrontendRequestResource # noqa: PLC0415 from ..models.log_function_request_resource import LogFunctionRequestResource # noqa: PLC0415 d = dict(src_dict) - def _parse_resource(data: object) -> LogDatabaseRequestResource | LogFrontendRequestResource | LogFunctionRequestResource: + def _parse_resource(data: object) -> LogAppRequestResource | LogDatabaseRequestResource | LogFrontendRequestResource | LogFunctionRequestResource: try: if not isinstance(data, dict): raise TypeError() @@ -125,13 +130,23 @@ def _parse_resource(data: object) -> LogDatabaseRequestResource | LogFrontendReq return componentsschemas_log_request_resource_type_1 except (TypeError, ValueError, AttributeError, KeyError): pass + try: + if not isinstance(data, dict): + raise TypeError() + componentsschemas_log_request_resource_type_2 = LogDatabaseRequestResource.from_dict(data) + + + + return componentsschemas_log_request_resource_type_2 + except (TypeError, ValueError, AttributeError, KeyError): + pass if not isinstance(data, dict): raise TypeError() - componentsschemas_log_request_resource_type_2 = LogDatabaseRequestResource.from_dict(data) + componentsschemas_log_request_resource_type_3 = LogAppRequestResource.from_dict(data) - return componentsschemas_log_request_resource_type_2 + return componentsschemas_log_request_resource_type_3 resource = _parse_resource(d.pop("resource")) diff --git a/src/volcano_sdk/_generated/models/log_app_request_resource.py b/src/volcano_sdk/_generated/models/log_app_request_resource.py new file mode 100644 index 00000000..66b351ee --- /dev/null +++ b/src/volcano_sdk/_generated/models/log_app_request_resource.py @@ -0,0 +1,99 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.log_app_request_resource_type import check_log_app_request_resource_type +from ..models.log_app_request_resource_type import LogAppRequestResourceType +from ..types import UNSET, Unset +from typing import cast +from uuid import UUID + + + + + + +T = TypeVar("T", bound="LogAppRequestResource") + + + +@_attrs_define +class LogAppRequestResource: + """ Selector for the entries a first-party app writes into this project's + logs, such as the Builder's run lifecycle. Each app is one resource. + Its ID is UUIDv5(`7374f5e9-35ff-4e46-ac13-a4717bae00e1`, slug), with + the app's slug as UTF-8 bytes, and its name is the slug. The Builder + (`builder`) is `b52fc8fa-8656-5141-adef-99d698ce6f3c`. Deployment logs + are not supported for apps. + + Attributes: + type_ (LogAppRequestResourceType): Resource type to read logs for. + ids (list[UUID] | Unset): Optional app resource IDs, each UUIDv5 of an app's slug. Omit or send an empty array + to include every app. + """ + + type_: LogAppRequestResourceType + ids: list[UUID] | Unset = UNSET + + + + + + def to_dict(self) -> dict[str, Any]: + type_: str = self.type_ + + ids: list[str] | Unset = UNSET + if not isinstance(self.ids, Unset): + ids = [] + for ids_item_data in self.ids: + ids_item = str(ids_item_data) + ids.append(ids_item) + + + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "type": type_, + }) + if ids is not UNSET: + field_dict["ids"] = ids + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + type_ = check_log_app_request_resource_type(d.pop("type")) + + + + + _ids = d.pop("ids", UNSET) + ids: list[UUID] | Unset = UNSET + if _ids is not UNSET: + ids = [] + for ids_item_data in _ids: + ids_item = UUID(ids_item_data) + + + + ids.append(ids_item) + + + log_app_request_resource = cls( + type_=type_, + ids=ids, + ) + + return log_app_request_resource + diff --git a/src/volcano_sdk/_generated/models/log_app_request_resource_type.py b/src/volcano_sdk/_generated/models/log_app_request_resource_type.py new file mode 100644 index 00000000..8b0f99c1 --- /dev/null +++ b/src/volcano_sdk/_generated/models/log_app_request_resource_type.py @@ -0,0 +1,10 @@ +from typing import Literal + +LogAppRequestResourceType = Literal['app'] + +LOG_APP_REQUEST_RESOURCE_TYPE_VALUES: set[LogAppRequestResourceType] = { 'app', } + +def check_log_app_request_resource_type(value: str) -> LogAppRequestResourceType: + if value in LOG_APP_REQUEST_RESOURCE_TYPE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {LOG_APP_REQUEST_RESOURCE_TYPE_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/log_resource.py b/src/volcano_sdk/_generated/models/log_resource.py index eac4b4f0..8fae7b65 100644 --- a/src/volcano_sdk/_generated/models/log_resource.py +++ b/src/volcano_sdk/_generated/models/log_resource.py @@ -29,8 +29,12 @@ class LogResource: Attributes: type_ (LogResourceType): Resource type that owns the log event. - id (UUID): Resource ID that owns the log event. - name (str | Unset): Resource name associated with the log event, when available. + id (UUID): Resource ID that owns the log event. For type `app`, the ID is + UUIDv5(`7374f5e9-35ff-4e46-ac13-a4717bae00e1`, slug), with the app's + slug as UTF-8 bytes; the Builder (`builder`) is + `b52fc8fa-8656-5141-adef-99d698ce6f3c`. + name (str | Unset): Resource name associated with the log event, when available. For type `app`, the app's slug, + such as `builder`. """ type_: LogResourceType diff --git a/src/volcano_sdk/_generated/models/log_resource_type.py b/src/volcano_sdk/_generated/models/log_resource_type.py index fbcf58c4..2f2f53e3 100644 --- a/src/volcano_sdk/_generated/models/log_resource_type.py +++ b/src/volcano_sdk/_generated/models/log_resource_type.py @@ -1,8 +1,8 @@ from typing import Literal -LogResourceType = Literal['database', 'frontend', 'function'] +LogResourceType = Literal['app', 'database', 'frontend', 'function'] -LOG_RESOURCE_TYPE_VALUES: set[LogResourceType] = { 'database', 'frontend', 'function', } +LOG_RESOURCE_TYPE_VALUES: set[LogResourceType] = { 'app', 'database', 'frontend', 'function', } def check_log_resource_type(value: str) -> LogResourceType: if value in LOG_RESOURCE_TYPE_VALUES: diff --git a/src/volcano_sdk/_generated/models/log_search_request.py b/src/volcano_sdk/_generated/models/log_search_request.py index 4648aa3a..e8ef5a9b 100644 --- a/src/volcano_sdk/_generated/models/log_search_request.py +++ b/src/volcano_sdk/_generated/models/log_search_request.py @@ -13,6 +13,7 @@ import datetime if TYPE_CHECKING: + from ..models.log_app_request_resource import LogAppRequestResource from ..models.log_database_request_resource import LogDatabaseRequestResource from ..models.log_frontend_request_resource import LogFrontendRequestResource from ..models.log_function_request_resource import LogFunctionRequestResource @@ -30,8 +31,8 @@ class LogSearchRequest: """ Search request for project logs. Attributes: - resource (LogDatabaseRequestResource | LogFrontendRequestResource | LogFunctionRequestResource): Resource - selectors for project log reads. + resource (LogAppRequestResource | LogDatabaseRequestResource | LogFrontendRequestResource | + LogFunctionRequestResource): Resource selectors for project log reads. q (str | Unset): Optional log query. Supports quoted text, implicit AND, AND/OR/NOT, parentheses, and fields such as `level`, `region`, `invocation.id`, `resource.id`, `resource.name`, `function`, `frontend`, `database`, and `body`. @@ -41,7 +42,7 @@ class LogSearchRequest: cursor (str | Unset): Opaque pagination cursor from the previous response's `next_cursor`. """ - resource: LogDatabaseRequestResource | LogFrontendRequestResource | LogFunctionRequestResource + resource: LogAppRequestResource | LogDatabaseRequestResource | LogFrontendRequestResource | LogFunctionRequestResource q: str | Unset = UNSET start_time: datetime.datetime | Unset = UNSET end_time: datetime.datetime | Unset = UNSET @@ -53,6 +54,7 @@ class LogSearchRequest: def to_dict(self) -> dict[str, Any]: + from ..models.log_app_request_resource import LogAppRequestResource # noqa: PLC0415 from ..models.log_database_request_resource import LogDatabaseRequestResource # noqa: PLC0415 from ..models.log_frontend_request_resource import LogFrontendRequestResource # noqa: PLC0415 from ..models.log_function_request_resource import LogFunctionRequestResource # noqa: PLC0415 @@ -61,6 +63,8 @@ def to_dict(self) -> dict[str, Any]: resource = self.resource.to_dict() elif isinstance(self.resource, LogFrontendRequestResource): resource = self.resource.to_dict() + elif isinstance(self.resource, LogDatabaseRequestResource): + resource = self.resource.to_dict() else: resource = self.resource.to_dict() @@ -102,11 +106,12 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.log_app_request_resource import LogAppRequestResource # noqa: PLC0415 from ..models.log_database_request_resource import LogDatabaseRequestResource # noqa: PLC0415 from ..models.log_frontend_request_resource import LogFrontendRequestResource # noqa: PLC0415 from ..models.log_function_request_resource import LogFunctionRequestResource # noqa: PLC0415 d = dict(src_dict) - def _parse_resource(data: object) -> LogDatabaseRequestResource | LogFrontendRequestResource | LogFunctionRequestResource: + def _parse_resource(data: object) -> LogAppRequestResource | LogDatabaseRequestResource | LogFrontendRequestResource | LogFunctionRequestResource: try: if not isinstance(data, dict): raise TypeError() @@ -127,13 +132,23 @@ def _parse_resource(data: object) -> LogDatabaseRequestResource | LogFrontendReq return componentsschemas_log_request_resource_type_1 except (TypeError, ValueError, AttributeError, KeyError): pass + try: + if not isinstance(data, dict): + raise TypeError() + componentsschemas_log_request_resource_type_2 = LogDatabaseRequestResource.from_dict(data) + + + + return componentsschemas_log_request_resource_type_2 + except (TypeError, ValueError, AttributeError, KeyError): + pass if not isinstance(data, dict): raise TypeError() - componentsschemas_log_request_resource_type_2 = LogDatabaseRequestResource.from_dict(data) + componentsschemas_log_request_resource_type_3 = LogAppRequestResource.from_dict(data) - return componentsschemas_log_request_resource_type_2 + return componentsschemas_log_request_resource_type_3 resource = _parse_resource(d.pop("resource")) diff --git a/src/volcano_sdk/_generated/models/log_stream_request.py b/src/volcano_sdk/_generated/models/log_stream_request.py index 49ad3446..08378c4f 100644 --- a/src/volcano_sdk/_generated/models/log_stream_request.py +++ b/src/volcano_sdk/_generated/models/log_stream_request.py @@ -13,6 +13,7 @@ import datetime if TYPE_CHECKING: + from ..models.log_app_request_resource import LogAppRequestResource from ..models.log_database_request_resource import LogDatabaseRequestResource from ..models.log_frontend_request_resource import LogFrontendRequestResource from ..models.log_function_request_resource import LogFunctionRequestResource @@ -30,15 +31,15 @@ class LogStreamRequest: """ Stream request for live project logs. Pagination cursors and fixed end times are not supported. Attributes: - resource (LogDatabaseRequestResource | LogFrontendRequestResource | LogFunctionRequestResource): Resource - selectors for project log reads. + resource (LogAppRequestResource | LogDatabaseRequestResource | LogFrontendRequestResource | + LogFunctionRequestResource): Resource selectors for project log reads. q (str | Unset): Optional log query using the same syntax as search and activity requests. start_time (datetime.datetime | Unset): Start time. limit (int | Unset): Maximum number of records to deliver on connect or reconnect before following new events. Default: 100. """ - resource: LogDatabaseRequestResource | LogFrontendRequestResource | LogFunctionRequestResource + resource: LogAppRequestResource | LogDatabaseRequestResource | LogFrontendRequestResource | LogFunctionRequestResource q: str | Unset = UNSET start_time: datetime.datetime | Unset = UNSET limit: int | Unset = 100 @@ -48,6 +49,7 @@ class LogStreamRequest: def to_dict(self) -> dict[str, Any]: + from ..models.log_app_request_resource import LogAppRequestResource # noqa: PLC0415 from ..models.log_database_request_resource import LogDatabaseRequestResource # noqa: PLC0415 from ..models.log_frontend_request_resource import LogFrontendRequestResource # noqa: PLC0415 from ..models.log_function_request_resource import LogFunctionRequestResource # noqa: PLC0415 @@ -56,6 +58,8 @@ def to_dict(self) -> dict[str, Any]: resource = self.resource.to_dict() elif isinstance(self.resource, LogFrontendRequestResource): resource = self.resource.to_dict() + elif isinstance(self.resource, LogDatabaseRequestResource): + resource = self.resource.to_dict() else: resource = self.resource.to_dict() @@ -87,11 +91,12 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.log_app_request_resource import LogAppRequestResource # noqa: PLC0415 from ..models.log_database_request_resource import LogDatabaseRequestResource # noqa: PLC0415 from ..models.log_frontend_request_resource import LogFrontendRequestResource # noqa: PLC0415 from ..models.log_function_request_resource import LogFunctionRequestResource # noqa: PLC0415 d = dict(src_dict) - def _parse_resource(data: object) -> LogDatabaseRequestResource | LogFrontendRequestResource | LogFunctionRequestResource: + def _parse_resource(data: object) -> LogAppRequestResource | LogDatabaseRequestResource | LogFrontendRequestResource | LogFunctionRequestResource: try: if not isinstance(data, dict): raise TypeError() @@ -112,13 +117,23 @@ def _parse_resource(data: object) -> LogDatabaseRequestResource | LogFrontendReq return componentsschemas_log_request_resource_type_1 except (TypeError, ValueError, AttributeError, KeyError): pass + try: + if not isinstance(data, dict): + raise TypeError() + componentsschemas_log_request_resource_type_2 = LogDatabaseRequestResource.from_dict(data) + + + + return componentsschemas_log_request_resource_type_2 + except (TypeError, ValueError, AttributeError, KeyError): + pass if not isinstance(data, dict): raise TypeError() - componentsschemas_log_request_resource_type_2 = LogDatabaseRequestResource.from_dict(data) + componentsschemas_log_request_resource_type_3 = LogAppRequestResource.from_dict(data) - return componentsschemas_log_request_resource_type_2 + return componentsschemas_log_request_resource_type_3 resource = _parse_resource(d.pop("resource")) diff --git a/src/volcano_sdk/_generated/models/notification_email_settings.py b/src/volcano_sdk/_generated/models/notification_email_settings.py new file mode 100644 index 00000000..c5dbcf5d --- /dev/null +++ b/src/volcano_sdk/_generated/models/notification_email_settings.py @@ -0,0 +1,87 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.notification_email_status import check_notification_email_status +from ..models.notification_email_status import NotificationEmailStatus +from typing import cast + + + + + + +T = TypeVar("T", bound="NotificationEmailSettings") + + + +@_attrs_define +class NotificationEmailSettings: + """ + Attributes: + enabled (bool): Whether alerts are emailed. + recipients (list[str]): Empty. Alerts are emailed to the project owner's verified account email address, the + only recipient supported. + status (NotificationEmailStatus): Whether alerts are being emailed. `owner_email_unverified` means email is + enabled but the project owner has no active account with a verified email address, so no alert is emailed, and + email does not count as a channel when deciding whether to announce a failing scheduler, until the owner + verifies it. Changing the account email address needs a new verification. + """ + + enabled: bool + recipients: list[str] + status: NotificationEmailStatus + + + + + + def to_dict(self) -> dict[str, Any]: + enabled = self.enabled + + recipients = self.recipients + + + + status: str = self.status + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "enabled": enabled, + "recipients": recipients, + "status": status, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + enabled = d.pop("enabled") + + recipients = cast(list[str], d.pop("recipients")) + + + status = check_notification_email_status(d.pop("status")) + + + + + notification_email_settings = cls( + enabled=enabled, + recipients=recipients, + status=status, + ) + + return notification_email_settings + diff --git a/src/volcano_sdk/_generated/models/notification_email_status.py b/src/volcano_sdk/_generated/models/notification_email_status.py new file mode 100644 index 00000000..6fbace3d --- /dev/null +++ b/src/volcano_sdk/_generated/models/notification_email_status.py @@ -0,0 +1,10 @@ +from typing import Literal + +NotificationEmailStatus = Literal['delivering', 'disabled', 'owner_email_unverified'] + +NOTIFICATION_EMAIL_STATUS_VALUES: set[NotificationEmailStatus] = { 'delivering', 'disabled', 'owner_email_unverified', } + +def check_notification_email_status(value: str) -> NotificationEmailStatus: + if value in NOTIFICATION_EMAIL_STATUS_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {NOTIFICATION_EMAIL_STATUS_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/notification_settings.py b/src/volcano_sdk/_generated/models/notification_settings.py new file mode 100644 index 00000000..12769c5f --- /dev/null +++ b/src/volcano_sdk/_generated/models/notification_settings.py @@ -0,0 +1,127 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset +from typing import cast +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.notification_email_settings import NotificationEmailSettings + from ..models.notification_webhook_settings import NotificationWebhookSettings + from ..models.scheduler_failure_alert_policy import SchedulerFailureAlertPolicy + + + + + +T = TypeVar("T", bound="NotificationSettings") + + + +@_attrs_define +class NotificationSettings: + """ + Attributes: + project_id (UUID): + email (NotificationEmailSettings): + webhook (NotificationWebhookSettings): + scheduler_failures (SchedulerFailureAlertPolicy): + updated_at (datetime.datetime | Unset): When the settings were last saved. Absent until the first save. + """ + + project_id: UUID + email: NotificationEmailSettings + webhook: NotificationWebhookSettings + scheduler_failures: SchedulerFailureAlertPolicy + updated_at: datetime.datetime | Unset = UNSET + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.notification_email_settings import NotificationEmailSettings # noqa: PLC0415 + from ..models.notification_webhook_settings import NotificationWebhookSettings # noqa: PLC0415 + from ..models.scheduler_failure_alert_policy import SchedulerFailureAlertPolicy # noqa: PLC0415 + project_id = str(self.project_id) + + email = self.email.to_dict() + + webhook = self.webhook.to_dict() + + scheduler_failures = self.scheduler_failures.to_dict() + + updated_at: str | Unset = UNSET + if not isinstance(self.updated_at, Unset): + updated_at = self.updated_at.isoformat() + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "project_id": project_id, + "email": email, + "webhook": webhook, + "scheduler_failures": scheduler_failures, + }) + if updated_at is not UNSET: + field_dict["updated_at"] = updated_at + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.notification_email_settings import NotificationEmailSettings # noqa: PLC0415 + from ..models.notification_webhook_settings import NotificationWebhookSettings # noqa: PLC0415 + from ..models.scheduler_failure_alert_policy import SchedulerFailureAlertPolicy # noqa: PLC0415 + d = dict(src_dict) + project_id = UUID(d.pop("project_id")) + + + + + email = NotificationEmailSettings.from_dict(d.pop("email")) + + + + + webhook = NotificationWebhookSettings.from_dict(d.pop("webhook")) + + + + + scheduler_failures = SchedulerFailureAlertPolicy.from_dict(d.pop("scheduler_failures")) + + + + + _updated_at = d.pop("updated_at", UNSET) + updated_at: datetime.datetime | Unset + if isinstance(_updated_at, Unset): + updated_at = UNSET + else: + updated_at = datetime.datetime.fromisoformat(_updated_at) + + + + + notification_settings = cls( + project_id=project_id, + email=email, + webhook=webhook, + scheduler_failures=scheduler_failures, + updated_at=updated_at, + ) + + return notification_settings + diff --git a/src/volcano_sdk/_generated/models/notification_test_delivery.py b/src/volcano_sdk/_generated/models/notification_test_delivery.py new file mode 100644 index 00000000..b8c98b34 --- /dev/null +++ b/src/volcano_sdk/_generated/models/notification_test_delivery.py @@ -0,0 +1,91 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.notification_test_delivery_channel import check_notification_test_delivery_channel +from ..models.notification_test_delivery_channel import NotificationTestDeliveryChannel +from ..types import UNSET, Unset +from typing import cast + + + + + + +T = TypeVar("T", bound="NotificationTestDelivery") + + + +@_attrs_define +class NotificationTestDelivery: + """ + Attributes: + channel (NotificationTestDeliveryChannel): + delivered (bool): + status_code (int | Unset): The webhook's response status. Absent for email, and when no response arrived. + error (str | Unset): Why the delivery failed. Absent when it arrived. + """ + + channel: NotificationTestDeliveryChannel + delivered: bool + status_code: int | Unset = UNSET + error: str | Unset = UNSET + + + + + + def to_dict(self) -> dict[str, Any]: + channel: str = self.channel + + delivered = self.delivered + + status_code = self.status_code + + error = self.error + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "channel": channel, + "delivered": delivered, + }) + if status_code is not UNSET: + field_dict["status_code"] = status_code + if error is not UNSET: + field_dict["error"] = error + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + channel = check_notification_test_delivery_channel(d.pop("channel")) + + + + + delivered = d.pop("delivered") + + status_code = d.pop("status_code", UNSET) + + error = d.pop("error", UNSET) + + notification_test_delivery = cls( + channel=channel, + delivered=delivered, + status_code=status_code, + error=error, + ) + + return notification_test_delivery + diff --git a/src/volcano_sdk/_generated/models/notification_test_delivery_channel.py b/src/volcano_sdk/_generated/models/notification_test_delivery_channel.py new file mode 100644 index 00000000..c4077729 --- /dev/null +++ b/src/volcano_sdk/_generated/models/notification_test_delivery_channel.py @@ -0,0 +1,10 @@ +from typing import Literal + +NotificationTestDeliveryChannel = Literal['email', 'webhook'] + +NOTIFICATION_TEST_DELIVERY_CHANNEL_VALUES: set[NotificationTestDeliveryChannel] = { 'email', 'webhook', } + +def check_notification_test_delivery_channel(value: str) -> NotificationTestDeliveryChannel: + if value in NOTIFICATION_TEST_DELIVERY_CHANNEL_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {NOTIFICATION_TEST_DELIVERY_CHANNEL_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/notification_test_result.py b/src/volcano_sdk/_generated/models/notification_test_result.py new file mode 100644 index 00000000..333c652f --- /dev/null +++ b/src/volcano_sdk/_generated/models/notification_test_result.py @@ -0,0 +1,76 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast + +if TYPE_CHECKING: + from ..models.notification_test_delivery import NotificationTestDelivery + + + + + +T = TypeVar("T", bound="NotificationTestResult") + + + +@_attrs_define +class NotificationTestResult: + """ + Attributes: + deliveries (list[NotificationTestDelivery]): + """ + + deliveries: list[NotificationTestDelivery] + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.notification_test_delivery import NotificationTestDelivery # noqa: PLC0415 + deliveries = [] + for deliveries_item_data in self.deliveries: + deliveries_item = deliveries_item_data.to_dict() + deliveries.append(deliveries_item) + + + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "deliveries": deliveries, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.notification_test_delivery import NotificationTestDelivery # noqa: PLC0415 + d = dict(src_dict) + deliveries = [] + _deliveries = d.pop("deliveries") + for deliveries_item_data in (_deliveries): + deliveries_item = NotificationTestDelivery.from_dict(deliveries_item_data) + + + + deliveries.append(deliveries_item) + + + notification_test_result = cls( + deliveries=deliveries, + ) + + return notification_test_result + diff --git a/src/volcano_sdk/_generated/models/notification_webhook_settings.py b/src/volcano_sdk/_generated/models/notification_webhook_settings.py new file mode 100644 index 00000000..3b7cde32 --- /dev/null +++ b/src/volcano_sdk/_generated/models/notification_webhook_settings.py @@ -0,0 +1,78 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset + + + + + + +T = TypeVar("T", bound="NotificationWebhookSettings") + + + +@_attrs_define +class NotificationWebhookSettings: + """ + Attributes: + secret_configured (bool): Whether a signing secret is set. The secret itself is returned only once. + url (str | Unset): Where alerts are posted. Absent when no webhook is configured. + secret (str | Unset): The signing secret, starting with `whsec_`. Present only in the response that generated + it: the update that first set `url`, or a rotation. Store it then; it cannot be read again. + """ + + secret_configured: bool + url: str | Unset = UNSET + secret: str | Unset = UNSET + + + + + + def to_dict(self) -> dict[str, Any]: + secret_configured = self.secret_configured + + url = self.url + + secret = self.secret + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "secret_configured": secret_configured, + }) + if url is not UNSET: + field_dict["url"] = url + if secret is not UNSET: + field_dict["secret"] = secret + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + secret_configured = d.pop("secret_configured") + + url = d.pop("url", UNSET) + + secret = d.pop("secret", UNSET) + + notification_webhook_settings = cls( + secret_configured=secret_configured, + url=url, + secret=secret, + ) + + return notification_webhook_settings + diff --git a/src/volcano_sdk/_generated/models/paginated_autofix_runs.py b/src/volcano_sdk/_generated/models/paginated_git_deployment_runs.py similarity index 79% rename from src/volcano_sdk/_generated/models/paginated_autofix_runs.py rename to src/volcano_sdk/_generated/models/paginated_git_deployment_runs.py index a61325e1..6006de72 100644 --- a/src/volcano_sdk/_generated/models/paginated_autofix_runs.py +++ b/src/volcano_sdk/_generated/models/paginated_git_deployment_runs.py @@ -12,27 +12,27 @@ from typing import cast if TYPE_CHECKING: - from ..models.autofix_run import AutofixRun + from ..models.git_deployment_run import GitDeploymentRun -T = TypeVar("T", bound="PaginatedAutofixRuns") +T = TypeVar("T", bound="PaginatedGitDeploymentRuns") @_attrs_define -class PaginatedAutofixRuns: +class PaginatedGitDeploymentRuns: """ Attributes: - data (list[AutofixRun]): + data (list[GitDeploymentRun]): limit (int): Number of items per page has_more (bool): Whether a next page exists next_cursor (str | Unset): Opaque cursor for the next page (present if has_more is true) """ - data: list[AutofixRun] + data: list[GitDeploymentRun] limit: int has_more: bool next_cursor: str | Unset = UNSET @@ -43,7 +43,7 @@ class PaginatedAutofixRuns: def to_dict(self) -> dict[str, Any]: - from ..models.autofix_run import AutofixRun # noqa: PLC0415 + from ..models.git_deployment_run import GitDeploymentRun # noqa: PLC0415 data = [] for data_item_data in self.data: data_item = data_item_data.to_dict() @@ -74,12 +74,12 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.autofix_run import AutofixRun # noqa: PLC0415 + from ..models.git_deployment_run import GitDeploymentRun # noqa: PLC0415 d = dict(src_dict) data = [] _data = d.pop("data") for data_item_data in (_data): - data_item = AutofixRun.from_dict(data_item_data) + data_item = GitDeploymentRun.from_dict(data_item_data) @@ -92,7 +92,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: next_cursor = d.pop("next_cursor", UNSET) - paginated_autofix_runs = cls( + paginated_git_deployment_runs = cls( data=data, limit=limit, has_more=has_more, @@ -100,8 +100,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) - paginated_autofix_runs.additional_properties = d - return paginated_autofix_runs + paginated_git_deployment_runs.additional_properties = d + return paginated_git_deployment_runs @property def additional_keys(self) -> list[str]: diff --git a/src/volcano_sdk/_generated/models/paginated_lavaflow_project_issues.py b/src/volcano_sdk/_generated/models/paginated_lavaflow_project_issues.py new file mode 100644 index 00000000..27befe7c --- /dev/null +++ b/src/volcano_sdk/_generated/models/paginated_lavaflow_project_issues.py @@ -0,0 +1,126 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.lavaflow_project_issue import LavaflowProjectIssue + from ..models.paginated_lavaflow_project_issues_realtime import PaginatedLavaflowProjectIssuesRealtime + + + + + +T = TypeVar("T", bound="PaginatedLavaflowProjectIssues") + + + +@_attrs_define +class PaginatedLavaflowProjectIssues: + """ + Attributes: + data (list[LavaflowProjectIssue]): + next_cursor (str | Unset): An opaque cursor for the same project and finished filter. + realtime (PaginatedLavaflowProjectIssuesRealtime | Unset): + """ + + data: list[LavaflowProjectIssue] + next_cursor: str | Unset = UNSET + realtime: PaginatedLavaflowProjectIssuesRealtime | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.lavaflow_project_issue import LavaflowProjectIssue # noqa: PLC0415 + from ..models.paginated_lavaflow_project_issues_realtime import PaginatedLavaflowProjectIssuesRealtime # noqa: PLC0415 + data = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + + + next_cursor = self.next_cursor + + realtime: dict[str, Any] | Unset = UNSET + if not isinstance(self.realtime, Unset): + realtime = self.realtime.to_dict() + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "data": data, + }) + if next_cursor is not UNSET: + field_dict["next_cursor"] = next_cursor + if realtime is not UNSET: + field_dict["realtime"] = realtime + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.lavaflow_project_issue import LavaflowProjectIssue # noqa: PLC0415 + from ..models.paginated_lavaflow_project_issues_realtime import PaginatedLavaflowProjectIssuesRealtime # noqa: PLC0415 + d = dict(src_dict) + data = [] + _data = d.pop("data") + for data_item_data in (_data): + data_item = LavaflowProjectIssue.from_dict(data_item_data) + + + + data.append(data_item) + + + next_cursor = d.pop("next_cursor", UNSET) + + _realtime = d.pop("realtime", UNSET) + realtime: PaginatedLavaflowProjectIssuesRealtime | Unset + if isinstance(_realtime, Unset): + realtime = UNSET + else: + realtime = PaginatedLavaflowProjectIssuesRealtime.from_dict(_realtime) + + + + + paginated_lavaflow_project_issues = cls( + data=data, + next_cursor=next_cursor, + realtime=realtime, + ) + + + paginated_lavaflow_project_issues.additional_properties = d + return paginated_lavaflow_project_issues + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/paginated_lavaflow_project_issues_realtime.py b/src/volcano_sdk/_generated/models/paginated_lavaflow_project_issues_realtime.py new file mode 100644 index 00000000..91a58589 --- /dev/null +++ b/src/volcano_sdk/_generated/models/paginated_lavaflow_project_issues_realtime.py @@ -0,0 +1,97 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast +import datetime + + + + + + +T = TypeVar("T", bound="PaginatedLavaflowProjectIssuesRealtime") + + + +@_attrs_define +class PaginatedLavaflowProjectIssuesRealtime: + """ + Attributes: + token (str): A short-lived subscribe-only grant. + channel (str): + expires_at (datetime.datetime): + """ + + token: str + channel: str + expires_at: datetime.datetime + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + token = self.token + + channel = self.channel + + expires_at = self.expires_at.isoformat() + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "token": token, + "channel": channel, + "expires_at": expires_at, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + token = d.pop("token") + + channel = d.pop("channel") + + expires_at = datetime.datetime.fromisoformat(d.pop("expires_at")) + + + + + paginated_lavaflow_project_issues_realtime = cls( + token=token, + channel=channel, + expires_at=expires_at, + ) + + + paginated_lavaflow_project_issues_realtime.additional_properties = d + return paginated_lavaflow_project_issues_realtime + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/paginated_lavaflow_runs.py b/src/volcano_sdk/_generated/models/paginated_lavaflow_runs.py new file mode 100644 index 00000000..da646062 --- /dev/null +++ b/src/volcano_sdk/_generated/models/paginated_lavaflow_runs.py @@ -0,0 +1,144 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.lavaflow_run_counts import LavaflowRunCounts + from ..models.lavaflow_run_summary import LavaflowRunSummary + + + + + +T = TypeVar("T", bound="PaginatedLavaflowRuns") + + + +@_attrs_define +class PaginatedLavaflowRuns: + """ + Attributes: + data (list[LavaflowRunSummary]): + limit (int): Number of items per page + has_more (bool): Whether a next page exists + next_cursor (str | Unset): Opaque cursor for the next page, present if has_more is true. It works only for the + same project_id, caller and order. + counts (LavaflowRunCounts | Unset): Runs that match the request. `total` applies every filter. Each breakdown + applies every filter but its own, so it shows what picking another value would return. + """ + + data: list[LavaflowRunSummary] + limit: int + has_more: bool + next_cursor: str | Unset = UNSET + counts: LavaflowRunCounts | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.lavaflow_run_counts import LavaflowRunCounts # noqa: PLC0415 + from ..models.lavaflow_run_summary import LavaflowRunSummary # noqa: PLC0415 + data = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + + + limit = self.limit + + has_more = self.has_more + + next_cursor = self.next_cursor + + counts: dict[str, Any] | Unset = UNSET + if not isinstance(self.counts, Unset): + counts = self.counts.to_dict() + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "data": data, + "limit": limit, + "has_more": has_more, + }) + if next_cursor is not UNSET: + field_dict["next_cursor"] = next_cursor + if counts is not UNSET: + field_dict["counts"] = counts + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.lavaflow_run_counts import LavaflowRunCounts # noqa: PLC0415 + from ..models.lavaflow_run_summary import LavaflowRunSummary # noqa: PLC0415 + d = dict(src_dict) + data = [] + _data = d.pop("data") + for data_item_data in (_data): + data_item = LavaflowRunSummary.from_dict(data_item_data) + + + + data.append(data_item) + + + limit = d.pop("limit") + + has_more = d.pop("has_more") + + next_cursor = d.pop("next_cursor", UNSET) + + _counts = d.pop("counts", UNSET) + counts: LavaflowRunCounts | Unset + if isinstance(_counts, Unset): + counts = UNSET + else: + counts = LavaflowRunCounts.from_dict(_counts) + + + + + paginated_lavaflow_runs = cls( + data=data, + limit=limit, + has_more=has_more, + next_cursor=next_cursor, + counts=counts, + ) + + + paginated_lavaflow_runs.additional_properties = d + return paginated_lavaflow_runs + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/paginated_lavaflow_scans.py b/src/volcano_sdk/_generated/models/paginated_lavaflow_scans.py new file mode 100644 index 00000000..25814ced --- /dev/null +++ b/src/volcano_sdk/_generated/models/paginated_lavaflow_scans.py @@ -0,0 +1,121 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.lavaflow_scan import LavaflowScan + + + + + +T = TypeVar("T", bound="PaginatedLavaflowScans") + + + +@_attrs_define +class PaginatedLavaflowScans: + """ + Attributes: + data (list[LavaflowScan]): + limit (int): Number of items per page + has_more (bool): Whether a next page exists + next_cursor (str | Unset): Opaque cursor for the next page, present if has_more is true. It works only for the + same project_id and caller. + """ + + data: list[LavaflowScan] + limit: int + has_more: bool + next_cursor: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.lavaflow_scan import LavaflowScan # noqa: PLC0415 + data = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + + + limit = self.limit + + has_more = self.has_more + + next_cursor = self.next_cursor + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "data": data, + "limit": limit, + "has_more": has_more, + }) + if next_cursor is not UNSET: + field_dict["next_cursor"] = next_cursor + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.lavaflow_scan import LavaflowScan # noqa: PLC0415 + d = dict(src_dict) + data = [] + _data = d.pop("data") + for data_item_data in (_data): + data_item = LavaflowScan.from_dict(data_item_data) + + + + data.append(data_item) + + + limit = d.pop("limit") + + has_more = d.pop("has_more") + + next_cursor = d.pop("next_cursor", UNSET) + + paginated_lavaflow_scans = cls( + data=data, + limit=limit, + has_more=has_more, + next_cursor=next_cursor, + ) + + + paginated_lavaflow_scans.additional_properties = d + return paginated_lavaflow_scans + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/paginated_share_releases.py b/src/volcano_sdk/_generated/models/paginated_share_releases.py new file mode 100644 index 00000000..8d19b329 --- /dev/null +++ b/src/volcano_sdk/_generated/models/paginated_share_releases.py @@ -0,0 +1,121 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.share_release import ShareRelease + + + + + +T = TypeVar("T", bound="PaginatedShareReleases") + + + +@_attrs_define +class PaginatedShareReleases: + """ + Attributes: + data (list[ShareRelease]): + limit (int): Number of items per page + has_more (bool): Whether a next page exists + next_cursor (str | Unset): Opaque cursor for the next page, present if has_more is true. It works only for the + same share_id and limit. + """ + + data: list[ShareRelease] + limit: int + has_more: bool + next_cursor: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.share_release import ShareRelease # noqa: PLC0415 + data = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + + + limit = self.limit + + has_more = self.has_more + + next_cursor = self.next_cursor + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "data": data, + "limit": limit, + "has_more": has_more, + }) + if next_cursor is not UNSET: + field_dict["next_cursor"] = next_cursor + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.share_release import ShareRelease # noqa: PLC0415 + d = dict(src_dict) + data = [] + _data = d.pop("data") + for data_item_data in (_data): + data_item = ShareRelease.from_dict(data_item_data) + + + + data.append(data_item) + + + limit = d.pop("limit") + + has_more = d.pop("has_more") + + next_cursor = d.pop("next_cursor", UNSET) + + paginated_share_releases = cls( + data=data, + limit=limit, + has_more=has_more, + next_cursor=next_cursor, + ) + + + paginated_share_releases.additional_properties = d + return paginated_share_releases + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/project_access_token.py b/src/volcano_sdk/_generated/models/project_access_token.py index e7e81f8f..9e79f173 100644 --- a/src/volcano_sdk/_generated/models/project_access_token.py +++ b/src/volcano_sdk/_generated/models/project_access_token.py @@ -8,8 +8,8 @@ from ..types import UNSET, Unset -from ..models.project_access_token_scope import check_project_access_token_scope -from ..models.project_access_token_scope import ProjectAccessTokenScope +from ..models.project_access_token_listed_scope import check_project_access_token_listed_scope +from ..models.project_access_token_listed_scope import ProjectAccessTokenListedScope from ..models.project_access_token_status import check_project_access_token_status from ..models.project_access_token_status import ProjectAccessTokenStatus from ..models.project_access_token_token_source import check_project_access_token_token_source @@ -42,25 +42,12 @@ class ProjectAccessToken: project_id (UUID): name (str): Unique per project. token_prefix (str): First 12 characters of the secret, for recognising a token in a list. - scope (ProjectAccessTokenScope): 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. + scope (ProjectAccessTokenListedScope): A listed token's scope. `full` and `read_only` are the scopes you + choose when you create a token; see `ProjectAccessTokenScope`. + + `delegated` marks a delegated grant: a `pg-` token a first-party app + minted for one run from the access you allowed it. It is listed only + with `include_delegated=true`, and you cannot create one. status (ProjectAccessTokenStatus): `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 @@ -80,7 +67,7 @@ class ProjectAccessToken: project_id: UUID name: str token_prefix: str - scope: ProjectAccessTokenScope + scope: ProjectAccessTokenListedScope status: ProjectAccessTokenStatus token_source: ProjectAccessTokenTokenSource created_at: datetime.datetime @@ -168,7 +155,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: token_prefix = d.pop("token_prefix") - scope = check_project_access_token_scope(d.pop("scope")) + scope = check_project_access_token_listed_scope(d.pop("scope")) diff --git a/src/volcano_sdk/_generated/models/project_access_token_listed_scope.py b/src/volcano_sdk/_generated/models/project_access_token_listed_scope.py new file mode 100644 index 00000000..35bda453 --- /dev/null +++ b/src/volcano_sdk/_generated/models/project_access_token_listed_scope.py @@ -0,0 +1,10 @@ +from typing import Literal + +ProjectAccessTokenListedScope = Literal['delegated', 'full', 'read_only'] + +PROJECT_ACCESS_TOKEN_LISTED_SCOPE_VALUES: set[ProjectAccessTokenListedScope] = { 'delegated', 'full', 'read_only', } + +def check_project_access_token_listed_scope(value: str) -> ProjectAccessTokenListedScope: + if value in PROJECT_ACCESS_TOKEN_LISTED_SCOPE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {PROJECT_ACCESS_TOKEN_LISTED_SCOPE_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/project_config.py b/src/volcano_sdk/_generated/models/project_config.py index ead8f893..86fceb02 100644 --- a/src/volcano_sdk/_generated/models/project_config.py +++ b/src/volcano_sdk/_generated/models/project_config.py @@ -15,11 +15,12 @@ if TYPE_CHECKING: from ..models.project_config_auth import ProjectConfigAuth - from ..models.project_config_autofix import ProjectConfigAutofix from ..models.project_config_bucket import ProjectConfigBucket from ..models.project_config_database import ProjectConfigDatabase from ..models.project_config_frontend import ProjectConfigFrontend from ..models.project_config_function import ProjectConfigFunction + from ..models.project_config_lava_flow import ProjectConfigLavaFlow + from ..models.project_config_notifications import ProjectConfigNotifications from ..models.project_config_project import ProjectConfigProject from ..models.project_config_realtime import ProjectConfigRealtime from ..models.project_config_sandbox import ProjectConfigSandbox @@ -59,9 +60,13 @@ class ProjectConfig: are deleted. buckets (list[ProjectConfigBucket] | Unset): realtime (ProjectConfigRealtime | Unset): - autofix (ProjectConfigAutofix | Unset): AI diagnosis and fix settings. Omitted fields keep their current value. - Your API key is never part of the manifest, and an apply never sets or deletes it: set it with `PUT - /projects/{id}/autofix` before turning on a provider that runs on your own key. + lavaflow (ProjectConfigLavaFlow | Unset): Ignored. The manifest doesn't configure LavaFlow. A manifest that + still declares this section applies as before, without it, and the result reports it as `unchanged` with a + notice. Export never includes it. + notifications (ProjectConfigNotifications | Unset): Where the project's alerts go and when a failing scheduler + is announced. Omitted fields keep their current value. The webhook signing secret is never part of the manifest: + setting `webhook.url` on a project without a webhook generates one that is never shown. Rotate it with `POST + /projects/{id}/notifications/webhook-secret` to get a secret you can use. auth (ProjectConfigAuth | Unset): Authentication settings, grouped like the dashboard auth-settings tabs. functions (list[ProjectConfigFunction] | Unset): frontends (list[ProjectConfigFrontend] | Unset): @@ -77,7 +82,8 @@ class ProjectConfig: variables: list[ProjectConfigVariable] | Unset = UNSET buckets: list[ProjectConfigBucket] | Unset = UNSET realtime: ProjectConfigRealtime | Unset = UNSET - autofix: ProjectConfigAutofix | Unset = UNSET + lavaflow: ProjectConfigLavaFlow | Unset = UNSET + notifications: ProjectConfigNotifications | Unset = UNSET auth: ProjectConfigAuth | Unset = UNSET functions: list[ProjectConfigFunction] | Unset = UNSET frontends: list[ProjectConfigFrontend] | Unset = UNSET @@ -89,11 +95,12 @@ class ProjectConfig: def to_dict(self) -> dict[str, Any]: from ..models.project_config_auth import ProjectConfigAuth # noqa: PLC0415 - from ..models.project_config_autofix import ProjectConfigAutofix # noqa: PLC0415 from ..models.project_config_bucket import ProjectConfigBucket # noqa: PLC0415 from ..models.project_config_database import ProjectConfigDatabase # noqa: PLC0415 from ..models.project_config_frontend import ProjectConfigFrontend # noqa: PLC0415 from ..models.project_config_function import ProjectConfigFunction # noqa: PLC0415 + from ..models.project_config_lava_flow import ProjectConfigLavaFlow # noqa: PLC0415 + from ..models.project_config_notifications import ProjectConfigNotifications # noqa: PLC0415 from ..models.project_config_project import ProjectConfigProject # noqa: PLC0415 from ..models.project_config_realtime import ProjectConfigRealtime # noqa: PLC0415 from ..models.project_config_sandbox import ProjectConfigSandbox # noqa: PLC0415 @@ -147,9 +154,13 @@ def to_dict(self) -> dict[str, Any]: if not isinstance(self.realtime, Unset): realtime = self.realtime.to_dict() - autofix: dict[str, Any] | Unset = UNSET - if not isinstance(self.autofix, Unset): - autofix = self.autofix.to_dict() + lavaflow: dict[str, Any] | Unset = UNSET + if not isinstance(self.lavaflow, Unset): + lavaflow = self.lavaflow.to_dict() + + notifications: dict[str, Any] | Unset = UNSET + if not isinstance(self.notifications, Unset): + notifications = self.notifications.to_dict() auth: dict[str, Any] | Unset = UNSET if not isinstance(self.auth, Unset): @@ -202,8 +213,10 @@ def to_dict(self) -> dict[str, Any]: field_dict["buckets"] = buckets if realtime is not UNSET: field_dict["realtime"] = realtime - if autofix is not UNSET: - field_dict["autofix"] = autofix + if lavaflow is not UNSET: + field_dict["lavaflow"] = lavaflow + if notifications is not UNSET: + field_dict["notifications"] = notifications if auth is not UNSET: field_dict["auth"] = auth if functions is not UNSET: @@ -220,11 +233,12 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.project_config_auth import ProjectConfigAuth # noqa: PLC0415 - from ..models.project_config_autofix import ProjectConfigAutofix # noqa: PLC0415 from ..models.project_config_bucket import ProjectConfigBucket # noqa: PLC0415 from ..models.project_config_database import ProjectConfigDatabase # noqa: PLC0415 from ..models.project_config_frontend import ProjectConfigFrontend # noqa: PLC0415 from ..models.project_config_function import ProjectConfigFunction # noqa: PLC0415 + from ..models.project_config_lava_flow import ProjectConfigLavaFlow # noqa: PLC0415 + from ..models.project_config_notifications import ProjectConfigNotifications # noqa: PLC0415 from ..models.project_config_project import ProjectConfigProject # noqa: PLC0415 from ..models.project_config_realtime import ProjectConfigRealtime # noqa: PLC0415 from ..models.project_config_sandbox import ProjectConfigSandbox # noqa: PLC0415 @@ -297,12 +311,22 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - _autofix = d.pop("autofix", UNSET) - autofix: ProjectConfigAutofix | Unset - if isinstance(_autofix, Unset): - autofix = UNSET + _lavaflow = d.pop("lavaflow", UNSET) + lavaflow: ProjectConfigLavaFlow | Unset + if isinstance(_lavaflow, Unset): + lavaflow = UNSET + else: + lavaflow = ProjectConfigLavaFlow.from_dict(_lavaflow) + + + + + _notifications = d.pop("notifications", UNSET) + notifications: ProjectConfigNotifications | Unset + if isinstance(_notifications, Unset): + notifications = UNSET else: - autofix = ProjectConfigAutofix.from_dict(_autofix) + notifications = ProjectConfigNotifications.from_dict(_notifications) @@ -362,7 +386,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: variables=variables, buckets=buckets, realtime=realtime, - autofix=autofix, + lavaflow=lavaflow, + notifications=notifications, auth=auth, functions=functions, frontends=frontends, diff --git a/src/volcano_sdk/_generated/models/project_config_apply_result_entry.py b/src/volcano_sdk/_generated/models/project_config_apply_result_entry.py index 34360379..3eab7a1a 100644 --- a/src/volcano_sdk/_generated/models/project_config_apply_result_entry.py +++ b/src/volcano_sdk/_generated/models/project_config_apply_result_entry.py @@ -30,6 +30,11 @@ class ProjectConfigApplyResultEntry: action (ProjectConfigApplyResultEntryAction): name (str | Unset): Resource name or key within the section. Empty for singleton sections. error (str | Unset): Error detail when action is `error`. + code (str | Unset): Machine-readable reason for a `notice`, when it has one. Clients must accept codes not + listed + here. `function_served_by_candidate` - a promoted preview serves the function and keeps the + variables it was built with, so the apply did not synchronize the function's variables; the + entry's action is `unchanged`, and the rest of the apply succeeded. notice (str | Unset): Optional operational note (e.g. disabling realtime drops active connections). """ @@ -37,6 +42,7 @@ class ProjectConfigApplyResultEntry: action: ProjectConfigApplyResultEntryAction name: str | Unset = UNSET error: str | Unset = UNSET + code: str | Unset = UNSET notice: str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -53,6 +59,8 @@ def to_dict(self) -> dict[str, Any]: error = self.error + code = self.code + notice = self.notice @@ -66,6 +74,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["name"] = name if error is not UNSET: field_dict["error"] = error + if code is not UNSET: + field_dict["code"] = code if notice is not UNSET: field_dict["notice"] = notice @@ -87,6 +97,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: error = d.pop("error", UNSET) + code = d.pop("code", UNSET) + notice = d.pop("notice", UNSET) project_config_apply_result_entry = cls( @@ -94,6 +106,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: action=action, name=name, error=error, + code=code, notice=notice, ) diff --git a/src/volcano_sdk/_generated/models/project_config_auth_cors.py b/src/volcano_sdk/_generated/models/project_config_auth_cors.py index 7b0ca723..40604b35 100644 --- a/src/volcano_sdk/_generated/models/project_config_auth_cors.py +++ b/src/volcano_sdk/_generated/models/project_config_auth_cors.py @@ -28,12 +28,14 @@ class ProjectConfigAuthCORS: allowed_origins (list[str] | Unset): allow_credentials (bool | Unset): max_age (int | Unset): + allow_frontend_previews (bool | Unset): Allow the origins of the project's own live frontend previews. """ enabled: bool | Unset = UNSET allowed_origins: list[str] | Unset = UNSET allow_credentials: bool | Unset = UNSET max_age: int | Unset = UNSET + allow_frontend_previews: bool | Unset = UNSET @@ -52,6 +54,8 @@ def to_dict(self) -> dict[str, Any]: max_age = self.max_age + allow_frontend_previews = self.allow_frontend_previews + field_dict: dict[str, Any] = {} @@ -65,6 +69,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["allow_credentials"] = allow_credentials if max_age is not UNSET: field_dict["max_age"] = max_age + if allow_frontend_previews is not UNSET: + field_dict["allow_frontend_previews"] = allow_frontend_previews return field_dict @@ -82,11 +88,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: max_age = d.pop("max_age", UNSET) + allow_frontend_previews = d.pop("allow_frontend_previews", UNSET) + project_config_auth_cors = cls( enabled=enabled, allowed_origins=allowed_origins, allow_credentials=allow_credentials, max_age=max_age, + allow_frontend_previews=allow_frontend_previews, ) return project_config_auth_cors diff --git a/src/volcano_sdk/_generated/models/project_config_auth_email_from.py b/src/volcano_sdk/_generated/models/project_config_auth_email_from.py index a841d893..ea408e15 100644 --- a/src/volcano_sdk/_generated/models/project_config_auth_email_from.py +++ b/src/volcano_sdk/_generated/models/project_config_auth_email_from.py @@ -23,8 +23,10 @@ class ProjectConfigAuthEmailFrom: """ Attributes: - address (str | Unset): - name (str | Unset): + address (str | Unset): Sender email address. New or changed values containing carriage returns or newlines + return 422. Unchanged exported values are preserved. + name (str | Unset): Sender display name; supports punctuation and Unicode. New or changed values containing + carriage returns or newlines return 422. Unchanged exported values are preserved. """ address: str | Unset = UNSET diff --git a/src/volcano_sdk/_generated/models/project_config_auth_email_smtp.py b/src/volcano_sdk/_generated/models/project_config_auth_email_smtp.py index 031c7643..411a6157 100644 --- a/src/volcano_sdk/_generated/models/project_config_auth_email_smtp.py +++ b/src/volcano_sdk/_generated/models/project_config_auth_email_smtp.py @@ -23,7 +23,9 @@ class ProjectConfigAuthEmailSMTP: """ Attributes: - host (str | Unset): + host (str | Unset): SMTP server host name or IP address. Outside local mode, Volcano connects only to public + internet addresses, and a host that is, or resolves to, a loopback, private, link-local, or other non-public + address fails delivery. port (int | Unset): username (str | Unset): password (str | Unset): Write-only; omitted from config export. diff --git a/src/volcano_sdk/_generated/models/project_config_autofix.py b/src/volcano_sdk/_generated/models/project_config_autofix.py deleted file mode 100644 index 9e5c4161..00000000 --- a/src/volcano_sdk/_generated/models/project_config_autofix.py +++ /dev/null @@ -1,141 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - -from ..models.autofix_model import AutofixModel -from ..models.autofix_model import check_autofix_model -from ..models.autofix_provider import AutofixProvider -from ..models.autofix_provider import check_autofix_provider -from ..models.autofix_stage import AutofixStage -from ..models.autofix_stage import check_autofix_stage -from ..types import UNSET, Unset -from typing import cast - - - - - - -T = TypeVar("T", bound="ProjectConfigAutofix") - - - -@_attrs_define -class ProjectConfigAutofix: - """ AI diagnosis and fix settings. Omitted fields keep their current value. Your API key is never part of the manifest, - and an apply never sets or deletes it: set it with `PUT /projects/{id}/autofix` before turning on a provider that - runs on your own key. - - Attributes: - enabled (bool | Unset): - max_stage (AutofixStage | Unset): How far a run may go. `diagnose` stops at a root-cause diagnosis. - `pull_request` may also open a draft pull request with a fix in the project's connected repository. - auto_trigger (bool | Unset): - provider (AutofixProvider | Unset): Who serves the model. `volcano` runs on Volcano's models. `anthropic` runs - on your own Anthropic API key. - model (AutofixModel | Unset): The Claude model a run uses. `claude-opus-5-5` is the default. - """ - - enabled: bool | Unset = UNSET - max_stage: AutofixStage | Unset = UNSET - auto_trigger: bool | Unset = UNSET - provider: AutofixProvider | Unset = UNSET - model: AutofixModel | Unset = UNSET - - - - - - def to_dict(self) -> dict[str, Any]: - enabled = self.enabled - - max_stage: str | Unset = UNSET - if not isinstance(self.max_stage, Unset): - max_stage = self.max_stage - - - auto_trigger = self.auto_trigger - - provider: str | Unset = UNSET - if not isinstance(self.provider, Unset): - provider = self.provider - - - model: str | Unset = UNSET - if not isinstance(self.model, Unset): - model = self.model - - - - field_dict: dict[str, Any] = {} - - field_dict.update({ - }) - if enabled is not UNSET: - field_dict["enabled"] = enabled - if max_stage is not UNSET: - field_dict["max_stage"] = max_stage - if auto_trigger is not UNSET: - field_dict["auto_trigger"] = auto_trigger - if provider is not UNSET: - field_dict["provider"] = provider - if model is not UNSET: - field_dict["model"] = model - - return field_dict - - - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - enabled = d.pop("enabled", UNSET) - - _max_stage = d.pop("max_stage", UNSET) - max_stage: AutofixStage | Unset - if isinstance(_max_stage, Unset): - max_stage = UNSET - else: - max_stage = check_autofix_stage(_max_stage) - - - - - auto_trigger = d.pop("auto_trigger", UNSET) - - _provider = d.pop("provider", UNSET) - provider: AutofixProvider | Unset - if isinstance(_provider, Unset): - provider = UNSET - else: - provider = check_autofix_provider(_provider) - - - - - _model = d.pop("model", UNSET) - model: AutofixModel | Unset - if isinstance(_model, Unset): - model = UNSET - else: - model = check_autofix_model(_model) - - - - - project_config_autofix = cls( - enabled=enabled, - max_stage=max_stage, - auto_trigger=auto_trigger, - provider=provider, - model=model, - ) - - return project_config_autofix - diff --git a/src/volcano_sdk/_generated/models/project_config_custom_domain_redirect.py b/src/volcano_sdk/_generated/models/project_config_custom_domain_redirect.py new file mode 100644 index 00000000..4f3b64b9 --- /dev/null +++ b/src/volcano_sdk/_generated/models/project_config_custom_domain_redirect.py @@ -0,0 +1,82 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.project_config_custom_domain_redirect_status import check_project_config_custom_domain_redirect_status +from ..models.project_config_custom_domain_redirect_status import ProjectConfigCustomDomainRedirectStatus +from ..types import UNSET, Unset +from typing import cast + + + + + + +T = TypeVar("T", bound="ProjectConfigCustomDomainRedirect") + + + +@_attrs_define +class ProjectConfigCustomDomainRedirect: + """ + Attributes: + to (str): Another domain in the same `custom_domains` list, without `redirect`. + status (ProjectConfigCustomDomainRedirectStatus | Unset): Default: 308. + """ + + to: str + status: ProjectConfigCustomDomainRedirectStatus | Unset = 308 + + + + + + def to_dict(self) -> dict[str, Any]: + to = self.to + + status: int | Unset = UNSET + if not isinstance(self.status, Unset): + status = self.status + + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "to": to, + }) + if status is not UNSET: + field_dict["status"] = status + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + to = d.pop("to") + + _status = d.pop("status", UNSET) + status: ProjectConfigCustomDomainRedirectStatus | Unset + if isinstance(_status, Unset): + status = UNSET + else: + status = check_project_config_custom_domain_redirect_status(_status) + + + + + project_config_custom_domain_redirect = cls( + to=to, + status=status, + ) + + return project_config_custom_domain_redirect + diff --git a/src/volcano_sdk/_generated/models/project_config_custom_domain_redirect_status.py b/src/volcano_sdk/_generated/models/project_config_custom_domain_redirect_status.py new file mode 100644 index 00000000..9e37c4ee --- /dev/null +++ b/src/volcano_sdk/_generated/models/project_config_custom_domain_redirect_status.py @@ -0,0 +1,10 @@ +from typing import Literal + +ProjectConfigCustomDomainRedirectStatus = Literal[301, 302, 307, 308] + +PROJECT_CONFIG_CUSTOM_DOMAIN_REDIRECT_STATUS_VALUES: set[ProjectConfigCustomDomainRedirectStatus] = { 301, 302, 307, 308, } + +def check_project_config_custom_domain_redirect_status(value: int) -> ProjectConfigCustomDomainRedirectStatus: + if value in PROJECT_CONFIG_CUSTOM_DOMAIN_REDIRECT_STATUS_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {PROJECT_CONFIG_CUSTOM_DOMAIN_REDIRECT_STATUS_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/project_config_email_template.py b/src/volcano_sdk/_generated/models/project_config_email_template.py index 654f2b76..6f9a245f 100644 --- a/src/volcano_sdk/_generated/models/project_config_email_template.py +++ b/src/volcano_sdk/_generated/models/project_config_email_template.py @@ -23,7 +23,9 @@ class ProjectConfigEmailTemplate: """ Attributes: - subject (str | Unset): + subject (str | Unset): Subject template. For new or changed values, literal interior carriage returns or + newlines after Go template whitespace trimming return 422. Outer whitespace and trailing block-scalar newlines + are allowed. Unchanged stored subjects are preserved. html_body (str | Unset): HTML body. Max 256 KiB. SUPERAGENT plan required for custom bodies. text_body (str | Unset): Plain-text body. Max 256 KiB. SUPERAGENT plan required for custom bodies. """ diff --git a/src/volcano_sdk/_generated/models/project_config_frontend.py b/src/volcano_sdk/_generated/models/project_config_frontend.py index 8664d9cf..cf057235 100644 --- a/src/volcano_sdk/_generated/models/project_config_frontend.py +++ b/src/volcano_sdk/_generated/models/project_config_frontend.py @@ -15,7 +15,9 @@ if TYPE_CHECKING: from ..models.project_config_custom_domain import ProjectConfigCustomDomain + from ..models.project_config_frontend_custom_domain import ProjectConfigFrontendCustomDomain from ..models.project_config_frontend_function_route import ProjectConfigFrontendFunctionRoute + from ..models.project_config_frontend_route import ProjectConfigFrontendRoute @@ -28,8 +30,7 @@ @_attrs_define class ProjectConfigFrontend: """ 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. + created or deleted through the manifest. Attributes: name (str): @@ -38,24 +39,31 @@ class ProjectConfigFrontend: in builds and runtime. Omission preserves the stored selection. variables (list[str] | Unset): Names selected when variable_scope is scoped. Missing declared values reject deployment. Omission preserves the stored list; an empty list clears it. - custom_domain (ProjectConfigCustomDomain | Unset): Custom domain with managed or BYOC TLS. `tls` is required - when the domain is first created and optional afterwards. For an existing - domain, omitting `tls` or sending only `tls.mode` keeps the stored - certificate; new BYOC material for the same domain rotates the - certificate in place (zero downtime). Changing `tls.mode` for the same - hostname switches an active domain in place (zero downtime); a domain - that is not yet active, or a managed domain changing hostname, must be - deleted first. BYOC TLS material is write-only; exports render only - `tls.mode`. + custom_domain (None | ProjectConfigCustomDomain | Unset): The frontend's custom domain. Omission leaves an + existing domain + untouched; null deletes it. For a frontend with more than one + domain, or a redirect, use `custom_domains`; an entry may not set + both. + custom_domains (list[ProjectConfigFrontendCustomDomain] | Unset): Complete set of the frontend's custom domains + when declared. + Domains not listed are deleted; an empty list deletes all of them. + Omission leaves existing domains untouched. More than one domain + needs a plan that allows it. function_routes (list[ProjectConfigFrontendFunctionRoute] | Unset): Complete set of same-origin Function path mappings when declared. Omission preserves existing mappings; an empty list deletes all mappings. + frontend_routes (list[ProjectConfigFrontendRoute] | Unset): Complete set of paths this frontend serves from + another frontend in the project when + declared. Omission preserves existing routes; an empty list deletes all of them. + Function and Frontend routes share one path namespace and the 64-route limit. """ name: str variable_scope: ProjectConfigFrontendVariableScope | Unset = UNSET variables: list[str] | Unset = UNSET - custom_domain: ProjectConfigCustomDomain | Unset = UNSET + custom_domain: None | ProjectConfigCustomDomain | Unset = UNSET + custom_domains: list[ProjectConfigFrontendCustomDomain] | Unset = UNSET function_routes: list[ProjectConfigFrontendFunctionRoute] | Unset = UNSET + frontend_routes: list[ProjectConfigFrontendRoute] | Unset = UNSET @@ -63,7 +71,9 @@ class ProjectConfigFrontend: def to_dict(self) -> dict[str, Any]: from ..models.project_config_custom_domain import ProjectConfigCustomDomain # noqa: PLC0415 + from ..models.project_config_frontend_custom_domain import ProjectConfigFrontendCustomDomain # noqa: PLC0415 from ..models.project_config_frontend_function_route import ProjectConfigFrontendFunctionRoute # noqa: PLC0415 + from ..models.project_config_frontend_route import ProjectConfigFrontendRoute # noqa: PLC0415 name = self.name variable_scope: str | Unset = UNSET @@ -77,9 +87,22 @@ def to_dict(self) -> dict[str, Any]: - custom_domain: dict[str, Any] | Unset = UNSET - if not isinstance(self.custom_domain, Unset): + custom_domain: dict[str, Any] | None | Unset + if isinstance(self.custom_domain, Unset): + custom_domain = UNSET + elif isinstance(self.custom_domain, ProjectConfigCustomDomain): custom_domain = self.custom_domain.to_dict() + else: + custom_domain = self.custom_domain + + custom_domains: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.custom_domains, Unset): + custom_domains = [] + for custom_domains_item_data in self.custom_domains: + custom_domains_item = custom_domains_item_data.to_dict() + custom_domains.append(custom_domains_item) + + function_routes: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.function_routes, Unset): @@ -90,6 +113,15 @@ def to_dict(self) -> dict[str, Any]: + frontend_routes: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.frontend_routes, Unset): + frontend_routes = [] + for frontend_routes_item_data in self.frontend_routes: + frontend_routes_item = frontend_routes_item_data.to_dict() + frontend_routes.append(frontend_routes_item) + + + field_dict: dict[str, Any] = {} @@ -102,8 +134,12 @@ def to_dict(self) -> dict[str, Any]: field_dict["variables"] = variables if custom_domain is not UNSET: field_dict["custom_domain"] = custom_domain + if custom_domains is not UNSET: + field_dict["custom_domains"] = custom_domains if function_routes is not UNSET: field_dict["function_routes"] = function_routes + if frontend_routes is not UNSET: + field_dict["frontend_routes"] = frontend_routes return field_dict @@ -112,7 +148,9 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.project_config_custom_domain import ProjectConfigCustomDomain # noqa: PLC0415 + from ..models.project_config_frontend_custom_domain import ProjectConfigFrontendCustomDomain # noqa: PLC0415 from ..models.project_config_frontend_function_route import ProjectConfigFrontendFunctionRoute # noqa: PLC0415 + from ..models.project_config_frontend_route import ProjectConfigFrontendRoute # noqa: PLC0415 d = dict(src_dict) name = d.pop("name") @@ -129,14 +167,36 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: variables = cast(list[str], d.pop("variables", UNSET)) - _custom_domain = d.pop("custom_domain", UNSET) - custom_domain: ProjectConfigCustomDomain | Unset - if isinstance(_custom_domain, Unset): - custom_domain = UNSET - else: - custom_domain = ProjectConfigCustomDomain.from_dict(_custom_domain) + def _parse_custom_domain(data: object) -> None | ProjectConfigCustomDomain | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + custom_domain_type_1 = ProjectConfigCustomDomain.from_dict(data) + + return custom_domain_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | ProjectConfigCustomDomain | Unset, data) + + custom_domain = _parse_custom_domain(d.pop("custom_domain", UNSET)) + + + _custom_domains = d.pop("custom_domains", UNSET) + custom_domains: list[ProjectConfigFrontendCustomDomain] | Unset = UNSET + if _custom_domains is not UNSET: + custom_domains = [] + for custom_domains_item_data in _custom_domains: + custom_domains_item = ProjectConfigFrontendCustomDomain.from_dict(custom_domains_item_data) + + + + custom_domains.append(custom_domains_item) _function_routes = d.pop("function_routes", UNSET) @@ -151,12 +211,26 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: function_routes.append(function_routes_item) + _frontend_routes = d.pop("frontend_routes", UNSET) + frontend_routes: list[ProjectConfigFrontendRoute] | Unset = UNSET + if _frontend_routes is not UNSET: + frontend_routes = [] + for frontend_routes_item_data in _frontend_routes: + frontend_routes_item = ProjectConfigFrontendRoute.from_dict(frontend_routes_item_data) + + + + frontend_routes.append(frontend_routes_item) + + project_config_frontend = cls( name=name, variable_scope=variable_scope, variables=variables, custom_domain=custom_domain, + custom_domains=custom_domains, function_routes=function_routes, + frontend_routes=frontend_routes, ) return project_config_frontend diff --git a/src/volcano_sdk/_generated/models/project_config_frontend_custom_domain.py b/src/volcano_sdk/_generated/models/project_config_frontend_custom_domain.py new file mode 100644 index 00000000..010eee55 --- /dev/null +++ b/src/volcano_sdk/_generated/models/project_config_frontend_custom_domain.py @@ -0,0 +1,132 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.byoc_project_config_frontend_custom_domain_tls_config import BYOCProjectConfigFrontendCustomDomainTLSConfig + from ..models.managed_project_config_frontend_custom_domain_tls_config import ManagedProjectConfigFrontendCustomDomainTLSConfig + from ..models.project_config_custom_domain_redirect import ProjectConfigCustomDomainRedirect + + + + + +T = TypeVar("T", bound="ProjectConfigFrontendCustomDomain") + + + +@_attrs_define +class ProjectConfigFrontendCustomDomain: + """ One of the frontend's custom domains. `domain` and `tls` behave as in + `custom_domain`. With `redirect`, the domain redirects every request to + another listed domain that serves the frontend. + + Attributes: + domain (str): Fully-qualified domain name (hostname only, no scheme/path). Managed TLS (`tls.mode: managed`) + accepts at most 219 characters; BYOC accepts 253. + tls (BYOCProjectConfigFrontendCustomDomainTLSConfig | ManagedProjectConfigFrontendCustomDomainTLSConfig | + Unset): TLS for the custom domain. `mode` defaults to `byoc` when omitted. + redirect (ProjectConfigCustomDomainRedirect | Unset): + """ + + domain: str + tls: BYOCProjectConfigFrontendCustomDomainTLSConfig | ManagedProjectConfigFrontendCustomDomainTLSConfig | Unset = UNSET + redirect: ProjectConfigCustomDomainRedirect | Unset = UNSET + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.byoc_project_config_frontend_custom_domain_tls_config import BYOCProjectConfigFrontendCustomDomainTLSConfig # noqa: PLC0415 + from ..models.managed_project_config_frontend_custom_domain_tls_config import ManagedProjectConfigFrontendCustomDomainTLSConfig # noqa: PLC0415 + from ..models.project_config_custom_domain_redirect import ProjectConfigCustomDomainRedirect # noqa: PLC0415 + domain = self.domain + + tls: dict[str, Any] | Unset + if isinstance(self.tls, Unset): + tls = UNSET + elif isinstance(self.tls, ManagedProjectConfigFrontendCustomDomainTLSConfig): + tls = self.tls.to_dict() + else: + tls = self.tls.to_dict() + + + redirect: dict[str, Any] | Unset = UNSET + if not isinstance(self.redirect, Unset): + redirect = self.redirect.to_dict() + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "domain": domain, + }) + if tls is not UNSET: + field_dict["tls"] = tls + if redirect is not UNSET: + field_dict["redirect"] = redirect + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.byoc_project_config_frontend_custom_domain_tls_config import BYOCProjectConfigFrontendCustomDomainTLSConfig # noqa: PLC0415 + from ..models.managed_project_config_frontend_custom_domain_tls_config import ManagedProjectConfigFrontendCustomDomainTLSConfig # noqa: PLC0415 + from ..models.project_config_custom_domain_redirect import ProjectConfigCustomDomainRedirect # noqa: PLC0415 + d = dict(src_dict) + domain = d.pop("domain") + + def _parse_tls(data: object) -> BYOCProjectConfigFrontendCustomDomainTLSConfig | ManagedProjectConfigFrontendCustomDomainTLSConfig | Unset: + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + componentsschemas_project_config_frontend_custom_domain_tls_config_type_0 = ManagedProjectConfigFrontendCustomDomainTLSConfig.from_dict(data) + + + + return componentsschemas_project_config_frontend_custom_domain_tls_config_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + if not isinstance(data, dict): + raise TypeError() + componentsschemas_project_config_frontend_custom_domain_tls_config_type_1 = BYOCProjectConfigFrontendCustomDomainTLSConfig.from_dict(data) + + + + return componentsschemas_project_config_frontend_custom_domain_tls_config_type_1 + + tls = _parse_tls(d.pop("tls", UNSET)) + + + _redirect = d.pop("redirect", UNSET) + redirect: ProjectConfigCustomDomainRedirect | Unset + if isinstance(_redirect, Unset): + redirect = UNSET + else: + redirect = ProjectConfigCustomDomainRedirect.from_dict(_redirect) + + + + + project_config_frontend_custom_domain = cls( + domain=domain, + tls=tls, + redirect=redirect, + ) + + return project_config_frontend_custom_domain + diff --git a/src/volcano_sdk/_generated/models/project_config_frontend_route.py b/src/volcano_sdk/_generated/models/project_config_frontend_route.py new file mode 100644 index 00000000..eff87beb --- /dev/null +++ b/src/volcano_sdk/_generated/models/project_config_frontend_route.py @@ -0,0 +1,66 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="ProjectConfigFrontendRoute") + + + +@_attrs_define +class ProjectConfigFrontendRoute: + """ + Attributes: + frontend (str): Name of another existing frontend in the project to mount. Paths are forwarded unchanged. + path_prefix (str): + """ + + frontend: str + path_prefix: str + + + + + + def to_dict(self) -> dict[str, Any]: + frontend = self.frontend + + path_prefix = self.path_prefix + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "frontend": frontend, + "path_prefix": path_prefix, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + frontend = d.pop("frontend") + + path_prefix = d.pop("path_prefix") + + project_config_frontend_route = cls( + frontend=frontend, + path_prefix=path_prefix, + ) + + return project_config_frontend_route + diff --git a/src/volcano_sdk/_generated/models/project_config_lava_flow.py b/src/volcano_sdk/_generated/models/project_config_lava_flow.py new file mode 100644 index 00000000..e25eed3a --- /dev/null +++ b/src/volcano_sdk/_generated/models/project_config_lava_flow.py @@ -0,0 +1,67 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="ProjectConfigLavaFlow") + + + +@_attrs_define +class ProjectConfigLavaFlow: + """ Ignored. The manifest doesn't configure LavaFlow. A manifest that still declares this section applies as before, + without it, and the result reports it as `unchanged` with a notice. Export never includes it. + + """ + + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + project_config_lava_flow = cls( + ) + + + project_config_lava_flow.additional_properties = d + return project_config_lava_flow + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/project_config_notifications.py b/src/volcano_sdk/_generated/models/project_config_notifications.py new file mode 100644 index 00000000..0f9d710c --- /dev/null +++ b/src/volcano_sdk/_generated/models/project_config_notifications.py @@ -0,0 +1,123 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.update_notification_email import UpdateNotificationEmail + from ..models.update_notification_webhook import UpdateNotificationWebhook + from ..models.update_scheduler_failure_alert_policy import UpdateSchedulerFailureAlertPolicy + + + + + +T = TypeVar("T", bound="ProjectConfigNotifications") + + + +@_attrs_define +class ProjectConfigNotifications: + """ Where the project's alerts go and when a failing scheduler is announced. Omitted fields keep their current value. + The webhook signing secret is never part of the manifest: setting `webhook.url` on a project without a webhook + generates one that is never shown. Rotate it with `POST /projects/{id}/notifications/webhook-secret` to get a secret + you can use. + + Attributes: + email (UpdateNotificationEmail | Unset): + webhook (UpdateNotificationWebhook | Unset): + scheduler_failures (UpdateSchedulerFailureAlertPolicy | Unset): + """ + + email: UpdateNotificationEmail | Unset = UNSET + webhook: UpdateNotificationWebhook | Unset = UNSET + scheduler_failures: UpdateSchedulerFailureAlertPolicy | Unset = UNSET + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.update_notification_email import UpdateNotificationEmail # noqa: PLC0415 + from ..models.update_notification_webhook import UpdateNotificationWebhook # noqa: PLC0415 + from ..models.update_scheduler_failure_alert_policy import UpdateSchedulerFailureAlertPolicy # noqa: PLC0415 + email: dict[str, Any] | Unset = UNSET + if not isinstance(self.email, Unset): + email = self.email.to_dict() + + webhook: dict[str, Any] | Unset = UNSET + if not isinstance(self.webhook, Unset): + webhook = self.webhook.to_dict() + + scheduler_failures: dict[str, Any] | Unset = UNSET + if not isinstance(self.scheduler_failures, Unset): + scheduler_failures = self.scheduler_failures.to_dict() + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + }) + if email is not UNSET: + field_dict["email"] = email + if webhook is not UNSET: + field_dict["webhook"] = webhook + if scheduler_failures is not UNSET: + field_dict["scheduler_failures"] = scheduler_failures + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.update_notification_email import UpdateNotificationEmail # noqa: PLC0415 + from ..models.update_notification_webhook import UpdateNotificationWebhook # noqa: PLC0415 + from ..models.update_scheduler_failure_alert_policy import UpdateSchedulerFailureAlertPolicy # noqa: PLC0415 + d = dict(src_dict) + _email = d.pop("email", UNSET) + email: UpdateNotificationEmail | Unset + if isinstance(_email, Unset): + email = UNSET + else: + email = UpdateNotificationEmail.from_dict(_email) + + + + + _webhook = d.pop("webhook", UNSET) + webhook: UpdateNotificationWebhook | Unset + if isinstance(_webhook, Unset): + webhook = UNSET + else: + webhook = UpdateNotificationWebhook.from_dict(_webhook) + + + + + _scheduler_failures = d.pop("scheduler_failures", UNSET) + scheduler_failures: UpdateSchedulerFailureAlertPolicy | Unset + if isinstance(_scheduler_failures, Unset): + scheduler_failures = UNSET + else: + scheduler_failures = UpdateSchedulerFailureAlertPolicy.from_dict(_scheduler_failures) + + + + + project_config_notifications = cls( + email=email, + webhook=webhook, + scheduler_failures=scheduler_failures, + ) + + return project_config_notifications + diff --git a/src/volcano_sdk/_generated/models/project_deployment.py b/src/volcano_sdk/_generated/models/project_deployment.py index 4529c3b1..5b7aadfc 100644 --- a/src/volcano_sdk/_generated/models/project_deployment.py +++ b/src/volcano_sdk/_generated/models/project_deployment.py @@ -20,6 +20,7 @@ import datetime if TYPE_CHECKING: + from ..models.deployment_commit import DeploymentCommit from ..models.deployment_progress import DeploymentProgress from ..models.project_deployment_resource import ProjectDeploymentResource @@ -48,6 +49,12 @@ class ProjectDeployment: completed_at (datetime.datetime | Unset): progress (DeploymentProgress | Unset): Normalized live progress derived from the deployment workflow and build phases. + commit (DeploymentCommit | Unset): The commit the deployment's source came from: the commit a deploy client + reported, or for a deployment a Git deployment run made, the commit the run deployed. Absent when there is + neither. A frontend deployment that publishes another deployment's build carries the commit that deployment's + client reported; one that publishes a Git deployment run's build has none. + git_deployment_run_id (UUID | Unset): The Git deployment run that made this deployment. Absent for a deployment + no Git deployment run made. """ id: UUID @@ -61,6 +68,8 @@ class ProjectDeployment: error_message: str | Unset = UNSET completed_at: datetime.datetime | Unset = UNSET progress: DeploymentProgress | Unset = UNSET + commit: DeploymentCommit | Unset = UNSET + git_deployment_run_id: UUID | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -68,6 +77,7 @@ class ProjectDeployment: def to_dict(self) -> dict[str, Any]: + from ..models.deployment_commit import DeploymentCommit # noqa: PLC0415 from ..models.deployment_progress import DeploymentProgress # noqa: PLC0415 from ..models.project_deployment_resource import ProjectDeploymentResource # noqa: PLC0415 id = str(self.id) @@ -96,6 +106,14 @@ def to_dict(self) -> dict[str, Any]: if not isinstance(self.progress, Unset): progress = self.progress.to_dict() + commit: dict[str, Any] | Unset = UNSET + if not isinstance(self.commit, Unset): + commit = self.commit.to_dict() + + git_deployment_run_id: str | Unset = UNSET + if not isinstance(self.git_deployment_run_id, Unset): + git_deployment_run_id = str(self.git_deployment_run_id) + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -115,6 +133,10 @@ def to_dict(self) -> dict[str, Any]: field_dict["completed_at"] = completed_at if progress is not UNSET: field_dict["progress"] = progress + if commit is not UNSET: + field_dict["commit"] = commit + if git_deployment_run_id is not UNSET: + field_dict["git_deployment_run_id"] = git_deployment_run_id return field_dict @@ -122,6 +144,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.deployment_commit import DeploymentCommit # noqa: PLC0415 from ..models.deployment_progress import DeploymentProgress # noqa: PLC0415 from ..models.project_deployment_resource import ProjectDeploymentResource # noqa: PLC0415 d = dict(src_dict) @@ -187,6 +210,26 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + _commit = d.pop("commit", UNSET) + commit: DeploymentCommit | Unset + if isinstance(_commit, Unset): + commit = UNSET + else: + commit = DeploymentCommit.from_dict(_commit) + + + + + _git_deployment_run_id = d.pop("git_deployment_run_id", UNSET) + git_deployment_run_id: UUID | Unset + if isinstance(_git_deployment_run_id, Unset): + git_deployment_run_id = UNSET + else: + git_deployment_run_id = UUID(_git_deployment_run_id) + + + + project_deployment = cls( id=id, project_id=project_id, @@ -199,6 +242,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: error_message=error_message, completed_at=completed_at, progress=progress, + commit=commit, + git_deployment_run_id=git_deployment_run_id, ) diff --git a/src/volcano_sdk/_generated/models/project_frontend_custom_domain.py b/src/volcano_sdk/_generated/models/project_frontend_custom_domain.py index eeee1384..76fb3b68 100644 --- a/src/volcano_sdk/_generated/models/project_frontend_custom_domain.py +++ b/src/volcano_sdk/_generated/models/project_frontend_custom_domain.py @@ -21,6 +21,7 @@ import datetime if TYPE_CHECKING: + from ..models.frontend_custom_domain_redirect import FrontendCustomDomainRedirect from ..models.frontend_domain_routing_record import FrontendDomainRoutingRecord from ..models.frontend_domain_verification_record import FrontendDomainVerificationRecord from ..models.project_frontend_custom_domain_frontend import ProjectFrontendCustomDomainFrontend @@ -45,6 +46,8 @@ class ProjectFrontendCustomDomain: withdrawn, or Volcano is retrying after a failure. `failed`: a failure left the domain unserved, alongside `domain_status: failed`; managed domains report the cause in `failure_reason`. effective_urls (list[str]): + redirect (FrontendCustomDomainRedirect | None): Where the domain redirects every request, or null when it serves + the frontend. created_at (datetime.datetime): updated_at (datetime.datetime): frontend (ProjectFrontendCustomDomainFrontend): The frontend this custom domain is attached to. Inlined to @@ -72,6 +75,7 @@ class ProjectFrontendCustomDomain: domain_status: FrontendCustomDomainResponseDomainStatus verification_status: FrontendCustomDomainResponseVerificationStatus effective_urls: list[str] + redirect: FrontendCustomDomainRedirect | None created_at: datetime.datetime updated_at: datetime.datetime frontend: ProjectFrontendCustomDomainFrontend @@ -87,6 +91,7 @@ class ProjectFrontendCustomDomain: def to_dict(self) -> dict[str, Any]: + from ..models.frontend_custom_domain_redirect import FrontendCustomDomainRedirect # noqa: PLC0415 from ..models.frontend_domain_routing_record import FrontendDomainRoutingRecord # noqa: PLC0415 from ..models.frontend_domain_verification_record import FrontendDomainVerificationRecord # noqa: PLC0415 from ..models.project_frontend_custom_domain_frontend import ProjectFrontendCustomDomainFrontend # noqa: PLC0415 @@ -102,6 +107,12 @@ def to_dict(self) -> dict[str, Any]: + redirect: dict[str, Any] | None + if isinstance(self.redirect, FrontendCustomDomainRedirect): + redirect = self.redirect.to_dict() + else: + redirect = self.redirect + created_at = self.created_at.isoformat() updated_at = self.updated_at.isoformat() @@ -139,6 +150,7 @@ def to_dict(self) -> dict[str, Any]: "domain_status": domain_status, "verification_status": verification_status, "effective_urls": effective_urls, + "redirect": redirect, "created_at": created_at, "updated_at": updated_at, "frontend": frontend, @@ -160,6 +172,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.frontend_custom_domain_redirect import FrontendCustomDomainRedirect # noqa: PLC0415 from ..models.frontend_domain_routing_record import FrontendDomainRoutingRecord # noqa: PLC0415 from ..models.frontend_domain_verification_record import FrontendDomainVerificationRecord # noqa: PLC0415 from ..models.project_frontend_custom_domain_frontend import ProjectFrontendCustomDomainFrontend # noqa: PLC0415 @@ -184,6 +197,24 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: effective_urls = cast(list[str], d.pop("effective_urls")) + def _parse_redirect(data: object) -> FrontendCustomDomainRedirect | None: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + redirect_type_1 = FrontendCustomDomainRedirect.from_dict(data) + + + + return redirect_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(FrontendCustomDomainRedirect | None, data) + + redirect = _parse_redirect(d.pop("redirect")) + + created_at = datetime.datetime.fromisoformat(d.pop("created_at")) @@ -241,6 +272,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: domain_status=domain_status, verification_status=verification_status, effective_urls=effective_urls, + redirect=redirect, created_at=created_at, updated_at=updated_at, frontend=frontend, diff --git a/src/volcano_sdk/_generated/models/project_git_connection.py b/src/volcano_sdk/_generated/models/project_git_connection.py index 679d5046..3a8e766d 100644 --- a/src/volcano_sdk/_generated/models/project_git_connection.py +++ b/src/volcano_sdk/_generated/models/project_git_connection.py @@ -30,7 +30,13 @@ class ProjectGitConnection: root_directory (str): production_branch (str): The branch a push must land on to deploy. Follows the repository's GitHub default branch unless the project set its own, which a default-branch rename on GitHub then leaves alone. - updated_at (datetime.datetime): + production_branch_follows_default (bool): True when `production_branch` follows the repository's default branch + and moves with a default-branch rename on GitHub. False when the project pinned a branch, even one that matches + the current default. Pin a branch with `PUT /projects/{id}/git-connection/production-branch`; send an empty + `production_branch` there to follow the default again. + updated_at (datetime.datetime): When the connection last changed: its repository, root directory or production + branch. Naming the branch it already uses, and other changes to the project, leave it alone. A connection that + has not changed since Volcano began tracking this reports the project's last change before then. """ repo_installation_id: int @@ -38,6 +44,7 @@ class ProjectGitConnection: repo_full_name: str root_directory: str production_branch: str + production_branch_follows_default: bool updated_at: datetime.datetime additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -56,6 +63,8 @@ def to_dict(self) -> dict[str, Any]: production_branch = self.production_branch + production_branch_follows_default = self.production_branch_follows_default + updated_at = self.updated_at.isoformat() @@ -67,6 +76,7 @@ def to_dict(self) -> dict[str, Any]: "repo_full_name": repo_full_name, "root_directory": root_directory, "production_branch": production_branch, + "production_branch_follows_default": production_branch_follows_default, "updated_at": updated_at, }) @@ -87,6 +97,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: production_branch = d.pop("production_branch") + production_branch_follows_default = d.pop("production_branch_follows_default") + updated_at = datetime.datetime.fromisoformat(d.pop("updated_at")) @@ -98,6 +110,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: repo_full_name=repo_full_name, root_directory=root_directory, production_branch=production_branch, + production_branch_follows_default=production_branch_follows_default, updated_at=updated_at, ) diff --git a/src/volcano_sdk/_generated/models/project_git_connection_summary.py b/src/volcano_sdk/_generated/models/project_git_connection_summary.py index 746925ee..0959eee0 100644 --- a/src/volcano_sdk/_generated/models/project_git_connection_summary.py +++ b/src/volcano_sdk/_generated/models/project_git_connection_summary.py @@ -29,7 +29,9 @@ class ProjectGitConnectionSummary: repo_full_name (str): root_directory (str): production_branch (str): - updated_at (datetime.datetime): + updated_at (datetime.datetime): When the connection last changed: its repository, root directory or production + branch. Naming the branch it already uses, and other changes to the project, leave it alone. A connection that + has not changed since Volcano began tracking this reports the project's last change before then. """ repo_installation_id: int diff --git a/src/volcano_sdk/_generated/models/project_git_deploy_settings.py b/src/volcano_sdk/_generated/models/project_git_deploy_settings.py index 33b56aff..53cc2988 100644 --- a/src/volcano_sdk/_generated/models/project_git_deploy_settings.py +++ b/src/volcano_sdk/_generated/models/project_git_deploy_settings.py @@ -23,13 +23,36 @@ @_attrs_define class ProjectGitDeploySettings: - """ A project's GitHub auto-deploy settings: what a push to the connected repo's production branch deploys. All settings - are default-off. + """ A project's GitHub auto-deploy settings: what a push to the connected repo's production branch deploys. Every + setting but skip_unchanged is default-off. Attributes: auto_deploy_enabled (bool): Whether a production-branch push triggers a deployment. deploy_functions (bool): Whether the repo's functions are deployed on push. - updated_at (datetime.datetime): + apply_migrations (bool): Whether a push applies the commit's pending migrations, the SQL files under + volcano/migrations, before it deploys anything. Each database gets a migration run with source `git_deploy`; + when one fails, nothing from the push deploys and the live version keeps serving. A push starts a migration run + only while the project owner's account is `active`; otherwise it starts none, deploys nothing, and fails with + code `owner_not_active`. A run an earlier attempt of the push started before the account changed keeps its + outcome, but the push still deploys none of its code and fails with `owner_not_active`; its message says the + schema changes stay. Nothing retries that push; push again once the account is `active`, and that push skips the + migrations already applied. Reads back as saved even where the `databases.migrations` capability is unavailable; + there, a push whose commit has migrations deploys nothing. + skip_unchanged (bool): Whether a push leaves a function or frontend on its current deployment when it would + deploy the same code the same way. A function is left alone when its live deployment succeeded, was built from a + byte-identical source archive by the same build, and has the same runtime, handler, kind, variable scope, memory + and regions. A change to shared code under a `_`-prefixed path redeploys every function. A frontend is left + alone when its live deployment compiled the same files (the frontend's whole workspace, including `volcano/` for + a frontend at the project root) with the same app root, framework, build, build variable values, sizing and + regions. Either is deployed again when it was deployed some other way since the last push or a promoted preview + serves it, and a function is deployed again after any variable change since its deployment. The push records a + skipped resource as unchanged and counts it as succeeded. On by default. Takes effect only where the + `git_deploy.skip_unchanged` capability is available; elsewhere every push deploys every function and frontend as + if this were off. + updated_at (datetime.datetime): When the settings were last saved, or last changed by connecting a repository. + Other changes to the project leave it alone. Settings a connection turned on before Volcano began tracking this + report the project's last change before then; settings never saved or changed report when the project was + created. frontend_name (str | Unset): Name of the frontend to build and deploy on push. Omitted when no frontend is deployed. Resolved at deploy time; need not exist yet. frontend_app_root (str | Unset): App root (subdirectory) the frontend builds from. Omitted for the repo root. @@ -37,6 +60,8 @@ class ProjectGitDeploySettings: auto_deploy_enabled: bool deploy_functions: bool + apply_migrations: bool + skip_unchanged: bool updated_at: datetime.datetime frontend_name: str | Unset = UNSET frontend_app_root: str | Unset = UNSET @@ -51,6 +76,10 @@ def to_dict(self) -> dict[str, Any]: deploy_functions = self.deploy_functions + apply_migrations = self.apply_migrations + + skip_unchanged = self.skip_unchanged + updated_at = self.updated_at.isoformat() frontend_name = self.frontend_name @@ -63,6 +92,8 @@ def to_dict(self) -> dict[str, Any]: field_dict.update({ "auto_deploy_enabled": auto_deploy_enabled, "deploy_functions": deploy_functions, + "apply_migrations": apply_migrations, + "skip_unchanged": skip_unchanged, "updated_at": updated_at, }) if frontend_name is not UNSET: @@ -81,6 +112,10 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: deploy_functions = d.pop("deploy_functions") + apply_migrations = d.pop("apply_migrations") + + skip_unchanged = d.pop("skip_unchanged") + updated_at = datetime.datetime.fromisoformat(d.pop("updated_at")) @@ -93,6 +128,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: project_git_deploy_settings = cls( auto_deploy_enabled=auto_deploy_enabled, deploy_functions=deploy_functions, + apply_migrations=apply_migrations, + skip_unchanged=skip_unchanged, updated_at=updated_at, frontend_name=frontend_name, frontend_app_root=frontend_app_root, diff --git a/src/volcano_sdk/_generated/models/project_git_owner_push.py b/src/volcano_sdk/_generated/models/project_git_owner_push.py new file mode 100644 index 00000000..b33927b6 --- /dev/null +++ b/src/volcano_sdk/_generated/models/project_git_owner_push.py @@ -0,0 +1,114 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.project_git_owner_push_reason import check_project_git_owner_push_reason +from ..models.project_git_owner_push_reason import ProjectGitOwnerPushReason +from ..types import UNSET, Unset +from typing import cast + + + + + + +T = TypeVar("T", bound="ProjectGitOwnerPush") + + + +@_attrs_define +class ProjectGitOwnerPush: + """ Whether the project owner can push to the project's connected repository. + + Attributes: + repository_id (int): Stable GitHub repository id of the connected repository, the `repo_id` of the project's git + connection. + can_push (bool): True when the project owner's GitHub account can push to the repository. + reason (ProjectGitOwnerPushReason | Unset): Why `can_push` is false; absent when it is true. + `owner_not_connected`: the owner has not connected a GitHub account. `owner_reconnect_required`: the owner's + GitHub connection expired or was revoked; the owner reconnects GitHub. `repository_access_lost`: the owner's + GitHub account can no longer see the repository. `no_push_permission`: the owner's GitHub account can read the + repository but not push to it. + """ + + repository_id: int + can_push: bool + reason: ProjectGitOwnerPushReason | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + repository_id = self.repository_id + + can_push = self.can_push + + reason: str | Unset = UNSET + if not isinstance(self.reason, Unset): + reason = self.reason + + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "repository_id": repository_id, + "can_push": can_push, + }) + if reason is not UNSET: + field_dict["reason"] = reason + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + repository_id = d.pop("repository_id") + + can_push = d.pop("can_push") + + _reason = d.pop("reason", UNSET) + reason: ProjectGitOwnerPushReason | Unset + if isinstance(_reason, Unset): + reason = UNSET + else: + reason = check_project_git_owner_push_reason(_reason) + + + + + project_git_owner_push = cls( + repository_id=repository_id, + can_push=can_push, + reason=reason, + ) + + + project_git_owner_push.additional_properties = d + return project_git_owner_push + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/project_git_owner_push_reason.py b/src/volcano_sdk/_generated/models/project_git_owner_push_reason.py new file mode 100644 index 00000000..ad7502bd --- /dev/null +++ b/src/volcano_sdk/_generated/models/project_git_owner_push_reason.py @@ -0,0 +1,10 @@ +from typing import Literal + +ProjectGitOwnerPushReason = Literal['no_push_permission', 'owner_not_connected', 'owner_reconnect_required', 'repository_access_lost'] + +PROJECT_GIT_OWNER_PUSH_REASON_VALUES: set[ProjectGitOwnerPushReason] = { 'no_push_permission', 'owner_not_connected', 'owner_reconnect_required', 'repository_access_lost', } + +def check_project_git_owner_push_reason(value: str) -> ProjectGitOwnerPushReason: + if value in PROJECT_GIT_OWNER_PUSH_REASON_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {PROJECT_GIT_OWNER_PUSH_REASON_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/project_import_preflight_request.py b/src/volcano_sdk/_generated/models/project_import_preflight_request.py index 4b549815..57266467 100644 --- a/src/volcano_sdk/_generated/models/project_import_preflight_request.py +++ b/src/volcano_sdk/_generated/models/project_import_preflight_request.py @@ -34,7 +34,17 @@ class ProjectImportPreflightRequest: confirm_environment_variable_read (bool | Unset): Set to true only after the user confirms an immediately preceding disclosure that the Vercel Integration grant permits reads and writes, while this preflight reads production variable values only. When false or omitted, preflight reads variable metadata only and reports - readable values as manual input. Default: False. + readable values as manual input. `github` reads no variable values and ignores it. Default: False. + branch (str | Unset): `github` only. The branch to deploy, which becomes the project's production branch. Omit + it to use the repository's default branch. + root_directory (str | Unset): `github` only. The repository directory, relative to its root, that holds the + project, as in a monorepo. Omit it or send an empty string for the repository root. It becomes the project's + root directory. A deployment receives only this directory. + app_root (str | Unset): `github` only. The directory of the Next.js app, relative to `root_directory`, when the + root directory holds a workspace that installs the app, as in a pnpm, npm or Yarn monorepo. Omit it or send an + empty string for the app at the root directory. It becomes the project's frontend app root. A repository whose + `.volcano/source-layout.json` names its frontends takes none, and sending one is refused with + `import_source_invalid`. """ connection_id: UUID @@ -42,6 +52,9 @@ class ProjectImportPreflightRequest: project_name: str target: ProjectImportTarget confirm_environment_variable_read: bool | Unset = False + branch: str | Unset = UNSET + root_directory: str | Unset = UNSET + app_root: str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -59,6 +72,12 @@ def to_dict(self) -> dict[str, Any]: confirm_environment_variable_read = self.confirm_environment_variable_read + branch = self.branch + + root_directory = self.root_directory + + app_root = self.app_root + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -70,6 +89,12 @@ def to_dict(self) -> dict[str, Any]: }) if confirm_environment_variable_read is not UNSET: field_dict["confirm_environment_variable_read"] = confirm_environment_variable_read + if branch is not UNSET: + field_dict["branch"] = branch + if root_directory is not UNSET: + field_dict["root_directory"] = root_directory + if app_root is not UNSET: + field_dict["app_root"] = app_root return field_dict @@ -94,12 +119,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: confirm_environment_variable_read = d.pop("confirm_environment_variable_read", UNSET) + branch = d.pop("branch", UNSET) + + root_directory = d.pop("root_directory", UNSET) + + app_root = d.pop("app_root", UNSET) + project_import_preflight_request = cls( connection_id=connection_id, source_id=source_id, project_name=project_name, target=target, confirm_environment_variable_read=confirm_environment_variable_read, + branch=branch, + root_directory=root_directory, + app_root=app_root, ) diff --git a/src/volcano_sdk/_generated/models/project_import_report.py b/src/volcano_sdk/_generated/models/project_import_report.py index 5ea60dc8..3f0ce63a 100644 --- a/src/volcano_sdk/_generated/models/project_import_report.py +++ b/src/volcano_sdk/_generated/models/project_import_report.py @@ -12,6 +12,7 @@ from ..models.import_provider import ImportProvider from ..models.project_import_readiness import check_project_import_readiness from ..models.project_import_readiness import ProjectImportReadiness +from ..types import UNSET, Unset from typing import cast import datetime @@ -20,6 +21,7 @@ from ..models.project_import_action import ProjectImportAction from ..models.project_import_destination import ProjectImportDestination from ..models.project_import_finding import ProjectImportFinding + from ..models.project_import_source_scan import ProjectImportSourceScan from ..models.project_import_summary import ProjectImportSummary @@ -35,7 +37,10 @@ class ProjectImportReport: """ Attributes: schema_version (str): - provider (ImportProvider): + provider (ImportProvider): Where an import comes from. `vercel` imports a Vercel project through a Vercel + Integration connection. `github` imports a GitHub repository through the caller's own GitHub connection (`GET + /user/git/connections`) and one of its Volcano GitHub App installations; it has no connect flow of its own under + `/user/imports`. source (ImportSource): destination (ProjectImportDestination): actions (list[ProjectImportAction]): @@ -46,6 +51,8 @@ class ProjectImportReport: capability_fingerprint (str): fingerprint (str): generated_at (datetime.datetime): + source_scan (ProjectImportSourceScan | Unset): `github` only. What the selected commit holds and what the import + deploys from it, found by preparing the commit the way a deployment does. """ schema_version: str @@ -60,6 +67,7 @@ class ProjectImportReport: capability_fingerprint: str fingerprint: str generated_at: datetime.datetime + source_scan: ProjectImportSourceScan | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -71,6 +79,7 @@ def to_dict(self) -> dict[str, Any]: from ..models.project_import_action import ProjectImportAction # noqa: PLC0415 from ..models.project_import_destination import ProjectImportDestination # noqa: PLC0415 from ..models.project_import_finding import ProjectImportFinding # noqa: PLC0415 + from ..models.project_import_source_scan import ProjectImportSourceScan # noqa: PLC0415 from ..models.project_import_summary import ProjectImportSummary # noqa: PLC0415 schema_version = self.schema_version @@ -106,6 +115,10 @@ def to_dict(self) -> dict[str, Any]: generated_at = self.generated_at.isoformat() + source_scan: dict[str, Any] | Unset = UNSET + if not isinstance(self.source_scan, Unset): + source_scan = self.source_scan.to_dict() + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -123,6 +136,8 @@ def to_dict(self) -> dict[str, Any]: "fingerprint": fingerprint, "generated_at": generated_at, }) + if source_scan is not UNSET: + field_dict["source_scan"] = source_scan return field_dict @@ -134,6 +149,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.project_import_action import ProjectImportAction # noqa: PLC0415 from ..models.project_import_destination import ProjectImportDestination # noqa: PLC0415 from ..models.project_import_finding import ProjectImportFinding # noqa: PLC0415 + from ..models.project_import_source_scan import ProjectImportSourceScan # noqa: PLC0415 from ..models.project_import_summary import ProjectImportSummary # noqa: PLC0415 d = dict(src_dict) schema_version = d.pop("schema_version") @@ -194,6 +210,16 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + _source_scan = d.pop("source_scan", UNSET) + source_scan: ProjectImportSourceScan | Unset + if isinstance(_source_scan, Unset): + source_scan = UNSET + else: + source_scan = ProjectImportSourceScan.from_dict(_source_scan) + + + + project_import_report = cls( schema_version=schema_version, provider=provider, @@ -207,6 +233,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: capability_fingerprint=capability_fingerprint, fingerprint=fingerprint, generated_at=generated_at, + source_scan=source_scan, ) diff --git a/src/volcano_sdk/_generated/models/project_import_resource_kind.py b/src/volcano_sdk/_generated/models/project_import_resource_kind.py index eb4e1554..53e90d77 100644 --- a/src/volcano_sdk/_generated/models/project_import_resource_kind.py +++ b/src/volcano_sdk/_generated/models/project_import_resource_kind.py @@ -1,8 +1,8 @@ from typing import Literal -ProjectImportResourceKind = Literal['domain', 'frontend', 'git_repository', 'project', 'variable'] +ProjectImportResourceKind = Literal['domain', 'frontend', 'function', 'git_repository', 'project', 'variable'] -PROJECT_IMPORT_RESOURCE_KIND_VALUES: set[ProjectImportResourceKind] = { 'domain', 'frontend', 'git_repository', 'project', 'variable', } +PROJECT_IMPORT_RESOURCE_KIND_VALUES: set[ProjectImportResourceKind] = { 'domain', 'frontend', 'function', 'git_repository', 'project', 'variable', } def check_project_import_resource_kind(value: str) -> ProjectImportResourceKind: if value in PROJECT_IMPORT_RESOURCE_KIND_VALUES: diff --git a/src/volcano_sdk/_generated/models/project_import_root_candidate.py b/src/volcano_sdk/_generated/models/project_import_root_candidate.py new file mode 100644 index 00000000..5505d223 --- /dev/null +++ b/src/volcano_sdk/_generated/models/project_import_root_candidate.py @@ -0,0 +1,112 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.project_import_root_candidate_reason import check_project_import_root_candidate_reason +from ..models.project_import_root_candidate_reason import ProjectImportRootCandidateReason +from typing import cast + + + + + + +T = TypeVar("T", bound="ProjectImportRootCandidate") + + + +@_attrs_define +class ProjectImportRootCandidate: + """ A `root_directory` and `app_root` to import instead. A Next.js app in a workspace has the workspace root as its root + directory and its own directory as the app root, because a deployment receives only the root directory and the app + installs from its workspace. Any other app, and a `volcano/functions` directory, is its own root directory. + + Attributes: + root_directory (str): Relative to the repository root; empty for the repository root. + app_root (str): Relative to `root_directory`; empty for none. + reasons (list[ProjectImportRootCandidateReason]): What it holds: `nextjs_app`, a Next.js app the frontend build + supports; `volcano_functions`, a `volcano/functions` directory with at least one function. + """ + + root_directory: str + app_root: str + reasons: list[ProjectImportRootCandidateReason] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + root_directory = self.root_directory + + app_root = self.app_root + + reasons = [] + for reasons_item_data in self.reasons: + reasons_item: str = reasons_item_data + reasons.append(reasons_item) + + + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "root_directory": root_directory, + "app_root": app_root, + "reasons": reasons, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + root_directory = d.pop("root_directory") + + app_root = d.pop("app_root") + + reasons = [] + _reasons = d.pop("reasons") + for reasons_item_data in (_reasons): + reasons_item = check_project_import_root_candidate_reason(reasons_item_data) + + + + reasons.append(reasons_item) + + + project_import_root_candidate = cls( + root_directory=root_directory, + app_root=app_root, + reasons=reasons, + ) + + + project_import_root_candidate.additional_properties = d + return project_import_root_candidate + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/project_import_root_candidate_reason.py b/src/volcano_sdk/_generated/models/project_import_root_candidate_reason.py new file mode 100644 index 00000000..5fdff46a --- /dev/null +++ b/src/volcano_sdk/_generated/models/project_import_root_candidate_reason.py @@ -0,0 +1,10 @@ +from typing import Literal + +ProjectImportRootCandidateReason = Literal['nextjs_app', 'volcano_functions'] + +PROJECT_IMPORT_ROOT_CANDIDATE_REASON_VALUES: set[ProjectImportRootCandidateReason] = { 'nextjs_app', 'volcano_functions', } + +def check_project_import_root_candidate_reason(value: str) -> ProjectImportRootCandidateReason: + if value in PROJECT_IMPORT_ROOT_CANDIDATE_REASON_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {PROJECT_IMPORT_ROOT_CANDIDATE_REASON_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/project_import_run.py b/src/volcano_sdk/_generated/models/project_import_run.py index e37697ff..88b18e9f 100644 --- a/src/volcano_sdk/_generated/models/project_import_run.py +++ b/src/volcano_sdk/_generated/models/project_import_run.py @@ -33,7 +33,10 @@ class ProjectImportRun: """ Attributes: id (str): - provider (ImportProvider): + provider (ImportProvider): Where an import comes from. `vercel` imports a Vercel project through a Vercel + Integration connection. `github` imports a GitHub repository through the caller's own GitHub connection (`GET + /user/git/connections`) and one of its Volcano GitHub App installations; it has no connect flow of its own under + `/user/imports`. source_id (str): destination_project_name (str): resource (ResourceReference): Stable reference to a Volcano resource. @@ -41,7 +44,10 @@ class ProjectImportRun: status (ProjectImportRunStatus): created_at (datetime.datetime): updated_at (datetime.datetime): - error_code (str | Unset): + error_code (str | Unset): Set when `status` is `failed`: `import.deployment_skipped` when the import's + deployment was skipped, otherwise the error code of the Git deployment run the import started (see + `GitDeploymentRunError.code`), such as `source_invalid`, `deploy_refused`, `child_deploy_failed`, + `child_deploy_not_started`, or `deploy_failed`. Treat a code you do not know as a failure. error_message (str | Unset): """ diff --git a/src/volcano_sdk/_generated/models/project_import_scanned_frontend.py b/src/volcano_sdk/_generated/models/project_import_scanned_frontend.py new file mode 100644 index 00000000..d849becf --- /dev/null +++ b/src/volcano_sdk/_generated/models/project_import_scanned_frontend.py @@ -0,0 +1,108 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="ProjectImportScannedFrontend") + + + +@_attrs_define +class ProjectImportScannedFrontend: + """ + Attributes: + name (str): + workspace (str): The frontend's workspace relative to the root directory; empty for the root directory itself. + app_root (str): The app relative to its workspace; empty for the workspace itself. + framework (str): `nextjs`, another framework its package names (such as `vite` or `astro`), or `unknown`. + supported (bool): + """ + + name: str + workspace: str + app_root: str + framework: str + supported: bool + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + name = self.name + + workspace = self.workspace + + app_root = self.app_root + + framework = self.framework + + supported = self.supported + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "name": name, + "workspace": workspace, + "app_root": app_root, + "framework": framework, + "supported": supported, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + name = d.pop("name") + + workspace = d.pop("workspace") + + app_root = d.pop("app_root") + + framework = d.pop("framework") + + supported = d.pop("supported") + + project_import_scanned_frontend = cls( + name=name, + workspace=workspace, + app_root=app_root, + framework=framework, + supported=supported, + ) + + + project_import_scanned_frontend.additional_properties = d + return project_import_scanned_frontend + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/project_import_scanned_function.py b/src/volcano_sdk/_generated/models/project_import_scanned_function.py new file mode 100644 index 00000000..31073c8a --- /dev/null +++ b/src/volcano_sdk/_generated/models/project_import_scanned_function.py @@ -0,0 +1,98 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.project_import_scanned_function_kind import check_project_import_scanned_function_kind +from ..models.project_import_scanned_function_kind import ProjectImportScannedFunctionKind +from typing import cast + + + + + + +T = TypeVar("T", bound="ProjectImportScannedFunction") + + + +@_attrs_define +class ProjectImportScannedFunction: + """ + Attributes: + name (str): + runtime (str): + kind (ProjectImportScannedFunctionKind): + """ + + name: str + runtime: str + kind: ProjectImportScannedFunctionKind + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + name = self.name + + runtime = self.runtime + + kind: str = self.kind + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "name": name, + "runtime": runtime, + "kind": kind, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + name = d.pop("name") + + runtime = d.pop("runtime") + + kind = check_project_import_scanned_function_kind(d.pop("kind")) + + + + + project_import_scanned_function = cls( + name=name, + runtime=runtime, + kind=kind, + ) + + + project_import_scanned_function.additional_properties = d + return project_import_scanned_function + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/project_import_scanned_function_kind.py b/src/volcano_sdk/_generated/models/project_import_scanned_function_kind.py new file mode 100644 index 00000000..a022ba59 --- /dev/null +++ b/src/volcano_sdk/_generated/models/project_import_scanned_function_kind.py @@ -0,0 +1,10 @@ +from typing import Literal + +ProjectImportScannedFunctionKind = Literal['durable', 'standard'] + +PROJECT_IMPORT_SCANNED_FUNCTION_KIND_VALUES: set[ProjectImportScannedFunctionKind] = { 'durable', 'standard', } + +def check_project_import_scanned_function_kind(value: str) -> ProjectImportScannedFunctionKind: + if value in PROJECT_IMPORT_SCANNED_FUNCTION_KIND_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {PROJECT_IMPORT_SCANNED_FUNCTION_KIND_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/project_import_scanned_migrations.py b/src/volcano_sdk/_generated/models/project_import_scanned_migrations.py new file mode 100644 index 00000000..d47dedbb --- /dev/null +++ b/src/volcano_sdk/_generated/models/project_import_scanned_migrations.py @@ -0,0 +1,89 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast + + + + + + +T = TypeVar("T", bound="ProjectImportScannedMigrations") + + + +@_attrs_define +class ProjectImportScannedMigrations: + """ + Attributes: + database (str): The database directory under `volcano/migrations`, or empty for files at its top level, which + belong to a project's only database. + files (list[str]): + """ + + database: str + files: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + database = self.database + + files = self.files + + + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "database": database, + "files": files, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + database = d.pop("database") + + files = cast(list[str], d.pop("files")) + + + project_import_scanned_migrations = cls( + database=database, + files=files, + ) + + + project_import_scanned_migrations.additional_properties = d + return project_import_scanned_migrations + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/project_import_source_scan.py b/src/volcano_sdk/_generated/models/project_import_source_scan.py new file mode 100644 index 00000000..bcbce7d6 --- /dev/null +++ b/src/volcano_sdk/_generated/models/project_import_source_scan.py @@ -0,0 +1,276 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast + +if TYPE_CHECKING: + from ..models.project_import_root_candidate import ProjectImportRootCandidate + from ..models.project_import_scanned_frontend import ProjectImportScannedFrontend + from ..models.project_import_scanned_function import ProjectImportScannedFunction + from ..models.project_import_scanned_migrations import ProjectImportScannedMigrations + from ..models.project_import_unsupported_item import ProjectImportUnsupportedItem + + + + + +T = TypeVar("T", bound="ProjectImportSourceScan") + + + +@_attrs_define +class ProjectImportSourceScan: + """ `github` only. What the selected commit holds and what the import deploys from it, found by preparing the commit the + way a deployment does. + + Attributes: + repository_id (int): + repository_full_name (str): + installation_id (int): + branch (str): + commit_sha (str): The branch head the report describes. A push after preflight makes a start with this report's + fingerprint stale. + root_directory (str): + app_root (str): The app root the scan used, relative to `root_directory`; empty for the root directory itself. + functions (list[ProjectImportScannedFunction]): Functions under `volcano/functions`. Functions are never + inferred from other layouts. + frontends (list[ProjectImportScannedFrontend]): The app at the root directory, or each frontend + `.volcano/source-layout.json` names. Only `supported` frontends deploy. + migrations (list[ProjectImportScannedMigrations]): + sandboxes (list[str]): + unsupported (list[ProjectImportUnsupportedItem]): What the import leaves out, each with the reason. + deployable (bool): True when the commit holds at least one function or one supported frontend. A start is + refused when it is false. + candidates (list[ProjectImportRootCandidate]): Other settings for this commit that hold something a deployment + would deploy, found below `root_directory`, sorted by path. The search looks two directory levels deep, and + further for members of a workspace the root directory declares. It skips `node_modules`, build output, and + directories whose names start with `.` or `_`. A source with `.volcano/source-layout.json` has none. A candidate + is not checked as fully as the report: run preflight again with its `root_directory` and `app_root` to see what + it deploys. + """ + + repository_id: int + repository_full_name: str + installation_id: int + branch: str + commit_sha: str + root_directory: str + app_root: str + functions: list[ProjectImportScannedFunction] + frontends: list[ProjectImportScannedFrontend] + migrations: list[ProjectImportScannedMigrations] + sandboxes: list[str] + unsupported: list[ProjectImportUnsupportedItem] + deployable: bool + candidates: list[ProjectImportRootCandidate] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.project_import_root_candidate import ProjectImportRootCandidate # noqa: PLC0415 + from ..models.project_import_scanned_frontend import ProjectImportScannedFrontend # noqa: PLC0415 + from ..models.project_import_scanned_function import ProjectImportScannedFunction # noqa: PLC0415 + from ..models.project_import_scanned_migrations import ProjectImportScannedMigrations # noqa: PLC0415 + from ..models.project_import_unsupported_item import ProjectImportUnsupportedItem # noqa: PLC0415 + repository_id = self.repository_id + + repository_full_name = self.repository_full_name + + installation_id = self.installation_id + + branch = self.branch + + commit_sha = self.commit_sha + + root_directory = self.root_directory + + app_root = self.app_root + + functions = [] + for functions_item_data in self.functions: + functions_item = functions_item_data.to_dict() + functions.append(functions_item) + + + + frontends = [] + for frontends_item_data in self.frontends: + frontends_item = frontends_item_data.to_dict() + frontends.append(frontends_item) + + + + migrations = [] + for migrations_item_data in self.migrations: + migrations_item = migrations_item_data.to_dict() + migrations.append(migrations_item) + + + + sandboxes = self.sandboxes + + + + unsupported = [] + for unsupported_item_data in self.unsupported: + unsupported_item = unsupported_item_data.to_dict() + unsupported.append(unsupported_item) + + + + deployable = self.deployable + + candidates = [] + for candidates_item_data in self.candidates: + candidates_item = candidates_item_data.to_dict() + candidates.append(candidates_item) + + + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "repository_id": repository_id, + "repository_full_name": repository_full_name, + "installation_id": installation_id, + "branch": branch, + "commit_sha": commit_sha, + "root_directory": root_directory, + "app_root": app_root, + "functions": functions, + "frontends": frontends, + "migrations": migrations, + "sandboxes": sandboxes, + "unsupported": unsupported, + "deployable": deployable, + "candidates": candidates, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.project_import_root_candidate import ProjectImportRootCandidate # noqa: PLC0415 + from ..models.project_import_scanned_frontend import ProjectImportScannedFrontend # noqa: PLC0415 + from ..models.project_import_scanned_function import ProjectImportScannedFunction # noqa: PLC0415 + from ..models.project_import_scanned_migrations import ProjectImportScannedMigrations # noqa: PLC0415 + from ..models.project_import_unsupported_item import ProjectImportUnsupportedItem # noqa: PLC0415 + d = dict(src_dict) + repository_id = d.pop("repository_id") + + repository_full_name = d.pop("repository_full_name") + + installation_id = d.pop("installation_id") + + branch = d.pop("branch") + + commit_sha = d.pop("commit_sha") + + root_directory = d.pop("root_directory") + + app_root = d.pop("app_root") + + functions = [] + _functions = d.pop("functions") + for functions_item_data in (_functions): + functions_item = ProjectImportScannedFunction.from_dict(functions_item_data) + + + + functions.append(functions_item) + + + frontends = [] + _frontends = d.pop("frontends") + for frontends_item_data in (_frontends): + frontends_item = ProjectImportScannedFrontend.from_dict(frontends_item_data) + + + + frontends.append(frontends_item) + + + migrations = [] + _migrations = d.pop("migrations") + for migrations_item_data in (_migrations): + migrations_item = ProjectImportScannedMigrations.from_dict(migrations_item_data) + + + + migrations.append(migrations_item) + + + sandboxes = cast(list[str], d.pop("sandboxes")) + + + unsupported = [] + _unsupported = d.pop("unsupported") + for unsupported_item_data in (_unsupported): + unsupported_item = ProjectImportUnsupportedItem.from_dict(unsupported_item_data) + + + + unsupported.append(unsupported_item) + + + deployable = d.pop("deployable") + + candidates = [] + _candidates = d.pop("candidates") + for candidates_item_data in (_candidates): + candidates_item = ProjectImportRootCandidate.from_dict(candidates_item_data) + + + + candidates.append(candidates_item) + + + project_import_source_scan = cls( + repository_id=repository_id, + repository_full_name=repository_full_name, + installation_id=installation_id, + branch=branch, + commit_sha=commit_sha, + root_directory=root_directory, + app_root=app_root, + functions=functions, + frontends=frontends, + migrations=migrations, + sandboxes=sandboxes, + unsupported=unsupported, + deployable=deployable, + candidates=candidates, + ) + + + project_import_source_scan.additional_properties = d + return project_import_source_scan + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/project_import_start_request.py b/src/volcano_sdk/_generated/models/project_import_start_request.py index 547b44f4..c8c93255 100644 --- a/src/volcano_sdk/_generated/models/project_import_start_request.py +++ b/src/volcano_sdk/_generated/models/project_import_start_request.py @@ -10,9 +10,12 @@ from ..models.project_import_target import check_project_import_target from ..models.project_import_target import ProjectImportTarget +from ..types import UNSET, Unset from typing import cast from uuid import UUID +if TYPE_CHECKING: + from ..models.project_import_variable import ProjectImportVariable @@ -30,16 +33,41 @@ class ProjectImportStartRequest: source_id (str): project_name (str): target (ProjectImportTarget): - confirm_environment_variable_read (bool): preflight_fingerprint (str): + confirm_environment_variable_read (bool | Unset): Required by `vercel`, which reads production variable values. + `github` reads none and does not need it. + branch (str | Unset): `github` only. The branch to deploy, which becomes the project's production branch. Omit + it to use the repository's default branch. + root_directory (str | Unset): `github` only. The repository directory, relative to its root, that holds the + project, as in a monorepo. Omit it or send an empty string for the repository root. It becomes the project's + root directory. A deployment receives only this directory. + app_root (str | Unset): `github` only. The directory of the Next.js app, relative to `root_directory`, when the + root directory holds a workspace that installs the app, as in a pnpm, npm or Yarn monorepo. Omit it or send an + empty string for the app at the root directory. It becomes the project's frontend app root. A repository whose + `.volcano/source-layout.json` names its frontends takes none, and sending one is refused with + `import_source_invalid`. + deploy_migrations (bool | Unset): `github` only. Turns on applying `volcano/migrations` for later pushes. The + first deployment never applies migrations, because a new project has no database yet; preflight reports the + files it found. Turning it on while database migrations are unavailable is refused with `feature_unavailable`. + Default: False. + variables (list[ProjectImportVariable] | Unset): `github` only. Project variables to store before the first + deployment. Nothing is read from the repository's env files. A name must start with a letter or underscore and + hold only letters, digits and underscores, must not be reserved, and must not repeat another entry's; otherwise + the start is refused with 400 `import_variable_name_invalid`. The whole request body is limited to 1 MiB; a + larger one is refused with 413. """ connection_id: UUID source_id: str project_name: str target: ProjectImportTarget - confirm_environment_variable_read: bool preflight_fingerprint: str + confirm_environment_variable_read: bool | Unset = UNSET + branch: str | Unset = UNSET + root_directory: str | Unset = UNSET + app_root: str | Unset = UNSET + deploy_migrations: bool | Unset = False + variables: list[ProjectImportVariable] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -47,6 +75,7 @@ class ProjectImportStartRequest: def to_dict(self) -> dict[str, Any]: + from ..models.project_import_variable import ProjectImportVariable # noqa: PLC0415 connection_id = str(self.connection_id) source_id = self.source_id @@ -55,9 +84,26 @@ def to_dict(self) -> dict[str, Any]: target: str = self.target + preflight_fingerprint = self.preflight_fingerprint + confirm_environment_variable_read = self.confirm_environment_variable_read - preflight_fingerprint = self.preflight_fingerprint + branch = self.branch + + root_directory = self.root_directory + + app_root = self.app_root + + deploy_migrations = self.deploy_migrations + + variables: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.variables, Unset): + variables = [] + for variables_item_data in self.variables: + variables_item = variables_item_data.to_dict() + variables.append(variables_item) + + field_dict: dict[str, Any] = {} @@ -67,9 +113,20 @@ def to_dict(self) -> dict[str, Any]: "source_id": source_id, "project_name": project_name, "target": target, - "confirm_environment_variable_read": confirm_environment_variable_read, "preflight_fingerprint": preflight_fingerprint, }) + if confirm_environment_variable_read is not UNSET: + field_dict["confirm_environment_variable_read"] = confirm_environment_variable_read + if branch is not UNSET: + field_dict["branch"] = branch + if root_directory is not UNSET: + field_dict["root_directory"] = root_directory + if app_root is not UNSET: + field_dict["app_root"] = app_root + if deploy_migrations is not UNSET: + field_dict["deploy_migrations"] = deploy_migrations + if variables is not UNSET: + field_dict["variables"] = variables return field_dict @@ -77,6 +134,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.project_import_variable import ProjectImportVariable # noqa: PLC0415 d = dict(src_dict) connection_id = UUID(d.pop("connection_id")) @@ -92,17 +150,42 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - confirm_environment_variable_read = d.pop("confirm_environment_variable_read") - preflight_fingerprint = d.pop("preflight_fingerprint") + confirm_environment_variable_read = d.pop("confirm_environment_variable_read", UNSET) + + branch = d.pop("branch", UNSET) + + root_directory = d.pop("root_directory", UNSET) + + app_root = d.pop("app_root", UNSET) + + deploy_migrations = d.pop("deploy_migrations", UNSET) + + _variables = d.pop("variables", UNSET) + variables: list[ProjectImportVariable] | Unset = UNSET + if _variables is not UNSET: + variables = [] + for variables_item_data in _variables: + variables_item = ProjectImportVariable.from_dict(variables_item_data) + + + + variables.append(variables_item) + + project_import_start_request = cls( connection_id=connection_id, source_id=source_id, project_name=project_name, target=target, - confirm_environment_variable_read=confirm_environment_variable_read, preflight_fingerprint=preflight_fingerprint, + confirm_environment_variable_read=confirm_environment_variable_read, + branch=branch, + root_directory=root_directory, + app_root=app_root, + deploy_migrations=deploy_migrations, + variables=variables, ) diff --git a/src/volcano_sdk/_generated/models/project_import_unsupported_item.py b/src/volcano_sdk/_generated/models/project_import_unsupported_item.py new file mode 100644 index 00000000..1a209e67 --- /dev/null +++ b/src/volcano_sdk/_generated/models/project_import_unsupported_item.py @@ -0,0 +1,106 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.project_import_resource_kind import check_project_import_resource_kind +from ..models.project_import_resource_kind import ProjectImportResourceKind +from typing import cast + + + + + + +T = TypeVar("T", bound="ProjectImportUnsupportedItem") + + + +@_attrs_define +class ProjectImportUnsupportedItem: + """ + Attributes: + kind (ProjectImportResourceKind): + name (str): + path (str): Repository-relative path of the item. + reason (str): + """ + + kind: ProjectImportResourceKind + name: str + path: str + reason: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + kind: str = self.kind + + name = self.name + + path = self.path + + reason = self.reason + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "kind": kind, + "name": name, + "path": path, + "reason": reason, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + kind = check_project_import_resource_kind(d.pop("kind")) + + + + + name = d.pop("name") + + path = d.pop("path") + + reason = d.pop("reason") + + project_import_unsupported_item = cls( + kind=kind, + name=name, + path=path, + reason=reason, + ) + + + project_import_unsupported_item.additional_properties = d + return project_import_unsupported_item + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/project_import_variable.py b/src/volcano_sdk/_generated/models/project_import_variable.py new file mode 100644 index 00000000..01cc45e5 --- /dev/null +++ b/src/volcano_sdk/_generated/models/project_import_variable.py @@ -0,0 +1,84 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="ProjectImportVariable") + + + +@_attrs_define +class ProjectImportVariable: + """ + Attributes: + name (str): + value (str): + """ + + name: str + value: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + name = self.name + + value = self.value + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "name": name, + "value": value, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + name = d.pop("name") + + value = d.pop("value") + + project_import_variable = cls( + name=name, + value=value, + ) + + + project_import_variable.additional_properties = d + return project_import_variable + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/project_template_installation.py b/src/volcano_sdk/_generated/models/project_template_installation.py index 211f658e..97dd13ca 100644 --- a/src/volcano_sdk/_generated/models/project_template_installation.py +++ b/src/volcano_sdk/_generated/models/project_template_installation.py @@ -12,8 +12,11 @@ from ..models.project_template_installation_phase import ProjectTemplateInstallationPhase from ..models.project_template_installation_status import check_project_template_installation_status from ..models.project_template_installation_status import ProjectTemplateInstallationStatus +from ..types import UNSET, Unset from typing import cast +if TYPE_CHECKING: + from ..models.project_template_installation_source import ProjectTemplateInstallationSource @@ -33,10 +36,34 @@ class ProjectTemplateInstallation: Attributes: status (ProjectTemplateInstallationStatus): phase (ProjectTemplateInstallationPhase): + source (ProjectTemplateInstallationSource | Unset): The share release a fork was installed from. + failure_code (str | Unset): Why the installation failed. Present only when `status` is `failed`, and + absent for installations that failed before Volcano recorded a reason. + New codes can be added, so treat an unknown one as a generic failure. + `source_withdrawn`: the deploy link was switched off or deleted, or its + project is being deleted. `source_invalid`: the source failed Volcano's checks, + such as a release archive whose digest, size or contents are wrong. + `source_access_lost`: Volcano can no longer read the source repository. + `invalid_source_configuration`: the source's `volcano-config.yaml` is + invalid, or it declares a variable the new project does not have. + `nothing_to_deploy`: the source has no function or frontend. + `database_not_supported`: the source ships database SQL. + `function_deploy_refused`: a function in the source cannot be deployed + as defined. `function_quota_exceeded`, + `durable_function_quota_exceeded`, `frontend_quota_exceeded`, + `frontend_deploy_limit` and `build_minutes_exceeded`: the project + reached a plan limit. `build_failed`: a function or frontend from the + source failed to build or deploy; its deployment's build logs say why. + `retry_budget_exhausted`: the installation kept failing and Volcano + stopped retrying. `internal_error`: Volcano failed for a reason of its + own. + Example: source_withdrawn. """ status: ProjectTemplateInstallationStatus phase: ProjectTemplateInstallationPhase + source: ProjectTemplateInstallationSource | Unset = UNSET + failure_code: str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -44,10 +71,17 @@ class ProjectTemplateInstallation: def to_dict(self) -> dict[str, Any]: + from ..models.project_template_installation_source import ProjectTemplateInstallationSource # noqa: PLC0415 status: str = self.status phase: str = self.phase + source: dict[str, Any] | Unset = UNSET + if not isinstance(self.source, Unset): + source = self.source.to_dict() + + failure_code = self.failure_code + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -55,6 +89,10 @@ def to_dict(self) -> dict[str, Any]: "status": status, "phase": phase, }) + if source is not UNSET: + field_dict["source"] = source + if failure_code is not UNSET: + field_dict["failure_code"] = failure_code return field_dict @@ -62,6 +100,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.project_template_installation_source import ProjectTemplateInstallationSource # noqa: PLC0415 d = dict(src_dict) status = check_project_template_installation_status(d.pop("status")) @@ -73,9 +112,23 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + _source = d.pop("source", UNSET) + source: ProjectTemplateInstallationSource | Unset + if isinstance(_source, Unset): + source = UNSET + else: + source = ProjectTemplateInstallationSource.from_dict(_source) + + + + + failure_code = d.pop("failure_code", UNSET) + project_template_installation = cls( status=status, phase=phase, + source=source, + failure_code=failure_code, ) diff --git a/src/volcano_sdk/_generated/models/project_template_installation_source.py b/src/volcano_sdk/_generated/models/project_template_installation_source.py new file mode 100644 index 00000000..c4fb8e2e --- /dev/null +++ b/src/volcano_sdk/_generated/models/project_template_installation_source.py @@ -0,0 +1,103 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.project_template_installation_source_kind import check_project_template_installation_source_kind +from ..models.project_template_installation_source_kind import ProjectTemplateInstallationSourceKind +from typing import cast +from uuid import UUID + + + + + + +T = TypeVar("T", bound="ProjectTemplateInstallationSource") + + + +@_attrs_define +class ProjectTemplateInstallationSource: + """ The share release a fork was installed from. + + Attributes: + kind (ProjectTemplateInstallationSourceKind): + share_id (str): The share the release belongs to. + release_id (UUID): The release the project was installed from. + """ + + kind: ProjectTemplateInstallationSourceKind + share_id: str + release_id: UUID + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + kind: str = self.kind + + share_id = self.share_id + + release_id = str(self.release_id) + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "kind": kind, + "share_id": share_id, + "release_id": release_id, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + kind = check_project_template_installation_source_kind(d.pop("kind")) + + + + + share_id = d.pop("share_id") + + release_id = UUID(d.pop("release_id")) + + + + + project_template_installation_source = cls( + kind=kind, + share_id=share_id, + release_id=release_id, + ) + + + project_template_installation_source.additional_properties = d + return project_template_installation_source + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/project_template_installation_source_kind.py b/src/volcano_sdk/_generated/models/project_template_installation_source_kind.py new file mode 100644 index 00000000..ee1ce2e7 --- /dev/null +++ b/src/volcano_sdk/_generated/models/project_template_installation_source_kind.py @@ -0,0 +1,10 @@ +from typing import Literal + +ProjectTemplateInstallationSourceKind = Literal['share_release'] + +PROJECT_TEMPLATE_INSTALLATION_SOURCE_KIND_VALUES: set[ProjectTemplateInstallationSourceKind] = { 'share_release', } + +def check_project_template_installation_source_kind(value: str) -> ProjectTemplateInstallationSourceKind: + if value in PROJECT_TEMPLATE_INSTALLATION_SOURCE_KIND_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {PROJECT_TEMPLATE_INSTALLATION_SOURCE_KIND_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/promote_frontend_candidate_body.py b/src/volcano_sdk/_generated/models/promote_frontend_candidate_body.py new file mode 100644 index 00000000..327d4d30 --- /dev/null +++ b/src/volcano_sdk/_generated/models/promote_frontend_candidate_body.py @@ -0,0 +1,58 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="PromoteFrontendCandidateBody") + + + +@_attrs_define +class PromoteFrontendCandidateBody: + """ + Attributes: + expected_revision (int): + """ + + expected_revision: int + + + + + + def to_dict(self) -> dict[str, Any]: + expected_revision = self.expected_revision + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "expected_revision": expected_revision, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + expected_revision = d.pop("expected_revision") + + promote_frontend_candidate_body = cls( + expected_revision=expected_revision, + ) + + return promote_frontend_candidate_body + diff --git a/src/volcano_sdk/_generated/models/realtime_publish_request.py b/src/volcano_sdk/_generated/models/realtime_publish_request.py new file mode 100644 index 00000000..4e2ccb53 --- /dev/null +++ b/src/volcano_sdk/_generated/models/realtime_publish_request.py @@ -0,0 +1,74 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="RealtimePublishRequest") + + + +@_attrs_define +class RealtimePublishRequest: + """ + Attributes: + channel (str): The client channel, `broadcast:` or `grant:`, with a name of at most 64 characters. + event (str): The message type subscribers match on. + payload (Any): Any JSON value, sent to subscribers as `payload`. + """ + + channel: str + event: str + payload: Any + + + + + + def to_dict(self) -> dict[str, Any]: + channel = self.channel + + event = self.event + + payload = self.payload + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "channel": channel, + "event": event, + "payload": payload, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + channel = d.pop("channel") + + event = d.pop("event") + + payload = d.pop("payload") + + realtime_publish_request = cls( + channel=channel, + event=event, + payload=payload, + ) + + return realtime_publish_request + diff --git a/src/volcano_sdk/_generated/models/realtime_publish_result.py b/src/volcano_sdk/_generated/models/realtime_publish_result.py new file mode 100644 index 00000000..5e5cc6ef --- /dev/null +++ b/src/volcano_sdk/_generated/models/realtime_publish_result.py @@ -0,0 +1,58 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="RealtimePublishResult") + + + +@_attrs_define +class RealtimePublishResult: + """ + Attributes: + channel (str): The channel the message was sent to. + """ + + channel: str + + + + + + def to_dict(self) -> dict[str, Any]: + channel = self.channel + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "channel": channel, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + channel = d.pop("channel") + + realtime_publish_result = cls( + channel=channel, + ) + + return realtime_publish_result + diff --git a/src/volcano_sdk/_generated/models/redeploy_frontend_candidate_body.py b/src/volcano_sdk/_generated/models/redeploy_frontend_candidate_body.py new file mode 100644 index 00000000..45b615a7 --- /dev/null +++ b/src/volcano_sdk/_generated/models/redeploy_frontend_candidate_body.py @@ -0,0 +1,101 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +import json +from .. import types + +from ..types import UNSET, Unset + +from ..types import File, FileTypes +from io import BytesIO + + + + + + +T = TypeVar("T", bound="RedeployFrontendCandidateBody") + + + +@_attrs_define +class RedeployFrontendCandidateBody: + """ + Attributes: + archive (File): ZIP or tar.gz archive of the frontend project, as for creating a frontend. + """ + + archive: File + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + archive = self.archive.to_tuple() + + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "archive": archive, + }) + + return field_dict + + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("archive", self.archive.to_tuple())) + + + + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + + + return files + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + archive = File( + payload = BytesIO(d.pop("archive")) + ) + + + + + redeploy_frontend_candidate_body = cls( + archive=archive, + ) + + + redeploy_frontend_candidate_body.additional_properties = d + return redeploy_frontend_candidate_body + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/redeploy_function_candidate_body.py b/src/volcano_sdk/_generated/models/redeploy_function_candidate_body.py new file mode 100644 index 00000000..86e76d1a --- /dev/null +++ b/src/volcano_sdk/_generated/models/redeploy_function_candidate_body.py @@ -0,0 +1,102 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +import json +from .. import types + +from ..types import UNSET, Unset + +from ..types import File, FileTypes +from io import BytesIO + + + + + + +T = TypeVar("T", bound="RedeployFunctionCandidateBody") + + + +@_attrs_define +class RedeployFunctionCandidateBody: + """ + Attributes: + code (File): The function's source archive, as for deploying the function. Built with the function's runtime and + handler. + """ + + code: File + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + code = self.code.to_tuple() + + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "code": code, + }) + + return field_dict + + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("code", self.code.to_tuple())) + + + + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + + + return files + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + code = File( + payload = BytesIO(d.pop("code")) + ) + + + + + redeploy_function_candidate_body = cls( + code=code, + ) + + + redeploy_function_candidate_body.additional_properties = d + return redeploy_function_candidate_body + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/resolve_function_response.py b/src/volcano_sdk/_generated/models/resolve_function_response.py index e8596032..dbf47b51 100644 --- a/src/volcano_sdk/_generated/models/resolve_function_response.py +++ b/src/volcano_sdk/_generated/models/resolve_function_response.py @@ -28,9 +28,9 @@ class ResolveFunctionResponse: function_id (UUID): Canonical function ID used for invocation routing cache_ttl_seconds (int): Suggested SDK cache TTL for this name-to-ID mapping invoke_url (str | Unset): 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. + domain with the API, so a host derived from the API URL will not reach the function. Omitted in local + development and when the deployment serves no public invocation domain; invoke through POST + /functions/{functionId}/invoke instead. """ name: str diff --git a/src/volcano_sdk/_generated/models/rollback_frontend_serving_body.py b/src/volcano_sdk/_generated/models/rollback_frontend_serving_body.py new file mode 100644 index 00000000..87a123f0 --- /dev/null +++ b/src/volcano_sdk/_generated/models/rollback_frontend_serving_body.py @@ -0,0 +1,68 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset + + + + + + +T = TypeVar("T", bound="RollbackFrontendServingBody") + + + +@_attrs_define +class RollbackFrontendServingBody: + """ + Attributes: + expected_revision (int): + to_production (bool | Unset): Return to the frontend's own runtime whatever it served before. Default: False. + """ + + expected_revision: int + to_production: bool | Unset = False + + + + + + def to_dict(self) -> dict[str, Any]: + expected_revision = self.expected_revision + + to_production = self.to_production + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "expected_revision": expected_revision, + }) + if to_production is not UNSET: + field_dict["to_production"] = to_production + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + expected_revision = d.pop("expected_revision") + + to_production = d.pop("to_production", UNSET) + + rollback_frontend_serving_body = cls( + expected_revision=expected_revision, + to_production=to_production, + ) + + return rollback_frontend_serving_body + diff --git a/src/volcano_sdk/_generated/models/sandbox_command_request.py b/src/volcano_sdk/_generated/models/sandbox_command_request.py index 7c8e31dc..4c4ece6a 100644 --- a/src/volcano_sdk/_generated/models/sandbox_command_request.py +++ b/src/volcano_sdk/_generated/models/sandbox_command_request.py @@ -32,11 +32,19 @@ class SandboxCommandRequest: precedence. Cloud synchronous requests must return within the public connection idle limit (1000 seconds); use a session with a background process and short polling requests for longer work. environment (SandboxCommandRequestEnvironment | Unset): + keep_output (bool | Unset): Set false to keep no output. stdout and stderr are returned once in this response, + and Volcano's control plane never stores them in the execution journal, database, logs or traces. This does not + cover the Sandbox's memory or a suspended session's snapshot. A retry with the same Idempotency-Key returns the + exit code with `output_kept` false and empty streams, without running the command again. Omit it to use the + session's `executions.keep_output`. True in a session that keeps no output is refused with 400 and code + `sandbox_session_keeps_no_output`. False is refused with 400 and code `feature_unavailable` while the + `sandboxes.output_not_kept` capability is unavailable. """ command: str timeout_seconds: int | Unset = UNSET environment: SandboxCommandRequestEnvironment | Unset = UNSET + keep_output: bool | Unset = UNSET @@ -52,6 +60,8 @@ def to_dict(self) -> dict[str, Any]: if not isinstance(self.environment, Unset): environment = self.environment.to_dict() + keep_output = self.keep_output + field_dict: dict[str, Any] = {} @@ -62,6 +72,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["timeout_seconds"] = timeout_seconds if environment is not UNSET: field_dict["environment"] = environment + if keep_output is not UNSET: + field_dict["keep_output"] = keep_output return field_dict @@ -85,10 +97,13 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + keep_output = d.pop("keep_output", UNSET) + sandbox_command_request = cls( command=command, timeout_seconds=timeout_seconds, environment=environment, + keep_output=keep_output, ) return sandbox_command_request diff --git a/src/volcano_sdk/_generated/models/sandbox_command_result.py b/src/volcano_sdk/_generated/models/sandbox_command_result.py index 60d05f3e..18c28226 100644 --- a/src/volcano_sdk/_generated/models/sandbox_command_result.py +++ b/src/volcano_sdk/_generated/models/sandbox_command_result.py @@ -22,12 +22,20 @@ class SandboxCommandResult: """ Attributes: - stdout (str): - stderr (str): + stdout (str): The first 1 MiB (1,048,576 bytes) the command wrote to stdout. Empty in a replay of a command that + kept no output. + stderr (str): The first 1 MiB (1,048,576 bytes) the command wrote to stderr. Empty in a replay of a command that + kept no output. exit_code (int): - stdout_truncated (bool): - stderr_truncated (bool): + stdout_truncated (bool): True when the command wrote more than 1 MiB to stdout. False in a replay of a command + that kept no output. + stderr_truncated (bool): True when the command wrote more than 1 MiB to stderr. False in a replay of a command + that kept no output. timed_out (bool): + output_kept (bool): False when the command kept no output. Its streams appear only in the response to the + request that ran it, and Volcano's control plane never stores them in the execution journal, database, logs or + traces. This does not cover the Sandbox's memory or a suspended session's snapshot. A retry with the same + Idempotency-Key returns them empty. """ stdout: str @@ -36,6 +44,7 @@ class SandboxCommandResult: stdout_truncated: bool stderr_truncated: bool timed_out: bool + output_kept: bool @@ -54,6 +63,8 @@ def to_dict(self) -> dict[str, Any]: timed_out = self.timed_out + output_kept = self.output_kept + field_dict: dict[str, Any] = {} @@ -64,6 +75,7 @@ def to_dict(self) -> dict[str, Any]: "stdout_truncated": stdout_truncated, "stderr_truncated": stderr_truncated, "timed_out": timed_out, + "output_kept": output_kept, }) return field_dict @@ -85,6 +97,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: timed_out = d.pop("timed_out") + output_kept = d.pop("output_kept") + sandbox_command_result = cls( stdout=stdout, stderr=stderr, @@ -92,6 +106,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: stdout_truncated=stdout_truncated, stderr_truncated=stderr_truncated, timed_out=timed_out, + output_kept=output_kept, ) return sandbox_command_result diff --git a/src/volcano_sdk/_generated/models/sandbox_execution_result.py b/src/volcano_sdk/_generated/models/sandbox_execution_result.py index ce8174c2..4b234340 100644 --- a/src/volcano_sdk/_generated/models/sandbox_execution_result.py +++ b/src/volcano_sdk/_generated/models/sandbox_execution_result.py @@ -23,12 +23,20 @@ class SandboxExecutionResult: """ Attributes: - stdout (str): - stderr (str): + stdout (str): The first 1 MiB (1,048,576 bytes) the command wrote to stdout. Empty in a replay of a command that + kept no output. + stderr (str): The first 1 MiB (1,048,576 bytes) the command wrote to stderr. Empty in a replay of a command that + kept no output. exit_code (int): - stdout_truncated (bool): - stderr_truncated (bool): + stdout_truncated (bool): True when the command wrote more than 1 MiB to stdout. False in a replay of a command + that kept no output. + stderr_truncated (bool): True when the command wrote more than 1 MiB to stderr. False in a replay of a command + that kept no output. timed_out (bool): + output_kept (bool): False when the command kept no output. Its streams appear only in the response to the + request that ran it, and Volcano's control plane never stores them in the execution journal, database, logs or + traces. This does not cover the Sandbox's memory or a suspended session's snapshot. A retry with the same + Idempotency-Key returns them empty. session_id (UUID): region (str): duration_ms (int): @@ -40,6 +48,7 @@ class SandboxExecutionResult: stdout_truncated: bool stderr_truncated: bool timed_out: bool + output_kept: bool session_id: UUID region: str duration_ms: int @@ -61,6 +70,8 @@ def to_dict(self) -> dict[str, Any]: timed_out = self.timed_out + output_kept = self.output_kept + session_id = str(self.session_id) region = self.region @@ -77,6 +88,7 @@ def to_dict(self) -> dict[str, Any]: "stdout_truncated": stdout_truncated, "stderr_truncated": stderr_truncated, "timed_out": timed_out, + "output_kept": output_kept, "session_id": session_id, "region": region, "duration_ms": duration_ms, @@ -101,6 +113,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: timed_out = d.pop("timed_out") + output_kept = d.pop("output_kept") + session_id = UUID(d.pop("session_id")) @@ -117,6 +131,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: stdout_truncated=stdout_truncated, stderr_truncated=stderr_truncated, timed_out=timed_out, + output_kept=output_kept, session_id=session_id, region=region, duration_ms=duration_ms, diff --git a/src/volcano_sdk/_generated/models/sandbox_file_archive.py b/src/volcano_sdk/_generated/models/sandbox_file_archive.py new file mode 100644 index 00000000..a505fb47 --- /dev/null +++ b/src/volcano_sdk/_generated/models/sandbox_file_archive.py @@ -0,0 +1,96 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from uuid import UUID + + + + + + +T = TypeVar("T", bound="SandboxFileArchive") + + + +@_attrs_define +class SandboxFileArchive: + """ + Attributes: + project_id (UUID): + session_id (UUID): + path (str): + files (int): Regular files written. + bytes_ (int): Bytes of file content written. + """ + + project_id: UUID + session_id: UUID + path: str + files: int + bytes_: int + + + + + + def to_dict(self) -> dict[str, Any]: + project_id = str(self.project_id) + + session_id = str(self.session_id) + + path = self.path + + files = self.files + + bytes_ = self.bytes_ + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "project_id": project_id, + "session_id": session_id, + "path": path, + "files": files, + "bytes": bytes_, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + project_id = UUID(d.pop("project_id")) + + + + + session_id = UUID(d.pop("session_id")) + + + + + path = d.pop("path") + + files = d.pop("files") + + bytes_ = d.pop("bytes") + + sandbox_file_archive = cls( + project_id=project_id, + session_id=session_id, + path=path, + files=files, + bytes_=bytes_, + ) + + return sandbox_file_archive diff --git a/src/volcano_sdk/_generated/models/sandbox_file_archive_form.py b/src/volcano_sdk/_generated/models/sandbox_file_archive_form.py new file mode 100644 index 00000000..318b10cc --- /dev/null +++ b/src/volcano_sdk/_generated/models/sandbox_file_archive_form.py @@ -0,0 +1,147 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +import json +from .. import types + +from ..types import UNSET, Unset + +from ..types import File, FileTypes +from io import BytesIO +from uuid import UUID + + + + + + +T = TypeVar("T", bound="SandboxFileArchiveForm") + + + +@_attrs_define +class SandboxFileArchiveForm: + """ Send `project_id`, `session_id` and `path`, in any order, then the `archive` part. + + Attributes: + project_id (UUID): + session_id (UUID): + path (str): Workspace directory to extract into, relative to `/workspace`. It must name a directory below the + workspace root; a path that resolves to the root or to `/`, such as `.`, `./`, `/`, `/workspace` or + `/workspace/.`, is refused. + archive (File): A tar archive, optionally gzip-compressed. + """ + + project_id: UUID + session_id: UUID + path: str + archive: File + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + project_id = str(self.project_id) + + session_id = str(self.session_id) + + path = self.path + + archive = self.archive.to_tuple() + + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "project_id": project_id, + "session_id": session_id, + "path": path, + "archive": archive, + }) + + return field_dict + + + def to_multipart(self) -> types.RequestFiles: + files: types.RequestFiles = [] + + files.append(("project_id", (None, str(self.project_id), "text/plain"))) + + + + files.append(("session_id", (None, str(self.session_id), "text/plain"))) + + + + files.append(("path", (None, str(self.path).encode(), "text/plain"))) + + + + files.append(("archive", self.archive.to_tuple())) + + + + + for prop_name, prop in self.additional_properties.items(): + files.append((prop_name, (None, str(prop).encode(), "text/plain"))) + + + + return files + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + project_id = UUID(d.pop("project_id")) + + + + + session_id = UUID(d.pop("session_id")) + + + + + path = d.pop("path") + + archive = File( + payload = BytesIO(d.pop("archive")) + ) + + + + + sandbox_file_archive_form = cls( + project_id=project_id, + session_id=session_id, + path=path, + archive=archive, + ) + + + sandbox_file_archive_form.additional_properties = d + return sandbox_file_archive_form + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/sandbox_file_entry.py b/src/volcano_sdk/_generated/models/sandbox_file_entry.py new file mode 100644 index 00000000..e333ebc7 --- /dev/null +++ b/src/volcano_sdk/_generated/models/sandbox_file_entry.py @@ -0,0 +1,146 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.sandbox_file_entry_sha_256_skipped import check_sandbox_file_entry_sha_256_skipped +from ..models.sandbox_file_entry_sha_256_skipped import SandboxFileEntrySha256Skipped +from ..models.sandbox_file_entry_type import check_sandbox_file_entry_type +from ..models.sandbox_file_entry_type import SandboxFileEntryType +from ..types import UNSET, Unset +from typing import cast + + + + + + +T = TypeVar("T", bound="SandboxFileEntry") + + + +@_attrs_define +class SandboxFileEntry: + """ + Attributes: + path (str): Path relative to the workspace root, usable with the read and write file routes. + type_ (SandboxFileEntryType): Entry type from the entry itself. A symlink is reported, never followed. + size (int): Size in bytes of a regular file; 0 for every other type. + mode (int): Permission bits, including setuid, setgid and sticky (`st_mode & 07777`). For example, 420 is `0644` + and 493 is `0755`. + sha256 (str | Unset): Lowercase hex SHA-256 of a regular file's content, present only when `include_sha256` is + true and the file could be hashed. + sha256_skipped (SandboxFileEntrySha256Skipped | Unset): Why a regular file has no `sha256` when `include_sha256` + is true. `budget` is a file over 256 MiB. `changing` is a file that changed while it was hashed or kept + changing; list it again later. `unreadable` is a file the session user doesn't own, whose owner-read bit + (`0400`) is clear, or that has more than one hard link. Treat such a file as unverified. + unreadable (bool | Unset): True on a directory the session user can't list; the listing doesn't enter it. The + user's permission bits on the directory lack read or execute: the owner bits when the user owns it, the group + bits when it belongs to the user's group, and the other bits otherwise. Absent on every other entry. + unsupported_names (int | Unset): In a recursive listing, how many names directly inside this directory no entry + can carry: names that are not UTF-8, or whose path would pass 4096 bytes. The listing skips them and everything + below them. Absent when there are none. + """ + + path: str + type_: SandboxFileEntryType + size: int + mode: int + sha256: str | Unset = UNSET + sha256_skipped: SandboxFileEntrySha256Skipped | Unset = UNSET + unreadable: bool | Unset = UNSET + unsupported_names: int | Unset = UNSET + + + + + + def to_dict(self) -> dict[str, Any]: + path = self.path + + type_: str = self.type_ + + size = self.size + + mode = self.mode + + sha256 = self.sha256 + + sha256_skipped: str | Unset = UNSET + if not isinstance(self.sha256_skipped, Unset): + sha256_skipped = self.sha256_skipped + + + unreadable = self.unreadable + + unsupported_names = self.unsupported_names + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "path": path, + "type": type_, + "size": size, + "mode": mode, + }) + if sha256 is not UNSET: + field_dict["sha256"] = sha256 + if sha256_skipped is not UNSET: + field_dict["sha256_skipped"] = sha256_skipped + if unreadable is not UNSET: + field_dict["unreadable"] = unreadable + if unsupported_names is not UNSET: + field_dict["unsupported_names"] = unsupported_names + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + path = d.pop("path") + + type_ = check_sandbox_file_entry_type(d.pop("type")) + + + + + size = d.pop("size") + + mode = d.pop("mode") + + sha256 = d.pop("sha256", UNSET) + + _sha256_skipped = d.pop("sha256_skipped", UNSET) + sha256_skipped: SandboxFileEntrySha256Skipped | Unset + if isinstance(_sha256_skipped, Unset): + sha256_skipped = UNSET + else: + sha256_skipped = check_sandbox_file_entry_sha_256_skipped(_sha256_skipped) + + + + + unreadable = d.pop("unreadable", UNSET) + + unsupported_names = d.pop("unsupported_names", UNSET) + + sandbox_file_entry = cls( + path=path, + type_=type_, + size=size, + mode=mode, + sha256=sha256, + sha256_skipped=sha256_skipped, + unreadable=unreadable, + unsupported_names=unsupported_names, + ) + + return sandbox_file_entry diff --git a/src/volcano_sdk/_generated/models/sandbox_file_entry_sha_256_skipped.py b/src/volcano_sdk/_generated/models/sandbox_file_entry_sha_256_skipped.py new file mode 100644 index 00000000..38b0fe78 --- /dev/null +++ b/src/volcano_sdk/_generated/models/sandbox_file_entry_sha_256_skipped.py @@ -0,0 +1,10 @@ +from typing import Literal + +SandboxFileEntrySha256Skipped = Literal['budget', 'changing', 'unreadable'] + +SANDBOX_FILE_ENTRY_SHA_256_SKIPPED_VALUES: set[SandboxFileEntrySha256Skipped] = { 'budget', 'changing', 'unreadable', } + +def check_sandbox_file_entry_sha_256_skipped(value: str) -> SandboxFileEntrySha256Skipped: + if value in SANDBOX_FILE_ENTRY_SHA_256_SKIPPED_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {SANDBOX_FILE_ENTRY_SHA_256_SKIPPED_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/sandbox_file_entry_type.py b/src/volcano_sdk/_generated/models/sandbox_file_entry_type.py new file mode 100644 index 00000000..5cff4d9b --- /dev/null +++ b/src/volcano_sdk/_generated/models/sandbox_file_entry_type.py @@ -0,0 +1,10 @@ +from typing import Literal + +SandboxFileEntryType = Literal['directory', 'file', 'other', 'symlink'] + +SANDBOX_FILE_ENTRY_TYPE_VALUES: set[SandboxFileEntryType] = { 'directory', 'file', 'other', 'symlink', } + +def check_sandbox_file_entry_type(value: str) -> SandboxFileEntryType: + if value in SANDBOX_FILE_ENTRY_TYPE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {SANDBOX_FILE_ENTRY_TYPE_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/sandbox_file_list_result.py b/src/volcano_sdk/_generated/models/sandbox_file_list_result.py new file mode 100644 index 00000000..57519a58 --- /dev/null +++ b/src/volcano_sdk/_generated/models/sandbox_file_list_result.py @@ -0,0 +1,120 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset +from typing import cast +from uuid import UUID + +if TYPE_CHECKING: + from ..models.sandbox_file_entry import SandboxFileEntry + + + + + +T = TypeVar("T", bound="SandboxFileListResult") + + + +@_attrs_define +class SandboxFileListResult: + """ + Attributes: + project_id (UUID): The project the session belongs to. + session_id (UUID): The session listed. + entries (list[SandboxFileEntry]): Entries sorted by path, compared one path element at a time by bytes, so a + directory comes right before its contents. + unsupported_names (int | Unset): How many names directly inside the listed directory no entry can carry: names + that are not UTF-8, or whose path would pass 4096 bytes. The listing skips them and everything below them. Every + page reports it. Absent when there are none. + next_cursor (str | Unset): Present when more entries remain. Pass it as `cursor` to get the next page. + """ + + project_id: UUID + session_id: UUID + entries: list[SandboxFileEntry] + unsupported_names: int | Unset = UNSET + next_cursor: str | Unset = UNSET + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.sandbox_file_entry import SandboxFileEntry # noqa: PLC0415 + project_id = str(self.project_id) + + session_id = str(self.session_id) + + entries = [] + for entries_item_data in self.entries: + entries_item = entries_item_data.to_dict() + entries.append(entries_item) + + + + unsupported_names = self.unsupported_names + + next_cursor = self.next_cursor + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "project_id": project_id, + "session_id": session_id, + "entries": entries, + }) + if unsupported_names is not UNSET: + field_dict["unsupported_names"] = unsupported_names + if next_cursor is not UNSET: + field_dict["next_cursor"] = next_cursor + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.sandbox_file_entry import SandboxFileEntry # noqa: PLC0415 + d = dict(src_dict) + project_id = UUID(d.pop("project_id")) + + + + + session_id = UUID(d.pop("session_id")) + + + + + entries = [] + _entries = d.pop("entries") + for entries_item_data in (_entries): + entries_item = SandboxFileEntry.from_dict(entries_item_data) + + + + entries.append(entries_item) + + + unsupported_names = d.pop("unsupported_names", UNSET) + + next_cursor = d.pop("next_cursor", UNSET) + + sandbox_file_list_result = cls( + project_id=project_id, + session_id=session_id, + entries=entries, + unsupported_names=unsupported_names, + next_cursor=next_cursor, + ) + + return sandbox_file_list_result diff --git a/src/volcano_sdk/_generated/models/sandbox_file_part.py b/src/volcano_sdk/_generated/models/sandbox_file_part.py new file mode 100644 index 00000000..f30b4afe --- /dev/null +++ b/src/volcano_sdk/_generated/models/sandbox_file_part.py @@ -0,0 +1,112 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from uuid import UUID + + + + + + +T = TypeVar("T", bound="SandboxFilePart") + + + +@_attrs_define +class SandboxFilePart: + """ + Attributes: + project_id (UUID): + session_id (UUID): + path (str): + offset (int): + size (int): + received (int): Bytes of the file received through the end of this part. + complete (bool): True when this part finished the file and it is now at `path`. + """ + + project_id: UUID + session_id: UUID + path: str + offset: int + size: int + received: int + complete: bool + + + + + + def to_dict(self) -> dict[str, Any]: + project_id = str(self.project_id) + + session_id = str(self.session_id) + + path = self.path + + offset = self.offset + + size = self.size + + received = self.received + + complete = self.complete + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "project_id": project_id, + "session_id": session_id, + "path": path, + "offset": offset, + "size": size, + "received": received, + "complete": complete, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + project_id = UUID(d.pop("project_id")) + + + + + session_id = UUID(d.pop("session_id")) + + + + + path = d.pop("path") + + offset = d.pop("offset") + + size = d.pop("size") + + received = d.pop("received") + + complete = d.pop("complete") + + sandbox_file_part = cls( + project_id=project_id, + session_id=session_id, + path=path, + offset=offset, + size=size, + received=received, + complete=complete, + ) + + return sandbox_file_part diff --git a/src/volcano_sdk/_generated/models/sandbox_file_part_request.py b/src/volcano_sdk/_generated/models/sandbox_file_part_request.py new file mode 100644 index 00000000..150e0222 --- /dev/null +++ b/src/volcano_sdk/_generated/models/sandbox_file_part_request.py @@ -0,0 +1,112 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from uuid import UUID + + + + + + +T = TypeVar("T", bound="SandboxFilePartRequest") + + + +@_attrs_define +class SandboxFilePartRequest: + """ + Attributes: + project_id (UUID): + session_id (UUID): + path (str): Workspace file to write, relative to `/workspace`. + offset (int): Byte offset of this part's data in the file. + size (int): Size of the whole file in bytes, at most 1 GiB. + sha256 (str): Lowercase hex SHA-256 of the whole file. + data (str): This part's bytes, at most 8 MiB. + """ + + project_id: UUID + session_id: UUID + path: str + offset: int + size: int + sha256: str + data: str + + + + + + def to_dict(self) -> dict[str, Any]: + project_id = str(self.project_id) + + session_id = str(self.session_id) + + path = self.path + + offset = self.offset + + size = self.size + + sha256 = self.sha256 + + data = self.data + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "project_id": project_id, + "session_id": session_id, + "path": path, + "offset": offset, + "size": size, + "sha256": sha256, + "data": data, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + project_id = UUID(d.pop("project_id")) + + + + + session_id = UUID(d.pop("session_id")) + + + + + path = d.pop("path") + + offset = d.pop("offset") + + size = d.pop("size") + + sha256 = d.pop("sha256") + + data = d.pop("data") + + sandbox_file_part_request = cls( + project_id=project_id, + session_id=session_id, + path=path, + offset=offset, + size=size, + sha256=sha256, + data=data, + ) + + return sandbox_file_part_request diff --git a/src/volcano_sdk/_generated/models/sandbox_limits_applied.py b/src/volcano_sdk/_generated/models/sandbox_limits_applied.py new file mode 100644 index 00000000..173d0d0f --- /dev/null +++ b/src/volcano_sdk/_generated/models/sandbox_limits_applied.py @@ -0,0 +1,10 @@ +from typing import Literal + +SandboxLimitsApplied = Literal['enforced', 'not_enforced', 'unknown'] + +SANDBOX_LIMITS_APPLIED_VALUES: set[SandboxLimitsApplied] = { 'enforced', 'not_enforced', 'unknown', } + +def check_sandbox_limits_applied(value: str) -> SandboxLimitsApplied: + if value in SANDBOX_LIMITS_APPLIED_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {SANDBOX_LIMITS_APPLIED_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/sandbox_session.py b/src/volcano_sdk/_generated/models/sandbox_session.py index 9cc9b99e..9f4e95b4 100644 --- a/src/volcano_sdk/_generated/models/sandbox_session.py +++ b/src/volcano_sdk/_generated/models/sandbox_session.py @@ -17,6 +17,10 @@ from uuid import UUID import datetime +if TYPE_CHECKING: + from ..models.sandbox_session_applied_limits import SandboxSessionAppliedLimits + from ..models.sandbox_session_executions import SandboxSessionExecutions + from ..models.sandbox_session_network import SandboxSessionNetwork @@ -40,7 +44,19 @@ class SandboxSession: memory_mb (int): created_at (datetime.datetime): expires_at (datetime.datetime | None): Absolute VM expiry. Null means unlimited in local mode. + network (SandboxSessionNetwork): + executions (SandboxSessionExecutions): How the session's command executions are kept. Fixed when the session is + created. + last_error_code (str | Unset): Last recorded lifecycle reason, such as sandbox_run_hook_timeout or + sandbox_authority_or_expiry. Historical information, not a current error; use state for the current session + state. Retained when later observations supply no reason, including after termination or recovery. Omitted when + no reason is known. Values may be added; this field does not imply whether a command ran or whether it can be + retried. started_at (datetime.datetime | Unset): + limits (SandboxSessionAppliedLimits | Unset): The caps the session enforces, as the session reports them. + Present only + when the session was created with `limits`. The session stays + `starting` until `applied` is known. """ id: UUID @@ -52,13 +68,20 @@ class SandboxSession: memory_mb: int created_at: datetime.datetime expires_at: datetime.datetime | None + network: SandboxSessionNetwork + executions: SandboxSessionExecutions + last_error_code: str | Unset = UNSET started_at: datetime.datetime | Unset = UNSET + limits: SandboxSessionAppliedLimits | Unset = UNSET def to_dict(self) -> dict[str, Any]: + from ..models.sandbox_session_applied_limits import SandboxSessionAppliedLimits # noqa: PLC0415 + from ..models.sandbox_session_executions import SandboxSessionExecutions # noqa: PLC0415 + from ..models.sandbox_session_network import SandboxSessionNetwork # noqa: PLC0415 id = str(self.id) project_id = str(self.project_id) @@ -85,10 +108,20 @@ def to_dict(self) -> dict[str, Any]: else: expires_at = self.expires_at + network = self.network.to_dict() + + executions = self.executions.to_dict() + + last_error_code = self.last_error_code + started_at: str | Unset = UNSET if not isinstance(self.started_at, Unset): started_at = self.started_at.isoformat() + limits: dict[str, Any] | Unset = UNSET + if not isinstance(self.limits, Unset): + limits = self.limits.to_dict() + field_dict: dict[str, Any] = {} @@ -102,9 +135,15 @@ def to_dict(self) -> dict[str, Any]: "memory_mb": memory_mb, "created_at": created_at, "expires_at": expires_at, + "network": network, + "executions": executions, }) + if last_error_code is not UNSET: + field_dict["last_error_code"] = last_error_code if started_at is not UNSET: field_dict["started_at"] = started_at + if limits is not UNSET: + field_dict["limits"] = limits return field_dict @@ -112,6 +151,9 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.sandbox_session_applied_limits import SandboxSessionAppliedLimits # noqa: PLC0415 + from ..models.sandbox_session_executions import SandboxSessionExecutions # noqa: PLC0415 + from ..models.sandbox_session_network import SandboxSessionNetwork # noqa: PLC0415 d = dict(src_dict) id = UUID(d.pop("id")) @@ -178,6 +220,18 @@ def _parse_expires_at(data: object) -> datetime.datetime | None: expires_at = _parse_expires_at(d.pop("expires_at")) + network = SandboxSessionNetwork.from_dict(d.pop("network")) + + + + + executions = SandboxSessionExecutions.from_dict(d.pop("executions")) + + + + + last_error_code = d.pop("last_error_code", UNSET) + _started_at = d.pop("started_at", UNSET) started_at: datetime.datetime | Unset if isinstance(_started_at, Unset): @@ -188,6 +242,16 @@ def _parse_expires_at(data: object) -> datetime.datetime | None: + _limits = d.pop("limits", UNSET) + limits: SandboxSessionAppliedLimits | Unset + if isinstance(_limits, Unset): + limits = UNSET + else: + limits = SandboxSessionAppliedLimits.from_dict(_limits) + + + + sandbox_session = cls( id=id, project_id=project_id, @@ -198,7 +262,11 @@ def _parse_expires_at(data: object) -> datetime.datetime | None: memory_mb=memory_mb, created_at=created_at, expires_at=expires_at, + network=network, + executions=executions, + last_error_code=last_error_code, started_at=started_at, + limits=limits, ) return sandbox_session diff --git a/src/volcano_sdk/_generated/models/sandbox_session_applied_limits.py b/src/volcano_sdk/_generated/models/sandbox_session_applied_limits.py new file mode 100644 index 00000000..d2a1cea4 --- /dev/null +++ b/src/volcano_sdk/_generated/models/sandbox_session_applied_limits.py @@ -0,0 +1,89 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.sandbox_limits_applied import check_sandbox_limits_applied +from ..models.sandbox_limits_applied import SandboxLimitsApplied +from ..types import UNSET, Unset +from typing import cast + + + + + + +T = TypeVar("T", bound="SandboxSessionAppliedLimits") + + + +@_attrs_define +class SandboxSessionAppliedLimits: + """ The caps the session enforces, as the session reports them. Present only + when the session was created with `limits`. The session stays + `starting` until `applied` is known. + + Attributes: + applied (SandboxLimitsApplied): `enforced` when every requested cap is enforced, `not_enforced` when the + session could not enforce them, and `unknown` until the session reports. + Terminate a session that reports anything but `enforced` if you rely on + the caps. + vcpus (int | Unset): Enforced vCPU cap. Never higher than requested; lower when the session has fewer vCPUs. + disk_mib (int | Unset): Enforced disk cap in MiB. Never higher than requested; lower when the session's disk has + less free space. + """ + + applied: SandboxLimitsApplied + vcpus: int | Unset = UNSET + disk_mib: int | Unset = UNSET + + + + + + def to_dict(self) -> dict[str, Any]: + applied: str = self.applied + + vcpus = self.vcpus + + disk_mib = self.disk_mib + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "applied": applied, + }) + if vcpus is not UNSET: + field_dict["vcpus"] = vcpus + if disk_mib is not UNSET: + field_dict["disk_mib"] = disk_mib + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + applied = check_sandbox_limits_applied(d.pop("applied")) + + + + + vcpus = d.pop("vcpus", UNSET) + + disk_mib = d.pop("disk_mib", UNSET) + + sandbox_session_applied_limits = cls( + applied=applied, + vcpus=vcpus, + disk_mib=disk_mib, + ) + + return sandbox_session_applied_limits diff --git a/src/volcano_sdk/_generated/models/sandbox_session_executions.py b/src/volcano_sdk/_generated/models/sandbox_session_executions.py new file mode 100644 index 00000000..9365a709 --- /dev/null +++ b/src/volcano_sdk/_generated/models/sandbox_session_executions.py @@ -0,0 +1,63 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="SandboxSessionExecutions") + + + +@_attrs_define +class SandboxSessionExecutions: + """ How the session's command executions are kept. Fixed when the session is created. + + Attributes: + keep_output (bool): When false, every command in the session keeps no output. stdout and stderr are returned + once in the command's response, and Volcano's control plane never stores them in the execution journal, + database, logs or traces. This does not cover the Sandbox's memory or a suspended session's snapshot. A retry + with the same Idempotency-Key returns the exit code with empty streams. A command in such a session that sets + `keep_output` to true is refused with 400 and code `sandbox_session_keeps_no_output`. False is refused with 400 + and code `feature_unavailable` while the `sandboxes.output_not_kept` capability is unavailable. + """ + + keep_output: bool + + + + + + def to_dict(self) -> dict[str, Any]: + keep_output = self.keep_output + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "keep_output": keep_output, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + keep_output = d.pop("keep_output") + + sandbox_session_executions = cls( + keep_output=keep_output, + ) + + return sandbox_session_executions diff --git a/src/volcano_sdk/_generated/models/sandbox_session_limits.py b/src/volcano_sdk/_generated/models/sandbox_session_limits.py new file mode 100644 index 00000000..74e77210 --- /dev/null +++ b/src/volcano_sdk/_generated/models/sandbox_session_limits.py @@ -0,0 +1,76 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset + + + + + + +T = TypeVar("T", bound="SandboxSessionLimits") + + + +@_attrs_define +class SandboxSessionLimits: + """ Caps the session's code runs under, enforced inside the session. Each + cap is an upper bound; the session's own size still bounds both. + + Attributes: + vcpus (int | Unset): CPU time the session's commands and template service may use + together, in vCPUs. A 1024 MiB session has 2 vCPUs and a 2048 MiB + session has 4; asking for more answers 400 with code + `sandbox_limits_exceed_session`. + disk_mib (int | Unset): Space the session can write beyond its image's contents, in MiB. + It covers every path commands and the template service can write, + including `/workspace` and `/tmp`. A write past it fails with + `ENOSPC`. `/dev/shm` is memory, capped separately at 64 MiB. + """ + + vcpus: int | Unset = UNSET + disk_mib: int | Unset = UNSET + + + + + + def to_dict(self) -> dict[str, Any]: + vcpus = self.vcpus + + disk_mib = self.disk_mib + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + }) + if vcpus is not UNSET: + field_dict["vcpus"] = vcpus + if disk_mib is not UNSET: + field_dict["disk_mib"] = disk_mib + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + vcpus = d.pop("vcpus", UNSET) + + disk_mib = d.pop("disk_mib", UNSET) + + sandbox_session_limits = cls( + vcpus=vcpus, + disk_mib=disk_mib, + ) + + return sandbox_session_limits diff --git a/src/volcano_sdk/_generated/models/sandbox_session_network.py b/src/volcano_sdk/_generated/models/sandbox_session_network.py new file mode 100644 index 00000000..dce4c786 --- /dev/null +++ b/src/volcano_sdk/_generated/models/sandbox_session_network.py @@ -0,0 +1,84 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.sandbox_session_network_applied import check_sandbox_session_network_applied +from ..models.sandbox_session_network_applied import SandboxSessionNetworkApplied +from ..models.sandbox_session_network_egress import check_sandbox_session_network_egress +from ..models.sandbox_session_network_egress import SandboxSessionNetworkEgress +from typing import cast + + + + + + +T = TypeVar("T", bound="SandboxSessionNetwork") + + + +@_attrs_define +class SandboxSessionNetwork: + """ + Attributes: + egress (SandboxSessionNetworkEgress): The outbound network policy the session was created with. It never + changes. + applied (SandboxSessionNetworkApplied): The outbound network policy Volcano last observed on the session's VM, + never the request alone. It is `unknown` until the session is first observed, from a suspend or resume request + until it is observed again, briefly while Volcano rolls out an update, and whenever the observation does not + match the request. A terminated session keeps what Volcano last observed, so a `deny_all` session ended because + Volcano observed outbound access reads `default`. A session first reports `state` `running` only once its + network has been observed. To depend on `deny_all`, wait for `running`, then terminate the session unless + `applied` is `deny_all`. Act on `applied` only while the session is `running`, and on a later `unknown` only + while `desired_state` is `running`. + """ + + egress: SandboxSessionNetworkEgress + applied: SandboxSessionNetworkApplied + + + + + + def to_dict(self) -> dict[str, Any]: + egress: str = self.egress + + applied: str = self.applied + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "egress": egress, + "applied": applied, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + egress = check_sandbox_session_network_egress(d.pop("egress")) + + + + + applied = check_sandbox_session_network_applied(d.pop("applied")) + + + + + sandbox_session_network = cls( + egress=egress, + applied=applied, + ) + + return sandbox_session_network diff --git a/src/volcano_sdk/_generated/models/sandbox_session_network_applied.py b/src/volcano_sdk/_generated/models/sandbox_session_network_applied.py new file mode 100644 index 00000000..fe69d933 --- /dev/null +++ b/src/volcano_sdk/_generated/models/sandbox_session_network_applied.py @@ -0,0 +1,10 @@ +from typing import Literal + +SandboxSessionNetworkApplied = Literal['default', 'deny_all', 'unknown'] + +SANDBOX_SESSION_NETWORK_APPLIED_VALUES: set[SandboxSessionNetworkApplied] = { 'default', 'deny_all', 'unknown', } + +def check_sandbox_session_network_applied(value: str) -> SandboxSessionNetworkApplied: + if value in SANDBOX_SESSION_NETWORK_APPLIED_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {SANDBOX_SESSION_NETWORK_APPLIED_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/sandbox_session_network_egress.py b/src/volcano_sdk/_generated/models/sandbox_session_network_egress.py new file mode 100644 index 00000000..e50a7f70 --- /dev/null +++ b/src/volcano_sdk/_generated/models/sandbox_session_network_egress.py @@ -0,0 +1,10 @@ +from typing import Literal + +SandboxSessionNetworkEgress = Literal['default', 'deny_all'] + +SANDBOX_SESSION_NETWORK_EGRESS_VALUES: set[SandboxSessionNetworkEgress] = { 'default', 'deny_all', } + +def check_sandbox_session_network_egress(value: str) -> SandboxSessionNetworkEgress: + if value in SANDBOX_SESSION_NETWORK_EGRESS_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {SANDBOX_SESSION_NETWORK_EGRESS_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/sandbox_session_network_request.py b/src/volcano_sdk/_generated/models/sandbox_session_network_request.py new file mode 100644 index 00000000..c598a348 --- /dev/null +++ b/src/volcano_sdk/_generated/models/sandbox_session_network_request.py @@ -0,0 +1,69 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.sandbox_session_network_request_egress import check_sandbox_session_network_request_egress +from ..models.sandbox_session_network_request_egress import SandboxSessionNetworkRequestEgress +from typing import cast + + + + + + +T = TypeVar("T", bound="SandboxSessionNetworkRequest") + + + +@_attrs_define +class SandboxSessionNetworkRequest: + """ Outbound network policy for the session. Omitting `network` is the same as `egress` `default`. + + Attributes: + egress (SandboxSessionNetworkRequestEgress): `default` gives the session the region's standard outbound internet + access. `deny_all` gives it no outbound network for its whole lifetime: DNS lookups, internet and link-local + addresses, and connections back out through Volcano all fail, and the session accepts no port access. Commands, + files and the rest of the session API work as usual. The policy cannot be changed after creation; suspend and + resume keep it. Check `network.applied` before relying on it. Where `GET /capabilities` lists + `sandboxes.network_isolation` as unavailable, `deny_all` answers `400` with code `feature_unavailable`. + """ + + egress: SandboxSessionNetworkRequestEgress + + + + + + def to_dict(self) -> dict[str, Any]: + egress: str = self.egress + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "egress": egress, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + egress = check_sandbox_session_network_request_egress(d.pop("egress")) + + + + + sandbox_session_network_request = cls( + egress=egress, + ) + + return sandbox_session_network_request diff --git a/src/volcano_sdk/_generated/models/sandbox_session_network_request_egress.py b/src/volcano_sdk/_generated/models/sandbox_session_network_request_egress.py new file mode 100644 index 00000000..1405a212 --- /dev/null +++ b/src/volcano_sdk/_generated/models/sandbox_session_network_request_egress.py @@ -0,0 +1,10 @@ +from typing import Literal + +SandboxSessionNetworkRequestEgress = Literal['default', 'deny_all'] + +SANDBOX_SESSION_NETWORK_REQUEST_EGRESS_VALUES: set[SandboxSessionNetworkRequestEgress] = { 'default', 'deny_all', } + +def check_sandbox_session_network_request_egress(value: str) -> SandboxSessionNetworkRequestEgress: + if value in SANDBOX_SESSION_NETWORK_REQUEST_EGRESS_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {SANDBOX_SESSION_NETWORK_REQUEST_EGRESS_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/scheduler_failure_alert_policy.py b/src/volcano_sdk/_generated/models/scheduler_failure_alert_policy.py new file mode 100644 index 00000000..6d3c0c39 --- /dev/null +++ b/src/volcano_sdk/_generated/models/scheduler_failure_alert_policy.py @@ -0,0 +1,84 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.scheduler_failure_notify_on import check_scheduler_failure_notify_on +from ..models.scheduler_failure_notify_on import SchedulerFailureNotifyOn +from typing import cast + + + + + + +T = TypeVar("T", bound="SchedulerFailureAlertPolicy") + + + +@_attrs_define +class SchedulerFailureAlertPolicy: + """ + Attributes: + notify_on (SchedulerFailureNotifyOn): When a failing scheduler is announced: on its first failed run, or once + `threshold` runs in a row have failed. Either way a streak is announced once, and a scheduler is announced + failing at most once an hour. + threshold (int): How many runs in a row have to fail before a `consecutive_failures` alert. Ignored for + `first_failure`. + notify_on_recovery (bool): Whether a successful run after an alerted failure streak sends a + `scheduler.recovered` alert. + """ + + notify_on: SchedulerFailureNotifyOn + threshold: int + notify_on_recovery: bool + + + + + + def to_dict(self) -> dict[str, Any]: + notify_on: str = self.notify_on + + threshold = self.threshold + + notify_on_recovery = self.notify_on_recovery + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "notify_on": notify_on, + "threshold": threshold, + "notify_on_recovery": notify_on_recovery, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + notify_on = check_scheduler_failure_notify_on(d.pop("notify_on")) + + + + + threshold = d.pop("threshold") + + notify_on_recovery = d.pop("notify_on_recovery") + + scheduler_failure_alert_policy = cls( + notify_on=notify_on, + threshold=threshold, + notify_on_recovery=notify_on_recovery, + ) + + return scheduler_failure_alert_policy + diff --git a/src/volcano_sdk/_generated/models/scheduler_failure_notify_on.py b/src/volcano_sdk/_generated/models/scheduler_failure_notify_on.py new file mode 100644 index 00000000..be7f3e06 --- /dev/null +++ b/src/volcano_sdk/_generated/models/scheduler_failure_notify_on.py @@ -0,0 +1,10 @@ +from typing import Literal + +SchedulerFailureNotifyOn = Literal['consecutive_failures', 'first_failure'] + +SCHEDULER_FAILURE_NOTIFY_ON_VALUES: set[SchedulerFailureNotifyOn] = { 'consecutive_failures', 'first_failure', } + +def check_scheduler_failure_notify_on(value: str) -> SchedulerFailureNotifyOn: + if value in SCHEDULER_FAILURE_NOTIFY_ON_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {SCHEDULER_FAILURE_NOTIFY_ON_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/service_key.py b/src/volcano_sdk/_generated/models/service_key.py index f2f25a9f..f47cc59b 100644 --- a/src/volcano_sdk/_generated/models/service_key.py +++ b/src/volcano_sdk/_generated/models/service_key.py @@ -37,7 +37,8 @@ class ServiceKey: Example: ['*']. project_id (UUID | Unset): key_value (str | Unset): Full JWT token for Authorization header. - Returned on create, get, and list (decrypted from storage). + Returned on create, get, and list (decrypted from storage). List + responses leave it out for a key that holds `ai.invoke` or `grants.mint`. **Store securely - NEVER expose in frontend code!** created_at (datetime.datetime | Unset): updated_at (datetime.datetime | Unset): diff --git a/src/volcano_sdk/_generated/models/set_project_git_production_branch_request.py b/src/volcano_sdk/_generated/models/set_project_git_production_branch_request.py index c5e9c766..54dea511 100644 --- a/src/volcano_sdk/_generated/models/set_project_git_production_branch_request.py +++ b/src/volcano_sdk/_generated/models/set_project_git_production_branch_request.py @@ -23,7 +23,7 @@ class SetProjectGitProductionBranchRequest: """ Attributes: production_branch (str): The branch a push must land on to deploy. Validated as a Git branch name only — it does - not have to exist yet. + not have to exist yet. An empty string follows the repository's default branch, including later renames. """ production_branch: str diff --git a/src/volcano_sdk/_generated/models/set_project_git_root_directory_request.py b/src/volcano_sdk/_generated/models/set_project_git_root_directory_request.py new file mode 100644 index 00000000..d44aefb8 --- /dev/null +++ b/src/volcano_sdk/_generated/models/set_project_git_root_directory_request.py @@ -0,0 +1,77 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="SetProjectGitRootDirectoryRequest") + + + +@_attrs_define +class SetProjectGitRootDirectoryRequest: + """ + Attributes: + root_directory (str): Monorepo subdirectory the project builds from, relative to the repository root. An empty + string means the repository root. + """ + + root_directory: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + root_directory = self.root_directory + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "root_directory": root_directory, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + root_directory = d.pop("root_directory") + + set_project_git_root_directory_request = cls( + root_directory=root_directory, + ) + + + set_project_git_root_directory_request.additional_properties = d + return set_project_git_root_directory_request + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/share.py b/src/volcano_sdk/_generated/models/share.py new file mode 100644 index 00000000..98defd50 --- /dev/null +++ b/src/volcano_sdk/_generated/models/share.py @@ -0,0 +1,232 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.share_status import check_share_status +from ..models.share_status import ShareStatus +from ..types import UNSET, Unset +from typing import cast +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.share_release_ref import ShareReleaseRef + + + + + +T = TypeVar("T", bound="Share") + + + +@_attrs_define +class Share: + """ + Attributes: + id (str): The link's public identifier. Its address is `https://volcano.dev/deploy/`. + project_id (UUID): + suggested_name (str): A project name for clients to offer a visitor as the default. The create request still + carries its own `name`; Volcano does not fill one in from the link. + description (str): What the project does, in the owner's words, shown to visitors before they deploy. One line + of plain text; empty when the owner wrote none. + allow_reshare (bool): Whether the projects made from this link, and the projects made from those, may be shared + again by their owners. False by default, so a copy of this project cannot create, draft, publish or switch on a + deploy link of its own, and its links serve nothing. Read at each request, so switching it off stops copies' + links that are already on. + status (ShareStatus): Whether the owner, or Volcano, has the link on. An `active` link can still not serve; see + `serving`. + serving (bool): Whether the link's address serves its current release now: it is + `active`, published, and nothing stops it, such as deploy links not being + available in this environment, the project being deleted, the owner's + account not allowing traffic, or the project being a copy that may no + longer be shared. An `active` link that is not serving + answers visitors as one switched off, and switching it on again changes + nothing until what stops it is resolved. + current_release (None | ShareReleaseRef): The release visitors are offered. Null until the first publish; until + then the link's preview answers `404`. + created_at (datetime.datetime): + updated_at (datetime.datetime): + disabled_reason (None | str | Unset): Why the link is off. Set only while it is disabled. New reasons can be + added, so treat an unknown one as disabled. `owner`: its owner switched + it off. `operator`: Volcano took it down; its owner cannot switch it back + on or delete it (`PATCH` and `DELETE` answer `403` with code + `operator_disabled`), but can still edit it. While it is down, its + project cannot be shared any more (no new link, draft or publish, and no + link switched on), and no project made from it, or from a copy of it, can + be shared either. + Example: owner. + """ + + id: str + project_id: UUID + suggested_name: str + description: str + allow_reshare: bool + status: ShareStatus + serving: bool + current_release: None | ShareReleaseRef + created_at: datetime.datetime + updated_at: datetime.datetime + disabled_reason: None | str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.share_release_ref import ShareReleaseRef # noqa: PLC0415 + id = self.id + + project_id = str(self.project_id) + + suggested_name = self.suggested_name + + description = self.description + + allow_reshare = self.allow_reshare + + status: str = self.status + + serving = self.serving + + current_release: dict[str, Any] | None + if isinstance(self.current_release, ShareReleaseRef): + current_release = self.current_release.to_dict() + else: + current_release = self.current_release + + created_at = self.created_at.isoformat() + + updated_at = self.updated_at.isoformat() + + disabled_reason: None | str | Unset + if isinstance(self.disabled_reason, Unset): + disabled_reason = UNSET + else: + disabled_reason = self.disabled_reason + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "id": id, + "project_id": project_id, + "suggested_name": suggested_name, + "description": description, + "allow_reshare": allow_reshare, + "status": status, + "serving": serving, + "current_release": current_release, + "created_at": created_at, + "updated_at": updated_at, + }) + if disabled_reason is not UNSET: + field_dict["disabled_reason"] = disabled_reason + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.share_release_ref import ShareReleaseRef # noqa: PLC0415 + d = dict(src_dict) + id = d.pop("id") + + project_id = UUID(d.pop("project_id")) + + + + + suggested_name = d.pop("suggested_name") + + description = d.pop("description") + + allow_reshare = d.pop("allow_reshare") + + status = check_share_status(d.pop("status")) + + + + + serving = d.pop("serving") + + def _parse_current_release(data: object) -> None | ShareReleaseRef: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + current_release_type_1 = ShareReleaseRef.from_dict(data) + + + + return current_release_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | ShareReleaseRef, data) + + current_release = _parse_current_release(d.pop("current_release")) + + + created_at = datetime.datetime.fromisoformat(d.pop("created_at")) + + + + + updated_at = datetime.datetime.fromisoformat(d.pop("updated_at")) + + + + + def _parse_disabled_reason(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + disabled_reason = _parse_disabled_reason(d.pop("disabled_reason", UNSET)) + + + share = cls( + id=id, + project_id=project_id, + suggested_name=suggested_name, + description=description, + allow_reshare=allow_reshare, + status=status, + serving=serving, + current_release=current_release, + created_at=created_at, + updated_at=updated_at, + disabled_reason=disabled_reason, + ) + + + share.additional_properties = d + return share + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/share_create_request.py b/src/volcano_sdk/_generated/models/share_create_request.py new file mode 100644 index 00000000..affff1ea --- /dev/null +++ b/src/volcano_sdk/_generated/models/share_create_request.py @@ -0,0 +1,93 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset +from uuid import UUID + + + + + + +T = TypeVar("T", bound="ShareCreateRequest") + + + +@_attrs_define +class ShareCreateRequest: + """ + Attributes: + project_id (UUID): The project to share. A project the caller can't share answers like one that doesn't exist. + suggested_name (str | Unset): A project name for clients to offer visitors as the default; the create request + still carries its own `name`. It may contain only letters, numbers, underscores and hyphens. + description (str | Unset): What the project does, shown to visitors before they deploy. One line of plain text + with no control characters; surrounding spaces are trimmed. + allow_reshare (bool | Unset): Lets the projects made from this link be shared again by their owners. Defaults to + false. + """ + + project_id: UUID + suggested_name: str | Unset = UNSET + description: str | Unset = UNSET + allow_reshare: bool | Unset = UNSET + + + + + + def to_dict(self) -> dict[str, Any]: + project_id = str(self.project_id) + + suggested_name = self.suggested_name + + description = self.description + + allow_reshare = self.allow_reshare + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "project_id": project_id, + }) + if suggested_name is not UNSET: + field_dict["suggested_name"] = suggested_name + if description is not UNSET: + field_dict["description"] = description + if allow_reshare is not UNSET: + field_dict["allow_reshare"] = allow_reshare + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + project_id = UUID(d.pop("project_id")) + + + + + suggested_name = d.pop("suggested_name", UNSET) + + description = d.pop("description", UNSET) + + allow_reshare = d.pop("allow_reshare", UNSET) + + share_create_request = cls( + project_id=project_id, + suggested_name=suggested_name, + description=description, + allow_reshare=allow_reshare, + ) + + return share_create_request + diff --git a/src/volcano_sdk/_generated/models/share_daily_count.py b/src/volcano_sdk/_generated/models/share_daily_count.py new file mode 100644 index 00000000..6db21b80 --- /dev/null +++ b/src/volcano_sdk/_generated/models/share_daily_count.py @@ -0,0 +1,102 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.share_daily_count_kind import check_share_daily_count_kind +from ..models.share_daily_count_kind import ShareDailyCountKind +from typing import cast +import datetime + + + + + + +T = TypeVar("T", bound="ShareDailyCount") + + + +@_attrs_define +class ShareDailyCount: + """ + Attributes: + day (datetime.date): UTC day. + kind (ShareDailyCountKind): + events (int): + """ + + day: datetime.date + kind: ShareDailyCountKind + events: int + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + day = self.day.isoformat() + + kind: str = self.kind + + events = self.events + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "day": day, + "kind": kind, + "events": events, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + day = datetime.date.fromisoformat(d.pop("day")) + + + + + kind = check_share_daily_count_kind(d.pop("kind")) + + + + + events = d.pop("events") + + share_daily_count = cls( + day=day, + kind=kind, + events=events, + ) + + + share_daily_count.additional_properties = d + return share_daily_count + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/share_daily_count_kind.py b/src/volcano_sdk/_generated/models/share_daily_count_kind.py new file mode 100644 index 00000000..b77cfcd9 --- /dev/null +++ b/src/volcano_sdk/_generated/models/share_daily_count_kind.py @@ -0,0 +1,10 @@ +from typing import Literal + +ShareDailyCountKind = Literal['accepted', 'click', 'confirm', 'failed', 'preview', 'ready'] + +SHARE_DAILY_COUNT_KIND_VALUES: set[ShareDailyCountKind] = { 'accepted', 'click', 'confirm', 'failed', 'preview', 'ready', } + +def check_share_daily_count_kind(value: str) -> ShareDailyCountKind: + if value in SHARE_DAILY_COUNT_KIND_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {SHARE_DAILY_COUNT_KIND_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/share_draft_changed_error.py b/src/volcano_sdk/_generated/models/share_draft_changed_error.py new file mode 100644 index 00000000..1c640c22 --- /dev/null +++ b/src/volcano_sdk/_generated/models/share_draft_changed_error.py @@ -0,0 +1,105 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.share_draft_changed_error_code import check_share_draft_changed_error_code +from ..models.share_draft_changed_error_code import ShareDraftChangedErrorCode +from typing import cast + +if TYPE_CHECKING: + from ..models.share_release_draft import ShareReleaseDraft + + + + + +T = TypeVar("T", bound="ShareDraftChangedError") + + + +@_attrs_define +class ShareDraftChangedError: + """ + Attributes: + error (str): + code (ShareDraftChangedErrorCode): + draft (ShareReleaseDraft): + """ + + error: str + code: ShareDraftChangedErrorCode + draft: ShareReleaseDraft + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.share_release_draft import ShareReleaseDraft # noqa: PLC0415 + error = self.error + + code: str = self.code + + draft = self.draft.to_dict() + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "error": error, + "code": code, + "draft": draft, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.share_release_draft import ShareReleaseDraft # noqa: PLC0415 + d = dict(src_dict) + error = d.pop("error") + + code = check_share_draft_changed_error_code(d.pop("code")) + + + + + draft = ShareReleaseDraft.from_dict(d.pop("draft")) + + + + + share_draft_changed_error = cls( + error=error, + code=code, + draft=draft, + ) + + + share_draft_changed_error.additional_properties = d + return share_draft_changed_error + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/share_draft_changed_error_code.py b/src/volcano_sdk/_generated/models/share_draft_changed_error_code.py new file mode 100644 index 00000000..91727651 --- /dev/null +++ b/src/volcano_sdk/_generated/models/share_draft_changed_error_code.py @@ -0,0 +1,10 @@ +from typing import Literal + +ShareDraftChangedErrorCode = Literal['draft_changed'] + +SHARE_DRAFT_CHANGED_ERROR_CODE_VALUES: set[ShareDraftChangedErrorCode] = { 'draft_changed', } + +def check_share_draft_changed_error_code(value: str) -> ShareDraftChangedErrorCode: + if value in SHARE_DRAFT_CHANGED_ERROR_CODE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {SHARE_DRAFT_CHANGED_ERROR_CODE_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/share_kind_count.py b/src/volcano_sdk/_generated/models/share_kind_count.py new file mode 100644 index 00000000..74f653aa --- /dev/null +++ b/src/volcano_sdk/_generated/models/share_kind_count.py @@ -0,0 +1,99 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.share_kind_count_kind import check_share_kind_count_kind +from ..models.share_kind_count_kind import ShareKindCountKind +from typing import cast + + + + + + +T = TypeVar("T", bound="ShareKindCount") + + + +@_attrs_define +class ShareKindCount: + """ + Attributes: + kind (ShareKindCountKind): + events (int): + visitors (int): Unique daily visitors among the events that carried one. A visitor is pseudonymised per day, so + one who returns on another day counts again. + """ + + kind: ShareKindCountKind + events: int + visitors: int + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + kind: str = self.kind + + events = self.events + + visitors = self.visitors + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "kind": kind, + "events": events, + "visitors": visitors, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + kind = check_share_kind_count_kind(d.pop("kind")) + + + + + events = d.pop("events") + + visitors = d.pop("visitors") + + share_kind_count = cls( + kind=kind, + events=events, + visitors=visitors, + ) + + + share_kind_count.additional_properties = d + return share_kind_count + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/share_kind_count_kind.py b/src/volcano_sdk/_generated/models/share_kind_count_kind.py new file mode 100644 index 00000000..427d4b57 --- /dev/null +++ b/src/volcano_sdk/_generated/models/share_kind_count_kind.py @@ -0,0 +1,10 @@ +from typing import Literal + +ShareKindCountKind = Literal['accepted', 'click', 'confirm', 'failed', 'preview', 'ready'] + +SHARE_KIND_COUNT_KIND_VALUES: set[ShareKindCountKind] = { 'accepted', 'click', 'confirm', 'failed', 'preview', 'ready', } + +def check_share_kind_count_kind(value: str) -> ShareKindCountKind: + if value in SHARE_KIND_COUNT_KIND_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {SHARE_KIND_COUNT_KIND_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/share_preview.py b/src/volcano_sdk/_generated/models/share_preview.py new file mode 100644 index 00000000..3ab31ffc --- /dev/null +++ b/src/volcano_sdk/_generated/models/share_preview.py @@ -0,0 +1,109 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast + +if TYPE_CHECKING: + from ..models.share_preview_release import SharePreviewRelease + + + + + +T = TypeVar("T", bound="SharePreview") + + + +@_attrs_define +class SharePreview: + """ + Attributes: + id (str): + suggested_name (str): A project name the link's owner suggests, for clients to offer as the default. The create + request still carries its own `name`; Volcano does not fill one in from the link. + description (str): What the project does, in the owner's words. Plain text; empty when the owner wrote none. + release (SharePreviewRelease): The release a project created from the link installs. + """ + + id: str + suggested_name: str + description: str + release: SharePreviewRelease + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.share_preview_release import SharePreviewRelease # noqa: PLC0415 + id = self.id + + suggested_name = self.suggested_name + + description = self.description + + release = self.release.to_dict() + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "id": id, + "suggested_name": suggested_name, + "description": description, + "release": release, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.share_preview_release import SharePreviewRelease # noqa: PLC0415 + d = dict(src_dict) + id = d.pop("id") + + suggested_name = d.pop("suggested_name") + + description = d.pop("description") + + release = SharePreviewRelease.from_dict(d.pop("release")) + + + + + share_preview = cls( + id=id, + suggested_name=suggested_name, + description=description, + release=release, + ) + + + share_preview.additional_properties = d + return share_preview + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/share_preview_release.py b/src/volcano_sdk/_generated/models/share_preview_release.py new file mode 100644 index 00000000..57b2814e --- /dev/null +++ b/src/volcano_sdk/_generated/models/share_preview_release.py @@ -0,0 +1,191 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.share_release_omission import ShareReleaseOmission + from ..models.share_variable import ShareVariable + + + + + +T = TypeVar("T", bound="SharePreviewRelease") + + + +@_attrs_define +class SharePreviewRelease: + """ The release a project created from the link installs. + + Attributes: + id (UUID): Send it as `release_id` in `POST /forks` to confirm this release. + published_at (datetime.datetime): + sha256 (str): The digest of the stored release archive. + frontends (list[str]): Names of the frontends installing the release creates. + functions (list[str]): Names of the functions installing the release creates. + service_key_functions (list[str]): Names of the functions that receive the new project's `VOLCANO_SERVICE_KEY`, + which bypasses row-level security. Show them to the visitor before they + confirm. Empty when no function receives it. + variables (list[ShareVariable]): The project variables the new project gets, sorted by name. A visitor may + give a value for any of them as `variables` when creating + the fork with `POST /forks`; each one left out is created empty, for the visitor to set + later. Volcano's own variables, such as `VOLCANO_API_URL`, are never + listed: the install sets them. + omissions (list[ShareReleaseOmission]): What the release does not carry. A `database` entry means the new + project starts without that database. + """ + + id: UUID + published_at: datetime.datetime + sha256: str + frontends: list[str] + functions: list[str] + service_key_functions: list[str] + variables: list[ShareVariable] + omissions: list[ShareReleaseOmission] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.share_release_omission import ShareReleaseOmission # noqa: PLC0415 + from ..models.share_variable import ShareVariable # noqa: PLC0415 + id = str(self.id) + + published_at = self.published_at.isoformat() + + sha256 = self.sha256 + + frontends = self.frontends + + + + functions = self.functions + + + + service_key_functions = self.service_key_functions + + + + variables = [] + for variables_item_data in self.variables: + variables_item = variables_item_data.to_dict() + variables.append(variables_item) + + + + omissions = [] + for omissions_item_data in self.omissions: + omissions_item = omissions_item_data.to_dict() + omissions.append(omissions_item) + + + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "id": id, + "published_at": published_at, + "sha256": sha256, + "frontends": frontends, + "functions": functions, + "service_key_functions": service_key_functions, + "variables": variables, + "omissions": omissions, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.share_release_omission import ShareReleaseOmission # noqa: PLC0415 + from ..models.share_variable import ShareVariable # noqa: PLC0415 + d = dict(src_dict) + id = UUID(d.pop("id")) + + + + + published_at = datetime.datetime.fromisoformat(d.pop("published_at")) + + + + + sha256 = d.pop("sha256") + + frontends = cast(list[str], d.pop("frontends")) + + + functions = cast(list[str], d.pop("functions")) + + + service_key_functions = cast(list[str], d.pop("service_key_functions")) + + + variables = [] + _variables = d.pop("variables") + for variables_item_data in (_variables): + variables_item = ShareVariable.from_dict(variables_item_data) + + + + variables.append(variables_item) + + + omissions = [] + _omissions = d.pop("omissions") + for omissions_item_data in (_omissions): + omissions_item = ShareReleaseOmission.from_dict(omissions_item_data) + + + + omissions.append(omissions_item) + + + share_preview_release = cls( + id=id, + published_at=published_at, + sha256=sha256, + frontends=frontends, + functions=functions, + service_key_functions=service_key_functions, + variables=variables, + omissions=omissions, + ) + + + share_preview_release.additional_properties = d + return share_preview_release + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/share_release.py b/src/volcano_sdk/_generated/models/share_release.py new file mode 100644 index 00000000..f0ff1fe5 --- /dev/null +++ b/src/volcano_sdk/_generated/models/share_release.py @@ -0,0 +1,231 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast +from uuid import UUID +import datetime + +if TYPE_CHECKING: + from ..models.share_release_function import ShareReleaseFunction + from ..models.share_release_omission import ShareReleaseOmission + from ..models.share_variable import ShareVariable + + + + + +T = TypeVar("T", bound="ShareRelease") + + + +@_attrs_define +class ShareRelease: + """ + Attributes: + id (UUID): + share_id (str): + project_id (UUID): + published_at (datetime.datetime): + published_by (str): The id of the user who published the release. + sha256 (str): The digest of the stored release archive. An install refuses an archive that does not match it. + size_bytes (int): + functions (list[ShareReleaseFunction]): + frontends (list[str]): + variables (list[ShareVariable]): + service_key_functions (list[str]): + omissions (list[ShareReleaseOmission]): + """ + + id: UUID + share_id: str + project_id: UUID + published_at: datetime.datetime + published_by: str + sha256: str + size_bytes: int + functions: list[ShareReleaseFunction] + frontends: list[str] + variables: list[ShareVariable] + service_key_functions: list[str] + omissions: list[ShareReleaseOmission] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.share_release_function import ShareReleaseFunction # noqa: PLC0415 + from ..models.share_release_omission import ShareReleaseOmission # noqa: PLC0415 + from ..models.share_variable import ShareVariable # noqa: PLC0415 + id = str(self.id) + + share_id = self.share_id + + project_id = str(self.project_id) + + published_at = self.published_at.isoformat() + + published_by = self.published_by + + sha256 = self.sha256 + + size_bytes = self.size_bytes + + functions = [] + for functions_item_data in self.functions: + functions_item = functions_item_data.to_dict() + functions.append(functions_item) + + + + frontends = self.frontends + + + + variables = [] + for variables_item_data in self.variables: + variables_item = variables_item_data.to_dict() + variables.append(variables_item) + + + + service_key_functions = self.service_key_functions + + + + omissions = [] + for omissions_item_data in self.omissions: + omissions_item = omissions_item_data.to_dict() + omissions.append(omissions_item) + + + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "id": id, + "share_id": share_id, + "project_id": project_id, + "published_at": published_at, + "published_by": published_by, + "sha256": sha256, + "size_bytes": size_bytes, + "functions": functions, + "frontends": frontends, + "variables": variables, + "service_key_functions": service_key_functions, + "omissions": omissions, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.share_release_function import ShareReleaseFunction # noqa: PLC0415 + from ..models.share_release_omission import ShareReleaseOmission # noqa: PLC0415 + from ..models.share_variable import ShareVariable # noqa: PLC0415 + d = dict(src_dict) + id = UUID(d.pop("id")) + + + + + share_id = d.pop("share_id") + + project_id = UUID(d.pop("project_id")) + + + + + published_at = datetime.datetime.fromisoformat(d.pop("published_at")) + + + + + published_by = d.pop("published_by") + + sha256 = d.pop("sha256") + + size_bytes = d.pop("size_bytes") + + functions = [] + _functions = d.pop("functions") + for functions_item_data in (_functions): + functions_item = ShareReleaseFunction.from_dict(functions_item_data) + + + + functions.append(functions_item) + + + frontends = cast(list[str], d.pop("frontends")) + + + variables = [] + _variables = d.pop("variables") + for variables_item_data in (_variables): + variables_item = ShareVariable.from_dict(variables_item_data) + + + + variables.append(variables_item) + + + service_key_functions = cast(list[str], d.pop("service_key_functions")) + + + omissions = [] + _omissions = d.pop("omissions") + for omissions_item_data in (_omissions): + omissions_item = ShareReleaseOmission.from_dict(omissions_item_data) + + + + omissions.append(omissions_item) + + + share_release = cls( + id=id, + share_id=share_id, + project_id=project_id, + published_at=published_at, + published_by=published_by, + sha256=sha256, + size_bytes=size_bytes, + functions=functions, + frontends=frontends, + variables=variables, + service_key_functions=service_key_functions, + omissions=omissions, + ) + + + share_release.additional_properties = d + return share_release + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/share_release_create_request.py b/src/volcano_sdk/_generated/models/share_release_create_request.py new file mode 100644 index 00000000..c6cd316b --- /dev/null +++ b/src/volcano_sdk/_generated/models/share_release_create_request.py @@ -0,0 +1,95 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast + + + + + + +T = TypeVar("T", bound="ShareReleaseCreateRequest") + + + +@_attrs_define +class ShareReleaseCreateRequest: + """ + Attributes: + share_id (str): The share to publish to. Its own project authorizes the publish. + draft_id (str): The `draft_id` of the draft the owner reviewed. If a fresh build of the + project is not that draft, nothing is published and the answer is `409` + `draft_changed` with the new draft. + variables (list[str]): Every name in the draft's `variables`, which a project created from the + release gets. Values are never carried: each is created empty unless the + visitor gives one. + service_key_functions (list[str]): The functions that receive the new project's `VOLCANO_SERVICE_KEY`, which + bypasses row-level security. Must be exactly the draft's + `service_key_functions`. + """ + + share_id: str + draft_id: str + variables: list[str] + service_key_functions: list[str] + + + + + + def to_dict(self) -> dict[str, Any]: + share_id = self.share_id + + draft_id = self.draft_id + + variables = self.variables + + + + service_key_functions = self.service_key_functions + + + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "share_id": share_id, + "draft_id": draft_id, + "variables": variables, + "service_key_functions": service_key_functions, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + share_id = d.pop("share_id") + + draft_id = d.pop("draft_id") + + variables = cast(list[str], d.pop("variables")) + + + service_key_functions = cast(list[str], d.pop("service_key_functions")) + + + share_release_create_request = cls( + share_id=share_id, + draft_id=draft_id, + variables=variables, + service_key_functions=service_key_functions, + ) + + return share_release_create_request + diff --git a/src/volcano_sdk/_generated/models/share_release_draft.py b/src/volcano_sdk/_generated/models/share_release_draft.py new file mode 100644 index 00000000..2f559410 --- /dev/null +++ b/src/volcano_sdk/_generated/models/share_release_draft.py @@ -0,0 +1,199 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast + +if TYPE_CHECKING: + from ..models.share_release_draft_frontend_variables import ShareReleaseDraftFrontendVariables + from ..models.share_release_function import ShareReleaseFunction + from ..models.share_release_omission import ShareReleaseOmission + from ..models.share_variable import ShareVariable + + + + + +T = TypeVar("T", bound="ShareReleaseDraft") + + + +@_attrs_define +class ShareReleaseDraft: + """ + Attributes: + draft_id (str): Opaque. Names exactly what a release built now would carry: each + function's and frontend's current deployment, and everything the draft + lists, including each function's settings (`http_auth_mode`, + `openapi_spec_sha256`, `variable_scope`), the `variables`, the + `frontend_variables` and the `omissions`. It stays the same while those + do, and changes when a function or frontend is redeployed or anything the + draft lists changes. A sandbox is not part of it, since a release does not + carry one: rebuilding only a sandbox leaves it unchanged. Send it with the + publish. + functions (list[ShareReleaseFunction]): + frontends (list[str]): + variables (list[ShareVariable]): The project's variables a visitor could be asked to supply. Volcano's own, such + as `VOLCANO_API_URL`, are never listed. + service_key_functions (list[str]): The functions whose code reads `VOLCANO_SERVICE_KEY`. A release gives them + the visitor project's service key once the owner confirms them. + omissions (list[ShareReleaseOmission]): + frontend_variables (ShareReleaseDraftFrontendVariables): The draft's variables each frontend receives, by + frontend name, as your + project's frontend of that name selects them by its variable scope now. + A frontend receives no others. + """ + + draft_id: str + functions: list[ShareReleaseFunction] + frontends: list[str] + variables: list[ShareVariable] + service_key_functions: list[str] + omissions: list[ShareReleaseOmission] + frontend_variables: ShareReleaseDraftFrontendVariables + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.share_release_draft_frontend_variables import ShareReleaseDraftFrontendVariables # noqa: PLC0415 + from ..models.share_release_function import ShareReleaseFunction # noqa: PLC0415 + from ..models.share_release_omission import ShareReleaseOmission # noqa: PLC0415 + from ..models.share_variable import ShareVariable # noqa: PLC0415 + draft_id = self.draft_id + + functions = [] + for functions_item_data in self.functions: + functions_item = functions_item_data.to_dict() + functions.append(functions_item) + + + + frontends = self.frontends + + + + variables = [] + for variables_item_data in self.variables: + variables_item = variables_item_data.to_dict() + variables.append(variables_item) + + + + service_key_functions = self.service_key_functions + + + + omissions = [] + for omissions_item_data in self.omissions: + omissions_item = omissions_item_data.to_dict() + omissions.append(omissions_item) + + + + frontend_variables = self.frontend_variables.to_dict() + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "draft_id": draft_id, + "functions": functions, + "frontends": frontends, + "variables": variables, + "service_key_functions": service_key_functions, + "omissions": omissions, + "frontend_variables": frontend_variables, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.share_release_draft_frontend_variables import ShareReleaseDraftFrontendVariables # noqa: PLC0415 + from ..models.share_release_function import ShareReleaseFunction # noqa: PLC0415 + from ..models.share_release_omission import ShareReleaseOmission # noqa: PLC0415 + from ..models.share_variable import ShareVariable # noqa: PLC0415 + d = dict(src_dict) + draft_id = d.pop("draft_id") + + functions = [] + _functions = d.pop("functions") + for functions_item_data in (_functions): + functions_item = ShareReleaseFunction.from_dict(functions_item_data) + + + + functions.append(functions_item) + + + frontends = cast(list[str], d.pop("frontends")) + + + variables = [] + _variables = d.pop("variables") + for variables_item_data in (_variables): + variables_item = ShareVariable.from_dict(variables_item_data) + + + + variables.append(variables_item) + + + service_key_functions = cast(list[str], d.pop("service_key_functions")) + + + omissions = [] + _omissions = d.pop("omissions") + for omissions_item_data in (_omissions): + omissions_item = ShareReleaseOmission.from_dict(omissions_item_data) + + + + omissions.append(omissions_item) + + + frontend_variables = ShareReleaseDraftFrontendVariables.from_dict(d.pop("frontend_variables")) + + + + + share_release_draft = cls( + draft_id=draft_id, + functions=functions, + frontends=frontends, + variables=variables, + service_key_functions=service_key_functions, + omissions=omissions, + frontend_variables=frontend_variables, + ) + + + share_release_draft.additional_properties = d + return share_release_draft + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/share_release_draft_frontend_variables.py b/src/volcano_sdk/_generated/models/share_release_draft_frontend_variables.py new file mode 100644 index 00000000..bfd27c1a --- /dev/null +++ b/src/volcano_sdk/_generated/models/share_release_draft_frontend_variables.py @@ -0,0 +1,79 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast + + + + + + +T = TypeVar("T", bound="ShareReleaseDraftFrontendVariables") + + + +@_attrs_define +class ShareReleaseDraftFrontendVariables: + """ The draft's variables each frontend receives, by frontend name, as your + project's frontend of that name selects them by its variable scope now. + A frontend receives no others. + + """ + + additional_properties: dict[str, list[str]] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + + + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + share_release_draft_frontend_variables = cls( + ) + + + additional_properties = {} + for prop_name, prop_dict in d.items(): + additional_property = cast(list[str], prop_dict) + + additional_properties[prop_name] = additional_property + + share_release_draft_frontend_variables.additional_properties = additional_properties + return share_release_draft_frontend_variables + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> list[str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: list[str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/share_release_function.py b/src/volcano_sdk/_generated/models/share_release_function.py new file mode 100644 index 00000000..b8b75853 --- /dev/null +++ b/src/volcano_sdk/_generated/models/share_release_function.py @@ -0,0 +1,174 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.share_release_function_kind import check_share_release_function_kind +from ..models.share_release_function_kind import ShareReleaseFunctionKind +from ..models.share_release_function_variable_scope import check_share_release_function_variable_scope +from ..models.share_release_function_variable_scope import ShareReleaseFunctionVariableScope +from ..types import UNSET, Unset +from typing import cast + + + + + + +T = TypeVar("T", bound="ShareReleaseFunction") + + + +@_attrs_define +class ShareReleaseFunction: + """ + Attributes: + name (str): + kind (ShareReleaseFunctionKind): + visibility (str | Unset): The function's invocation visibility, as installed. + invocation_mode (str | Unset): The function's invocation mode, when it is not the default. + http_auth_mode (str | Unset): How the function's HTTP invocations authenticate, when its invocation + settings are not the default; omitted means `volcano`. `none` lets + anyone call the function without a credential in every project made from + the release. Releases published before this was recorded omit it. + openapi_spec_sha256 (str | Unset): The SHA-256 of the function's OpenAPI document as the release carries it, + when it has one, so a draft shows when the document changed. Releases + published before this was recorded omit it. + variable_scope (ShareReleaseFunctionVariableScope | Unset): `scoped` when the function receives only the + variables it declares, as + your project's function does, listed in `variables`. Omitted when it + receives every variable shared with functions. The service key is not + part of it: `service_key_functions` says which functions receive that. + Releases published before this was recorded omit it. + variables (list[str] | Unset): For a `scoped` function, the variables it declares that a project made from the + release has. + """ + + name: str + kind: ShareReleaseFunctionKind + visibility: str | Unset = UNSET + invocation_mode: str | Unset = UNSET + http_auth_mode: str | Unset = UNSET + openapi_spec_sha256: str | Unset = UNSET + variable_scope: ShareReleaseFunctionVariableScope | Unset = UNSET + variables: list[str] | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + name = self.name + + kind: str = self.kind + + visibility = self.visibility + + invocation_mode = self.invocation_mode + + http_auth_mode = self.http_auth_mode + + openapi_spec_sha256 = self.openapi_spec_sha256 + + variable_scope: str | Unset = UNSET + if not isinstance(self.variable_scope, Unset): + variable_scope = self.variable_scope + + + variables: list[str] | Unset = UNSET + if not isinstance(self.variables, Unset): + variables = self.variables + + + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "name": name, + "kind": kind, + }) + if visibility is not UNSET: + field_dict["visibility"] = visibility + if invocation_mode is not UNSET: + field_dict["invocation_mode"] = invocation_mode + if http_auth_mode is not UNSET: + field_dict["http_auth_mode"] = http_auth_mode + if openapi_spec_sha256 is not UNSET: + field_dict["openapi_spec_sha256"] = openapi_spec_sha256 + if variable_scope is not UNSET: + field_dict["variable_scope"] = variable_scope + if variables is not UNSET: + field_dict["variables"] = variables + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + name = d.pop("name") + + kind = check_share_release_function_kind(d.pop("kind")) + + + + + visibility = d.pop("visibility", UNSET) + + invocation_mode = d.pop("invocation_mode", UNSET) + + http_auth_mode = d.pop("http_auth_mode", UNSET) + + openapi_spec_sha256 = d.pop("openapi_spec_sha256", UNSET) + + _variable_scope = d.pop("variable_scope", UNSET) + variable_scope: ShareReleaseFunctionVariableScope | Unset + if isinstance(_variable_scope, Unset): + variable_scope = UNSET + else: + variable_scope = check_share_release_function_variable_scope(_variable_scope) + + + + + variables = cast(list[str], d.pop("variables", UNSET)) + + + share_release_function = cls( + name=name, + kind=kind, + visibility=visibility, + invocation_mode=invocation_mode, + http_auth_mode=http_auth_mode, + openapi_spec_sha256=openapi_spec_sha256, + variable_scope=variable_scope, + variables=variables, + ) + + + share_release_function.additional_properties = d + return share_release_function + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/share_release_function_kind.py b/src/volcano_sdk/_generated/models/share_release_function_kind.py new file mode 100644 index 00000000..33d1156c --- /dev/null +++ b/src/volcano_sdk/_generated/models/share_release_function_kind.py @@ -0,0 +1,10 @@ +from typing import Literal + +ShareReleaseFunctionKind = Literal['durable', 'standard'] + +SHARE_RELEASE_FUNCTION_KIND_VALUES: set[ShareReleaseFunctionKind] = { 'durable', 'standard', } + +def check_share_release_function_kind(value: str) -> ShareReleaseFunctionKind: + if value in SHARE_RELEASE_FUNCTION_KIND_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {SHARE_RELEASE_FUNCTION_KIND_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/share_release_function_variable_scope.py b/src/volcano_sdk/_generated/models/share_release_function_variable_scope.py new file mode 100644 index 00000000..20b152e9 --- /dev/null +++ b/src/volcano_sdk/_generated/models/share_release_function_variable_scope.py @@ -0,0 +1,10 @@ +from typing import Literal + +ShareReleaseFunctionVariableScope = Literal['scoped'] + +SHARE_RELEASE_FUNCTION_VARIABLE_SCOPE_VALUES: set[ShareReleaseFunctionVariableScope] = { 'scoped', } + +def check_share_release_function_variable_scope(value: str) -> ShareReleaseFunctionVariableScope: + if value in SHARE_RELEASE_FUNCTION_VARIABLE_SCOPE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {SHARE_RELEASE_FUNCTION_VARIABLE_SCOPE_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/share_release_omission.py b/src/volcano_sdk/_generated/models/share_release_omission.py new file mode 100644 index 00000000..dec422dc --- /dev/null +++ b/src/volcano_sdk/_generated/models/share_release_omission.py @@ -0,0 +1,109 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.share_release_omission_kind import check_share_release_omission_kind +from ..models.share_release_omission_kind import ShareReleaseOmissionKind +from ..types import UNSET, Unset +from typing import cast + + + + + + +T = TypeVar("T", bound="ShareReleaseOmission") + + + +@_attrs_define +class ShareReleaseOmission: + """ Something a release does not carry. + + Attributes: + kind (ShareReleaseOmissionKind): `no_source`: a function or frontend whose current deployment has no stored + source to carry. `database`: a database; a visitor's project starts without + one. `sandbox`: a sandbox, which releases do not deploy. `secret_file`: a + file that may hold credentials, such as a dotenv or `.envrc` file, a tool's + token file like `.netrc` or an `.npmrc` holding a registry credential, a + private key, a credential JSON or a Terraform variables file. `unsupported_entry`: a file that is not a regular + file, + such as a symbolic link. + resource (str | Unset): The function, frontend, database or sandbox, when there is one. + path (str | Unset): The file left out, for a file. + """ + + kind: ShareReleaseOmissionKind + resource: str | Unset = UNSET + path: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + kind: str = self.kind + + resource = self.resource + + path = self.path + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "kind": kind, + }) + if resource is not UNSET: + field_dict["resource"] = resource + if path is not UNSET: + field_dict["path"] = path + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + kind = check_share_release_omission_kind(d.pop("kind")) + + + + + resource = d.pop("resource", UNSET) + + path = d.pop("path", UNSET) + + share_release_omission = cls( + kind=kind, + resource=resource, + path=path, + ) + + + share_release_omission.additional_properties = d + return share_release_omission + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/share_release_omission_kind.py b/src/volcano_sdk/_generated/models/share_release_omission_kind.py new file mode 100644 index 00000000..81c3c3f9 --- /dev/null +++ b/src/volcano_sdk/_generated/models/share_release_omission_kind.py @@ -0,0 +1,10 @@ +from typing import Literal + +ShareReleaseOmissionKind = Literal['database', 'no_source', 'sandbox', 'secret_file', 'unsupported_entry'] + +SHARE_RELEASE_OMISSION_KIND_VALUES: set[ShareReleaseOmissionKind] = { 'database', 'no_source', 'sandbox', 'secret_file', 'unsupported_entry', } + +def check_share_release_omission_kind(value: str) -> ShareReleaseOmissionKind: + if value in SHARE_RELEASE_OMISSION_KIND_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {SHARE_RELEASE_OMISSION_KIND_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/share_release_ref.py b/src/volcano_sdk/_generated/models/share_release_ref.py new file mode 100644 index 00000000..491ebd78 --- /dev/null +++ b/src/volcano_sdk/_generated/models/share_release_ref.py @@ -0,0 +1,93 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast +from uuid import UUID +import datetime + + + + + + +T = TypeVar("T", bound="ShareReleaseRef") + + + +@_attrs_define +class ShareReleaseRef: + """ + Attributes: + id (UUID): + published_at (datetime.datetime): + """ + + id: UUID + published_at: datetime.datetime + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + id = str(self.id) + + published_at = self.published_at.isoformat() + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "id": id, + "published_at": published_at, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = UUID(d.pop("id")) + + + + + published_at = datetime.datetime.fromisoformat(d.pop("published_at")) + + + + + share_release_ref = cls( + id=id, + published_at=published_at, + ) + + + share_release_ref.additional_properties = d + return share_release_ref + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/share_stats.py b/src/volcano_sdk/_generated/models/share_stats.py new file mode 100644 index 00000000..19ea9ad3 --- /dev/null +++ b/src/volcano_sdk/_generated/models/share_stats.py @@ -0,0 +1,130 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast +import datetime + +if TYPE_CHECKING: + from ..models.share_daily_count import ShareDailyCount + from ..models.share_kind_count import ShareKindCount + + + + + +T = TypeVar("T", bound="ShareStats") + + + +@_attrs_define +class ShareStats: + """ + Attributes: + since (datetime.datetime): Start of the counted window. + totals (list[ShareKindCount]): + daily (list[ShareDailyCount]): + """ + + since: datetime.datetime + totals: list[ShareKindCount] + daily: list[ShareDailyCount] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.share_daily_count import ShareDailyCount # noqa: PLC0415 + from ..models.share_kind_count import ShareKindCount # noqa: PLC0415 + since = self.since.isoformat() + + totals = [] + for totals_item_data in self.totals: + totals_item = totals_item_data.to_dict() + totals.append(totals_item) + + + + daily = [] + for daily_item_data in self.daily: + daily_item = daily_item_data.to_dict() + daily.append(daily_item) + + + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "since": since, + "totals": totals, + "daily": daily, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.share_daily_count import ShareDailyCount # noqa: PLC0415 + from ..models.share_kind_count import ShareKindCount # noqa: PLC0415 + d = dict(src_dict) + since = datetime.datetime.fromisoformat(d.pop("since")) + + + + + totals = [] + _totals = d.pop("totals") + for totals_item_data in (_totals): + totals_item = ShareKindCount.from_dict(totals_item_data) + + + + totals.append(totals_item) + + + daily = [] + _daily = d.pop("daily") + for daily_item_data in (_daily): + daily_item = ShareDailyCount.from_dict(daily_item_data) + + + + daily.append(daily_item) + + + share_stats = cls( + since=since, + totals=totals, + daily=daily, + ) + + + share_stats.additional_properties = d + return share_stats + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/share_status.py b/src/volcano_sdk/_generated/models/share_status.py new file mode 100644 index 00000000..1a149b0f --- /dev/null +++ b/src/volcano_sdk/_generated/models/share_status.py @@ -0,0 +1,10 @@ +from typing import Literal + +ShareStatus = Literal['active', 'disabled'] + +SHARE_STATUS_VALUES: set[ShareStatus] = { 'active', 'disabled', } + +def check_share_status(value: str) -> ShareStatus: + if value in SHARE_STATUS_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {SHARE_STATUS_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/share_update_request.py b/src/volcano_sdk/_generated/models/share_update_request.py new file mode 100644 index 00000000..a387c2ec --- /dev/null +++ b/src/volcano_sdk/_generated/models/share_update_request.py @@ -0,0 +1,104 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.share_update_request_status import check_share_update_request_status +from ..models.share_update_request_status import ShareUpdateRequestStatus +from ..types import UNSET, Unset +from typing import cast + + + + + + +T = TypeVar("T", bound="ShareUpdateRequest") + + + +@_attrs_define +class ShareUpdateRequest: + """ + Attributes: + suggested_name (str | Unset): + description (str | Unset): What the project does, shown to visitors before they deploy. One line of plain text + with no control characters; surrounding spaces are trimmed. Send an empty string to remove it. + allow_reshare (bool | Unset): Lets the projects made from this link be shared again by their owners. Switching + it off stops their copies, and copies of those, from sharing again, read at each request, including links of + theirs that are already on. + status (ShareUpdateRequestStatus | Unset): + """ + + suggested_name: str | Unset = UNSET + description: str | Unset = UNSET + allow_reshare: bool | Unset = UNSET + status: ShareUpdateRequestStatus | Unset = UNSET + + + + + + def to_dict(self) -> dict[str, Any]: + suggested_name = self.suggested_name + + description = self.description + + allow_reshare = self.allow_reshare + + status: str | Unset = UNSET + if not isinstance(self.status, Unset): + status = self.status + + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + }) + if suggested_name is not UNSET: + field_dict["suggested_name"] = suggested_name + if description is not UNSET: + field_dict["description"] = description + if allow_reshare is not UNSET: + field_dict["allow_reshare"] = allow_reshare + if status is not UNSET: + field_dict["status"] = status + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + suggested_name = d.pop("suggested_name", UNSET) + + description = d.pop("description", UNSET) + + allow_reshare = d.pop("allow_reshare", UNSET) + + _status = d.pop("status", UNSET) + status: ShareUpdateRequestStatus | Unset + if isinstance(_status, Unset): + status = UNSET + else: + status = check_share_update_request_status(_status) + + + + + share_update_request = cls( + suggested_name=suggested_name, + description=description, + allow_reshare=allow_reshare, + status=status, + ) + + return share_update_request + diff --git a/src/volcano_sdk/_generated/models/share_update_request_status.py b/src/volcano_sdk/_generated/models/share_update_request_status.py new file mode 100644 index 00000000..bec66fa0 --- /dev/null +++ b/src/volcano_sdk/_generated/models/share_update_request_status.py @@ -0,0 +1,10 @@ +from typing import Literal + +ShareUpdateRequestStatus = Literal['active', 'disabled'] + +SHARE_UPDATE_REQUEST_STATUS_VALUES: set[ShareUpdateRequestStatus] = { 'active', 'disabled', } + +def check_share_update_request_status(value: str) -> ShareUpdateRequestStatus: + if value in SHARE_UPDATE_REQUEST_STATUS_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {SHARE_UPDATE_REQUEST_STATUS_VALUES!r}") diff --git a/src/volcano_sdk/_generated/models/share_variable.py b/src/volcano_sdk/_generated/models/share_variable.py new file mode 100644 index 00000000..09d4b6d4 --- /dev/null +++ b/src/volcano_sdk/_generated/models/share_variable.py @@ -0,0 +1,108 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset + + + + + + +T = TypeVar("T", bound="ShareVariable") + + + +@_attrs_define +class ShareVariable: + """ A project variable a deploy link's release declares. A project created from the link always gets it. + + Attributes: + name (str): The variable's name. + required (bool): Always true: a project created from the link always gets this variable, + created empty when the visitor gives no value. It never means a value must + be given. + secret (bool): Whether to treat the value as a secret: take it masked and never show it back. Only a + `NEXT_PUBLIC_` name, which a Next.js build copies into the browser, is not secret. + unshared (bool | Unset): True when the source project gives the variable only to the scoped + functions that declare it, not to every function, and so does a project + made from the release. Omitted when false. + """ + + name: str + required: bool + secret: bool + unshared: bool | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + name = self.name + + required = self.required + + secret = self.secret + + unshared = self.unshared + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "name": name, + "required": required, + "secret": secret, + }) + if unshared is not UNSET: + field_dict["unshared"] = unshared + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + name = d.pop("name") + + required = d.pop("required") + + secret = d.pop("secret") + + unshared = d.pop("unshared", UNSET) + + share_variable = cls( + name=name, + required=required, + secret=secret, + unshared=unshared, + ) + + + share_variable.additional_properties = d + return share_variable + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/shared_variables_replace_result.py b/src/volcano_sdk/_generated/models/shared_variables_replace_result.py new file mode 100644 index 00000000..be6f1f01 --- /dev/null +++ b/src/volcano_sdk/_generated/models/shared_variables_replace_result.py @@ -0,0 +1,77 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast + +if TYPE_CHECKING: + from ..models.skipped_served_function import SkippedServedFunction + + + + + +T = TypeVar("T", bound="SharedVariablesReplaceResult") + + + +@_attrs_define +class SharedVariablesReplaceResult: + """ + Attributes: + skipped_functions (list[SkippedServedFunction]): Functions the replacement changes whose variables were not + synchronized. + """ + + skipped_functions: list[SkippedServedFunction] + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.skipped_served_function import SkippedServedFunction # noqa: PLC0415 + skipped_functions = [] + for skipped_functions_item_data in self.skipped_functions: + skipped_functions_item = skipped_functions_item_data.to_dict() + skipped_functions.append(skipped_functions_item) + + + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "skipped_functions": skipped_functions, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.skipped_served_function import SkippedServedFunction # noqa: PLC0415 + d = dict(src_dict) + skipped_functions = [] + _skipped_functions = d.pop("skipped_functions") + for skipped_functions_item_data in (_skipped_functions): + skipped_functions_item = SkippedServedFunction.from_dict(skipped_functions_item_data) + + + + skipped_functions.append(skipped_functions_item) + + + shared_variables_replace_result = cls( + skipped_functions=skipped_functions, + ) + + return shared_variables_replace_result + diff --git a/src/volcano_sdk/_generated/models/shares_response.py b/src/volcano_sdk/_generated/models/shares_response.py new file mode 100644 index 00000000..8a2a03dc --- /dev/null +++ b/src/volcano_sdk/_generated/models/shares_response.py @@ -0,0 +1,94 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast + +if TYPE_CHECKING: + from ..models.share import Share + + + + + +T = TypeVar("T", bound="SharesResponse") + + + +@_attrs_define +class SharesResponse: + """ + Attributes: + shares (list[Share]): + """ + + shares: list[Share] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.share import Share # noqa: PLC0415 + shares = [] + for shares_item_data in self.shares: + shares_item = shares_item_data.to_dict() + shares.append(shares_item) + + + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "shares": shares, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.share import Share # noqa: PLC0415 + d = dict(src_dict) + shares = [] + _shares = d.pop("shares") + for shares_item_data in (_shares): + shares_item = Share.from_dict(shares_item_data) + + + + shares.append(shares_item) + + + shares_response = cls( + shares=shares, + ) + + + shares_response.additional_properties = d + return shares_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/skipped_served_function.py b/src/volcano_sdk/_generated/models/skipped_served_function.py new file mode 100644 index 00000000..9c5f0450 --- /dev/null +++ b/src/volcano_sdk/_generated/models/skipped_served_function.py @@ -0,0 +1,88 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from uuid import UUID + + + + + + +T = TypeVar("T", bound="SkippedServedFunction") + + + +@_attrs_define +class SkippedServedFunction: + """ + Attributes: + id (UUID): Function ID. + name (str): Function name. + code (str): Why the function was left out. Clients must accept codes not listed here. + `function_served_by_candidate` - a promoted preview serves the function and keeps the + variables it was built with. + message (str): What brings the function in line. + """ + + id: UUID + name: str + code: str + message: str + + + + + + def to_dict(self) -> dict[str, Any]: + id = str(self.id) + + name = self.name + + code = self.code + + message = self.message + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "id": id, + "name": name, + "code": code, + "message": message, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = UUID(d.pop("id")) + + + + + name = d.pop("name") + + code = d.pop("code") + + message = d.pop("message") + + skipped_served_function = cls( + id=id, + name=name, + code=code, + message=message, + ) + + return skipped_served_function + diff --git a/src/volcano_sdk/_generated/models/slack_authorization_response.py b/src/volcano_sdk/_generated/models/slack_authorization_response.py new file mode 100644 index 00000000..98817995 --- /dev/null +++ b/src/volcano_sdk/_generated/models/slack_authorization_response.py @@ -0,0 +1,76 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="SlackAuthorizationResponse") + + + +@_attrs_define +class SlackAuthorizationResponse: + """ + Attributes: + authorization_url (str): The Slack page to send the browser to. + """ + + authorization_url: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + authorization_url = self.authorization_url + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "authorization_url": authorization_url, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + authorization_url = d.pop("authorization_url") + + slack_authorization_response = cls( + authorization_url=authorization_url, + ) + + + slack_authorization_response.additional_properties = d + return slack_authorization_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/slack_channel.py b/src/volcano_sdk/_generated/models/slack_channel.py new file mode 100644 index 00000000..f7d32462 --- /dev/null +++ b/src/volcano_sdk/_generated/models/slack_channel.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="SlackChannel") + + + +@_attrs_define +class SlackChannel: + """ + Attributes: + id (str): A Slack channel ID, such as `C0123ABCD`. + name (str): + is_private (bool): + """ + + id: str + name: str + is_private: bool + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + id = self.id + + name = self.name + + is_private = self.is_private + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "id": id, + "name": name, + "is_private": is_private, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + name = d.pop("name") + + is_private = d.pop("is_private") + + slack_channel = cls( + id=id, + name=name, + is_private=is_private, + ) + + + slack_channel.additional_properties = d + return slack_channel + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/slack_channels_response.py b/src/volcano_sdk/_generated/models/slack_channels_response.py new file mode 100644 index 00000000..fa6ecfd4 --- /dev/null +++ b/src/volcano_sdk/_generated/models/slack_channels_response.py @@ -0,0 +1,94 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast + +if TYPE_CHECKING: + from ..models.slack_channel import SlackChannel + + + + + +T = TypeVar("T", bound="SlackChannelsResponse") + + + +@_attrs_define +class SlackChannelsResponse: + """ + Attributes: + channels (list[SlackChannel]): + """ + + channels: list[SlackChannel] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.slack_channel import SlackChannel # noqa: PLC0415 + channels = [] + for channels_item_data in self.channels: + channels_item = channels_item_data.to_dict() + channels.append(channels_item) + + + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "channels": channels, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.slack_channel import SlackChannel # noqa: PLC0415 + d = dict(src_dict) + channels = [] + _channels = d.pop("channels") + for channels_item_data in (_channels): + channels_item = SlackChannel.from_dict(channels_item_data) + + + + channels.append(channels_item) + + + slack_channels_response = cls( + channels=channels, + ) + + + slack_channels_response.additional_properties = d + return slack_channels_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/slack_connection.py b/src/volcano_sdk/_generated/models/slack_connection.py new file mode 100644 index 00000000..ef353778 --- /dev/null +++ b/src/volcano_sdk/_generated/models/slack_connection.py @@ -0,0 +1,135 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast +from uuid import UUID +import datetime + + + + + + +T = TypeVar("T", bound="SlackConnection") + + + +@_attrs_define +class SlackConnection: + """ A Slack identity connected to the caller's Volcano account. + + Attributes: + id (UUID): + team_id (str): A Slack workspace ID, such as `T0123ABCD`. + team_name (str): The workspace's name, or empty until the Volcano app is installed in it. + slack_user_id (str): The Slack user ID Slack verified. + slack_user_name (str): The Slack user's name, as Slack gave it when the identity last connected, or empty for a + connection made before Volcano kept it. Connect the identity again to fill it. + installed (bool): Whether the Volcano app is installed in the workspace. + created_at (datetime.datetime): + """ + + id: UUID + team_id: str + team_name: str + slack_user_id: str + slack_user_name: str + installed: bool + created_at: datetime.datetime + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + id = str(self.id) + + team_id = self.team_id + + team_name = self.team_name + + slack_user_id = self.slack_user_id + + slack_user_name = self.slack_user_name + + installed = self.installed + + created_at = self.created_at.isoformat() + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "id": id, + "team_id": team_id, + "team_name": team_name, + "slack_user_id": slack_user_id, + "slack_user_name": slack_user_name, + "installed": installed, + "created_at": created_at, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = UUID(d.pop("id")) + + + + + team_id = d.pop("team_id") + + team_name = d.pop("team_name") + + slack_user_id = d.pop("slack_user_id") + + slack_user_name = d.pop("slack_user_name") + + installed = d.pop("installed") + + created_at = datetime.datetime.fromisoformat(d.pop("created_at")) + + + + + slack_connection = cls( + id=id, + team_id=team_id, + team_name=team_name, + slack_user_id=slack_user_id, + slack_user_name=slack_user_name, + installed=installed, + created_at=created_at, + ) + + + slack_connection.additional_properties = d + return slack_connection + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/slack_connections_response.py b/src/volcano_sdk/_generated/models/slack_connections_response.py new file mode 100644 index 00000000..2f727663 --- /dev/null +++ b/src/volcano_sdk/_generated/models/slack_connections_response.py @@ -0,0 +1,94 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast + +if TYPE_CHECKING: + from ..models.slack_connection import SlackConnection + + + + + +T = TypeVar("T", bound="SlackConnectionsResponse") + + + +@_attrs_define +class SlackConnectionsResponse: + """ + Attributes: + connections (list[SlackConnection]): + """ + + connections: list[SlackConnection] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.slack_connection import SlackConnection # noqa: PLC0415 + connections = [] + for connections_item_data in self.connections: + connections_item = connections_item_data.to_dict() + connections.append(connections_item) + + + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "connections": connections, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.slack_connection import SlackConnection # noqa: PLC0415 + d = dict(src_dict) + connections = [] + _connections = d.pop("connections") + for connections_item_data in (_connections): + connections_item = SlackConnection.from_dict(connections_item_data) + + + + connections.append(connections_item) + + + slack_connections_response = cls( + connections=connections, + ) + + + slack_connections_response.additional_properties = d + return slack_connections_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/slack_connector.py b/src/volcano_sdk/_generated/models/slack_connector.py new file mode 100644 index 00000000..4a1b3667 --- /dev/null +++ b/src/volcano_sdk/_generated/models/slack_connector.py @@ -0,0 +1,77 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + + + + + + + +T = TypeVar("T", bound="SlackConnector") + + + +@_attrs_define +class SlackConnector: + """ A `slack` connector's workspace. Present when `type` is `slack`. + + Attributes: + team_id (str): A Slack workspace ID, such as `T0123ABCD`. + """ + + team_id: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + team_id = self.team_id + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "team_id": team_id, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + team_id = d.pop("team_id") + + slack_connector = cls( + team_id=team_id, + ) + + + slack_connector.additional_properties = d + return slack_connector + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/volcano_sdk/_generated/models/update_auth_config_request.py b/src/volcano_sdk/_generated/models/update_auth_config_request.py index 7da93df3..5e5bb502 100644 --- a/src/volcano_sdk/_generated/models/update_auth_config_request.py +++ b/src/volcano_sdk/_generated/models/update_auth_config_request.py @@ -52,6 +52,7 @@ class UpdateAuthConfigRequest: 'http://localhost:3000']. cors_allow_credentials (bool | Unset): cors_max_age (int | Unset): + cors_allow_frontend_previews (bool | Unset): Allow the origins of the project's own live frontend previews. enable_anonymous_signins (bool | Unset): allowed_email_domains (list[str] | Unset): Replaces the email domain allowlist. Empty array removes the restriction so any domain can sign up. Entries must be bare domains @@ -79,17 +80,29 @@ class UpdateAuthConfigRequest: the same email instead of returning a conflict. Requires require_email_confirmation to be true. email_enabled (bool | Unset): Enable transactional email sending. Cannot be false while require_email_confirmation is true. - email_from_address (str | Unset): - email_from_name (str | Unset): - smtp_host (str | Unset): + email_from_address (str | Unset): Sender email address. New or changed values containing carriage returns or + newlines return 400. Unchanged stored or exported values are preserved. Leading and trailing whitespace in + previously saved settings is ignored when sending. + email_from_name (str | Unset): Sender display name; supports punctuation and Unicode. New or changed values + containing carriage returns or newlines return 400. Unchanged stored or exported values are preserved. Leading + and trailing whitespace in previously saved settings is ignored when sending. + smtp_host (str | Unset): SMTP server host name or IP address. Outside local mode, Volcano connects only to + public internet addresses, and a host that is, or resolves to, a loopback, private, link-local, or other non- + public address fails delivery. smtp_port (int | Unset): smtp_username (str | Unset): smtp_password (str | Unset): Replacement SMTP password. Omit this field to preserve the configured password. The value is encrypted at rest and never returned. smtp_use_tls (bool | Unset): - email_confirmation_subject (str | Unset): - email_password_reset_subject (str | Unset): - email_password_changed_subject (str | Unset): + email_confirmation_subject (str | Unset): Subject template. For new or changed values, literal interior carriage + returns or newlines after Go template whitespace trimming return 400. Outer whitespace and trailing block-scalar + newlines are allowed. Unchanged stored subjects are preserved. + email_password_reset_subject (str | Unset): Subject template. For new or changed values, literal interior + carriage returns or newlines after Go template whitespace trimming return 400. Outer whitespace and trailing + block-scalar newlines are allowed. Unchanged stored subjects are preserved. + email_password_changed_subject (str | Unset): Subject template. For new or changed values, literal interior + carriage returns or newlines after Go template whitespace trimming return 400. Outer whitespace and trailing + block-scalar newlines are allowed. Unchanged stored subjects are preserved. managed_auth_enabled (bool | Unset): Enable or disable managed auth hosted pages for the project. post_auth_redirect_url (str | Unset): Must be included in allowed_redirect_urls when set. allowed_redirect_urls (list[str] | Unset): Redirect allowlist. Every entry must be a valid http/https URL. @@ -121,6 +134,7 @@ class UpdateAuthConfigRequest: cors_allowed_origins: list[str] | Unset = UNSET cors_allow_credentials: bool | Unset = UNSET cors_max_age: int | Unset = UNSET + cors_allow_frontend_previews: bool | Unset = UNSET enable_anonymous_signins: bool | Unset = UNSET allowed_email_domains: list[str] | Unset = UNSET allowed_email_domains_mode: UpdateAuthConfigRequestAllowedEmailDomainsMode | Unset = UNSET @@ -199,6 +213,8 @@ def to_dict(self) -> dict[str, Any]: cors_max_age = self.cors_max_age + cors_allow_frontend_previews = self.cors_allow_frontend_previews + enable_anonymous_signins = self.enable_anonymous_signins allowed_email_domains: list[str] | Unset = UNSET @@ -307,6 +323,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["cors_allow_credentials"] = cors_allow_credentials if cors_max_age is not UNSET: field_dict["cors_max_age"] = cors_max_age + if cors_allow_frontend_previews is not UNSET: + field_dict["cors_allow_frontend_previews"] = cors_allow_frontend_previews if enable_anonymous_signins is not UNSET: field_dict["enable_anonymous_signins"] = enable_anonymous_signins if allowed_email_domains is not UNSET: @@ -408,6 +426,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: cors_max_age = d.pop("cors_max_age", UNSET) + cors_allow_frontend_previews = d.pop("cors_allow_frontend_previews", UNSET) + enable_anonymous_signins = d.pop("enable_anonymous_signins", UNSET) allowed_email_domains = cast(list[str], d.pop("allowed_email_domains", UNSET)) @@ -490,6 +510,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: cors_allowed_origins=cors_allowed_origins, cors_allow_credentials=cors_allow_credentials, cors_max_age=cors_max_age, + cors_allow_frontend_previews=cors_allow_frontend_previews, enable_anonymous_signins=enable_anonymous_signins, allowed_email_domains=allowed_email_domains, allowed_email_domains_mode=allowed_email_domains_mode, diff --git a/src/volcano_sdk/_generated/models/update_autofix_settings_request.py b/src/volcano_sdk/_generated/models/update_autofix_settings_request.py deleted file mode 100644 index 272b6b10..00000000 --- a/src/volcano_sdk/_generated/models/update_autofix_settings_request.py +++ /dev/null @@ -1,147 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - -from ..models.autofix_model import AutofixModel -from ..models.autofix_model import check_autofix_model -from ..models.autofix_provider import AutofixProvider -from ..models.autofix_provider import check_autofix_provider -from ..models.autofix_stage import AutofixStage -from ..models.autofix_stage import check_autofix_stage -from ..types import UNSET, Unset -from typing import cast - - - - - - -T = TypeVar("T", bound="UpdateAutofixSettingsRequest") - - - -@_attrs_define -class UpdateAutofixSettingsRequest: - """ - Attributes: - enabled (bool): - max_stage (AutofixStage | Unset): How far a run may go. `diagnose` stops at a root-cause diagnosis. - `pull_request` may also open a draft pull request with a fix in the project's connected repository. - auto_trigger (bool | Unset): Default: False. - provider (AutofixProvider | Unset): Who serves the model. `volcano` runs on Volcano's models. `anthropic` runs - on your own Anthropic API key. - model (AutofixModel | Unset): The Claude model a run uses. `claude-opus-5-5` is the default. - api_key (str | Unset): Your own API key for `provider`, such as an Anthropic key for `anthropic`. Omit it to - keep the stored key. Encrypted at rest and never returned. - """ - - enabled: bool - max_stage: AutofixStage | Unset = UNSET - auto_trigger: bool | Unset = False - provider: AutofixProvider | Unset = UNSET - model: AutofixModel | Unset = UNSET - api_key: str | Unset = UNSET - - - - - - def to_dict(self) -> dict[str, Any]: - enabled = self.enabled - - max_stage: str | Unset = UNSET - if not isinstance(self.max_stage, Unset): - max_stage = self.max_stage - - - auto_trigger = self.auto_trigger - - provider: str | Unset = UNSET - if not isinstance(self.provider, Unset): - provider = self.provider - - - model: str | Unset = UNSET - if not isinstance(self.model, Unset): - model = self.model - - - api_key = self.api_key - - - field_dict: dict[str, Any] = {} - - field_dict.update({ - "enabled": enabled, - }) - if max_stage is not UNSET: - field_dict["max_stage"] = max_stage - if auto_trigger is not UNSET: - field_dict["auto_trigger"] = auto_trigger - if provider is not UNSET: - field_dict["provider"] = provider - if model is not UNSET: - field_dict["model"] = model - if api_key is not UNSET: - field_dict["api_key"] = api_key - - return field_dict - - - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - enabled = d.pop("enabled") - - _max_stage = d.pop("max_stage", UNSET) - max_stage: AutofixStage | Unset - if isinstance(_max_stage, Unset): - max_stage = UNSET - else: - max_stage = check_autofix_stage(_max_stage) - - - - - auto_trigger = d.pop("auto_trigger", UNSET) - - _provider = d.pop("provider", UNSET) - provider: AutofixProvider | Unset - if isinstance(_provider, Unset): - provider = UNSET - else: - provider = check_autofix_provider(_provider) - - - - - _model = d.pop("model", UNSET) - model: AutofixModel | Unset - if isinstance(_model, Unset): - model = UNSET - else: - model = check_autofix_model(_model) - - - - - api_key = d.pop("api_key", UNSET) - - update_autofix_settings_request = cls( - enabled=enabled, - max_stage=max_stage, - auto_trigger=auto_trigger, - provider=provider, - model=model, - api_key=api_key, - ) - - return update_autofix_settings_request - diff --git a/src/volcano_sdk/_generated/models/update_email_template_request.py b/src/volcano_sdk/_generated/models/update_email_template_request.py index dc903645..ceac7294 100644 --- a/src/volcano_sdk/_generated/models/update_email_template_request.py +++ b/src/volcano_sdk/_generated/models/update_email_template_request.py @@ -23,7 +23,9 @@ class UpdateEmailTemplateRequest: """ Attributes: - subject (str | Unset): + subject (str | Unset): Subject template. For new or changed values, literal interior carriage returns or + newlines after Go template whitespace trimming return 400. Outer whitespace and trailing block-scalar newlines + are allowed. Unchanged stored subjects are preserved. html_body (str | Unset): text_body (str | Unset): """ diff --git a/src/volcano_sdk/_generated/models/update_frontend_custom_domain_request.py b/src/volcano_sdk/_generated/models/update_frontend_custom_domain_request.py new file mode 100644 index 00000000..0cda6df0 --- /dev/null +++ b/src/volcano_sdk/_generated/models/update_frontend_custom_domain_request.py @@ -0,0 +1,84 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast + +if TYPE_CHECKING: + from ..models.frontend_custom_domain_redirect_request import FrontendCustomDomainRedirectRequest + + + + + +T = TypeVar("T", bound="UpdateFrontendCustomDomainRequest") + + + +@_attrs_define +class UpdateFrontendCustomDomainRequest: + """ + Attributes: + redirect (FrontendCustomDomainRedirectRequest | None): The redirect to set, or null to make the domain serve the + frontend. + """ + + redirect: FrontendCustomDomainRedirectRequest | None + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.frontend_custom_domain_redirect_request import FrontendCustomDomainRedirectRequest # noqa: PLC0415 + redirect: dict[str, Any] | None + if isinstance(self.redirect, FrontendCustomDomainRedirectRequest): + redirect = self.redirect.to_dict() + else: + redirect = self.redirect + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "redirect": redirect, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.frontend_custom_domain_redirect_request import FrontendCustomDomainRedirectRequest # noqa: PLC0415 + d = dict(src_dict) + def _parse_redirect(data: object) -> FrontendCustomDomainRedirectRequest | None: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + redirect_type_1 = FrontendCustomDomainRedirectRequest.from_dict(data) + + + + return redirect_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(FrontendCustomDomainRedirectRequest | None, data) + + redirect = _parse_redirect(d.pop("redirect")) + + + update_frontend_custom_domain_request = cls( + redirect=redirect, + ) + + return update_frontend_custom_domain_request + diff --git a/src/volcano_sdk/_generated/models/update_issue_request.py b/src/volcano_sdk/_generated/models/update_issue_request.py index 4ac87a7c..5eba1dde 100644 --- a/src/volcano_sdk/_generated/models/update_issue_request.py +++ b/src/volcano_sdk/_generated/models/update_issue_request.py @@ -26,7 +26,9 @@ class UpdateIssueRequest: """ Attributes: status (IssueStatus): `open` until someone resolves or ignores the issue. A resolved issue - seen again reopens. + seen again reopens. A reported problem resolves when its LavaFlow fix + merges. Volcano ignores one whose report it deleted before any fix + merged, so it no longer counts toward the project's open issues. """ status: IssueStatus diff --git a/src/volcano_sdk/_generated/models/update_notification_email.py b/src/volcano_sdk/_generated/models/update_notification_email.py new file mode 100644 index 00000000..c149c6be --- /dev/null +++ b/src/volcano_sdk/_generated/models/update_notification_email.py @@ -0,0 +1,77 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset +from typing import cast + + + + + + +T = TypeVar("T", bound="UpdateNotificationEmail") + + + +@_attrs_define +class UpdateNotificationEmail: + """ + Attributes: + enabled (bool | Unset): + recipients (list[str] | Unset): Only the project owner's verified account email address is supported. An empty + list, or one naming only that address, emails the owner and is saved as an empty list. Any other list is refused + as invalid. + """ + + enabled: bool | Unset = UNSET + recipients: list[str] | Unset = UNSET + + + + + + def to_dict(self) -> dict[str, Any]: + enabled = self.enabled + + recipients: list[str] | Unset = UNSET + if not isinstance(self.recipients, Unset): + recipients = self.recipients + + + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + }) + if enabled is not UNSET: + field_dict["enabled"] = enabled + if recipients is not UNSET: + field_dict["recipients"] = recipients + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + enabled = d.pop("enabled", UNSET) + + recipients = cast(list[str], d.pop("recipients", UNSET)) + + + update_notification_email = cls( + enabled=enabled, + recipients=recipients, + ) + + return update_notification_email + diff --git a/src/volcano_sdk/_generated/models/update_notification_settings_request.py b/src/volcano_sdk/_generated/models/update_notification_settings_request.py new file mode 100644 index 00000000..5abfb2a3 --- /dev/null +++ b/src/volcano_sdk/_generated/models/update_notification_settings_request.py @@ -0,0 +1,120 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset +from typing import cast + +if TYPE_CHECKING: + from ..models.update_notification_email import UpdateNotificationEmail + from ..models.update_notification_webhook import UpdateNotificationWebhook + from ..models.update_scheduler_failure_alert_policy import UpdateSchedulerFailureAlertPolicy + + + + + +T = TypeVar("T", bound="UpdateNotificationSettingsRequest") + + + +@_attrs_define +class UpdateNotificationSettingsRequest: + """ Omitted fields keep their current values. + + Attributes: + email (UpdateNotificationEmail | Unset): + webhook (UpdateNotificationWebhook | Unset): + scheduler_failures (UpdateSchedulerFailureAlertPolicy | Unset): + """ + + email: UpdateNotificationEmail | Unset = UNSET + webhook: UpdateNotificationWebhook | Unset = UNSET + scheduler_failures: UpdateSchedulerFailureAlertPolicy | Unset = UNSET + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.update_notification_email import UpdateNotificationEmail # noqa: PLC0415 + from ..models.update_notification_webhook import UpdateNotificationWebhook # noqa: PLC0415 + from ..models.update_scheduler_failure_alert_policy import UpdateSchedulerFailureAlertPolicy # noqa: PLC0415 + email: dict[str, Any] | Unset = UNSET + if not isinstance(self.email, Unset): + email = self.email.to_dict() + + webhook: dict[str, Any] | Unset = UNSET + if not isinstance(self.webhook, Unset): + webhook = self.webhook.to_dict() + + scheduler_failures: dict[str, Any] | Unset = UNSET + if not isinstance(self.scheduler_failures, Unset): + scheduler_failures = self.scheduler_failures.to_dict() + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + }) + if email is not UNSET: + field_dict["email"] = email + if webhook is not UNSET: + field_dict["webhook"] = webhook + if scheduler_failures is not UNSET: + field_dict["scheduler_failures"] = scheduler_failures + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.update_notification_email import UpdateNotificationEmail # noqa: PLC0415 + from ..models.update_notification_webhook import UpdateNotificationWebhook # noqa: PLC0415 + from ..models.update_scheduler_failure_alert_policy import UpdateSchedulerFailureAlertPolicy # noqa: PLC0415 + d = dict(src_dict) + _email = d.pop("email", UNSET) + email: UpdateNotificationEmail | Unset + if isinstance(_email, Unset): + email = UNSET + else: + email = UpdateNotificationEmail.from_dict(_email) + + + + + _webhook = d.pop("webhook", UNSET) + webhook: UpdateNotificationWebhook | Unset + if isinstance(_webhook, Unset): + webhook = UNSET + else: + webhook = UpdateNotificationWebhook.from_dict(_webhook) + + + + + _scheduler_failures = d.pop("scheduler_failures", UNSET) + scheduler_failures: UpdateSchedulerFailureAlertPolicy | Unset + if isinstance(_scheduler_failures, Unset): + scheduler_failures = UNSET + else: + scheduler_failures = UpdateSchedulerFailureAlertPolicy.from_dict(_scheduler_failures) + + + + + update_notification_settings_request = cls( + email=email, + webhook=webhook, + scheduler_failures=scheduler_failures, + ) + + return update_notification_settings_request + diff --git a/src/volcano_sdk/_generated/models/update_notification_webhook.py b/src/volcano_sdk/_generated/models/update_notification_webhook.py new file mode 100644 index 00000000..92e9f7b2 --- /dev/null +++ b/src/volcano_sdk/_generated/models/update_notification_webhook.py @@ -0,0 +1,61 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset + + + + + + +T = TypeVar("T", bound="UpdateNotificationWebhook") + + + +@_attrs_define +class UpdateNotificationWebhook: + """ + Attributes: + url (str | Unset): An `http` or `https` URL. Surrounding whitespace is trimmed. An empty string removes the + webhook and its secret. + """ + + url: str | Unset = UNSET + + + + + + def to_dict(self) -> dict[str, Any]: + url = self.url + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + }) + if url is not UNSET: + field_dict["url"] = url + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + url = d.pop("url", UNSET) + + update_notification_webhook = cls( + url=url, + ) + + return update_notification_webhook + diff --git a/src/volcano_sdk/_generated/models/update_project_git_deploy_settings_request.py b/src/volcano_sdk/_generated/models/update_project_git_deploy_settings_request.py index 9b0a713e..d15328a1 100644 --- a/src/volcano_sdk/_generated/models/update_project_git_deploy_settings_request.py +++ b/src/volcano_sdk/_generated/models/update_project_git_deploy_settings_request.py @@ -21,20 +21,35 @@ @_attrs_define class UpdateProjectGitDeploySettingsRequest: - """ Full replace of a project's Git auto-deploy settings. + """ Full replace of a project's Git auto-deploy settings, except apply_migrations and skip_unchanged, which keep their + saved values when omitted. Attributes: auto_deploy_enabled (bool): deploy_functions (bool): - frontend_name (str | Unset): Frontend to deploy on push. Omit or empty to deploy no frontend. + frontend_name (str | Unset): Legacy frontend to deploy on push. In Git mode, explicitly send an empty string to + stop deploying the selected frontend; omit frontend_app_root too. This keeps the serving frontend and Git + handover intact. Omitting an existing selection or renaming it is refused in Git mode. In platform mode, omit or + empty to deploy no frontend. Explicit source-layout mappings are independent of this legacy selection. frontend_app_root (str | Unset): App root the frontend builds from. Requires frontend_name; omit for the repo root. + apply_migrations (bool | Unset): Apply the commit's pending migrations before each push deploys. Anyone who can + push to the production branch can then run any SQL as the database owner, so protect that branch first. Off + until set. Omit to leave the saved value unchanged. Turning it on answers `400` with code `feature_unavailable` + where the `databases.migrations` capability is unavailable; `false`, or the saved `true` sent back, is accepted + even there. While the project owner's account is `read_only`, the request answers `403` whatever it sends; an + `inactive` owner's credentials answer `401`. + skip_unchanged (bool | Unset): Leave a function or frontend on its current deployment when a push would deploy + the same code the same way. On until set. Set it to false to deploy every function and frontend on every push. + Omit to leave the saved value unchanged. """ auto_deploy_enabled: bool deploy_functions: bool frontend_name: str | Unset = UNSET frontend_app_root: str | Unset = UNSET + apply_migrations: bool | Unset = UNSET + skip_unchanged: bool | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -50,6 +65,10 @@ def to_dict(self) -> dict[str, Any]: frontend_app_root = self.frontend_app_root + apply_migrations = self.apply_migrations + + skip_unchanged = self.skip_unchanged + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -61,6 +80,10 @@ def to_dict(self) -> dict[str, Any]: field_dict["frontend_name"] = frontend_name if frontend_app_root is not UNSET: field_dict["frontend_app_root"] = frontend_app_root + if apply_migrations is not UNSET: + field_dict["apply_migrations"] = apply_migrations + if skip_unchanged is not UNSET: + field_dict["skip_unchanged"] = skip_unchanged return field_dict @@ -77,11 +100,17 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: frontend_app_root = d.pop("frontend_app_root", UNSET) + apply_migrations = d.pop("apply_migrations", UNSET) + + skip_unchanged = d.pop("skip_unchanged", UNSET) + update_project_git_deploy_settings_request = cls( auto_deploy_enabled=auto_deploy_enabled, deploy_functions=deploy_functions, frontend_name=frontend_name, frontend_app_root=frontend_app_root, + apply_migrations=apply_migrations, + skip_unchanged=skip_unchanged, ) diff --git a/src/volcano_sdk/_generated/models/update_sandbox_session_activity_body.py b/src/volcano_sdk/_generated/models/update_sandbox_session_activity_body.py new file mode 100644 index 00000000..d5188850 --- /dev/null +++ b/src/volcano_sdk/_generated/models/update_sandbox_session_activity_body.py @@ -0,0 +1,65 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from typing import cast + +if TYPE_CHECKING: + from ..models.update_sandbox_session_activity_body_activity import UpdateSandboxSessionActivityBodyActivity + + + + + +T = TypeVar("T", bound="UpdateSandboxSessionActivityBody") + + + +@_attrs_define +class UpdateSandboxSessionActivityBody: + """ + Attributes: + activity (UpdateSandboxSessionActivityBodyActivity): + """ + + activity: UpdateSandboxSessionActivityBodyActivity + + + + + + def to_dict(self) -> dict[str, Any]: + from ..models.update_sandbox_session_activity_body_activity import UpdateSandboxSessionActivityBodyActivity # noqa: PLC0415 + activity = self.activity.to_dict() + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "activity": activity, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.update_sandbox_session_activity_body_activity import UpdateSandboxSessionActivityBodyActivity # noqa: PLC0415 + d = dict(src_dict) + activity = UpdateSandboxSessionActivityBodyActivity.from_dict(d.pop("activity")) + + + + + update_sandbox_session_activity_body = cls( + activity=activity, + ) + + return update_sandbox_session_activity_body diff --git a/src/volcano_sdk/_generated/models/update_sandbox_session_activity_body_activity.py b/src/volcano_sdk/_generated/models/update_sandbox_session_activity_body_activity.py new file mode 100644 index 00000000..f062c964 --- /dev/null +++ b/src/volcano_sdk/_generated/models/update_sandbox_session_activity_body_activity.py @@ -0,0 +1,76 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..types import UNSET, Unset + + + + + + +T = TypeVar("T", bound="UpdateSandboxSessionActivityBodyActivity") + + + +@_attrs_define +class UpdateSandboxSessionActivityBodyActivity: + """ + Attributes: + sequence (int): + idle (bool): + idle_timeout_seconds (int | Unset): Seconds from acceptance of an idle report to expiry. Required when idle is + true and omitted when active. + """ + + sequence: int + idle: bool + idle_timeout_seconds: int | Unset = UNSET + + + + + + def to_dict(self) -> dict[str, Any]: + sequence = self.sequence + + idle = self.idle + + idle_timeout_seconds = self.idle_timeout_seconds + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + "sequence": sequence, + "idle": idle, + }) + if idle_timeout_seconds is not UNSET: + field_dict["idle_timeout_seconds"] = idle_timeout_seconds + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + sequence = d.pop("sequence") + + idle = d.pop("idle") + + idle_timeout_seconds = d.pop("idle_timeout_seconds", UNSET) + + update_sandbox_session_activity_body_activity = cls( + sequence=sequence, + idle=idle, + idle_timeout_seconds=idle_timeout_seconds, + ) + + return update_sandbox_session_activity_body_activity diff --git a/src/volcano_sdk/_generated/models/update_scheduler_failure_alert_policy.py b/src/volcano_sdk/_generated/models/update_scheduler_failure_alert_policy.py new file mode 100644 index 00000000..5044f08d --- /dev/null +++ b/src/volcano_sdk/_generated/models/update_scheduler_failure_alert_policy.py @@ -0,0 +1,94 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.scheduler_failure_notify_on import check_scheduler_failure_notify_on +from ..models.scheduler_failure_notify_on import SchedulerFailureNotifyOn +from ..types import UNSET, Unset +from typing import cast + + + + + + +T = TypeVar("T", bound="UpdateSchedulerFailureAlertPolicy") + + + +@_attrs_define +class UpdateSchedulerFailureAlertPolicy: + """ + Attributes: + notify_on (SchedulerFailureNotifyOn | Unset): When a failing scheduler is announced: on its first failed run, or + once `threshold` runs in a row have failed. Either way a streak is announced once, and a scheduler is announced + failing at most once an hour. + threshold (int | Unset): + notify_on_recovery (bool | Unset): + """ + + notify_on: SchedulerFailureNotifyOn | Unset = UNSET + threshold: int | Unset = UNSET + notify_on_recovery: bool | Unset = UNSET + + + + + + def to_dict(self) -> dict[str, Any]: + notify_on: str | Unset = UNSET + if not isinstance(self.notify_on, Unset): + notify_on = self.notify_on + + + threshold = self.threshold + + notify_on_recovery = self.notify_on_recovery + + + field_dict: dict[str, Any] = {} + + field_dict.update({ + }) + if notify_on is not UNSET: + field_dict["notify_on"] = notify_on + if threshold is not UNSET: + field_dict["threshold"] = threshold + if notify_on_recovery is not UNSET: + field_dict["notify_on_recovery"] = notify_on_recovery + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + _notify_on = d.pop("notify_on", UNSET) + notify_on: SchedulerFailureNotifyOn | Unset + if isinstance(_notify_on, Unset): + notify_on = UNSET + else: + notify_on = check_scheduler_failure_notify_on(_notify_on) + + + + + threshold = d.pop("threshold", UNSET) + + notify_on_recovery = d.pop("notify_on_recovery", UNSET) + + update_scheduler_failure_alert_policy = cls( + notify_on=notify_on, + threshold=threshold, + notify_on_recovery=notify_on_recovery, + ) + + return update_scheduler_failure_alert_policy +