Documentation
¶
Overview ¶
Package apiclient is the one HTTP client implementation for the control plane's versioned API (internal/api, mounted at /api/v1). cmd/levelrail-cli and cmd/levelrail-mcp both import this package rather than each rolling their own: they are exactly the external callers the documented wire contract in internal/api exists for (see internal/store/tokens.go's own doc comment on APIToken), so neither gets special internal access, only this same bearer-token HTTP client. Wire-shape request/response types live in types.go; this file is the Client type itself and its methods.
Index ¶
- Constants
- func ConfigDir(prog string) (string, error)
- func ExtractErrorMessage(data []byte) string
- func PathEscape(s string) string
- func ResolveAPIURL(flagURL string, lookupEnv func(string) (string, bool), prog, profile string) string
- func ResolveProfile(flagProfile string, lookupEnv func(string) (string, bool)) string
- func ResolveToken(flagToken string, lookupEnv func(string) (string, bool), prog, profile string) string
- func WriteCredentialsFile(prog, profile string, creds Credentials) error
- type AIAssistantSettingsResource
- type APIError
- type AlertRuleResource
- type AppBindMountResource
- type AppBranchEnvOverride
- type AppDatabaseResource
- type AppEgressAllow
- type AppEgressPolicyResource
- type AppGroupResource
- type AppHealthResource
- type AppHookRunsResource
- type AppIntegrationResource
- type AppMetricsResource
- type AppPreviewEnvOverride
- type AppResource
- type AppResourceUsageResource
- type AppStatusSummary
- type AppStorageResource
- type AppVaultEnvRef
- type AppVolumeMoveResource
- type AppVolumeMoveStepResource
- type AppVolumeResource
- type AttachAppIntegrationRequest
- type AttachAppTagRequest
- type AttachPolicyRequest
- type AuditLogEntryResource
- type AutoRollbackSettingResource
- type BackupHistoryResource
- type BackupScheduleResource
- type BackupTargetResource
- type BackupVerificationResource
- type BaseBackupHistoryResource
- type BitbucketAppRepoResource
- type BitbucketAppStatusResource
- type BuildTriggerRequest
- type BuildTriggerRequestBuild
- type BuildTriggerResponse
- type CertificateResource
- type CleanupOrphanedVolumesRequest
- type CleanupOrphanedVolumesResult
- type Client
- func (c *Client) ApproveDeployApproval(ctx context.Context, id string) (DeployApprovalDecisionResult, error)
- func (c *Client) AttachAppIntegration(ctx context.Context, name, integrationKey string, fields map[string]string) (AppIntegrationResource, error)
- func (c *Client) AttachAppTag(ctx context.Context, name, tagName string) (TagResource, error)
- func (c *Client) AttachPolicy(ctx context.Context, id string, req AttachPolicyRequest) error
- func (c *Client) CheckDomain(ctx context.Context, name, domain string) (DomainCheckResource, error)
- func (c *Client) CleanupOrphanedVolumes(ctx context.Context, names []string) (CleanupOrphanedVolumesResult, error)
- func (c *Client) ClearAppDatabaseAttachment(ctx context.Context, name string) error
- func (c *Client) ClearAppEgressPolicy(ctx context.Context, name string) error
- func (c *Client) ClearAppHealth(ctx context.Context, name string) error
- func (c *Client) ClearAppPreviewEnvOverride(ctx context.Context, name, key string) error
- func (c *Client) ClearAppStorage(ctx context.Context, name string) error
- func (c *Client) ClearAppVaultEnv(ctx context.Context, name, key string) error
- func (c *Client) ClearBackupSchedule(ctx context.Context, name string) error
- func (c *Client) ClearDatabasePublicAccess(ctx context.Context, name string) error
- func (c *Client) ClearDomainBasicAuth(ctx context.Context, name, domain string) (DomainBasicAuthResource, error)
- func (c *Client) ClearDomainErrorPage(ctx context.Context, name, domain string, statusCode int) (DomainErrorPagesResource, error)
- func (c *Client) ClearDomainErrorPages(ctx context.Context, name, domain string) (DomainErrorPagesResource, error)
- func (c *Client) ClearDomainMaintenance(ctx context.Context, name, domain string) (DomainMaintenanceResource, error)
- func (c *Client) ClearDomainRedirect(ctx context.Context, name, domain string) (DomainRedirectResource, error)
- func (c *Client) ClearDomainTLSCert(ctx context.Context, name, domain string) (DomainTLSCertResource, error)
- func (c *Client) ClearDomainWAF(ctx context.Context, name, domain string) (DomainWAFResource, error)
- func (c *Client) ClearLogDrain(ctx context.Context, name string) error
- func (c *Client) ClearVolumeBackupSchedule(ctx context.Context, name, volume string) error
- func (c *Client) CloneApp(ctx context.Context, name, newName string) (AppResource, error)
- func (c *Client) CloneEnvironment(ctx context.Context, id string, req EnvironmentCloneRequest) (EnvironmentCloneResultResource, error)
- func (c *Client) CompareDeploys(ctx context.Context, name, from, to string) (DeployCompareResource, error)
- func (c *Client) CordonNode(ctx context.Context, id string) (NodeResource, error)
- func (c *Client) CreateAlertRule(ctx context.Context, name string, req CreateAlertRuleRequest) (AlertRuleResource, error)
- func (c *Client) CreateApp(ctx context.Context, req AppResource) (AppResource, error)
- func (c *Client) CreateBackupTarget(ctx context.Context, req CreateBackupTargetRequest) (BackupTargetResource, error)
- func (c *Client) CreateDatabase(ctx context.Context, req DatabaseResource) (DatabaseResource, error)
- func (c *Client) CreateDeployNotifyTarget(ctx context.Context, name string, req CreateDeployNotifyTargetRequest) (DeployNotifyTargetResource, error)
- func (c *Client) CreateEnvironment(ctx context.Context, projectID string, req CreateEnvironmentRequest) (EnvironmentResource, error)
- func (c *Client) CreateFeatureFlag(ctx context.Context, name string, req FeatureFlagRequest) (FeatureFlagResource, error)
- func (c *Client) CreateInvite(ctx context.Context, req CreateInviteRequest) (CreateInviteResponse, error)
- func (c *Client) CreateNodeJoinToken(ctx context.Context) (CreateNodeJoinTokenResponse, error)
- func (c *Client) CreateNotificationChannel(ctx context.Context, req CreateNotificationChannelRequest) (NotificationChannelResource, error)
- func (c *Client) CreateOrganization(ctx context.Context, req CreateOrganizationRequest) (OrganizationResource, error)
- func (c *Client) CreatePolicy(ctx context.Context, req PolicyRequest) (PolicyResource, error)
- func (c *Client) CreateProject(ctx context.Context, req CreateProjectRequest) (ProjectResource, error)
- func (c *Client) CreateRegistryCredential(ctx context.Context, req CreateRegistryCredentialRequest) (RegistryCredentialResource, error)
- func (c *Client) CreateScheduledTask(ctx context.Context, name string, req ScheduledTaskRequest) (ScheduledTaskResource, error)
- func (c *Client) CreateTag(ctx context.Context, name string) (TagResource, error)
- func (c *Client) CreateUser(ctx context.Context, req CreateUserRequest) (UserResource, error)
- func (c *Client) DeleteAIAssistantSettings(ctx context.Context) (AIAssistantSettingsResource, error)
- func (c *Client) DeleteAlertRule(ctx context.Context, name, id string) error
- func (c *Client) DeleteApp(ctx context.Context, name string) error
- func (c *Client) DeleteAppBranchEnv(ctx context.Context, name, id string) error
- func (c *Client) DeleteBackup(ctx context.Context, name, historyID string) error
- func (c *Client) DeleteBackupTarget(ctx context.Context, id string) error
- func (c *Client) DeleteDatabase(ctx context.Context, name string) error
- func (c *Client) DeleteDeployNotifyTarget(ctx context.Context, name, id string) error
- func (c *Client) DeleteEnvironment(ctx context.Context, id string) error
- func (c *Client) DeleteFeatureFlag(ctx context.Context, name, id string) error
- func (c *Client) DeleteGitSource(ctx context.Context, name string) error
- func (c *Client) DeleteNode(ctx context.Context, id string) error
- func (c *Client) DeleteNotificationChannel(ctx context.Context, id string) error
- func (c *Client) DeleteOrganization(ctx context.Context, id string) error
- func (c *Client) DeletePolicy(ctx context.Context, id string) error
- func (c *Client) DeleteProject(ctx context.Context, id string) error
- func (c *Client) DeleteRegistryCredential(ctx context.Context, id string) error
- func (c *Client) DeleteScheduledTask(ctx context.Context, name, id string) error
- func (c *Client) DeleteSharedEnvSecret(ctx context.Context, scope, id, key string) error
- func (c *Client) DeleteTag(ctx context.Context, id string) error
- func (c *Client) DeleteUser(ctx context.Context, id string) error
- func (c *Client) DeleteVolumeBackup(ctx context.Context, name, volume, historyID string) error
- func (c *Client) DeployApp(ctx context.Context, name, image string, confirm bool) (DeployTriggerResult, error)
- func (c *Client) DeployCompose(ctx context.Context, name string, composeYAML []byte) (ComposeDeployResult, error)
- func (c *Client) DeploySpec(ctx context.Context, name string, req DeploySpecRequest) (DeploySpecResult, error)
- func (c *Client) DetachAppIntegration(ctx context.Context, name, id string) error
- func (c *Client) DetachAppTag(ctx context.Context, name, tagID string) error
- func (c *Client) DetachPolicy(ctx context.Context, id, principalType, principalID string) error
- func (c *Client) DiagnoseApp(ctx context.Context, name, deployID string) (DiagnosisResource, error)
- func (c *Client) DisablePITR(ctx context.Context, name string) error
- func (c *Client) DisableRegistry(ctx context.Context) (RegistrySettingsResource, error)
- func (c *Client) DisconnectBitbucketApp(ctx context.Context) error
- func (c *Client) DisconnectCloudflareDNS(ctx context.Context) (CloudflareDNSResource, error)
- func (c *Client) DisconnectCloudflareTunnel(ctx context.Context) (CloudflareTunnelResource, error)
- func (c *Client) DisconnectGitHubApp(ctx context.Context) error
- func (c *Client) DisconnectGitLabApp(ctx context.Context) error
- func (c *Client) DisconnectGiteaApp(ctx context.Context) error
- func (c *Client) DisconnectRoute53DNS(ctx context.Context) (Route53DNSResource, error)
- func (c *Client) DisconnectVault(ctx context.Context) (VaultSettingsResource, error)
- func (c *Client) DownloadAuditLogCSV(ctx context.Context, opts ListAuditLogOptions) ([]byte, error)
- func (c *Client) DownloadBackup(ctx context.Context, name, historyID string) ([]byte, error)
- func (c *Client) DownloadDeployLog(ctx context.Context, name, deployID string) ([]byte, error)
- func (c *Client) DownloadVolumeBackup(ctx context.Context, name, volume, historyID string) ([]byte, error)
- func (c *Client) DrainNode(ctx context.Context, id, targetNodeID string) (DrainNodeResponse, error)
- func (c *Client) EnablePITR(ctx context.Context, name string) error
- func (c *Client) EvaluateFeatureFlag(ctx context.Context, key, identifier string) (EvaluateFlagResource, error)
- func (c *Client) ExecApp(ctx context.Context, name string, req ExecRequest) (ExecResponse, error)
- func (c *Client) GetAIAssistantSettings(ctx context.Context) (AIAssistantSettingsResource, error)
- func (c *Client) GetApp(ctx context.Context, name string) (AppResource, error)
- func (c *Client) GetAppEgressPolicy(ctx context.Context, name string) (AppEgressPolicyResource, error)
- func (c *Client) GetAppGroup(ctx context.Context, name string) (AppGroupResource, error)
- func (c *Client) GetAppHealth(ctx context.Context, name string) (AppHealthResource, error)
- func (c *Client) GetAppHookRuns(ctx context.Context, name string) (AppHookRunsResource, error)
- func (c *Client) GetAppNetwork(ctx context.Context, name string) (NetworkResource, error)
- func (c *Client) GetAppResourceRecommendation(ctx context.Context, name string) (ResourceRecommendationResource, error)
- func (c *Client) GetAppVolumeMove(ctx context.Context, name, id string) (AppVolumeMoveResource, error)
- func (c *Client) GetAutoRollback(ctx context.Context, appName string) (AutoRollbackSettingResource, error)
- func (c *Client) GetBackupTarget(ctx context.Context, id string) (BackupTargetResource, error)
- func (c *Client) GetBitbucketAppStatus(ctx context.Context) (BitbucketAppStatusResource, error)
- func (c *Client) GetCloudflareDNS(ctx context.Context) (CloudflareDNSResource, error)
- func (c *Client) GetCloudflareTunnel(ctx context.Context) (CloudflareTunnelResource, error)
- func (c *Client) GetDashboardURL(ctx context.Context) (DashboardURLResource, error)
- func (c *Client) GetDatabase(ctx context.Context, name string) (DatabaseResource, error)
- func (c *Client) GetDatabaseResourceRecommendation(ctx context.Context, name string) (ResourceRecommendationResource, error)
- func (c *Client) GetDeployApproval(ctx context.Context, id string) (DeployApprovalResource, error)
- func (c *Client) GetDeployStatus(ctx context.Context, name string) ([]ConditionResource, error)
- func (c *Client) GetDomainBasicAuth(ctx context.Context, name, domain string) (DomainBasicAuthResource, error)
- func (c *Client) GetDomainErrorPages(ctx context.Context, name, domain string) (DomainErrorPagesResource, error)
- func (c *Client) GetDomainMaintenance(ctx context.Context, name, domain string) (DomainMaintenanceResource, error)
- func (c *Client) GetDomainRedirect(ctx context.Context, name, domain string) (DomainRedirectResource, error)
- func (c *Client) GetDomainTLSCert(ctx context.Context, name, domain string) (DomainTLSCertResource, error)
- func (c *Client) GetDomainWAF(ctx context.Context, name, domain string) (DomainWAFResource, error)
- func (c *Client) GetEmailSettings(ctx context.Context) (EmailSettingsResource, error)
- func (c *Client) GetEnvironmentEnv(ctx context.Context, id string) (map[string]string, error)
- func (c *Client) GetExecAccess(ctx context.Context, appName string) (ExecAccessResource, error)
- func (c *Client) GetFeatureFlag(ctx context.Context, name, id string) (FeatureFlagResource, error)
- func (c *Client) GetFleetResourceUsage(ctx context.Context) (FleetResourceUsageResource, error)
- func (c *Client) GetGitHubAppStatus(ctx context.Context) (GitHubAppStatusResource, error)
- func (c *Client) GetGitLabAppStatus(ctx context.Context) (GitLabAppStatusResource, error)
- func (c *Client) GetGitSource(ctx context.Context, name string) (GitSourceResource, error)
- func (c *Client) GetGiteaAppStatus(ctx context.Context) (GiteaAppStatusResource, error)
- func (c *Client) GetIngressSettings(ctx context.Context) (IngressSettingsResource, error)
- func (c *Client) GetLogDrain(ctx context.Context, name string) (LogDrainResource, error)
- func (c *Client) GetMeshStatus(ctx context.Context) (MeshStatusResource, error)
- func (c *Client) GetNode(ctx context.Context, id string) (NodeResource, error)
- func (c *Client) GetNodeHealth(ctx context.Context, id string) ([]ConditionResource, error)
- func (c *Client) GetNodePatchStatus(ctx context.Context, id string) (NodePatchStatusResource, error)
- func (c *Client) GetOAuthSettings(ctx context.Context) ([]OAuthProviderSettingsResource, error)
- func (c *Client) GetOnboardingState(ctx context.Context) (OnboardingStateResource, error)
- func (c *Client) GetOrganization(ctx context.Context, id string) (OrganizationResource, error)
- func (c *Client) GetOrganizationEnv(ctx context.Context, id string) (map[string]string, error)
- func (c *Client) GetPITRStatus(ctx context.Context, name string) (PITRStatusResource, error)
- func (c *Client) GetPolicy(ctx context.Context, id string) (PolicyResource, error)
- func (c *Client) GetProject(ctx context.Context, id string) (ProjectResource, error)
- func (c *Client) GetProjectEnv(ctx context.Context, id string) (map[string]string, error)
- func (c *Client) GetRegistryCredential(ctx context.Context, id string) (RegistryCredentialResource, error)
- func (c *Client) GetRegistrySettings(ctx context.Context) (RegistrySettingsResource, error)
- func (c *Client) GetRoute53DNS(ctx context.Context) (Route53DNSResource, error)
- func (c *Client) GetScheduledTask(ctx context.Context, name, id string) (ScheduledTaskResource, error)
- func (c *Client) GetServiceTemplate(ctx context.Context, id string) (ServiceTemplateDetail, error)
- func (c *Client) GetSession(ctx context.Context) (SessionInfoResource, error)
- func (c *Client) GetSetupStatus(ctx context.Context) (SetupStatusResource, error)
- func (c *Client) GetSystemDoctor(ctx context.Context) (SystemDoctorResource, error)
- func (c *Client) GetSystemStatus(ctx context.Context) (SystemStatusResource, error)
- func (c *Client) GetUpdates(ctx context.Context) (UpdatesResource, error)
- func (c *Client) GetVault(ctx context.Context) (VaultSettingsResource, error)
- func (c *Client) GetVolumeBackupSchedule(ctx context.Context, name, volume string) (VolumeBackupScheduleResource, error)
- func (c *Client) ListAlertRules(ctx context.Context, name string) ([]AlertRuleResource, error)
- func (c *Client) ListAllBackups(ctx context.Context, opts ListBackupsOptions) ([]BackupHistoryResource, error)
- func (c *Client) ListAppBranchEnv(ctx context.Context, name string) ([]AppBranchEnvOverride, error)
- func (c *Client) ListAppImages(ctx context.Context, name string) ([]ImageResource, error)
- func (c *Client) ListAppIntegrations(ctx context.Context, name string) ([]AppIntegrationResource, error)
- func (c *Client) ListAppResourceUsage(ctx context.Context) ([]AppResourceUsageResource, error)
- func (c *Client) ListAppTags(ctx context.Context, name string) ([]TagResource, error)
- func (c *Client) ListAppVolumeMoves(ctx context.Context, name string) ([]AppVolumeMoveResource, error)
- func (c *Client) ListApps(ctx context.Context) ([]AppResource, error)
- func (c *Client) ListAppsByTag(ctx context.Context, id string) ([]TagAppResource, error)
- func (c *Client) ListAuditLog(ctx context.Context, opts ListAuditLogOptions) ([]AuditLogEntryResource, error)
- func (c *Client) ListBackupTargets(ctx context.Context) ([]BackupTargetResource, error)
- func (c *Client) ListBackupVerifications(ctx context.Context, name, historyID string) ([]BackupVerificationResource, error)
- func (c *Client) ListBackups(ctx context.Context, name string, opts ListBackupsOptions) ([]BackupHistoryResource, error)
- func (c *Client) ListBaseBackups(ctx context.Context, name string) ([]BaseBackupHistoryResource, error)
- func (c *Client) ListBitbucketAppBranches(ctx context.Context, workspace, repoSlug string) ([]GitAppBranchResource, error)
- func (c *Client) ListBitbucketAppRepos(ctx context.Context) ([]BitbucketAppRepoResource, error)
- func (c *Client) ListCertificates(ctx context.Context) ([]CertificateResource, error)
- func (c *Client) ListContainers(ctx context.Context) ([]ContainerResource, error)
- func (c *Client) ListDatabaseEngines(ctx context.Context) ([]DatabaseEngineResource, error)
- func (c *Client) ListDatabases(ctx context.Context) ([]DatabaseResource, error)
- func (c *Client) ListDeployApprovals(ctx context.Context, status, service string) ([]DeployApprovalResource, error)
- func (c *Client) ListDeployAttempts(ctx context.Context, name string) ([]DeployAttemptResource, error)
- func (c *Client) ListDeployNotifyTargets(ctx context.Context, name string) ([]DeployNotifyTargetResource, error)
- func (c *Client) ListDomains(ctx context.Context) ([]DomainResource, error)
- func (c *Client) ListEnvironments(ctx context.Context, projectID string) ([]EnvironmentResource, error)
- func (c *Client) ListFeatureFlags(ctx context.Context, name string) ([]FeatureFlagResource, error)
- func (c *Client) ListGitHubAppBranches(ctx context.Context, owner, repo string) ([]GitAppBranchResource, error)
- func (c *Client) ListGitHubAppRepos(ctx context.Context) ([]GitHubAppRepoResource, error)
- func (c *Client) ListGitLabAppBranches(ctx context.Context, projectID int64) ([]GitAppBranchResource, error)
- func (c *Client) ListGitLabAppProjects(ctx context.Context) ([]GitLabAppProjectResource, error)
- func (c *Client) ListGitProviders(ctx context.Context) ([]GitProviderResource, error)
- func (c *Client) ListGiteaAppBranches(ctx context.Context, owner, repo string) ([]GitAppBranchResource, error)
- func (c *Client) ListGiteaAppRepos(ctx context.Context) ([]GiteaAppRepoResource, error)
- func (c *Client) ListIntegrationCatalog(ctx context.Context) ([]IntegrationCatalogEntryResource, error)
- func (c *Client) ListInvites(ctx context.Context) ([]InviteResource, error)
- func (c *Client) ListNodes(ctx context.Context) ([]NodeResource, error)
- func (c *Client) ListNotificationChannels(ctx context.Context) ([]NotificationChannelResource, error)
- func (c *Client) ListNotificationDeliveries(ctx context.Context, id string, limit int) ([]NotificationDeliveryResource, error)
- func (c *Client) ListOAuthProviderSettings(ctx context.Context) ([]OAuthProviderSettingsResource, error)
- func (c *Client) ListOrganizations(ctx context.Context) ([]OrganizationResource, error)
- func (c *Client) ListOrphanedVolumes(ctx context.Context) ([]OrphanedVolumeResource, error)
- func (c *Client) ListPolicies(ctx context.Context) ([]PolicyResource, error)
- func (c *Client) ListPolicyAttachments(ctx context.Context, id string) ([]PolicyAttachmentResource, error)
- func (c *Client) ListPreviewEnvironments(ctx context.Context, appName string) ([]PreviewEnvironmentResource, error)
- func (c *Client) ListProjects(ctx context.Context) ([]ProjectResource, error)
- func (c *Client) ListRegistryCredentialRepositories(ctx context.Context, id string) (RegistryRepositoriesResource, error)
- func (c *Client) ListRegistryCredentialTags(ctx context.Context, id, repository string) (RegistryTagsResource, error)
- func (c *Client) ListRegistryCredentials(ctx context.Context) ([]RegistryCredentialResource, error)
- func (c *Client) ListRegistryRepositories(ctx context.Context) (RegistryRepositoriesResource, error)
- func (c *Client) ListRegistryTags(ctx context.Context, repository string) (RegistryTagsResource, error)
- func (c *Client) ListRoles(ctx context.Context) ([]RoleResource, error)
- func (c *Client) ListScheduledTasks(ctx context.Context, name string) ([]ScheduledTaskResource, error)
- func (c *Client) ListSecrets(ctx context.Context, name string) ([]SecretKeyResource, error)
- func (c *Client) ListServiceTemplates(ctx context.Context) ([]ServiceTemplateListItem, error)
- func (c *Client) ListSharedEnvAll(ctx context.Context, scope, id string) ([]SharedEnvVarResource, error)
- func (c *Client) ListSharedEnvSecretKeys(ctx context.Context, scope, id string) ([]string, error)
- func (c *Client) ListStaticSites(ctx context.Context) ([]StaticSiteResource, error)
- func (c *Client) ListTags(ctx context.Context) ([]TagResource, error)
- func (c *Client) ListUsers(ctx context.Context) ([]UserResource, error)
- func (c *Client) ListVolumeBackupVerifications(ctx context.Context, name, volume, historyID string) ([]BackupVerificationResource, error)
- func (c *Client) ListVolumeBackups(ctx context.Context, name, volume string, opts ListBackupsOptions) ([]BackupHistoryResource, error)
- func (c *Client) ListWebhookDeliveries(ctx context.Context, name string, opts ListWebhookDeliveriesOptions) ([]WebhookDeliveryResource, error)
- func (c *Client) MoveAppWithVolumes(ctx context.Context, name, nodeID string) (AppVolumeMoveResource, error)
- func (c *Client) PollDeviceAuthToken(ctx context.Context, deviceCode string) (DeviceTokenResponse, error)
- func (c *Client) PreviewEnvironmentClone(ctx context.Context, id, newEnvironmentName string) (EnvironmentClonePreviewResource, error)
- func (c *Client) PreviewPromotion(ctx context.Context, name, environmentID, target string) (PromotePreviewResource, error)
- func (c *Client) PromoteApp(ctx context.Context, name string, req PromoteAppRequest) (DeployTriggerResult, error)
- func (c *Client) PruneSystem(ctx context.Context) (SystemPruneResult, error)
- func (c *Client) PurgeAuditLog(ctx context.Context) (PurgeAuditLogResult, error)
- func (c *Client) QueryAppMetrics(ctx context.Context, name, metric string, from, to time.Time, ...) (AppMetricsResource, error)
- func (c *Client) QueryDatabaseLogs(ctx context.Context, name string, from, to time.Time, q string) ([]LogEntryResource, error)
- func (c *Client) QueryDatabaseMetrics(ctx context.Context, name, metric string, from, to time.Time, ...) (AppMetricsResource, error)
- func (c *Client) QueryDatabaseSlowQueries(ctx context.Context, name string, from, to time.Time, limit, offset int) ([]SlowQueryEntryResource, int, error)
- func (c *Client) QueryLogs(ctx context.Context, name string, from, to time.Time, q string) ([]LogEntryResource, error)
- func (c *Client) QueryNodeMetrics(ctx context.Context, id, metric string, from, to time.Time, step time.Duration) (NodeMetricsResource, error)
- func (c *Client) RejectDeployApproval(ctx context.Context, id, reason string) (DeployApprovalResource, error)
- func (c *Client) ReplayWebhookDelivery(ctx context.Context, name, id string) (ReplayWebhookDeliveryResult, error)
- func (c *Client) RestartApp(ctx context.Context, name string) (AppResource, error)
- func (c *Client) RestartProject(ctx context.Context, id string) (ProjectRestartResponse, error)
- func (c *Client) RevokeInvite(ctx context.Context, id string) error
- func (c *Client) RotateMasterKey(ctx context.Context, newMasterKey string) (RotateMasterKeyResult, error)
- func (c *Client) RotateNodeMeshKey(ctx context.Context, id string) (RotateKeyResponse, error)
- func (c *Client) RunScheduledTask(ctx context.Context, name, id string) (ScheduledTaskResource, error)
- func (c *Client) SetAppBranchEnv(ctx context.Context, name, branchPattern, key, value string, secret bool) (AppBranchEnvOverride, error)
- func (c *Client) SetAppDatabaseAttachment(ctx context.Context, name string, req SetAppDatabaseRequest) (AppDatabaseResource, error)
- func (c *Client) SetAppEgressPolicy(ctx context.Context, name string, req SetAppEgressPolicyRequest) (AppEgressPolicyResource, error)
- func (c *Client) SetAppEnvironment(ctx context.Context, name, environmentID string) (AppResource, error)
- func (c *Client) SetAppHealth(ctx context.Context, name string, health ServiceHealth) (AppHealthResource, error)
- func (c *Client) SetAppNode(ctx context.Context, name, nodeID string) (AppResource, error)
- func (c *Client) SetAppPreviewEnvOverride(ctx context.Context, name, key, value string) (AppPreviewEnvOverride, error)
- func (c *Client) SetAppProject(ctx context.Context, name, projectID string) (AppResource, error)
- func (c *Client) SetAppStorage(ctx context.Context, name, storageTargetID string) (AppStorageResource, error)
- func (c *Client) SetAppVaultEnv(ctx context.Context, name, key string, req AppVaultEnvRef) (AppVaultEnvRef, error)
- func (c *Client) SetAutoRollback(ctx context.Context, appName string, enabled bool) (AutoRollbackSettingResource, error)
- func (c *Client) SetBackupSchedule(ctx context.Context, name string, req SetBackupScheduleRequest) (BackupScheduleResource, error)
- func (c *Client) SetCloudflareDNS(ctx context.Context, req UpdateCloudflareDNSRequest) (CloudflareDNSResource, error)
- func (c *Client) SetCloudflareTunnel(ctx context.Context, req UpdateCloudflareTunnelRequest) (CloudflareTunnelResource, error)
- func (c *Client) SetDatabaseNode(ctx context.Context, name, nodeID string) (DatabaseResource, error)
- func (c *Client) SetDatabaseProject(ctx context.Context, name, projectID string) (DatabaseResource, error)
- func (c *Client) SetDatabasePublicAccess(ctx context.Context, name string, port int, bindAddress string) (DatabasePublicAccessResource, error)
- func (c *Client) SetDatabaseResources(ctx context.Context, name string, resources *ServiceResources) (DatabaseResource, error)
- func (c *Client) SetDomainBasicAuth(ctx context.Context, name, domain string, req SetDomainBasicAuthRequest) (DomainBasicAuthResource, error)
- func (c *Client) SetDomainErrorPage(ctx context.Context, name, domain string, req SetDomainErrorPageRequest) (DomainErrorPagesResource, error)
- func (c *Client) SetDomainMaintenance(ctx context.Context, name, domain string) (DomainMaintenanceResource, error)
- func (c *Client) SetDomainRedirect(ctx context.Context, name, domain string, req SetDomainRedirectRequest) (DomainRedirectResource, error)
- func (c *Client) SetDomainTLSCert(ctx context.Context, name, domain string, req SetDomainTLSCertRequest) (DomainTLSCertResource, error)
- func (c *Client) SetDomainWAF(ctx context.Context, name, domain string, req SetDomainWAFRequest) (DomainWAFResource, error)
- func (c *Client) SetEnvironmentEnv(ctx context.Context, id string, vars map[string]string) (map[string]string, error)
- func (c *Client) SetExecAccess(ctx context.Context, appName string, enabled bool) (ExecAccessResource, error)
- func (c *Client) SetGitSource(ctx context.Context, name string, req SetGitSourceRequest) (GitSourceResource, error)
- func (c *Client) SetLogDrain(ctx context.Context, name string, req SetLogDrainRequest) (LogDrainResource, error)
- func (c *Client) SetNodeWorkloads(ctx context.Context, id string, req SetNodeWorkloadsRequest) (NodeResource, error)
- func (c *Client) SetOrganizationEnv(ctx context.Context, id string, vars map[string]string) (map[string]string, error)
- func (c *Client) SetPreviewEnabled(ctx context.Context, appName string, enabled bool) (PreviewSettingsResource, error)
- func (c *Client) SetPreviewPostPRComments(ctx context.Context, appName string, enabled bool) (PreviewSettingsResource, error)
- func (c *Client) SetProjectEnv(ctx context.Context, id string, vars map[string]string) (map[string]string, error)
- func (c *Client) SetProjectOrganization(ctx context.Context, projectID, orgID string) (ProjectResource, error)
- func (c *Client) SetRoute53DNS(ctx context.Context, req UpdateRoute53DNSRequest) (Route53DNSResource, error)
- func (c *Client) SetSecret(ctx context.Context, name, key, value string, overwriteLocked bool) error
- func (c *Client) SetSecretLock(ctx context.Context, name, key string, locked bool) error
- func (c *Client) SetSharedEnvSecret(ctx context.Context, scope, id, key, value string) error
- func (c *Client) SetVault(ctx context.Context, req UpdateVaultSettingsRequest) (VaultSettingsResource, error)
- func (c *Client) SetVolumeBackupSchedule(ctx context.Context, name, volume string, req SetVolumeBackupScheduleRequest) (VolumeBackupScheduleResource, error)
- func (c *Client) StartApp(ctx context.Context, name string) (AppResource, error)
- func (c *Client) StartDatabase(ctx context.Context, name string) (DatabaseResource, error)
- func (c *Client) StartDeviceAuth(ctx context.Context, req DeviceStartRequest) (DeviceStartResponse, error)
- func (c *Client) StartProject(ctx context.Context, id string) (ProjectLifecycleResult, error)
- func (c *Client) StopApp(ctx context.Context, name string) (AppResource, error)
- func (c *Client) StopDatabase(ctx context.Context, name string) (DatabaseResource, error)
- func (c *Client) StopProject(ctx context.Context, id string) (ProjectLifecycleResult, error)
- func (c *Client) StreamDatabaseLogs(ctx context.Context, name string, onEntry func(LogStreamEntry) error) error
- func (c *Client) StreamDeployLog(ctx context.Context, name, deployID string, onEntry func(LogStreamEntry) error) error
- func (c *Client) StreamLogs(ctx context.Context, name string, onEntry func(LogStreamEntry) error) error
- func (c *Client) SweepPreviewEnvironments(ctx context.Context) (SweepPreviewEnvironmentsResult, error)
- func (c *Client) TeardownPreviewEnvironment(ctx context.Context, appName string, prNumber int) error
- func (c *Client) TestBackupTarget(ctx context.Context, id string) error
- func (c *Client) TestExistingNotificationChannel(ctx context.Context, id string) error
- func (c *Client) TestNotificationChannel(ctx context.Context, kind, notifyURL string) error
- func (c *Client) TestRegistryCredential(ctx context.Context, id string) error
- func (c *Client) TriggerBackup(ctx context.Context, name, targetID string) (BackupHistoryResource, error)
- func (c *Client) TriggerBaseBackup(ctx context.Context, name, targetID string) (BaseBackupHistoryResource, error)
- func (c *Client) TriggerBuild(ctx context.Context, name string, req BuildTriggerRequest) (BuildTriggerResponse, error)
- func (c *Client) TriggerCloneRestore(ctx context.Context, name string, req TriggerCloneRestoreRequest) (CloneRestoreResource, error)
- func (c *Client) TriggerPITRRestore(ctx context.Context, name, baseBackupID, targetTime string) (PITRRestoreHistoryResource, error)
- func (c *Client) TriggerRestore(ctx context.Context, name, backupID string) (RestoreHistoryResource, error)
- func (c *Client) TriggerVolumeBackup(ctx context.Context, name, volume, targetID string) (BackupHistoryResource, error)
- func (c *Client) TriggerVolumeCloneRestore(ctx context.Context, name, volume string, req TriggerVolumeCloneRestoreRequest) (VolumeCloneRestoreResource, error)
- func (c *Client) TriggerVolumeRestore(ctx context.Context, name, volume, backupID string) (RestoreHistoryResource, error)
- func (c *Client) UncordonNode(ctx context.Context, id string) (NodeResource, error)
- func (c *Client) UpdateAIAssistantSettings(ctx context.Context, req UpdateAIAssistantSettingsRequest) (AIAssistantSettingsResource, error)
- func (c *Client) UpdateAlertRule(ctx context.Context, name, id string, req UpdateAlertRuleRequest) (AlertRuleResource, error)
- func (c *Client) UpdateBackupTarget(ctx context.Context, id string, req UpdateBackupTargetRequest) (BackupTargetResource, error)
- func (c *Client) UpdateDashboardURL(ctx context.Context, req DashboardURLResource) (DashboardURLResource, error)
- func (c *Client) UpdateEmailSettings(ctx context.Context, req EmailSettingsResource) (EmailSettingsResource, error)
- func (c *Client) UpdateEnvironment(ctx context.Context, id string, req UpdateEnvironmentRequest) (EnvironmentResource, error)
- func (c *Client) UpdateFeatureFlag(ctx context.Context, name, id string, req FeatureFlagRequest) (FeatureFlagResource, error)
- func (c *Client) UpdateIngressSettings(ctx context.Context, req IngressSettingsResource) (IngressSettingsResource, error)
- func (c *Client) UpdateNotificationChannel(ctx context.Context, id string, req UpdateNotificationChannelRequest) (NotificationChannelResource, error)
- func (c *Client) UpdateOAuthProviderSettings(ctx context.Context, provider string, req UpdateOAuthProviderSettingsRequest) (OAuthProviderSettingsResource, error)
- func (c *Client) UpdatePolicy(ctx context.Context, id string, req PolicyRequest) (PolicyResource, error)
- func (c *Client) UpdateRegistryCredential(ctx context.Context, id string, req UpdateRegistryCredentialRequest) (RegistryCredentialResource, error)
- func (c *Client) UpdateRegistrySettings(ctx context.Context, req UpdateRegistrySettingsRequest) (RegistrySettingsResource, error)
- func (c *Client) UpdateScheduledTask(ctx context.Context, name, id string, req ScheduledTaskRequest) (ScheduledTaskResource, error)
- func (c *Client) UpdateUserAbilities(ctx context.Context, id string, req UpdateUserAbilitiesRequest) (UserResource, error)
- func (c *Client) UseBitbucketRepoAsSource(ctx context.Context, workspace, repoSlug string, req UseRepoAsSourceRequest) (GitSourceResource, error)
- func (c *Client) UseGitHubRepoAsSource(ctx context.Context, owner, repo string, req UseRepoAsSourceRequest) (UseGitHubRepoAsSourceResponse, error)
- func (c *Client) UseGitLabProjectAsSource(ctx context.Context, projectID int64, req UseRepoAsSourceRequest) (GitSourceResource, error)
- func (c *Client) UseGiteaRepoAsSource(ctx context.Context, owner, repo string, req UseRepoAsSourceRequest) (GitSourceResource, error)
- func (c *Client) VerifyBackup(ctx context.Context, name, historyID string) (BackupVerificationResource, error)
- func (c *Client) VerifyVolumeBackup(ctx context.Context, name, volume, historyID string) (BackupVerificationResource, error)
- type CloneAppRequest
- type CloneRestoreResource
- type CloudflareDNSResource
- type CloudflareTunnelResource
- type ComposeDeployResult
- type ConditionResource
- type ContainerPortResource
- type ContainerResource
- type CreateAlertRuleRequest
- type CreateBackupTargetRequest
- type CreateDeployNotifyTargetRequest
- type CreateEnvironmentRequest
- type CreateInviteRequest
- type CreateInviteResponse
- type CreateNodeJoinTokenResponse
- type CreateNotificationChannelRequest
- type CreateOrganizationRequest
- type CreateProjectRequest
- type CreateRegistryCredentialRequest
- type CreateTagRequest
- type CreateUserRequest
- type Credentials
- type DashboardURLResource
- type DatabaseEngineResource
- type DatabasePublicAccessResource
- type DatabaseResource
- type DeployApprovalDecisionResult
- type DeployApprovalListResult
- type DeployApprovalResource
- type DeployAttemptResource
- type DeployCompareField
- type DeployCompareResource
- type DeployCompareSide
- type DeployNotifyTargetResource
- type DeploySpecRequest
- type DeploySpecResult
- type DeploySpecService
- type DeploySpecServiceBuild
- type DeploySpecServiceEnv
- type DeploySpecServiceHealth
- type DeploySpecServiceHooks
- type DeploySpecServiceProbe
- type DeploySpecServiceResources
- type DeploySpecServiceResult
- type DeployTriggerRequest
- type DeployTriggerResult
- type DeviceStartRequest
- type DeviceStartResponse
- type DeviceTokenRequest
- type DeviceTokenResponse
- type DiagnosisResource
- type DiagnosisSignal
- type DimensionRecommendationResource
- type DoctorCheckResource
- type DomainBasicAuthResource
- type DomainCheckResource
- type DomainErrorPageEntry
- type DomainErrorPagesResource
- type DomainMaintenanceResource
- type DomainRedirectResource
- type DomainResource
- type DomainTLSCertResource
- type DomainWAFResource
- type DrainNodeResponse
- type EmailSettingsResource
- type EnvironmentCloneAppInput
- type EnvironmentCloneAppPreview
- type EnvironmentCloneAppResult
- type EnvironmentClonePreviewResource
- type EnvironmentCloneRequest
- type EnvironmentCloneResultResource
- type EnvironmentResource
- type EvaluateFlagResource
- type ExecAccessResource
- type ExecRequest
- type ExecResponse
- type FeatureFlagRequest
- type FeatureFlagResource
- type FleetResourceUsageResource
- type FleetResourceUsageRollup
- type GitAppBranchResource
- type GitHubAppRepoResource
- type GitHubAppStatusResource
- type GitLabAppProjectResource
- type GitLabAppStatusResource
- type GitProviderResource
- type GitSourceResource
- type GiteaAppRepoResource
- type GiteaAppStatusResource
- type HookRunResource
- type ImageResource
- type IngressSettingsResource
- type IntegrationCatalogEntryResource
- type IntegrationCatalogEnvVarResource
- type InviteResource
- type ListAuditLogOptions
- type ListBackupsOptions
- type ListWebhookDeliveriesOptions
- type LogDrainResource
- type LogEntryResource
- type LogStreamEntry
- type MeshPeerResource
- type MeshRotationResource
- type MeshStatusResource
- type MetricPointResource
- type MoveAppWithVolumesRequest
- type NetworkResource
- type NodeAlertStatusResource
- type NodeMetricsResource
- type NodePatchStatusResource
- type NodeResource
- type NodeResourceUsageResource
- type NotificationChannelResource
- type NotificationDeliveryResource
- type OAuthProviderSettingsResource
- type OnboardingStateResource
- type Option
- type OrganizationResource
- type OrphanedVolumeResource
- type PITRRestoreHistoryResource
- type PITRStatusResource
- type PolicyAttachmentResource
- type PolicyRequest
- type PolicyResource
- type PreviewEnvironmentResource
- type PreviewEphemeralDatabaseResource
- type PreviewSettingsResource
- type ProfileSummary
- type ProjectLifecycleResult
- type ProjectResource
- type ProjectRestartResponse
- type PromoteAppRequest
- type PromotePreviewResource
- type PromotePreviewSide
- type PurgeAuditLogResult
- type RegistryCredentialResource
- type RegistryRepositoriesResource
- type RegistrySettingsResource
- type RegistryTagsResource
- type RejectDeployApprovalRequest
- type ReplayWebhookDeliveryResult
- type ResourceRecommendationResource
- type RestoreHistoryResource
- type RoleResource
- type RotateKeyResponse
- type RotateMasterKeyRequest
- type RotateMasterKeyResult
- type Route53DNSResource
- type ScheduledTaskRequest
- type ScheduledTaskResource
- type SecretKeyResource
- type ServiceHealth
- type ServiceHooks
- type ServiceProbe
- type ServiceResources
- type ServiceTemplateDetail
- type ServiceTemplateListItem
- type SessionInfoResource
- type SetAppDatabaseRequest
- type SetAppEgressPolicyRequest
- type SetAppEnvironmentRequest
- type SetAppNodeRequest
- type SetAppProjectRequest
- type SetAppStorageRequest
- type SetAutoRollbackRequest
- type SetBackupScheduleRequest
- type SetDatabaseProjectRequest
- type SetDatabasePublicAccessRequest
- type SetDatabaseResourcesRequest
- type SetDomainBasicAuthRequest
- type SetDomainErrorPageRequest
- type SetDomainRedirectRequest
- type SetDomainTLSCertRequest
- type SetDomainWAFRequest
- type SetExecAccessRequest
- type SetGitSourceRequest
- type SetLogDrainRequest
- type SetNodeWorkloadsRequest
- type SetPreviewSettingsRequest
- type SetProjectOrganizationRequest
- type SetSecretLockRequest
- type SetSecretRequest
- type SetSharedEnvSecretRequest
- type SetVolumeBackupScheduleRequest
- type SetupStatusResource
- type SharedEnvVarResource
- type SlowQueryEntryResource
- type StaticSiteResource
- type SweepPreviewEnvironmentsResult
- type SystemDoctorResource
- type SystemPruneResult
- type SystemStatusResource
- type TagAppResource
- type TagResource
- type TestNotificationChannelRequest
- type TriggerBackupRequest
- type TriggerBaseBackupRequest
- type TriggerCloneRestoreRequest
- type TriggerPITRRestoreRequest
- type TriggerRestoreRequest
- type TriggerVolumeCloneRestoreRequest
- type UpdateAIAssistantSettingsRequest
- type UpdateAlertRuleRequest
- type UpdateBackupTargetRequest
- type UpdateCloudflareDNSRequest
- type UpdateCloudflareTunnelRequest
- type UpdateEnvironmentRequest
- type UpdateNotificationChannelRequest
- type UpdateOAuthProviderSettingsRequest
- type UpdateRegistryCredentialRequest
- type UpdateRegistrySettingsRequest
- type UpdateRoute53DNSRequest
- type UpdateUserAbilitiesRequest
- type UpdateVaultSettingsRequest
- type UpdatesResource
- type UseGitHubRepoAsSourceResponse
- type UseRepoAsSourceRequest
- type UserResource
- type VaultSettingsResource
- type VolumeBackupScheduleResource
- type VolumeCloneRestoreResource
- type WebhookDeliveryResource
Constants ¶
const ( EnvAPIToken = "APP_API_TOKEN" //nolint:gosec // this is the name of an env var, not a credential value EnvAPIURL = "APP_API_URL" EnvProfile = "APP_PROFILE" )
EnvAPIToken, EnvAPIURL, and EnvProfile are this project's established APP_*-env-var-prefix convention (see internal/brand's own envPrefix, and cmd/levelrail/main.go's APP_DATA_DIR/APP_HTTP_ADDR/etc.), not a product-name-specific prefix: renaming the product later must not require renaming these. Every caller of this package (the CLI, the MCP server) uses these same names, so a token or URL set for one is already set for the other.
const ( OAuthProviderGoogle = "google" OAuthProviderGitHub = "github" OAuthProviderOIDC = "oidc" )
OAuth provider names accepted by GET/PUT /api/v1/settings/oauth[/{provider}], redeclared from internal/store.OAuthProvider* rather than imported, the same reasoning as ServiceResources above.
const ( EmailBackendSMTP = "smtp" EmailBackendSES = "ses" )
Email backends accepted by EmailSettingsResource.Backend.
const CredentialsFileName = "credentials"
CredentialsFileName is the file ReadCredentialsFile reads, inside a directory named after the caller's own binary (ConfigDir below), not a hardcoded product name.
const DefaultAPIURL = "http://localhost:8080"
DefaultAPIURL is a zero-config local default, so a caller with no flag, env var, or credentials file still reaches a locally running control plane out of the box: its own defaultHTTPAddr (cmd/levelrail/main.go) is ":8080", so this is that same port on loopback.
const DefaultProfile = "default"
DefaultProfile is the section ResolveProfile falls back to when neither a --profile flag nor APP_PROFILE is set, and the section an old, pre-profile flat credentials file (no "[section]" headers at all) is read as, for backward compatibility with every credentials file written before profile support existed.
Variables ¶
This section is empty.
Functions ¶
func ConfigDir ¶
ConfigDir is "~/.config/<prog>", prog being the caller's own binary basename (filepath.Base(os.Args[0])), never a hardcoded product name: this makes the credentials file location follow the binary automatically if it's ever renamed, the same rebrandability property required everywhere else in this codebase.
func ExtractErrorMessage ¶
ExtractErrorMessage parses the control plane's {"error": "..."} body shape (internal/api/respond.go). A body that doesn't match that shape (a proxy's HTML error page, an empty body) falls back to the raw text so the caller still sees something, not a blank message. Exported so callers with their own hand-rolled request (outside this Client, e.g. the CLI's session-cookie authSessionClient) can reuse the same parsing rather than duplicating it.
func PathEscape ¶
PathEscape guards against a name containing characters that would otherwise change the request's URL shape (a "/" turning one path segment into two, for instance). Server-side validation is the real authority on what a valid app name is; this only protects request construction from building a request to the wrong path. Exported for the same reuse reason as ExtractErrorMessage.
func ResolveAPIURL ¶
func ResolveAPIURL(flagURL string, lookupEnv func(string) (string, bool), prog, profile string) string
ResolveAPIURL picks the base API URL by precedence: flagURL, then EnvAPIURL, then profile's section of the credentials file, then DefaultAPIURL.
func ResolveProfile ¶
ResolveProfile picks the active profile name by precedence: flagProfile, then EnvProfile, then DefaultProfile. It never returns an empty string.
func ResolveToken ¶
func ResolveToken(flagToken string, lookupEnv func(string) (string, bool), prog, profile string) string
ResolveToken picks an API token by precedence: flagToken, then EnvAPIToken, then profile's section of the local credentials file. Returns "" (not an error) if none is set: an empty token is a valid, if unlikely to succeed, thing to send, and letting the server's own 401 be what reports "not authenticated" keeps this function from duplicating that judgment.
func WriteCredentialsFile ¶
func WriteCredentialsFile(prog, profile string, creds Credentials) error
WriteCredentialsFile writes creds under profile's section in prog's credentials file, creating ConfigDir(prog) if it doesn't exist yet, and leaving every other profile section already in the file untouched. "auth login" is this function's only caller today: it is the one command that produces a credential rather than just consuming one. 0o600 on both the directory and the file, tighter than ReadCredentialsFile's own comment on the file needing to stay hand-editable: a freshly minted API token is a live credential, not a value that should ever be group- or world-readable by default.
Types ¶
type AIAssistantSettingsResource ¶ added in v0.2.0
type AIAssistantSettingsResource struct {
Configured bool `json:"configured"`
Provider string `json:"provider,omitempty"`
Model string `json:"model,omitempty"`
}
AIAssistantSettingsResource mirrors internal/api's aiAssistantSettingsResource (internal/api/ai_settings.go): the shape of GET/PUT/DELETE /api/v1/settings/ai-assistant. Configured reports whether a key has actually been saved; the key itself never round-trips.
type APIError ¶
type APIError struct {
StatusCode int
Message string
// RetryAfter is parsed from the response's Retry-After header
// (seconds form only, the only form this control plane ever sends),
// 0 when absent. Currently only the general per-actor rate limiter
// (429 Too Many Requests, internal/api/api_rate_limit.go) sets it,
// but any future response carrying the header gets the same
// treatment for free.
RetryAfter time.Duration
}
APIError is returned by Client methods for a non-2xx HTTP response: a real reply from the server, as opposed to a network-level failure (connection refused, DNS, timeout), which Client methods return as a plain wrapped error instead. Callers distinguish the two with errors.As, which is what picks the CLI's exit code and lets the MCP server surface a specific tool error (e.g. a 403's "token lacks the required ability" message) rather than a generic failure.
type AlertRuleResource ¶
type AlertRuleResource struct {
ID string `json:"id,omitempty"`
Name string `json:"name"`
Kind string `json:"kind"`
ResourceID string `json:"resource_id,omitempty"`
ChannelID string `json:"channel_id,omitempty"`
Metric string `json:"metric,omitempty"`
Comparator string `json:"comparator,omitempty"`
Threshold float64 `json:"threshold"`
ForDuration string `json:"for_duration,omitempty"`
RestartCountThreshold int `json:"restart_count_threshold"`
RestartWindow string `json:"restart_window,omitempty"`
ScheduledTaskID string `json:"scheduled_task_id,omitempty"`
// BackupResourceKind/BackupDatabaseName/BackupServiceName/
// BackupVolumeName are kind=backup_missing-only: see
// CreateAlertRuleRequest's own doc comment.
BackupResourceKind string `json:"backup_resource_kind,omitempty"`
BackupDatabaseName string `json:"backup_database_name,omitempty"`
BackupServiceName string `json:"backup_service_name,omitempty"`
BackupVolumeName string `json:"backup_volume_name,omitempty"`
NotifyURL string `json:"notify_url,omitempty"`
NotifyKind string `json:"notify_kind,omitempty"`
Enabled bool `json:"enabled"`
Firing bool `json:"firing,omitempty"`
PendingSince *time.Time `json:"pending_since,omitempty"`
FiringSince *time.Time `json:"firing_since,omitempty"`
LastEvaluatedAt *time.Time `json:"last_evaluated_at,omitempty"`
LastValue *float64 `json:"last_value,omitempty"`
}
AlertRuleResource mirrors internal/api's ruleResource (internal/api/alerts.go). Threshold-kind fields (Metric, Comparator, Threshold, ForDuration) and crashloop-kind fields (RestartCountThreshold, RestartWindow) are both present on the wire; only the ones matching Kind are meaningful, mirroring alerting.Rule's own shape. A kind=cert_expiry rule uses neither group: it watches every stored certificate platform-wide, not this rule's own resource_id.
type AppBindMountResource ¶ added in v0.2.0
type AppBindMountResource struct {
HostPath string `json:"host_path"`
ContainerPath string `json:"container_path"`
ReadOnly bool `json:"read_only,omitempty"`
}
AppBindMountResource mirrors internal/api's appBindMountResource (app_volumes.go): one of an app's bind-mounted host directories.
type AppBranchEnvOverride ¶ added in v0.2.0
type AppBranchEnvOverride struct {
ID string `json:"id"`
BranchPattern string `json:"branch_pattern"`
Key string `json:"key"`
Value string `json:"value"`
Secret bool `json:"secret"`
UpdatedAt string `json:"updated_at"`
}
AppBranchEnvOverride mirrors internal/api's branchEnvOverrideResource: one branch-scoped env var override. Value is always "" for a secret-marked entry, never echoed back once saved.
type AppDatabaseResource ¶
type AppDatabaseResource struct {
AppName string `json:"app_name,omitempty"`
DatabaseName string `json:"database_name"`
EnvVar string `json:"env_var"`
Field string `json:"field"`
}
AppDatabaseResource mirrors internal/api's appDatabaseResource: PUT /api/v1/apps/{name}/database's response body.
type AppEgressAllow ¶ added in v0.2.0
AppEgressAllow mirrors internal/api's egressAllowResource: one host+port pair in an app's outbound network allowlist.
type AppEgressPolicyResource ¶ added in v0.2.0
type AppEgressPolicyResource struct {
AppName string `json:"app_name"`
Mode string `json:"mode,omitempty"`
Allow []AppEgressAllow `json:"allow,omitempty"`
}
AppEgressPolicyResource mirrors internal/api's egressPolicyResource: GET/PUT /api/v1/apps/{name}/egress-policy's response body. Mode/Allow both empty means unconfigured, unrestricted egress, the default for every app that has never opted in.
type AppGroupResource ¶
type AppGroupResource struct {
AppID string `json:"app_id,omitempty"`
Services []AppResource `json:"services"`
Status AppStatusSummary `json:"status"`
}
AppGroupResource mirrors internal/api's appGroupResource (internal/api/apps_group.go): GET /api/v1/apps/{name}/group's response, name's sibling services under the same store.App plus one rollup status across all of them.
type AppHealthResource ¶ added in v0.2.0
type AppHealthResource struct {
Name string `json:"name"`
Health *ServiceHealth `json:"health"`
}
AppHealthResource mirrors internal/api's appHealthResource.
type AppHookRunsResource ¶
type AppHookRunsResource struct {
PreDeploy *HookRunResource `json:"pre_deploy,omitempty"`
PostDeploy *HookRunResource `json:"post_deploy,omitempty"`
}
AppHookRunsResource mirrors internal/api's appHookRunsResource: nil fields mean that hook has never run, not an empty HookRunResource.
type AppIntegrationResource ¶ added in v0.2.0
type AppIntegrationResource struct {
ID string `json:"id"`
AppName string `json:"app_name,omitempty"`
IntegrationKey string `json:"integration_key"`
Name string `json:"name"`
CreatedAt string `json:"created_at,omitempty"`
UpdatedAt string `json:"updated_at,omitempty"`
}
AppIntegrationResource mirrors internal/api's appIntegrationResource: one app's attached integration. Field values are never included here, the same "names only" shape SecretKeyResource already establishes.
type AppMetricsResource ¶
type AppMetricsResource struct {
Metric string `json:"metric"`
Points []MetricPointResource `json:"points"`
}
AppMetricsResource mirrors internal/api's metricsResponse (internal/api/metrics.go).
type AppPreviewEnvOverride ¶ added in v0.2.0
AppPreviewEnvOverride mirrors handleSetAppPreviewEnvOverride's own response shape: the env var key plus the preview-specific value just saved.
type AppResource ¶
type AppResource struct {
Name string `json:"name"`
Image string `json:"image"`
Port int `json:"port"`
// HostPort mirrors internal/api's appResource.HostPort: nil means
// "let Docker assign one", a value pins the host-side port. Settable
// on create and update, like Port.
HostPort *int `json:"host_port,omitempty"`
// BindAddress mirrors internal/api's appResource.BindAddress:
// "private" (loopback only, the default), "public" (every
// interface), or a literal IP. No omitempty: a response always
// carries the resolved value.
BindAddress string `json:"bind_address"`
Domains []string `json:"domains,omitempty"`
Env map[string]string `json:"env,omitempty"`
// SecretEnv mirrors internal/api's appResource.SecretEnv: names of
// env vars backed by encrypted secret storage, values held only in
// Secrets below or set later via PUT .../secrets/{key}, never here.
SecretEnv []string `json:"secret_env,omitempty"`
// Secrets mirrors internal/api's appResource.Secrets: plaintext
// values to encrypt and store for SecretEnv-named vars at create
// time. Write-only, like SetSecretRequest's own Value: never
// populated on a response.
Secrets map[string]string `json:"secrets,omitempty"`
// VaultEnv mirrors internal/api's appResource.VaultEnv: env vars
// whose values resolve live from an external HashiCorp Vault
// instance, never a value this platform stores. Settable at create
// time, response-mirrors the store otherwise.
VaultEnv map[string]AppVaultEnvRef `json:"vault_env,omitempty"`
Resources *ServiceResources `json:"resources,omitempty"`
Health *ServiceHealth `json:"health,omitempty"`
// Hooks mirrors internal/api's appResource.Hooks: settable on create
// and update, like Resources/Health above.
Hooks *ServiceHooks `json:"hooks,omitempty"`
// NodeID mirrors internal/api's appResource.NodeID: response-only on
// update, but settable at create time as an explicit placement
// override (omitted entirely lets the server auto-place via simple
// spread scheduling instead, see AutoPlaced below).
NodeID string `json:"node_id,omitempty"`
// AutoPlaced mirrors internal/api's appResource.AutoPlaced:
// response-only, true when create left node_id unset and the server
// picked a non-local node for it via simple spread scheduling.
AutoPlaced bool `json:"auto_placed,omitempty"`
// ProjectID mirrors internal/api's appResource.ProjectID:
// response-only, set via PUT /api/v1/apps/{name}/project.
ProjectID string `json:"project_id,omitempty"`
// EnvironmentID mirrors internal/api's appResource.EnvironmentID:
// response-only, set via PUT /api/v1/apps/{name}/environment.
EnvironmentID string `json:"environment_id,omitempty"`
// StorageTargetID mirrors internal/api's appResource.StorageTargetID:
// response-only, set via PUT/DELETE /api/v1/apps/{name}/storage
// (SetAppStorage/ClearAppStorage).
StorageTargetID string `json:"storage_target_id,omitempty"`
// EnvDirty mirrors internal/api's appResource.EnvDirty: true means
// Env was saved since the running container was last recreated, so
// the change is not live yet. Clears on restart or redeploy.
EnvDirty bool `json:"env_dirty"`
// Volumes mirrors internal/api's appResource.Volumes: this app's
// declared named Docker volumes, response-only (declared through
// app.yaml, not settable here).
Volumes []AppVolumeResource `json:"volumes,omitempty"`
// BindMounts mirrors internal/api's appResource.BindMounts: this
// app's declared host-directory bind mounts, response-only
// (declared through app.yaml or a compose import, not settable
// here).
BindMounts []AppBindMountResource `json:"bind_mounts,omitempty"`
// Command mirrors internal/api's appResource.Command: overrides the
// image's own default CMD, response-only (declared through app.yaml's
// command: or a compose import, not settable here).
Command []string `json:"command,omitempty"`
// PullPolicy mirrors internal/api's appResource.PullPolicy: "always"
// forces a fresh image pull on every deploy, empty is the default
// pull-if-absent behavior. Response-only (declared through a compose
// import's pull_policy:, not settable here).
PullPolicy string `json:"pull_policy,omitempty"`
// PreviewEnvOverrides mirrors internal/api's
// appResource.PreviewEnvOverrides: response-only, set via PUT/DELETE
// /api/v1/apps/{name}/preview-env/{key} (SetAppPreviewEnvOverride/
// ClearAppPreviewEnvOverride).
PreviewEnvOverrides map[string]string `json:"preview_env_overrides,omitempty"`
// Tags mirrors internal/api's appResource.Tags: names of every
// store.Tag attached to this app, response-only, set via POST/DELETE
// /api/v1/apps/{name}/tags (AttachAppTag/DetachAppTag).
Tags []string `json:"tags,omitempty"`
}
AppResource mirrors internal/api's appResource (apps.go). Field order and JSON tags match exactly, so a response decodes cleanly and a request encodes into exactly what the server expects.
type AppResourceUsageResource ¶ added in v0.2.0
type AppResourceUsageResource struct {
Name string `json:"name"`
CPUPercent *float64 `json:"cpu_percent,omitempty"`
MemoryUsageBytes *float64 `json:"memory_usage_bytes,omitempty"`
MemoryLimitBytes *float64 `json:"memory_limit_bytes,omitempty"`
NetworkRxBytes *float64 `json:"network_rx_bytes,omitempty"`
NetworkTxBytes *float64 `json:"network_tx_bytes,omitempty"`
}
AppResourceUsageResource mirrors internal/api's appResourceUsageResource (internal/api/app_resource_usage.go): one app's latest known CPU/memory/network reading, for the dashboard's "what's consuming the most resources right now" ranking. A nil field means telemetry has never recorded that metric for this app yet, not zero usage.
type AppStatusSummary ¶
AppStatusSummary mirrors internal/api's appStatusSummary (internal/api/app_status.go): a compact category rollup, not the raw conditions list ConditionResource carries.
type AppStorageResource ¶ added in v0.2.0
type AppStorageResource struct {
AppName string `json:"app_name"`
StorageTargetID string `json:"storage_target_id,omitempty"`
}
AppStorageResource mirrors internal/api's appStorageResource (internal/api/apps_storage.go): PUT/DELETE /api/v1/apps/{name}/storage's response.
type AppVaultEnvRef ¶ added in v0.2.0
AppVaultEnvRef mirrors internal/api's appVaultEnvRef: one env var's { path, key } reference into an external Vault instance.
type AppVolumeMoveResource ¶ added in v0.2.0
type AppVolumeMoveResource struct {
ID string `json:"id"`
ServiceName string `json:"service_name"`
FromNodeID string `json:"from_node_id"`
ToNodeID string `json:"to_node_id"`
Status string `json:"status"`
Error string `json:"error,omitempty"`
Steps []AppVolumeMoveStepResource `json:"steps"`
StartedAt string `json:"started_at"`
FinishedAt string `json:"finished_at,omitempty"`
}
AppVolumeMoveResource mirrors internal/api's appVolumeMoveResource: one "move this app to another node, taking its volumes with it" attempt. MoveAppWithVolumes always returns this shape regardless of status code: 200 means it already finished (an app with no volumes, or already on the target node), 202 means Status is "running" and the caller should poll GetAppVolumeMove until it isn't.
type AppVolumeMoveStepResource ¶ added in v0.2.0
type AppVolumeMoveStepResource struct {
Name string `json:"name"`
Status string `json:"status"`
Error string `json:"error,omitempty"`
StartedAt string `json:"started_at"`
FinishedAt string `json:"finished_at,omitempty"`
}
AppVolumeMoveStepResource mirrors internal/api's appVolumeMoveStepResource (apps_move_with_volumes.go).
type AppVolumeResource ¶
type AppVolumeResource struct {
Name string `json:"name"`
ContainerPath string `json:"container_path"`
}
AppVolumeResource mirrors internal/api's appVolumeResource (app_volumes.go): one of an app's named Docker volumes, identified by its logical name (what an operator wrote in app.yaml), not the resolved, platform-prefixed Docker volume name.
type AttachAppIntegrationRequest ¶ added in v0.2.0
type AttachAppIntegrationRequest struct {
IntegrationKey string `json:"integration_key"`
Fields map[string]string `json:"fields"`
}
AttachAppIntegrationRequest mirrors internal/api's attachAppIntegrationRequest.
type AttachAppTagRequest ¶ added in v0.2.0
type AttachAppTagRequest struct {
Name string `json:"name"`
}
AttachAppTagRequest mirrors internal/api's attachAppTagRequest: POST /api/v1/apps/{name}/tags' body, a tag name rather than an ID (see that type's own doc comment for why).
type AttachPolicyRequest ¶
type AttachPolicyRequest struct {
PrincipalType string `json:"principal_type"`
PrincipalID string `json:"principal_id"`
}
AttachPolicyRequest mirrors internal/api's attachPolicyRequest.
type AuditLogEntryResource ¶
type AuditLogEntryResource struct {
ID string `json:"id"`
ActorType string `json:"actor_type"`
ActorID string `json:"actor_id"`
ActorName string `json:"actor_name"`
Ability string `json:"ability"`
Method string `json:"method"`
Path string `json:"path"`
StatusCode int `json:"status_code"`
RemoteAddr string `json:"remote_addr"`
CreatedAt string `json:"created_at"`
ClientKind string `json:"client_kind"`
}
AuditLogEntryResource mirrors internal/api's auditLogEntryResource (internal/api/audit.go).
type AutoRollbackSettingResource ¶ added in v0.2.0
type AutoRollbackSettingResource struct {
Enabled bool `json:"enabled"`
}
AutoRollbackSettingResource mirrors internal/api's autoRollbackSettingResource: both GET and PUT /api/v1/apps/{name}/auto-rollback's response, whether this app rolls itself back automatically the next time a crashloop alert rule fires.
type BackupHistoryResource ¶
type BackupHistoryResource struct {
ID string `json:"id"`
ResourceKind string `json:"resource_kind"`
DatabaseName string `json:"database_name,omitempty"`
ServiceName string `json:"service_name,omitempty"`
VolumeName string `json:"volume_name,omitempty"`
TargetID string `json:"target_id"`
ObjectKey string `json:"object_key"`
SizeBytes int64 `json:"size_bytes"`
Status string `json:"status"`
Error string `json:"error,omitempty"`
StartedAt string `json:"started_at"`
FinishedAt string `json:"finished_at,omitempty"`
ChecksumSHA256 string `json:"checksum_sha256,omitempty"`
}
BackupHistoryResource mirrors internal/api's backupHistoryResource (internal/api/backups.go). ServiceName/VolumeName are set instead of DatabaseName for an app service volume backup, never alongside it.
type BackupScheduleResource ¶
type BackupScheduleResource struct {
DatabaseName string `json:"database_name"`
TargetID string `json:"target_id,omitempty"`
Schedule string `json:"schedule,omitempty"`
Retain int `json:"retain,omitempty"`
RetainDays int `json:"retain_days,omitempty"`
}
BackupScheduleResource mirrors internal/api's backupScheduleResource (internal/api/backups.go): PUT/DELETE .../backup-schedule only ever touch these three fields, never the full database resource.
type BackupTargetResource ¶
type BackupTargetResource struct {
ID string `json:"id"`
Name string `json:"name"`
Provider string `json:"provider"`
Endpoint string `json:"endpoint,omitempty"`
Region string `json:"region,omitempty"`
Bucket string `json:"bucket"`
CreatedAt string `json:"created_at"`
}
BackupTargetResource mirrors internal/api's backupTargetResource (internal/api/backup_targets.go). No credential fields: access_key_id and secret_access_key are write-only, accepted through CreateBackupTargetRequest/UpdateBackupTargetRequest and never echoed back in any response.
type BackupVerificationResource ¶
type BackupVerificationResource struct {
ID string `json:"id"`
BackupHistoryID string `json:"backup_history_id"`
Status string `json:"status"`
ChecksumMatch bool `json:"checksum_match"`
SizeMatch bool `json:"size_match"`
FormatValid bool `json:"format_valid"`
DownloadedBytes int64 `json:"downloaded_bytes"`
Error string `json:"error,omitempty"`
CheckedBy string `json:"checked_by,omitempty"`
StartedAt string `json:"started_at"`
FinishedAt string `json:"finished_at,omitempty"`
}
BackupVerificationResource mirrors internal/api's backupVerificationResource (internal/api/backup_verify.go).
type BaseBackupHistoryResource ¶ added in v0.2.0
type BaseBackupHistoryResource struct {
ID string `json:"id"`
DatabaseName string `json:"database_name"`
TargetID string `json:"target_id"`
LSN string `json:"lsn,omitempty"`
SizeBytes int64 `json:"size_bytes"`
Status string `json:"status"`
Error string `json:"error,omitempty"`
StartedAt string `json:"started_at"`
FinishedAt string `json:"finished_at,omitempty"`
}
BaseBackupHistoryResource mirrors internal/api's baseBackupHistoryResource: GET/POST .../base-backups.
type BitbucketAppRepoResource ¶ added in v0.2.0
type BitbucketAppRepoResource struct {
FullName string `json:"full_name"`
Name string `json:"name"`
Private bool `json:"private"`
DefaultBranch string `json:"default_branch"`
CloneURL string `json:"clone_url"`
WebURL string `json:"web_url"`
}
BitbucketAppRepoResource mirrors internal/api's bitbucketAppRepoResource: one entry of GET /api/v1/bitbucket-app/repos.
type BitbucketAppStatusResource ¶ added in v0.2.0
type BitbucketAppStatusResource struct {
Connected bool `json:"connected"`
Key string `json:"key,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
Authorized bool `json:"authorized"`
BaseURL string `json:"base_url,omitempty"`
}
BitbucketAppStatusResource mirrors internal/api's bitbucketAppStatusResource: GET /api/v1/bitbucket-app's response.
type BuildTriggerRequest ¶
type BuildTriggerRequest struct {
RepoURL string `json:"repo_url"`
Ref string `json:"ref"`
ImageRepo string `json:"image_repo,omitempty"`
Build BuildTriggerRequestBuild `json:"build,omitempty"`
}
BuildTriggerRequest mirrors internal/api's triggerBuildRequest (internal/api/builds.go). Ref is required server-side (handleTriggerBuild rejects an empty one with 400), so every caller of TriggerBuild must resolve a real ref before sending this, never leave it blank.
type BuildTriggerRequestBuild ¶
type BuildTriggerRequestBuild struct {
Type string `json:"type,omitempty"`
Path string `json:"path,omitempty"`
// BaseDirectory scopes the build context to a subdirectory of the
// repo, for a monorepo. Not meaningful for Type == "image".
BaseDirectory string `json:"base_directory,omitempty"`
Image string `json:"image,omitempty"`
// Args are Dockerfile build-time ARG values. Only meaningful for
// Type == "dockerfile".
Args map[string]string `json:"args,omitempty"`
}
BuildTriggerRequestBuild is BuildTriggerRequest's nested build.* input (internal/api/builds.go's triggerBuildBuildInput), matching the same fields app.yaml's own build: block has. Type left empty defaults server-side to a Dockerfile build. Image is only meaningful for Type == "image": a prebuilt registry reference deployed as-is, no repo/ref/build needed.
type BuildTriggerResponse ¶
type BuildTriggerResponse struct {
ID string `json:"id,omitempty"`
}
BuildTriggerResponse mirrors internal/api's triggerBuildResponse: handleTriggerBuild is asynchronous (202 Accepted, the fetch and build run in a background goroutine), so this carries only the new deploy attempt's id, not a finished image tag. Poll its outcome via "apps deploys list"/"apps deploys logs", the same deploy_attempts row a git-push-triggered deploy produces.
type CertificateResource ¶ added in v0.2.0
type CertificateResource struct {
Domain string `json:"domain"`
SANs []string `json:"sans,omitempty"`
Issuer string `json:"issuer,omitempty"`
NotBefore time.Time `json:"not_before"`
NotAfter time.Time `json:"not_after"`
Status string `json:"status"`
}
CertificateResource mirrors internal/api's certificateStatus (internal/api/certificates.go): one entry of GET /api/v1/certificates. Status is "healthy", "expiring_soon", or "expired".
type CleanupOrphanedVolumesRequest ¶ added in v0.2.0
type CleanupOrphanedVolumesRequest struct {
Names []string `json:"names"`
}
CleanupOrphanedVolumesRequest mirrors internal/api's cleanupOrphanedVolumesRequest: the exact, operator-confirmed set of volume names to remove.
type CleanupOrphanedVolumesResult ¶ added in v0.2.0
type CleanupOrphanedVolumesResult struct {
Removed []string `json:"removed"`
ReclaimedBytes uint64 `json:"reclaimed_bytes"`
Skipped []string `json:"skipped,omitempty"`
Errors []string `json:"errors,omitempty"`
}
CleanupOrphanedVolumesResult mirrors internal/api's cleanupOrphanedVolumesResponse.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a minimal HTTP client for the control plane's versioned API (internal/api, mounted at /api/v1). It carries no session/cookie state: every request is a single bearer-token call, matching how this project's own token scheme (internal/api/abilities.go) is meant to be used by a non-interactive caller.
func NewClient ¶
NewClient builds a Client. baseURL should not have a trailing slash (trimmed defensively if it does). The timeout is long, not the usual few seconds a typical REST call would use: POST .../builds is synchronous and blocking (internal/api/builds.go's own doc comment), and a real Dockerfile build can legitimately take minutes.
func (*Client) ApproveDeployApproval ¶ added in v0.2.0
func (c *Client) ApproveDeployApproval(ctx context.Context, id string) (DeployApprovalDecisionResult, error)
ApproveDeployApproval calls POST /api/v1/deploy-approvals/{id}/approve: applies the gated deploy/promote through the normal reconcile path. Fails with 403 if the caller is the same actor who requested it, or 409 if it's no longer pending (already decided, or expired).
func (*Client) AttachAppIntegration ¶ added in v0.2.0
func (c *Client) AttachAppIntegration(ctx context.Context, name, integrationKey string, fields map[string]string) (AppIntegrationResource, error)
AttachAppIntegration calls POST /api/v1/apps/{name}/integrations: attaches integrationKey with the given field values, storing them through the same envelope encryption every other app secret uses.
func (*Client) AttachAppTag ¶ added in v0.2.0
AttachAppTag calls POST /api/v1/apps/{name}/tags: attaches tagName, creating it first if this is the first time it's been used.
func (*Client) AttachPolicy ¶
AttachPolicy calls POST /api/v1/iam/policies/{id}/attachments.
func (*Client) CheckDomain ¶ added in v0.2.0
CheckDomain calls GET /api/v1/apps/{name}/domains/{domain}/check: a real DNS lookup reporting whether domain currently resolves to this control plane's own advertised address.
func (*Client) CleanupOrphanedVolumes ¶ added in v0.2.0
func (c *Client) CleanupOrphanedVolumes(ctx context.Context, names []string) (CleanupOrphanedVolumesResult, error)
CleanupOrphanedVolumes calls POST /api/v1/system/volumes/orphaned/cleanup: removes exactly the named volumes, after the control plane re-confirms each one is still genuinely orphaned.
func (*Client) ClearAppDatabaseAttachment ¶
ClearAppDatabaseAttachment calls DELETE /api/v1/apps/{name}/database.
func (*Client) ClearAppEgressPolicy ¶ added in v0.2.0
ClearAppEgressPolicy calls DELETE /api/v1/apps/{name}/egress-policy, opting name back out to unrestricted egress.
func (*Client) ClearAppHealth ¶ added in v0.2.0
ClearAppHealth calls DELETE /api/v1/apps/{name}/health.
func (*Client) ClearAppPreviewEnvOverride ¶ added in v0.2.0
ClearAppPreviewEnvOverride calls DELETE /api/v1/apps/{name}/preview-env/{key}.
func (*Client) ClearAppStorage ¶ added in v0.2.0
ClearAppStorage calls DELETE /api/v1/apps/{name}/storage: detaches name's object-storage credential source.
func (*Client) ClearAppVaultEnv ¶ added in v0.2.0
ClearAppVaultEnv calls DELETE /api/v1/apps/{name}/vault-env/{key}.
func (*Client) ClearBackupSchedule ¶
ClearBackupSchedule calls DELETE /api/v1/databases/{name}/backup-schedule: returns name to its default "no scheduled backup configured" state. Past backup_history rows are untouched, only the going-forward configuration.
func (*Client) ClearDatabasePublicAccess ¶ added in v0.2.0
ClearDatabasePublicAccess calls DELETE /api/v1/databases/{name}/public-access: returns name to internal-network-only, the reverse of SetDatabasePublicAccess.
func (*Client) ClearDomainBasicAuth ¶
func (c *Client) ClearDomainBasicAuth(ctx context.Context, name, domain string) (DomainBasicAuthResource, error)
ClearDomainBasicAuth calls DELETE /api/v1/apps/{name}/domains/{domain}/auth: removes basic auth protection from domain.
func (*Client) ClearDomainErrorPage ¶ added in v0.2.0
func (c *Client) ClearDomainErrorPage(ctx context.Context, name, domain string, statusCode int) (DomainErrorPagesResource, error)
ClearDomainErrorPage calls DELETE /api/v1/apps/{name}/domains/{domain}/error-pages?status_code=<code>: removes domain's mapping for one status code.
func (*Client) ClearDomainErrorPages ¶ added in v0.2.0
func (c *Client) ClearDomainErrorPages(ctx context.Context, name, domain string) (DomainErrorPagesResource, error)
ClearDomainErrorPages calls DELETE /api/v1/apps/{name}/domains/{domain}/error-pages: removes every custom error page configured for domain.
func (*Client) ClearDomainMaintenance ¶
func (c *Client) ClearDomainMaintenance(ctx context.Context, name, domain string) (DomainMaintenanceResource, error)
ClearDomainMaintenance calls DELETE /api/v1/apps/{name}/domains/{domain}/maintenance: disables maintenance mode on domain.
func (*Client) ClearDomainRedirect ¶ added in v0.2.0
func (c *Client) ClearDomainRedirect(ctx context.Context, name, domain string) (DomainRedirectResource, error)
ClearDomainRedirect calls DELETE /api/v1/apps/{name}/domains/{domain}/redirect: removes domain's redirect.
func (*Client) ClearDomainTLSCert ¶
func (c *Client) ClearDomainTLSCert(ctx context.Context, name, domain string) (DomainTLSCertResource, error)
ClearDomainTLSCert calls DELETE /api/v1/apps/{name}/domains/{domain}/tls-cert: removes domain's BYO certificate, reverting it to automatic ACME/internal issuance.
func (*Client) ClearDomainWAF ¶ added in v0.2.0
func (c *Client) ClearDomainWAF(ctx context.Context, name, domain string) (DomainWAFResource, error)
ClearDomainWAF calls DELETE /api/v1/apps/{name}/domains/{domain}/waf: resets domain to no WAF and no rate limiting.
func (*Client) ClearLogDrain ¶
ClearLogDrain calls DELETE /api/v1/apps/{name}/log-drain. No response body (204 on success), matching SetSecret's own "no body beyond the status" shape above.
func (*Client) ClearVolumeBackupSchedule ¶
ClearVolumeBackupSchedule calls DELETE /api/v1/apps/{name}/volumes/{volume}/backup-schedule: the app service volume counterpart of ClearBackupSchedule.
func (*Client) CloneApp ¶ added in v0.2.0
CloneApp calls POST /api/v1/apps/{name}/clone: duplicates name's desired state under newName. Domains, secret values, and node placement are never copied (see internal/api/apps_clone.go's own doc comment for why).
func (*Client) CloneEnvironment ¶ added in v0.2.0
func (c *Client) CloneEnvironment(ctx context.Context, id string, req EnvironmentCloneRequest) (EnvironmentCloneResultResource, error)
CloneEnvironment calls POST /api/v1/environments/{id}/clone: creates a new environment in id's own project plus a real, deployed copy of every app tagged with id.
func (*Client) CompareDeploys ¶
func (c *Client) CompareDeploys(ctx context.Context, name, from, to string) (DeployCompareResource, error)
CompareDeploys calls GET /api/v1/apps/{name}/deploys/compare: a before/after diff of deploy attempt from against to, or against the app's current live state when to is empty.
func (*Client) CordonNode ¶
CordonNode calls POST /api/v1/nodes/{id}/cordon: marks id unschedulable for new placements without evacuating anything already running there.
func (*Client) CreateAlertRule ¶
func (c *Client) CreateAlertRule(ctx context.Context, name string, req CreateAlertRuleRequest) (AlertRuleResource, error)
CreateAlertRule calls POST /api/v1/apps/{name}/alerts.
func (*Client) CreateApp ¶
func (c *Client) CreateApp(ctx context.Context, req AppResource) (AppResource, error)
CreateApp calls POST /api/v1/apps.
func (*Client) CreateBackupTarget ¶
func (c *Client) CreateBackupTarget(ctx context.Context, req CreateBackupTargetRequest) (BackupTargetResource, error)
CreateBackupTarget calls POST /api/v1/backup-targets.
func (*Client) CreateDatabase ¶
func (c *Client) CreateDatabase(ctx context.Context, req DatabaseResource) (DatabaseResource, error)
CreateDatabase calls POST /api/v1/databases.
func (*Client) CreateDeployNotifyTarget ¶ added in v0.2.0
func (c *Client) CreateDeployNotifyTarget(ctx context.Context, name string, req CreateDeployNotifyTargetRequest) (DeployNotifyTargetResource, error)
CreateDeployNotifyTarget calls POST /api/v1/apps/{name}/deploy-notify-targets.
func (*Client) CreateEnvironment ¶
func (c *Client) CreateEnvironment(ctx context.Context, projectID string, req CreateEnvironmentRequest) (EnvironmentResource, error)
CreateEnvironment calls POST /api/v1/projects/{id}/environments.
func (*Client) CreateFeatureFlag ¶
func (c *Client) CreateFeatureFlag(ctx context.Context, name string, req FeatureFlagRequest) (FeatureFlagResource, error)
CreateFeatureFlag calls POST /api/v1/apps/{name}/flags.
func (*Client) CreateInvite ¶
func (c *Client) CreateInvite(ctx context.Context, req CreateInviteRequest) (CreateInviteResponse, error)
CreateInvite calls POST /api/v1/invites.
func (*Client) CreateNodeJoinToken ¶
func (c *Client) CreateNodeJoinToken(ctx context.Context) (CreateNodeJoinTokenResponse, error)
CreateNodeJoinToken calls POST /api/v1/nodes/join-tokens: mints a one-time enrollment token, returned in plaintext exactly once.
func (*Client) CreateNotificationChannel ¶
func (c *Client) CreateNotificationChannel(ctx context.Context, req CreateNotificationChannelRequest) (NotificationChannelResource, error)
CreateNotificationChannel calls POST /api/v1/notification-channels.
func (*Client) CreateOrganization ¶
func (c *Client) CreateOrganization(ctx context.Context, req CreateOrganizationRequest) (OrganizationResource, error)
CreateOrganization calls POST /api/v1/organizations.
func (*Client) CreatePolicy ¶
func (c *Client) CreatePolicy(ctx context.Context, req PolicyRequest) (PolicyResource, error)
CreatePolicy calls POST /api/v1/iam/policies.
func (*Client) CreateProject ¶
func (c *Client) CreateProject(ctx context.Context, req CreateProjectRequest) (ProjectResource, error)
CreateProject calls POST /api/v1/projects.
func (*Client) CreateRegistryCredential ¶
func (c *Client) CreateRegistryCredential(ctx context.Context, req CreateRegistryCredentialRequest) (RegistryCredentialResource, error)
CreateRegistryCredential calls POST /api/v1/registry-credentials.
func (*Client) CreateScheduledTask ¶
func (c *Client) CreateScheduledTask(ctx context.Context, name string, req ScheduledTaskRequest) (ScheduledTaskResource, error)
CreateScheduledTask calls POST /api/v1/apps/{name}/scheduled-tasks.
func (*Client) CreateUser ¶
func (c *Client) CreateUser(ctx context.Context, req CreateUserRequest) (UserResource, error)
CreateUser calls POST /api/v1/auth/users.
func (*Client) DeleteAIAssistantSettings ¶ added in v0.2.0
func (c *Client) DeleteAIAssistantSettings(ctx context.Context) (AIAssistantSettingsResource, error)
DeleteAIAssistantSettings calls DELETE /api/v1/settings/ai-assistant: clears the stored key and resets provider/model in one step.
func (*Client) DeleteAlertRule ¶
DeleteAlertRule calls DELETE /api/v1/apps/{name}/alerts/{id}.
func (*Client) DeleteApp ¶
DeleteApp calls DELETE /api/v1/apps/{name}: removes the app's desired state (internal/api/apps.go's own handleDeleteApp doc comment covers the known gap that this does not itself stop the running container).
func (*Client) DeleteAppBranchEnv ¶ added in v0.2.0
DeleteAppBranchEnv calls DELETE /api/v1/apps/{name}/branch-env/{id}: id is the override's own id (from ListAppBranchEnv or SetAppBranchEnv), not a branch name or env var key.
func (*Client) DeleteBackup ¶ added in v0.2.0
DeleteBackup calls DELETE /api/v1/databases/{name}/backups/{historyId}: permanently deletes one specific archived backup attempt, both its stored object and its history row, rather than waiting for retention to age it out. Irreversible; callers must gate this behind their own explicit confirmation before ever reaching it.
func (*Client) DeleteBackupTarget ¶
DeleteBackupTarget calls DELETE /api/v1/backup-targets/{id}.
func (*Client) DeleteDatabase ¶
DeleteDatabase calls DELETE /api/v1/databases/{name}.
func (*Client) DeleteDeployNotifyTarget ¶ added in v0.2.0
DeleteDeployNotifyTarget calls DELETE /api/v1/apps/{name}/deploy-notify-targets/{id}.
func (*Client) DeleteEnvironment ¶
DeleteEnvironment calls DELETE /api/v1/environments/{id}.
func (*Client) DeleteFeatureFlag ¶
DeleteFeatureFlag calls DELETE /api/v1/apps/{name}/flags/{id}.
func (*Client) DeleteGitSource ¶
DeleteGitSource calls DELETE /api/v1/apps/{name}/git-source.
func (*Client) DeleteNode ¶
DeleteNode calls DELETE /api/v1/nodes/{id}. Refused with a 409 (*APIError) while any service or database is still placed on id, telling the caller to drain first (handleDeleteNode's own doc comment).
func (*Client) DeleteNotificationChannel ¶
DeleteNotificationChannel calls DELETE /api/v1/notification-channels/{id}.
func (*Client) DeleteOrganization ¶
DeleteOrganization calls DELETE /api/v1/organizations/{id}.
func (*Client) DeletePolicy ¶
DeletePolicy calls DELETE /api/v1/iam/policies/{id}.
func (*Client) DeleteProject ¶
DeleteProject calls DELETE /api/v1/projects/{id}.
func (*Client) DeleteRegistryCredential ¶
DeleteRegistryCredential calls DELETE /api/v1/registry-credentials/{id}.
func (*Client) DeleteScheduledTask ¶
DeleteScheduledTask calls DELETE /api/v1/apps/{name}/scheduled-tasks/{id}.
func (*Client) DeleteSharedEnvSecret ¶ added in v0.2.0
DeleteSharedEnvSecret calls DELETE /api/v1/{scope}s/{id}/env/secrets/{key}.
func (*Client) DeleteUser ¶
DeleteUser calls DELETE /api/v1/users/{id}.
func (*Client) DeleteVolumeBackup ¶ added in v0.2.0
DeleteVolumeBackup calls DELETE /api/v1/apps/{name}/volumes/{volume}/backups/{historyId}: the app service volume counterpart of DeleteBackup.
func (*Client) DeployApp ¶
func (c *Client) DeployApp(ctx context.Context, name, image string, confirm bool) (DeployTriggerResult, error)
DeployApp calls POST /api/v1/apps/{name}/deploys: points the app's desired image at image. Asynchronous: this returns as soon as the desired state is saved, not once a container is actually running it. Also how a rollback is done: deploying an older, already-known tag with this same method.
confirm must be true just to have the request accepted at all when the app is tagged with a protected environment (internal/api/ environments.go's checkEnvironmentProtection); otherwise the call fails with a 409, ignored when the app has no protected environment. Even with confirm: true, a protected environment does not deploy immediately: the result's PendingApproval is set instead of App, and a different, sufficiently privileged user must approve it (ApproveDeployApproval below) before this tag actually reaches a running container.
func (*Client) DeployCompose ¶
func (c *Client) DeployCompose(ctx context.Context, name string, composeYAML []byte) (ComposeDeployResult, error)
DeployCompose calls POST /api/v1/apps/{name}/compose with composeYAML as the raw request body. Unlike every other Client method, this doesn't go through do(): handleDeployCompose (internal/api/apps_compose.go) reads the body directly via io.ReadAll and parses it as a compose.yaml document, so the body must be sent as-is, not JSON-marshaled, with Content-Type: text/yaml instead of do()'s hardcoded application/json.
func (*Client) DeploySpec ¶
func (c *Client) DeploySpec(ctx context.Context, name string, req DeploySpecRequest) (DeploySpecResult, error)
DeploySpec calls POST /api/v1/apps/{name}/deploy-spec (internal/api/apps_multi.go's handleDeploySpec): fans req.Services out into N independent builds+deploys under one store.App named name. Synchronous and blocking, same as TriggerBuild, for the identical reason (internal/api/apps_multi.go's own doc comment).
func (*Client) DetachAppIntegration ¶ added in v0.2.0
DetachAppIntegration calls DELETE /api/v1/apps/{name}/integrations/{id}: id is the attachment's own ID (from ListAppIntegrations), not the catalog key.
func (*Client) DetachAppTag ¶ added in v0.2.0
DetachAppTag calls DELETE /api/v1/apps/{name}/tags/{id}: id is the tag's ID (from ListAppTags or ListTags above), not its name.
func (*Client) DetachPolicy ¶
DetachPolicy calls DELETE /api/v1/iam/policies/{id}/attachments/{principalType}/{principalID}.
func (*Client) DiagnoseApp ¶
DiagnoseApp calls GET /api/v1/apps/{name}/diagnose (internal/api/diagnose.go's handleDiagnoseApp): a read-only, deterministic explanation of the app's newest deploy failure or crashloop state. deployID pins the diagnosis to one past attempt (?deploy_id=); empty means "the app's newest attempt."
func (*Client) DisablePITR ¶ added in v0.2.0
DisablePITR calls DELETE /api/v1/databases/{name}/pitr.
func (*Client) DisableRegistry ¶
func (c *Client) DisableRegistry(ctx context.Context) (RegistrySettingsResource, error)
DisableRegistry calls DELETE /api/v1/settings/registry: disables the registry and clears its generated credentials in one step.
func (*Client) DisconnectBitbucketApp ¶ added in v0.2.0
DisconnectBitbucketApp calls DELETE /api/v1/bitbucket-app: forgets the stored connection locally. Does not revoke the token or delete the consumer on Bitbucket's own side.
func (*Client) DisconnectCloudflareDNS ¶
func (c *Client) DisconnectCloudflareDNS(ctx context.Context) (CloudflareDNSResource, error)
DisconnectCloudflareDNS calls DELETE /api/v1/settings/cloudflare-dns.
func (*Client) DisconnectCloudflareTunnel ¶
func (c *Client) DisconnectCloudflareTunnel(ctx context.Context) (CloudflareTunnelResource, error)
DisconnectCloudflareTunnel calls DELETE /api/v1/settings/cloudflare-tunnel: disables the tunnel and clears the stored token in one step.
func (*Client) DisconnectGitHubApp ¶ added in v0.2.0
DisconnectGitHubApp calls DELETE /api/v1/github-app: forgets the stored connection locally. Does not uninstall or delete the App on GitHub's own side.
func (*Client) DisconnectGitLabApp ¶ added in v0.2.0
DisconnectGitLabApp calls DELETE /api/v1/gitlab-app: forgets the stored connection locally. Does not revoke the token or delete the Application on GitLab's own side.
func (*Client) DisconnectGiteaApp ¶ added in v0.2.0
DisconnectGiteaApp calls DELETE /api/v1/gitea-app: forgets the stored connection locally. Does not revoke the token or delete the Application on Gitea's own side.
func (*Client) DisconnectRoute53DNS ¶ added in v0.2.0
func (c *Client) DisconnectRoute53DNS(ctx context.Context) (Route53DNSResource, error)
DisconnectRoute53DNS calls DELETE /api/v1/settings/route53-dns.
func (*Client) DisconnectVault ¶ added in v0.2.0
func (c *Client) DisconnectVault(ctx context.Context) (VaultSettingsResource, error)
DisconnectVault calls DELETE /api/v1/settings/vault: disables vault and clears the stored credential in one step.
func (*Client) DownloadAuditLogCSV ¶
DownloadAuditLogCSV calls GET /api/v1/audit-log?format=csv: the same rows ListAuditLog returns, as a raw CSV file rather than JSON. Built as its own request rather than through do(), since the response body is a CSV file to pass through unmodified, not a JSON value to decode.
func (*Client) DownloadBackup ¶ added in v0.2.0
DownloadBackup calls GET /api/v1/databases/{name}/backups/{historyId}/download: one succeeded database backup's own object, streamed straight through as raw bytes so a caller can write it to a local file.
func (*Client) DownloadDeployLog ¶ added in v0.2.0
DownloadDeployLog calls GET /api/v1/apps/{name}/deploys/{deployId}/logs/download: one deploy attempt's full log as raw text, the download counterpart to the dashboard's own SSE view. Built as its own request rather than through do(), the same reasoning DownloadAuditLogCSV above already gives: the response body is a text file to pass through unmodified, not a JSON value to decode.
func (*Client) DownloadVolumeBackup ¶ added in v0.2.0
func (c *Client) DownloadVolumeBackup(ctx context.Context, name, volume, historyID string) ([]byte, error)
DownloadVolumeBackup calls GET /api/v1/apps/{name}/volumes/{volume}/backups/{historyId}/download: the app service volume counterpart of DownloadBackup above.
func (*Client) DrainNode ¶
DrainNode calls POST /api/v1/nodes/{id}/drain?target_node_id=: moves every service and database placed on id to targetNodeID (empty: the local-node sentinel, the server's own default).
func (*Client) EnablePITR ¶ added in v0.2.0
EnablePITR calls POST /api/v1/databases/{name}/pitr: turns on continuous WAL archiving for name going forward.
func (*Client) EvaluateFeatureFlag ¶
func (c *Client) EvaluateFeatureFlag(ctx context.Context, key, identifier string) (EvaluateFlagResource, error)
EvaluateFeatureFlag calls GET /api/v1/flags/evaluate/{key}, optionally with an identifier query param for consistent percentage-rollout bucketing. Flat, not nested under an app: see internal/api/feature_flags.go's own handleEvaluateFeatureFlag doc comment for why.
func (*Client) ExecApp ¶
func (c *Client) ExecApp(ctx context.Context, name string, req ExecRequest) (ExecResponse, error)
ExecApp calls POST /api/v1/apps/{name}/exec: runs command (plus args) inside the app's currently running container and returns its stdout/stderr/exit code once it finishes. AbilityRoot-gated server-side (internal/api/exec.go's own doc comment: secrets are injected as plaintext env vars, so exec can read them anyway, and must sit behind the tier that boundary implies).
func (*Client) GetAIAssistantSettings ¶ added in v0.2.0
func (c *Client) GetAIAssistantSettings(ctx context.Context) (AIAssistantSettingsResource, error)
GetAIAssistantSettings calls GET /api/v1/settings/ai-assistant.
func (*Client) GetAppEgressPolicy ¶ added in v0.2.0
func (c *Client) GetAppEgressPolicy(ctx context.Context, name string) (AppEgressPolicyResource, error)
GetAppEgressPolicy calls GET /api/v1/apps/{name}/egress-policy: name's current outbound network allowlist, unconfigured (Mode/Allow both empty) meaning unrestricted egress.
func (*Client) GetAppGroup ¶
GetAppGroup calls GET /api/v1/apps/{name}/group (internal/api/apps_group.go's handleGetAppGroup): name's sibling services under the same store.App, one call whether name already has siblings or is its own one-service group.
func (*Client) GetAppHealth ¶ added in v0.2.0
GetAppHealth calls GET /api/v1/apps/{name}/health.
func (*Client) GetAppHookRuns ¶
GetAppHookRuns calls GET /api/v1/apps/{name}/hook-runs (internal/api/apps_hooks.go's handleGetAppHookRuns): the most recent outcome of each of name's pre/post-deploy hooks.
func (*Client) GetAppNetwork ¶
GetAppNetwork calls GET /api/v1/apps/{name}/network (internal/api/network.go's handleGetAppNetwork).
func (*Client) GetAppResourceRecommendation ¶
func (c *Client) GetAppResourceRecommendation(ctx context.Context, name string) (ResourceRecommendationResource, error)
GetAppResourceRecommendation calls GET /api/v1/apps/{name}/resource-recommendation (internal/api/resource_recommendation.go's handleAppResourceRecommendation): a read-only, deterministic memory/CPU right-sizing suggestion derived from the app's own historical usage.
func (*Client) GetAppVolumeMove ¶ added in v0.2.0
func (c *Client) GetAppVolumeMove(ctx context.Context, name, id string) (AppVolumeMoveResource, error)
GetAppVolumeMove calls GET /api/v1/apps/{name}/moves/{id}: what a caller polls while MoveAppWithVolumes' own returned Status is still "running".
func (*Client) GetAutoRollback ¶ added in v0.2.0
func (c *Client) GetAutoRollback(ctx context.Context, appName string) (AutoRollbackSettingResource, error)
GetAutoRollback calls GET /api/v1/apps/{name}/auto-rollback: whether appName rolls itself back automatically the next time a crashloop alert rule fires for it.
func (*Client) GetBackupTarget ¶
GetBackupTarget calls GET /api/v1/backup-targets/{id}.
func (*Client) GetBitbucketAppStatus ¶ added in v0.2.0
func (c *Client) GetBitbucketAppStatus(ctx context.Context) (BitbucketAppStatusResource, error)
GetBitbucketAppStatus calls GET /api/v1/bitbucket-app: the connection status (configured, and whether the OAuth consumer has been authorized).
func (*Client) GetCloudflareDNS ¶
func (c *Client) GetCloudflareDNS(ctx context.Context) (CloudflareDNSResource, error)
GetCloudflareDNS calls GET /api/v1/settings/cloudflare-dns: the Cloudflare DNS-01 credential's enabled/has_token state, needed for ACME to issue real wildcard certificates (HTTP-01 cannot).
func (*Client) GetCloudflareTunnel ¶
func (c *Client) GetCloudflareTunnel(ctx context.Context) (CloudflareTunnelResource, error)
GetCloudflareTunnel calls GET /api/v1/settings/cloudflare-tunnel: the cloudflared container's configured/observed state, exposing the control plane through a Cloudflare Tunnel instead of an inbound port.
func (*Client) GetDashboardURL ¶ added in v0.2.0
func (c *Client) GetDashboardURL(ctx context.Context) (DashboardURLResource, error)
GetDashboardURL calls GET /api/v1/settings/dashboard-url.
func (*Client) GetDatabase ¶
GetDatabase calls GET /api/v1/databases/{name}.
func (*Client) GetDatabaseResourceRecommendation ¶
func (c *Client) GetDatabaseResourceRecommendation(ctx context.Context, name string) (ResourceRecommendationResource, error)
GetDatabaseResourceRecommendation calls GET /api/v1/databases/{name}/resource-recommendation (internal/api/database_resource_recommendation.go's handleDatabaseResourceRecommendation): the database-kind counterpart to GetAppResourceRecommendation, same wire shape.
func (*Client) GetDeployApproval ¶ added in v0.2.0
GetDeployApproval calls GET /api/v1/deploy-approvals/{id}.
func (*Client) GetDeployStatus ¶
GetDeployStatus calls GET /api/v1/apps/{name}/deploys: the application controller's current stored reconcile conditions, not a deploy history log (internal/api/deploys.go's own handleDeployHistory doc comment).
func (*Client) GetDomainBasicAuth ¶
func (c *Client) GetDomainBasicAuth(ctx context.Context, name, domain string) (DomainBasicAuthResource, error)
GetDomainBasicAuth calls GET /api/v1/apps/{name}/domains/{domain}/auth: domain's current HTTP Basic Auth state.
func (*Client) GetDomainErrorPages ¶ added in v0.2.0
func (c *Client) GetDomainErrorPages(ctx context.Context, name, domain string) (DomainErrorPagesResource, error)
GetDomainErrorPages calls GET /api/v1/apps/{name}/domains/{domain}/error-pages: every custom error page currently configured for domain.
func (*Client) GetDomainMaintenance ¶
func (c *Client) GetDomainMaintenance(ctx context.Context, name, domain string) (DomainMaintenanceResource, error)
GetDomainMaintenance calls GET /api/v1/apps/{name}/domains/{domain}/maintenance: domain's current maintenance-mode state.
func (*Client) GetDomainRedirect ¶ added in v0.2.0
func (c *Client) GetDomainRedirect(ctx context.Context, name, domain string) (DomainRedirectResource, error)
GetDomainRedirect calls GET /api/v1/apps/{name}/domains/{domain}/redirect: domain's current redirect configuration.
func (*Client) GetDomainTLSCert ¶
func (c *Client) GetDomainTLSCert(ctx context.Context, name, domain string) (DomainTLSCertResource, error)
GetDomainTLSCert calls GET /api/v1/apps/{name}/domains/{domain}/tls-cert: domain's current BYO certificate state.
func (*Client) GetDomainWAF ¶ added in v0.2.0
GetDomainWAF calls GET /api/v1/apps/{name}/domains/{domain}/waf: domain's current WAF and rate-limit state.
func (*Client) GetEmailSettings ¶ added in v0.2.0
func (c *Client) GetEmailSettings(ctx context.Context) (EmailSettingsResource, error)
GetEmailSettings calls GET /api/v1/settings/email.
func (*Client) GetEnvironmentEnv ¶
GetEnvironmentEnv calls GET /api/v1/environments/{id}/env.
func (*Client) GetExecAccess ¶ added in v0.2.0
GetExecAccess calls GET /api/v1/apps/{name}/exec-access: whether appName's shell/exec routes (POST .../exec, GET .../terminal) are even attempted, regardless of the caller's own IAM abilities. On by default.
func (*Client) GetFeatureFlag ¶
GetFeatureFlag calls GET /api/v1/apps/{name}/flags/{id}.
func (*Client) GetFleetResourceUsage ¶ added in v0.2.0
func (c *Client) GetFleetResourceUsage(ctx context.Context) (FleetResourceUsageResource, error)
GetFleetResourceUsage calls GET /api/v1/nodes/resource-usage (internal/api/node_resource_usage.go's handleFleetResourceUsage): the latest CPU/memory/disk reading for every node plus a fleet-wide rollup, the node-scoped counterpart to ListAppResourceUsage.
func (*Client) GetGitHubAppStatus ¶ added in v0.2.0
func (c *Client) GetGitHubAppStatus(ctx context.Context) (GitHubAppStatusResource, error)
GetGitHubAppStatus calls GET /api/v1/github-app: the connection status (not connected / connected / connected but not yet installed).
func (*Client) GetGitLabAppStatus ¶ added in v0.2.0
func (c *Client) GetGitLabAppStatus(ctx context.Context) (GitLabAppStatusResource, error)
GetGitLabAppStatus calls GET /api/v1/gitlab-app: the connection status (configured, and whether the OAuth authorization-code flow has completed).
func (*Client) GetGitSource ¶
GetGitSource calls GET /api/v1/apps/{name}/git-source.
func (*Client) GetGiteaAppStatus ¶ added in v0.2.0
func (c *Client) GetGiteaAppStatus(ctx context.Context) (GiteaAppStatusResource, error)
GetGiteaAppStatus calls GET /api/v1/gitea-app: the connection status (configured, and whether the OAuth authorization-code flow has completed).
func (*Client) GetIngressSettings ¶ added in v0.2.0
func (c *Client) GetIngressSettings(ctx context.Context) (IngressSettingsResource, error)
GetIngressSettings calls GET /api/v1/settings/ingress.
func (*Client) GetLogDrain ¶
GetLogDrain calls GET /api/v1/apps/{name}/log-drain: the app's currently configured external log-forwarding sink. Returns *APIError with StatusCode 404 (via errors.As) if the app doesn't exist or has no drain configured, the same two-404-cases-in-one shape that route's own doc comment describes.
func (*Client) GetMeshStatus ¶ added in v0.2.0
func (c *Client) GetMeshStatus(ctx context.Context) (MeshStatusResource, error)
GetMeshStatus calls GET /api/v1/mesh: this node's live WireGuard mesh state, every peer it currently knows about, and its own most recent key rotation if any. Returns a 501-wrapping error when mesh networking is not enabled on the target control plane.
func (*Client) GetNodeHealth ¶
GetNodeHealth calls GET /api/v1/nodes/{id}/health: the node health controller's stored reconcile conditions, the same ConditionResource shape GetDeployStatus returns for an app.
func (*Client) GetNodePatchStatus ¶
func (c *Client) GetNodePatchStatus(ctx context.Context, id string) (NodePatchStatusResource, error)
GetNodePatchStatus calls GET /api/v1/nodes/{id}/patch-status: the latest OS-patch reading HostPatchCollector wrote for id, or Checked == false if it has never checked (unsupported package manager, or the collector hasn't run yet).
func (*Client) GetOAuthSettings ¶ added in v0.2.0
func (c *Client) GetOAuthSettings(ctx context.Context) ([]OAuthProviderSettingsResource, error)
GetOAuthSettings calls GET /api/v1/settings/oauth: every OAuth sign-in provider's current configuration.
func (*Client) GetOnboardingState ¶
func (c *Client) GetOnboardingState(ctx context.Context) (OnboardingStateResource, error)
GetOnboardingState calls GET /api/v1/onboarding: whether the first-run onboarding flow has been completed.
func (*Client) GetOrganization ¶
GetOrganization calls GET /api/v1/organizations/{id}.
func (*Client) GetOrganizationEnv ¶
GetOrganizationEnv calls GET /api/v1/organizations/{id}/env.
func (*Client) GetPITRStatus ¶ added in v0.2.0
GetPITRStatus calls GET /api/v1/databases/{name}/pitr: whether PITR is enabled and, if so, the currently recoverable window.
func (*Client) GetProject ¶
GetProject calls GET /api/v1/projects/{id}.
func (*Client) GetProjectEnv ¶
GetProjectEnv calls GET /api/v1/projects/{id}/env.
func (*Client) GetRegistryCredential ¶
func (c *Client) GetRegistryCredential(ctx context.Context, id string) (RegistryCredentialResource, error)
GetRegistryCredential calls GET /api/v1/registry-credentials/{id}.
func (*Client) GetRegistrySettings ¶
func (c *Client) GetRegistrySettings(ctx context.Context) (RegistrySettingsResource, error)
GetRegistrySettings calls GET /api/v1/settings/registry: the built-in registry container's configured/observed state.
func (*Client) GetRoute53DNS ¶ added in v0.2.0
func (c *Client) GetRoute53DNS(ctx context.Context) (Route53DNSResource, error)
GetRoute53DNS calls GET /api/v1/settings/route53-dns: a second, independent ACME DNS-01 provider's enabled/credential-presence state, mirroring GetCloudflareDNS's own shape.
func (*Client) GetScheduledTask ¶
func (c *Client) GetScheduledTask(ctx context.Context, name, id string) (ScheduledTaskResource, error)
GetScheduledTask calls GET /api/v1/apps/{name}/scheduled-tasks/{id}.
func (*Client) GetServiceTemplate ¶
GetServiceTemplate calls GET /api/v1/service-templates/{id}: one catalog entry, including its full compose.yaml body.
func (*Client) GetSession ¶
func (c *Client) GetSession(ctx context.Context) (SessionInfoResource, error)
GetSession calls GET /api/v1/auth/session using this Client's bearer token, exactly the same auth mechanism every other method on this type uses. The server gates this route with requireAuth, session-cookie-only, by explicit design (internal/api/account.go's handleGetSession doc comment), so a call made through this method always gets back a real, honest 401 "authentication required" for a bearer-token caller, not a client-side bug.
func (*Client) GetSetupStatus ¶ added in v0.2.0
func (c *Client) GetSetupStatus(ctx context.Context) (SetupStatusResource, error)
GetSetupStatus calls GET /api/v1/auth/setup-status.
func (*Client) GetSystemDoctor ¶
func (c *Client) GetSystemDoctor(ctx context.Context) (SystemDoctorResource, error)
GetSystemDoctor calls GET /api/v1/system/doctor: the "levelrail-cli doctor" preflight bundle, a superset of GetSystemStatus above.
func (*Client) GetSystemStatus ¶
func (c *Client) GetSystemStatus(ctx context.Context) (SystemStatusResource, error)
GetSystemStatus calls GET /api/v1/system/status: this control plane's own configured/not-configured signals, including local Docker daemon reachability (DockerConnected/DockerError).
func (*Client) GetUpdates ¶
func (c *Client) GetUpdates(ctx context.Context) (UpdatesResource, error)
GetUpdates calls GET /api/v1/updates: the running control plane version against GitHub's latest published release.
func (*Client) GetVault ¶ added in v0.2.0
func (c *Client) GetVault(ctx context.Context) (VaultSettingsResource, error)
GetVault calls GET /api/v1/settings/vault: the external Vault integration's configured state, for resolving { vault: { path, key } } app.yaml env vars.
func (*Client) GetVolumeBackupSchedule ¶
func (c *Client) GetVolumeBackupSchedule(ctx context.Context, name, volume string) (VolumeBackupScheduleResource, error)
GetVolumeBackupSchedule calls GET /api/v1/apps/{name}/volumes/{volume}/backup-schedule: the app service volume counterpart of the schedule fields riding along on GET .../databases/{name} for a database (a service can have many volumes, so there is no single app resource to embed this in, hence its own dedicated GET here).
func (*Client) ListAlertRules ¶
ListAlertRules calls GET /api/v1/apps/{name}/alerts: every alert rule scoped to name, including disabled ones.
func (*Client) ListAllBackups ¶ added in v0.2.0
func (c *Client) ListAllBackups(ctx context.Context, opts ListBackupsOptions) ([]BackupHistoryResource, error)
ListAllBackups calls GET /api/v1/backups: the instance-wide backup attempt history across every database and app volume, the aggregated counterpart of ListBackups/ListVolumeBackups.
func (*Client) ListAppBranchEnv ¶ added in v0.2.0
ListAppBranchEnv calls GET /api/v1/apps/{name}/branch-env: every branch-scoped env var override declared for name, across every branch pattern.
func (*Client) ListAppImages ¶ added in v0.2.0
ListAppImages calls GET /api/v1/apps/{name}/images: every locally-present tag under name's current image's repo, newest first.
func (*Client) ListAppIntegrations ¶ added in v0.2.0
func (c *Client) ListAppIntegrations(ctx context.Context, name string) ([]AppIntegrationResource, error)
ListAppIntegrations calls GET /api/v1/apps/{name}/integrations: every catalog integration attached to name.
func (*Client) ListAppResourceUsage ¶ added in v0.2.0
func (c *Client) ListAppResourceUsage(ctx context.Context) ([]AppResourceUsageResource, error)
ListAppResourceUsage calls GET /api/v1/apps/resource-usage (internal/api/app_resource_usage.go's handleAppResourceUsage): the latest CPU/memory/network reading for every app in one call, for a dashboard-wide ranking rather than one QueryAppMetrics call per app.
func (*Client) ListAppTags ¶ added in v0.2.0
ListAppTags calls GET /api/v1/apps/{name}/tags.
func (*Client) ListAppVolumeMoves ¶ added in v0.2.0
func (c *Client) ListAppVolumeMoves(ctx context.Context, name string) ([]AppVolumeMoveResource, error)
ListAppVolumeMoves calls GET /api/v1/apps/{name}/moves: every "move with volumes" attempt for name, newest first.
func (*Client) ListApps ¶
func (c *Client) ListApps(ctx context.Context) ([]AppResource, error)
ListApps calls GET /api/v1/apps.
func (*Client) ListAppsByTag ¶ added in v0.2.0
ListAppsByTag calls GET /api/v1/tags/{id}/apps: every app tagged with id, the "list resources filtered by tag" primitive.
func (*Client) ListAuditLog ¶
func (c *Client) ListAuditLog(ctx context.Context, opts ListAuditLogOptions) ([]AuditLogEntryResource, error)
ListAuditLog calls GET /api/v1/audit-log: every recorded write/ deploy/root-tier request, newest first, cursor-paginated by opts.Before.
func (*Client) ListBackupTargets ¶
func (c *Client) ListBackupTargets(ctx context.Context) ([]BackupTargetResource, error)
ListBackupTargets calls GET /api/v1/backup-targets.
func (*Client) ListBackupVerifications ¶
func (c *Client) ListBackupVerifications(ctx context.Context, name, historyID string) ([]BackupVerificationResource, error)
ListBackupVerifications calls GET /api/v1/databases/{name}/backups/{historyId}/verifications: every verification attempt made against one backup, newest first.
func (*Client) ListBackups ¶
func (c *Client) ListBackups(ctx context.Context, name string, opts ListBackupsOptions) ([]BackupHistoryResource, error)
ListBackups calls GET /api/v1/databases/{name}/backups: the full backup attempt history for one database.
func (*Client) ListBaseBackups ¶ added in v0.2.0
func (c *Client) ListBaseBackups(ctx context.Context, name string) ([]BaseBackupHistoryResource, error)
ListBaseBackups calls GET /api/v1/databases/{name}/base-backups.
func (*Client) ListBitbucketAppBranches ¶ added in v0.2.0
func (c *Client) ListBitbucketAppBranches(ctx context.Context, workspace, repoSlug string) ([]GitAppBranchResource, error)
ListBitbucketAppBranches calls GET /api/v1/bitbucket-app/repos/{workspace}/{repoSlug}/branches.
func (*Client) ListBitbucketAppRepos ¶ added in v0.2.0
func (c *Client) ListBitbucketAppRepos(ctx context.Context) ([]BitbucketAppRepoResource, error)
ListBitbucketAppRepos calls GET /api/v1/bitbucket-app/repos: every repository the connected Bitbucket account can access.
func (*Client) ListCertificates ¶ added in v0.2.0
func (c *Client) ListCertificates(ctx context.Context) ([]CertificateResource, error)
ListCertificates calls GET /api/v1/certificates: every certificate currently in this control plane's certmagic storage, healthy or not. An empty slice means no certificate has ever been issued, not an error.
func (*Client) ListContainers ¶
func (c *Client) ListContainers(ctx context.Context) ([]ContainerResource, error)
ListContainers calls GET /api/v1/system/containers: every container on this node, whether or not Levelrail manages it.
func (*Client) ListDatabaseEngines ¶
func (c *Client) ListDatabaseEngines(ctx context.Context) ([]DatabaseEngineResource, error)
ListDatabaseEngines calls GET /api/v1/database-engines: every engine this control plane can actually create, backing the creation wizard's engine picker instead of a hardcoded list.
func (*Client) ListDatabases ¶
func (c *Client) ListDatabases(ctx context.Context) ([]DatabaseResource, error)
ListDatabases calls GET /api/v1/databases.
func (*Client) ListDeployApprovals ¶ added in v0.2.0
func (c *Client) ListDeployApprovals(ctx context.Context, status, service string) ([]DeployApprovalResource, error)
ListDeployApprovals calls GET /api/v1/deploy-approvals: status defaults server-side to "pending" when empty; pass "all" to include decided requests too. service filters to one app, empty means every app.
func (*Client) ListDeployAttempts ¶ added in v0.2.0
func (c *Client) ListDeployAttempts(ctx context.Context, name string) ([]DeployAttemptResource, error)
ListDeployAttempts calls GET /api/v1/apps/{name}/deploy-attempts: the real, row-per-trigger-call deploy history for name, newest first. Additive to GetDeployStatus's reconcile conditions, not a replacement.
func (*Client) ListDeployNotifyTargets ¶ added in v0.2.0
func (c *Client) ListDeployNotifyTargets(ctx context.Context, name string) ([]DeployNotifyTargetResource, error)
ListDeployNotifyTargets calls GET /api/v1/apps/{name}/deploy-notify-targets: every deploy-outcome notification target scoped to name, including disabled ones.
func (*Client) ListDomains ¶
func (c *Client) ListDomains(ctx context.Context) ([]DomainResource, error)
ListDomains calls GET /api/v1/domains: every service_domains row across every app, aggregated in one call.
func (*Client) ListEnvironments ¶
func (c *Client) ListEnvironments(ctx context.Context, projectID string) ([]EnvironmentResource, error)
ListEnvironments calls GET /api/v1/projects/{id}/environments.
func (*Client) ListFeatureFlags ¶
ListFeatureFlags calls GET /api/v1/apps/{name}/flags.
func (*Client) ListGitHubAppBranches ¶ added in v0.2.0
func (c *Client) ListGitHubAppBranches(ctx context.Context, owner, repo string) ([]GitAppBranchResource, error)
ListGitHubAppBranches calls GET /api/v1/github-app/repos/{owner}/{repo}/branches.
func (*Client) ListGitHubAppRepos ¶ added in v0.2.0
func (c *Client) ListGitHubAppRepos(ctx context.Context) ([]GitHubAppRepoResource, error)
ListGitHubAppRepos calls GET /api/v1/github-app/repos: every repository the connected GitHub App installation can access.
func (*Client) ListGitLabAppBranches ¶ added in v0.2.0
func (c *Client) ListGitLabAppBranches(ctx context.Context, projectID int64) ([]GitAppBranchResource, error)
ListGitLabAppBranches calls GET /api/v1/gitlab-app/projects/{id}/branches.
func (*Client) ListGitLabAppProjects ¶ added in v0.2.0
func (c *Client) ListGitLabAppProjects(ctx context.Context) ([]GitLabAppProjectResource, error)
ListGitLabAppProjects calls GET /api/v1/gitlab-app/projects: every project the connected GitLab account can access.
func (*Client) ListGitProviders ¶ added in v0.2.0
func (c *Client) ListGitProviders(ctx context.Context) ([]GitProviderResource, error)
ListGitProviders calls GET /api/v1/git-providers: a capability summary (connected, can list branches, can register a webhook, can auth-clone) for every git provider this control plane knows about, in one call rather than three separate per-provider status checks.
func (*Client) ListGiteaAppBranches ¶ added in v0.2.0
func (c *Client) ListGiteaAppBranches(ctx context.Context, owner, repo string) ([]GitAppBranchResource, error)
ListGiteaAppBranches calls GET /api/v1/gitea-app/repos/{owner}/{repo}/branches.
func (*Client) ListGiteaAppRepos ¶ added in v0.2.0
func (c *Client) ListGiteaAppRepos(ctx context.Context) ([]GiteaAppRepoResource, error)
ListGiteaAppRepos calls GET /api/v1/gitea-app/repos: every repository the connected Gitea account can access.
func (*Client) ListIntegrationCatalog ¶ added in v0.2.0
func (c *Client) ListIntegrationCatalog(ctx context.Context) ([]IntegrationCatalogEntryResource, error)
ListIntegrationCatalog calls GET /api/v1/integrations: the full internal/integrations.Catalog, global and read-only.
func (*Client) ListInvites ¶
func (c *Client) ListInvites(ctx context.Context) ([]InviteResource, error)
ListInvites calls GET /api/v1/invites.
func (*Client) ListNodes ¶
func (c *Client) ListNodes(ctx context.Context) ([]NodeResource, error)
ListNodes calls GET /api/v1/nodes.
func (*Client) ListNotificationChannels ¶
func (c *Client) ListNotificationChannels(ctx context.Context) ([]NotificationChannelResource, error)
ListNotificationChannels calls GET /api/v1/notification-channels.
func (*Client) ListNotificationDeliveries ¶
func (c *Client) ListNotificationDeliveries(ctx context.Context, id string, limit int) ([]NotificationDeliveryResource, error)
ListNotificationDeliveries calls GET /api/v1/notification-channels/{id}/deliveries: this channel's send history, newest first, up to limit rows (0 leaves the server's own default in place).
func (*Client) ListOAuthProviderSettings ¶ added in v0.2.0
func (c *Client) ListOAuthProviderSettings(ctx context.Context) ([]OAuthProviderSettingsResource, error)
ListOAuthProviderSettings calls GET /api/v1/settings/oauth: every provider's full sign-in configuration.
func (*Client) ListOrganizations ¶
func (c *Client) ListOrganizations(ctx context.Context) ([]OrganizationResource, error)
ListOrganizations calls GET /api/v1/organizations.
func (*Client) ListOrphanedVolumes ¶ added in v0.2.0
func (c *Client) ListOrphanedVolumes(ctx context.Context) ([]OrphanedVolumeResource, error)
ListOrphanedVolumes calls GET /api/v1/system/volumes/orphaned: every named Docker volume this instance created that current desired state no longer references.
func (*Client) ListPolicies ¶
func (c *Client) ListPolicies(ctx context.Context) ([]PolicyResource, error)
ListPolicies calls GET /api/v1/iam/policies.
func (*Client) ListPolicyAttachments ¶
func (c *Client) ListPolicyAttachments(ctx context.Context, id string) ([]PolicyAttachmentResource, error)
ListPolicyAttachments calls GET /api/v1/iam/policies/{id}/attachments.
func (*Client) ListPreviewEnvironments ¶
func (c *Client) ListPreviewEnvironments(ctx context.Context, appName string) ([]PreviewEnvironmentResource, error)
ListPreviewEnvironments calls GET /api/v1/apps/{name}/previews: every active pull-request preview for an app.
func (*Client) ListProjects ¶
func (c *Client) ListProjects(ctx context.Context) ([]ProjectResource, error)
ListProjects calls GET /api/v1/projects.
func (*Client) ListRegistryCredentialRepositories ¶ added in v0.2.0
func (c *Client) ListRegistryCredentialRepositories(ctx context.Context, id string) (RegistryRepositoriesResource, error)
ListRegistryCredentialRepositories calls GET /api/v1/registry-credentials/{id}/repositories: every repository in the external registry this credential authenticates against, the same wire shape ListRegistryRepositories uses for the built-in registry.
func (*Client) ListRegistryCredentialTags ¶ added in v0.2.0
func (c *Client) ListRegistryCredentialTags(ctx context.Context, id, repository string) (RegistryTagsResource, error)
ListRegistryCredentialTags calls GET /api/v1/registry-credentials/{id}/tags?repository=<name>: every tag pushed for one repository in the external registry this credential authenticates against.
func (*Client) ListRegistryCredentials ¶
func (c *Client) ListRegistryCredentials(ctx context.Context) ([]RegistryCredentialResource, error)
ListRegistryCredentials calls GET /api/v1/registry-credentials.
func (*Client) ListRegistryRepositories ¶ added in v0.2.0
func (c *Client) ListRegistryRepositories(ctx context.Context) (RegistryRepositoriesResource, error)
ListRegistryRepositories calls GET /api/v1/registry/repositories: every repository name pushed to the built-in registry.
func (*Client) ListRegistryTags ¶ added in v0.2.0
func (c *Client) ListRegistryTags(ctx context.Context, repository string) (RegistryTagsResource, error)
ListRegistryTags calls GET /api/v1/registry/tags?repository=<name>: every tag pushed for one repository in the built-in registry.
func (*Client) ListRoles ¶
func (c *Client) ListRoles(ctx context.Context) ([]RoleResource, error)
ListRoles calls GET /api/v1/roles.
func (*Client) ListScheduledTasks ¶
func (c *Client) ListScheduledTasks(ctx context.Context, name string) ([]ScheduledTaskResource, error)
ListScheduledTasks calls GET /api/v1/apps/{name}/scheduled-tasks.
func (*Client) ListSecrets ¶
ListSecrets calls GET /api/v1/apps/{name}/secrets: every known secret key for the app with its locked state, never a value.
func (*Client) ListServiceTemplates ¶
func (c *Client) ListServiceTemplates(ctx context.Context) ([]ServiceTemplateListItem, error)
ListServiceTemplates calls GET /api/v1/service-templates: the full catalog, without each entry's Compose body (see ServiceTemplateListItem).
func (*Client) ListSharedEnvAll ¶ added in v0.2.0
func (c *Client) ListSharedEnvAll(ctx context.Context, scope, id string) ([]SharedEnvVarResource, error)
ListSharedEnvAll calls GET /api/v1/{scope}s/{id}/env/all: every shared env var at that tier, plain and secret-marked alike.
func (*Client) ListSharedEnvSecretKeys ¶ added in v0.2.0
ListSharedEnvSecretKeys calls GET /api/v1/{scope}s/{id}/env/secrets: every secret-marked shared env var key at that tier, never a value.
func (*Client) ListStaticSites ¶ added in v0.2.0
func (c *Client) ListStaticSites(ctx context.Context) ([]StaticSiteResource, error)
ListStaticSites calls GET /api/v1/static-sites: every build.type: static site currently served directly through embedded Caddy.
func (*Client) ListTags ¶ added in v0.2.0
func (c *Client) ListTags(ctx context.Context) ([]TagResource, error)
ListTags calls GET /api/v1/tags.
func (*Client) ListUsers ¶
func (c *Client) ListUsers(ctx context.Context) ([]UserResource, error)
ListUsers calls GET /api/v1/users.
func (*Client) ListVolumeBackupVerifications ¶
func (c *Client) ListVolumeBackupVerifications(ctx context.Context, name, volume, historyID string) ([]BackupVerificationResource, error)
ListVolumeBackupVerifications calls GET /api/v1/apps/{name}/volumes/{volume}/backups/{historyId}/verifications: the app service volume counterpart of ListBackupVerifications.
func (*Client) ListVolumeBackups ¶
func (c *Client) ListVolumeBackups(ctx context.Context, name, volume string, opts ListBackupsOptions) ([]BackupHistoryResource, error)
ListVolumeBackups calls GET /api/v1/apps/{name}/volumes/{volume}/backups: the app service volume counterpart of ListBackups.
func (*Client) ListWebhookDeliveries ¶
func (c *Client) ListWebhookDeliveries(ctx context.Context, name string, opts ListWebhookDeliveriesOptions) ([]WebhookDeliveryResource, error)
ListWebhookDeliveries calls GET /api/v1/apps/{name}/webhook-deliveries: recent inbound git-provider webhook requests for name, newest first.
func (*Client) MoveAppWithVolumes ¶ added in v0.2.0
func (c *Client) MoveAppWithVolumes(ctx context.Context, name, nodeID string) (AppVolumeMoveResource, error)
MoveAppWithVolumes calls POST /api/v1/apps/{name}/move-with-volumes: the same placement change SetAppNode makes, plus archiving and restoring every one of the app's named Docker volumes onto the destination node (internal/api's handleMoveAppWithVolumes). Always returns an AppVolumeMoveResource: check its Status field, not the status code alone, to tell "already done" (an app with no volumes, or already on nodeID) from "still running" (real volumes to copy: poll GetAppVolumeMove with the returned ID until Status is no longer "running"). An empty nodeID moves the app back to the control plane's own local node.
func (*Client) PollDeviceAuthToken ¶
func (c *Client) PollDeviceAuthToken(ctx context.Context, deviceCode string) (DeviceTokenResponse, error)
PollDeviceAuthToken calls POST /api/v1/auth/device/token once. Unauthenticated, same as StartDeviceAuth. Returns *APIError with Message one of "authorization_pending"/"access_denied"/ "expired_token" until the request has been approved; the caller is expected to poll this on an interval (DeviceStartResponse.Interval) until it either returns a token or a terminal error.
func (*Client) PreviewEnvironmentClone ¶ added in v0.2.0
func (c *Client) PreviewEnvironmentClone(ctx context.Context, id, newEnvironmentName string) (EnvironmentClonePreviewResource, error)
PreviewEnvironmentClone calls GET /api/v1/environments/{id}/clone/preview: what cloning id into a new environment named newEnvironmentName would most likely create, without applying it or reserving any name.
func (*Client) PreviewPromotion ¶
func (c *Client) PreviewPromotion(ctx context.Context, name, environmentID, target string) (PromotePreviewResource, error)
PreviewPromotion calls GET /api/v1/apps/{name}/promote/preview: what promoting name's current image into environmentID would change, without applying it. target disambiguates when more than one app in environmentID belongs to the same project; leave it empty to let the server auto-discover the sole candidate.
func (*Client) PromoteApp ¶
func (c *Client) PromoteApp(ctx context.Context, name string, req PromoteAppRequest) (DeployTriggerResult, error)
PromoteApp calls POST /api/v1/apps/{name}/promote: points the resolved target app's image at name's current image and redeploys it.
func (*Client) PruneSystem ¶ added in v0.2.0
func (c *Client) PruneSystem(ctx context.Context) (SystemPruneResult, error)
PruneSystem calls POST /api/v1/system/prune: removes every stopped container, dangling image, and unused volume or build cache the reconciler's current desired state doesn't need, fleet-wide.
func (*Client) PurgeAuditLog ¶
func (c *Client) PurgeAuditLog(ctx context.Context) (PurgeAuditLogResult, error)
PurgeAuditLog calls POST /api/v1/audit-log/purge: deletes every audit_log row older than the control plane's own configured retention window right now, instead of waiting for its next periodic sweep.
func (*Client) QueryAppMetrics ¶
func (c *Client) QueryAppMetrics(ctx context.Context, name, metric string, from, to time.Time, step time.Duration) (AppMetricsResource, error)
QueryAppMetrics calls GET /api/v1/apps/{name}/metrics?metric=&from=&to=&step= (internal/api/metrics.go's handleQueryMetrics). from/to are sent as RFC3339; step of zero omits the query param, matching the server's own "step<=0 means raw unaggregated samples" contract (telemetry.Aggregate).
func (*Client) QueryDatabaseLogs ¶ added in v0.2.0
func (c *Client) QueryDatabaseLogs(ctx context.Context, name string, from, to time.Time, q string) ([]LogEntryResource, error)
QueryDatabaseLogs calls GET /api/v1/databases/{name}/logs?from=&to=&q= (internal/api/database_logs.go's handleQueryDatabaseLogs), the database counterpart to QueryLogs above: same request/response shape, same shared queryResourceLogs implementation server-side.
func (*Client) QueryDatabaseMetrics ¶ added in v0.2.0
func (c *Client) QueryDatabaseMetrics(ctx context.Context, name, metric string, from, to time.Time, step time.Duration) (AppMetricsResource, error)
QueryDatabaseMetrics calls GET /api/v1/databases/{name}/metrics?metric=&from=&to=&step= (internal/api/database_metrics.go's handleQueryDatabaseMetrics), the database-kind counterpart to QueryAppMetrics: same params, same response shape, since internal/api's queryResourceMetrics is the shared implementation behind both routes server-side.
func (*Client) QueryDatabaseSlowQueries ¶ added in v0.2.0
func (c *Client) QueryDatabaseSlowQueries(ctx context.Context, name string, from, to time.Time, limit, offset int) ([]SlowQueryEntryResource, int, error)
QueryDatabaseSlowQueries calls GET /api/v1/databases/{name}/slow-queries?from=&to=&limit=&offset= (internal/api/database_slow_queries.go's handleQueryDatabaseSlowQueries), returning parsed slow-query entries sorted by duration descending plus the total count before limit/offset truncation. limit <= 0 omits the ?limit param, letting the server apply its own default.
func (*Client) QueryLogs ¶
func (c *Client) QueryLogs(ctx context.Context, name string, from, to time.Time, q string) ([]LogEntryResource, error)
QueryLogs calls GET /api/v1/apps/{name}/logs?from=&to=&q= (internal/api/logs.go's handleQueryLogs): a real, historical full-text search over already-stored log entries. from/to are sent as RFC3339, the same format the server requires (internal/api's parseTimeRange); q empty means every entry in the window, matching the server's own "empty query" contract.
func (*Client) QueryNodeMetrics ¶ added in v0.2.0
func (c *Client) QueryNodeMetrics(ctx context.Context, id, metric string, from, to time.Time, step time.Duration) (NodeMetricsResource, error)
QueryNodeMetrics calls GET /api/v1/nodes/{id}/metrics?metric=&from=&to=&step= (internal/api/node_metrics.go's handleQueryNodeMetrics): a sum of every service placed on the node for most metrics, or a real host-level reading for the rest (disk usage, OS patches available); see that handler's own doc comment for exactly which metric names fall into each group. The server, not this client, is the authority on which metric names are valid.
func (*Client) RejectDeployApproval ¶ added in v0.2.0
func (c *Client) RejectDeployApproval(ctx context.Context, id, reason string) (DeployApprovalResource, error)
RejectDeployApproval calls POST /api/v1/deploy-approvals/{id}/reject: records the decision, the app's desired state is left untouched.
func (*Client) ReplayWebhookDelivery ¶
func (c *Client) ReplayWebhookDelivery(ctx context.Context, name, id string) (ReplayWebhookDeliveryResult, error)
ReplayWebhookDelivery calls POST /api/v1/apps/{name}/webhook-deliveries/{id}/replay: re-runs a stored delivery's exact payload through the same processing a live webhook takes, which can trigger a real build and deploy.
func (*Client) RestartApp ¶
RestartApp calls POST /api/v1/apps/{name}/restart: force a running container to be recreated with no image change (internal/api/apps.go's own handleRestartApp). No request body; the response is the app's current desired state, unchanged.
func (*Client) RestartProject ¶ added in v0.2.0
RestartProject calls POST /api/v1/projects/{id}/restart: force every app filed under this project to have its running container recreated with no image change (internal/api/project_restart.go's own handleRestartProject). No request body.
func (*Client) RevokeInvite ¶
RevokeInvite calls DELETE /api/v1/invites/{id}.
func (*Client) RotateMasterKey ¶
func (c *Client) RotateMasterKey(ctx context.Context, newMasterKey string) (RotateMasterKeyResult, error)
RotateMasterKey calls POST /api/v1/system/master-key/rotate: re-wraps every stored DEK from the control plane's currently active master key to newMasterKey, live, in one atomic step.
func (*Client) RotateNodeMeshKey ¶ added in v0.2.0
RotateNodeMeshKey calls POST /api/v1/nodes/{id}/mesh/rotate-key: generates a fresh WireGuard keypair for id and makes it live immediately. Only actually succeeds for the node running the target control plane itself today; see internal/api/mesh.go's own doc comment for why remote-node rotation isn't possible yet.
func (*Client) RunScheduledTask ¶
func (c *Client) RunScheduledTask(ctx context.Context, name, id string) (ScheduledTaskResource, error)
RunScheduledTask calls POST /api/v1/apps/{name}/scheduled-tasks/{id}/run: triggers an immediate run and returns as soon as it starts, not once the command finishes.
func (*Client) SetAppBranchEnv ¶ added in v0.2.0
func (c *Client) SetAppBranchEnv(ctx context.Context, name, branchPattern, key, value string, secret bool) (AppBranchEnvOverride, error)
SetAppBranchEnv calls POST /api/v1/apps/{name}/branch-env: declares (or, for the same branchPattern+key, replaces) one env var's value for name, applied only when a preview built from a matching branch is deployed.
func (*Client) SetAppDatabaseAttachment ¶
func (c *Client) SetAppDatabaseAttachment(ctx context.Context, name string, req SetAppDatabaseRequest) (AppDatabaseResource, error)
SetAppDatabaseAttachment calls PUT /api/v1/apps/{name}/database: attaches an existing managed database to name as a real, persisted connection env var source.
func (*Client) SetAppEgressPolicy ¶ added in v0.2.0
func (c *Client) SetAppEgressPolicy(ctx context.Context, name string, req SetAppEgressPolicyRequest) (AppEgressPolicyResource, error)
SetAppEgressPolicy calls PUT /api/v1/apps/{name}/egress-policy: sets (or replaces) name's outbound network allowlist.
func (*Client) SetAppEnvironment ¶
func (c *Client) SetAppEnvironment(ctx context.Context, name, environmentID string) (AppResource, error)
SetAppEnvironment calls PUT /api/v1/apps/{name}/environment. An empty environmentID clears the assignment. Returns the updated app.
func (*Client) SetAppHealth ¶ added in v0.2.0
func (c *Client) SetAppHealth(ctx context.Context, name string, health ServiceHealth) (AppHealthResource, error)
SetAppHealth calls PUT /api/v1/apps/{name}/health, replacing name's readiness and liveness config as a whole.
func (*Client) SetAppNode ¶ added in v0.2.0
SetAppNode calls PUT /api/v1/apps/{name}/node: an instant placement change (internal/api's handleSetAppNode), no volumes involved. An empty nodeID moves the app back to the control plane's own local node. Returns the updated app. See MoveAppWithVolumes for the same move, taking the app's named volumes along with it.
func (*Client) SetAppPreviewEnvOverride ¶ added in v0.2.0
func (c *Client) SetAppPreviewEnvOverride(ctx context.Context, name, key, value string) (AppPreviewEnvOverride, error)
SetAppPreviewEnvOverride calls PUT /api/v1/apps/{name}/preview-env/{key}: declares (or replaces) one env var's preview-specific value on an app that already exists, applied only the next time a preview environment is created from it.
func (*Client) SetAppProject ¶
SetAppProject calls PUT /api/v1/apps/{name}/project. An empty projectID clears the assignment. Returns the updated app.
func (*Client) SetAppStorage ¶ added in v0.2.0
func (c *Client) SetAppStorage(ctx context.Context, name, storageTargetID string) (AppStorageResource, error)
SetAppStorage calls PUT /api/v1/apps/{name}/storage: attaches an already-connected backup target to name as its object-storage credential source.
func (*Client) SetAppVaultEnv ¶ added in v0.2.0
func (c *Client) SetAppVaultEnv(ctx context.Context, name, key string, req AppVaultEnvRef) (AppVaultEnvRef, error)
SetAppVaultEnv calls PUT /api/v1/apps/{name}/vault-env/{key}: declares (or replaces) one env var as resolving live from the platform's configured external Vault instance, for an app that already exists.
func (*Client) SetAutoRollback ¶ added in v0.2.0
func (c *Client) SetAutoRollback(ctx context.Context, appName string, enabled bool) (AutoRollbackSettingResource, error)
SetAutoRollback calls PUT /api/v1/apps/{name}/auto-rollback, opting appName into (or out of) automatic rollback on a crashloop. Off by default.
func (*Client) SetBackupSchedule ¶
func (c *Client) SetBackupSchedule(ctx context.Context, name string, req SetBackupScheduleRequest) (BackupScheduleResource, error)
SetBackupSchedule calls PUT /api/v1/databases/{name}/backup-schedule: configures a recurring backup, replacing any previously configured schedule for name.
func (*Client) SetCloudflareDNS ¶
func (c *Client) SetCloudflareDNS(ctx context.Context, req UpdateCloudflareDNSRequest) (CloudflareDNSResource, error)
SetCloudflareDNS calls PUT /api/v1/settings/cloudflare-dns.
func (*Client) SetCloudflareTunnel ¶
func (c *Client) SetCloudflareTunnel(ctx context.Context, req UpdateCloudflareTunnelRequest) (CloudflareTunnelResource, error)
SetCloudflareTunnel calls PUT /api/v1/settings/cloudflare-tunnel.
func (*Client) SetDatabaseNode ¶ added in v0.2.0
func (c *Client) SetDatabaseNode(ctx context.Context, name, nodeID string) (DatabaseResource, error)
SetDatabaseNode calls PUT /api/v1/databases/{name}/node (internal/api/databases.go's handleSetDatabaseNode), the database counterpart to SetAppNode: an empty nodeID moves the database back to this control plane's own local node. Reuses SetAppNodeRequest, an identical {node_id} body shape on both routes.
func (*Client) SetDatabaseProject ¶
func (c *Client) SetDatabaseProject(ctx context.Context, name, projectID string) (DatabaseResource, error)
SetDatabaseProject calls PUT /api/v1/databases/{name}/project. An empty projectID clears the assignment. Returns the updated database.
func (*Client) SetDatabasePublicAccess ¶
func (c *Client) SetDatabasePublicAccess(ctx context.Context, name string, port int, bindAddress string) (DatabasePublicAccessResource, error)
SetDatabasePublicAccess calls PUT /api/v1/databases/{name}/public-access: exposes name on the host at port (0 requests auto-assignment) bound to bindAddress ("" requests the server's own default, "private").
func (*Client) SetDatabaseResources ¶
func (c *Client) SetDatabaseResources(ctx context.Context, name string, resources *ServiceResources) (DatabaseResource, error)
SetDatabaseResources calls PUT /api/v1/databases/{name}/resources: applies memory/CPU limits to name, replacing whatever was set before.
func (*Client) SetDomainBasicAuth ¶
func (c *Client) SetDomainBasicAuth(ctx context.Context, name, domain string, req SetDomainBasicAuthRequest) (DomainBasicAuthResource, error)
SetDomainBasicAuth calls PUT /api/v1/apps/{name}/domains/{domain}/auth: enables HTTP Basic Auth on domain, enforced by Caddy on the next ingress reconcile pass.
func (*Client) SetDomainErrorPage ¶ added in v0.2.0
func (c *Client) SetDomainErrorPage(ctx context.Context, name, domain string, req SetDomainErrorPageRequest) (DomainErrorPagesResource, error)
SetDomainErrorPage calls PUT /api/v1/apps/{name}/domains/{domain}/error-pages: upserts one status-code-to-body mapping for domain, enforced by Caddy on the next ingress reconcile pass.
func (*Client) SetDomainMaintenance ¶
func (c *Client) SetDomainMaintenance(ctx context.Context, name, domain string) (DomainMaintenanceResource, error)
SetDomainMaintenance calls PUT /api/v1/apps/{name}/domains/{domain}/maintenance: enables maintenance mode on domain, enforced by Caddy on the next ingress reconcile pass.
func (*Client) SetDomainRedirect ¶ added in v0.2.0
func (c *Client) SetDomainRedirect(ctx context.Context, name, domain string, req SetDomainRedirectRequest) (DomainRedirectResource, error)
SetDomainRedirect calls PUT /api/v1/apps/{name}/domains/{domain}/redirect: configures domain to redirect to a target URL, enforced by Caddy on the next ingress reconcile pass.
func (*Client) SetDomainTLSCert ¶
func (c *Client) SetDomainTLSCert(ctx context.Context, name, domain string, req SetDomainTLSCertRequest) (DomainTLSCertResource, error)
SetDomainTLSCert calls PUT /api/v1/apps/{name}/domains/{domain}/tls-cert: uploads a BYO certificate for domain, used by Caddy in place of automatic ACME/ internal issuance on the next ingress reconcile pass.
func (*Client) SetDomainWAF ¶ added in v0.2.0
func (c *Client) SetDomainWAF(ctx context.Context, name, domain string, req SetDomainWAFRequest) (DomainWAFResource, error)
SetDomainWAF calls PUT /api/v1/apps/{name}/domains/{domain}/waf: sets WAF and/or rate-limit configuration for domain, enforced by Caddy on the next ingress reconcile pass.
func (*Client) SetEnvironmentEnv ¶
func (c *Client) SetEnvironmentEnv(ctx context.Context, id string, vars map[string]string) (map[string]string, error)
SetEnvironmentEnv calls PUT /api/v1/environments/{id}/env: a full replace, mirroring PUT /apps/{name}'s own env field semantics.
func (*Client) SetExecAccess ¶ added in v0.2.0
func (c *Client) SetExecAccess(ctx context.Context, appName string, enabled bool) (ExecAccessResource, error)
SetExecAccess calls PUT /api/v1/apps/{name}/exec-access, opting appName into (or out of) shell/exec access.
func (*Client) SetGitSource ¶
func (c *Client) SetGitSource(ctx context.Context, name string, req SetGitSourceRequest) (GitSourceResource, error)
SetGitSource calls PUT /api/v1/apps/{name}/git-source: connects a repo (creating a new webhook secret) the first time it's called for an app, or edits the connection on every call after.
func (*Client) SetLogDrain ¶
func (c *Client) SetLogDrain(ctx context.Context, name string, req SetLogDrainRequest) (LogDrainResource, error)
SetLogDrain calls PUT /api/v1/apps/{name}/log-drain.
func (*Client) SetNodeWorkloads ¶
func (c *Client) SetNodeWorkloads(ctx context.Context, id string, req SetNodeWorkloadsRequest) (NodeResource, error)
SetNodeWorkloads calls PUT /api/v1/nodes/{id}/workloads: a full replace of both workload flags, not a partial patch, matching handleSetNodeWorkloads' own contract.
func (*Client) SetOrganizationEnv ¶
func (c *Client) SetOrganizationEnv(ctx context.Context, id string, vars map[string]string) (map[string]string, error)
SetOrganizationEnv calls PUT /api/v1/organizations/{id}/env: a full replace, mirroring PUT /apps/{name}'s own env field semantics.
func (*Client) SetPreviewEnabled ¶
func (c *Client) SetPreviewEnabled(ctx context.Context, appName string, enabled bool) (PreviewSettingsResource, error)
SetPreviewEnabled calls PUT /api/v1/apps/{name}/preview-settings, touching only the enabled toggle: post_pr_comments, if previously set, is left unchanged (SetPreviewSettingsRequest's own doc comment).
func (*Client) SetPreviewPostPRComments ¶
func (c *Client) SetPreviewPostPRComments(ctx context.Context, appName string, enabled bool) (PreviewSettingsResource, error)
SetPreviewPostPRComments calls PUT /api/v1/apps/{name}/preview-settings, touching only the post_pr_comments toggle: enabled, if previously set, is left unchanged.
func (*Client) SetProjectEnv ¶
func (c *Client) SetProjectEnv(ctx context.Context, id string, vars map[string]string) (map[string]string, error)
SetProjectEnv calls PUT /api/v1/projects/{id}/env: a full replace, mirroring PUT /apps/{name}'s own env field semantics.
func (*Client) SetProjectOrganization ¶
func (c *Client) SetProjectOrganization(ctx context.Context, projectID, orgID string) (ProjectResource, error)
SetProjectOrganization calls PUT /api/v1/projects/{id}/organization. An empty orgID clears the assignment. Returns the updated project.
func (*Client) SetRoute53DNS ¶ added in v0.2.0
func (c *Client) SetRoute53DNS(ctx context.Context, req UpdateRoute53DNSRequest) (Route53DNSResource, error)
SetRoute53DNS calls PUT /api/v1/settings/route53-dns.
func (*Client) SetSecret ¶
func (c *Client) SetSecret(ctx context.Context, name, key, value string, overwriteLocked bool) error
SetSecret calls PUT /api/v1/apps/{name}/secrets/{key}. No response body beyond the status (internal/api/secrets.go's handleSetSecret returns 204 on success), matching that handler's own doc comment on why a secret's value is never echoed back. overwriteLocked bypasses the server's 409-if-locked guard, the same escape hatch the dashboard's SecretsEditor exposes.
func (*Client) SetSecretLock ¶
SetSecretLock calls POST /api/v1/apps/{name}/secrets/{key}/lock: toggles the accidental-overwrite guard SetSecret's overwriteLocked bypasses. Reversible either direction, not a permanent write-once marker.
func (*Client) SetSharedEnvSecret ¶ added in v0.2.0
SetSharedEnvSecret calls PUT /api/v1/{scope}s/{id}/env/secrets/{key}: encrypts value and marks key secret. No response body beyond the status, matching SetSecret's own "never echo a value back" rule.
func (*Client) SetVault ¶ added in v0.2.0
func (c *Client) SetVault(ctx context.Context, req UpdateVaultSettingsRequest) (VaultSettingsResource, error)
SetVault calls PUT /api/v1/settings/vault.
func (*Client) SetVolumeBackupSchedule ¶
func (c *Client) SetVolumeBackupSchedule(ctx context.Context, name, volume string, req SetVolumeBackupScheduleRequest) (VolumeBackupScheduleResource, error)
SetVolumeBackupSchedule calls PUT /api/v1/apps/{name}/volumes/{volume}/backup-schedule: the app service volume counterpart of SetBackupSchedule.
func (*Client) StartApp ¶
StartApp calls POST /api/v1/apps/{name}/start: clears the suspended flag StopApp set, letting the reconciler bring the container back.
func (*Client) StartDatabase ¶ added in v0.2.0
StartDatabase calls POST /api/v1/databases/{name}/start: clears the suspended flag StopDatabase set, letting the reconciler bring the container back against the same data volume.
func (*Client) StartDeviceAuth ¶
func (c *Client) StartDeviceAuth(ctx context.Context, req DeviceStartRequest) (DeviceStartResponse, error)
StartDeviceAuth calls POST /api/v1/auth/device/start. Unauthenticated by design: call it on a Client built with an empty token (NewClient(baseURL, "")).
func (*Client) StartProject ¶ added in v0.2.0
StartProject calls POST /api/v1/projects/{id}/start: clears the suspended flag StopProject set on every app and database in the project.
func (*Client) StopApp ¶
StopApp calls POST /api/v1/apps/{name}/stop: marks the service suspended, so the reconciler stops (and leaves stopped) its container on the next pass, without touching desired state otherwise.
func (*Client) StopDatabase ¶ added in v0.2.0
StopDatabase calls POST /api/v1/databases/{name}/stop: marks the database suspended, so the reconciler removes its container on the next pass without touching desired state or its data volume otherwise.
func (*Client) StopProject ¶ added in v0.2.0
StopProject calls POST /api/v1/projects/{id}/stop: suspends every app and database filed under the project, mirroring StopApp's own single- resource shape at the project scope.
func (*Client) StreamDatabaseLogs ¶ added in v0.2.0
func (c *Client) StreamDatabaseLogs(ctx context.Context, name string, onEntry func(LogStreamEntry) error) error
StreamDatabaseLogs calls GET /api/v1/databases/{name}/logs/stream (internal/api/database_logs.go's handleLiveDatabaseLogStream), the database counterpart to StreamLogs above.
func (*Client) StreamDeployLog ¶ added in v0.2.0
func (c *Client) StreamDeployLog(ctx context.Context, name, deployID string, onEntry func(LogStreamEntry) error) error
StreamDeployLog calls GET /api/v1/apps/{name}/deploys/{deployId}/logs (internal/api/deploy_attempts.go's handleDeployLogStream): the same SSE connection the dashboard's deploy log page opens, replaying the attempt's log so far and then tailing live until the attempt finishes, ctx is canceled, or the server closes the connection. Same wire shape and same onEntry contract as StreamLogs above, just a different endpoint.
func (*Client) StreamLogs ¶ added in v0.2.0
func (c *Client) StreamLogs(ctx context.Context, name string, onEntry func(LogStreamEntry) error) error
StreamLogs calls GET /api/v1/apps/{name}/logs/stream (internal/api/live_logs.go's handleLiveLogStream): an SSE connection that replays a short recent backfill then tails live output until ctx is canceled or the server closes the connection. See streamLogEvents for the onEntry contract and transport details shared with StreamDeployLog below.
func (*Client) SweepPreviewEnvironments ¶
func (c *Client) SweepPreviewEnvironments(ctx context.Context) (SweepPreviewEnvironmentsResult, error)
SweepPreviewEnvironments calls POST /api/v1/previews/sweep: the manual trigger for the TTL fallback that tears down any preview environment whose pull-request-closed webhook never arrived, cross-app.
func (*Client) TeardownPreviewEnvironment ¶
func (c *Client) TeardownPreviewEnvironment(ctx context.Context, appName string, prNumber int) error
TeardownPreviewEnvironment calls POST /api/v1/apps/{name}/previews/{number}/teardown: the manual safety net alongside a pull request's own automatic close-triggered teardown.
func (*Client) TestBackupTarget ¶
TestBackupTarget calls POST /api/v1/backup-targets/{id}/test: probes the target's stored credentials against its configured bucket, without uploading or deleting anything.
func (*Client) TestExistingNotificationChannel ¶
TestExistingNotificationChannel calls POST /api/v1/notification-channels/{id}/test: the same real send, against an already-saved channel's own kind/notify_url.
func (*Client) TestNotificationChannel ¶
TestNotificationChannel calls POST /api/v1/notification-channels/test: fires a real test message via kind/notifyURL without requiring the channel to exist yet.
func (*Client) TestRegistryCredential ¶
TestRegistryCredential calls POST /api/v1/registry-credentials/{id}/test: authenticates the credential's stored username/password against its registry host, without pulling anything.
func (*Client) TriggerBackup ¶
func (c *Client) TriggerBackup(ctx context.Context, name, targetID string) (BackupHistoryResource, error)
TriggerBackup calls POST /api/v1/databases/{name}/backups: starts a real backup of name to targetID and returns as soon as the attempt is recorded and under way, not once the dump and upload actually finish. ListBackups is how a caller finds out whether it did.
func (*Client) TriggerBaseBackup ¶ added in v0.2.0
func (c *Client) TriggerBaseBackup(ctx context.Context, name, targetID string) (BaseBackupHistoryResource, error)
TriggerBaseBackup calls POST /api/v1/databases/{name}/base-backups: starts a real physical base backup, the point-in-time-restore counterpart of TriggerBackup.
func (*Client) TriggerBuild ¶
func (c *Client) TriggerBuild(ctx context.Context, name string, req BuildTriggerRequest) (BuildTriggerResponse, error)
TriggerBuild calls POST /api/v1/apps/{name}/builds.
func (*Client) TriggerCloneRestore ¶
func (c *Client) TriggerCloneRestore(ctx context.Context, name string, req TriggerCloneRestoreRequest) (CloneRestoreResource, error)
TriggerCloneRestore calls POST /api/v1/databases/{name}/restore-as-new: the non-destructive counterpart to TriggerRestore above. Creates a brand-new database and restores a previously succeeded backup of name into it, never touching name's own live data.
func (*Client) TriggerPITRRestore ¶ added in v0.2.0
func (c *Client) TriggerPITRRestore(ctx context.Context, name, baseBackupID, targetTime string) (PITRRestoreHistoryResource, error)
TriggerPITRRestore calls POST /api/v1/databases/{name}/pitr-restore: starts a real point-in-time restore to targetTime, replaying archived WAL forward from baseBackupID.
func (*Client) TriggerRestore ¶
func (c *Client) TriggerRestore(ctx context.Context, name, backupID string) (RestoreHistoryResource, error)
TriggerRestore calls POST /api/v1/databases/{name}/restore: overwrites name's live data in place from a previously succeeded backup attempt. The single most destructive call this Client makes; callers must gate this behind their own explicit confirmation before ever reaching it.
func (*Client) TriggerVolumeBackup ¶
func (c *Client) TriggerVolumeBackup(ctx context.Context, name, volume, targetID string) (BackupHistoryResource, error)
TriggerVolumeBackup calls POST /api/v1/apps/{name}/volumes/{volume}/backups: the app service volume counterpart of TriggerBackup.
func (*Client) TriggerVolumeCloneRestore ¶
func (c *Client) TriggerVolumeCloneRestore(ctx context.Context, name, volume string, req TriggerVolumeCloneRestoreRequest) (VolumeCloneRestoreResource, error)
TriggerVolumeCloneRestore calls POST /api/v1/apps/{name}/volumes/{volume}/restore-as-new: the app service volume counterpart of TriggerCloneRestore. Creates a brand-new, standalone Docker volume and restores a previously succeeded backup of name/volume into it, never touching that volume's own live contents.
func (*Client) TriggerVolumeRestore ¶
func (c *Client) TriggerVolumeRestore(ctx context.Context, name, volume, backupID string) (RestoreHistoryResource, error)
TriggerVolumeRestore calls POST /api/v1/apps/{name}/volumes/{volume}/restore: overwrites the named app service volume's live contents in place from a previously succeeded backup attempt, the app service volume counterpart of TriggerRestore. The same "single most destructive call" warning TriggerRestore's own doc comment gives applies identically here.
func (*Client) UncordonNode ¶
UncordonNode calls POST /api/v1/nodes/{id}/uncordon: the inverse of CordonNode.
func (*Client) UpdateAIAssistantSettings ¶ added in v0.2.0
func (c *Client) UpdateAIAssistantSettings(ctx context.Context, req UpdateAIAssistantSettingsRequest) (AIAssistantSettingsResource, error)
UpdateAIAssistantSettings calls PUT /api/v1/settings/ai-assistant.
func (*Client) UpdateAlertRule ¶ added in v0.2.0
func (c *Client) UpdateAlertRule(ctx context.Context, name, id string, req UpdateAlertRuleRequest) (AlertRuleResource, error)
UpdateAlertRule calls PUT /api/v1/apps/{name}/alerts/{id}: a full replace of the rule's configuration.
func (*Client) UpdateBackupTarget ¶
func (c *Client) UpdateBackupTarget(ctx context.Context, id string, req UpdateBackupTargetRequest) (BackupTargetResource, error)
UpdateBackupTarget calls PUT /api/v1/backup-targets/{id}: a full replace of name/provider/endpoint/region/bucket, matching handleUpdateBackupTarget's own contract. Credentials rotate only when req carries both AccessKeyID and SecretAccessKey.
func (*Client) UpdateDashboardURL ¶ added in v0.2.0
func (c *Client) UpdateDashboardURL(ctx context.Context, req DashboardURLResource) (DashboardURLResource, error)
UpdateDashboardURL calls PUT /api/v1/settings/dashboard-url.
func (*Client) UpdateEmailSettings ¶ added in v0.2.0
func (c *Client) UpdateEmailSettings(ctx context.Context, req EmailSettingsResource) (EmailSettingsResource, error)
UpdateEmailSettings calls PUT /api/v1/settings/email.
func (*Client) UpdateEnvironment ¶
func (c *Client) UpdateEnvironment(ctx context.Context, id string, req UpdateEnvironmentRequest) (EnvironmentResource, error)
UpdateEnvironment calls PATCH /api/v1/environments/{id}.
func (*Client) UpdateFeatureFlag ¶
func (c *Client) UpdateFeatureFlag(ctx context.Context, name, id string, req FeatureFlagRequest) (FeatureFlagResource, error)
UpdateFeatureFlag calls PUT /api/v1/apps/{name}/flags/{id}: a full replace of Name/Description/Enabled/RolloutPercentage, not a partial patch, matching handleUpdateFeatureFlag's own contract. Key is never updated once created.
func (*Client) UpdateIngressSettings ¶ added in v0.2.0
func (c *Client) UpdateIngressSettings(ctx context.Context, req IngressSettingsResource) (IngressSettingsResource, error)
UpdateIngressSettings calls PUT /api/v1/settings/ingress.
func (*Client) UpdateNotificationChannel ¶ added in v0.2.0
func (c *Client) UpdateNotificationChannel(ctx context.Context, id string, req UpdateNotificationChannelRequest) (NotificationChannelResource, error)
UpdateNotificationChannel calls PUT /api/v1/notification-channels/{id}: a full replace of the channel's configuration.
func (*Client) UpdateOAuthProviderSettings ¶ added in v0.2.0
func (c *Client) UpdateOAuthProviderSettings(ctx context.Context, provider string, req UpdateOAuthProviderSettingsRequest) (OAuthProviderSettingsResource, error)
UpdateOAuthProviderSettings calls PUT /api/v1/settings/oauth/{provider}.
func (*Client) UpdatePolicy ¶
func (c *Client) UpdatePolicy(ctx context.Context, id string, req PolicyRequest) (PolicyResource, error)
UpdatePolicy calls PUT /api/v1/iam/policies/{id}.
func (*Client) UpdateRegistryCredential ¶
func (c *Client) UpdateRegistryCredential(ctx context.Context, id string, req UpdateRegistryCredentialRequest) (RegistryCredentialResource, error)
UpdateRegistryCredential calls PUT /api/v1/registry-credentials/{id}: a full replace of name/registry_host/username, matching handleUpdateRegistryCredential's own contract. The password rotates only when req carries one.
func (*Client) UpdateRegistrySettings ¶
func (c *Client) UpdateRegistrySettings(ctx context.Context, req UpdateRegistrySettingsRequest) (RegistrySettingsResource, error)
UpdateRegistrySettings calls PUT /api/v1/settings/registry.
func (*Client) UpdateScheduledTask ¶
func (c *Client) UpdateScheduledTask(ctx context.Context, name, id string, req ScheduledTaskRequest) (ScheduledTaskResource, error)
UpdateScheduledTask calls PUT /api/v1/apps/{name}/scheduled-tasks/{id}: a full replace of Command/Schedule/Enabled, not a partial patch, matching handleUpdateScheduledTask's own contract.
func (*Client) UpdateUserAbilities ¶
func (c *Client) UpdateUserAbilities(ctx context.Context, id string, req UpdateUserAbilitiesRequest) (UserResource, error)
UpdateUserAbilities calls PUT /api/v1/users/{id}/abilities.
func (*Client) UseBitbucketRepoAsSource ¶ added in v0.2.0
func (c *Client) UseBitbucketRepoAsSource(ctx context.Context, workspace, repoSlug string, req UseRepoAsSourceRequest) (GitSourceResource, error)
UseBitbucketRepoAsSource calls POST /api/v1/bitbucket-app/repos/{workspace}/{repoSlug}/use-as-source.
func (*Client) UseGitHubRepoAsSource ¶ added in v0.2.0
func (c *Client) UseGitHubRepoAsSource(ctx context.Context, owner, repo string, req UseRepoAsSourceRequest) (UseGitHubRepoAsSourceResponse, error)
UseGitHubRepoAsSource calls POST /api/v1/github-app/repos/{owner}/{repo}/use-as-source: connects the repo as req.AppName's git source and registers a push webhook.
func (*Client) UseGitLabProjectAsSource ¶ added in v0.2.0
func (c *Client) UseGitLabProjectAsSource(ctx context.Context, projectID int64, req UseRepoAsSourceRequest) (GitSourceResource, error)
UseGitLabProjectAsSource calls POST /api/v1/gitlab-app/projects/{id}/use-as-source.
func (*Client) UseGiteaRepoAsSource ¶ added in v0.2.0
func (c *Client) UseGiteaRepoAsSource(ctx context.Context, owner, repo string, req UseRepoAsSourceRequest) (GitSourceResource, error)
UseGiteaRepoAsSource calls POST /api/v1/gitea-app/repos/{owner}/{repo}/use-as-source.
func (*Client) VerifyBackup ¶
func (c *Client) VerifyBackup(ctx context.Context, name, historyID string) (BackupVerificationResource, error)
VerifyBackup calls POST /api/v1/databases/{name}/backups/{historyId}/verify: re-downloads a previously succeeded backup and checks it for corruption, returning as soon as the attempt is recorded and under way, not once the download and checks actually finish. ListBackupVerifications is how a caller finds out whether it passed.
func (*Client) VerifyVolumeBackup ¶
func (c *Client) VerifyVolumeBackup(ctx context.Context, name, volume, historyID string) (BackupVerificationResource, error)
VerifyVolumeBackup calls POST /api/v1/apps/{name}/volumes/{volume}/backups/{historyId}/verify: the app service volume counterpart of VerifyBackup.
type CloneAppRequest ¶ added in v0.2.0
type CloneAppRequest struct {
NewName string `json:"new_name"`
}
CloneAppRequest mirrors internal/api's cloneAppRequest (internal/api/apps_clone.go): POST /api/v1/apps/{name}/clone's request body.
type CloneRestoreResource ¶
type CloneRestoreResource struct {
ID string `json:"id"`
SourceDatabaseName string `json:"source_database_name"`
NewDatabaseName string `json:"new_database_name"`
BackupHistoryID string `json:"backup_history_id"`
Status string `json:"status"`
Error string `json:"error,omitempty"`
StartedAt string `json:"started_at"`
FinishedAt string `json:"finished_at,omitempty"`
}
CloneRestoreResource mirrors internal/api's cloneRestoreResource (internal/api/database_clone_restore.go): one "restore as new database" attempt.
type CloudflareDNSResource ¶
type CloudflareDNSResource struct {
Enabled bool `json:"enabled"`
HasToken bool `json:"has_token"`
}
CloudflareDNSResource mirrors internal/api's cloudflareDNSResource (internal/api/cloudflare_dns.go): GET/PUT/DELETE /api/v1/settings/cloudflare-dns's wire shape. The token itself never appears here in either direction.
type CloudflareTunnelResource ¶
type CloudflareTunnelResource struct {
Enabled bool `json:"enabled"`
HasToken bool `json:"has_token"`
Status string `json:"status"`
Message string `json:"message,omitempty"`
}
CloudflareTunnelResource mirrors internal/api's cloudflareTunnelResource (internal/api/cloudflare_tunnel.go): GET/PUT/DELETE /api/v1/settings/cloudflare-tunnel's wire shape. The token itself never appears here in either direction. A distinct credential and endpoint from CloudflareDNSResource: this one runs the cloudflared container, that one configures ACME's DNS-01 challenge.
type ComposeDeployResult ¶
type ComposeDeployResult struct {
AppID string `json:"app_id"`
Services []AppResource `json:"services"`
}
ComposeDeployResult mirrors internal/api's composeDeployResponse (internal/api/apps_compose.go).
type ConditionResource ¶
type ConditionResource struct {
Type string `json:"Type"`
Status string `json:"Status"`
Reason string `json:"Reason"`
Message string `json:"Message"`
LastTransitionTime time.Time `json:"LastTransitionTime"`
}
ConditionResource mirrors internal/reconcile.Condition, the wire shape both GET /api/v1/apps/{name}/deploys (internal/api/deploys.go's handleDeployHistory) and GET /api/v1/databases/{name}/status (internal/api/databases.go's handleDatabaseStatus) return. The source type carries no json struct tags, so its field names are the wire field names verbatim; the tags here just make that explicit rather than relying on encoding/json's case-insensitive match.
type ContainerPortResource ¶
type ContainerPortResource struct {
ContainerPort int `json:"container_port"`
HostPort int `json:"host_port"`
Protocol string `json:"protocol"`
}
ContainerPortResource mirrors internal/api's containerPortResource.
type ContainerResource ¶
type ContainerResource struct {
Name string `json:"name"`
Image string `json:"image"`
Running bool `json:"running"`
Ports []ContainerPortResource `json:"ports"`
}
ContainerResource mirrors internal/api's containerResource (internal/api/containers.go): every container on this node, Levelrail-managed or not. Read-only, no id: see that file's own doc comment on why a stop/restart action doesn't belong on this endpoint.
type CreateAlertRuleRequest ¶
type CreateAlertRuleRequest struct {
Name string `json:"name"`
Kind string `json:"kind"`
Metric string `json:"metric,omitempty"`
Comparator string `json:"comparator,omitempty"`
Threshold float64 `json:"threshold,omitempty"`
ForDuration string `json:"for_duration,omitempty"`
RestartCountThreshold int `json:"restart_count_threshold,omitempty"`
RestartWindow string `json:"restart_window,omitempty"`
// ScheduledTaskID is kind=scheduled_task_failure-only: which of this
// app's scheduled tasks the rule watches. RestartCountThreshold above
// doubles as its consecutive-failure threshold.
ScheduledTaskID string `json:"scheduled_task_id,omitempty"`
// BackupResourceKind/BackupDatabaseName/BackupServiceName/
// BackupVolumeName are kind=backup_missing-only: which database or
// service volume the rule watches. ForDuration above doubles as its
// overdue grace period.
BackupResourceKind string `json:"backup_resource_kind,omitempty"`
BackupDatabaseName string `json:"backup_database_name,omitempty"`
BackupServiceName string `json:"backup_service_name,omitempty"`
BackupVolumeName string `json:"backup_volume_name,omitempty"`
ChannelID string `json:"channel_id,omitempty"`
NotifyURL string `json:"notify_url,omitempty"`
NotifyKind string `json:"notify_kind,omitempty"`
Enabled bool `json:"enabled"`
}
CreateAlertRuleRequest mirrors the fields internal/api's ruleResource actually reads from a create request body; id and resource_id always come from the server (alerting.NewRuleID, the app name in the URL), never the body, so this type has no fields for either. A kind=cert_expiry rule needs none of the threshold or crashloop fields below: it watches every stored certificate platform-wide, not this rule's own resource_id.
type CreateBackupTargetRequest ¶
type CreateBackupTargetRequest struct {
Name string `json:"name"`
Provider string `json:"provider"`
Endpoint string `json:"endpoint,omitempty"`
Region string `json:"region,omitempty"`
Bucket string `json:"bucket"`
AccessKeyID string `json:"access_key_id"`
SecretAccessKey string `json:"secret_access_key"`
}
CreateBackupTargetRequest mirrors internal/api's createBackupTargetRequest: AccessKeyID/SecretAccessKey are required here, unlike UpdateBackupTargetRequest where they're optional.
type CreateDeployNotifyTargetRequest ¶ added in v0.2.0
type CreateDeployNotifyTargetRequest struct {
ChannelID string `json:"channel_id"`
Enabled bool `json:"enabled"`
}
CreateDeployNotifyTargetRequest mirrors internal/api's createDeployTargetRequest: attach an already-connected channel by ID.
type CreateEnvironmentRequest ¶
type CreateEnvironmentRequest struct {
Name string `json:"name"`
Protected bool `json:"protected,omitempty"`
}
CreateEnvironmentRequest mirrors internal/api's createEnvironmentRequest.
type CreateInviteRequest ¶
type CreateInviteRequest struct {
Email string `json:"email"`
Role string `json:"role,omitempty"`
Abilities []string `json:"abilities,omitempty"`
}
CreateInviteRequest mirrors internal/api's createInviteRequest. Role, when set, takes precedence server-side over Abilities, same precedence CreateUserRequest documents.
type CreateInviteResponse ¶
type CreateInviteResponse struct {
InviteResource
Link string `json:"link"`
}
CreateInviteResponse mirrors internal/api's createInviteResponse: the invite plus Link, the accept URL to hand or send to the invited person.
type CreateNodeJoinTokenResponse ¶
type CreateNodeJoinTokenResponse struct {
Token string `json:"token"`
ExpiresAt time.Time `json:"expires_at"`
CAFingerprint string `json:"ca_fingerprint,omitempty"`
}
CreateNodeJoinTokenResponse mirrors internal/api's createNodeJoinTokenResponse: a join token's one and only plaintext appearance, the same "shown once, never recoverable again" shape a created API token uses.
type CreateNotificationChannelRequest ¶
type CreateNotificationChannelRequest struct {
Name string `json:"name"`
Kind string `json:"kind"`
NotifyURL string `json:"notify_url"`
Enabled *bool `json:"enabled,omitempty"`
}
CreateNotificationChannelRequest mirrors internal/api's createNotificationChannelRequest.
type CreateOrganizationRequest ¶
type CreateOrganizationRequest struct {
Name string `json:"name"`
}
CreateOrganizationRequest mirrors internal/api's createOrganizationRequest.
type CreateProjectRequest ¶
type CreateProjectRequest struct {
Name string `json:"name"`
}
CreateProjectRequest mirrors internal/api's createProjectRequest.
type CreateRegistryCredentialRequest ¶
type CreateRegistryCredentialRequest struct {
Name string `json:"name"`
RegistryHost string `json:"registry_host"`
Username string `json:"username"`
Password string `json:"password"`
ExpiresAt *time.Time `json:"expires_at,omitempty"`
}
CreateRegistryCredentialRequest mirrors internal/api's createRegistryCredentialRequest: Password is required here, unlike UpdateRegistryCredentialRequest where it's optional.
type CreateTagRequest ¶ added in v0.2.0
type CreateTagRequest struct {
Name string `json:"name"`
}
CreateTagRequest mirrors internal/api's tagResource decode shape for POST /api/v1/tags: only Name is read on create.
type CreateUserRequest ¶
type CreateUserRequest struct {
Email string `json:"email"`
DisplayName string `json:"display_name,omitempty"`
Password string `json:"password"`
Abilities []string `json:"abilities,omitempty"`
Role string `json:"role,omitempty"`
}
CreateUserRequest mirrors internal/api's createUserRequest. Role, when set, takes precedence server-side over Abilities (roles.go's resolveAbilities): set one or the other, not both.
type Credentials ¶
Credentials is ReadCredentialsFile/WriteCredentialsFile's in-memory shape: the same two values as EnvAPIURL/EnvAPIToken.
func ReadCredentialsFile ¶
func ReadCredentialsFile(prog, profile string) (Credentials, error)
ReadCredentialsFile reads profile's section from prog's credentials file. A missing file is a plain error the caller treats as "no credentials file," not logged or reported: this is the lowest-priority source in ResolveToken/ResolveAPIURL's precedence chain, its absence is the common case, not a problem. A file that exists but has no section named profile returns a zero Credentials and no error, the same "nothing configured here" shape, since asking for an unconfigured profile is not itself a failure to read the file.
type DashboardURLResource ¶ added in v0.2.0
type DashboardURLResource struct {
DashboardURL string `json:"dashboard_url"`
}
DashboardURLResource mirrors internal/api's dashboardURLResource (GET/PUT /api/v1/settings/dashboard-url).
type DatabaseEngineResource ¶
type DatabaseEngineResource struct {
ID string `json:"id"`
Label string `json:"label"`
DefaultVersion string `json:"default_version"`
}
DatabaseEngineResource mirrors internal/api's databaseEngineResource (internal/api/database_engines.go): one entry from GET /api/v1/database-engines, the dynamic registry backing the creation wizard's engine picker.
type DatabasePublicAccessResource ¶
type DatabasePublicAccessResource struct {
DatabaseName string `json:"database_name"`
PubliclyAccessible bool `json:"publicly_accessible"`
PublicPort int `json:"public_port,omitempty"`
// BindAddress: see SetDatabasePublicAccessRequest's own field doc
// comment for what this holds.
BindAddress string `json:"bind_address,omitempty"`
}
DatabasePublicAccessResource mirrors internal/api's databasePublicAccessResource (internal/api/database_public_access.go): PUT/DELETE .../public-access only ever touch these three fields.
type DatabaseResource ¶
type DatabaseResource struct {
Name string `json:"name"`
Engine string `json:"engine"`
Version string `json:"version"`
NodeID string `json:"node_id,omitempty"`
// AutoPlaced mirrors internal/api's databaseResource.AutoPlaced: see
// AppResource's identically-named field doc comment.
AutoPlaced bool `json:"auto_placed,omitempty"`
// ProjectID mirrors internal/api's databaseResource.ProjectID:
// response-only, set via PUT /api/v1/databases/{name}/project.
ProjectID string `json:"project_id,omitempty"`
// Resources, PubliclyAccessible, PublicPort, and the Backup* fields
// are set through their own dedicated routes (SetDatabaseResources,
// SetDatabasePublicAccess, SetBackupSchedule), never through this
// resource's own create/update body; see internal/api's
// databaseResource for the identical boundary server-side.
Resources *ServiceResources `json:"resources,omitempty"`
PubliclyAccessible bool `json:"publicly_accessible,omitempty"`
PublicPort int `json:"public_port,omitempty"`
BackupTargetID string `json:"backup_target_id,omitempty"`
BackupSchedule string `json:"backup_schedule,omitempty"`
BackupRetain int `json:"backup_retain,omitempty"`
BackupRetainDays int `json:"backup_retain_days,omitempty"`
// Suspended is set via POST /api/v1/databases/{name}/stop and
// .../start (StopDatabase/StartDatabase), the same response-only
// boundary NodeID/ProjectID already establish.
Suspended bool `json:"suspended,omitempty"`
// TLSEnabled mirrors internal/api's databaseResource.TLSEnabled:
// response-only, computed fresh on every read, true when this
// database's connection string (DATABASE_URL/REDIS_URL, injected
// into consuming app containers) is TLS-encrypted.
TLSEnabled bool `json:"tls_enabled,omitempty"`
}
DatabaseResource mirrors internal/api's databaseResource (internal/api/databases.go). NodeID is response-only on update, but settable at create time as an explicit placement override, the same boundary AppResource's own NodeID field documents.
type DeployApprovalDecisionResult ¶ added in v0.2.0
type DeployApprovalDecisionResult struct {
Approval DeployApprovalResource `json:"approval"`
App AppResource `json:"app"`
}
DeployApprovalDecisionResult mirrors internal/api's deployApprovalDecisionResponse (POST .../deploy-approvals/{id}/approve).
type DeployApprovalListResult ¶ added in v0.2.0
type DeployApprovalListResult struct {
Approvals []DeployApprovalResource `json:"approvals"`
}
DeployApprovalListResult mirrors internal/api's deployApprovalListResponse (GET /api/v1/deploy-approvals).
type DeployApprovalResource ¶ added in v0.2.0
type DeployApprovalResource struct {
ID string `json:"id"`
ServiceName string `json:"service_name"`
SourceServiceName string `json:"source_service_name,omitempty"`
EnvironmentID string `json:"environment_id"`
Action string `json:"action"`
Image string `json:"image"`
Status string `json:"status"`
RequestedByType string `json:"requested_by_type"`
RequestedBy string `json:"requested_by"`
RequestedByName string `json:"requested_by_name"`
ApprovedByType string `json:"approved_by_type,omitempty"`
ApprovedBy string `json:"approved_by,omitempty"`
ApprovedByName string `json:"approved_by_name,omitempty"`
Reason string `json:"reason,omitempty"`
CreatedAt string `json:"created_at"`
ExpiresAt string `json:"expires_at"`
DecidedAt string `json:"decided_at,omitempty"`
}
DeployApprovalResource mirrors internal/api's deployApprovalResource (deploy_approvals.go): a pending or decided two-person approval gate on a deploy/promote into a protected environment.
type DeployAttemptResource ¶ added in v0.2.0
type DeployAttemptResource struct {
ID string `json:"id"`
ServiceName string `json:"service_name"`
Image string `json:"image"`
CommitSHA string `json:"commit_sha,omitempty"`
Source string `json:"source,omitempty"`
Status string `json:"status"`
StartedAt time.Time `json:"started_at"`
FinishedAt *time.Time `json:"finished_at,omitempty"`
Error string `json:"error,omitempty"`
// DetectedFramework is the wizard's pre-flight detection result for
// this build, e.g. "Node.js"; empty when detection was skipped
// (a CLI or webhook-triggered build) or found nothing buildable.
DetectedFramework string `json:"detected_framework,omitempty"`
}
DeployAttemptResource mirrors internal/api's deployAttemptResource (internal/api/deploy_attempts.go): one row of GET /api/v1/apps/{name}/deploy-attempts, additive to the reconcile conditions GetDeployStatus already returns, not a replacement for it.
type DeployCompareField ¶
type DeployCompareField struct {
Field string `json:"field"`
From string `json:"from"`
To string `json:"to"`
}
DeployCompareField mirrors internal/api's deployCompareField: one field that differs between From and To.
type DeployCompareResource ¶
type DeployCompareResource struct {
ServiceName string `json:"service_name"`
From DeployCompareSide `json:"from"`
To DeployCompareSide `json:"to"`
Changes []DeployCompareField `json:"changes"`
UnsnapshottedFields []string `json:"unsnapshotted_fields"`
Note string `json:"note"`
}
DeployCompareResource mirrors internal/api's deployCompareResource, GET /api/v1/apps/{name}/deploys/compare's response. UnsnapshottedFields and Note are the honest limitation this task's own design note requires: deploy_attempts never snapshotted env/resources/ domains/etc per attempt, so those cannot be diffed across past deploys, only reported as not tracked.
type DeployCompareSide ¶
type DeployCompareSide struct {
DeployID string `json:"deploy_id,omitempty"`
IsCurrent bool `json:"is_current"`
Image string `json:"image"`
CommitSHA string `json:"commit_sha,omitempty"`
Source string `json:"source,omitempty"`
Status string `json:"status,omitempty"`
StartedAt *time.Time `json:"started_at,omitempty"`
FinishedAt *time.Time `json:"finished_at,omitempty"`
}
DeployCompareSide mirrors internal/api's deployCompareSide (internal/api/deploy_compare.go): one side of a deploy comparison. IsCurrent true and DeployID empty means this side is the app's current live desired state, not a stored attempt.
type DeployNotifyTargetResource ¶ added in v0.2.0
type DeployNotifyTargetResource struct {
ID string `json:"id,omitempty"`
ResourceID string `json:"resource_id,omitempty"`
ChannelID string `json:"channel_id,omitempty"`
NotifyURL string `json:"notify_url,omitempty"`
NotifyKind string `json:"notify_kind,omitempty"`
Enabled bool `json:"enabled"`
}
DeployNotifyTargetResource mirrors internal/api's deployTargetResource (internal/api/deploy_notify_targets.go). NotifyURL/NotifyKind are always the resolved values from the attached channel, response-only.
type DeploySpecRequest ¶
type DeploySpecRequest struct {
RepoURL string `json:"repo_url"`
Ref string `json:"ref"`
ImageRepoBase string `json:"image_repo_base,omitempty"`
Services map[string]DeploySpecService `json:"services"`
}
DeploySpecRequest mirrors internal/api's deploySpecRequest (internal/api/apps_multi.go): POST /api/v1/apps/{name}/deploy-spec's body, one app.yaml services: map fanned out under app name.
type DeploySpecResult ¶
type DeploySpecResult struct {
AppID string `json:"app_id"`
Services []DeploySpecServiceResult `json:"services"`
AllSucceeded bool `json:"all_succeeded"`
}
DeploySpecResult mirrors internal/api's deploySpecResponse. AllSucceeded false means at least one ServiceKey's own Error is set; the request as a whole still succeeded at fanning out.
type DeploySpecService ¶
type DeploySpecService struct {
Build DeploySpecServiceBuild `json:"build"`
Domains []string `json:"domains,omitempty"`
Port int `json:"port,omitempty"`
Health *DeploySpecServiceHealth `json:"health,omitempty"`
Resources *DeploySpecServiceResources `json:"resources,omitempty"`
Env map[string]DeploySpecServiceEnv `json:"env,omitempty"`
Replicas int `json:"replicas,omitempty"`
Strategy string `json:"strategy,omitempty"`
Hooks *DeploySpecServiceHooks `json:"hooks,omitempty"`
}
DeploySpecService mirrors one entry in app.yaml's services: map (internal/spec.Service) as POST /api/v1/apps/{name}/deploy-spec expects to receive it directly, field for field.
type DeploySpecServiceBuild ¶
type DeploySpecServiceBuild struct {
Type string `json:"type"`
Path string `json:"path,omitempty"`
BaseDirectory string `json:"baseDirectory,omitempty"`
Image string `json:"image,omitempty"`
RegistryCredential string `json:"registryCredential,omitempty"`
}
DeploySpecServiceBuild mirrors internal/spec.Build's JSON wire shape: human-written field names, not AppResource's bytes/nanoCPUs encoding.
type DeploySpecServiceEnv ¶
type DeploySpecServiceEnv struct {
Value string `json:"value,omitempty"`
From string `json:"from,omitempty"`
Secret bool `json:"secret,omitempty"`
Required bool `json:"required,omitempty"`
}
DeploySpecServiceEnv mirrors internal/spec.EnvVar's JSON shape. Unlike app.yaml's YAML parsing, no plain-string shorthand: use Value for a literal.
type DeploySpecServiceHealth ¶
type DeploySpecServiceHealth struct {
Readiness *DeploySpecServiceProbe `json:"readiness,omitempty"`
Liveness *DeploySpecServiceProbe `json:"liveness,omitempty"`
ReadyTimeout string `json:"readyTimeout,omitempty"`
}
DeploySpecServiceHealth mirrors internal/spec.Health.
type DeploySpecServiceHooks ¶
type DeploySpecServiceHooks struct {
PreDeploy string `json:"preDeploy,omitempty"`
PostDeploy string `json:"postDeploy,omitempty"`
}
DeploySpecServiceHooks mirrors internal/spec.Hooks.
type DeploySpecServiceProbe ¶
type DeploySpecServiceProbe struct {
Path string `json:"path,omitempty"`
Scheme string `json:"scheme,omitempty"`
Host string `json:"host,omitempty"`
TLSSkipVerify bool `json:"tls_skip_verify,omitempty"`
FollowRedirects *bool `json:"follow_redirects,omitempty"`
ExpectedStatus string `json:"expected_status,omitempty"`
Exec []string `json:"exec,omitempty"`
Interval string `json:"interval,omitempty"`
Timeout string `json:"timeout,omitempty"`
Failures int `json:"failures,omitempty"`
}
DeploySpecServiceProbe mirrors internal/spec.Probe: human-readable duration strings ("5s"), not ServiceProbe's nanosecond encoding.
type DeploySpecServiceResources ¶
type DeploySpecServiceResources struct {
Memory string `json:"memory,omitempty"`
CPU float64 `json:"cpu,omitempty"`
}
DeploySpecServiceResources mirrors internal/spec.Resources: human-readable "512Mi"/0.5 values, not ServiceResources' bytes/ nanoCPUs encoding.
type DeploySpecServiceResult ¶
type DeploySpecServiceResult struct {
ServiceKey string `json:"service_key"`
ServiceName string `json:"service_name"`
Image string `json:"image,omitempty"`
Error string `json:"error,omitempty"`
}
DeploySpecServiceResult mirrors internal/api's deploySpecServiceResult: one service key's own build+deploy outcome. Error is set on failure, Image on success, matching deploy.ServiceOutcome's own "never both" contract.
type DeployTriggerRequest ¶
type DeployTriggerRequest struct {
Image string `json:"image"`
Confirm bool `json:"confirm,omitempty"`
}
DeployTriggerRequest mirrors internal/api's deployTriggerRequest (internal/api/deploys.go).
type DeployTriggerResult ¶ added in v0.2.0
type DeployTriggerResult struct {
*AppResource
PendingApproval *DeployApprovalResource `json:"pending_approval,omitempty"`
}
DeployTriggerResult mirrors internal/api's deployTriggerResult (deploys.go): the common case is a flat AppResource on the wire (*AppResource is embedded so those fields promote to the top level, unchanged from before this type existed), PendingApproval is only ever set instead, when the target environment is protected and the deploy/promote was accepted as a pending approval rather than applied.
type DeviceStartRequest ¶
type DeviceStartRequest struct {
ClientName string `json:"client_name,omitempty"`
}
DeviceStartRequest mirrors internal/api's deviceStartRequest.
type DeviceStartResponse ¶
type DeviceStartResponse struct {
DeviceCode string `json:"device_code"`
UserCode string `json:"user_code"`
VerificationURI string `json:"verification_uri"`
VerificationURIComplete string `json:"verification_uri_complete"`
ExpiresIn int `json:"expires_in"`
Interval int `json:"interval"`
}
DeviceStartResponse mirrors internal/api's deviceStartResponse.
type DeviceTokenRequest ¶
type DeviceTokenRequest struct {
DeviceCode string `json:"device_code"`
}
DeviceTokenRequest mirrors internal/api's deviceTokenRequest.
type DeviceTokenResponse ¶
type DeviceTokenResponse struct {
ID string `json:"id"`
Name string `json:"name"`
Abilities []string `json:"abilities"`
CreatedAt time.Time `json:"created_at"`
LastUsedAt *time.Time `json:"last_used_at,omitempty"`
ExpiresAt *time.Time `json:"expires_at,omitempty"`
RevokedAt *time.Time `json:"revoked_at,omitempty"`
Token string `json:"token"`
}
DeviceTokenResponse mirrors internal/api's createTokenResponse, the shape POST /api/v1/auth/device/token returns once a request is approved.
type DiagnosisResource ¶
type DiagnosisResource struct {
Explanation string `json:"explanation"`
Suggestion string `json:"suggestion"`
Confidence string `json:"confidence"`
MatchedSignals []DiagnosisSignal `json:"matched_signals"`
DeployAttemptID string `json:"deploy_attempt_id,omitempty"`
}
DiagnosisResource mirrors internal/api's diagnosisResource (internal/api/diagnose.go): GET /api/v1/apps/{name}/diagnose's response, a deterministic explanation of a deploy failure or crashloop synthesized from internal/diagnose, never from an external model.
type DiagnosisSignal ¶
DiagnosisSignal mirrors internal/api's diagnosisSignalResource: one piece of evidence a diagnosis signature matched against.
type DimensionRecommendationResource ¶
type DimensionRecommendationResource struct {
Dimension string `json:"dimension"`
SampleCount int `json:"sample_count"`
DataSufficient bool `json:"data_sufficient"`
Confidence string `json:"confidence"`
CurrentLimit int64 `json:"current_limit"`
P95Usage float64 `json:"p95_usage"`
P99Usage float64 `json:"p99_usage"`
SuggestedLimit int64 `json:"suggested_limit"`
Action string `json:"action,omitempty"`
Reason string `json:"reason"`
}
DimensionRecommendationResource mirrors internal/api's dimensionRecommendationResource (internal/api/resource_recommendation.go): one resource dimension's (memory or cpu) right-sizing suggestion. CurrentLimit/SuggestedLimit are bytes for memory, nano-CPUs for cpu, the same raw-unit convention AppResource.Resources already uses. Action is "" when there isn't enough data, or no limit is currently set, to responsibly suggest a change.
type DoctorCheckResource ¶
type DoctorCheckResource struct {
Code string `json:"code"`
Name string `json:"name"`
Status string `json:"status"`
Message string `json:"message"`
Fix string `json:"fix,omitempty"`
DocsPath string `json:"docs_path,omitempty"`
}
DoctorCheckResource mirrors internal/api's doctorCheckResource: one preflight check's result (Status is "ok", "warn", "fail", or "unknown"). Fix/DocsPath are empty when the check is ok or has no single actionable command.
type DomainBasicAuthResource ¶
type DomainBasicAuthResource struct {
Domain string `json:"domain"`
Enabled bool `json:"enabled"`
Username string `json:"username,omitempty"`
HasPassword bool `json:"has_password"`
}
DomainBasicAuthResource mirrors internal/api's domainBasicAuthResource (internal/api/domain_basic_auth.go): GET/PUT/DELETE /api/v1/apps/{name}/domains/{domain}/auth's wire shape. The password itself never appears here in either direction.
type DomainCheckResource ¶ added in v0.2.0
type DomainCheckResource struct {
Domain string `json:"domain"`
ExpectedHost string `json:"expected_host,omitempty"`
HostInferred bool `json:"host_inferred,omitempty"`
Resolved bool `json:"resolved"`
ResolvedHosts []string `json:"resolved_hosts,omitempty"`
Status string `json:"status"`
ExpectedIPv4 []string `json:"expected_ipv4,omitempty"`
ExpectedIPv6 []string `json:"expected_ipv6,omitempty"`
}
DomainCheckResource mirrors internal/api's domainCheckResponse (internal/api/domain_check.go): GET /api/v1/apps/{name}/domains/{domain}/check's wire shape.
type DomainErrorPageEntry ¶ added in v0.2.0
DomainErrorPageEntry mirrors internal/api's domainErrorPageEntry: one status-code-to-body mapping.
type DomainErrorPagesResource ¶ added in v0.2.0
type DomainErrorPagesResource struct {
Domain string `json:"domain"`
Pages []DomainErrorPageEntry `json:"pages"`
}
DomainErrorPagesResource mirrors internal/api's domainErrorPagesResource (internal/api/domain_error_pages.go): GET/PUT/DELETE /api/v1/apps/{name}/domains/{domain}/error-pages's wire shape.
type DomainMaintenanceResource ¶
type DomainMaintenanceResource struct {
Domain string `json:"domain"`
Enabled bool `json:"enabled"`
}
DomainMaintenanceResource mirrors internal/api's domainMaintenanceResource: GET/PUT/DELETE /api/v1/apps/{name}/domains/{domain}/maintenance's wire shape.
type DomainRedirectResource ¶ added in v0.2.0
type DomainRedirectResource struct {
Domain string `json:"domain"`
Enabled bool `json:"enabled"`
TargetURL string `json:"target_url,omitempty"`
StatusCode int `json:"status_code"`
}
DomainRedirectResource mirrors internal/api's domainRedirectResource (internal/api/domain_redirect.go): GET/PUT/DELETE /api/v1/apps/{name}/domains/{domain}/redirect's wire shape.
type DomainResource ¶
type DomainResource struct {
Domain string `json:"domain"`
ServiceName string `json:"service_name"`
}
DomainResource mirrors internal/api's domainResource (internal/api/ingress_settings.go).
type DomainTLSCertResource ¶
type DomainTLSCertResource struct {
Domain string `json:"domain"`
Enabled bool `json:"enabled"`
UploadedAt string `json:"uploaded_at,omitempty"`
ExpiresAt string `json:"expires_at,omitempty"`
}
DomainTLSCertResource mirrors internal/api's domainTLSCertResource (internal/api/domain_tls_cert.go): GET/PUT/DELETE /api/v1/apps/{name}/domains/{domain}/tls-cert's wire shape. Neither the certificate nor the private key ever appears here.
type DomainWAFResource ¶ added in v0.2.0
type DomainWAFResource struct {
Domain string `json:"domain"`
WAFEnabled bool `json:"waf_enabled"`
WAFMode string `json:"waf_mode"`
RateLimitEnabled bool `json:"rate_limit_enabled"`
RateLimitRPS int `json:"rate_limit_rps"`
RateLimitBurst int `json:"rate_limit_burst"`
}
DomainWAFResource mirrors internal/api's domainWAFResource (internal/api/domain_waf.go): GET/PUT/DELETE /api/v1/apps/{name}/domains/{domain}/waf's wire shape.
type DrainNodeResponse ¶
type DrainNodeResponse struct {
TargetNodeID string `json:"target_node_id"`
MovedServices []string `json:"moved_services"`
MovedDatabases []string `json:"moved_databases"`
Errors []string `json:"errors,omitempty"`
}
DrainNodeResponse mirrors internal/api's drainNodeResponse. A partial failure is not itself a Go error from DrainNode: it comes back as a successful response with Errors populated, naming exactly which resource didn't move so the caller can retry just that one.
type EmailSettingsResource ¶ added in v0.2.0
type EmailSettingsResource struct {
Backend string `json:"backend"`
SMTPHost string `json:"smtp_host,omitempty"`
SMTPPort int `json:"smtp_port,omitempty"`
SMTPUsername string `json:"smtp_username,omitempty"`
SMTPFrom string `json:"smtp_from,omitempty"`
SMTPPassword string `json:"smtp_password,omitempty"`
SMTPPasswordSet bool `json:"smtp_password_set,omitempty"`
SESRegion string `json:"ses_region,omitempty"`
SESAccessKeyID string `json:"ses_access_key_id,omitempty"`
SESFrom string `json:"ses_from,omitempty"`
SESSecretAccessKey string `json:"ses_secret_access_key,omitempty"`
SESSecretAccessKeySet bool `json:"ses_secret_access_key_set,omitempty"`
}
EmailSettingsResource mirrors internal/api's emailSettingsResource (internal/api/email_settings.go): the shape of both GET and PUT /api/v1/settings/email. Credential fields are write-only; the corresponding *Set booleans report presence instead.
type EnvironmentCloneAppInput ¶ added in v0.2.0
type EnvironmentCloneAppInput struct {
SourceApp string `json:"source_app"`
NewName string `json:"new_name,omitempty"`
Domains []string `json:"domains,omitempty"`
}
EnvironmentCloneAppInput mirrors internal/api's environmentCloneAppInput: an optional per-app override inside a clone request. Omitted entirely for a source app means "use the auto-suggested name, assign no domains".
type EnvironmentCloneAppPreview ¶ added in v0.2.0
type EnvironmentCloneAppPreview struct {
SourceApp string `json:"source_app"`
SuggestedNewName string `json:"suggested_new_name"`
Image string `json:"image"`
EnvVarCount int `json:"env_var_count"`
SecretEnvKeys []string `json:"secret_env_keys"`
CurrentDomains []string `json:"current_domains"`
VolumeCount int `json:"volume_count"`
BindMountCount int `json:"bind_mount_count"`
HasHealthCheck bool `json:"has_health_check"`
HasDatabaseAttachment bool `json:"has_database_attachment"`
HasHostPortPin bool `json:"has_host_port_pin"`
ScheduledTaskCount int `json:"scheduled_task_count"`
}
EnvironmentCloneAppPreview mirrors internal/api's environmentCloneAppPreview (internal/api/environment_clone.go): one source app's own view inside GET .../clone/preview.
type EnvironmentCloneAppResult ¶ added in v0.2.0
type EnvironmentCloneAppResult struct {
SourceApp string `json:"source_app"`
NewApp string `json:"new_app"`
Image string `json:"image"`
}
EnvironmentCloneAppResult mirrors internal/api's environmentCloneAppResult: one cloned app's own entry inside POST .../clone's response.
type EnvironmentClonePreviewResource ¶ added in v0.2.0
type EnvironmentClonePreviewResource struct {
SourceEnvironment EnvironmentResource `json:"source_environment"`
NewEnvironmentName string `json:"new_environment_name"`
Apps []EnvironmentCloneAppPreview `json:"apps"`
EnvironmentEnvVarKeys []string `json:"environment_env_var_keys"`
EnvironmentSecretEnvKeys []string `json:"environment_secret_env_keys"`
UnclonedFields []string `json:"uncloned_fields"`
Note string `json:"note"`
}
EnvironmentClonePreviewResource mirrors internal/api's environmentClonePreviewResource, GET .../clone/preview's response.
type EnvironmentCloneRequest ¶ added in v0.2.0
type EnvironmentCloneRequest struct {
NewEnvironmentName string `json:"new_environment_name"`
CopySecretValues bool `json:"copy_secret_values,omitempty"`
Apps []EnvironmentCloneAppInput `json:"apps,omitempty"`
}
EnvironmentCloneRequest mirrors internal/api's environmentCloneRequest, POST /api/v1/environments/{id}/clone's body.
type EnvironmentCloneResultResource ¶ added in v0.2.0
type EnvironmentCloneResultResource struct {
Environment EnvironmentResource `json:"environment"`
Apps []EnvironmentCloneAppResult `json:"apps"`
CopiedSecretValues bool `json:"copied_secret_values"`
Note string `json:"note"`
}
EnvironmentCloneResultResource mirrors internal/api's environmentCloneResultResource, POST .../clone's response.
type EnvironmentResource ¶
type EnvironmentResource struct {
ID string `json:"id"`
ProjectID string `json:"project_id"`
Name string `json:"name"`
Protected bool `json:"protected"`
CreatedAt string `json:"created_at"`
}
EnvironmentResource mirrors internal/api's environmentResource (internal/api/environments.go).
type EvaluateFlagResource ¶
EvaluateFlagResource mirrors internal/api's evaluateFlagResource: the tiny shape GET /api/v1/flags/evaluate/{key} returns.
type ExecAccessResource ¶ added in v0.2.0
type ExecAccessResource struct {
Enabled bool `json:"enabled"`
}
ExecAccessResource mirrors internal/api's execAccessResource: both GET and PUT /api/v1/apps/{name}/exec-access's response, whether shell/exec access is even attempted for this app regardless of the caller's own IAM abilities. Default true, unlike AutoRollbackSettingResource.
type ExecRequest ¶
type ExecRequest struct {
Command string `json:"command"`
Args []string `json:"args,omitempty"`
TimeoutSeconds int `json:"timeout_seconds,omitempty"`
}
ExecRequest mirrors internal/api's execRequest (internal/api/exec.go). Command is required server-side and is never shell-interpreted: a caller who wants shell features (pipes, redirection, env expansion) passes Command: "sh", Args: []string{"-c", "..."} explicitly, the same contract the server documents.
type ExecResponse ¶
type ExecResponse struct {
Stdout string `json:"stdout"`
Stderr string `json:"stderr,omitempty"`
ExitCode int `json:"exit_code"`
Truncated bool `json:"truncated,omitempty"`
}
ExecResponse mirrors internal/api's execResponse. ExitCode is always the remote command's real exit code, never a client-level sentinel.
type FeatureFlagRequest ¶
type FeatureFlagRequest struct {
Key string `json:"key,omitempty"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Enabled bool `json:"enabled"`
RolloutPercentage int `json:"rollout_percentage"`
}
FeatureFlagRequest mirrors the fields internal/api's featureFlagResource actually reads from a create/update request body. Key is only read on create; an update ignores it (ID and ServiceName always come from the URL, same as ScheduledTaskRequest above).
type FeatureFlagResource ¶
type FeatureFlagResource struct {
ID string `json:"id,omitempty"`
Key string `json:"key"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
ServiceName string `json:"service_name,omitempty"`
Enabled bool `json:"enabled"`
RolloutPercentage int `json:"rollout_percentage"`
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
}
FeatureFlagResource mirrors internal/api's featureFlagResource (internal/api/feature_flags.go). Key is globally unique across the whole platform, not just within ServiceName: see that file's own migration comment for why.
type FleetResourceUsageResource ¶ added in v0.2.0
type FleetResourceUsageResource struct {
Nodes []NodeResourceUsageResource `json:"nodes"`
Fleet FleetResourceUsageRollup `json:"fleet"`
}
FleetResourceUsageResource mirrors internal/api's fleetResourceUsageResponse: one row per node plus the fleet-wide rollup, GET /api/v1/nodes/resource-usage's full body.
type FleetResourceUsageRollup ¶ added in v0.2.0
type FleetResourceUsageRollup struct {
NodeCount int `json:"node_count"`
TotalCPUPercent *float64 `json:"total_cpu_percent,omitempty"`
TotalMemoryUsageBytes *float64 `json:"total_memory_usage_bytes,omitempty"`
TotalMemoryBytes *float64 `json:"total_memory_bytes,omitempty"`
MemoryUsedPercent *float64 `json:"memory_used_percent,omitempty"`
NodesWithMemoryCapacity int `json:"nodes_with_memory_capacity"`
TotalDiskUsedBytes *float64 `json:"total_disk_used_bytes,omitempty"`
TotalDiskBytes *float64 `json:"total_disk_bytes,omitempty"`
DiskUsedPercent *float64 `json:"disk_used_percent,omitempty"`
NodesWithDiskCapacity int `json:"nodes_with_disk_capacity"`
}
FleetResourceUsageRollup mirrors internal/api's fleetResourceUsageRollup: fleet-wide sums, with *Percent fields only computed from nodes that actually reported a capacity figure (see NodesWithMemoryCapacity/NodesWithDiskCapacity).
type GitAppBranchResource ¶ added in v0.2.0
GitAppBranchResource mirrors the identical branch wire shape every git provider App integration returns: internal/api's gitHubAppBranchResource, gitLabAppBranchResource, and bitbucketAppBranchResource are structurally the same two fields, so this client uses one type for all three.
type GitHubAppRepoResource ¶ added in v0.2.0
type GitHubAppRepoResource struct {
FullName string `json:"full_name"`
Name string `json:"name"`
OwnerLogin string `json:"owner_login"`
Private bool `json:"private"`
DefaultBranch string `json:"default_branch"`
CloneURL string `json:"clone_url"`
}
GitHubAppRepoResource mirrors internal/api's gitHubAppRepoResource: one entry of GET /api/v1/github-app/repos.
type GitHubAppStatusResource ¶ added in v0.2.0
type GitHubAppStatusResource struct {
Connected bool `json:"connected"`
AppID int64 `json:"app_id,omitempty"`
ClientID string `json:"client_id,omitempty"`
InstanceURL string `json:"instance_url,omitempty"`
Installed bool `json:"installed"`
InstallationStatus string `json:"installation_status,omitempty"`
AccountLogin string `json:"account_login,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
BaseURL string `json:"base_url,omitempty"`
}
GitHubAppStatusResource mirrors internal/api's gitHubAppStatusResource: GET /api/v1/github-app's response. No secret fields ever appear here.
type GitLabAppProjectResource ¶ added in v0.2.0
type GitLabAppProjectResource struct {
ID int64 `json:"id"`
Name string `json:"name"`
PathWithNamespace string `json:"path_with_namespace"`
CloneURL string `json:"clone_url"`
DefaultBranch string `json:"default_branch"`
Visibility string `json:"visibility"`
WebURL string `json:"web_url"`
}
GitLabAppProjectResource mirrors internal/api's gitLabAppProjectResource: one entry of GET /api/v1/gitlab-app/projects.
type GitLabAppStatusResource ¶ added in v0.2.0
type GitLabAppStatusResource struct {
Connected bool `json:"connected"`
InstanceURL string `json:"instance_url,omitempty"`
ClientID string `json:"client_id,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
Authorized bool `json:"authorized"`
BaseURL string `json:"base_url,omitempty"`
}
GitLabAppStatusResource mirrors internal/api's gitLabAppStatusResource: GET /api/v1/gitlab-app's response.
type GitProviderResource ¶ added in v0.2.0
type GitProviderResource struct {
Provider string `json:"provider"`
Connected bool `json:"connected"`
CanListBranches bool `json:"can_list_branches"`
CanRegisterWebhook bool `json:"can_register_webhook"`
CanAuthClone bool `json:"can_auth_clone"`
}
GitProviderResource mirrors internal/api's gitProviderResource: one entry of GET /api/v1/git-providers, a capability summary for one git provider (github, gitlab, bitbucket, gitea).
type GitSourceResource ¶
type GitSourceResource struct {
ServiceName string `json:"service_name"`
RepoURL string `json:"repo_url"`
Branch string `json:"branch"`
BuildType string `json:"build_type"`
BuildPath string `json:"build_path,omitempty"`
// TriggerMode mirrors store.GitSource.TriggerMode: "push" (default)
// or "release", see internal/api's normalizeGitSourceTriggerMode.
TriggerMode string `json:"trigger_mode,omitempty"`
HasToken bool `json:"has_token"`
WebhookURL string `json:"webhook_url"`
WebhookSecret string `json:"webhook_secret,omitempty"`
PreviewEnabled bool `json:"preview_enabled"`
// PostPRComments mirrors store.GitSource.PostPRComments: the opt-in
// toggle for a preview deploy's GitHub PR comment/commit status, set
// via SetPreviewPostPRComments (preview-settings, same route as
// PreviewEnabled).
PostPRComments bool `json:"post_pr_comments"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
}
GitSourceResource mirrors internal/api's gitSourceResource (internal/api/git_sources.go). AdditionalServices/Services (the multi-service fan-out fields) are deliberately not carried here: this client's SetGitSourceRequest only covers the single-service connect flow "apps deploy-spec" already handles for the multi-service case.
type GiteaAppRepoResource ¶ added in v0.2.0
type GiteaAppRepoResource struct {
FullName string `json:"full_name"`
Name string `json:"name"`
Private bool `json:"private"`
DefaultBranch string `json:"default_branch"`
CloneURL string `json:"clone_url"`
WebURL string `json:"web_url"`
}
GiteaAppRepoResource mirrors internal/api's giteaAppRepoResource: one entry of GET /api/v1/gitea-app/repos.
type GiteaAppStatusResource ¶ added in v0.2.0
type GiteaAppStatusResource struct {
Connected bool `json:"connected"`
InstanceURL string `json:"instance_url,omitempty"`
ClientID string `json:"client_id,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
Authorized bool `json:"authorized"`
BaseURL string `json:"base_url,omitempty"`
}
GiteaAppStatusResource mirrors internal/api's giteaAppStatusResource: GET /api/v1/gitea-app's response.
type HookRunResource ¶
type HookRunResource struct {
HookType string `json:"hook_type"`
Command string `json:"command"`
ExitCode int `json:"exit_code"`
Success bool `json:"success"`
Output string `json:"output"`
RanAt time.Time `json:"ran_at"`
}
HookRunResource mirrors internal/api's hookRunResource (apps_hooks.go): one pre/post-deploy hook's most recent outcome.
type ImageResource ¶ added in v0.2.0
ImageResource mirrors internal/api's imageResource (internal/api/images.go): one element of GET /api/v1/apps/{name}/images's wire shape.
type IngressSettingsResource ¶ added in v0.2.0
type IngressSettingsResource struct {
PrimaryDomain string `json:"primary_domain,omitempty"`
ACMEEnabled bool `json:"acme_enabled"`
ACMEEmail string `json:"acme_email,omitempty"`
ACMEDirectoryURL string `json:"acme_directory_url,omitempty"`
}
IngressSettingsResource mirrors internal/api's ingressSettingsResource (internal/api/ingress_settings.go): the shape of both GET and PUT /api/v1/settings/ingress.
type IntegrationCatalogEntryResource ¶ added in v0.2.0
type IntegrationCatalogEntryResource struct {
Key string `json:"key"`
Name string `json:"name"`
Description string `json:"description"`
DocsURL string `json:"docs_url"`
EnvVars []IntegrationCatalogEnvVarResource `json:"env_vars"`
Frameworks []string `json:"frameworks,omitempty"`
}
IntegrationCatalogEntryResource mirrors internal/api's integrationCatalogEntry: one internal/integrations.Catalog entry, GET /api/v1/integrations' wire shape.
type IntegrationCatalogEnvVarResource ¶ added in v0.2.0
type IntegrationCatalogEnvVarResource struct {
Name string `json:"name"`
Type string `json:"type"`
Required bool `json:"required"`
Default string `json:"default,omitempty"`
Placeholder string `json:"placeholder,omitempty"`
}
IntegrationCatalogEnvVarResource mirrors internal/api's integrationCatalogEnvVar (internal/api/app_integrations.go).
type InviteResource ¶
type InviteResource struct {
ID string `json:"id"`
Email string `json:"email"`
Role string `json:"role,omitempty"`
Abilities []string `json:"abilities"`
CreatedBy string `json:"created_by,omitempty"`
CreatedAt time.Time `json:"created_at"`
ExpiresAt time.Time `json:"expires_at"`
Expired bool `json:"expired"`
}
InviteResource mirrors internal/api's inviteResource (internal/api/invites.go).
type ListAuditLogOptions ¶
type ListAuditLogOptions struct {
Limit int
Before string
Path string
Method string
ClientKind string
}
ListAuditLogOptions is ListAuditLog's and DownloadAuditLogCSV's shared query input, mirroring GET /api/v1/audit-log's own ?limit/?before/ ?path/?method/?client_kind params (internal/api/audit.go). Zero values omit the param, the same convention ListBackupsOptions establishes.
type ListBackupsOptions ¶
ListBackupsOptions is ListBackups' pagination input, mirroring the server's ?limit/?before query params. Zero values omit the param (Limit <= 0 uses the server default, Before == "" is the first page).
type ListWebhookDeliveriesOptions ¶
ListWebhookDeliveriesOptions is ListWebhookDeliveries' pagination input, the same shape ListBackupsOptions establishes.
type LogDrainResource ¶
type LogDrainResource struct {
AppName string `json:"app_name"`
Type string `json:"type"`
Target string `json:"target"`
Enabled bool `json:"enabled"`
}
LogDrainResource mirrors internal/api's logDrainResource (apps_log_drain.go): GET/PUT /api/v1/apps/{name}/log-drain's wire shape. Type is "http" or "syslog", validated server-side.
type LogEntryResource ¶
type LogEntryResource struct {
Timestamp time.Time `json:"timestamp"`
Stream string `json:"stream"`
Message string `json:"message"`
Structured bool `json:"structured"`
FieldsJSON json.RawMessage `json:"fields,omitempty"`
}
LogEntryResource mirrors internal/api's logEntryResource (internal/api/logs.go).
type LogStreamEntry ¶ added in v0.2.0
LogStreamEntry mirrors internal/api's sseLogEvent (internal/api/deploy_attempts.go), the exact JSON payload GET /api/v1/apps/{name}/logs/stream sends on each SSE "data:" line: no timestamp, unlike LogEntryResource's historical shape, since a live tail has no persisted-store round trip to attach one from.
type MeshPeerResource ¶ added in v0.2.0
type MeshPeerResource struct {
NodeID string `json:"node_id"`
Name string `json:"name,omitempty"`
PublicKey string `json:"public_key"`
MeshAddress string `json:"mesh_address,omitempty"`
Endpoint string `json:"endpoint,omitempty"`
LastHandshake *time.Time `json:"last_handshake_at,omitempty"`
Healthy bool `json:"healthy"`
TransferRx int64 `json:"transfer_rx_bytes"`
TransferTx int64 `json:"transfer_tx_bytes"`
Live bool `json:"live"`
}
MeshPeerResource mirrors internal/api's meshPeerResource (internal/api/mesh.go): one WireGuard peer as this node's own device sees it, joined with the store's record of that node's identity. Live is false for a peer this control plane only knows about from the store (no live device peer entry for it yet), true for one the local device actually has, real UAPI-backed handshake data and all.
type MeshRotationResource ¶ added in v0.2.0
type MeshRotationResource struct {
NodeID string `json:"node_id"`
OldPublicKey string `json:"old_public_key"`
NewPublicKey string `json:"new_public_key"`
StartedAt time.Time `json:"started_at"`
Confirmed bool `json:"confirmed"`
ConfirmedAt *time.Time `json:"confirmed_at,omitempty"`
}
MeshRotationResource mirrors internal/api's meshRotationResource: one key rotation's tracked confirmation state.
type MeshStatusResource ¶ added in v0.2.0
type MeshStatusResource struct {
Enabled bool `json:"enabled"`
Backend string `json:"backend,omitempty"`
Interface string `json:"interface,omitempty"`
LocalNodeID string `json:"local_node_id,omitempty"`
PublicKey string `json:"public_key,omitempty"`
MeshAddress string `json:"mesh_address,omitempty"`
ListenPort int `json:"listen_port,omitempty"`
Peers []MeshPeerResource `json:"peers"`
Rotation *MeshRotationResource `json:"rotation,omitempty"`
}
MeshStatusResource mirrors internal/api's meshStatusResource (GET /api/v1/mesh). Enabled is false only via a 501 response (mesh networking not turned on for this control plane at all), which GetMeshStatus surfaces as an error rather than a false-valued response, so in practice a caller that got a MeshStatusResource back at all always has Enabled true; the field is kept for parity with the wire response rather than assumed away.
type MetricPointResource ¶
type MetricPointResource struct {
Timestamp time.Time `json:"timestamp"`
Value float64 `json:"value"`
Count int `json:"count"`
}
MetricPointResource mirrors internal/api's metricPoint (internal/api/metrics.go): one aggregated bucket of a queried metric.
type MoveAppWithVolumesRequest ¶ added in v0.2.0
type MoveAppWithVolumesRequest struct {
NodeID string `json:"node_id"`
}
MoveAppWithVolumesRequest mirrors internal/api's moveAppWithVolumesRequest, the same node_id shape SetAppNodeRequest establishes.
type NetworkResource ¶
type NetworkResource struct {
ContainerPort int `json:"container_port"`
HostPort int `json:"host_port,omitempty"`
Running bool `json:"running"`
// FallbackURL is the zero-config sslip.io URL this app is reachable
// at when it has no operator-configured domain and this control
// plane's own APP_PUBLIC_HOST is a real, publicly routable IP; see
// internal/api's own networkResource.FallbackURL doc comment.
FallbackURL string `json:"fallback_url,omitempty"`
}
NetworkResource mirrors internal/api's networkResource (internal/api/network.go): the live traffic path, container's declared port plus whatever host port Docker currently has bound.
type NodeAlertStatusResource ¶
type NodeAlertStatusResource struct {
PatchStatus string `json:"patch_status"`
NodeDiskSpace string `json:"node_disk_space"`
NodeResourceUsage string `json:"node_resource_usage"`
}
NodeAlertStatusResource mirrors internal/api's nodeAlertStatusResource (internal/api/nodes.go): each field is "ok", "firing", or "unknown", a live re-evaluation of this one node's own standing for that node-scoped, platform-wide alert kind, not a rule's stored aggregate value.
type NodeMetricsResource ¶ added in v0.2.0
type NodeMetricsResource struct {
Metric string `json:"metric"`
Points []MetricPointResource `json:"points"`
ResourceCount int `json:"resource_count"`
}
NodeMetricsResource mirrors internal/api's nodeMetricsResponse (internal/api/node_metrics.go): AppMetricsResource's fields plus ResourceCount, how many of the node's placed services actually contributed a sample to this response.
type NodePatchStatusResource ¶
type NodePatchStatusResource struct {
Checked bool `json:"checked"`
Total int `json:"total"`
Security int `json:"security"`
CheckedAt *time.Time `json:"checked_at,omitempty"`
}
NodePatchStatusResource mirrors internal/api's nodePatchStatusResponse (internal/api/node_patch_status.go). Checked distinguishes "never checked" (Total/Security both zero-valued and meaningless) from checked-and-genuinely-up-to-date (Checked true, Total 0): callers must branch on Checked first.
type NodeResource ¶
type NodeResource struct {
ID string `json:"id"`
Name string `json:"name"`
Address string `json:"address,omitempty"`
Status string `json:"status"`
CertFingerprint string `json:"cert_fingerprint,omitempty"`
JoinedAt *time.Time `json:"joined_at,omitempty"`
LastSeenAt *time.Time `json:"last_seen_at,omitempty"`
// Schedulable is the cordon state: false means the node refuses new
// placements while whatever's already running there keeps running.
Schedulable bool `json:"schedulable"`
AcceptsAppWorkloads bool `json:"accepts_app_workloads"`
AcceptsBuildWorkloads bool `json:"accepts_build_workloads"`
CreatedAt time.Time `json:"created_at"`
// AlertStatus is only set by GET /api/v1/nodes/{id} (a single-node
// fetch), never the list endpoint; nil when telemetry isn't
// configured on the control plane.
AlertStatus *NodeAlertStatusResource `json:"alert_status,omitempty"`
// IsLocal is true for the one node running the control plane process
// itself, the only node with real disk/memory host metrics.
IsLocal bool `json:"is_local"`
}
NodeResource mirrors internal/api's nodeResource (internal/api/nodes.go).
type NodeResourceUsageResource ¶ added in v0.2.0
type NodeResourceUsageResource struct {
NodeID string `json:"node_id"`
Name string `json:"name"`
IsLocal bool `json:"is_local"`
CPUPercent *float64 `json:"cpu_percent,omitempty"`
MemoryUsageBytes *float64 `json:"memory_usage_bytes,omitempty"`
MemoryTotalBytes *float64 `json:"memory_total_bytes,omitempty"`
DiskUsedBytes *float64 `json:"disk_used_bytes,omitempty"`
DiskTotalBytes *float64 `json:"disk_total_bytes,omitempty"`
}
NodeResourceUsageResource mirrors internal/api's nodeResourceUsageResource (internal/api/node_resource_usage.go): one node's latest known CPU/memory/disk reading. CPUPercent/ MemoryUsageBytes are the sum of every placed service's latest sample, not a true host read; MemoryTotalBytes/DiskUsedBytes/DiskTotalBytes are real host reads but (today) only ever populated for the node running the control plane itself. A nil field means no data yet, not zero usage.
type NotificationChannelResource ¶
type NotificationChannelResource struct {
ID string `json:"id"`
Name string `json:"name"`
Kind string `json:"kind"`
NotifyURL string `json:"notify_url"`
Enabled bool `json:"enabled"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
}
NotificationChannelResource mirrors internal/api's notificationChannelResource (internal/api/notification_channels.go).
type NotificationDeliveryResource ¶
type NotificationDeliveryResource struct {
ID string `json:"id"`
ChannelID string `json:"channel_id"`
Trigger string `json:"trigger"`
Success bool `json:"success"`
Error string `json:"error,omitempty"`
CreatedAt string `json:"created_at"`
}
NotificationDeliveryResource mirrors internal/api's notificationDeliveryResource (internal/api/notification_channels.go).
type OAuthProviderSettingsResource ¶ added in v0.2.0
type OAuthProviderSettingsResource struct {
Provider string `json:"provider"`
Enabled bool `json:"enabled"`
ClientID string `json:"client_id,omitempty"`
AllowedEmailDomain string `json:"allowed_email_domain,omitempty"`
IssuerURL string `json:"issuer_url,omitempty"`
DisplayName string `json:"display_name,omitempty"`
HasClientSecret bool `json:"has_client_secret"`
}
OAuthProviderSettingsResource mirrors internal/api's oauthProviderSettingsResource (internal/api/oauth_settings.go): GET/PUT /api/v1/settings/oauth[/{provider}]'s wire shape. ClientSecret is never included in a response, only HasClientSecret.
type OnboardingStateResource ¶
type OnboardingStateResource struct {
Completed bool `json:"completed"`
CurrentStep string `json:"current_step,omitempty"`
Steps map[string]string `json:"steps,omitempty"`
}
OnboardingStateResource mirrors internal/api's onboardingStateResource (internal/api/onboarding.go).
type Option ¶
type Option func(*Client)
Option configures a Client at construction time. See WithUserAgent.
func WithUserAgent ¶
WithUserAgent sets the User-Agent header on every request this Client sends, so the control plane's audit log (internal/api's clientKindFromUserAgent) can tell which real client made a call rather than lumping every bearer-token caller into one bucket. Each of this project's own callers passes its own value: cmd/levelrail-cli sets "levelrail-cli/<version>", cmd/levelrail-mcp sets "levelrail-mcp/<version>".
type OrganizationResource ¶
type OrganizationResource struct {
ID string `json:"id"`
Name string `json:"name"`
CreatedAt string `json:"created_at"`
}
OrganizationResource mirrors internal/api's organizationResource (internal/api/organizations.go).
type OrphanedVolumeResource ¶ added in v0.2.0
type OrphanedVolumeResource struct {
Name string `json:"name"`
SizeBytes *int64 `json:"size_bytes,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
}
OrphanedVolumeResource mirrors internal/api's orphanedVolumeResource: one of this instance's own named Docker volumes that current desired state no longer references. SizeBytes is nil when the volume driver didn't report a size, never a fabricated 0.
type PITRRestoreHistoryResource ¶ added in v0.2.0
type PITRRestoreHistoryResource struct {
ID string `json:"id"`
DatabaseName string `json:"database_name"`
BaseBackupHistoryID string `json:"base_backup_history_id"`
TargetTimestamp string `json:"target_timestamp"`
Status string `json:"status"`
Error string `json:"error,omitempty"`
StartedAt string `json:"started_at"`
FinishedAt string `json:"finished_at,omitempty"`
}
PITRRestoreHistoryResource mirrors internal/api's pitrRestoreHistoryResource: GET/POST .../pitr-restore(s).
type PITRStatusResource ¶ added in v0.2.0
type PITRStatusResource struct {
Enabled bool `json:"enabled"`
EnabledAt string `json:"enabled_at,omitempty"`
HasBaseBackup bool `json:"has_base_backup"`
WindowStart string `json:"window_start,omitempty"`
WindowEnd string `json:"window_end,omitempty"`
WindowError string `json:"window_error,omitempty"`
}
PITRStatusResource mirrors internal/api's pitrStatusResource (internal/api/pitr.go): GET /api/v1/databases/{name}/pitr.
type PolicyAttachmentResource ¶
type PolicyAttachmentResource struct {
ID string `json:"id"`
PolicyID string `json:"policy_id"`
PrincipalType string `json:"principal_type"`
PrincipalID string `json:"principal_id"`
CreatedAt time.Time `json:"created_at"`
}
PolicyAttachmentResource mirrors internal/api's policyAttachmentResource.
type PolicyRequest ¶
type PolicyRequest struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
Document json.RawMessage `json:"document"`
}
PolicyRequest mirrors internal/api's policyRequest, the body for both CreatePolicy and UpdatePolicy.
type PolicyResource ¶
type PolicyResource struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Document json.RawMessage `json:"document"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
PolicyResource mirrors internal/api's policyResource (internal/api/iam_handlers.go).
type PreviewEnvironmentResource ¶
type PreviewEnvironmentResource struct {
PRNumber int `json:"pr_number"`
PreviewAppID string `json:"preview_app_id"`
Branch string `json:"branch"`
HeadSHA string `json:"head_sha"`
Domain string `json:"domain,omitempty"`
Status string `json:"status"`
StatusReason string `json:"status_reason,omitempty"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
Stale bool `json:"stale"`
// EphemeralDatabases mirrors internal/api's own EphemeralDatabases
// field: every disposable, preview-scoped database instance
// provisioned for this preview (spec.Database.EphemeralInPreviews),
// empty when none were declared or none opted in.
EphemeralDatabases []PreviewEphemeralDatabaseResource `json:"ephemeral_databases,omitempty"`
}
PreviewEnvironmentResource mirrors internal/api's previewEnvironmentResource (internal/api/preview_environments_handlers.go).
type PreviewEphemeralDatabaseResource ¶ added in v0.2.0
type PreviewEphemeralDatabaseResource struct {
SourceKey string `json:"source_key"`
DatabaseName string `json:"database_name"`
Engine string `json:"engine"`
Version string `json:"version"`
Status string `json:"status"`
StatusReason string `json:"status_reason,omitempty"`
Ready AppStatusSummary `json:"ready"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
}
PreviewEphemeralDatabaseResource mirrors internal/api's previewEphemeralDatabaseResource (preview_environments_handlers.go). Ready reuses AppStatusSummary's exact shape: it's computed the same way, from the same database.Controller reconcile conditions GET /api/v1/databases already summarizes per database.
type PreviewSettingsResource ¶
type PreviewSettingsResource struct {
Enabled bool `json:"enabled"`
PostPRComments bool `json:"post_pr_comments"`
}
PreviewSettingsResource mirrors internal/api's previewSettingsResource: the resulting state of both preview-settings toggles after a SetPreviewSettingsRequest is applied.
type ProfileSummary ¶
ProfileSummary is ListProfiles' element type: a profile's name and API URL, deliberately never its token. See ListProfiles.
func ListProfiles ¶
func ListProfiles(prog string) ([]ProfileSummary, error)
ListProfiles returns every profile section configured in prog's credentials file, in the order they first appear, each with its API URL but never its token: see ProfileSummary. Returns a nil slice, no error, for a missing file, the same "nothing configured" shape ReadCredentialsFile's own doc comment describes.
type ProjectLifecycleResult ¶ added in v0.2.0
type ProjectLifecycleResult struct {
SucceededApps []string `json:"succeeded_apps"`
SucceededDatabases []string `json:"succeeded_databases"`
FailedApps []string `json:"failed_apps,omitempty"`
FailedDatabases []string `json:"failed_databases,omitempty"`
}
ProjectLifecycleResult mirrors internal/api's projectLifecycleResult: the response for StopProject/StartProject, which apps and databases in the project succeeded or failed the requested state change.
type ProjectResource ¶
type ProjectResource struct {
ID string `json:"id"`
Name string `json:"name"`
CreatedAt string `json:"created_at"`
OrgID string `json:"org_id,omitempty"`
}
ProjectResource mirrors internal/api's projectResource (internal/api/projects.go). OrgID is empty when the project isn't filed under any organization.
type ProjectRestartResponse ¶ added in v0.2.0
type ProjectRestartResponse struct {
RestartedCount int `json:"restarted_count"`
Apps []string `json:"apps"`
Failed []string `json:"failed,omitempty"`
}
ProjectRestartResponse mirrors internal/api's projectRestartResponse (internal/api/project_restart.go): which apps a bulk restart succeeded or failed on.
type PromoteAppRequest ¶
type PromoteAppRequest struct {
To string `json:"to"`
Target string `json:"target,omitempty"`
Confirm bool `json:"confirm,omitempty"`
}
PromoteAppRequest mirrors internal/api's promoteTriggerRequest: POST /api/v1/apps/{name}/promote's body. Target is optional, the same "auto-discover the sole candidate, or disambiguate" contract PromotePreview's own Target query param has.
type PromotePreviewResource ¶
type PromotePreviewResource struct {
SourceApp string `json:"source_app"`
TargetApp string `json:"target_app"`
Environment EnvironmentResource `json:"environment"`
From PromotePreviewSide `json:"from"`
To PromotePreviewSide `json:"to"`
Changes []DeployCompareField `json:"changes"`
UnsnapshottedFields []string `json:"unsnapshotted_fields"`
Note string `json:"note"`
}
PromotePreviewResource mirrors internal/api's promotePreviewResource, GET /api/v1/apps/{name}/promote/preview's response.
type PromotePreviewSide ¶
PromotePreviewSide mirrors internal/api's promotePreviewSide (internal/api/promote.go): one side of a promotion preview, always live desired state (there is no DeployID/CommitSHA/Status to show).
type PurgeAuditLogResult ¶
type PurgeAuditLogResult struct {
Deleted int64 `json:"deleted"`
}
PurgeAuditLogResult is POST /api/v1/audit-log/purge's response shape (internal/api/audit_retention.go's purgeAuditLogResponse).
type RegistryCredentialResource ¶
type RegistryCredentialResource struct {
ID string `json:"id"`
Name string `json:"name"`
RegistryHost string `json:"registry_host"`
Username string `json:"username"`
CreatedAt string `json:"created_at"`
ExpiresAt *time.Time `json:"expires_at,omitempty"`
ExpiryStatus string `json:"expiry_status,omitempty"`
}
RegistryCredentialResource mirrors internal/api's registryCredentialResource (internal/api/registry_credentials.go). No password field, the same write-only convention BackupTargetResource uses for its own credentials. ExpiresAt/ExpiryStatus are operator-set metadata, not something the platform infers from the credential itself; ExpiryStatus is "healthy"/"expiring_soon"/"expired", empty when no expiry was set.
type RegistryRepositoriesResource ¶ added in v0.2.0
type RegistryRepositoriesResource struct {
Repositories []string `json:"repositories"`
}
RegistryRepositoriesResource mirrors internal/api's registryRepositoriesResponse (internal/api/registry_catalog.go): GET /api/v1/registry/repositories's wire shape.
type RegistrySettingsResource ¶
type RegistrySettingsResource struct {
Enabled bool `json:"enabled"`
Host string `json:"host,omitempty"`
Username string `json:"username,omitempty"`
HasCredentials bool `json:"has_credentials"`
Status string `json:"status"`
Message string `json:"message,omitempty"`
Password string `json:"password,omitempty"`
}
RegistrySettingsResource mirrors internal/api's registrySettingsResource (internal/api/registry_settings.go): GET/PUT/DELETE /api/v1/settings/registry's wire shape. Password is write-once: it is only ever populated in the response to a PUT call that generates a fresh credential (the registry's first enable), empty every other time.
type RegistryTagsResource ¶ added in v0.2.0
type RegistryTagsResource struct {
Repository string `json:"repository"`
Tags []string `json:"tags"`
}
RegistryTagsResource mirrors internal/api's registryTagsResponse: GET /api/v1/registry/tags's wire shape.
type RejectDeployApprovalRequest ¶ added in v0.2.0
type RejectDeployApprovalRequest struct {
Reason string `json:"reason,omitempty"`
}
RejectDeployApprovalRequest mirrors internal/api's rejectDeployApprovalRequest (POST .../deploy-approvals/{id}/reject).
type ReplayWebhookDeliveryResult ¶
type ReplayWebhookDeliveryResult struct {
Status int `json:"status"`
Message string `json:"message"`
}
ReplayWebhookDeliveryResult mirrors internal/api's replayWebhookDeliveryResult: the status/message a replayed delivery's re-run processing produced.
type ResourceRecommendationResource ¶
type ResourceRecommendationResource struct {
ServiceName string `json:"service_name"`
LookbackWindow string `json:"lookback_window"`
Memory DimensionRecommendationResource `json:"memory"`
CPU DimensionRecommendationResource `json:"cpu"`
OOMDetectedAt string `json:"oom_detected_at,omitempty"`
OOMExcerpt string `json:"oom_excerpt,omitempty"`
}
ResourceRecommendationResource mirrors internal/api's resourceRecommendationResource: the shared response shape for both GET /api/v1/apps/{name}/resource-recommendation (internal/api/resource_recommendation.go) and GET /api/v1/databases/{name}/resource-recommendation (internal/api/database_resource_recommendation.go), a deterministic memory/CPU right-sizing suggestion synthesized from internal/rightsizing over the resource's own historical usage samples, never from an external model, and never applied automatically. ServiceName holds the app or database name either way.
type RestoreHistoryResource ¶
type RestoreHistoryResource struct {
ID string `json:"id"`
DatabaseName string `json:"database_name,omitempty"`
ServiceName string `json:"service_name,omitempty"`
VolumeName string `json:"volume_name,omitempty"`
BackupHistoryID string `json:"backup_history_id"`
Status string `json:"status"`
Error string `json:"error,omitempty"`
StartedAt string `json:"started_at"`
FinishedAt string `json:"finished_at,omitempty"`
}
RestoreHistoryResource mirrors internal/api's restoreHistoryResource (internal/api/restore.go). ServiceName/VolumeName mirror BackupHistoryResource's own identical fields above.
type RoleResource ¶
type RoleResource struct {
Name string `json:"name"`
Description string `json:"description"`
Abilities []string `json:"abilities"`
}
RoleResource mirrors internal/api's Role (internal/api/roles.go).
type RotateKeyResponse ¶ added in v0.2.0
type RotateKeyResponse struct {
NodeID string `json:"node_id"`
OldPublicKey string `json:"old_public_key"`
NewPublicKey string `json:"new_public_key"`
}
RotateKeyResponse mirrors internal/api's rotateKeyResponse (POST /api/v1/nodes/{id}/mesh/rotate-key).
type RotateMasterKeyRequest ¶
type RotateMasterKeyRequest struct {
NewMasterKey string `json:"newMasterKey"`
}
RotateMasterKeyRequest mirrors internal/api's rotateMasterKeyRequest: the new master key, read from a file or stdin by the CLI so it never appears as a bare command-line argument.
type RotateMasterKeyResult ¶
type RotateMasterKeyResult struct {
RotatedAt time.Time `json:"rotatedAt"`
PersistedToFile bool `json:"persistedToFile"`
Warning string `json:"warning,omitempty"`
}
RotateMasterKeyResult mirrors internal/api's rotateMasterKeyResponse. Warning is non-empty exactly when the operator has a required follow-up before the control plane's next restart: either the master key is env-sourced (update APP_MASTER_KEY out of band) or the file write itself failed (update the key file by hand).
type Route53DNSResource ¶ added in v0.2.0
type Route53DNSResource struct {
Enabled bool `json:"enabled"`
Region string `json:"region,omitempty"`
HostedZoneID string `json:"hosted_zone_id,omitempty"`
HasAccessKeyID bool `json:"has_access_key_id"`
HasSecretAccessKey bool `json:"has_secret_access_key"`
}
Route53DNSResource mirrors internal/api's route53DNSResource (internal/api/route53_dns.go): GET/PUT/DELETE /api/v1/settings/route53-dns's wire shape. Neither credential half ever appears here in either direction. A second, independent ACME DNS-01 provider from CloudflareDNSResource, not a replacement.
type ScheduledTaskRequest ¶
type ScheduledTaskRequest struct {
Command []string `json:"command"`
Schedule string `json:"schedule"`
Enabled bool `json:"enabled"`
// ConcurrencyPolicy is one of "allow", "forbid", "replace", or empty
// (server-side default "allow").
ConcurrencyPolicy string `json:"concurrency_policy,omitempty"`
}
ScheduledTaskRequest mirrors the fields internal/api's scheduledTaskResource actually reads from a create/update request body (Command, Schedule, Enabled); ID and ServiceName always come from the URL, never the body.
type ScheduledTaskResource ¶
type ScheduledTaskResource struct {
ID string `json:"id,omitempty"`
ServiceName string `json:"service_name,omitempty"`
Command []string `json:"command"`
Schedule string `json:"schedule"`
Enabled bool `json:"enabled"`
// ConcurrencyPolicy is one of "allow", "forbid", "replace": what
// happens when this task's next due run finds a previous invocation
// of itself still executing. Empty on a request defaults to "allow"
// server-side.
ConcurrencyPolicy string `json:"concurrency_policy"`
LastRunAt *time.Time `json:"last_run_at,omitempty"`
LastRunStatus string `json:"last_run_status,omitempty"`
LastRunOutput string `json:"last_run_output,omitempty"`
// ConsecutiveFailures mirrors internal/api's own field: what a
// kind=scheduled_task_failure alert rule watches.
ConsecutiveFailures int `json:"consecutive_failures"`
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
}
ScheduledTaskResource mirrors internal/api's scheduledTaskResource (internal/api/scheduled_tasks.go). Command is a real argv (no shell), and LastRun* describe only the single most recent run in place: there is no separate run-history endpoint.
type SecretKeyResource ¶
type SecretKeyResource struct {
Key string `json:"key"`
Locked bool `json:"locked"`
UpdatedAt string `json:"updated_at"`
Stale bool `json:"stale"`
}
SecretKeyResource mirrors internal/api's secretKeyResource (internal/api/secrets.go): a secret's key and locked state, never its value. UpdatedAt is RFC3339, and Stale reports whether it's older than the effective secret rotation warning threshold.
type ServiceHealth ¶
type ServiceHealth struct {
Readiness *ServiceProbe `json:"readiness,omitempty"`
Liveness *ServiceProbe `json:"liveness,omitempty"`
ReadyTimeout int64 `json:"ready_timeout,omitempty"`
}
ServiceHealth mirrors internal/api's appResource.Health field.
type ServiceHooks ¶
type ServiceHooks struct {
PreDeploy string `json:"pre_deploy,omitempty"`
PostDeploy string `json:"post_deploy,omitempty"`
}
ServiceHooks mirrors internal/api's appResource.Hooks field (store.ServiceHooks' JSON encoding).
type ServiceProbe ¶
type ServiceProbe struct {
Path string `json:"path"`
Scheme string `json:"scheme,omitempty"`
Host string `json:"host,omitempty"`
TLSSkipVerify bool `json:"tls_skip_verify,omitempty"`
FollowRedirects *bool `json:"follow_redirects,omitempty"`
ExpectedStatus string `json:"expected_status,omitempty"`
Exec []string `json:"exec,omitempty"`
Interval int64 `json:"interval,omitempty"`
Timeout int64 `json:"timeout,omitempty"`
Failures int `json:"failures,omitempty"`
}
ServiceProbe mirrors one of AppResource.Health's two probes (readiness or liveness).
type ServiceResources ¶
type ServiceResources struct {
MemoryBytes int64 `json:"memory_bytes,omitempty"`
NanoCPUs int64 `json:"nano_cpus,omitempty"`
SwapMemoryBytes int64 `json:"swap_memory_bytes,omitempty"`
CPUSetCPUs string `json:"cpuset_cpus,omitempty"`
}
ServiceResources mirrors internal/api's appResource.Resources field (internal/api/apps.go), which is itself store.DesiredService's own JSON encoding: bytes and nanoseconds, not app.yaml's human-friendly "512Mi"/"5s" strings. Redeclared here, not imported from internal/store or internal/api, so this package depends only on the documented wire contract, never on the control plane's internal Go types. ServiceProbe and ServiceHealth below share that same reasoning.
type ServiceTemplateDetail ¶
type ServiceTemplateDetail struct {
ID string `json:"id"`
Name string `json:"name"`
Slogan string `json:"slogan"`
Category string `json:"category"`
DocumentationURL string `json:"documentation_url"`
Compose string `json:"compose"`
RecommendedMemoryBytes int64 `json:"recommended_memory_bytes,omitempty"`
}
ServiceTemplateDetail mirrors internal/api's serviceTemplateDetail: GET /api/v1/service-templates/{id}'s response, including the full compose.yaml body.
type ServiceTemplateListItem ¶
type ServiceTemplateListItem struct {
ID string `json:"id"`
Name string `json:"name"`
Slogan string `json:"slogan"`
Category string `json:"category"`
DocumentationURL string `json:"documentation_url"`
RecommendedMemoryBytes int64 `json:"recommended_memory_bytes,omitempty"`
}
ServiceTemplateListItem mirrors internal/api's serviceTemplateListItem (internal/api/service_templates.go): one catalog entry from GET /api/v1/service-templates, without the full Compose body.
type SessionInfoResource ¶
type SessionInfoResource struct {
Username string `json:"username"`
ExpiresAt string `json:"expires_at"`
}
SessionInfoResource mirrors internal/api's sessionInfoResponse (internal/api/account.go)'s wire shape. GetSession below sends this over a plain bearer-token request, which handleGetSession's own doc comment says it will never honor ("deliberately not requireAbility: a bearer token has no session of its own to report on").
type SetAppDatabaseRequest ¶
type SetAppDatabaseRequest struct {
DatabaseName string `json:"database_name"`
EnvVar string `json:"env_var,omitempty"`
Field string `json:"field,omitempty"`
}
SetAppDatabaseRequest mirrors internal/api's setAppDatabaseRequest (apps_database.go). EnvVar and Field are both optional: the server defaults them ("DATABASE_URL"/"url") when left blank.
type SetAppEgressPolicyRequest ¶ added in v0.2.0
type SetAppEgressPolicyRequest struct {
Mode string `json:"mode"`
Allow []AppEgressAllow `json:"allow"`
}
SetAppEgressPolicyRequest mirrors internal/api's setEgressPolicyRequest (apps_egress.go). Mode must be "allowlist" with at least one Allow entry; the server rejects anything else.
type SetAppEnvironmentRequest ¶
type SetAppEnvironmentRequest struct {
EnvironmentID string `json:"environment_id"`
}
SetAppEnvironmentRequest mirrors internal/api's setAppEnvironmentRequest. An empty EnvironmentID clears the assignment.
type SetAppNodeRequest ¶ added in v0.2.0
type SetAppNodeRequest struct {
NodeID string `json:"node_id"`
}
SetAppNodeRequest mirrors internal/api's setAppNodeRequest. An empty NodeID moves the app back to the control plane's own local node.
type SetAppProjectRequest ¶
type SetAppProjectRequest struct {
ProjectID string `json:"project_id"`
}
SetAppProjectRequest mirrors internal/api's setAppProjectRequest. An empty ProjectID clears the assignment.
type SetAppStorageRequest ¶ added in v0.2.0
type SetAppStorageRequest struct {
StorageTargetID string `json:"storage_target_id"`
}
SetAppStorageRequest mirrors internal/api's setAppStorageRequest: PUT /api/v1/apps/{name}/storage's request body.
type SetAutoRollbackRequest ¶ added in v0.2.0
type SetAutoRollbackRequest struct {
Enabled bool `json:"enabled"`
}
SetAutoRollbackRequest mirrors internal/api's setAutoRollbackRequest (deploys.go): PUT /api/v1/apps/{name}/auto-rollback's body.
type SetBackupScheduleRequest ¶
type SetBackupScheduleRequest struct {
TargetID string `json:"target_id"`
Schedule string `json:"schedule"`
Retain int `json:"retain,omitempty"`
RetainDays int `json:"retain_days,omitempty"`
}
SetBackupScheduleRequest mirrors internal/api's setBackupScheduleRequest.
type SetDatabaseProjectRequest ¶
type SetDatabaseProjectRequest struct {
ProjectID string `json:"project_id"`
}
SetDatabaseProjectRequest mirrors internal/api's setDatabaseProjectRequest. An empty ProjectID clears the assignment.
type SetDatabasePublicAccessRequest ¶
type SetDatabasePublicAccessRequest struct {
Port int `json:"port,omitempty"`
BindAddress string `json:"bind_address,omitempty"`
}
SetDatabasePublicAccessRequest mirrors internal/api's setDatabasePublicAccessRequest. Port 0 means auto-assign the next free port. BindAddress empty means the server's own default ("private", loopback only); "public" opts into every interface.
type SetDatabaseResourcesRequest ¶
type SetDatabaseResourcesRequest struct {
Resources *ServiceResources `json:"resources"`
}
SetDatabaseResourcesRequest mirrors internal/api's setDatabaseResourcesRequest.
type SetDomainBasicAuthRequest ¶
type SetDomainBasicAuthRequest struct {
Username string `json:"username"`
Password string `json:"password,omitempty"`
}
SetDomainBasicAuthRequest mirrors internal/api's setDomainBasicAuthRequest. Password empty on an update means "leave the currently stored password unchanged".
type SetDomainErrorPageRequest ¶ added in v0.2.0
type SetDomainErrorPageRequest struct {
StatusCode int `json:"status_code"`
Body string `json:"body"`
}
SetDomainErrorPageRequest mirrors internal/api's setDomainErrorPageRequest: one status-code-to-body upsert at a time.
type SetDomainRedirectRequest ¶ added in v0.2.0
type SetDomainRedirectRequest struct {
TargetURL string `json:"target_url"`
StatusCode int `json:"status_code,omitempty"`
}
SetDomainRedirectRequest mirrors internal/api's setDomainRedirectRequest. StatusCode 0 defaults server-side to 301 (permanent).
type SetDomainTLSCertRequest ¶
SetDomainTLSCertRequest mirrors internal/api's setDomainTLSCertRequest: both fields are required every call, there is no "leave the current certificate unchanged" partial-update case.
type SetDomainWAFRequest ¶ added in v0.2.0
type SetDomainWAFRequest struct {
WAFEnabled bool `json:"waf_enabled"`
WAFMode string `json:"waf_mode,omitempty"`
RateLimitRPS int `json:"rate_limit_rps"`
RateLimitBurst int `json:"rate_limit_burst"`
}
SetDomainWAFRequest mirrors internal/api's setDomainWAFRequest. WAFMode empty defaults server-side to "detect". RateLimitRPS 0 means rate limiting is off, independent of WAFEnabled.
type SetExecAccessRequest ¶ added in v0.2.0
type SetExecAccessRequest struct {
Enabled bool `json:"enabled"`
}
SetExecAccessRequest mirrors internal/api's setExecAccessRequest (exec.go): PUT /api/v1/apps/{name}/exec-access's body.
type SetGitSourceRequest ¶
type SetGitSourceRequest struct {
RepoURL string `json:"repo_url"`
Branch string `json:"branch,omitempty"`
BuildType string `json:"build_type,omitempty"`
BuildPath string `json:"build_path,omitempty"`
Token string `json:"token,omitempty"`
TriggerMode string `json:"trigger_mode,omitempty"`
}
SetGitSourceRequest mirrors internal/api's setGitSourceRequest (internal/api/git_sources.go), minus the multi-service Services/ AdditionalServices fields (see GitSourceResource's own doc comment).
type SetLogDrainRequest ¶
type SetLogDrainRequest struct {
Type string `json:"type"`
Target string `json:"target"`
Enabled bool `json:"enabled"`
}
SetLogDrainRequest mirrors internal/api's setLogDrainRequest.
type SetNodeWorkloadsRequest ¶
type SetNodeWorkloadsRequest struct {
AcceptsAppWorkloads bool `json:"accepts_app_workloads"`
AcceptsBuildWorkloads bool `json:"accepts_build_workloads"`
}
SetNodeWorkloadsRequest mirrors internal/api's setNodeWorkloadsRequest: a full replace of both fields, not a partial patch.
type SetPreviewSettingsRequest ¶
type SetPreviewSettingsRequest struct {
Enabled *bool `json:"enabled,omitempty"`
PostPRComments *bool `json:"post_pr_comments,omitempty"`
}
SetPreviewSettingsRequest mirrors internal/api's setPreviewSettingsRequest (preview_environments_handlers.go). Both fields are optional pointers: nil means "leave the currently stored value unchanged," so SetPreviewEnabled and SetPreviewPostPRComments (client.go) can each touch just their own toggle without resetting the other back to false.
type SetProjectOrganizationRequest ¶
type SetProjectOrganizationRequest struct {
OrgID string `json:"org_id"`
}
SetProjectOrganizationRequest mirrors internal/api's setProjectOrganizationRequest. An empty OrgID clears the assignment.
type SetSecretLockRequest ¶
type SetSecretLockRequest struct {
Locked bool `json:"locked"`
}
SetSecretLockRequest mirrors internal/api's setSecretLockRequest (internal/api/secrets.go).
type SetSecretRequest ¶
type SetSecretRequest struct {
Value string `json:"value"`
OverwriteLocked bool `json:"overwrite_locked"`
}
SetSecretRequest mirrors internal/api's setSecretRequest (internal/api/secrets.go).
type SetSharedEnvSecretRequest ¶ added in v0.2.0
type SetSharedEnvSecretRequest struct {
}
SetSharedEnvSecretRequest mirrors internal/api's setSharedEnvSecretRequest (internal/api/shared_env_secrets.go).
type SetVolumeBackupScheduleRequest ¶
type SetVolumeBackupScheduleRequest struct {
TargetID string `json:"target_id"`
Schedule string `json:"schedule"`
Retain int `json:"retain,omitempty"`
RetainDays int `json:"retain_days,omitempty"`
}
SetVolumeBackupScheduleRequest mirrors internal/api's setVolumeBackupScheduleRequest.
type SetupStatusResource ¶ added in v0.2.0
type SetupStatusResource struct {
NeedsSetup bool `json:"needs_setup"`
}
SetupStatusResource mirrors GET /api/v1/auth/setup-status.
type SharedEnvVarResource ¶ added in v0.2.0
type SharedEnvVarResource struct {
}
SharedEnvVarResource mirrors internal/api's sharedEnvVarResource (internal/api/shared_env_secrets.go): one shared env var at the project/organization/environment tier. Value is always "" for a secret-marked entry, matching SecretKeyResource's own "never a value" rule above. UpdatedAt/Stale are only populated when Secret is true, see sharedEnvVarResource's own doc comment.
type SlowQueryEntryResource ¶ added in v0.2.0
type SlowQueryEntryResource struct {
Timestamp time.Time `json:"timestamp"`
DurationMs float64 `json:"duration_ms"`
Query string `json:"query"`
RowsExamined int64 `json:"rows_examined,omitempty"`
}
SlowQueryEntryResource mirrors internal/api's slowQueryEntryResource (internal/api/database_slow_queries.go).
type StaticSiteResource ¶ added in v0.2.0
StaticSiteResource mirrors internal/api's staticSiteResource (internal/api/static_sites.go): one entry of GET /api/v1/static-sites.
type SweepPreviewEnvironmentsResult ¶
type SweepPreviewEnvironmentsResult struct {
Swept int `json:"swept"`
}
SweepPreviewEnvironmentsResult mirrors internal/api's sweepPreviewEnvironmentsResponse (preview_environments_sweep.go).
type SystemDoctorResource ¶
type SystemDoctorResource struct {
OK bool `json:"ok"`
Checks []DoctorCheckResource `json:"checks"`
}
SystemDoctorResource mirrors internal/api's systemDoctorResponse (internal/api/doctor.go): the "levelrail-cli doctor" preflight bundle, a superset of SystemStatusResource above. OK is false only when at least one check's Status is "fail"; "warn" doesn't affect it.
type SystemPruneResult ¶ added in v0.2.0
type SystemPruneResult struct {
ContainersRemoved []string `json:"containers_removed"`
ContainersReclaimedBytes uint64 `json:"containers_reclaimed_bytes"`
ImagesRemoved []string `json:"images_removed"`
ImagesReclaimedBytes uint64 `json:"images_reclaimed_bytes"`
VolumesRemoved []string `json:"volumes_removed"`
VolumesReclaimedBytes uint64 `json:"volumes_reclaimed_bytes"`
BuildCacheReclaimedBytes uint64 `json:"build_cache_reclaimed_bytes"`
Errors []string `json:"errors,omitempty"`
}
SystemPruneResult mirrors internal/api's systemPruneResponse (internal/api/system_prune.go): everything POST /system/prune removed and how much space came back, per resource kind, plus any per-stage error that didn't stop the rest.
type SystemStatusResource ¶
type SystemStatusResource struct {
SecretsConfigured bool `json:"secrets_configured"`
TelemetryConfigured bool `json:"telemetry_configured"`
AlertsConfigured bool `json:"alerts_configured"`
DataDirTotalBytes int64 `json:"data_dir_total_bytes,omitempty"`
DataDirFreeBytes int64 `json:"data_dir_free_bytes,omitempty"`
DockerConnected bool `json:"docker_connected"`
DockerError string `json:"docker_error,omitempty"`
}
SystemStatusResource mirrors internal/api's systemStatusResponse (internal/api/status.go): DockerConnected/DockerError are this control plane's own local Docker daemon reachability, not a per-node signal (see docker_connected's own doc comment on internal/api/status.go for why: multi-node Docker reachability forwarding isn't wired yet).
type TagAppResource ¶ added in v0.2.0
type TagAppResource struct {
Name string `json:"name"`
}
TagAppResource mirrors internal/api's tagAppResource: GET /api/v1/tags/{id}/apps' wire shape.
type TagResource ¶ added in v0.2.0
type TagResource struct {
ID string `json:"id"`
Name string `json:"name"`
CreatedAt string `json:"created_at,omitempty"`
}
TagResource mirrors internal/api's tagResource (internal/api/tags.go).
type TestNotificationChannelRequest ¶
type TestNotificationChannelRequest struct {
Kind string `json:"kind"`
NotifyURL string `json:"notify_url"`
}
TestNotificationChannelRequest mirrors internal/api's testNotificationChannelRequest.
type TriggerBackupRequest ¶
type TriggerBackupRequest struct {
TargetID string `json:"target_id"`
}
TriggerBackupRequest mirrors internal/api's triggerBackupRequest.
type TriggerBaseBackupRequest ¶ added in v0.2.0
type TriggerBaseBackupRequest struct {
TargetID string `json:"target_id"`
}
TriggerBaseBackupRequest mirrors internal/api's triggerBaseBackupRequest.
type TriggerCloneRestoreRequest ¶
type TriggerCloneRestoreRequest struct {
BackupID string `json:"backup_id"`
NewName string `json:"new_name"`
Version string `json:"version,omitempty"`
ProjectID string `json:"project_id,omitempty"`
Resources *ServiceResources `json:"resources,omitempty"`
}
TriggerCloneRestoreRequest mirrors internal/api's cloneRestoreRequest.
type TriggerPITRRestoreRequest ¶ added in v0.2.0
type TriggerPITRRestoreRequest struct {
BaseBackupID string `json:"base_backup_id"`
TargetTime string `json:"target_time"`
}
TriggerPITRRestoreRequest mirrors internal/api's triggerPITRRestoreRequest.
type TriggerRestoreRequest ¶
type TriggerRestoreRequest struct {
BackupID string `json:"backup_id"`
}
TriggerRestoreRequest mirrors internal/api's triggerRestoreRequest.
type TriggerVolumeCloneRestoreRequest ¶
type TriggerVolumeCloneRestoreRequest struct {
BackupID string `json:"backup_id"`
NewVolumeName string `json:"new_volume_name,omitempty"`
}
TriggerVolumeCloneRestoreRequest mirrors internal/api's volumeCloneRestoreRequest.
type UpdateAIAssistantSettingsRequest ¶ added in v0.2.0
type UpdateAIAssistantSettingsRequest struct {
Provider string `json:"provider"`
Model string `json:"model"`
APIKey string `json:"api_key"`
}
UpdateAIAssistantSettingsRequest mirrors internal/api's updateAIAssistantSettingsRequest: PUT /api/v1/settings/ai-assistant's request body. Provider must be "anthropic" server-side; all three fields are required.
type UpdateAlertRuleRequest ¶ added in v0.2.0
type UpdateAlertRuleRequest = CreateAlertRuleRequest
UpdateAlertRuleRequest is the same shape as CreateAlertRuleRequest: handleUpdateAlertRule reuses ruleResource.toRule for both, the same "one request type for create and update" shape ScheduledTaskRequest and FeatureFlagRequest already use for their own resources.
type UpdateBackupTargetRequest ¶
type UpdateBackupTargetRequest struct {
Name string `json:"name"`
Provider string `json:"provider"`
Endpoint string `json:"endpoint,omitempty"`
Region string `json:"region,omitempty"`
Bucket string `json:"bucket"`
AccessKeyID string `json:"access_key_id,omitempty"`
SecretAccessKey string `json:"secret_access_key,omitempty"`
}
UpdateBackupTargetRequest mirrors internal/api's updateBackupTargetRequest. Blank AccessKeyID/SecretAccessKey keep the target's existing stored credentials; set together, they rotate them.
type UpdateCloudflareDNSRequest ¶
type UpdateCloudflareDNSRequest struct {
Enabled bool `json:"enabled"`
Token string `json:"token,omitempty"`
}
UpdateCloudflareDNSRequest mirrors internal/api's updateCloudflareDNSRequest. Token empty on an update means "leave the currently stored token unchanged".
type UpdateCloudflareTunnelRequest ¶
type UpdateCloudflareTunnelRequest struct {
Enabled bool `json:"enabled"`
Token string `json:"token,omitempty"`
}
UpdateCloudflareTunnelRequest mirrors internal/api's updateCloudflareTunnelRequest. Token empty on an update means "leave the currently stored token unchanged".
type UpdateEnvironmentRequest ¶
type UpdateEnvironmentRequest struct {
Protected bool `json:"protected"`
}
UpdateEnvironmentRequest mirrors internal/api's updateEnvironmentRequest (PATCH /api/v1/environments/{id}).
type UpdateNotificationChannelRequest ¶ added in v0.2.0
type UpdateNotificationChannelRequest = CreateNotificationChannelRequest
UpdateNotificationChannelRequest is the same shape as CreateNotificationChannelRequest: handleUpdateNotificationChannel reuses createNotificationChannelRequest.toChannel for both, the same "one request type for create and update" shape ScheduledTaskRequest and FeatureFlagRequest already use for their own resources.
type UpdateOAuthProviderSettingsRequest ¶ added in v0.2.0
type UpdateOAuthProviderSettingsRequest struct {
Enabled bool `json:"enabled"`
ClientID string `json:"client_id"`
ClientSecret string `json:"client_secret,omitempty"`
AllowedEmailDomain string `json:"allowed_email_domain"`
IssuerURL string `json:"issuer_url"`
DisplayName string `json:"display_name"`
}
UpdateOAuthProviderSettingsRequest mirrors internal/api's updateOAuthProviderSettingsRequest: PUT /api/v1/settings/oauth/{provider}'s request body. An empty ClientSecret leaves the currently stored secret unchanged.
type UpdateRegistryCredentialRequest ¶
type UpdateRegistryCredentialRequest struct {
Name string `json:"name"`
RegistryHost string `json:"registry_host"`
Username string `json:"username"`
Password string `json:"password,omitempty"`
ExpiresAt *time.Time `json:"expires_at,omitempty"`
}
UpdateRegistryCredentialRequest mirrors internal/api's updateRegistryCredentialRequest. A blank Password keeps the credential's existing stored password; a non-blank one rotates it.
type UpdateRegistrySettingsRequest ¶
type UpdateRegistrySettingsRequest struct {
Enabled bool `json:"enabled"`
Host string `json:"host,omitempty"`
}
UpdateRegistrySettingsRequest mirrors internal/api's updateRegistrySettingsRequest.
type UpdateRoute53DNSRequest ¶ added in v0.2.0
type UpdateRoute53DNSRequest struct {
Enabled bool `json:"enabled"`
Region string `json:"region,omitempty"`
HostedZoneID string `json:"hosted_zone_id,omitempty"`
AccessKeyID string `json:"access_key_id,omitempty"`
SecretAccessKey string `json:"secret_access_key,omitempty"`
}
UpdateRoute53DNSRequest mirrors internal/api's updateRoute53DNSRequest. AccessKeyID/SecretAccessKey empty on an update means "leave the currently stored credential unchanged"; the two are set together or not at all.
type UpdateUserAbilitiesRequest ¶
type UpdateUserAbilitiesRequest struct {
Abilities []string `json:"abilities,omitempty"`
Role string `json:"role,omitempty"`
}
UpdateUserAbilitiesRequest mirrors internal/api's updateUserAbilitiesRequest, same Role/Abilities precedence as CreateUserRequest.
type UpdateVaultSettingsRequest ¶ added in v0.2.0
type UpdateVaultSettingsRequest struct {
Enabled bool `json:"enabled"`
Address string `json:"address"`
AuthMethod string `json:"auth_method"`
Namespace string `json:"namespace,omitempty"`
RoleID string `json:"role_id,omitempty"`
MountPath string `json:"mount_path,omitempty"`
Credential string `json:"credential,omitempty"`
}
UpdateVaultSettingsRequest mirrors internal/api's updateVaultSettingsRequest. Credential empty on an update means "leave the currently stored credential unchanged".
type UpdatesResource ¶
type UpdatesResource struct {
CurrentVersion string `json:"current_version"`
LatestVersion *string `json:"latest_version"`
UpdateAvailable bool `json:"update_available"`
ReleaseURL *string `json:"release_url"`
PublishedAt *string `json:"published_at"`
}
UpdatesResource mirrors internal/api's updateStatusResource (internal/api/updates.go): the running version compared against GitHub's latest published release. LatestVersion/ReleaseURL/PublishedAt are all nil when no release has ever been published.
type UseGitHubRepoAsSourceResponse ¶ added in v0.2.0
type UseGitHubRepoAsSourceResponse struct {
GitSourceResource
WebhookRegistered bool `json:"webhook_registered"`
WebhookError string `json:"webhook_error,omitempty"`
}
UseGitHubRepoAsSourceResponse mirrors internal/api's useGitHubRepoAsSourceResponse: GitSourceResource plus whether the push webhook was actually auto-registered.
type UseRepoAsSourceRequest ¶ added in v0.2.0
type UseRepoAsSourceRequest struct {
AppName string `json:"app_name"`
Branch string `json:"branch,omitempty"`
BuildType string `json:"build_type,omitempty"`
BuildPath string `json:"build_path,omitempty"`
TriggerMode string `json:"trigger_mode,omitempty"`
}
UseRepoAsSourceRequest mirrors internal/api's useRepoAsSourceRequest: the request body every provider's own use-as-source route shares (github-app, gitlab-app, bitbucket-app).
type UserResource ¶
type UserResource struct {
ID string `json:"id"`
Email string `json:"email"`
DisplayName string `json:"display_name"`
HasPassword bool `json:"has_password"`
Providers []string `json:"providers"`
Abilities []string `json:"abilities"`
Role string `json:"role,omitempty"`
IsFirstUser bool `json:"is_first_user"`
CreatedAt time.Time `json:"created_at"`
LastLoginAt *time.Time `json:"last_login_at,omitempty"`
}
UserResource mirrors internal/api's userResource (internal/api/users.go).
type VaultSettingsResource ¶ added in v0.2.0
type VaultSettingsResource struct {
Enabled bool `json:"enabled"`
Address string `json:"address"`
AuthMethod string `json:"auth_method"`
Namespace string `json:"namespace,omitempty"`
RoleID string `json:"role_id,omitempty"`
MountPath string `json:"mount_path"`
HasCredential bool `json:"has_credential"`
}
VaultSettingsResource mirrors internal/api's vaultSettingsResource (internal/api/vault_settings.go): GET/PUT/DELETE /api/v1/settings/vault's wire shape. The credential (a Vault token or AppRole secret ID, depending on AuthMethod) never appears here in either direction.
type VolumeBackupScheduleResource ¶
type VolumeBackupScheduleResource struct {
ServiceName string `json:"service_name"`
VolumeName string `json:"volume_name"`
TargetID string `json:"target_id,omitempty"`
Schedule string `json:"schedule,omitempty"`
Retain int `json:"retain,omitempty"`
RetainDays int `json:"retain_days,omitempty"`
}
VolumeBackupScheduleResource mirrors internal/api's volumeBackupScheduleResource (internal/api/app_volume_backups.go).
type VolumeCloneRestoreResource ¶
type VolumeCloneRestoreResource struct {
ID string `json:"id"`
SourceServiceName string `json:"source_service_name"`
SourceVolumeName string `json:"source_volume_name"`
NewVolumeName string `json:"new_volume_name"`
BackupHistoryID string `json:"backup_history_id"`
Status string `json:"status"`
Error string `json:"error,omitempty"`
StartedAt string `json:"started_at"`
FinishedAt string `json:"finished_at,omitempty"`
}
VolumeCloneRestoreResource mirrors internal/api's volumeCloneRestoreResource (internal/api/app_volume_clone_restore.go): one "restore as new volume" attempt.
type WebhookDeliveryResource ¶
type WebhookDeliveryResource struct {
ID string `json:"id"`
ServiceName string `json:"service_name"`
Provider string `json:"provider"`
EventType string `json:"event_type"`
SignatureValid bool `json:"signature_valid"`
Matched bool `json:"matched"`
StatusCode int `json:"status_code"`
Payload string `json:"payload"`
PayloadTruncated bool `json:"payload_truncated"`
Error string `json:"error,omitempty"`
ReceivedAt time.Time `json:"received_at"`
}
WebhookDeliveryResource mirrors internal/api's webhookDeliveryResource (internal/api/webhook_deliveries.go): one recorded inbound git-provider webhook request.