From 7097219bf941cb045ef7713a062aa0e02329345f Mon Sep 17 00:00:00 2001 From: "kong[bot]" <123129154+kong[bot]@users.noreply.github.com> Date: Thu, 27 Aug 2026 08:28:23 +0000 Subject: [PATCH] chore(api): sync OpenAPI contract --- internal/apiclient/client.gen.go | 1111 ++++++++++++++++++++++-------- openapi/openapi.yaml | 500 +++++++++++--- 2 files changed, 1206 insertions(+), 405 deletions(-) diff --git a/internal/apiclient/client.gen.go b/internal/apiclient/client.gen.go index 8eb0f96..19b6fd0 100644 --- a/internal/apiclient/client.gen.go +++ b/internal/apiclient/client.gen.go @@ -2074,6 +2074,30 @@ func (e ProjectMetricsUnit) Valid() bool { } } +// Defines values for ProjectSourceExportStateMode. +const ( + ProjectSourceExportStateModeGit ProjectSourceExportStateMode = "git" + ProjectSourceExportStateModeGitExporting ProjectSourceExportStateMode = "git_exporting" + ProjectSourceExportStateModeGitPending ProjectSourceExportStateMode = "git_pending" + ProjectSourceExportStateModePlatform ProjectSourceExportStateMode = "platform" +) + +// Valid indicates whether the value is a known member of the ProjectSourceExportStateMode enum. +func (e ProjectSourceExportStateMode) Valid() bool { + switch e { + case ProjectSourceExportStateModeGit: + return true + case ProjectSourceExportStateModeGitExporting: + return true + case ProjectSourceExportStateModeGitPending: + return true + case ProjectSourceExportStateModePlatform: + return true + default: + return false + } +} + // Defines values for ResourceReferenceType. const ( ResourceReferenceTypeDatabase ResourceReferenceType = "database" @@ -2232,28 +2256,28 @@ func (e UploadSessionStatusResponseStatus) Valid() bool { // Defines values for VariableDeploySource. const ( - Api VariableDeploySource = "api" - Cli VariableDeploySource = "cli" - Git VariableDeploySource = "git" - System VariableDeploySource = "system" - Unknown VariableDeploySource = "unknown" - Web VariableDeploySource = "web" + VariableDeploySourceApi VariableDeploySource = "api" + VariableDeploySourceCli VariableDeploySource = "cli" + VariableDeploySourceGit VariableDeploySource = "git" + VariableDeploySourceSystem VariableDeploySource = "system" + VariableDeploySourceUnknown VariableDeploySource = "unknown" + VariableDeploySourceWeb VariableDeploySource = "web" ) // Valid indicates whether the value is a known member of the VariableDeploySource enum. func (e VariableDeploySource) Valid() bool { switch e { - case Api: + case VariableDeploySourceApi: return true - case Cli: + case VariableDeploySourceCli: return true - case Git: + case VariableDeploySourceGit: return true - case System: + case VariableDeploySourceSystem: return true - case Unknown: + case VariableDeploySourceUnknown: return true - case Web: + case VariableDeploySourceWeb: return true default: return false @@ -2964,16 +2988,16 @@ func (e ListUserSessionsParamsSort) Valid() bool { // Defines values for ListUserSessionsParamsStatus. const ( - Active ListUserSessionsParamsStatus = "active" - Expired ListUserSessionsParamsStatus = "expired" + ListUserSessionsParamsStatusActive ListUserSessionsParamsStatus = "active" + ListUserSessionsParamsStatusExpired ListUserSessionsParamsStatus = "expired" ) // Valid indicates whether the value is a known member of the ListUserSessionsParamsStatus enum. func (e ListUserSessionsParamsStatus) Valid() bool { switch e { - case Active: + case ListUserSessionsParamsStatusActive: return true - case Expired: + case ListUserSessionsParamsStatusExpired: return true default: return false @@ -2998,6 +3022,33 @@ func (e GetProjectConfigParamsFormat) Valid() bool { } } +// Defines values for ListDatabasesParamsStatus. +const ( + ListDatabasesParamsStatusActive ListDatabasesParamsStatus = "active" + ListDatabasesParamsStatusDeleting ListDatabasesParamsStatus = "deleting" + ListDatabasesParamsStatusFailed ListDatabasesParamsStatus = "failed" + ListDatabasesParamsStatusProvisioning ListDatabasesParamsStatus = "provisioning" + ListDatabasesParamsStatusRestoring ListDatabasesParamsStatus = "restoring" +) + +// Valid indicates whether the value is a known member of the ListDatabasesParamsStatus enum. +func (e ListDatabasesParamsStatus) Valid() bool { + switch e { + case ListDatabasesParamsStatusActive: + return true + case ListDatabasesParamsStatusDeleting: + return true + case ListDatabasesParamsStatusFailed: + return true + case ListDatabasesParamsStatusProvisioning: + return true + case ListDatabasesParamsStatusRestoring: + return true + default: + return false + } +} + // Defines values for GetDatabaseStatsParamsGranularity. const ( Daily GetDatabaseStatsParamsGranularity = "daily" @@ -3841,7 +3892,12 @@ type CreateDatabaseRequestRegion string // CreateDatabaseRestoreRequest Names what to restore. Supply exactly one of `backup_name` or // `restore_to`. type CreateDatabaseRestoreRequest struct { - // BackupName A backup of this database to restore. + // BackupName 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. BackupName *string `json:"backup_name,omitempty"` // RestoreTo A point in time to restore to, which must fall inside the @@ -3907,27 +3963,6 @@ type CreateOAuthConfigRequest struct { // CreateOAuthConfigRequestProvider defines model for CreateOAuthConfigRequest.Provider. type CreateOAuthConfigRequestProvider string -// CreateProjectGitRepositoryRequest defines model for CreateProjectGitRepositoryRequest. -type CreateProjectGitRepositoryRequest struct { - // Description Repository description shown on GitHub. - Description *string `json:"description,omitempty"` - - // Name Repository name, unique within the owner account. - Name string `json:"name"` - - // Owner GitHub account to create the repository under, as returned in account_login by /user/git/connections/{id}/installations. Omit for the connected user's own account. Must be an organization the app is installed on, or your own account. - Owner *string `json:"owner,omitempty"` - - // Private Whether the new repository is private. Defaults to true: the next step is pushing the project's source into it, so an omitted field must not publish it. - Private *bool `json:"private,omitempty"` - - // ProductionBranch The branch to deploy from — name the one you are about to push. The repository is created empty, so it has no real default branch to follow: omitting this binds whatever branch name GitHub reports for the new repository (falling back to "main" if it reports none), which is the account's configured default and a prediction, and pushing anything else then deploys nothing. Naming the branch GitHub already reports is not treated as pinning it, so the project still tracks a later default-branch rename; naming any other branch pins it. Rejected before the repository is created if it is not a valid Git branch name; it does not have to exist. - ProductionBranch *string `json:"production_branch,omitempty"` - - // RootDirectory Monorepo subdirectory the project builds from, as a relative path inside the repository. Omit for the repo root. Absolute paths and ".." traversal are rejected before the repository is created, because the build applies the same rule and nothing would deploy. - RootDirectory *string `json:"root_directory,omitempty"` -} - // CreateProjectRequest Request to create a new project type CreateProjectRequest struct { // AllRegions Optional region policy. @@ -4007,16 +4042,6 @@ type CreateVariableRequest struct { Value string `json:"value"` } -// CreatedProjectGitConnection A newly created repository's project binding, plus whether the Volcano GitHub App can actually see it. -type CreatedProjectGitConnection struct { - // AppInstalled Whether the App installation covers the new repository. False means the binding is complete but no push will deploy until the user grants access at install_url. An installation scoped to selected repositories never picks up a new repo on its own. - AppInstalled bool `json:"app_installed"` - Connection ProjectGitConnection `json:"connection"` - - // InstallUrl Where the user grants the App access to the new repository. Present only when app_installed is false. - InstallUrl *string `json:"install_url,omitempty"` -} - // Database PostgreSQL database with automatic scalability and security features. type Database struct { // ConnectionString Secure PostgreSQL connection URI for your database. @@ -4116,8 +4141,12 @@ type DatabaseBackupSource string type DatabaseBackupList struct { Data []DatabaseBackup `json:"data"` - // RestoreWindow The span a point-in-time restore may target. Empty when the owner's plan - // does not include point-in-time restore. + // RestoreWindow 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. RestoreWindow *DatabaseRestoreWindow `json:"restore_window,omitempty"` } @@ -4421,8 +4450,12 @@ type DatabaseRestoreList struct { Data []DatabaseRestore `json:"data"` } -// DatabaseRestoreWindow The span a point-in-time restore may target. Empty when the owner's plan -// does not include point-in-time restore. +// DatabaseRestoreWindow 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. type DatabaseRestoreWindow struct { // EarliestRestoreAt The oldest point that can still be restored. Moves forward // continuously as history ages out, so treat it as a lower bound at @@ -4601,6 +4634,12 @@ type Error struct { Error string `json:"error"` } +// ExportProjectSourceRequest defines model for ExportProjectSourceRequest. +type ExportProjectSourceRequest struct { + // ProductionBranch The currently configured production branch the user confirmed for export. + ProductionBranch string `json:"production_branch"` +} + // Frontend defines model for Frontend. type Frontend struct { // AppRoot Optional relative POSIX path from the uploaded archive root to the Next.js app that is deployed. @@ -6652,6 +6691,55 @@ type ProjectMetricsWindow struct { To time.Time `json:"to"` } +// ProjectSourceExport The initial production-branch commit, and everything export could not carry. +type ProjectSourceExport struct { + // Branch The production branch that was created. + Branch string `json:"branch"` + CommitSha string `json:"commit_sha"` + FileCount int `json:"file_count"` + + // Omitted Things deliberately left out of the branch. + Omitted []ProjectSourceExportOmission `json:"omitted"` + RepoFullName string `json:"repo_full_name"` + + // Skipped Resources whose source could not be taken, with the reason. Most often a resource that has never deployed successfully. + Skipped []ProjectSourceExportSkip `json:"skipped"` +} + +// ProjectSourceExportOmission defines model for ProjectSourceExportOmission. +type ProjectSourceExportOmission struct { + // Kind 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. + Kind string `json:"kind"` + Path string `json:"path"` + + // Resource The resource it came from, empty when project-wide. + Resource string `json:"resource"` +} + +// ProjectSourceExportSkip defines model for ProjectSourceExportSkip. +type ProjectSourceExportSkip struct { + // Kind 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. + Kind string `json:"kind"` + Name string `json:"name"` + Reason string `json:"reason"` +} + +// ProjectSourceExportState The project's source of truth and any pending Git transition. +type ProjectSourceExportState struct { + // ExportedAt 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. + ExportedAt *time.Time `json:"exported_at"` + + // HandedOverAt 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. + HandedOverAt *time.Time `json:"handed_over_at"` + Mode ProjectSourceExportStateMode `json:"mode"` + + // TransitionStartedAt When source export started, cleared if an incomplete transition is canceled. + TransitionStartedAt *time.Time `json:"transition_started_at"` +} + +// ProjectSourceExportStateMode defines model for ProjectSourceExportState.Mode. +type ProjectSourceExportStateMode string + // ProjectUsageResponse Aggregated usage metrics for a project. type ProjectUsageResponse struct { // Frontends Per-frontend request totals for the current usage month @@ -7356,6 +7444,9 @@ type VariableName = string // BandwidthCapExceeded defines model for BandwidthCapExceeded. type BandwidthCapExceeded = Error +// DatabaseBranchQueryUnavailable defines model for DatabaseBranchQueryUnavailable. +type DatabaseBranchQueryUnavailable = Error + // DatabaseQueryCapExceeded defines model for DatabaseQueryCapExceeded. type DatabaseQueryCapExceeded = Error @@ -8098,8 +8189,14 @@ type ListDatabasesParams struct { // Search Case-insensitive substring match on the resource `name`. See the // endpoint description for supported pagination modes. Search *Search `form:"search,omitempty" json:"search,omitempty"` + + // Status Return only the databases in this status. + Status *ListDatabasesParamsStatus `form:"status,omitempty" json:"status,omitempty"` } +// ListDatabasesParamsStatus defines parameters for ListDatabases. +type ListDatabasesParamsStatus string + // GetProjectDatabaseQueriesParams defines parameters for GetProjectDatabaseQueries. type GetProjectDatabaseQueriesParams struct { // Limit Maximum number of queries to return. @@ -8891,9 +8988,6 @@ type ConnectProjectGitJSONRequestBody = ConnectProjectGitRequest // SetProjectGitProductionBranchJSONRequestBody defines body for SetProjectGitProductionBranch for application/json ContentType. type SetProjectGitProductionBranchJSONRequestBody = SetProjectGitProductionBranchRequest -// CreateProjectGitRepositoryJSONRequestBody defines body for CreateProjectGitRepository for application/json ContentType. -type CreateProjectGitRepositoryJSONRequestBody = CreateProjectGitRepositoryRequest - // UpdateProjectGitDeploySettingsJSONRequestBody defines body for UpdateProjectGitDeploySettings for application/json ContentType. type UpdateProjectGitDeploySettingsJSONRequestBody = UpdateProjectGitDeploySettingsRequest @@ -8924,6 +9018,9 @@ type UpdateRealtimeConfigJSONRequestBody = UpdateRealtimeConfigRequest // CreateServiceKeyJSONRequestBody defines body for CreateServiceKey for application/json ContentType. type CreateServiceKeyJSONRequestBody CreateServiceKeyJSONBody +// ExportProjectSourceJSONRequestBody defines body for ExportProjectSource for application/json ContentType. +type ExportProjectSourceJSONRequestBody = ExportProjectSourceRequest + // CreateStorageBucketJSONRequestBody defines body for CreateStorageBucket for application/json ContentType. type CreateStorageBucketJSONRequestBody = CreateStorageBucketRequest @@ -10340,11 +10437,6 @@ type ClientInterface interface { SetProjectGitProductionBranch(ctx context.Context, id ProjectId, body SetProjectGitProductionBranchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // CreateProjectGitRepositoryWithBody request with any body - CreateProjectGitRepositoryWithBody(ctx context.Context, id ProjectId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - CreateProjectGitRepository(ctx context.Context, id ProjectId, body CreateProjectGitRepositoryJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetProjectGitDeploySettings request GetProjectGitDeploySettings(ctx context.Context, id ProjectId, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -10438,6 +10530,17 @@ type ClientInterface interface { // RegenerateServiceKey request RegenerateServiceKey(ctx context.Context, id ProjectId, keyId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) + // CancelProjectSourceExport request + CancelProjectSourceExport(ctx context.Context, id ProjectId, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetProjectSourceExport request + GetProjectSourceExport(ctx context.Context, id ProjectId, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ExportProjectSourceWithBody request with any body + ExportProjectSourceWithBody(ctx context.Context, id ProjectId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + ExportProjectSource(ctx context.Context, id ProjectId, body ExportProjectSourceJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // ListStorageBuckets request ListStorageBuckets(ctx context.Context, id ProjectId, params *ListStorageBucketsParams, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -13136,30 +13239,6 @@ func (c *Client) SetProjectGitProductionBranch(ctx context.Context, id ProjectId return c.Client.Do(req) } -func (c *Client) CreateProjectGitRepositoryWithBody(ctx context.Context, id ProjectId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateProjectGitRepositoryRequestWithBody(c.Server, id, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) CreateProjectGitRepository(ctx context.Context, id ProjectId, body CreateProjectGitRepositoryJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateProjectGitRepositoryRequest(c.Server, id, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - func (c *Client) GetProjectGitDeploySettings(ctx context.Context, id ProjectId, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetProjectGitDeploySettingsRequest(c.Server, id) if err != nil { @@ -13568,6 +13647,54 @@ func (c *Client) RegenerateServiceKey(ctx context.Context, id ProjectId, keyId o return c.Client.Do(req) } +func (c *Client) CancelProjectSourceExport(ctx context.Context, id ProjectId, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCancelProjectSourceExportRequest(c.Server, id) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetProjectSourceExport(ctx context.Context, id ProjectId, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetProjectSourceExportRequest(c.Server, id) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) ExportProjectSourceWithBody(ctx context.Context, id ProjectId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewExportProjectSourceRequestWithBody(c.Server, id, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) ExportProjectSource(ctx context.Context, id ProjectId, body ExportProjectSourceJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewExportProjectSourceRequest(c.Server, id, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + func (c *Client) ListStorageBuckets(ctx context.Context, id ProjectId, params *ListStorageBucketsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewListStorageBucketsRequest(c.Server, id, params) if err != nil { @@ -19293,6 +19420,18 @@ func NewListDatabasesRequest(server string, id ProjectId, params *ListDatabasesP } + if params.Status != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "status", *params.Status, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } @@ -22419,53 +22558,6 @@ func NewSetProjectGitProductionBranchRequestWithBody(server string, id ProjectId return req, nil } -// NewCreateProjectGitRepositoryRequest calls the generic CreateProjectGitRepository builder with application/json body -func NewCreateProjectGitRepositoryRequest(server string, id ProjectId, body CreateProjectGitRepositoryJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewCreateProjectGitRepositoryRequestWithBody(server, id, "application/json", bodyReader) -} - -// NewCreateProjectGitRepositoryRequestWithBody generates requests for CreateProjectGitRepository with any type of body -func NewCreateProjectGitRepositoryRequestWithBody(server string, id ProjectId, contentType string, body io.Reader) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "uuid"}) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/projects/%s/git-connection/repository", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - // NewGetProjectGitDeploySettingsRequest generates requests for GetProjectGitDeploySettings func NewGetProjectGitDeploySettingsRequest(server string, id ProjectId) (*http.Request, error) { var err error @@ -23774,6 +23866,121 @@ func NewRegenerateServiceKeyRequest(server string, id ProjectId, keyId openapi_t return req, nil } +// NewCancelProjectSourceExportRequest generates requests for CancelProjectSourceExport +func NewCancelProjectSourceExportRequest(server string, id ProjectId) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "uuid"}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/projects/%s/source-export", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetProjectSourceExportRequest generates requests for GetProjectSourceExport +func NewGetProjectSourceExportRequest(server string, id ProjectId) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "uuid"}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/projects/%s/source-export", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewExportProjectSourceRequest calls the generic ExportProjectSource builder with application/json body +func NewExportProjectSourceRequest(server string, id ProjectId, body ExportProjectSourceJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewExportProjectSourceRequestWithBody(server, id, "application/json", bodyReader) +} + +// NewExportProjectSourceRequestWithBody generates requests for ExportProjectSource with any type of body +func NewExportProjectSourceRequestWithBody(server string, id ProjectId, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "uuid"}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/projects/%s/source-export", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + // NewListStorageBucketsRequest generates requests for ListStorageBuckets func NewListStorageBucketsRequest(server string, id ProjectId, params *ListStorageBucketsParams) (*http.Request, error) { var err error @@ -26223,11 +26430,6 @@ type ClientWithResponsesInterface interface { SetProjectGitProductionBranchWithResponse(ctx context.Context, id ProjectId, body SetProjectGitProductionBranchJSONRequestBody, reqEditors ...RequestEditorFn) (*SetProjectGitProductionBranchClientResponse, error) - // CreateProjectGitRepositoryWithBodyWithResponse request with any body - CreateProjectGitRepositoryWithBodyWithResponse(ctx context.Context, id ProjectId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateProjectGitRepositoryClientResponse, error) - - CreateProjectGitRepositoryWithResponse(ctx context.Context, id ProjectId, body CreateProjectGitRepositoryJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateProjectGitRepositoryClientResponse, error) - // GetProjectGitDeploySettingsWithResponse request GetProjectGitDeploySettingsWithResponse(ctx context.Context, id ProjectId, reqEditors ...RequestEditorFn) (*GetProjectGitDeploySettingsClientResponse, error) @@ -26321,6 +26523,17 @@ type ClientWithResponsesInterface interface { // RegenerateServiceKeyWithResponse request RegenerateServiceKeyWithResponse(ctx context.Context, id ProjectId, keyId openapi_types.UUID, reqEditors ...RequestEditorFn) (*RegenerateServiceKeyClientResponse, error) + // CancelProjectSourceExportWithResponse request + CancelProjectSourceExportWithResponse(ctx context.Context, id ProjectId, reqEditors ...RequestEditorFn) (*CancelProjectSourceExportClientResponse, error) + + // GetProjectSourceExportWithResponse request + GetProjectSourceExportWithResponse(ctx context.Context, id ProjectId, reqEditors ...RequestEditorFn) (*GetProjectSourceExportClientResponse, error) + + // ExportProjectSourceWithBodyWithResponse request with any body + ExportProjectSourceWithBodyWithResponse(ctx context.Context, id ProjectId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ExportProjectSourceClientResponse, error) + + ExportProjectSourceWithResponse(ctx context.Context, id ProjectId, body ExportProjectSourceJSONRequestBody, reqEditors ...RequestEditorFn) (*ExportProjectSourceClientResponse, error) + // ListStorageBucketsWithResponse request ListStorageBucketsWithResponse(ctx context.Context, id ProjectId, params *ListStorageBucketsParams, reqEditors ...RequestEditorFn) (*ListStorageBucketsClientResponse, error) @@ -27727,6 +27940,7 @@ type QueryDatabaseBranchDeleteClientResponse struct { JSON403 *Error JSON404 *Error JSON429 *DatabaseQueryCapExceeded + JSON503 *DatabaseBranchQueryUnavailable } // Status returns HTTPResponse.Status @@ -27762,6 +27976,7 @@ type QueryDatabaseBranchInsertClientResponse struct { JSON403 *Error JSON404 *Error JSON429 *DatabaseQueryCapExceeded + JSON503 *DatabaseBranchQueryUnavailable } // Status returns HTTPResponse.Status @@ -27796,6 +28011,7 @@ type QueryDatabaseBranchPingClientResponse struct { JSON403 *Error JSON404 *Error JSON429 *DatabaseQueryCapExceeded + JSON503 *DatabaseBranchQueryUnavailable } // Status returns HTTPResponse.Status @@ -27831,6 +28047,7 @@ type QueryDatabaseBranchSelectClientResponse struct { JSON403 *Error JSON404 *Error JSON429 *DatabaseQueryCapExceeded + JSON503 *DatabaseBranchQueryUnavailable } // Status returns HTTPResponse.Status @@ -27866,6 +28083,7 @@ type QueryDatabaseBranchUpdateClientResponse struct { JSON403 *Error JSON404 *Error JSON429 *DatabaseQueryCapExceeded + JSON503 *DatabaseBranchQueryUnavailable } // Status returns HTTPResponse.Status @@ -29854,6 +30072,7 @@ type DeleteDatabaseClientResponse struct { } JSON404 *Error JSON409 *Error + JSON503 *Error } // Status returns HTTPResponse.Status @@ -30405,6 +30624,7 @@ type ResetDatabasePasswordClientResponse struct { JSON400 *Error JSON404 *Error JSON409 *Error + JSON503 *Error } // Status returns HTTPResponse.Status @@ -30570,6 +30790,7 @@ type UpdateDatabaseTypeClientResponse struct { HTTPResponse *http.Response JSON200 *Database JSON409 *Error + JSON503 *Error } // Status returns HTTPResponse.Status @@ -31589,6 +31810,7 @@ type DisconnectProjectGitClientResponse struct { JSON401 *Error JSON403 *Error JSON404 *Error + JSON409 *Error JSON500 *Error } @@ -31658,6 +31880,7 @@ type ConnectProjectGitClientResponse struct { JSON401 *Error JSON403 *Error JSON404 *Error + JSON409 *Error JSON500 *Error JSON503 *Error } @@ -31694,6 +31917,7 @@ type SetProjectGitProductionBranchClientResponse struct { JSON401 *Error JSON403 *Error JSON404 *Error + JSON409 *Error JSON500 *Error } @@ -31721,45 +31945,6 @@ func (r SetProjectGitProductionBranchClientResponse) ContentType() string { return "" } -type CreateProjectGitRepositoryClientResponse struct { - Body []byte - HTTPResponse *http.Response - JSON201 *CreatedProjectGitConnection - JSON400 *Error - JSON401 *Error - JSON403 *Error - JSON404 *Error - JSON409 *Error - JSON422 *Error - JSON429 *Error - JSON500 *Error - JSON503 *Error -} - -// Status returns HTTPResponse.Status -func (r CreateProjectGitRepositoryClientResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r CreateProjectGitRepositoryClientResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r CreateProjectGitRepositoryClientResponse) ContentType() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Header.Get("Content-Type") - } - return "" -} - type GetProjectGitDeploySettingsClientResponse struct { Body []byte HTTPResponse *http.Response @@ -31802,6 +31987,7 @@ type UpdateProjectGitDeploySettingsClientResponse struct { JSON401 *Error JSON403 *Error JSON404 *Error + JSON409 *Error JSON500 *Error } @@ -32561,6 +32747,116 @@ func (r RegenerateServiceKeyClientResponse) ContentType() string { return "" } +type CancelProjectSourceExportClientResponse struct { + Body []byte + HTTPResponse *http.Response + JSON401 *Error + JSON403 *Error + JSON404 *Error + JSON409 *Error + JSON500 *Error + JSON501 *Error +} + +// Status returns HTTPResponse.Status +func (r CancelProjectSourceExportClientResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r CancelProjectSourceExportClientResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r CancelProjectSourceExportClientResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type GetProjectSourceExportClientResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *ProjectSourceExportState + JSON401 *Error + JSON403 *Error + JSON404 *Error + JSON500 *Error + JSON501 *Error +} + +// Status returns HTTPResponse.Status +func (r GetProjectSourceExportClientResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetProjectSourceExportClientResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r GetProjectSourceExportClientResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type ExportProjectSourceClientResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *ProjectSourceExport + JSON400 *Error + JSON401 *Error + JSON403 *Error + JSON404 *Error + JSON409 *Error + JSON422 *Error + JSON429 *Error + JSON500 *Error + JSON501 *Error + JSON503 *Error +} + +// Status returns HTTPResponse.Status +func (r ExportProjectSourceClientResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ExportProjectSourceClientResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r ExportProjectSourceClientResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + type ListStorageBucketsClientResponse struct { Body []byte HTTPResponse *http.Response @@ -35483,23 +35779,6 @@ func (c *ClientWithResponses) SetProjectGitProductionBranchWithResponse(ctx cont return ParseSetProjectGitProductionBranchClientResponse(rsp) } -// CreateProjectGitRepositoryWithBodyWithResponse request with arbitrary body returning *CreateProjectGitRepositoryClientResponse -func (c *ClientWithResponses) CreateProjectGitRepositoryWithBodyWithResponse(ctx context.Context, id ProjectId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateProjectGitRepositoryClientResponse, error) { - rsp, err := c.CreateProjectGitRepositoryWithBody(ctx, id, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseCreateProjectGitRepositoryClientResponse(rsp) -} - -func (c *ClientWithResponses) CreateProjectGitRepositoryWithResponse(ctx context.Context, id ProjectId, body CreateProjectGitRepositoryJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateProjectGitRepositoryClientResponse, error) { - rsp, err := c.CreateProjectGitRepository(ctx, id, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseCreateProjectGitRepositoryClientResponse(rsp) -} - // GetProjectGitDeploySettingsWithResponse request returning *GetProjectGitDeploySettingsClientResponse func (c *ClientWithResponses) GetProjectGitDeploySettingsWithResponse(ctx context.Context, id ProjectId, reqEditors ...RequestEditorFn) (*GetProjectGitDeploySettingsClientResponse, error) { rsp, err := c.GetProjectGitDeploySettings(ctx, id, reqEditors...) @@ -35797,6 +36076,41 @@ func (c *ClientWithResponses) RegenerateServiceKeyWithResponse(ctx context.Conte return ParseRegenerateServiceKeyClientResponse(rsp) } +// CancelProjectSourceExportWithResponse request returning *CancelProjectSourceExportClientResponse +func (c *ClientWithResponses) CancelProjectSourceExportWithResponse(ctx context.Context, id ProjectId, reqEditors ...RequestEditorFn) (*CancelProjectSourceExportClientResponse, error) { + rsp, err := c.CancelProjectSourceExport(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParseCancelProjectSourceExportClientResponse(rsp) +} + +// GetProjectSourceExportWithResponse request returning *GetProjectSourceExportClientResponse +func (c *ClientWithResponses) GetProjectSourceExportWithResponse(ctx context.Context, id ProjectId, reqEditors ...RequestEditorFn) (*GetProjectSourceExportClientResponse, error) { + rsp, err := c.GetProjectSourceExport(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetProjectSourceExportClientResponse(rsp) +} + +// ExportProjectSourceWithBodyWithResponse request with arbitrary body returning *ExportProjectSourceClientResponse +func (c *ClientWithResponses) ExportProjectSourceWithBodyWithResponse(ctx context.Context, id ProjectId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ExportProjectSourceClientResponse, error) { + rsp, err := c.ExportProjectSourceWithBody(ctx, id, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseExportProjectSourceClientResponse(rsp) +} + +func (c *ClientWithResponses) ExportProjectSourceWithResponse(ctx context.Context, id ProjectId, body ExportProjectSourceJSONRequestBody, reqEditors ...RequestEditorFn) (*ExportProjectSourceClientResponse, error) { + rsp, err := c.ExportProjectSource(ctx, id, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseExportProjectSourceClientResponse(rsp) +} + // ListStorageBucketsWithResponse request returning *ListStorageBucketsClientResponse func (c *ClientWithResponses) ListStorageBucketsWithResponse(ctx context.Context, id ProjectId, params *ListStorageBucketsParams, reqEditors ...RequestEditorFn) (*ListStorageBucketsClientResponse, error) { rsp, err := c.ListStorageBuckets(ctx, id, params, reqEditors...) @@ -37673,6 +37987,13 @@ func ParseQueryDatabaseBranchDeleteClientResponse(rsp *http.Response) (*QueryDat } response.JSON429 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + var dest DatabaseBranchQueryUnavailable + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON503 = &dest + } return response, nil @@ -37734,6 +38055,13 @@ func ParseQueryDatabaseBranchInsertClientResponse(rsp *http.Response) (*QueryDat } response.JSON429 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + var dest DatabaseBranchQueryUnavailable + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON503 = &dest + } return response, nil @@ -37788,6 +38116,13 @@ func ParseQueryDatabaseBranchPingClientResponse(rsp *http.Response) (*QueryDatab } response.JSON429 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + var dest DatabaseBranchQueryUnavailable + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON503 = &dest + } return response, nil @@ -37849,6 +38184,13 @@ func ParseQueryDatabaseBranchSelectClientResponse(rsp *http.Response) (*QueryDat } response.JSON429 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + var dest DatabaseBranchQueryUnavailable + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON503 = &dest + } return response, nil @@ -37910,6 +38252,13 @@ func ParseQueryDatabaseBranchUpdateClientResponse(rsp *http.Response) (*QueryDat } response.JSON429 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + var dest DatabaseBranchQueryUnavailable + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON503 = &dest + } return response, nil @@ -40381,6 +40730,13 @@ func ParseDeleteDatabaseClientResponse(rsp *http.Response) (*DeleteDatabaseClien } response.JSON409 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON503 = &dest + } return response, nil @@ -41198,6 +41554,13 @@ func ParseResetDatabasePasswordClientResponse(rsp *http.Response) (*ResetDatabas } response.JSON409 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON503 = &dest + } return response, nil @@ -41433,6 +41796,13 @@ func ParseUpdateDatabaseTypeClientResponse(rsp *http.Response) (*UpdateDatabaseT } response.JSON409 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON503 = &dest + } return response, nil @@ -42847,6 +43217,13 @@ func ParseDisconnectProjectGitClientResponse(rsp *http.Response) (*DisconnectPro } response.JSON404 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON409 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -42962,6 +43339,13 @@ func ParseConnectProjectGitClientResponse(rsp *http.Response) (*ConnectProjectGi } response.JSON404 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON409 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -43030,6 +43414,13 @@ func ParseSetProjectGitProductionBranchClientResponse(rsp *http.Response) (*SetP } response.JSON404 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON409 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -43042,33 +43433,26 @@ func ParseSetProjectGitProductionBranchClientResponse(rsp *http.Response) (*SetP return response, nil } -// ParseCreateProjectGitRepositoryClientResponse parses an HTTP response from a CreateProjectGitRepositoryWithResponse call -func ParseCreateProjectGitRepositoryClientResponse(rsp *http.Response) (*CreateProjectGitRepositoryClientResponse, error) { +// ParseGetProjectGitDeploySettingsClientResponse parses an HTTP response from a GetProjectGitDeploySettingsWithResponse call +func ParseGetProjectGitDeploySettingsClientResponse(rsp *http.Response) (*GetProjectGitDeploySettingsClientResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &CreateProjectGitRepositoryClientResponse{ + response := &GetProjectGitDeploySettingsClientResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: - var dest CreatedProjectGitConnection - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON201 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest Error + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest ProjectGitDeploySettings if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON400 = &dest + response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest Error @@ -43091,27 +43475,6 @@ func ParseCreateProjectGitRepositoryClientResponse(rsp *http.Response) (*CreateP } response.JSON404 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON409 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON429 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -43119,27 +43482,20 @@ func ParseCreateProjectGitRepositoryClientResponse(rsp *http.Response) (*CreateP } response.JSON500 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON503 = &dest - } return response, nil } -// ParseGetProjectGitDeploySettingsClientResponse parses an HTTP response from a GetProjectGitDeploySettingsWithResponse call -func ParseGetProjectGitDeploySettingsClientResponse(rsp *http.Response) (*GetProjectGitDeploySettingsClientResponse, error) { +// ParseUpdateProjectGitDeploySettingsClientResponse parses an HTTP response from a UpdateProjectGitDeploySettingsWithResponse call +func ParseUpdateProjectGitDeploySettingsClientResponse(rsp *http.Response) (*UpdateProjectGitDeploySettingsClientResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetProjectGitDeploySettingsClientResponse{ + response := &UpdateProjectGitDeploySettingsClientResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -43152,6 +43508,13 @@ func ParseGetProjectGitDeploySettingsClientResponse(rsp *http.Response) (*GetPro } response.JSON200 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -43173,66 +43536,12 @@ func ParseGetProjectGitDeploySettingsClientResponse(rsp *http.Response) (*GetPro } response.JSON404 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON500 = &dest - - } - - return response, nil -} - -// ParseUpdateProjectGitDeploySettingsClientResponse parses an HTTP response from a UpdateProjectGitDeploySettingsWithResponse call -func ParseUpdateProjectGitDeploySettingsClientResponse(rsp *http.Response) (*UpdateProjectGitDeploySettingsClientResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &UpdateProjectGitDeploySettingsClientResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest ProjectGitDeploySettings - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON400 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON401 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON403 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON404 = &dest + response.JSON409 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest Error @@ -44084,6 +44393,224 @@ func ParseRegenerateServiceKeyClientResponse(rsp *http.Response) (*RegenerateSer return response, nil } +// ParseCancelProjectSourceExportClientResponse parses an HTTP response from a CancelProjectSourceExportWithResponse call +func ParseCancelProjectSourceExportClientResponse(rsp *http.Response) (*CancelProjectSourceExportClientResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &CancelProjectSourceExportClientResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON409 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 501: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON501 = &dest + + } + + return response, nil +} + +// ParseGetProjectSourceExportClientResponse parses an HTTP response from a GetProjectSourceExportWithResponse call +func ParseGetProjectSourceExportClientResponse(rsp *http.Response) (*GetProjectSourceExportClientResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetProjectSourceExportClientResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest ProjectSourceExportState + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 501: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON501 = &dest + + } + + return response, nil +} + +// ParseExportProjectSourceClientResponse parses an HTTP response from a ExportProjectSourceWithResponse call +func ParseExportProjectSourceClientResponse(rsp *http.Response) (*ExportProjectSourceClientResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ExportProjectSourceClientResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest ProjectSourceExport + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON409 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON422 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON429 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 501: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON501 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON503 = &dest + + } + + return response, nil +} + // ParseListStorageBucketsClientResponse parses an HTTP response from a ListStorageBucketsWithResponse call func ParseListStorageBucketsClientResponse(rsp *http.Response) (*ListStorageBucketsClientResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) diff --git a/openapi/openapi.yaml b/openapi/openapi.yaml index cd5175f..68f1ab6 100644 --- a/openapi/openapi.yaml +++ b/openapi/openapi.yaml @@ -1527,33 +1527,99 @@ paths: application/json: schema: $ref: '#/components/schemas/ProjectConfigValidationErrorResponse' - /projects/{id}/git-connection/repository: + /projects/{id}/source-export: + get: + tags: + - Projects + - Git Connections + summary: Report the project's source-of-truth state + operationId: getProjectSourceExport + 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. + security: + - UserToken: [] + parameters: + - $ref: '#/components/parameters/ProjectId' + 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 + 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' post: tags: - Projects - Git Connections - summary: Create a GitHub repository for a project and connect it + summary: Initialize an empty repository with a project's stored source + operationId: exportProjectSource description: | - Creates a new, empty repository under the caller's GitHub account or an - organization they have the App installed on, then binds the project to - it. This is the "Create on Git" counterpart to importing an existing - repo with PUT /projects/{id}/git-connection. + 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 repository is created without an initial commit: its first commit - comes from the client that already holds the project's source, pushed - with the user's own Git credentials. Volcano never pushes on the user's - behalf. + 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. - Because it has no commits, it has no real default branch either — so - name the branch you are about to push in production_branch. Omitting it - binds the branch name GitHub reports for the new repository, which is - the account's configured default and only a guess at what will be - pushed; a push to anything else deploys nothing. + 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. - A 201 with app_installed false means the repository and the binding both - exist but the App cannot see the repo, so no push will ever deploy until - the user grants access at install_url. - operationId: createProjectGitRepository + 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: [] parameters: @@ -1563,64 +1629,53 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/CreateProjectGitRepositoryRequest' + $ref: '#/components/schemas/ExportProjectSourceRequest' responses: '201': - description: Repository created and connected to the project + description: The initial production-branch commit that was pushed content: application/json: schema: - $ref: '#/components/schemas/CreatedProjectGitConnection' + $ref: '#/components/schemas/ProjectSourceExport' '400': - description: | - Malformed request body, a missing repository name, a root_directory - that is not a relative path inside the repository, or a - production_branch that is not a valid Git branch name. All are - refused before the repository is created, so none of them means a - repository exists. + description: Malformed request body content: application/json: schema: $ref: '#/components/schemas/Error' '401': - description: Unauthorized, or the stored GitHub connection needs reconnecting + description: Unauthorized - invalid or missing token content: application/json: schema: $ref: '#/components/schemas/Error' '403': - description: | - Project not owned by the caller, or the GitHub account refused the - creation + description: Forbidden - project not owned by the caller content: application/json: schema: $ref: '#/components/schemas/Error' '404': - description: | - Project not found, no GitHub connection, or the App is not installed - on the requested owner account + description: Project not found, or it has no repository connected content: application/json: schema: $ref: '#/components/schemas/Error' '409': description: | - The project already has a repository connected, or a concurrent - request connected one first, or the created repository landed under - a different account than the one selected. A body naming a - repository means that repository exists on GitHub and was not - connected; a body that names none means nothing was created. + 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: | - GitHub refused to create the repository. The name may already exist - on the account, the organization may forbid member repository - creation, or the account may be at its repository limit — GitHub - reports all of these identically, so the cause is not distinguished. + 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: @@ -1632,20 +1687,73 @@ paths: schema: $ref: '#/components/schemas/Error' '500': - description: | - The repository was created but could not be connected, its creation - could not be confirmed, or the request failed before reaching - GitHub. The body is the discriminator, as it is for 409: one that - names a repository, or says the outcome could not be confirmed, - means a repository may exist — check the account before retrying - with another name. One that says no repository was created means - exactly that, and the same name can be retried. + 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: Git provider integration is not configured + description: GitHub integration is not configured + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + delete: + 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. + security: + - UserToken: [] + 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 + 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: @@ -1717,6 +1825,12 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + '409': + description: A Git source transition is pending + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': description: Failed to set the production branch content: @@ -1829,6 +1943,14 @@ paths: 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: @@ -1872,6 +1994,14 @@ paths: application/json: 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: + schema: + $ref: '#/components/schemas/Error' '500': description: Failed to disconnect project git content: @@ -1979,6 +2109,14 @@ paths: application/json: 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 + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': description: Failed to update project git deploy settings content: @@ -2698,7 +2836,7 @@ paths: '429': description: | Rate limit exceeded (per-function or project-wide limit), or the - owning platform user's monthly bandwidth cap (aggregate ingress + + owning platform user's billing-cycle bandwidth allowance (aggregate ingress + egress) was exceeded. content: application/json: @@ -3305,7 +3443,7 @@ paths: 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.23 (`^18.18.0 || ^19.8.0 || >=20.0.0`) and Next 16.3.2 (`>=20.9.0`). + `engines.node` constraint. Volcano tests Next 15.5.24 (`^18.18.0 || ^19.8.0 || >=20.0.0`) and Next 16.3.3 (`>=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. @@ -3942,6 +4080,18 @@ paths: - $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 @@ -3955,7 +4105,8 @@ paths: summary: Create a new serverless PostgreSQL database description: | Creates a serverless PostgreSQL database in the project. - Each project can contain up to 100 databases. Requests over this cap return 403. + Each project can hold 1 database on Free and up to 10,000 on Pro. + Requests over the plan's cap return 403. operationId: createDatabase security: - UserToken: [] @@ -4051,6 +4202,14 @@ paths: 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. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /projects/{id}/databases/{databaseName}/branches: get: tags: @@ -4145,7 +4304,7 @@ paths: description: | A branch of that name already exists on this database, or the database cannot be branched right now because it is still - provisioning, failed, or being deleted. + provisioning, being restored, failed, or being deleted. content: application/json: schema: @@ -4253,7 +4412,8 @@ paths: branch half-deleted. Deleting a branch that is still provisioning is allowed and stops the - build. Deleting a branch that is already gone succeeds. + 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: [] @@ -4329,7 +4489,10 @@ paths: $ref: '#/components/schemas/Error' '409': description: | - The branch is not active, or a reset is already in progress. + 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: @@ -4348,7 +4511,9 @@ paths: 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. + 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. The parent database's credentials are untouched. operationId: resetDatabaseBranchPassword @@ -4485,8 +4650,8 @@ paths: $ref: '#/components/schemas/Error' '409': description: | - A backup of that name already exists, the database is not active, or - a backup was taken too recently. + 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: @@ -4551,7 +4716,6 @@ paths: 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: @@ -4681,7 +4845,10 @@ paths: schema: $ref: '#/components/schemas/DatabaseBackupSchedule' '400': - description: Invalid schedule + 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: @@ -4699,7 +4866,10 @@ paths: schema: $ref: '#/components/schemas/Error' '409': - description: The database is not active + 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: @@ -4874,6 +5044,10 @@ paths: 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: - UserToken: [] @@ -4920,6 +5094,14 @@ paths: 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. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /projects/{id}/databases/{databaseName}/type: patch: tags: @@ -4966,6 +5148,14 @@ paths: 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. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /projects/{id}/databases/{databaseName}/stats: get: tags: @@ -5405,6 +5595,8 @@ paths: $ref: '#/components/schemas/Error' '429': $ref: '#/components/responses/DatabaseQueryCapExceeded' + '503': + $ref: '#/components/responses/DatabaseBranchQueryUnavailable' /databases/{databaseName}/branches/{branchName}/query/select: post: tags: @@ -5481,6 +5673,8 @@ paths: $ref: '#/components/schemas/Error' '429': $ref: '#/components/responses/DatabaseQueryCapExceeded' + '503': + $ref: '#/components/responses/DatabaseBranchQueryUnavailable' /databases/{databaseName}/branches/{branchName}/query/insert: post: tags: @@ -5553,6 +5747,8 @@ paths: $ref: '#/components/schemas/Error' '429': $ref: '#/components/responses/DatabaseQueryCapExceeded' + '503': + $ref: '#/components/responses/DatabaseBranchQueryUnavailable' /databases/{databaseName}/branches/{branchName}/query/update: post: tags: @@ -5624,6 +5820,8 @@ paths: $ref: '#/components/schemas/Error' '429': $ref: '#/components/responses/DatabaseQueryCapExceeded' + '503': + $ref: '#/components/responses/DatabaseBranchQueryUnavailable' /databases/{databaseName}/branches/{branchName}/query/delete: post: tags: @@ -5691,6 +5889,8 @@ paths: $ref: '#/components/schemas/Error' '429': $ref: '#/components/responses/DatabaseQueryCapExceeded' + '503': + $ref: '#/components/responses/DatabaseBranchQueryUnavailable' /databases/regions: get: tags: @@ -10782,21 +10982,30 @@ components: responses: BandwidthCapExceeded: description: | - The platform user exceeded their monthly bandwidth cap (aggregate + The platform user exceeded their billing-cycle bandwidth allowance (aggregate ingress + egress across owned projects). Enforcement is eventual: - requests are rejected until the cap increases (plan/override) or the - calendar-month meter resets. + 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 monthly usage cap: either the platform user's - bandwidth cap (aggregate ingress + egress across owned projects) or the - project's monthly database-request cap. Enforcement is eventual: queries - are rejected until the relevant cap increases (plan/override) or the - calendar-month meter resets. The error message identifies which cap. + 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: @@ -11582,9 +11791,15 @@ components: properties: backup_name: type: string - description: A backup of this database to restore. - pattern: ^[a-z0-9][a-z0-9_-]{0,62}$ - maxLength: 63 + 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 @@ -12430,8 +12645,12 @@ components: DatabaseRestoreWindow: type: object description: | - The span a point-in-time restore may target. Empty when the owner's plan - does not include point-in-time restore. + 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 @@ -13255,36 +13474,106 @@ components: description: Current holder's fencing token. Present only when held. required: - held - CreateProjectGitRepositoryRequest: + ProjectSourceExportState: type: object + description: The project's source of truth and any pending Git transition. properties: - owner: + mode: type: string - maxLength: 39 - pattern: ^[A-Za-z0-9-]+$ - description: GitHub account to create the repository under, as returned in account_login by /user/git/connections/{id}/installations. Omit for the connected user's own account. Must be an organization the app is installed on, or your own account. - name: + enum: + - platform + - git_exporting + - git_pending + - git + transition_started_at: type: string - minLength: 1 - maxLength: 100 - description: Repository name, unique within the owner account. - private: - type: boolean - default: true - description: 'Whether the new repository is private. Defaults to true: the next step is pushing the project''s source into it, so an omitted field must not publish it.' - description: + format: date-time + nullable: true + description: When source export started, cleared if an incomplete transition is canceled. + exported_at: type: string - maxLength: 350 - description: Repository description shown on GitHub. - root_directory: + 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: + - 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: + repo_full_name: + type: string + branch: + type: string + description: The production branch that was created. + commit_sha: type: string - description: Monorepo subdirectory the project builds from, as a relative path inside the repository. Omit for the repo root. Absolute paths and ".." traversal are rejected before the repository is created, because the build applies the same rule and nothing would deploy. + 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: + type: array + description: Things deliberately left out of the branch. + items: + $ref: '#/components/schemas/ProjectSourceExportOmission' + required: + - repo_full_name + - branch + - commit_sha + - file_count + - skipped + - omitted + ExportProjectSourceRequest: + type: object + additionalProperties: false + properties: production_branch: type: string - maxLength: 255 - description: 'The branch to deploy from — name the one you are about to push. The repository is created empty, so it has no real default branch to follow: omitting this binds whatever branch name GitHub reports for the new repository (falling back to "main" if it reports none), which is the account''s configured default and a prediction, and pushing anything else then deploys nothing. Naming the branch GitHub already reports is not treated as pinning it, so the project still tracks a later default-branch rename; naming any other branch pins it. Rejected before the repository is created if it is not a valid Git branch name; it does not have to exist.' + minLength: 1 + description: The currently configured production branch the user confirmed for export. required: + - production_branch + ProjectSourceExportSkip: + type: object + properties: + kind: + 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: + type: string + reason: + type: string + required: + - kind - name + - reason + ProjectSourceExportOmission: + type: object + 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: + type: string + description: The resource it came from, empty when project-wide. + path: + type: string + required: + - kind + - resource + - path SetProjectGitProductionBranchRequest: type: object properties: @@ -13295,21 +13584,6 @@ components: description: The branch a push must land on to deploy. Validated as a Git branch name only — it does not have to exist yet. required: - production_branch - CreatedProjectGitConnection: - type: object - description: A newly created repository's project binding, plus whether the Volcano GitHub App can actually see it. - properties: - connection: - $ref: '#/components/schemas/ProjectGitConnection' - app_installed: - type: boolean - description: Whether the App installation covers the new repository. False means the binding is complete but no push will deploy until the user grants access at install_url. An installation scoped to selected repositories never picks up a new repo on its own. - install_url: - type: string - description: Where the user grants the App access to the new repository. Present only when app_installed is false. - required: - - connection - - app_installed ConnectProjectGitRequest: type: object properties: