Documentation
¶
Overview ¶
Package api wraps the Miabi /api/v1 HTTP surface, unwrapping its {success,data,error} envelope.
Index ¶
- Constants
- Variables
- func IsBackupFailure(status string) bool
- func IsBackupTerminal(status string) bool
- func IsFailure(status string) bool
- func IsRunTerminal(status string) bool
- func IsSettled(status string) bool
- func IsTerminal(status string) bool
- func MigrationRunDone(status string) bool
- func MigrationSettled(status string) bool
- type APIError
- type Alert
- type App
- type AppDatabase
- type ApplyFailure
- type ApplyRequest
- type ApplyResult
- type AttachVolumeRequest
- type Backup
- type Change
- type Client
- func (c *Client) AckAlert(ctx context.Context, ws string, id uint) (*Alert, error)
- func (c *Client) Alerts(ctx context.Context, ws string, activeOnly bool) ([]Alert, error)
- func (c *Client) App(ctx context.Context, ws string, app string) (*App, error)
- func (c *Client) AppDatabases(ctx context.Context, ws string, app string) ([]AppDatabase, error)
- func (c *Client) AppEvents(ctx context.Context, ws string, app string, limit int) ([]Event, error)
- func (c *Client) AppMigrations(ctx context.Context, ws string, app string) ([]Migration, error)
- func (c *Client) Apply(ctx context.Context, ws string, manifests string, prune, force bool) (*ApplyResult, error)
- func (c *Client) Apps(ctx context.Context, ws string) ([]App, error)
- func (c *Client) AttachDatabase(ctx context.Context, ws string, app string, dbID uint, req LinkDatabaseRequest) (*LinkDatabaseResult, error)
- func (c *Client) AttachVolume(ctx context.Context, ws string, app string, req AttachVolumeRequest) error
- func (c *Client) Backups(ctx context.Context, ws string, id, dbID uint) ([]Backup, error)
- func (c *Client) CancelWorkspaceMigration(ctx context.Context, ws string) error
- func (c *Client) ClaimLoginToken(ctx context.Context, code string) (*LoginToken, error)
- func (c *Client) Config(ctx context.Context, ws string, id uint) (*Config, error)
- func (c *Client) ConfigData(ctx context.Context, ws string, id uint) (map[string]string, error)
- func (c *Client) ConfigUsage(ctx context.Context, ws string, id uint) ([]SecretUsage, error)
- func (c *Client) Configs(ctx context.Context, ws string) ([]Config, error)
- func (c *Client) CreateApp(ctx context.Context, ws string, req CreateAppRequest) (*App, error)
- func (c *Client) CreateConfig(ctx context.Context, ws string, req CreateConfigRequest) (*Config, error)
- func (c *Client) CreateDatabase(ctx context.Context, ws string, req CreateDatabaseRequest) (*DatabaseInstance, error)
- func (c *Client) CreateLogicalDatabase(ctx context.Context, ws string, id uint, req CreateLogicalDatabaseRequest) (*CreateLogicalDatabaseResult, error)
- func (c *Client) CreateSecret(ctx context.Context, ws string, req CreateSecretRequest) (*Secret, error)
- func (c *Client) CreateVolume(ctx context.Context, ws string, req CreateVolumeRequest) (*Volume, error)
- func (c *Client) Database(ctx context.Context, ws string, id uint) (*DatabaseInstance, error)
- func (c *Client) DatabaseCredentials(ctx context.Context, ws string, id uint) (*ConnectionInfo, error)
- func (c *Client) DatabaseEngines(ctx context.Context, ws string) ([]EngineDefault, error)
- func (c *Client) Databases(ctx context.Context, ws string) ([]DatabaseInstance, error)
- func (c *Client) Delete(ctx context.Context, ws string, manifests string) (*ApplyResult, error)
- func (c *Client) DeleteApp(ctx context.Context, ws string, app string) error
- func (c *Client) DeleteConfig(ctx context.Context, ws string, id uint) error
- func (c *Client) DeleteDatabaseInstance(ctx context.Context, ws string, id uint) error
- func (c *Client) DeleteLogicalDatabase(ctx context.Context, ws string, id, dbID uint) error
- func (c *Client) DeleteSecret(ctx context.Context, ws string, id uint) error
- func (c *Client) DeleteVolume(ctx context.Context, ws string, id uint) error
- func (c *Client) DeleteVolumeBackup(ctx context.Context, ws string, id, backupID uint) error
- func (c *Client) DeleteVolumeFile(ctx context.Context, ws string, id uint, path string) error
- func (c *Client) Deploy(ctx context.Context, ws string, app string, req DeployRequest, ...) (*DeployResult, error)
- func (c *Client) DeployStack(ctx context.Context, ws string, id uint, outdatedOnly bool) ([]StackDeployResult, error)
- func (c *Client) Deployment(ctx context.Context, ws string, app string, depID uint) (*Deployment, error)
- func (c *Client) DeploymentByNumber(ctx context.Context, ws string, app string, number int) (*Deployment, error)
- func (c *Client) Deployments(ctx context.Context, ws string, app string) ([]Deployment, error)
- func (c *Client) DetachDatabase(ctx context.Context, ws string, app string, dbID uint) error
- func (c *Client) DetachVolume(ctx context.Context, ws string, app string, volumeID uint) error
- func (c *Client) DownloadVolumeFile(ctx context.Context, ws string, id uint, path string, dst io.Writer) (int64, error)
- func (c *Client) EnvVars(ctx context.Context, ws string, app string) ([]EnvVar, error)
- func (c *Client) FindConfigByName(ctx context.Context, ws, name string) (*Config, error)
- func (c *Client) FindSecretByName(ctx context.Context, ws, name string) (*Secret, error)
- func (c *Client) FindVolumeBackup(ctx context.Context, ws string, id, backupID uint) (*VolumeBackup, error)
- func (c *Client) FindVolumeByName(ctx context.Context, ws, name string) (*Volume, error)
- func (c *Client) ImportEnv(ctx context.Context, ws string, app string, req ImportEnvRequest) error
- func (c *Client) ImportStack(ctx context.Context, ws string, req ImportStackRequest) (*StackImportResult, error)
- func (c *Client) ImportWorkspace(ctx context.Context, body MigrationImport) (*MigrationRun, error)
- func (c *Client) InvalidateBuildCache(ctx context.Context, ws string, app string) error
- func (c *Client) LinkDatabaseInstance(ctx context.Context, ws string, app string, instID uint, ...) (*LinkDatabaseResult, error)
- func (c *Client) LogicalDatabaseConnection(ctx context.Context, ws string, id, dbID uint) (*ConnectionInfo, error)
- func (c *Client) LogicalDatabases(ctx context.Context, ws string, id uint) ([]LogicalDatabase, error)
- func (c *Client) Me(ctx context.Context) (*Me, error)
- func (c *Client) Migration(ctx context.Context, ws string, id uint) (*Migration, error)
- func (c *Client) MigrationAction(ctx context.Context, ws string, id uint, action string) (*Migration, error)
- func (c *Client) MigrationRun(ctx context.Context, id uint) (*MigrationRun, error)
- func (c *Client) MigrationStatus(ctx context.Context) (*MigrationStatus, error)
- func (c *Client) Migrations(ctx context.Context, ws string) ([]Migration, error)
- func (c *Client) PinVolumeBackup(ctx context.Context, ws string, id, backupID uint, pinned bool) (*VolumeBackup, error)
- func (c *Client) PipelineRun(ctx context.Context, ws string, runID uint) (*PipelineRun, error)
- func (c *Client) PipelineVersioning(ctx context.Context, ws, pipeline string) (*VersionPolicy, error)
- func (c *Client) Pipelines(ctx context.Context, ws string) ([]Pipeline, error)
- func (c *Client) PlanApply(ctx context.Context, ws string, manifests string, prune, force bool) (*Plan, error)
- func (c *Client) PlanDelete(ctx context.Context, ws string, manifests string) (*Plan, error)
- func (c *Client) PlanMigration(ctx context.Context, ws string, app string, body StartMigration) (*MigrationPlan, error)
- func (c *Client) ProbeMigration(ctx context.Context, src MigrationSource) (*MigrationProbe, error)
- func (c *Client) ReleaseByVersion(ctx context.Context, ws string, app string, version int) (*Release, error)
- func (c *Client) Releases(ctx context.Context, ws string, app string) ([]Release, error)
- func (c *Client) RerunPipelineRun(ctx context.Context, ws string, runID uint, req RerunPipelineRequest) (*PipelineRun, error)
- func (c *Client) ResolveAlert(ctx context.Context, ws string, id uint) (*Alert, error)
- func (c *Client) ResolveConfigID(ctx context.Context, ws, ref string) (uint, error)
- func (c *Client) ResolveDatabaseID(ctx context.Context, ws, ref string) (uint, error)
- func (c *Client) ResolveLogicalDatabaseID(ctx context.Context, ws string, id uint, ref string) (uint, error)
- func (c *Client) ResolveSecretID(ctx context.Context, ws, ref string) (uint, error)
- func (c *Client) ResolveStackID(ctx context.Context, ws, ref string) (uint, error)
- func (c *Client) ResolveVolumeID(ctx context.Context, ws, ref string) (uint, error)
- func (c *Client) ResolveWorkspaceName(ctx context.Context, ref, fallback string) (string, error)
- func (c *Client) RestartApp(ctx context.Context, ws string, app string) error
- func (c *Client) RestartDatabase(ctx context.Context, ws string, id uint) error
- func (c *Client) RestoreVolumeBackup(ctx context.Context, ws string, id, backupID uint) error
- func (c *Client) ResyncAppPipeline(ctx context.Context, ws string, app string) (*ResyncPipelineResult, error)
- func (c *Client) RevealSecret(ctx context.Context, ws string, id uint) (string, error)
- func (c *Client) Rollback(ctx context.Context, ws string, app string, req RollbackRequest, ...) (*DeployResult, error)
- func (c *Client) RunBackup(ctx context.Context, ws string, id, dbID uint, comment string) (*Backup, error)
- func (c *Client) RunVolumeBackup(ctx context.Context, ws string, id uint) (*VolumeBackup, error)
- func (c *Client) SealingKey(ctx context.Context, ws string) (*SealingKey, error)
- func (c *Client) SecretUsage(ctx context.Context, ws string, id uint) ([]SecretUsage, error)
- func (c *Client) Secrets(ctx context.Context, ws string) ([]Secret, error)
- func (c *Client) SetAppSource(ctx context.Context, ws string, app string, req SetAppSourceRequest) (*SetAppSourceResult, error)
- func (c *Client) SetEnv(ctx context.Context, ws string, app string, req SetEnvRequest) error
- func (c *Client) Stack(ctx context.Context, ws string, id uint) (*Stack, error)
- func (c *Client) Stacks(ctx context.Context, ws string) ([]StackListItem, error)
- func (c *Client) StartApp(ctx context.Context, ws string, app string) error
- func (c *Client) StartDatabase(ctx context.Context, ws string, id uint) error
- func (c *Client) StartMigration(ctx context.Context, ws string, app string, body StartMigration) (*Migration, error)
- func (c *Client) StartWorkspaceMigration(ctx context.Context, ws string, body MigrationStartRequest) (*MigrationStarted, error)
- func (c *Client) StopApp(ctx context.Context, ws string, app string) error
- func (c *Client) StopDatabase(ctx context.Context, ws string, id uint) error
- func (c *Client) SwitchVersionSeries(ctx context.Context, ws, policy, series string) (*VersionPolicy, error)
- func (c *Client) TrafficSummary(ctx context.Context, ws string, appID uint, rng string) (*TrafficSummary, error)
- func (c *Client) TriggerPipeline(ctx context.Context, ws, pipeline string, req TriggerPipelineRequest) (*PipelineRun, error)
- func (c *Client) UnfreezeWorkspace(ctx context.Context, ws string) error
- func (c *Client) UnlinkDatabaseInstance(ctx context.Context, ws string, app string, instID uint) error
- func (c *Client) UpdateConfig(ctx context.Context, ws string, id uint, req UpdateConfigRequest) (*Config, error)
- func (c *Client) UpdateSecret(ctx context.Context, ws string, id uint, req UpdateSecretRequest) (*Secret, error)
- func (c *Client) UpdateVersionPolicy(ctx context.Context, ws, policy string, s VersionSettings) (*VersionPolicy, error)
- func (c *Client) UpgradeDatabase(ctx context.Context, ws string, id uint, req UpgradeDatabaseRequest) (*DatabaseInstance, error)
- func (c *Client) UploadVolumeFile(ctx context.Context, ws string, id uint, subdir, name string, ...) (string, error)
- func (c *Client) VerifyVolumeBackup(ctx context.Context, ws string, id, backupID uint) (*VerifyResult, error)
- func (c *Client) VersionAllocations(ctx context.Context, ws, policy string, size int) ([]VersionAllocation, error)
- func (c *Client) Volume(ctx context.Context, ws string, id uint) (*VolumeDetail, error)
- func (c *Client) VolumeBackupConfigured(ctx context.Context, ws string, id uint) (bool, error)
- func (c *Client) VolumeBackupLogs(ctx context.Context, ws string, id, backupID uint) ([]byte, error)
- func (c *Client) VolumeBackups(ctx context.Context, ws string, id uint) ([]VolumeBackup, error)
- func (c *Client) VolumeFiles(ctx context.Context, ws string, id uint) ([]VolumeFile, error)
- func (c *Client) Volumes(ctx context.Context, ws string) ([]Volume, error)
- func (c *Client) WaitForDeploy(ctx context.Context, ws string, app string, depID uint, ...) (*Deployment, error)
- func (c *Client) WaitForMigration(ctx context.Context, ws string, id uint, onPhase func(*Migration)) (*Migration, error)
- func (c *Client) WaitForMigrationRun(ctx context.Context, id uint, every time.Duration, ...) (*MigrationRun, error)
- func (c *Client) WaitForPipelineRun(ctx context.Context, ws string, runID uint, onUpdate func(status string)) (*PipelineRun, error)
- func (c *Client) WaitForVolumeBackup(ctx context.Context, ws string, id, backupID uint, ...) (*VolumeBackup, error)
- func (c *Client) Workspace(ctx context.Context, ref string) (*Workspace, error)
- func (c *Client) WorkspaceEvents(ctx context.Context, ws string, limit int) ([]Event, error)
- func (c *Client) WorkspaceMigration(ctx context.Context, ws string) (*MigrationOverview, error)
- func (c *Client) WorkspaceOverview(ctx context.Context, ws string) (*WorkspaceOverview, error)
- func (c *Client) WorkspaceStorage(ctx context.Context, ws string) (*WorkspaceStorage, error)
- func (c *Client) WorkspaceUsage(ctx context.Context, ws string) (map[string]any, error)
- func (c *Client) Workspaces(ctx context.Context) ([]Workspace, error)
- type Config
- type ConfigReveal
- type ConnectionInfo
- type CreateAppRequest
- type CreateConfigRequest
- type CreateDatabaseRequest
- type CreateLogicalDatabaseRequest
- type CreateLogicalDatabaseResult
- type CreateSecretRequest
- type CreateVolumeRequest
- type DatabaseInstance
- type DeployRequest
- type DeployResult
- type Deployment
- type EngineDefault
- type EnvVar
- type Event
- type ImportEnvRequest
- type ImportStackRequest
- type LinkDatabaseRequest
- type LinkDatabaseResult
- type LogicalDatabase
- type LoginToken
- type Me
- type Migration
- type MigrationDBChoice
- type MigrationDBItem
- type MigrationExport
- type MigrationImport
- type MigrationIssue
- type MigrationOverview
- type MigrationPlan
- type MigrationProbe
- type MigrationReportItem
- type MigrationRun
- type MigrationSource
- type MigrationStartRequest
- type MigrationStarted
- type MigrationStatus
- type MigrationWindow
- type MigrationWorkspace
- type Options
- type OverviewApp
- type Pipeline
- type PipelineRun
- type Plan
- type Release
- type RerunPipelineRequest
- type ResyncPipelineResult
- type RollbackRequest
- type ScopeError
- type SealingKey
- type Secret
- type SecretReveal
- type SecretUsage
- type SetAppSourceRequest
- type SetAppSourceResult
- type SetEnvRequest
- type SourceChange
- type Stack
- type StackDeployResult
- type StackImportResult
- type StackImportSkip
- type StackListItem
- type StackPortConflict
- type StackStatusCounts
- type StartMigration
- type TrafficSummary
- type TriggerPipelineRequest
- type UpdateConfigRequest
- type UpdateSecretRequest
- type UpgradeDatabaseRequest
- type VerifyResult
- type VersionAllocation
- type VersionBranches
- type VersionPolicy
- type VersionSettings
- type Volume
- type VolumeBackup
- type VolumeBackupStatus
- type VolumeDetail
- type VolumeFile
- type VolumeUploadResult
- type VolumeUsage
- type Workspace
- type WorkspaceOverview
- type WorkspaceStorage
Constants ¶
const ( StatusSucceeded = "succeeded" StatusRunning = "running" // legacy terminal success StatusFailed = "failed" // StatusCanary is not terminal: it waits for a human to promote or abort it. StatusCanary = "canary" )
"running" is a legacy terminal success; any status that is not terminal is in progress.
const ( BackupPending = "pending" BackupRunning = "running" BackupCompleted = "completed" BackupFailed = "failed" )
Backup statuses: "running" is in flight here but terminal for a deployment.
const BackupRunTimeout = 30 * time.Minute
BackupRunTimeout is long because the server runs a manual backup inline in the request.
const FileTransferTimeout = 30 * time.Minute
FileTransferTimeout replaces the 30s control-plane timeout, too short for large files on slow links.
const MaxEventPage = 100
MaxEventPage is the largest page the workspace events feed serves.
const MaxListedVolumeFiles = 5000
MaxListedVolumeFiles mirrors the panel's unreported listing cap; a listing this long may be truncated.
const MaxServerWait = 900 * time.Second
MaxServerWait is the longest ?wait= the server accepts on deploy and rollback.
const MaxVolumeUploadBytes = 512 << 20
MaxVolumeUploadBytes mirrors the panel's cap so an oversized file fails before it is sent.
const MigrationImportTimeout = 2 * time.Minute
MigrationImportTimeout covers /migrations and /migrations/probe, which reach the source before answering.
const RestoreTimeout = 60 * time.Minute
RestoreTimeout exceeds the 30s default because the panel restores inline before answering.
Variables ¶
var Version = "dev"
Version is stamped at build time (see .goreleaser.yaml); used in User-Agent.
Functions ¶
func IsBackupFailure ¶ added in v0.12.0
func IsBackupTerminal ¶ added in v0.12.0
func IsRunTerminal ¶ added in v0.17.0
func IsSettled ¶ added in v0.17.0
IsSettled is also true for a canary, which will not move until someone promotes it.
func IsTerminal ¶
func MigrationRunDone ¶ added in v0.22.0
func MigrationSettled ¶ added in v0.16.0
MigrationSettled reports whether it stopped moving on its own: cut over, waiting for a person, or ended.
Types ¶
type APIError ¶
type Alert ¶ added in v0.17.0
type Alert struct {
ID uint `json:"id"`
Category string `json:"category"`
Severity string `json:"severity"`
State string `json:"state"` // firing | acknowledged | resolved
Title string `json:"title"`
Body string `json:"body"`
Count int64 `json:"count"`
SubjectType string `json:"subject_type"`
SubjectRef string `json:"subject_ref"`
FirstSeen time.Time `json:"first_seen"`
LastSeen time.Time `json:"last_seen"`
}
type App ¶
type App struct {
ID uint `json:"id"`
Name string `json:"name"`
DisplayName string `json:"display_name"`
Image string `json:"image"`
Tag string `json:"tag"`
// SourceType is "image" or "git".
SourceType string `json:"source_type"`
GitRepo string `json:"git_repo,omitempty"`
GitRef string `json:"git_ref,omitempty"`
Status string `json:"status"`
CurrentReleaseID *uint `json:"current_release_id"`
CreatedAt time.Time `json:"created_at"`
}
type AppDatabase ¶ added in v0.18.0
type AppDatabase struct {
LogicalDatabase
Kind string `json:"kind"`
InstanceName string `json:"instance_name"`
Engine string `json:"engine"`
Host string `json:"host"`
Port int `json:"port"`
}
AppDatabase is a logical database (kind "database") or a whole instance (kind "instance", ids are its).
type ApplyFailure ¶
type ApplyRequest ¶
type ApplyRequest struct {
Manifests string `json:"manifests"`
Prune bool `json:"prune"`
DryRun bool `json:"dry_run"`
// Delete removes exactly the resources the bundle names instead of converging.
Delete bool `json:"delete,omitempty"`
// Force changes resources a GitOps project owns; its next sync reverts them.
Force bool `json:"force,omitempty"`
}
type ApplyResult ¶
type ApplyResult struct {
Plan *Plan `json:"plan"`
Applied int `json:"applied"`
DryRun bool `json:"dry_run"`
Failures []ApplyFailure `json:"failures,omitempty"`
}
type AttachVolumeRequest ¶ added in v0.12.0
type Backup ¶ added in v0.17.0
type Backup struct {
ID uint `json:"id"`
Number int `json:"number"`
Status string `json:"status"`
Trigger string `json:"trigger"`
Destination string `json:"destination"`
SizeBytes int64 `json:"size_bytes"`
Comment string `json:"comment,omitempty"`
Error string `json:"error,omitempty"`
CreatedAt time.Time `json:"created_at"`
FinishedAt *time.Time `json:"finished_at,omitempty"`
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func New ¶
New fails on an unreadable CA bundle rather than silently falling back to the system roots.
func (*Client) AckAlert ¶ added in v0.17.0
AckAlert acknowledges an alert: it stays active but stops re-notifying.
func (*Client) Alerts ¶ added in v0.17.0
Alerts with activeOnly keeps the firing and acknowledged ones.
func (*Client) AppDatabases ¶ added in v0.18.0
func (*Client) AppMigrations ¶ added in v0.16.0
func (*Client) AttachDatabase ¶ added in v0.18.0
func (c *Client) AttachDatabase(ctx context.Context, ws string, app string, dbID uint, req LinkDatabaseRequest) (*LinkDatabaseResult, error)
func (*Client) AttachVolume ¶ added in v0.12.0
func (c *Client) AttachVolume(ctx context.Context, ws string, app string, req AttachVolumeRequest) error
AttachVolume only flags the app for a redeploy; it does not restart it.
func (*Client) CancelWorkspaceMigration ¶ added in v0.22.0
CancelWorkspaceMigration closes ws's open migration, so its code stops working; ws "" closes the install's.
func (*Client) ClaimLoginToken ¶ added in v0.10.0
ClaimLoginToken is public (the one-time code is the credential), so it works on a client without a token.
func (*Client) ConfigData ¶ added in v0.10.0
ConfigData returns a config's decrypted files (admin only, audited).
func (*Client) ConfigUsage ¶ added in v0.10.0
func (*Client) CreateConfig ¶ added in v0.10.0
func (*Client) CreateDatabase ¶ added in v0.10.0
func (c *Client) CreateDatabase(ctx context.Context, ws string, req CreateDatabaseRequest) (*DatabaseInstance, error)
func (*Client) CreateLogicalDatabase ¶ added in v0.10.0
func (c *Client) CreateLogicalDatabase(ctx context.Context, ws string, id uint, req CreateLogicalDatabaseRequest) (*CreateLogicalDatabaseResult, error)
func (*Client) CreateSecret ¶ added in v0.10.0
func (*Client) CreateVolume ¶ added in v0.12.0
func (*Client) DatabaseCredentials ¶ added in v0.10.0
func (*Client) DatabaseEngines ¶ added in v0.10.0
func (*Client) DeleteConfig ¶ added in v0.10.0
func (*Client) DeleteDatabaseInstance ¶ added in v0.10.0
func (*Client) DeleteLogicalDatabase ¶ added in v0.10.0
func (*Client) DeleteSecret ¶ added in v0.10.0
func (*Client) DeleteVolume ¶ added in v0.12.0
DeleteVolume fails with 409 while an application still mounts the volume.
func (*Client) DeleteVolumeBackup ¶ added in v0.12.0
func (*Client) DeleteVolumeFile ¶ added in v0.12.0
DeleteVolumeFile is recursive for directories.
func (*Client) Deploy ¶
func (c *Client) Deploy(ctx context.Context, ws string, app string, req DeployRequest, wait time.Duration) (*DeployResult, error)
Deploy: a server may answer before the deployment settles despite wait, so callers must still poll.
func (*Client) DeployStack ¶ added in v0.23.0
func (*Client) Deployment ¶
func (c *Client) Deployment(ctx context.Context, ws string, app string, depID uint) (*Deployment, error)
Deployment falls back to the recent list when the server lacks the per-deployment GET (404/405).
func (*Client) DeploymentByNumber ¶ added in v0.10.0
func (c *Client) DeploymentByNumber(ctx context.Context, ws string, app string, number int) (*Deployment, error)
DeploymentByNumber maps the per-app number users pass to the deployment, whose ID API paths use.
func (*Client) Deployments ¶
func (*Client) DetachDatabase ¶ added in v0.18.0
func (*Client) DetachVolume ¶ added in v0.12.0
DetachVolume keeps the volume's data.
func (*Client) DownloadVolumeFile ¶ added in v0.12.0
func (c *Client) DownloadVolumeFile(ctx context.Context, ws string, id uint, path string, dst io.Writer) (int64, error)
DownloadVolumeFile streams so a file up to the panel's 512 MiB cap is never held in memory.
func (*Client) EnvVars ¶ added in v0.10.0
EnvVars returns secret values masked; the API never returns them in plaintext.
func (*Client) FindConfigByName ¶ added in v0.10.0
FindConfigByName returns nil, not an error, when no config has that name.
func (*Client) FindSecretByName ¶ added in v0.10.0
FindSecretByName returns nil, not an error, when no secret has that name.
func (*Client) FindVolumeBackup ¶ added in v0.12.0
func (c *Client) FindVolumeBackup(ctx context.Context, ws string, id, backupID uint) (*VolumeBackup, error)
FindVolumeBackup filters the history because there is no single-backup endpoint.
func (*Client) FindVolumeByName ¶ added in v0.12.0
FindVolumeByName returns the named volume, or nil when none exists.
func (*Client) ImportStack ¶ added in v0.23.0
func (c *Client) ImportStack(ctx context.Context, ws string, req ImportStackRequest) (*StackImportResult, error)
func (*Client) ImportWorkspace ¶ added in v0.22.0
func (c *Client) ImportWorkspace(ctx context.Context, body MigrationImport) (*MigrationRun, error)
func (*Client) InvalidateBuildCache ¶ added in v0.11.0
func (*Client) LinkDatabaseInstance ¶ added in v0.18.0
func (c *Client) LinkDatabaseInstance(ctx context.Context, ws string, app string, instID uint, req LinkDatabaseRequest) (*LinkDatabaseResult, error)
func (*Client) LogicalDatabaseConnection ¶ added in v0.10.0
func (*Client) LogicalDatabases ¶ added in v0.10.0
func (*Client) MigrationAction ¶ added in v0.16.0
func (*Client) MigrationRun ¶ added in v0.22.0
func (*Client) MigrationStatus ¶ added in v0.22.0
func (c *Client) MigrationStatus(ctx context.Context) (*MigrationStatus, error)
func (*Client) Migrations ¶ added in v0.16.0
func (*Client) PinVolumeBackup ¶ added in v0.15.0
func (*Client) PipelineRun ¶ added in v0.17.0
func (*Client) PipelineVersioning ¶ added in v0.21.0
func (*Client) PlanDelete ¶
func (*Client) PlanMigration ¶ added in v0.16.0
func (c *Client) PlanMigration(ctx context.Context, ws string, app string, body StartMigration) (*MigrationPlan, error)
func (*Client) ProbeMigration ¶ added in v0.22.0
func (c *Client) ProbeMigration(ctx context.Context, src MigrationSource) (*MigrationProbe, error)
func (*Client) ReleaseByVersion ¶ added in v0.10.0
func (c *Client) ReleaseByVersion(ctx context.Context, ws string, app string, version int) (*Release, error)
ReleaseByVersion resolves a version to the release, since rollback takes the release ID.
func (*Client) RerunPipelineRun ¶ added in v0.11.0
func (c *Client) RerunPipelineRun(ctx context.Context, ws string, runID uint, req RerunPipelineRequest) (*PipelineRun, error)
func (*Client) ResolveAlert ¶ added in v0.17.0
func (*Client) ResolveConfigID ¶ added in v0.10.0
func (*Client) ResolveDatabaseID ¶ added in v0.10.0
func (*Client) ResolveLogicalDatabaseID ¶ added in v0.17.0
func (c *Client) ResolveLogicalDatabaseID(ctx context.Context, ws string, id uint, ref string) (uint, error)
ResolveLogicalDatabaseID selects the instance's only database when ref is empty.
func (*Client) ResolveSecretID ¶ added in v0.10.0
func (*Client) ResolveStackID ¶ added in v0.23.0
func (*Client) ResolveVolumeID ¶ added in v0.12.0
func (*Client) ResolveWorkspaceName ¶ added in v0.10.0
ResolveWorkspaceName falls back to fallback, then the sole visible workspace; it always returns a name.
func (*Client) RestartApp ¶ added in v0.10.0
func (*Client) RestartDatabase ¶ added in v0.10.0
func (*Client) RestoreVolumeBackup ¶ added in v0.12.0
RestoreVolumeBackup overwrites the volume and blocks for the whole restore.
func (*Client) ResyncAppPipeline ¶ added in v0.10.0
func (*Client) RevealSecret ¶ added in v0.10.0
RevealSecret returns a secret's decrypted value (admin only, audited).
func (*Client) Rollback ¶
func (c *Client) Rollback(ctx context.Context, ws string, app string, req RollbackRequest, wait time.Duration) (*DeployResult, error)
func (*Client) RunBackup ¶ added in v0.17.0
func (c *Client) RunBackup(ctx context.Context, ws string, id, dbID uint, comment string) (*Backup, error)
RunBackup returns the finished record; its status says whether the backup succeeded.
func (*Client) RunVolumeBackup ¶ added in v0.12.0
RunVolumeBackup only enqueues: the returned record is pending, not finished.
func (*Client) SealingKey ¶ added in v0.19.0
func (*Client) SecretUsage ¶ added in v0.10.0
func (*Client) Secrets ¶ added in v0.10.0
Secrets asks for a large page so the paginated list arrives in one call; values never come back.
func (*Client) SetAppSource ¶ added in v0.10.0
func (c *Client) SetAppSource(ctx context.Context, ws string, app string, req SetAppSourceRequest) (*SetAppSourceResult, error)
SetAppSource replaces the whole source: the server clears the fields of the source being left.
func (*Client) Stack ¶ added in v0.23.0
Stack returns one stack with its member apps; the API addresses stacks by id or uid, not name.
func (*Client) StartDatabase ¶ added in v0.10.0
func (*Client) StartMigration ¶ added in v0.16.0
func (*Client) StartWorkspaceMigration ¶ added in v0.22.0
func (c *Client) StartWorkspaceMigration(ctx context.Context, ws string, body MigrationStartRequest) (*MigrationStarted, error)
StartWorkspaceMigration with ws "" opens the install (platform admin); starting again replaces the code.
func (*Client) StopDatabase ¶ added in v0.10.0
func (*Client) SwitchVersionSeries ¶ added in v0.21.0
func (*Client) TrafficSummary ¶ added in v0.17.0
func (c *Client) TrafficSummary(ctx context.Context, ws string, appID uint, rng string) (*TrafficSummary, error)
TrafficSummary's rng is 15m, 1h, 24h, 7d…; empty means the server default of 24h.
func (*Client) TriggerPipeline ¶ added in v0.11.0
func (c *Client) TriggerPipeline(ctx context.Context, ws, pipeline string, req TriggerPipelineRequest) (*PipelineRun, error)
TriggerPipeline takes the pipeline's numeric id or uid.
func (*Client) UnfreezeWorkspace ¶ added in v0.22.0
UnfreezeWorkspace lifts the freeze a migration put on ws, rolling the migration back on the source.
func (*Client) UnlinkDatabaseInstance ¶ added in v0.18.0
func (*Client) UpdateConfig ¶ added in v0.10.0
func (*Client) UpdateSecret ¶ added in v0.10.0
func (*Client) UpdateVersionPolicy ¶ added in v0.21.0
func (c *Client) UpdateVersionPolicy(ctx context.Context, ws, policy string, s VersionSettings) (*VersionPolicy, error)
func (*Client) UpgradeDatabase ¶ added in v0.10.0
func (c *Client) UpgradeDatabase(ctx context.Context, ws string, id uint, req UpgradeDatabaseRequest) (*DatabaseInstance, error)
func (*Client) UploadVolumeFile ¶ added in v0.12.0
func (c *Client) UploadVolumeFile(ctx context.Context, ws string, id uint, subdir, name string, content io.Reader) (string, error)
UploadVolumeFile overwrites an existing file; subdir may be empty.
func (*Client) VerifyVolumeBackup ¶ added in v0.15.0
func (c *Client) VerifyVolumeBackup(ctx context.Context, ws string, id, backupID uint) (*VerifyResult, error)
VerifyVolumeBackup checks presence, size and, for a sealed recovery point, that the passphrase opens it.
func (*Client) VersionAllocations ¶ added in v0.21.0
func (*Client) Volume ¶ added in v0.12.0
Volume takes a numeric id only, unlike the file routes; resolve names with ResolveVolumeID.
func (*Client) VolumeBackupConfigured ¶ added in v0.12.0
func (*Client) VolumeBackupLogs ¶ added in v0.12.0
func (*Client) VolumeBackups ¶ added in v0.12.0
func (*Client) VolumeFiles ¶ added in v0.12.0
func (*Client) Volumes ¶ added in v0.12.0
Volumes fetches every volume at once; the endpoint is not paginated.
func (*Client) WaitForDeploy ¶
func (c *Client) WaitForDeploy(ctx context.Context, ws string, app string, depID uint, onUpdate func(status string)) (*Deployment, error)
WaitForDeploy also stops on a canary awaiting promotion, which will not move on its own.
func (*Client) WaitForMigration ¶ added in v0.16.0
func (*Client) WaitForMigrationRun ¶ added in v0.22.0
func (c *Client) WaitForMigrationRun(ctx context.Context, id uint, every time.Duration, onChange func(*MigrationRun)) (*MigrationRun, error)
func (*Client) WaitForPipelineRun ¶ added in v0.17.0
func (*Client) WaitForVolumeBackup ¶ added in v0.12.0
func (*Client) WorkspaceEvents ¶ added in v0.17.0
WorkspaceEvents pages are zero-based on the server.
func (*Client) WorkspaceMigration ¶ added in v0.22.0
WorkspaceMigration returns ws's migration state on the source; ws "" returns the install's.
func (*Client) WorkspaceOverview ¶ added in v0.17.0
func (*Client) WorkspaceStorage ¶ added in v0.12.0
func (*Client) WorkspaceUsage ¶ added in v0.17.0
WorkspaceUsage is passed through as-is because its shape grows with every plan limit.
type Config ¶ added in v0.10.0
type Config struct {
ID uint `json:"id"`
UID string `json:"uid"`
Name string `json:"name"`
DisplayName string `json:"display_name"`
Description string `json:"description"`
Digest string `json:"digest"`
Mode string `json:"mode"`
Sensitive bool `json:"sensitive"`
Delimiters []string `json:"delimiters,omitempty"`
Version int `json:"version"`
Managed bool `json:"managed"`
Keys []string `json:"keys"`
Sizes map[string]int `json:"sizes"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
Config content never comes back on list or get, only keys, sizes and the digest.
type ConfigReveal ¶ added in v0.10.0
type ConnectionInfo ¶ added in v0.10.0
type CreateAppRequest ¶ added in v0.10.0
type CreateAppRequest struct {
DisplayName string `json:"display_name"`
Name string `json:"name,omitempty"`
ServerID uint `json:"server_id,omitempty"`
SourceType string `json:"source_type,omitempty"`
Image string `json:"image,omitempty"`
Tag string `json:"tag,omitempty"`
GitRepo string `json:"git_repo,omitempty"`
GitRef string `json:"git_ref,omitempty"`
BuildMethod string `json:"build_method,omitempty"`
Port int `json:"port,omitempty"`
Command []string `json:"command,omitempty"`
}
CreateAppRequest: the server derives Name from DisplayName when Name is empty.
type CreateConfigRequest ¶ added in v0.10.0
type CreateConfigRequest struct {
Name string `json:"name"`
DisplayName string `json:"display_name,omitempty"`
Description string `json:"description,omitempty"`
Data map[string]string `json:"data"`
Mode string `json:"mode,omitempty"`
Sensitive bool `json:"sensitive,omitempty"`
Delimiters []string `json:"delimiters,omitempty"`
}
type CreateDatabaseRequest ¶ added in v0.10.0
type CreateLogicalDatabaseRequest ¶ added in v0.10.0
type CreateLogicalDatabaseResult ¶ added in v0.10.0
type CreateLogicalDatabaseResult struct {
Database LogicalDatabase `json:"database"`
EnvInjected bool `json:"env_injected"`
}
type CreateSecretRequest ¶ added in v0.10.0
type CreateVolumeRequest ¶ added in v0.12.0
type CreateVolumeRequest struct {
Name string `json:"name"`
ServerID uint `json:"server_id,omitempty"`
SizeMB int `json:"size_mb,omitempty"`
// DriverOpts are the backend's mount options (NFS/CIFS: device, o; host: path), encrypted and never returned.
Driver string `json:"driver,omitempty"`
DriverOpts map[string]string `json:"driver_opts,omitempty"`
}
CreateVolumeRequest is final: a volume has no update endpoint.
type DatabaseInstance ¶ added in v0.10.0
type DatabaseInstance struct {
ID uint `json:"id"`
Name string `json:"name"`
DisplayName string `json:"display_name"`
Engine string `json:"engine"`
Version string `json:"version"`
Status string `json:"status"`
ServerID uint `json:"server_id"`
ServerName string `json:"server_name,omitempty"`
Host string `json:"host"`
Port int `json:"port"`
AdminUser string `json:"admin_user"`
SizeBytes int64 `json:"size_bytes,omitempty"`
NetworkName string `json:"network_name,omitempty"`
CreatedAt time.Time `json:"created_at"`
}
type DeployRequest ¶
type DeployRequest struct {
Tag string `json:"tag,omitempty"`
Strategy string `json:"strategy,omitempty"`
RegistryID *uint `json:"registry_id,omitempty"`
// NoCache rebuilds every layer for this deploy only (git-source apps).
NoCache bool `json:"no_cache,omitempty"`
}
DeployRequest carries no image (the app owns it), only a tag/registry/strategy override.
type DeployResult ¶ added in v0.17.0
type DeployResult struct {
Kind string `json:"kind"` // deployment | pipeline_run
Deployment *Deployment `json:"deployment,omitempty"`
Run *PipelineRun `json:"run,omitempty"`
// WaitTimedOut is set when the server was asked to wait and gave up first.
WaitTimedOut bool `json:"wait_timed_out,omitempty"`
}
DeployResult sets exactly one of Deployment and Run: a repo-owned pipeline deploys by running it.
type Deployment ¶
type Deployment struct {
ID uint `json:"id"`
// Number is the per-app number users see; ID is the durable key API paths use.
Number int `json:"number"`
ApplicationID uint `json:"application_id"`
Status string `json:"status"`
Image string `json:"image"`
Trigger string `json:"trigger"`
Strategy string `json:"strategy"`
Error string `json:"error"`
StartedAt *time.Time `json:"started_at"`
FinishedAt *time.Time `json:"finished_at"`
CreatedAt time.Time `json:"created_at"`
Current bool `json:"current"`
}
type EngineDefault ¶ added in v0.10.0
type EnvVar ¶ added in v0.10.0
type EnvVar struct {
Key string `json:"key"`
Value string `json:"value"`
IsSecret bool `json:"is_secret"`
}
The server masks secret values, so Value is never their plaintext.
type Event ¶ added in v0.17.0
type Event struct {
ID uint `json:"id"`
SubjectType string `json:"subject_type,omitempty"`
ApplicationID uint `json:"application_id,omitempty"`
DatabaseID uint `json:"database_id,omitempty"`
Type string `json:"type"`
Severity string `json:"severity"`
Message string `json:"message"`
Metadata map[string]string `json:"metadata,omitempty"`
AppName string `json:"app_name,omitempty"`
DatabaseName string `json:"database_name,omitempty"`
CreatedAt time.Time `json:"created_at"`
}
Event.AppName is only filled on the workspace-wide feed.
type ImportEnvRequest ¶
type ImportStackRequest ¶ added in v0.23.0
type LinkDatabaseRequest ¶ added in v0.18.0
type LinkDatabaseRequest struct {
EnvPrefix string `json:"env_prefix,omitempty"`
EnvMap map[string]string `json:"env_map,omitempty"`
}
LinkDatabaseRequest.EnvMap renames a connection field's env var; an empty name skips that field.
type LinkDatabaseResult ¶ added in v0.18.0
type LogicalDatabase ¶ added in v0.10.0
type LogicalDatabase struct {
ID uint `json:"id"`
InstanceID uint `json:"instance_id"`
Name string `json:"name"`
Username string `json:"username"`
Status string `json:"status"`
ApplicationID *uint `json:"application_id"`
EnvPrefix string `json:"env_prefix,omitempty"`
EnvMap map[string]string `json:"env_map,omitempty"`
EnvVars []string `json:"env_vars,omitempty"`
SizeBytes int64 `json:"size_bytes,omitempty"`
CreatedAt time.Time `json:"created_at"`
}
type LoginToken ¶ added in v0.10.0
type Me ¶
type Me struct {
ID uint `json:"id"`
Name string `json:"name"`
Username string `json:"username"`
Email string `json:"email"`
Role string `json:"role"`
Auth struct {
Method string `json:"method"` // api_key | jwt
APIKeyID *uint `json:"api_key_id"` // when method=api_key
WorkspaceID *uint `json:"workspace_id"` // set only for workspace-bound keys
Scopes []string `json:"scopes"`
} `json:"auth"`
}
type Migration ¶ added in v0.16.0
type Migration struct {
ID uint `json:"id"`
AppName string `json:"app_name"`
Status string `json:"status"`
Phase string `json:"phase"`
Plan MigrationPlan `json:"plan"`
Progress struct {
Items []struct {
Kind string `json:"kind"`
Name string `json:"name"`
Status string `json:"status"`
Bytes int64 `json:"bytes"`
Total int64 `json:"total"`
} `json:"items"`
EstimatedDowntimeSeconds int `json:"estimated_downtime_seconds"`
Message string `json:"message"`
} `json:"progress"`
Report struct {
Notes []string `json:"notes"`
} `json:"report"`
Error string `json:"error"`
FinalizeAfter *time.Time `json:"finalize_after"`
CreatedAt time.Time `json:"created_at"`
}
type MigrationDBChoice ¶ added in v0.16.0
type MigrationDBItem ¶ added in v0.16.0
type MigrationExport ¶ added in v0.22.0
type MigrationExport struct {
ID uint `json:"id"`
Workspace string `json:"workspace"`
Status string `json:"status"`
Phase string `json:"phase,omitempty"`
Error string `json:"error,omitempty"`
Freeze bool `json:"freeze"`
Data bool `json:"data"`
Completed bool `json:"completed"`
ImportedBy string `json:"imported_by,omitempty"`
CreatedAt time.Time `json:"created_at"`
}
type MigrationImport ¶ added in v0.22.0
type MigrationImport struct {
MigrationSource
SourceWorkspace string `json:"source_workspace,omitempty"`
NewWorkspace string `json:"new_workspace,omitempty"`
RestoreData bool `json:"restore_data"`
DeployApps bool `json:"deploy_apps"`
Freeze bool `json:"freeze"`
Rehearse bool `json:"rehearse"`
RetireSource bool `json:"retire_source"`
}
type MigrationIssue ¶ added in v0.16.0
type MigrationOverview ¶ added in v0.22.0
type MigrationOverview struct {
Enabled bool `json:"enabled"`
Window *MigrationWindow `json:"window"`
Frozen bool `json:"frozen"`
FrozenReason string `json:"frozen_reason,omitempty"`
Exports []MigrationExport `json:"exports"`
URL string `json:"url,omitempty"`
}
type MigrationPlan ¶ added in v0.16.0
type MigrationPlan struct {
Location string `json:"location"`
LocationLabel string `json:"location_label"`
Volumes []struct {
VolumeID uint `json:"volume_id"`
Name string `json:"name"`
Action string `json:"action"`
UsedBytes int64 `json:"used_bytes"`
StorageClass string `json:"storage_class"`
} `json:"volumes"`
Databases []MigrationDBItem `json:"databases"`
Blockers []MigrationIssue `json:"blockers"`
Warnings []MigrationIssue `json:"warnings"`
CopyBytes int64 `json:"copy_bytes"`
}
type MigrationProbe ¶ added in v0.22.0
type MigrationProbe struct {
InstallID string `json:"install_id"`
Version string `json:"version"`
Schema int `json:"schema"`
// CodeWorkspace is the workspace a workspace code was started for; empty for an instance code.
CodeWorkspace string `json:"code_workspace,omitempty"`
Workspaces []MigrationWorkspace `json:"workspaces"`
}
type MigrationReportItem ¶ added in v0.22.0
type MigrationRun ¶ added in v0.22.0
type MigrationRun struct {
ID uint `json:"id"`
WorkspaceID uint `json:"workspace_id"`
TargetWorkspaceID uint `json:"target_workspace_id,omitempty"`
Ref string `json:"ref,omitempty"`
Status string `json:"status"`
Phase string `json:"phase,omitempty"`
SourceWorkspace string `json:"source_workspace,omitempty"`
RestoreData bool `json:"restore_data"`
DeployApps bool `json:"deploy_apps"`
Artifacts int `json:"artifacts"`
SizeBytes int64 `json:"size_bytes"`
Report struct {
Items []MigrationReportItem `json:"items,omitempty"`
Notes []string `json:"notes,omitempty"`
} `json:"report"`
Migration *struct {
SourceURL string `json:"source_url,omitempty"`
SourceVersion string `json:"source_version,omitempty"`
Freeze bool `json:"freeze,omitempty"`
Rehearse bool `json:"rehearse,omitempty"`
RetireSource bool `json:"retire_source,omitempty"`
SourceRetired bool `json:"source_retired,omitempty"`
SourceUnfrozen bool `json:"source_unfrozen,omitempty"`
BatchID string `json:"batch_id,omitempty"`
} `json:"migration,omitempty"`
Error string `json:"error,omitempty"`
StartedAt *time.Time `json:"started_at"`
FinishedAt *time.Time `json:"finished_at"`
CreatedAt time.Time `json:"created_at"`
}
type MigrationSource ¶ added in v0.22.0
type MigrationSource struct {
Code string `json:"code"`
InsecureTLS bool `json:"insecure_skip_tls_verify"`
CABundle string `json:"ca_bundle,omitempty"`
}
MigrationSource.CABundle is PEM text, not a path.
type MigrationStartRequest ¶ added in v0.22.0
type MigrationStartRequest struct {
ExpiresInHours int `json:"expires_in_hours,omitempty"`
}
type MigrationStarted ¶ added in v0.22.0
type MigrationStarted struct {
Code string `json:"code"`
SourceURL string `json:"source_url,omitempty"`
Workspace string `json:"workspace,omitempty"`
ExpiresAt time.Time `json:"expires_at"`
}
MigrationStarted is an open migration as started; Code is shown only once.
type MigrationStatus ¶ added in v0.22.0
MigrationStatus is GET /migrations/status: whether MIABI_MIGRATION_ENABLED is set on a server.
type MigrationWindow ¶ added in v0.22.0
type MigrationWorkspace ¶ added in v0.22.0
type OverviewApp ¶ added in v0.17.0
type PipelineRun ¶ added in v0.11.0
type PipelineRun struct {
ID uint `json:"id"`
PipelineID uint `json:"pipeline_id"`
Number int `json:"number"`
Status string `json:"status"`
Trigger string `json:"trigger,omitempty"`
Branch string `json:"branch,omitempty"`
Commit string `json:"commit,omitempty"`
Version string `json:"version,omitempty"`
ImageTag string `json:"image_tag,omitempty"`
NoCache bool `json:"no_cache,omitempty"`
Error string `json:"error,omitempty"`
StartedAt *time.Time `json:"started_at,omitempty"`
FinishedAt *time.Time `json:"finished_at,omitempty"`
CreatedAt time.Time `json:"created_at"`
}
type RerunPipelineRequest ¶ added in v0.11.0
type RerunPipelineRequest struct {
NoCache bool `json:"no_cache,omitempty"`
}
type ResyncPipelineResult ¶ added in v0.10.0
type ResyncPipelineResult struct {
Pipeline *struct {
Name string `json:"name"`
SourcePath string `json:"source_path"`
SourceRef string `json:"source_ref"`
} `json:"pipeline"`
Changed bool `json:"changed"`
Adopted bool `json:"adopted"`
}
ResyncPipelineResult.Changed is false when the stored document already matched: a no-op, not a failure.
type RollbackRequest ¶
type RollbackRequest struct {
ReleaseID uint `json:"release_id"`
}
type ScopeError ¶ added in v0.17.0
ScopeError is a 403 for a missing API key scope, not the caller's workspace role.
func (*ScopeError) Error ¶ added in v0.17.0
func (e *ScopeError) Error() string
func (*ScopeError) Unwrap ¶ added in v0.17.0
func (e *ScopeError) Unwrap() error
type SealingKey ¶ added in v0.19.0
type Secret ¶ added in v0.10.0
type Secret struct {
ID uint `json:"id"`
UID string `json:"uid"`
Name string `json:"name"`
DisplayName string `json:"display_name"`
Description string `json:"description"`
// Version bumps on each value rotation.
Version int `json:"version"`
// Managed secrets belong to a platform resource; rotate them via the owner, not by hand.
Managed bool `json:"managed"`
// SealedKeyVersion is set when the value came from a sealed value in a manifest.
SealedKeyVersion int `json:"sealed_key_version,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
Secret values are write-only over the API; Name is the handle env refs use (${{ secrets.NAME }}).
type SecretReveal ¶ added in v0.10.0
type SecretReveal struct {
Value string `json:"value"`
}
type SecretUsage ¶ added in v0.10.0
type SetAppSourceRequest ¶ added in v0.10.0
type SetAppSourceRequest struct {
SourceType string `json:"source_type"`
Image string `json:"image,omitempty"`
Tag string `json:"tag,omitempty"`
RegistryID *uint `json:"registry_id,omitempty"`
GitRepo string `json:"git_repo,omitempty"`
GitRef string `json:"git_ref,omitempty"`
GitRepositoryID *uint `json:"git_repository_id,omitempty"`
BuildMethod string `json:"build_method,omitempty"`
Builder string `json:"builder,omitempty"`
}
SetAppSourceRequest is a whole-source replacement; the server clears the other source's fields.
type SetAppSourceResult ¶ added in v0.10.0
type SetAppSourceResult struct {
Application App `json:"application"`
Change SourceChange `json:"change"`
}
type SetEnvRequest ¶
type SourceChange ¶ added in v0.10.0
type SourceChange struct {
From string `json:"from"`
To string `json:"to"`
// Switched is false when only the details changed (a new tag, a different branch).
Switched bool `json:"switched"`
// PipelineRemoved is true when leaving git dropped a repo-owned pipeline.
PipelineRemoved bool `json:"pipeline_removed"`
// RedeployRequired is true when the running container no longer matches the source.
RedeployRequired bool `json:"redeploy_required"`
}
SourceChange is worth surfacing: none of it shows in the app record afterwards.
type Stack ¶ added in v0.23.0
type Stack struct {
ID uint `json:"id"`
UID string `json:"uid,omitempty"`
Name string `json:"name"`
DisplayName string `json:"display_name"`
Description string `json:"description,omitempty"`
ClusterID uint `json:"cluster_id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Apps []App `json:"apps,omitempty"`
}
type StackDeployResult ¶ added in v0.23.0
type StackDeployResult struct {
AppID uint `json:"app_id"`
AppName string `json:"app_name"`
Status string `json:"status"`
DeploymentID uint `json:"deployment_id,omitempty"`
Error string `json:"error,omitempty"`
}
StackDeployResult is one member app's outcome; Status is queued or failed.
type StackImportResult ¶ added in v0.23.0
type StackImportResult struct {
Stack *Stack `json:"stack"`
Created []string `json:"created"`
Volumes []string `json:"volumes"`
PortRequests int `json:"port_requests"`
PortConflicts []StackPortConflict `json:"port_conflicts"`
Skipped []StackImportSkip `json:"skipped"`
Warnings []string `json:"warnings"`
}
type StackImportSkip ¶ added in v0.23.0
type StackListItem ¶ added in v0.23.0
type StackListItem struct {
Stack
AppCount int64 `json:"app_count"`
Status StackStatusCounts `json:"status"`
}
type StackPortConflict ¶ added in v0.23.0
type StackStatusCounts ¶ added in v0.23.0
type StartMigration ¶ added in v0.16.0
type StartMigration struct {
Location string `json:"location"`
Databases []MigrationDBChoice `json:"databases,omitempty"`
CutoverMode string `json:"cutover_mode,omitempty"`
BandwidthKBps int `json:"bandwidth_kbps,omitempty"`
}
type TrafficSummary ¶ added in v0.17.0
type TrafficSummary struct {
Totals struct {
Requests int64 `json:"requests"`
ErrorRate float64 `json:"error_rate"` // 0..1
AvgLatencyMS float64 `json:"avg_latency_ms"`
P95LatencyMS float64 `json:"p95_latency_ms"`
P99LatencyMS float64 `json:"p99_latency_ms"`
} `json:"totals"`
Status struct {
S2xx int64 `json:"s2xx"`
S3xx int64 `json:"s3xx"`
S4xx int64 `json:"s4xx"`
S5xx int64 `json:"s5xx"`
} `json:"status"`
}
type TriggerPipelineRequest ¶ added in v0.11.0
type TriggerPipelineRequest struct {
Branch string `json:"branch,omitempty"`
Commit string `json:"commit,omitempty"`
NoCache bool `json:"no_cache,omitempty"`
// Bump (patch|minor|major) or Version (exact, admins only) override this run's version.
Bump string `json:"bump,omitempty"`
Version string `json:"version,omitempty"`
}
type UpdateConfigRequest ¶ added in v0.10.0
type UpdateSecretRequest ¶ added in v0.10.0
type UpdateSecretRequest struct {
Value string `json:"value"`
Description string `json:"description"`
}
UpdateSecretRequest: a blank Value keeps the stored value; a new one rotates the secret.
type UpgradeDatabaseRequest ¶ added in v0.10.0
type VerifyResult ¶ added in v0.15.0
type VersionAllocation ¶ added in v0.21.0
type VersionAllocation struct {
Version string `json:"version"`
Tag string `json:"tag"`
Series string `json:"series,omitempty"`
Branch string `json:"branch,omitempty"`
Prerelease bool `json:"prerelease"`
Status string `json:"status"`
RunNumber int `json:"run_number,omitempty"`
Digest string `json:"digest,omitempty"`
Note string `json:"note,omitempty"`
CreatedAt time.Time `json:"created_at"`
}
type VersionBranches ¶ added in v0.21.0
type VersionPolicy ¶ added in v0.21.0
type VersionPolicy struct {
ID uint `json:"id"`
UID string `json:"uid"`
Scheme string `json:"scheme"`
Template string `json:"template"`
Series string `json:"series,omitempty"`
Bump string `json:"bump"`
Start string `json:"start,omitempty"`
CalverFormat string `json:"calver_format,omitempty"`
ReleaseBranches []string `json:"release_branches,omitempty"`
OtherBranches string `json:"other_branches"`
BranchSeries map[string]string `json:"branch_series,omitempty"`
FloatingTags []string `json:"floating_tags,omitempty"`
BumpFromCommits bool `json:"bump_from_commits"`
ManagedBy string `json:"managed_by,omitempty"`
Current string `json:"current,omitempty"`
OwnerKind string `json:"owner_kind,omitempty"`
Repository string `json:"repository,omitempty"`
Next string `json:"next,omitempty"`
}
func (VersionPolicy) Settings ¶ added in v0.21.0
func (p VersionPolicy) Settings() VersionSettings
type VersionSettings ¶ added in v0.21.0
type VersionSettings struct {
Scheme string `json:"scheme"`
Template string `json:"template,omitempty"`
Series string `json:"series,omitempty"`
Bump string `json:"bump,omitempty"`
Start string `json:"start,omitempty"`
CalverFormat string `json:"calver_format,omitempty"`
Branches VersionBranches `json:"branches"`
FloatingTags []string `json:"floating_tags,omitempty"`
BumpFromCommits bool `json:"bump_from_commits,omitempty"`
}
type Volume ¶ added in v0.12.0
type Volume struct {
ID uint `json:"id"`
UID string `json:"uid"`
Name string `json:"name"`
DisplayName string `json:"display_name"`
// DockerName is the underlying Docker volume, which is not the handle.
DockerName string `json:"docker_name"`
// ServerID 0 is the local control-plane node.
ServerID uint `json:"server_id"`
ServerName string `json:"server_name,omitempty"`
Mountpoint string `json:"mountpoint,omitempty"`
SizeBytes int64 `json:"size_bytes"`
UsedBytes int64 `json:"used_bytes"`
UsedMeasuredAt *time.Time `json:"used_measured_at,omitempty"`
// Driver is local (rwo) or nfs | cifs | host (rwx).
Driver string `json:"driver"`
AccessMode string `json:"access_mode"`
HostPath string `json:"host_path,omitempty"`
// Imported marks a volume that adopted a pre-existing external Docker volume.
Imported bool `json:"imported"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
Volume.UsedBytes is measured, SizeBytes declared; a nil UsedMeasuredAt means never measured, not empty.
type VolumeBackup ¶ added in v0.12.0
type VolumeBackup struct {
ID uint `json:"id"`
WorkspaceID uint `json:"workspace_id"`
VolumeID uint `json:"volume_id"`
ServerID uint `json:"server_id"`
// VolumeName is the Docker volume that was archived, not the handle.
VolumeName string `json:"volume_name"`
Status string `json:"status"` // pending | running | completed | failed
Trigger string `json:"trigger"` // manual | scheduled
S3Bucket string `json:"s3_bucket,omitempty"`
S3Path string `json:"s3_path,omitempty"`
Filename string `json:"filename,omitempty"`
SizeBytes int64 `json:"size_bytes"`
// Logs is the tail the record carries; the full log is a separate download.
Logs string `json:"logs,omitempty"`
Error string `json:"error,omitempty"`
StartedAt *time.Time `json:"started_at,omitempty"`
FinishedAt *time.Time `json:"finished_at,omitempty"`
CreatedAt time.Time `json:"created_at"`
// Ref names a recovery point (Enterprise); empty on a plain archive.
Ref string `json:"ref,omitempty"`
Consistency string `json:"consistency,omitempty"` // hot
Encrypted bool `json:"encrypted"`
Pinned bool `json:"pinned"`
VerifiedAt *time.Time `json:"verified_at,omitempty"`
VerifyStatus string `json:"verify_status,omitempty"` // ok | failed; empty = never
VerifyError string `json:"verify_error,omitempty"`
}
type VolumeBackupStatus ¶ added in v0.12.0
type VolumeDetail ¶ added in v0.12.0
type VolumeDetail struct {
// Inlined for yaml.v3, which otherwise nests the anonymous struct under "volume"; encoding/json flattens it.
Volume `yaml:",inline"`
Exists bool `json:"exists"`
InUse bool `json:"in_use"`
UsedBy []VolumeUsage `json:"used_by"`
}
type VolumeFile ¶ added in v0.12.0
type VolumeFile struct {
Path string `json:"path"`
Size int64 `json:"size"`
ModTime int64 `json:"mod_time"`
IsDir bool `json:"is_dir"`
}
VolumeFile paths are relative to the volume root; ModTime is unix seconds; directories report size 0.
type VolumeUploadResult ¶ added in v0.12.0
type VolumeUploadResult struct {
Path string `json:"path"`
}
type VolumeUsage ¶ added in v0.12.0
type WorkspaceOverview ¶ added in v0.17.0
type WorkspaceStorage ¶ added in v0.12.0
type WorkspaceStorage struct {
DeclaredBytes int64 `json:"declared_bytes"`
UsedBytes int64 `json:"used_bytes"`
LimitMB int `json:"limit_mb"`
MeasuredAt *time.Time `json:"measured_at,omitempty"`
VolumeCount int64 `json:"volume_count"`
}
WorkspaceStorage.LimitMB is -1 when unlimited.