Documentation
¶
Overview ¶
Package api is the HTTP client for the Volcano cloud API.
Index ¶
- Constants
- Variables
- func Code(err error) string
- func DebugEnabled() bool
- func Message(err error) string
- func ResetLastInstructionsForTest()
- func ResetLastRefusalForTest()
- func SetDebug(on bool)
- func Status(err error) int
- func WebSignupURL(webURL, email, next string) (string, error)
- type AccessTokenCreateInput
- type AccessTokenListInput
- type Client
- func (c *Client) ApplyProjectConfig(ctx context.Context, projectID uuid.UUID, manifestJSON []byte, dryRun bool) (*apiclient.ProjectConfigApplyResult, error)
- func (c *Client) ApproveDurableApproval(ctx context.Context, projectID, approvalID uuid.UUID, comment string) (*apiclient.DurableApproval, error)
- func (c *Client) ConnectProjectGit(ctx context.Context, projectID uuid.UUID, ...) (*apiclient.ProjectGitConnection, error)
- func (c *Client) CopyStorageObject(ctx context.Context, bucketName, from, to string) (*apiclient.StorageObject, error)
- func (c *Client) CreateAccessToken(ctx context.Context, projectID uuid.UUID, input AccessTokenCreateInput) (*apiclient.CreatedProjectAccessToken, error)
- func (c *Client) CreateAnonKey(ctx context.Context, projectID uuid.UUID, name string) (*apiclient.AnonKey, error)
- func (c *Client) CreateDatabase(ctx context.Context, projectID uuid.UUID, ...) (*apiclient.Database, error)
- func (c *Client) CreateDatabaseBackup(ctx context.Context, projectID uuid.UUID, databaseName, backupName string) (*apiclient.DatabaseBackup, error)
- func (c *Client) CreateDatabaseBranch(ctx context.Context, projectID uuid.UUID, databaseName, branchName string, ...) (*apiclient.DatabaseBranch, error)
- func (c *Client) CreateDatabaseRestore(ctx context.Context, projectID uuid.UUID, databaseName string, ...) (*apiclient.DatabaseRestore, error)
- func (c *Client) CreateDurableFunctionScheduler(ctx context.Context, projectID uuid.UUID, function string, ...) (*apiclient.FunctionScheduler, error)
- func (c *Client) CreateFrontendCustomDomain(ctx context.Context, projectID, frontendID uuid.UUID, ...) (*apiclient.FrontendCustomDomainResponse, error)
- func (c *Client) CreateFrontendFunctionRoute(ctx context.Context, projectID, frontendID uuid.UUID, ...) (*apiclient.FrontendFunctionRoute, error)
- func (c *Client) CreateFunctionScheduler(ctx context.Context, projectID, functionID uuid.UUID, ...) (*apiclient.FunctionScheduler, error)
- func (c *Client) CreateProject(ctx context.Context, name, templateID string) (*apiclient.Project, error)
- func (c *Client) CreateSandboxTemplate(ctx context.Context, project, key uuid.UUID, ...) (*apiclient.SandboxTemplate, error)
- func (c *Client) CreateServiceKey(ctx context.Context, projectID uuid.UUID, name string, permissions []string) (*apiclient.ServiceKey, error)
- func (c *Client) CreateStorageBucket(ctx context.Context, projectID uuid.UUID, input StorageBucketCreateInput) (*apiclient.StorageBucket, error)
- func (c *Client) CreateStoragePolicy(ctx context.Context, projectID uuid.UUID, bucketName string, ...) (*apiclient.StoragePolicy, error)
- func (c *Client) CreateVariable(ctx context.Context, projectID uuid.UUID, name, value string) (*apiclient.Variable, error)
- func (c *Client) DeleteDatabase(ctx context.Context, projectID uuid.UUID, databaseName string) error
- func (c *Client) DeleteDatabaseBackup(ctx context.Context, projectID uuid.UUID, databaseName, backupName string) error
- func (c *Client) DeleteDatabaseBranch(ctx context.Context, projectID uuid.UUID, databaseName, branchName string) error
- func (c *Client) DeleteDurableFunction(ctx context.Context, projectID uuid.UUID, function string) error
- func (c *Client) DeleteDurableFunctionScheduler(ctx context.Context, projectID uuid.UUID, function string, ...) error
- func (c *Client) DeleteFrontend(ctx context.Context, projectID, frontendID uuid.UUID) error
- func (c *Client) DeleteFrontendCustomDomain(ctx context.Context, projectID, frontendID uuid.UUID) error
- func (c *Client) DeleteFrontendFunctionRoute(ctx context.Context, projectID, frontendID, routeID uuid.UUID) error
- func (c *Client) DeleteFunction(ctx context.Context, projectID, functionID uuid.UUID) error
- func (c *Client) DeleteFunctionScheduler(ctx context.Context, projectID, functionID, schedulerID uuid.UUID) error
- func (c *Client) DeleteProject(ctx context.Context, projectID uuid.UUID) error
- func (c *Client) DeleteSandboxTemplate(ctx context.Context, project, id uuid.UUID) error
- func (c *Client) DeleteStorageBucket(ctx context.Context, projectID uuid.UUID, bucketName string) error
- func (c *Client) DeleteStorageObject(ctx context.Context, bucketName, path string) error
- func (c *Client) DeleteStoragePolicy(ctx context.Context, projectID uuid.UUID, bucketName string, ...) error
- func (c *Client) DeleteVariable(ctx context.Context, projectID uuid.UUID, name string) error
- func (c *Client) DeleteVerifiedDomain(ctx context.Context, domain string) error
- func (c *Client) DenyDurableApproval(ctx context.Context, projectID, approvalID uuid.UUID, comment string) (*apiclient.DurableApproval, error)
- func (c *Client) DeployDurableFunction(ctx context.Context, projectID uuid.UUID, fn DurableFunctionDeployInput) (deployed *apiclient.DurableFunction, created bool, err error)
- func (c *Client) DeployFrontend(ctx context.Context, projectID uuid.UUID, input FrontendDeployInput) (*apiclient.Frontend, error)
- func (c *Client) DeployFunction(ctx context.Context, projectID uuid.UUID, fn FunctionDeployInput) (*apiclient.Function, error)
- func (c *Client) DeployFunctionsBatch(ctx context.Context, projectID uuid.UUID, functions []FunctionDeployInput) (*apiclient.BatchFunctionDeployResponse, error)
- func (c *Client) DeploySandbox(ctx context.Context, project, template, key uuid.UUID, ...) (*apiclient.SandboxDeployment, error)
- func (c *Client) DisconnectProjectGit(ctx context.Context, projectID uuid.UUID) error
- func (c *Client) DownloadStorageObject(ctx context.Context, bucketName, path string) (*http.Response, error)
- func (c *Client) ExchangePlatformToken(ctx context.Context, authAccessToken, clientID string) (*apiclient.PlatformExchangeResponse, error)
- func (c *Client) ExecSandbox(ctx context.Context, project, key uuid.UUID, ...) (*apiclient.SandboxExecutionResult, error)
- func (c *Client) ExecSandboxSession(ctx context.Context, id, key uuid.UUID, body apiclient.SandboxCommandRequest) (*apiclient.SandboxCommandResult, error)
- func (c *Client) GetAccessToken(ctx context.Context, projectID, tokenID uuid.UUID) (*apiclient.ProjectAccessToken, error)
- func (c *Client) GetAccessTokenUsage(ctx context.Context, projectID, tokenID uuid.UUID, days int) (*apiclient.ProjectAccessTokenUsage, error)
- func (c *Client) GetDatabase(ctx context.Context, projectID uuid.UUID, databaseName string) (*apiclient.Database, error)
- func (c *Client) GetDatabaseBackup(ctx context.Context, projectID uuid.UUID, databaseName, backupName string) (*apiclient.DatabaseBackup, error)
- func (c *Client) GetDatabaseBackupSchedule(ctx context.Context, projectID uuid.UUID, databaseName string) (*apiclient.DatabaseBackupSchedule, error)
- func (c *Client) GetDatabaseBranch(ctx context.Context, projectID uuid.UUID, databaseName, branchName string) (*apiclient.DatabaseBranch, error)
- func (c *Client) GetDatabaseRestore(ctx context.Context, projectID uuid.UUID, databaseName string, ...) (*apiclient.DatabaseRestore, error)
- func (c *Client) GetDurableApproval(ctx context.Context, projectID, approvalID uuid.UUID) (*apiclient.DurableApproval, error)
- func (c *Client) GetDurableApprovalStats(ctx context.Context, projectID uuid.UUID, function string, from, to *time.Time) (*apiclient.DurableApprovalStats, error)
- func (c *Client) GetDurableExecution(ctx context.Context, projectID uuid.UUID, function string, ...) (*apiclient.DurableExecution, error)
- func (c *Client) GetDurableFunction(ctx context.Context, projectID uuid.UUID, function string) (*apiclient.DurableFunction, error)
- func (c *Client) GetFrontend(ctx context.Context, projectID, frontendID uuid.UUID) (*apiclient.Frontend, error)
- func (c *Client) GetFrontendCustomDomain(ctx context.Context, projectID, frontendID uuid.UUID) (*apiclient.FrontendCustomDomainResponse, error)
- func (c *Client) GetFrontendDeploymentLogs(ctx context.Context, projectID, frontendID, deploymentID uuid.UUID, limit int, ...) (*apiclient.LogSearchResponse, error)
- func (c *Client) GetFrontendLogs(ctx context.Context, projectID, frontendID uuid.UUID, limit int, cursor string) (*apiclient.LogSearchResponse, error)
- func (c *Client) GetFunction(ctx context.Context, projectID, functionID uuid.UUID) (*apiclient.Function, error)
- func (c *Client) GetFunctionDeploymentLogs(ctx context.Context, projectID, functionID, deploymentID uuid.UUID, limit int, ...) (*apiclient.LogSearchResponse, error)
- func (c *Client) GetFunctionLogs(ctx context.Context, projectID, functionID uuid.UUID, limit int, cursor string) (*apiclient.LogSearchResponse, error)
- func (c *Client) GetProject(ctx context.Context, projectID uuid.UUID) (*apiclient.Project, error)
- func (c *Client) GetProjectConfigYAML(ctx context.Context, projectID uuid.UUID) ([]byte, error)
- func (c *Client) GetProjectGitConnection(ctx context.Context, projectID uuid.UUID) (*apiclient.ProjectGitConnection, error)
- func (c *Client) GetProjectGitDeploySettings(ctx context.Context, projectID uuid.UUID) (*apiclient.ProjectGitDeploySettings, error)
- func (c *Client) GetProjectUsage(ctx context.Context, projectID uuid.UUID) (*apiclient.ProjectUsageResponse, error)
- func (c *Client) GetServiceKey(ctx context.Context, projectID, keyID uuid.UUID) (*apiclient.ServiceKey, error)
- func (c *Client) GetStorageBucket(ctx context.Context, projectID uuid.UUID, bucketName string) (*apiclient.StorageBucket, error)
- func (c *Client) GetStorageStats(ctx context.Context, projectID uuid.UUID) (*apiclient.StorageStats, error)
- func (c *Client) GetVariable(ctx context.Context, projectID uuid.UUID, name string) (*apiclient.Variable, error)
- func (c *Client) InvokeFunction(ctx context.Context, functionID uuid.UUID, input FunctionInvokeInput) (*apiclient.FunctionInvocationResponse, error)
- func (c *Client) ListAccessTokens(ctx context.Context, projectID uuid.UUID, input AccessTokenListInput) (*apiclient.PaginatedProjectAccessTokens, error)
- func (c *Client) ListAccessTokensUsage(ctx context.Context, projectID uuid.UUID, days int) ([]apiclient.ProjectAccessTokenUsage, error)
- func (c *Client) ListAnonKeys(ctx context.Context, projectID uuid.UUID) ([]apiclient.AnonKey, error)
- func (c *Client) ListDatabaseBackups(ctx context.Context, projectID uuid.UUID, databaseName string) (*apiclient.DatabaseBackupList, error)
- func (c *Client) ListDatabaseBranches(ctx context.Context, projectID uuid.UUID, databaseName string) ([]apiclient.DatabaseBranch, error)
- func (c *Client) ListDatabaseRestores(ctx context.Context, projectID uuid.UUID, databaseName string) (*apiclient.DatabaseRestoreList, error)
- func (c *Client) ListDatabases(ctx context.Context, projectID uuid.UUID, page, limit int) (*apiclient.PaginatedDatabases, error)
- func (c *Client) ListDurableApprovals(ctx context.Context, projectID uuid.UUID, input DurableApprovalListInput) (*apiclient.PaginatedDurableApprovals, error)
- func (c *Client) ListDurableExecutions(ctx context.Context, projectID uuid.UUID, function, status string, ...) (*apiclient.PaginatedDurableExecutions, error)
- func (c *Client) ListDurableFunctionSchedulers(ctx context.Context, projectID uuid.UUID, function string) (*apiclient.FunctionSchedulerListResponse, error)
- func (c *Client) ListDurableFunctions(ctx context.Context, projectID uuid.UUID, page, limit int) (*apiclient.PaginatedDurableFunctions, error)
- func (c *Client) ListFrontendDeployments(ctx context.Context, projectID, frontendID uuid.UUID, page, limit int) (*apiclient.PaginatedFrontendDeployments, error)
- func (c *Client) ListFrontendFunctionRoutes(ctx context.Context, projectID, frontendID uuid.UUID) ([]apiclient.FrontendFunctionRoute, error)
- func (c *Client) ListFrontends(ctx context.Context, projectID uuid.UUID, page, limit int) (*apiclient.PaginatedFrontends, error)
- func (c *Client) ListFunctionDeployments(ctx context.Context, projectID, functionID uuid.UUID, page, limit int) (*apiclient.PaginatedFunctionDeployments, error)
- func (c *Client) ListFunctionRuntimes(ctx context.Context) ([]apiclient.FunctionRuntimeOption, error)
- func (c *Client) ListFunctionSchedulers(ctx context.Context, projectID, functionID uuid.UUID) (*apiclient.FunctionSchedulerListResponse, error)
- func (c *Client) ListFunctions(ctx context.Context, projectID uuid.UUID, page, limit int) (*apiclient.PaginatedFunctions, error)
- func (c *Client) ListGitConnections(ctx context.Context) ([]apiclient.GitConnection, error)
- func (c *Client) ListGitInstallationRepositories(ctx context.Context, connectionID uuid.UUID, installationID int64) ([]apiclient.GitRepository, error)
- func (c *Client) ListGitInstallations(ctx context.Context, connectionID uuid.UUID) ([]apiclient.GitInstallation, error)
- func (c *Client) ListProjects(ctx context.Context, page, limit int) (*apiclient.PaginatedProjects, error)
- func (c *Client) ListServiceKeys(ctx context.Context, projectID uuid.UUID, page, limit int) (*apiclient.PaginatedServiceKeys, error)
- func (c *Client) ListStorageBuckets(ctx context.Context, projectID uuid.UUID) ([]apiclient.StorageBucket, error)
- func (c *Client) ListStorageObjects(ctx context.Context, bucketName string, opts StorageObjectListOptions) (*apiclient.StorageListResponse, error)
- func (c *Client) ListStoragePolicies(ctx context.Context, projectID uuid.UUID, bucketName string) ([]apiclient.StoragePolicy, error)
- func (c *Client) ListVariables(ctx context.Context, projectID uuid.UUID, page, limit int) (*apiclient.PaginatedVariables, error)
- func (c *Client) ListVerifiedDomains(ctx context.Context) ([]apiclient.VerifiedDomain, error)
- func (c *Client) MoveStorageObject(ctx context.Context, bucketName, from, to string) (*apiclient.StorageObject, error)
- func (c *Client) PollDeviceToken(ctx context.Context, clientID, deviceCode string) (*DeviceTokenPollResult, error)
- func (c *Client) ReadSandboxFile(ctx context.Context, id uuid.UUID, body apiclient.SandboxFileReadRequest) (*apiclient.SandboxFileResult, error)
- func (c *Client) RedeployFrontend(ctx context.Context, projectID, frontendID uuid.UUID) (*apiclient.Frontend, error)
- func (c *Client) RenameProject(ctx context.Context, projectID uuid.UUID, name string) (*apiclient.Project, error)
- func (c *Client) ResetDatabaseBranch(ctx context.Context, projectID uuid.UUID, databaseName, branchName string) (*apiclient.DatabaseBranch, error)
- func (c *Client) ResetDatabaseBranchPassword(ctx context.Context, projectID uuid.UUID, databaseName, branchName string) (*apiclient.DatabaseBranch, error)
- func (c *Client) ResumeSandbox(ctx context.Context, id uuid.UUID) (*apiclient.SandboxSession, error)
- func (c *Client) RevokeAccessToken(ctx context.Context, projectID, tokenID uuid.UUID) error
- func (c *Client) SandboxAccess(ctx context.Context, id uuid.UUID, body apiclient.SandboxAccessRequest) (*apiclient.SandboxAccess, error)
- func (c *Client) SandboxDeployment(ctx context.Context, project, template, deployment uuid.UUID) (*apiclient.SandboxDeployment, error)
- func (c *Client) SandboxDeploymentLogs(ctx context.Context, project, template, deployment uuid.UUID, ...) (*apiclient.SandboxBuildLogPage, error)
- func (c *Client) SandboxDeploymentSource(ctx context.Context, project, template, deployment uuid.UUID, output io.Writer) error
- func (c *Client) SandboxDeployments(ctx context.Context, project, template uuid.UUID, cursor string, limit int) (*apiclient.SandboxDeploymentPage, error)
- func (c *Client) SandboxPresets(ctx context.Context) (*apiclient.SandboxPresetList, error)
- func (c *Client) SandboxSession(ctx context.Context, id uuid.UUID) (*apiclient.SandboxSession, error)
- func (c *Client) SandboxSessions(ctx context.Context, project uuid.UUID, ...) (*apiclient.SandboxSessionPage, error)
- func (c *Client) SandboxTemplate(ctx context.Context, project, id uuid.UUID) (*apiclient.SandboxTemplate, error)
- func (c *Client) SandboxTemplates(ctx context.Context, project uuid.UUID, params *apiclient.ListSandboxesParams) (*apiclient.SandboxTemplatePage, error)
- func (c *Client) SetStorageObjectVisibility(ctx context.Context, bucketName, path string, isPublic bool) (*apiclient.StorageObject, error)
- func (c *Client) StartDeviceAuthorization(ctx context.Context, clientID string) (*apiclient.DeviceAuthorizationResponse, error)
- func (c *Client) StartDurableExecution(ctx context.Context, projectID uuid.UUID, function string, ...) (*apiclient.DurableExecution, error)
- func (c *Client) StartSandbox(ctx context.Context, project, key uuid.UUID, ...) (*apiclient.SandboxSession, error)
- func (c *Client) StopDurableExecution(ctx context.Context, projectID uuid.UUID, function string, ...) (*apiclient.DurableExecution, error)
- func (c *Client) StreamFrontendDeploymentLogs(ctx context.Context, projectID, frontendID, deploymentID uuid.UUID, limit int, ...) (*ProjectLogStream, error)
- func (c *Client) StreamFrontendLogs(ctx context.Context, projectID, frontendID uuid.UUID, limit int, ...) (*ProjectLogStream, error)
- func (c *Client) StreamFunctionDeploymentLogs(ctx context.Context, projectID, functionID, deploymentID uuid.UUID, limit int, ...) (*ProjectLogStream, error)
- func (c *Client) StreamFunctionLogs(ctx context.Context, projectID, functionID uuid.UUID, limit int, ...) (*ProjectLogStream, error)
- func (c *Client) SuspendSandbox(ctx context.Context, id uuid.UUID) (*apiclient.SandboxSession, error)
- func (c *Client) TerminateSandbox(ctx context.Context, id uuid.UUID) (*apiclient.SandboxSession, error)
- func (c *Client) UpdateDatabaseBackupSchedule(ctx context.Context, projectID uuid.UUID, databaseName string, ...) (*apiclient.DatabaseBackupSchedule, error)
- func (c *Client) UpdateDatabaseBranch(ctx context.Context, projectID uuid.UUID, databaseName, branchName string, ...) (*apiclient.DatabaseBranch, error)
- func (c *Client) UpdateDurableFunctionScheduler(ctx context.Context, projectID uuid.UUID, function string, ...) (*apiclient.FunctionScheduler, error)
- func (c *Client) UpdateFrontendFunctionRoute(ctx context.Context, projectID, frontendID, routeID uuid.UUID, ...) (*apiclient.FrontendFunctionRoute, error)
- func (c *Client) UpdateFunctionScheduler(ctx context.Context, projectID, functionID, schedulerID uuid.UUID, ...) (*apiclient.FunctionScheduler, error)
- func (c *Client) UpdateFunctionVisibility(ctx context.Context, projectID, functionID uuid.UUID, ...) (*apiclient.Function, error)
- func (c *Client) UpdateStorageBucket(ctx context.Context, projectID uuid.UUID, bucketName string, ...) (*apiclient.StorageBucket, error)
- func (c *Client) UpdateVariable(ctx context.Context, projectID uuid.UUID, name, value string) (*apiclient.Variable, error)
- func (c *Client) UploadStorageObject(ctx context.Context, bucketName, path, contentType string, content io.Reader) (*apiclient.StorageObject, error)
- func (c *Client) ValidateToken(ctx context.Context) error
- func (c *Client) VerifyDomain(ctx context.Context, domain string) (*apiclient.VerifiedDomain, bool, error)
- func (c *Client) WriteSandboxFile(ctx context.Context, id uuid.UUID, body apiclient.SandboxFileWriteRequest) error
- type DeviceTokenPollResult
- type DurableApprovalListInput
- type DurableExecutionStartInput
- type DurableFunctionDeployInput
- type Error
- type FrontendCustomDomainInput
- type FrontendDeployInput
- type FunctionDeployInput
- type FunctionInvokeInput
- type FunctionSchedulerInput
- type Instructions
- type Option
- type OwnershipRequiredError
- type ProjectConfigValidationError
- type ProjectLogStream
- type ProjectLogStreamEvent
- type Refusal
- type SandboxDeployInput
- type StorageBucketCreateInput
- type StorageBucketUpdateInput
- type StorageObjectListOptions
- type StoragePolicyCreateInput
Constants ¶
const ( // DefaultPage is the first page fetched by paginated API callers. DefaultPage = 1 // DefaultLimit is the default number of resources fetched per page. DefaultLimit = 100 )
const ( // CLIInstructionSuggestionVersionUpgrade signals a newer CLI is published; non-blocking. CLIInstructionSuggestionVersionUpgrade = "suggestion_version_upgrade" // CLIInstructionRequireVersionUpgrade signals this CLI version is no longer // supported. The API pairs it with an HTTP 426 on non-exempt routes. CLIInstructionRequireVersionUpgrade = "require_version_upgrade" // CLIInstructionLowCreditWarning signals the account's credit balance is // low; non-blocking. CLIInstructionNotEnoughCredit signals the account has // no credit left; the request itself is blocked by the API's own error // response (this instruction only adds explanatory context, it does not // gate anything CLI-side). CLIInstructionLowCreditWarning = "low_credit_warning" CLIInstructionNotEnoughCredit = "not_enough_credit" // DeviceInstructionReauth signals the platform token needs re-authentication. DeviceInstructionReauth = "reauth" )
Header names and instruction values for the CLI version protocol. This is the CLI's HTTP wire contract and is duplicated here because this repository has no shared Go module with the API. The claimed version is advisory input only and never a privilege: the CLI cannot make this request header trustworthy, and it does not use the value to grant authority.
const OwnershipVerificationRequired = "ownership_verification_required"
OwnershipVerificationRequired is the code of a refusal the user resolves by publishing a DNS record that proves the account owns the domain.
Variables ¶
var ErrNotFound = errors.New("not found")
ErrNotFound is returned by resolver lookups when no matching resource exists. Callers branch on it with errors.Is(err, api.ErrNotFound).
Functions ¶
func Code ¶ added in v0.44.0
Code returns the API's machine-readable code for the *Error wrapped in err, or "" if err does not wrap an *Error or the response carried no code. A code tells apart refusals that share a status and whose messages may change.
func DebugEnabled ¶ added in v0.4.0
func DebugEnabled() bool
DebugEnabled reports whether API tracing is on.
func Message ¶ added in v0.31.0
Message returns the API's own message for the *Error wrapped in err, or "" if err is nil, does not wrap an *Error, or carries no message. Callers that act on which refusal a status stands for need the body, not just the code.
func ResetLastInstructionsForTest ¶ added in v0.1.0
func ResetLastInstructionsForTest()
ResetLastInstructionsForTest clears the process-global instructions state. Test-only: production never needs this, since each CLI invocation is a fresh process. Call it between test cases that expect LastInstructions() to start from the zero value — recordInstructions is intentionally sticky (see its doc comment): a response that omits a field never clears a previously recorded value for it, so tests must reset explicitly rather than relying on an unrelated response to clear prior state.
func ResetLastRefusalForTest ¶ added in v0.31.0
func ResetLastRefusalForTest()
ResetLastRefusalForTest clears the process-global refusal state. Test-only: each CLI invocation is a fresh process.
func SetDebug ¶ added in v0.4.0
func SetDebug(on bool)
SetDebug enables or disables API request/response tracing to stderr.
func Status ¶
Status returns the HTTP status code carried by an *Error wrapped in err, or 0 if err is nil or does not wrap an *Error.
func WebSignupURL ¶ added in v0.0.4
WebSignupURL builds the Volcano Web signup URL used by the CLI signup flow. next must be a same-origin relative path: Volcano Web's signup page rejects any next value that isn't (see isSafeInternalPath in volcano-web).
Types ¶
type AccessTokenCreateInput ¶ added in v0.31.0
AccessTokenCreateInput contains one project access token mint request.
type AccessTokenListInput ¶ added in v0.31.0
AccessTokenListInput contains one project access token page request.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a thin wrapper around the generated OpenAPI client.
func (*Client) ApplyProjectConfig ¶ added in v0.0.5
func (c *Client) ApplyProjectConfig(ctx context.Context, projectID uuid.UUID, manifestJSON []byte, dryRun bool) (*apiclient.ProjectConfigApplyResult, error)
ApplyProjectConfig uploads a full configuration manifest (pre-encoded JSON) and returns the server's per-resource apply report.
func (*Client) ApproveDurableApproval ¶ added in v0.44.0
func (c *Client) ApproveDurableApproval( ctx context.Context, projectID, approvalID uuid.UUID, comment string, ) (*apiclient.DurableApproval, error)
ApproveDurableApproval approves a pending approval, and the workflow resumes with the decision. Only a person's credential may decide.
func (*Client) ConnectProjectGit ¶ added in v0.22.0
func (c *Client) ConnectProjectGit(ctx context.Context, projectID uuid.UUID, body apiclient.ConnectProjectGitJSONRequestBody) (*apiclient.ProjectGitConnection, error)
ConnectProjectGit binds a project to a repository. It is a full replace: it only binds, and never creates or deletes anything on the git provider.
func (*Client) CopyStorageObject ¶
func (c *Client) CopyStorageObject(ctx context.Context, bucketName, from, to string) (*apiclient.StorageObject, error)
CopyStorageObject copies one object within a bucket.
func (*Client) CreateAccessToken ¶ added in v0.31.0
func (c *Client) CreateAccessToken(ctx context.Context, projectID uuid.UUID, input AccessTokenCreateInput) (*apiclient.CreatedProjectAccessToken, error)
CreateAccessToken mints one project access token. The response carries the plaintext secret, which the API returns only here.
func (*Client) CreateAnonKey ¶ added in v0.34.0
func (c *Client) CreateAnonKey(ctx context.Context, projectID uuid.UUID, name string) (*apiclient.AnonKey, error)
CreateAnonKey creates a publishable key with the server's auth-only default.
func (*Client) CreateDatabase ¶
func (c *Client) CreateDatabase(ctx context.Context, projectID uuid.UUID, name, region, pgVersion, databaseType string) (*apiclient.Database, error)
CreateDatabase creates a database in a project.
func (*Client) CreateDatabaseBackup ¶ added in v0.23.0
func (c *Client) CreateDatabaseBackup(ctx context.Context, projectID uuid.UUID, databaseName, backupName string) (*apiclient.DatabaseBackup, error)
CreateDatabaseBackup captures the database as it is now.
func (*Client) CreateDatabaseBranch ¶ added in v0.21.0
func (c *Client) CreateDatabaseBranch(ctx context.Context, projectID uuid.UUID, databaseName, branchName string, ttlSeconds *int64) (*apiclient.DatabaseBranch, error)
CreateDatabaseBranch forks a branch off a database. The branch returns before it is connectable; poll GetDatabaseBranch until it reports active.
func (*Client) CreateDatabaseRestore ¶ added in v0.23.0
func (c *Client) CreateDatabaseRestore(ctx context.Context, projectID uuid.UUID, databaseName string, backupName *string, restoreTo *time.Time) (*apiclient.DatabaseRestore, error)
CreateDatabaseRestore replaces a database's data, either from a named backup or from its state at a point in time. Exactly one of backupName and restoreTo must be set. The restore returns before it finishes; the database is not connectable until it reports completed.
func (*Client) CreateDurableFunctionScheduler ¶ added in v0.26.0
func (c *Client) CreateDurableFunctionScheduler( ctx context.Context, projectID uuid.UUID, function string, input FunctionSchedulerInput, ) (*apiclient.FunctionScheduler, error)
CreateDurableFunctionScheduler creates one scheduler for a durable function. Each tick starts an execution rather than invoking the function.
func (*Client) CreateFrontendCustomDomain ¶
func (c *Client) CreateFrontendCustomDomain(ctx context.Context, projectID, frontendID uuid.UUID, input FrontendCustomDomainInput) (*apiclient.FrontendCustomDomainResponse, error)
CreateFrontendCustomDomain attaches a BYOC custom domain to a frontend.
func (*Client) CreateFrontendFunctionRoute ¶ added in v0.42.0
func (c *Client) CreateFrontendFunctionRoute( ctx context.Context, projectID, frontendID uuid.UUID, route apiclient.CreateFrontendFunctionRouteRequest, ) (*apiclient.FrontendFunctionRoute, error)
CreateFrontendFunctionRoute forwards a path prefix on a frontend to a function.
func (*Client) CreateFunctionScheduler ¶
func (c *Client) CreateFunctionScheduler(ctx context.Context, projectID, functionID uuid.UUID, input FunctionSchedulerInput) (*apiclient.FunctionScheduler, error)
CreateFunctionScheduler creates one scheduler for a function.
func (*Client) CreateProject ¶
func (c *Client) CreateProject(ctx context.Context, name, templateID string) (*apiclient.Project, error)
CreateProject creates a project for the authenticated user.
func (*Client) CreateSandboxTemplate ¶ added in v0.38.0
func (c *Client) CreateSandboxTemplate(ctx context.Context, project, key uuid.UUID, body apiclient.CreateSandboxTemplateRequest) (*apiclient.SandboxTemplate, error)
CreateSandboxTemplate calls the Sandbox CreateSandbox operation.
func (*Client) CreateServiceKey ¶ added in v0.0.4
func (c *Client) CreateServiceKey(ctx context.Context, projectID uuid.UUID, name string, permissions []string) (*apiclient.ServiceKey, error)
CreateServiceKey creates one service key in a project. When permissions is non-empty the key is scoped to exactly those operations; otherwise the server grants full access (["*"]).
func (*Client) CreateStorageBucket ¶
func (c *Client) CreateStorageBucket(ctx context.Context, projectID uuid.UUID, input StorageBucketCreateInput) (*apiclient.StorageBucket, error)
CreateStorageBucket creates one bucket in the project.
func (*Client) CreateStoragePolicy ¶
func (c *Client) CreateStoragePolicy(ctx context.Context, projectID uuid.UUID, bucketName string, input StoragePolicyCreateInput) (*apiclient.StoragePolicy, error)
CreateStoragePolicy attaches a new policy to a bucket.
func (*Client) CreateVariable ¶
func (c *Client) CreateVariable(ctx context.Context, projectID uuid.UUID, name, value string) (*apiclient.Variable, error)
CreateVariable creates a variable in a project.
func (*Client) DeleteDatabase ¶
func (c *Client) DeleteDatabase(ctx context.Context, projectID uuid.UUID, databaseName string) error
DeleteDatabase deletes one database by name.
func (*Client) DeleteDatabaseBackup ¶ added in v0.23.0
func (c *Client) DeleteDatabaseBackup(ctx context.Context, projectID uuid.UUID, databaseName, backupName string) error
DeleteDatabaseBackup deletes one backup by name.
func (*Client) DeleteDatabaseBranch ¶ added in v0.21.0
func (c *Client) DeleteDatabaseBranch(ctx context.Context, projectID uuid.UUID, databaseName, branchName string) error
DeleteDatabaseBranch deletes one branch by name.
func (*Client) DeleteDurableFunction ¶ added in v0.26.0
func (c *Client) DeleteDurableFunction(ctx context.Context, projectID uuid.UUID, function string) error
DeleteDurableFunction starts deleting one durable function by ID or name.
func (*Client) DeleteDurableFunctionScheduler ¶ added in v0.26.0
func (c *Client) DeleteDurableFunctionScheduler( ctx context.Context, projectID uuid.UUID, function string, schedulerID uuid.UUID, ) error
DeleteDurableFunctionScheduler deletes one scheduler of a durable function.
func (*Client) DeleteFrontend ¶
DeleteFrontend starts deleting one frontend by ID.
func (*Client) DeleteFrontendCustomDomain ¶
func (c *Client) DeleteFrontendCustomDomain(ctx context.Context, projectID, frontendID uuid.UUID) error
DeleteFrontendCustomDomain detaches the configured custom domain from a frontend.
func (*Client) DeleteFrontendFunctionRoute ¶ added in v0.42.0
func (c *Client) DeleteFrontendFunctionRoute(ctx context.Context, projectID, frontendID, routeID uuid.UUID) error
DeleteFrontendFunctionRoute stops forwarding one route's path prefix.
func (*Client) DeleteFunction ¶
DeleteFunction starts deleting one function by ID.
func (*Client) DeleteFunctionScheduler ¶
func (c *Client) DeleteFunctionScheduler(ctx context.Context, projectID, functionID, schedulerID uuid.UUID) error
DeleteFunctionScheduler deletes one scheduler for a function.
func (*Client) DeleteProject ¶
DeleteProject starts project deletion.
func (*Client) DeleteSandboxTemplate ¶ added in v0.38.0
DeleteSandboxTemplate calls the Sandbox DeleteSandbox operation.
func (*Client) DeleteStorageBucket ¶
func (c *Client) DeleteStorageBucket(ctx context.Context, projectID uuid.UUID, bucketName string) error
DeleteStorageBucket removes one bucket from the project.
func (*Client) DeleteStorageObject ¶
DeleteStorageObject removes one object from a bucket.
func (*Client) DeleteStoragePolicy ¶
func (c *Client) DeleteStoragePolicy(ctx context.Context, projectID uuid.UUID, bucketName string, policyID uuid.UUID) error
DeleteStoragePolicy removes one policy from a bucket.
func (*Client) DeleteVariable ¶
DeleteVariable deletes one variable by name.
func (*Client) DeleteVerifiedDomain ¶ added in v0.41.0
DeleteVerifiedDomain gives up the account's ownership of domain.
func (*Client) DenyDurableApproval ¶ added in v0.44.0
func (c *Client) DenyDurableApproval( ctx context.Context, projectID, approvalID uuid.UUID, comment string, ) (*apiclient.DurableApproval, error)
DenyDurableApproval denies a pending approval. A denial resumes the workflow too: it is a decision, not a failure.
func (*Client) DeployDurableFunction ¶ added in v0.26.0
func (c *Client) DeployDurableFunction( ctx context.Context, projectID uuid.UUID, fn DurableFunctionDeployInput, ) (deployed *apiclient.DurableFunction, created bool, err error)
DeployDurableFunction deploys one durable function source archive. It creates the function on the first call for a name and redeploys it after that; created reports which one happened.
func (*Client) DeployFrontend ¶
func (c *Client) DeployFrontend(ctx context.Context, projectID uuid.UUID, input FrontendDeployInput) (*apiclient.Frontend, error)
DeployFrontend uploads one frontend source archive.
func (*Client) DeployFunction ¶
func (c *Client) DeployFunction(ctx context.Context, projectID uuid.UUID, fn FunctionDeployInput) (*apiclient.Function, error)
DeployFunction deploys one function source archive.
func (*Client) DeployFunctionsBatch ¶
func (c *Client) DeployFunctionsBatch(ctx context.Context, projectID uuid.UUID, functions []FunctionDeployInput) (*apiclient.BatchFunctionDeployResponse, error)
DeployFunctionsBatch deploys one batch of function source archives.
func (*Client) DeploySandbox ¶ added in v0.43.0
func (c *Client) DeploySandbox(ctx context.Context, project, template, key uuid.UUID, input SandboxDeployInput) (*apiclient.SandboxDeployment, error)
DeploySandbox uploads a build context for a stable template ID.
func (*Client) DisconnectProjectGit ¶ added in v0.22.0
DisconnectProjectGit removes a project's repo connection. The repository itself is untouched.
func (*Client) DownloadStorageObject ¶
func (c *Client) DownloadStorageObject(ctx context.Context, bucketName, path string) (*http.Response, error)
DownloadStorageObject opens a streaming download for one object. The caller is responsible for closing the response body.
func (*Client) ExchangePlatformToken ¶
func (c *Client) ExchangePlatformToken(ctx context.Context, authAccessToken, clientID string) (*apiclient.PlatformExchangeResponse, error)
ExchangePlatformToken exchanges an auth-user device-flow token for a platform token.
func (*Client) ExecSandbox ¶ added in v0.38.0
func (c *Client) ExecSandbox(ctx context.Context, project, key uuid.UUID, body apiclient.SandboxExecutionRequest) (*apiclient.SandboxExecutionResult, error)
ExecSandbox calls the Sandbox ExecuteSandbox operation.
func (*Client) ExecSandboxSession ¶ added in v0.38.0
func (c *Client) ExecSandboxSession(ctx context.Context, id, key uuid.UUID, body apiclient.SandboxCommandRequest) (*apiclient.SandboxCommandResult, error)
ExecSandboxSession calls the Sandbox ExecuteSandboxSession operation.
func (*Client) GetAccessToken ¶ added in v0.31.0
func (c *Client) GetAccessToken(ctx context.Context, projectID, tokenID uuid.UUID) (*apiclient.ProjectAccessToken, error)
GetAccessToken returns one project access token by ID.
func (*Client) GetAccessTokenUsage ¶ added in v0.31.0
func (c *Client) GetAccessTokenUsage(ctx context.Context, projectID, tokenID uuid.UUID, days int) (*apiclient.ProjectAccessTokenUsage, error)
GetAccessTokenUsage returns the daily request counts for one project access token.
func (*Client) GetDatabase ¶
func (c *Client) GetDatabase(ctx context.Context, projectID uuid.UUID, databaseName string) (*apiclient.Database, error)
GetDatabase returns one database by name.
func (*Client) GetDatabaseBackup ¶ added in v0.23.0
func (c *Client) GetDatabaseBackup(ctx context.Context, projectID uuid.UUID, databaseName, backupName string) (*apiclient.DatabaseBackup, error)
GetDatabaseBackup returns one backup by name.
func (*Client) GetDatabaseBackupSchedule ¶ added in v0.23.0
func (c *Client) GetDatabaseBackupSchedule(ctx context.Context, projectID uuid.UUID, databaseName string) (*apiclient.DatabaseBackupSchedule, error)
GetDatabaseBackupSchedule returns the database's automated backup schedule.
func (*Client) GetDatabaseBranch ¶ added in v0.21.0
func (c *Client) GetDatabaseBranch(ctx context.Context, projectID uuid.UUID, databaseName, branchName string) (*apiclient.DatabaseBranch, error)
GetDatabaseBranch returns one branch by name.
func (*Client) GetDatabaseRestore ¶ added in v0.23.0
func (c *Client) GetDatabaseRestore(ctx context.Context, projectID uuid.UUID, databaseName string, restoreID uuid.UUID) (*apiclient.DatabaseRestore, error)
GetDatabaseRestore returns one restore by id, scoped to the database, so a restore id belonging to another database reads as not found.
func (*Client) GetDurableApproval ¶ added in v0.44.0
func (c *Client) GetDurableApproval( ctx context.Context, projectID, approvalID uuid.UUID, ) (*apiclient.DurableApproval, error)
GetDurableApproval returns one approval, including its decision once a person has made one.
func (*Client) GetDurableApprovalStats ¶ added in v0.44.0
func (c *Client) GetDurableApprovalStats( ctx context.Context, projectID uuid.UUID, function string, from, to *time.Time, ) (*apiclient.DurableApprovalStats, error)
GetDurableApprovalStats counts a project's approvals by outcome from `from` until `to`. A nil to is the API's now, and a nil from 30 days before to.
func (*Client) GetDurableExecution ¶ added in v0.26.0
func (c *Client) GetDurableExecution( ctx context.Context, projectID uuid.UUID, function string, executionID uuid.UUID, ) (*apiclient.DurableExecution, error)
GetDurableExecution returns one durable execution, including its result once it has finished.
func (*Client) GetDurableFunction ¶ added in v0.26.0
func (c *Client) GetDurableFunction(ctx context.Context, projectID uuid.UUID, function string) (*apiclient.DurableFunction, error)
GetDurableFunction returns one durable function by ID or name.
func (*Client) GetFrontend ¶
func (c *Client) GetFrontend(ctx context.Context, projectID, frontendID uuid.UUID) (*apiclient.Frontend, error)
GetFrontend returns one frontend by ID.
func (*Client) GetFrontendCustomDomain ¶
func (c *Client) GetFrontendCustomDomain(ctx context.Context, projectID, frontendID uuid.UUID) (*apiclient.FrontendCustomDomainResponse, error)
GetFrontendCustomDomain returns the configured custom domain for a frontend.
func (*Client) GetFrontendDeploymentLogs ¶
func (c *Client) GetFrontendDeploymentLogs(ctx context.Context, projectID, frontendID, deploymentID uuid.UUID, limit int, cursor string) (*apiclient.LogSearchResponse, error)
GetFrontendDeploymentLogs returns one build log search page for a frontend deployment.
func (*Client) GetFrontendLogs ¶
func (c *Client) GetFrontendLogs(ctx context.Context, projectID, frontendID uuid.UUID, limit int, cursor string) (*apiclient.LogSearchResponse, error)
GetFrontendLogs returns one runtime log search page for a frontend.
func (*Client) GetFunction ¶
func (c *Client) GetFunction(ctx context.Context, projectID, functionID uuid.UUID) (*apiclient.Function, error)
GetFunction returns one function by ID.
func (*Client) GetFunctionDeploymentLogs ¶
func (c *Client) GetFunctionDeploymentLogs(ctx context.Context, projectID, functionID, deploymentID uuid.UUID, limit int, cursor string) (*apiclient.LogSearchResponse, error)
GetFunctionDeploymentLogs returns one build log search page for a function deployment.
func (*Client) GetFunctionLogs ¶
func (c *Client) GetFunctionLogs(ctx context.Context, projectID, functionID uuid.UUID, limit int, cursor string) (*apiclient.LogSearchResponse, error)
GetFunctionLogs returns one runtime log search page for a function.
func (*Client) GetProject ¶
GetProject returns one project by ID.
func (*Client) GetProjectConfigYAML ¶ added in v0.0.5
GetProjectConfigYAML downloads the project configuration as the canonical YAML manifest rendered by the server, returned verbatim.
func (*Client) GetProjectGitConnection ¶ added in v0.22.0
func (c *Client) GetProjectGitConnection(ctx context.Context, projectID uuid.UUID) (*apiclient.ProjectGitConnection, error)
GetProjectGitConnection returns a project's repo connection. A project with no connection answers 404, which surfaces as an *Error carrying that status.
func (*Client) GetProjectGitDeploySettings ¶ added in v0.22.0
func (c *Client) GetProjectGitDeploySettings(ctx context.Context, projectID uuid.UUID) (*apiclient.ProjectGitDeploySettings, error)
GetProjectGitDeploySettings returns what a push to the connected repo's production branch deploys.
func (*Client) GetProjectUsage ¶ added in v0.34.0
func (c *Client) GetProjectUsage(ctx context.Context, projectID uuid.UUID) (*apiclient.ProjectUsageResponse, error)
GetProjectUsage returns aggregate usage for a project. The response also contains hourly and daily series; callers choose whether a command contract needs to render those details.
func (*Client) GetServiceKey ¶ added in v0.0.4
func (c *Client) GetServiceKey(ctx context.Context, projectID, keyID uuid.UUID) (*apiclient.ServiceKey, error)
GetServiceKey returns one service key by ID.
func (*Client) GetStorageBucket ¶
func (c *Client) GetStorageBucket(ctx context.Context, projectID uuid.UUID, bucketName string) (*apiclient.StorageBucket, error)
GetStorageBucket returns one bucket by name.
func (*Client) GetStorageStats ¶
func (c *Client) GetStorageStats(ctx context.Context, projectID uuid.UUID) (*apiclient.StorageStats, error)
GetStorageStats returns aggregate storage statistics for a project.
func (*Client) GetVariable ¶
func (c *Client) GetVariable(ctx context.Context, projectID uuid.UUID, name string) (*apiclient.Variable, error)
GetVariable returns one variable by name.
func (*Client) InvokeFunction ¶ added in v0.0.4
func (c *Client) InvokeFunction(ctx context.Context, functionID uuid.UUID, input FunctionInvokeInput) (*apiclient.FunctionInvocationResponse, error)
InvokeFunction invokes one function by ID.
func (*Client) ListAccessTokens ¶ added in v0.31.0
func (c *Client) ListAccessTokens(ctx context.Context, projectID uuid.UUID, input AccessTokenListInput) (*apiclient.PaginatedProjectAccessTokens, error)
ListAccessTokens lists one project access token page.
func (*Client) ListAccessTokensUsage ¶ added in v0.31.0
func (c *Client) ListAccessTokensUsage(ctx context.Context, projectID uuid.UUID, days int) ([]apiclient.ProjectAccessTokenUsage, error)
ListAccessTokensUsage returns the daily request counts for every access token in a project, revoked tokens included.
func (*Client) ListAnonKeys ¶ added in v0.5.0
func (c *Client) ListAnonKeys(ctx context.Context, projectID uuid.UUID) ([]apiclient.AnonKey, error)
ListAnonKeys lists a project's anon keys — the publishable JWTs that go in the frontend/SDK Authorization header (the value an app build needs).
func (*Client) ListDatabaseBackups ¶ added in v0.23.0
func (c *Client) ListDatabaseBackups(ctx context.Context, projectID uuid.UUID, databaseName string) (*apiclient.DatabaseBackupList, error)
ListDatabaseBackups returns a database's backups along with the window a point-in-time restore may target.
func (*Client) ListDatabaseBranches ¶ added in v0.21.0
func (c *Client) ListDatabaseBranches(ctx context.Context, projectID uuid.UUID, databaseName string) ([]apiclient.DatabaseBranch, error)
ListDatabaseBranches returns every branch of a database.
func (*Client) ListDatabaseRestores ¶ added in v0.23.0
func (c *Client) ListDatabaseRestores(ctx context.Context, projectID uuid.UUID, databaseName string) (*apiclient.DatabaseRestoreList, error)
ListDatabaseRestores returns a database's restore history, newest first. This route keeps answering while a restore is running, which is the point of it.
func (*Client) ListDatabases ¶
func (c *Client) ListDatabases(ctx context.Context, projectID uuid.UUID, page, limit int) (*apiclient.PaginatedDatabases, error)
ListDatabases lists one database page for a project.
func (*Client) ListDurableApprovals ¶ added in v0.44.0
func (c *Client) ListDurableApprovals( ctx context.Context, projectID uuid.UUID, input DurableApprovalListInput, ) (*apiclient.PaginatedDurableApprovals, error)
ListDurableApprovals lists one approval page for a project, newest first.
func (*Client) ListDurableExecutions ¶ added in v0.26.0
func (c *Client) ListDurableExecutions( ctx context.Context, projectID uuid.UUID, function, status string, page, limit int, ) (*apiclient.PaginatedDurableExecutions, error)
ListDurableExecutions lists one execution page for a durable function. The statuses each entry carries are the last the platform observed rather than live state; fetch a single execution for that.
func (*Client) ListDurableFunctionSchedulers ¶ added in v0.26.0
func (c *Client) ListDurableFunctionSchedulers( ctx context.Context, projectID uuid.UUID, function string, ) (*apiclient.FunctionSchedulerListResponse, error)
ListDurableFunctionSchedulers lists schedulers for a durable function.
func (*Client) ListDurableFunctions ¶ added in v0.26.0
func (c *Client) ListDurableFunctions(ctx context.Context, projectID uuid.UUID, page, limit int) (*apiclient.PaginatedDurableFunctions, error)
ListDurableFunctions lists one durable function page for a project.
func (*Client) ListFrontendDeployments ¶
func (c *Client) ListFrontendDeployments(ctx context.Context, projectID, frontendID uuid.UUID, page, limit int) (*apiclient.PaginatedFrontendDeployments, error)
ListFrontendDeployments lists one deployment page for a frontend.
func (*Client) ListFrontendFunctionRoutes ¶ added in v0.42.0
func (c *Client) ListFrontendFunctionRoutes(ctx context.Context, projectID, frontendID uuid.UUID) ([]apiclient.FrontendFunctionRoute, error)
ListFrontendFunctionRoutes lists the paths a frontend forwards to functions.
func (*Client) ListFrontends ¶
func (c *Client) ListFrontends(ctx context.Context, projectID uuid.UUID, page, limit int) (*apiclient.PaginatedFrontends, error)
ListFrontends lists one frontend page for a project.
func (*Client) ListFunctionDeployments ¶
func (c *Client) ListFunctionDeployments(ctx context.Context, projectID, functionID uuid.UUID, page, limit int) (*apiclient.PaginatedFunctionDeployments, error)
ListFunctionDeployments lists one deployment page for a function.
func (*Client) ListFunctionRuntimes ¶
func (c *Client) ListFunctionRuntimes(ctx context.Context) ([]apiclient.FunctionRuntimeOption, error)
ListFunctionRuntimes returns the function runtime catalog.
func (*Client) ListFunctionSchedulers ¶
func (c *Client) ListFunctionSchedulers(ctx context.Context, projectID, functionID uuid.UUID) (*apiclient.FunctionSchedulerListResponse, error)
ListFunctionSchedulers lists schedulers for a function.
func (*Client) ListFunctions ¶
func (c *Client) ListFunctions(ctx context.Context, projectID uuid.UUID, page, limit int) (*apiclient.PaginatedFunctions, error)
ListFunctions lists one function page for a project.
func (*Client) ListGitConnections ¶ added in v0.22.0
ListGitConnections returns the caller's stored git provider connections.
func (*Client) ListGitInstallationRepositories ¶ added in v0.22.0
func (c *Client) ListGitInstallationRepositories(ctx context.Context, connectionID uuid.UUID, installationID int64) ([]apiclient.GitRepository, error)
ListGitInstallationRepositories returns the repos reachable through one installation.
func (*Client) ListGitInstallations ¶ added in v0.22.0
func (c *Client) ListGitInstallations(ctx context.Context, connectionID uuid.UUID) ([]apiclient.GitInstallation, error)
ListGitInstallations returns the GitHub App installations a connection can reach. This is a live proxy to GitHub; nothing is persisted by the call.
func (*Client) ListProjects ¶
func (c *Client) ListProjects(ctx context.Context, page, limit int) (*apiclient.PaginatedProjects, error)
ListProjects lists one project page for the authenticated user.
func (*Client) ListServiceKeys ¶ added in v0.0.4
func (c *Client) ListServiceKeys(ctx context.Context, projectID uuid.UUID, page, limit int) (*apiclient.PaginatedServiceKeys, error)
ListServiceKeys returns one service-key page for a project.
func (*Client) ListStorageBuckets ¶
func (c *Client) ListStorageBuckets(ctx context.Context, projectID uuid.UUID) ([]apiclient.StorageBucket, error)
ListStorageBuckets returns every bucket in the project.
func (*Client) ListStorageObjects ¶
func (c *Client) ListStorageObjects(ctx context.Context, bucketName string, opts StorageObjectListOptions) (*apiclient.StorageListResponse, error)
ListStorageObjects returns one cursor page of objects in a bucket.
func (*Client) ListStoragePolicies ¶
func (c *Client) ListStoragePolicies(ctx context.Context, projectID uuid.UUID, bucketName string) ([]apiclient.StoragePolicy, error)
ListStoragePolicies returns every policy attached to a bucket.
func (*Client) ListVariables ¶
func (c *Client) ListVariables(ctx context.Context, projectID uuid.UUID, page, limit int) (*apiclient.PaginatedVariables, error)
ListVariables lists one variable page for a project.
func (*Client) ListVerifiedDomains ¶ added in v0.41.0
ListVerifiedDomains lists the domains the account has verified.
func (*Client) MoveStorageObject ¶
func (c *Client) MoveStorageObject(ctx context.Context, bucketName, from, to string) (*apiclient.StorageObject, error)
MoveStorageObject renames one object within a bucket.
func (*Client) PollDeviceToken ¶
func (c *Client) PollDeviceToken(ctx context.Context, clientID, deviceCode string) (*DeviceTokenPollResult, error)
PollDeviceToken polls the OAuth device token endpoint once.
func (*Client) ReadSandboxFile ¶ added in v0.38.0
func (c *Client) ReadSandboxFile(ctx context.Context, id uuid.UUID, body apiclient.SandboxFileReadRequest) (*apiclient.SandboxFileResult, error)
ReadSandboxFile calls the Sandbox ReadSandboxSessionFile operation.
func (*Client) RedeployFrontend ¶
func (c *Client) RedeployFrontend(ctx context.Context, projectID, frontendID uuid.UUID) (*apiclient.Frontend, error)
RedeployFrontend starts a new deployment using the last uploaded archive.
func (*Client) RenameProject ¶ added in v0.25.0
func (c *Client) RenameProject(ctx context.Context, projectID uuid.UUID, name string) (*apiclient.Project, error)
RenameProject changes a project's name.
func (*Client) ResetDatabaseBranch ¶ added in v0.21.0
func (c *Client) ResetDatabaseBranch(ctx context.Context, projectID uuid.UUID, databaseName, branchName string) (*apiclient.DatabaseBranch, error)
ResetDatabaseBranch discards a branch's changes and re-forks it from the parent's current state. The rewind runs in the background, so the branch comes back provisioning; poll GetDatabaseBranch until it reports active.
func (*Client) ResetDatabaseBranchPassword ¶ added in v0.21.0
func (c *Client) ResetDatabaseBranchPassword(ctx context.Context, projectID uuid.UUID, databaseName, branchName string) (*apiclient.DatabaseBranch, error)
ResetDatabaseBranchPassword rotates the branch role's password and returns the branch carrying the new connection string.
func (*Client) ResumeSandbox ¶ added in v0.38.0
func (c *Client) ResumeSandbox(ctx context.Context, id uuid.UUID) (*apiclient.SandboxSession, error)
ResumeSandbox calls the Sandbox ResumeSandboxSession operation.
func (*Client) RevokeAccessToken ¶ added in v0.31.0
RevokeAccessToken revokes one project access token by ID.
func (*Client) SandboxAccess ¶ added in v0.38.0
func (c *Client) SandboxAccess(ctx context.Context, id uuid.UUID, body apiclient.SandboxAccessRequest) (*apiclient.SandboxAccess, error)
SandboxAccess calls the Sandbox CreateSandboxSessionAccess operation.
func (*Client) SandboxDeployment ¶ added in v0.43.0
func (c *Client) SandboxDeployment(ctx context.Context, project, template, deployment uuid.UUID) (*apiclient.SandboxDeployment, error)
SandboxDeployment reads the current build and validation status.
func (*Client) SandboxDeploymentLogs ¶ added in v0.43.0
func (c *Client) SandboxDeploymentLogs(ctx context.Context, project, template, deployment uuid.UUID, params *apiclient.GetSandboxDeploymentLogsParams) (*apiclient.SandboxBuildLogPage, error)
SandboxDeploymentLogs reads a bounded page of regional build logs.
func (*Client) SandboxDeploymentSource ¶ added in v0.43.0
func (c *Client) SandboxDeploymentSource(ctx context.Context, project, template, deployment uuid.UUID, output io.Writer) error
SandboxDeploymentSource streams the original build context to output.
func (*Client) SandboxDeployments ¶ added in v0.43.0
func (c *Client) SandboxDeployments(ctx context.Context, project, template uuid.UUID, cursor string, limit int) (*apiclient.SandboxDeploymentPage, error)
SandboxDeployments lists one deployment history page.
func (*Client) SandboxPresets ¶ added in v0.38.0
SandboxPresets calls the Sandbox ListSandboxPresets operation.
func (*Client) SandboxSession ¶ added in v0.38.0
func (c *Client) SandboxSession(ctx context.Context, id uuid.UUID) (*apiclient.SandboxSession, error)
SandboxSession calls the Sandbox GetSandboxSession operation.
func (*Client) SandboxSessions ¶ added in v0.38.0
func (c *Client) SandboxSessions(ctx context.Context, project uuid.UUID, params *apiclient.ListSandboxSessionsParams) (*apiclient.SandboxSessionPage, error)
SandboxSessions calls the Sandbox ListSandboxSessions operation.
func (*Client) SandboxTemplate ¶ added in v0.38.0
func (c *Client) SandboxTemplate(ctx context.Context, project, id uuid.UUID) (*apiclient.SandboxTemplate, error)
SandboxTemplate calls the Sandbox GetSandbox operation.
func (*Client) SandboxTemplates ¶ added in v0.38.0
func (c *Client) SandboxTemplates(ctx context.Context, project uuid.UUID, params *apiclient.ListSandboxesParams) (*apiclient.SandboxTemplatePage, error)
SandboxTemplates calls the Sandbox ListSandboxes operation.
func (*Client) SetStorageObjectVisibility ¶
func (c *Client) SetStorageObjectVisibility(ctx context.Context, bucketName, path string, isPublic bool) (*apiclient.StorageObject, error)
SetStorageObjectVisibility updates the public/private flag for one object.
func (*Client) StartDeviceAuthorization ¶
func (c *Client) StartDeviceAuthorization(ctx context.Context, clientID string) (*apiclient.DeviceAuthorizationResponse, error)
StartDeviceAuthorization starts the OAuth device authorization flow.
func (*Client) StartDurableExecution ¶ added in v0.26.0
func (c *Client) StartDurableExecution( ctx context.Context, projectID uuid.UUID, function string, input DurableExecutionStartInput, ) (*apiclient.DurableExecution, error)
StartDurableExecution starts one durable execution and returns its handle. A durable execution outlives any request that could wait for it, so this never carries a result.
func (*Client) StartSandbox ¶ added in v0.38.0
func (c *Client) StartSandbox(ctx context.Context, project, key uuid.UUID, body apiclient.CreateSandboxSessionRequest) (*apiclient.SandboxSession, error)
StartSandbox calls the Sandbox CreateSandboxSession operation.
func (*Client) StopDurableExecution ¶ added in v0.26.0
func (c *Client) StopDurableExecution( ctx context.Context, projectID uuid.UUID, function string, executionID uuid.UUID, ) (*apiclient.DurableExecution, error)
StopDurableExecution stops one durable execution. Completed steps are not undone; the execution stops where it is.
func (*Client) StreamFrontendDeploymentLogs ¶ added in v0.0.4
func (c *Client) StreamFrontendDeploymentLogs(ctx context.Context, projectID, frontendID, deploymentID uuid.UUID, limit int, lastEventID string) (*ProjectLogStream, error)
StreamFrontendDeploymentLogs opens a build log stream for a frontend deployment.
func (*Client) StreamFrontendLogs ¶ added in v0.0.4
func (c *Client) StreamFrontendLogs(ctx context.Context, projectID, frontendID uuid.UUID, limit int, lastEventID string) (*ProjectLogStream, error)
StreamFrontendLogs opens a runtime log stream for a frontend.
func (*Client) StreamFunctionDeploymentLogs ¶ added in v0.0.4
func (c *Client) StreamFunctionDeploymentLogs(ctx context.Context, projectID, functionID, deploymentID uuid.UUID, limit int, lastEventID string) (*ProjectLogStream, error)
StreamFunctionDeploymentLogs opens a build log stream for a function deployment.
func (*Client) StreamFunctionLogs ¶ added in v0.0.4
func (c *Client) StreamFunctionLogs(ctx context.Context, projectID, functionID uuid.UUID, limit int, lastEventID string) (*ProjectLogStream, error)
StreamFunctionLogs opens a runtime log stream for a function.
func (*Client) SuspendSandbox ¶ added in v0.38.0
func (c *Client) SuspendSandbox(ctx context.Context, id uuid.UUID) (*apiclient.SandboxSession, error)
SuspendSandbox calls the Sandbox SuspendSandboxSession operation.
func (*Client) TerminateSandbox ¶ added in v0.38.0
func (c *Client) TerminateSandbox(ctx context.Context, id uuid.UUID) (*apiclient.SandboxSession, error)
TerminateSandbox calls the Sandbox TerminateSandboxSession operation.
func (*Client) UpdateDatabaseBackupSchedule ¶ added in v0.23.0
func (c *Client) UpdateDatabaseBackupSchedule(ctx context.Context, projectID uuid.UUID, databaseName string, entries []apiclient.DatabaseBackupScheduleEntry) (*apiclient.DatabaseBackupSchedule, error)
UpdateDatabaseBackupSchedule replaces the schedule wholesale. An empty entries slice stops scheduled backups. The API clamps retention to the plan's, so the schedule it returns can differ from the one sent.
func (*Client) UpdateDatabaseBranch ¶ added in v0.21.0
func (c *Client) UpdateDatabaseBranch(ctx context.Context, projectID uuid.UUID, databaseName, branchName string, ttlSeconds int64) (*apiclient.DatabaseBranch, error)
UpdateDatabaseBranch re-arms a branch's lifetime from now.
func (*Client) UpdateDurableFunctionScheduler ¶ added in v0.26.0
func (c *Client) UpdateDurableFunctionScheduler( ctx context.Context, projectID uuid.UUID, function string, schedulerID uuid.UUID, input FunctionSchedulerInput, ) (*apiclient.FunctionScheduler, error)
UpdateDurableFunctionScheduler updates one scheduler of a durable function.
func (*Client) UpdateFrontendFunctionRoute ¶ added in v0.42.0
func (c *Client) UpdateFrontendFunctionRoute( ctx context.Context, projectID, frontendID, routeID uuid.UUID, route apiclient.CreateFrontendFunctionRouteRequest, ) (*apiclient.FrontendFunctionRoute, error)
UpdateFrontendFunctionRoute replaces one route's prefix, target, and stripping.
func (*Client) UpdateFunctionScheduler ¶
func (c *Client) UpdateFunctionScheduler(ctx context.Context, projectID, functionID, schedulerID uuid.UUID, input FunctionSchedulerInput) (*apiclient.FunctionScheduler, error)
UpdateFunctionScheduler updates one scheduler for a function.
func (*Client) UpdateFunctionVisibility ¶
func (c *Client) UpdateFunctionVisibility( ctx context.Context, projectID, functionID uuid.UUID, visibility apiclient.FunctionVisibility, ) (*apiclient.Function, error)
UpdateFunctionVisibility sets who can invoke one function.
func (*Client) UpdateStorageBucket ¶
func (c *Client) UpdateStorageBucket(ctx context.Context, projectID uuid.UUID, bucketName string, input StorageBucketUpdateInput) (*apiclient.StorageBucket, error)
UpdateStorageBucket updates one bucket's configuration.
func (*Client) UpdateVariable ¶
func (c *Client) UpdateVariable(ctx context.Context, projectID uuid.UUID, name, value string) (*apiclient.Variable, error)
UpdateVariable updates one variable by name.
func (*Client) UploadStorageObject ¶
func (c *Client) UploadStorageObject(ctx context.Context, bucketName, path, contentType string, content io.Reader) (*apiclient.StorageObject, error)
UploadStorageObject uploads one object to a bucket via a streaming multipart request. The body is assembled lazily through an io.Pipe so the caller's reader is consumed in fixed-size chunks rather than buffered in memory.
func (*Client) ValidateToken ¶
ValidateToken validates the configured token by listing projects.
func (*Client) VerifyDomain ¶ added in v0.41.0
func (c *Client) VerifyDomain(ctx context.Context, domain string) (*apiclient.VerifiedDomain, bool, error)
VerifyDomain proves the account owns domain once DNS serves its record. created is false when the account had already verified it.
func (*Client) WriteSandboxFile ¶ added in v0.38.0
func (c *Client) WriteSandboxFile(ctx context.Context, id uuid.UUID, body apiclient.SandboxFileWriteRequest) error
WriteSandboxFile calls the Sandbox WriteSandboxSessionFile operation.
type DeviceTokenPollResult ¶
DeviceTokenPollResult is the normalized result of a device-token poll.
type DurableApprovalListInput ¶ added in v0.44.0
type DurableApprovalListInput struct {
Function string
Status string
ExecutionID *uuid.UUID
From *time.Time
To *time.Time
Page int
Limit int
}
DurableApprovalListInput filters one approval page. Empty and nil fields apply no filter, so an empty Status lists approvals in every status.
type DurableExecutionStartInput ¶ added in v0.26.0
DurableExecutionStartInput contains one durable execution start request. Name is the idempotency key: repeating a start with the same one returns the execution that already exists rather than beginning a second.
type DurableFunctionDeployInput ¶ added in v0.26.0
type DurableFunctionDeployInput struct {
Name string
Runtime string
Handler string
SourceArchive []byte
// Visibility is nil to keep a deployed function's current visibility.
Visibility *apiclient.FunctionVisibility
// VariableScope and Variables carry the manifest's declaration, nil when it
// declared none — which leaves an existing function's scope alone.
VariableScope *string
Variables *[]string
}
DurableFunctionDeployInput contains one packaged durable function source archive.
type Error ¶
type Error struct {
StatusCode int
Message string
// Code is the API's machine-readable code, when the response declares one.
Code string
}
Error is a normalized error returned for non-successful API responses.
type FrontendCustomDomainInput ¶
type FrontendCustomDomainInput struct {
Domain string
CertificatePEM string
PrivateKeyPEM string
CertificateChainPEM string
}
FrontendCustomDomainInput contains one custom domain attach request.
type FrontendDeployInput ¶
type FrontendDeployInput struct {
Name string
Framework string
AppRoot string
VariableScope string
Variables []string
Archive []byte
}
FrontendDeployInput contains one packaged frontend source archive.
type FunctionDeployInput ¶
type FunctionDeployInput struct {
Name string
Runtime string
Handler string
SourceArchive []byte
VariableScope *string
Variables *[]string
}
FunctionDeployInput contains one packaged function source archive. A nil VariableScope or Variables sends no field at all, which leaves the stored declaration on the server unchanged.
type FunctionInvokeInput ¶ added in v0.0.4
FunctionInvokeInput contains one function invocation request.
type FunctionSchedulerInput ¶
type FunctionSchedulerInput struct {
Name string
CronExpression string
Payload map[string]any
Regions []string
Enabled *bool
}
FunctionSchedulerInput contains one function scheduler create or update request.
type Instructions ¶ added in v0.1.0
type Instructions struct {
CLIInstruction string
LatestVersion string
CreditURL string
DeviceInstruction string
}
Instructions is a snapshot of the most recent VOL-180 protocol signals observed on any API response in this process.
func ConsumeCLIInstructions ¶ added in v0.1.0
func ConsumeCLIInstructions() Instructions
ConsumeCLIInstructions returns each observed CLI instruction/latest-version/ credit-URL combination once. Repeated API responses commonly carry the same combination, so retaining the last consumed one prevents a long-running command from rendering the same notice again after a poll or stream reconnect. CreditURL is part of the identity so a later response with the same instruction and version but a changed credit URL is treated as new information and rendered again, instead of being suppressed as a repeat. DeviceInstruction is returned unchanged because callers render the reauthentication hint from LastInstructions alongside command errors.
func LastInstructions ¶ added in v0.1.0
func LastInstructions() Instructions
LastInstructions returns the most recently observed VOL-180 instructions from any API response in this process. It retains the latest observed values after ConsumeCLIInstructions renders their one-shot notice so error paths can still use response metadata such as LatestVersion. It is the zero value if no API call has completed yet — e.g. local-only commands (init, help, version, completion) never populate this, since they never make a request.
A CLI process runs exactly one command per invocation, so "most recent" is simply "from the request(s) this command made" — there is no cross-command state to reconcile.
type Option ¶
type Option func(*options)
Option configures a cloud API client.
func WithHTTPClient ¶
func WithHTTPClient(httpClient apiclient.HttpRequestDoer) Option
WithHTTPClient injects the HTTP client used by the generated API client.
type OwnershipRequiredError ¶ added in v0.41.0
type OwnershipRequiredError struct {
Err *Error
Record apiclient.FrontendDomainVerificationRecord
}
OwnershipRequiredError is an ownership refusal. Its message names the record to publish, so every command that can hit it tells the user what to do.
func (*OwnershipRequiredError) Error ¶ added in v0.41.0
func (e *OwnershipRequiredError) Error() string
func (*OwnershipRequiredError) Unwrap ¶ added in v0.41.0
func (e *OwnershipRequiredError) Unwrap() error
type ProjectConfigValidationError ¶ added in v0.0.5
type ProjectConfigValidationError struct {
Errors []apiclient.ProjectConfigValidationError
}
ProjectConfigValidationError is returned when the server rejects a config manifest with 422. Nothing was applied; Errors carries the full list.
func (*ProjectConfigValidationError) Error ¶ added in v0.0.5
func (e *ProjectConfigValidationError) Error() string
type ProjectLogStream ¶ added in v0.0.4
type ProjectLogStream struct {
// contains filtered or unexported fields
}
ProjectLogStream reads project log Server-Sent Events.
func (*ProjectLogStream) Close ¶ added in v0.0.4
func (s *ProjectLogStream) Close() error
Close closes the underlying response body.
func (*ProjectLogStream) Next ¶ added in v0.0.4
func (s *ProjectLogStream) Next() (*ProjectLogStreamEvent, error)
Next returns the next non-comment SSE event.
type ProjectLogStreamEvent ¶ added in v0.0.4
type ProjectLogStreamEvent struct {
ID string
Type string
Data string
Log *apiclient.LogSearchEvent
Warning string
}
ProjectLogStreamEvent is one parsed project log stream event.
type Refusal ¶ added in v0.31.0
type Refusal struct {
// ProjectID is the project the refused request addressed, empty when its
// route was not project-scoped.
ProjectID string
// ProjectAccessToken reports whether the refused request carried a pt-
// credential.
ProjectAccessToken bool
}
Refusal describes the request behind the most recent 403 in this process.
It is read from the request as it goes out rather than resolved from the configuration afterwards, because the two can disagree: a command that takes a project ID as an argument addresses a project the configuration never selected, and a local-mode command sends no credential at all. A caller explaining a refusal has to describe what was sent.
Recorded process-wide instead of carried on Error for the same reason LastInstructions is: the error is built from a status and a body, neither of which names the request, and a CLI process runs exactly one command — so "most recent" is "this command's".
func LastRefusal ¶ added in v0.31.0
func LastRefusal() Refusal
LastRefusal returns the request behind the most recent 403 observed on any API response in this process. It is the zero value until one is refused.
type SandboxDeployInput ¶ added in v0.43.0
SandboxDeployInput contains a custom image build context and configuration.
type StorageBucketCreateInput ¶
StorageBucketCreateInput captures fields supported by bucket creation.
type StorageBucketUpdateInput ¶
StorageBucketUpdateInput captures fields supported by bucket update.
type StorageObjectListOptions ¶
StorageObjectListOptions controls the object list query.
type StoragePolicyCreateInput ¶
type StoragePolicyCreateInput struct {
Name string
Definition string
Operation apiclient.CreateStoragePolicyRequestOperation
}
StoragePolicyCreateInput captures fields supported by policy creation.
Source Files
¶
- access_tokens.go
- auth.go
- client.go
- database_backups.go
- database_branches.go
- databases.go
- debug.go
- durable_approvals.go
- durable_functions.go
- errors.go
- frontends.go
- functions.go
- git.go
- log_stream.go
- logs.go
- network_error.go
- project_config.go
- projects.go
- refusal.go
- sandbox_deployments.go
- sandboxes.go
- service_keys.go
- storage.go
- usage.go
- variables.go
- verified_domains.go
- version_protocol.go