Documentation
¶
Overview ¶
Package client is the Go client for the SynCloud API, used by synctl (and published as the Go SDK later, §7.1). It signs requests with an access key, or sends a personal access token as a Bearer credential.
Index ¶
- Constants
- type AccessKey
- type AddressRecord
- type AlertChannel
- type AlertChannelConfig
- type AlertEvent
- type AlertState
- type AutoDeploy
- type Autoscaling
- type BackupConfig
- type BackupObject
- type BackupSettings
- type Branding
- type Build
- type BuildSettings
- type BuildSettingsInput
- type Certificate
- type CertificateImportInput
- type CertificateInfo
- type CertificateRequestInput
- type ChallengeRoute
- type ChallengeServer
- type Client
- func (c *Client) ActiveAlerts(ctx context.Context) ([]AlertState, error)
- func (c *Client) AddServiceDomain(ctx context.Context, project, env, name, host, port string, opts DomainOptions) (DomainCheck, error)
- func (c *Client) AlertEvents(ctx context.Context, limit int) ([]AlertEvent, error)
- func (c *Client) ApplyJob(ctx context.Context, project, env, name string, spec map[string]any) (Job, error)
- func (c *Client) ApplyService(ctx context.Context, project, env, name string, spec ServiceSpec) (Service, error)
- func (c *Client) CancelDeployment(ctx context.Context, project, env, name, id string) (Service, error)
- func (c *Client) CancelRun(ctx context.Context, id string) error
- func (c *Client) ChallengeServer(ctx context.Context) (ChallengeServer, error)
- func (c *Client) CheckDomain(ctx context.Context, host string) (DomainCheck, error)
- func (c *Client) CheckImage(ctx context.Context, project, env, service string) (ImageUpdate, error)
- func (c *Client) CheckReachability(ctx context.Context, from, to, protocol string, port int) (Reachability, error)
- func (c *Client) CleanNodeDocker(ctx context.Context, node, kind string, ids []string, all bool) (NodeDockerCleanResult, error)
- func (c *Client) CloneEnvironment(ctx context.Context, project, name, from string, start bool) (services, jobs []string, err error)
- func (c *Client) CreateAccessKey(ctx context.Context, description string) (AccessKey, error)
- func (c *Client) CreateDeployWebhook(ctx context.Context, project, env, service string) (string, error)
- func (c *Client) CreateDomainRecord(ctx context.Context, zone string, r DomainRecord) (DomainRecord, error)
- func (c *Client) CreateEnvironment(ctx context.Context, project, name string) (Environment, error)
- func (c *Client) CreateFirewallBlock(ctx context.Context, source, node string, minutes int, reason string, ...) (FirewallBlock, error)
- func (c *Client) CreateFirewallPolicy(ctx context.Context, p FirewallPolicy) (FirewallPolicy, error)
- func (c *Client) CreateGitConnection(ctx context.Context, kind, name, serverURL, token string) (GitConnection, error)
- func (c *Client) CreateGitHubAppManifest(ctx context.Context, name, org, githubURL string) (GitHubAppManifest, error)
- func (c *Client) CreateJoinToken(ctx context.Context, description string, ttlMinutes int, singleUse bool) (JoinToken, error)
- func (c *Client) CreateMiddleware(ctx context.Context, project string, m Middleware) (Middleware, error)
- func (c *Client) CreateProject(ctx context.Context, name, description, environment string) (Project, error)
- func (c *Client) CreateProtectionValkey(ctx context.Context, project, env string) (ProjectProtection, error)
- func (c *Client) CreateSecurityGroup(ctx context.Context, project string, g SecurityGroup) (SecurityGroup, error)
- func (c *Client) CreateToken(ctx context.Context, name string, expiresInDays int) (Token, error)
- func (c *Client) CutOverProjectIngress(ctx context.Context, project string) (ProjectIngress, error)
- func (c *Client) DNSLookup(ctx context.Context, name string) (DNSAnswer, error)
- func (c *Client) DNSRecords(ctx context.Context) ([]DNSRecord, error)
- func (c *Client) DelegateDomainChallenge(ctx context.Context, zone, name string, replaceConflicts bool) (ChallengeRoute, error)
- func (c *Client) DeleteAccessKey(ctx context.Context, id string) error
- func (c *Client) DeleteAlertChannel(ctx context.Context, id string) error
- func (c *Client) DeleteAlertRule(ctx context.Context, id string) error
- func (c *Client) DeleteAutoscaling(ctx context.Context, project, env, service string) error
- func (c *Client) DeleteBrandingLogo(ctx context.Context) (Branding, error)
- func (c *Client) DeleteCertificate(ctx context.Context, id string, force bool) error
- func (c *Client) DeleteDeployWebhook(ctx context.Context, project, env, service string) error
- func (c *Client) DeleteDomainRecord(ctx context.Context, zone, id string) error
- func (c *Client) DeleteEnvironment(ctx context.Context, project, name string, everything bool) (pending bool, err error)
- func (c *Client) DeleteFirewallBlock(ctx context.Context, id string) error
- func (c *Client) DeleteFirewallPolicy(ctx context.Context, id string) error
- func (c *Client) DeleteGitConnection(ctx context.Context, name string) error
- func (c *Client) DeleteGitSource(ctx context.Context, project, env, service string) error
- func (c *Client) DeleteImage(ctx context.Context, repo, tag string, force bool) error
- func (c *Client) DeleteJob(ctx context.Context, project, env, name string) error
- func (c *Client) DeleteJoinToken(ctx context.Context, id string) error
- func (c *Client) DeleteLifecyclePolicy(ctx context.Context, repo string) error
- func (c *Client) DeleteMiddleware(ctx context.Context, project, name string) error
- func (c *Client) DeleteNode(ctx context.Context, id string, force bool) error
- func (c *Client) DeleteProject(ctx context.Context, name string, everything bool) (pending bool, err error)
- func (c *Client) DeleteRepository(ctx context.Context, repo string, force bool) error
- func (c *Client) DeleteSMTP(ctx context.Context) error
- func (c *Client) DeleteSecurityGroup(ctx context.Context, project, name string) error
- func (c *Client) DeleteService(ctx context.Context, project, env, name string) error
- func (c *Client) DeleteToken(ctx context.Context, id string) error
- func (c *Client) DeleteUpstreamCredential(ctx context.Context, id string) error
- func (c *Client) DeployBuild(ctx context.Context, id string) (Build, error)
- func (c *Client) DisableBackups(ctx context.Context) error
- func (c *Client) Do(ctx context.Context, method, path string, in, out any) error
- func (c *Client) DomainChallenge(ctx context.Context, zone, name string) (ChallengeRoute, error)
- func (c *Client) DrainNode(ctx context.Context, id string) (Node, error)
- func (c *Client) EffectiveFirewall(ctx context.Context, nodeID string) (EffectiveFirewall, error)
- func (c *Client) Endpoint() string
- func (c *Client) ExecDial(ctx context.Context, taskID string, command []string, tty bool, cols, rows int) (*websocket.Conn, error)
- func (c *Client) ExportCertificate(ctx context.Context, id string) (chain, privateKey string, err error)
- func (c *Client) FirewallCounters(ctx context.Context, node string) ([]RuleCounter, error)
- func (c *Client) FirewallDrops(ctx context.Context, since, node, direction, ip string) ([]FirewallDrop, error)
- func (c *Client) GetAutoDeploy(ctx context.Context, project, env, service string) (AutoDeploy, error)
- func (c *Client) GetAutoscaling(ctx context.Context, project, env, service string) (Autoscaling, error)
- func (c *Client) GetBackupConfig(ctx context.Context) (BackupSettings, error)
- func (c *Client) GetBranding(ctx context.Context) (Branding, error)
- func (c *Client) GetBuildSettings(ctx context.Context, project, env, service string) (BuildSettings, error)
- func (c *Client) GetCertificate(ctx context.Context, id string) (CertificateInfo, error)
- func (c *Client) GetDeployment(ctx context.Context, project, env, name, id string) (DeploymentDetail, error)
- func (c *Client) GetDomain(ctx context.Context, name string) (Domain, error)
- func (c *Client) GetDomainSettings(ctx context.Context) (DomainSettings, error)
- func (c *Client) GetFirewallSSH(ctx context.Context) (FirewallSSH, error)
- func (c *Client) GetGitConnection(ctx context.Context, name string) (GitConnection, error)
- func (c *Client) GetGitServer(ctx context.Context) (GitServer, error)
- func (c *Client) GetGitSource(ctx context.Context, project, env, service string) (GitSource, error)
- func (c *Client) GetIPAM(ctx context.Context) (IPAM, error)
- func (c *Client) GetJob(ctx context.Context, project, env, name string) (Job, error)
- func (c *Client) GetLifecyclePolicy(ctx context.Context, repo string) (LifecyclePolicy, error)
- func (c *Client) GetMesh(ctx context.Context) (Mesh, error)
- func (c *Client) GetNodeFirewall(ctx context.Context, nodeID string) (NodeFirewall, error)
- func (c *Client) GetProjectIngress(ctx context.Context, project string) (ProjectIngress, error)
- func (c *Client) GetProjectProtection(ctx context.Context, project string) (ProjectProtection, error)
- func (c *Client) GetRouting(ctx context.Context, project, env, name string) ([]PortRoute, error)
- func (c *Client) GetRun(ctx context.Context, id string) (JobRun, error)
- func (c *Client) GetSMTP(ctx context.Context) (SMTP, error)
- func (c *Client) GetSecurityGroup(ctx context.Context, project, name string) (SecurityGroup, error)
- func (c *Client) GetService(ctx context.Context, project, env, name string) (Service, error)
- func (c *Client) GitServerCredentials(ctx context.Context) (map[string]string, error)
- func (c *Client) IPHistory(ctx context.Context, ip string) ([]AddressRecord, error)
- func (c *Client) ImageDetails(ctx context.Context, repo, tag string) (ImageDetails, error)
- func (c *Client) ImportCertificate(ctx context.Context, in CertificateImportInput) (CertificateInfo, []string, error)
- func (c *Client) Incidents(ctx context.Context, openOnly bool) ([]Incident, error)
- func (c *Client) JobRuns(ctx context.Context, project, env, name string) ([]JobRun, error)
- func (c *Client) JoinNode(ctx context.Context, req JoinRequest) (JoinResponse, error)
- func (c *Client) ListAccessKeys(ctx context.Context) ([]AccessKey, error)
- func (c *Client) ListAlertChannels(ctx context.Context) ([]AlertChannel, error)
- func (c *Client) ListAlertRules(ctx context.Context) ([]map[string]any, error)
- func (c *Client) ListAllMiddlewares(ctx context.Context) ([]Middleware, error)
- func (c *Client) ListAllSecurityGroups(ctx context.Context) ([]SecurityGroup, map[string]string, error)
- func (c *Client) ListBackups(ctx context.Context) ([]BackupObject, error)
- func (c *Client) ListBuilds(ctx context.Context, project, env, service string) ([]Build, error)
- func (c *Client) ListCertificates(ctx context.Context) ([]Certificate, error)
- func (c *Client) ListDomainRecords(ctx context.Context, zone string, q url.Values) ([]DomainRecord, error)
- func (c *Client) ListDomains(ctx context.Context) ([]Domain, error)
- func (c *Client) ListEnvironments(ctx context.Context, project string) ([]Environment, error)
- func (c *Client) ListFirewallBlocks(ctx context.Context, node string) ([]FirewallBlock, error)
- func (c *Client) ListFirewallPolicies(ctx context.Context) ([]FirewallPolicy, error)
- func (c *Client) ListGitBranches(ctx context.Context, name, repo string) ([]string, error)
- func (c *Client) ListGitConnections(ctx context.Context) ([]GitConnection, error)
- func (c *Client) ListGitRepos(ctx context.Context, name, query string) ([]GitRepo, error)
- func (c *Client) ListGitSources(ctx context.Context) ([]GitSourceSummary, error)
- func (c *Client) ListImages(ctx context.Context, repo string) ([]Image, error)
- func (c *Client) ListJobs(ctx context.Context, project, env string) ([]Job, error)
- func (c *Client) ListJoinTokens(ctx context.Context) ([]JoinToken, error)
- func (c *Client) ListMiddlewares(ctx context.Context, project string) ([]Middleware, error)
- func (c *Client) ListNodes(ctx context.Context) ([]Node, error)
- func (c *Client) ListProjects(ctx context.Context) ([]Project, error)
- func (c *Client) ListRegistryEvents(ctx context.Context, repo string, limit int) ([]RegistryEvent, error)
- func (c *Client) ListRepositories(ctx context.Context) ([]Repository, error)
- func (c *Client) ListSecurityGroups(ctx context.Context, project string) ([]SecurityGroup, error)
- func (c *Client) ListServiceDomains(ctx context.Context, project, env, name string) ([]ServiceDomain, error)
- func (c *Client) ListServices(ctx context.Context, project, env string) ([]Service, error)
- func (c *Client) ListSystemTasks(ctx context.Context) ([]SystemTask, error)
- func (c *Client) ListTasks(ctx context.Context) ([]Task, error)
- func (c *Client) ListTokens(ctx context.Context) ([]Token, error)
- func (c *Client) ListUpstreamCredentials(ctx context.Context) ([]UpstreamCredential, error)
- func (c *Client) Metrics(ctx context.Context, project, env, service, rng string) (Metrics, error)
- func (c *Client) NetworkThroughput(ctx context.Context, rng string) (NetworkThroughput, error)
- func (c *Client) NodeDocker(ctx context.Context, node string) (NodeDocker, error)
- func (c *Client) NodeShellDial(ctx context.Context, nodeID string, command []string, tty bool, cols, rows int) (*websocket.Conn, error)
- func (c *Client) PointDomain(ctx context.Context, zone, name string, targets []string, ...) (DNSPlan, error)
- func (c *Client) PreviewLifecyclePolicy(ctx context.Context, repo string, rules []LifecycleRule) (LifecyclePreview, error)
- func (c *Client) PreviewSecurityGroup(ctx context.Context, project, existing string, g SecurityGroup) ([]PreviewChange, error)
- func (c *Client) ProjectAddresses(ctx context.Context, project, env string) ([]ProjectAddress, error)
- func (c *Client) ProjectDeployments(ctx context.Context, project, env, service, status string) ([]Deployment, error)
- func (c *Client) PutAlertChannel(ctx context.Context, id, name, typ string, cfg AlertChannelConfig) (AlertChannel, error)
- func (c *Client) PutAlertRule(ctx context.Context, id string, rule map[string]any) (map[string]any, error)
- func (c *Client) PutAutoscaling(ctx context.Context, project, env, service string, p ScalingPolicy) (Autoscaling, error)
- func (c *Client) PutLifecyclePolicy(ctx context.Context, repo string, rules []LifecycleRule) (LifecyclePolicy, error)
- func (c *Client) PutTraefikCustom(ctx context.Context, yaml string) error
- func (c *Client) PutUpstreamCredential(ctx context.Context, host, username, password string) (UpstreamCredential, error)
- func (c *Client) QueryLogs(ctx context.Context, q LogQuery) ([]LogLine, error)
- func (c *Client) Raw(ctx context.Context, method, path string, body []byte) (int, []byte, error)
- func (c *Client) RedeployService(ctx context.Context, project, env, name string, runHooks bool) (Service, error)
- func (c *Client) RegistryCleanups(ctx context.Context) ([]GCRun, bool, error)
- func (c *Client) RegistryInfo(ctx context.Context) (RegistryInfo, error)
- func (c *Client) RegistryStorage(ctx context.Context) (RegistryStorage, error)
- func (c *Client) RegistryUsage(ctx context.Context, refresh bool) (RegistryUsage, error)
- func (c *Client) RemoveServiceDomain(ctx context.Context, project, env, name, host string) error
- func (c *Client) RenewCertificate(ctx context.Context, host string) error
- func (c *Client) RequestCertificate(ctx context.Context, in CertificateRequestInput) (CertificateInfo, error)
- func (c *Client) RestartTask(ctx context.Context, id string) error
- func (c *Client) RevokeCertificate(ctx context.Context, id string) (CertificateInfo, error)
- func (c *Client) RollbackService(ctx context.Context, project, env, name string, revision int, runHooks bool) (Service, error)
- func (c *Client) RunBackup(ctx context.Context) (BackupObject, error)
- func (c *Client) RunJob(ctx context.Context, project, env, name string, command []string) (JobRun, error)
- func (c *Client) RunService(ctx context.Context, project, env, service string, command []string) (JobRun, error)
- func (c *Client) ScaleService(ctx context.Context, project, env, name string, desired int) (Service, error)
- func (c *Client) ScalingEvents(ctx context.Context, project, env, service string, limit int) ([]ScalingEvent, error)
- func (c *Client) Send(ctx context.Context, method, path string, body []byte, contentType string) (*http.Response, error)
- func (c *Client) ServiceDeployments(ctx context.Context, project, env, name string) ([]Deployment, error)
- func (c *Client) ServiceHealth(ctx context.Context) ([]ServiceHealth, error)
- func (c *Client) ServiceRevisions(ctx context.Context, project, env, name string) ([]Revision, error)
- func (c *Client) ServiceSecurity(ctx context.Context, project, env, service string) (ServiceSecurity, error)
- func (c *Client) ServiceTasks(ctx context.Context, project, env, name string) ([]Task, error)
- func (c *Client) SetAutoDeploy(ctx context.Context, project, env, service string, on bool, pollSeconds int) (AutoDeploy, error)
- func (c *Client) SetBackupConfig(ctx context.Context, cfg BackupConfig) (BackupSettings, error)
- func (c *Client) SetBaseDomain(ctx context.Context, baseDomain string) (DomainSettings, error)
- func (c *Client) SetBranding(ctx context.Context, name, title string) (Branding, error)
- func (c *Client) SetBrandingLogo(ctx context.Context, image []byte) (Branding, error)
- func (c *Client) SetBuildSettings(ctx context.Context, project, env, service string, in BuildSettingsInput) (BuildSettings, error)
- func (c *Client) SetChallengeServer(ctx context.Context, zone, ns, ip string) (ChallengeServer, error)
- func (c *Client) SetEnvironmentPolicy(ctx context.Context, project, env string, in EnvironmentPolicy) (Environment, error)
- func (c *Client) SetFirewallSSH(ctx context.Context, s FirewallSSH) (FirewallSSH, error)
- func (c *Client) SetGitServer(ctx context.Context, enabled bool) (GitServer, error)
- func (c *Client) SetGitSource(ctx context.Context, project, env, service string, src GitSource) (GitSource, error)
- func (c *Client) SetNodeSchedulable(ctx context.Context, id string, on bool) (Node, error)
- func (c *Client) SetProjectIngress(ctx context.Context, project string, nodes []string) (ProjectIngress, error)
- func (c *Client) SetProjectNodes(ctx context.Context, project string, nodes []string) (Project, error)
- func (c *Client) SetProjectProtection(ctx context.Context, project string, s ProtectionSpec, extra map[string]any) (ProjectProtection, error)
- func (c *Client) SetRegistryStorage(ctx context.Context, t RegistryStorageTarget) (RegistryStorage, error)
- func (c *Client) SetRouting(ctx context.Context, project, env, name string, ports map[string]RoutingInput) ([]PortRoute, error)
- func (c *Client) SetSMTP(ctx context.Context, in SMTP) (SMTP, error)
- func (c *Client) SetSharedVariables(ctx context.Context, project, env string, vars map[string]string) ([]string, error)
- func (c *Client) SharedVariables(ctx context.Context, project, env string) (map[string]string, error)
- func (c *Client) StartBuild(ctx context.Context, project, env, service, ref, sha string) (Build, error)
- func (c *Client) StartRegistryCleanup(ctx context.Context) (GCRun, error)
- func (c *Client) Stream(ctx context.Context, path string) (io.ReadCloser, error)
- func (c *Client) SystemStatus(ctx context.Context) (SystemStatus, error)
- func (c *Client) TagImage(ctx context.Context, repo, from, tag string) error
- func (c *Client) TailLogs(ctx context.Context, q LogQuery, fn func(LogLine)) error
- func (c *Client) TestAlertChannel(ctx context.Context, id string) error
- func (c *Client) TestSMTP(ctx context.Context, to string) (sendErr string, err error)
- func (c *Client) TraefikConfig(ctx context.Context) (map[string]any, error)
- func (c *Client) TraefikCustom(ctx context.Context) (string, error)
- func (c *Client) TraefikSettings(ctx context.Context) (map[string]any, error)
- func (c *Client) Traffic(ctx context.Context, project, env, service, rng string) (Traffic, error)
- func (c *Client) TrafficMap(ctx context.Context) ([]TrafficMapRoute, error)
- func (c *Client) UpdateDomainRecord(ctx context.Context, zone, id string, r DomainRecord) (DomainRecord, error)
- func (c *Client) UpdateFirewallPolicy(ctx context.Context, id string, p FirewallPolicy) (FirewallPolicy, error)
- func (c *Client) UpdateMiddleware(ctx context.Context, project, name string, m Middleware) (Middleware, error)
- func (c *Client) UpdateProject(ctx context.Context, project string, description *string, rollbackWindow *int) (Project, error)
- func (c *Client) UpdateSecurityGroup(ctx context.Context, project, name string, g SecurityGroup) (SecurityGroup, error)
- func (c *Client) UpdateTraefikSettings(ctx context.Context, settings map[string]any) (map[string]any, error)
- func (c *Client) ValidateTraefikCustom(ctx context.Context, yaml string) error
- func (c *Client) VerifyCertificate(ctx context.Context, id string) (CertificateInfo, error)
- func (c *Client) Whoami(ctx context.Context) (User, error)
- func (c *Client) WithTLS(cfg *tls.Config) *Client
- type Credentials
- type DNSAnswer
- type DNSPlan
- type DNSRecord
- type Deployment
- type DeploymentChange
- type DeploymentDetail
- type Domain
- type DomainCheck
- type DomainOptions
- type DomainRecord
- type DomainSettings
- type EffectiveFirewall
- type Environment
- type EnvironmentPolicy
- type Error
- type FirewallBlock
- type FirewallDrop
- type FirewallPolicy
- type FirewallRule
- type FirewallSSH
- type GCRun
- type GatewayEndpoint
- type GitConnection
- type GitHubAppManifest
- type GitRepo
- type GitServer
- type GitSource
- type GitSourceSummary
- type HealthCheck
- type IPAM
- type IPAMAddress
- type Image
- type ImageDetails
- type ImageUpdate
- type Incident
- type IngressMove
- type Job
- type JobRun
- type JoinRequest
- type JoinResponse
- type JoinToken
- type LifecycleDecision
- type LifecyclePolicy
- type LifecyclePreview
- type LifecycleRule
- type LogLine
- type LogQuery
- type Mesh
- type MeshNode
- type MeshPeer
- type MetricSeries
- type Metrics
- type Middleware
- type NetworkThroughput
- type Node
- type NodeDocker
- type NodeDockerCleanResult
- type NodeFirewall
- type NodeInfo
- type NodeMetrics
- type PortRoute
- type PreviewChange
- type Project
- type ProjectAddress
- type ProjectIngress
- type ProjectProtection
- type ProtectionSpec
- type Reachability
- type RegistryEvent
- type RegistryInfo
- type RegistryRepoUsage
- type RegistryStorage
- type RegistryStorageSwitch
- type RegistryStorageTarget
- type RegistryUsage
- type Repository
- type Revision
- type RouteTraffic
- type RoutingInput
- type RuleCounter
- type RuleMatch
- type SMTP
- type ScalingEvent
- type ScalingPolicy
- type SecurityGroup
- type SecurityRule
- type Service
- type ServiceDomain
- type ServiceHealth
- type ServicePort
- type ServiceSecurity
- type ServiceSpec
- type SystemStatus
- type SystemTask
- type Talker
- type Task
- type Token
- type Traffic
- type TrafficMapRoute
- type TrafficMapTask
- type UpstreamCredential
- type User
Constants ¶
const HeaderSessionToken = "X-Syncloud-Session-Token"
HeaderSessionToken carries the session token of temporary credentials.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddressRecord ¶
type AlertChannel ¶
type AlertChannel struct {
ID string `json:"id"`
Name string `json:"name"`
Type string `json:"type"`
Summary string `json:"summary"`
}
AlertChannel is a notification channel (secrets are never returned).
type AlertChannelConfig ¶
type AlertChannelConfig struct {
URL string `json:"url,omitempty"`
BotToken string `json:"botToken,omitempty"`
ChatID string `json:"chatId,omitempty"`
SMTPHost string `json:"smtpHost,omitempty"`
SMTPPort int `json:"smtpPort,omitempty"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
From string `json:"from,omitempty"`
To []string `json:"to,omitempty"`
}
AlertChannelConfig holds the settings of one channel type.
type AlertEvent ¶
type AlertState ¶
type AutoDeploy ¶ added in v0.1.7
type AutoDeploy struct {
Watchable bool `json:"watchable"`
Reason string `json:"reason,omitempty"`
Git bool `json:"git"`
BuiltIn bool `json:"builtIn"`
AutoDeploy bool `json:"autoDeploy"`
PollSeconds int `json:"pollSeconds"`
Webhook bool `json:"webhook"`
CheckedAt *time.Time `json:"checkedAt"`
LastDigest string `json:"lastDigest"`
LastError string `json:"lastError"`
LastDeployAt *time.Time `json:"lastDeployAt"`
}
AutoDeploy is a service's auto-deploy of new pushes of its image.
type Autoscaling ¶
type BackupConfig ¶
type BackupConfig struct {
Endpoint string `json:"endpoint"`
Region string `json:"region"`
Bucket string `json:"bucket"`
Prefix string `json:"prefix"`
AccessKeyID string `json:"accessKeyId"`
SecretAccessKey string `json:"secretAccessKey,omitempty"`
IntervalMinutes int `json:"intervalMinutes"`
Retain int `json:"retain"`
}
type BackupObject ¶
type BackupSettings ¶
type BackupSettings struct {
Configured bool `json:"configured"`
Config *BackupConfig `json:"config"`
Status struct {
LastRunAt *time.Time `json:"lastRunAt"`
LastSuccessAt *time.Time `json:"lastSuccessAt"`
LastError string `json:"lastError"`
LastObject string `json:"lastObject"`
LastSize int64 `json:"lastSize"`
} `json:"status"`
}
type Branding ¶ added in v0.2.0
type Branding struct {
Name string `json:"name"`
Title string `json:"title"`
HasLogo bool `json:"hasLogo"`
Version string `json:"version"`
}
Branding is the workspace name, title and logo (Phase 21).
type Build ¶
type Build struct {
ID string `json:"id"`
ServiceID string `json:"serviceId"`
Project string `json:"project"`
Environment string `json:"environment"`
Service string `json:"service"`
SHA string `json:"sha"`
Ref string `json:"ref"`
Trigger string `json:"trigger"`
Status string `json:"status"`
Image string `json:"image"`
RunID string `json:"runId"`
Message string `json:"message"`
Deployed bool `json:"deployed"`
BaseSHA string `json:"baseSha"`
CreatedAt time.Time `json:"createdAt"`
StartedAt *time.Time `json:"startedAt"`
FinishedAt *time.Time `json:"finishedAt"`
}
type BuildSettings ¶
type BuildSettings struct {
InstallCommand string `json:"installCommand"`
BuildCommand string `json:"buildCommand"`
StartCommand string `json:"startCommand"`
PostBuild []string `json:"postBuild"`
Variables []string `json:"variables"`
}
BuildSettings are a Git source's command overrides, build variable names and after-build checks.
type BuildSettingsInput ¶
type BuildSettingsInput struct {
InstallCommand string `json:"installCommand"`
BuildCommand string `json:"buildCommand"`
StartCommand string `json:"startCommand"`
PostBuild []string `json:"postBuild"`
Variables map[string]*string `json:"variables"`
}
BuildSettingsInput changes them; a nil variable keeps its stored value.
type Certificate ¶
type Certificate struct {
Host string `json:"host"`
Issuer string `json:"issuer"`
Status string `json:"status"`
NotAfter time.Time `json:"notAfter"`
LastError string `json:"lastError"`
Failures int `json:"failures"`
NextAttemptAt *time.Time `json:"nextAttemptAt"`
UpdatedAt time.Time `json:"updatedAt"`
// Phase 28 (additive): the key, what it covers and whether somebody asked for it.
ID string `json:"id"`
Names []string `json:"names"`
Managed bool `json:"managed"`
}
type CertificateImportInput ¶ added in v0.5.0
type CertificateImportInput struct {
Chain string `json:"chain,omitempty"`
Key string `json:"key,omitempty"`
Passphrase string `json:"passphrase,omitempty"`
Replace string `json:"replace,omitempty"`
}
CertificateImportInput brings in a certificate from a provider.
type CertificateInfo ¶ added in v0.5.0
type CertificateInfo struct {
ID string `json:"id"`
Names []string `json:"names"`
Status string `json:"status"`
Source string `json:"source"`
Method string `json:"method"`
Authority string `json:"authority"`
AuthorityID string `json:"authorityId"`
KeyType string `json:"keyType"`
AutoRenew bool `json:"autoRenew"`
NotAfter time.Time `json:"notAfter"`
DaysLeft int `json:"daysLeft"`
Wildcard bool `json:"wildcard"`
Zone string `json:"zone"`
Fingerprint string `json:"fingerprint"`
LastError string `json:"lastError"`
UsedBy []string `json:"usedBy"`
Order *struct {
State string `json:"state"`
Challenges []struct {
Name string `json:"name"`
Value string `json:"value"`
Auto bool `json:"auto"`
Present bool `json:"present"`
Mode string `json:"mode"`
Target string `json:"target"`
CNAMEOK bool `json:"cnameOk"`
} `json:"challenges"`
} `json:"order"`
}
CertificateInfo is a certificate as the API shows it (never its key).
type CertificateRequestInput ¶ added in v0.5.0
type CertificateRequestInput struct {
Names []string `json:"names"`
Authority string `json:"authority,omitempty"`
Method string `json:"method,omitempty"`
KeyType string `json:"keyType,omitempty"`
Fallback string `json:"fallback,omitempty"`
AutoRenew *bool `json:"autoRenew,omitempty"`
}
CertificateRequestInput asks for a certificate.
type ChallengeRoute ¶ added in v0.5.0
type ChallengeRoute struct {
Name string `json:"name"`
Host string `json:"host"`
Zone string `json:"zone"`
Mode string `json:"mode"` // direct | delegated | builtin | manual
Auto bool `json:"auto"`
Target string `json:"target"`
TargetZone string `json:"targetZone"`
CNAME *struct {
Name string `json:"name"`
Target string `json:"target"`
Present bool `json:"present"`
Seen []string `json:"seen"`
Managed bool `json:"managed"`
} `json:"cname"`
Note string `json:"note"`
}
ChallengeRoute says where the _acme-challenge TXT record of a name goes: written at the name (direct), written where a CNAME delegates it, or by hand.
type ChallengeServer ¶ added in v0.5.0
type ChallengeServer struct {
Enabled bool `json:"enabled"`
Zone string `json:"zone"`
NS string `json:"ns"`
IP string `json:"ip"`
Listen string `json:"listen"`
Listening bool `json:"listening"`
Error string `json:"error"`
Records int `json:"records"`
// Needed are the records to create so the internet reaches the server.
Needed []struct {
Type string `json:"type"`
Name string `json:"name"`
Content string `json:"content"`
Zone string `json:"zone"`
Managed bool `json:"managed"`
} `json:"needed"`
// Domains are the registered domains whose challenges it answers.
Domains []string `json:"domains"`
}
ChallengeServer is SynCloud's own ACME challenge DNS server.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func New ¶
func New(endpoint string, creds Credentials) (*Client, error)
New returns a client for endpoint, e.g. "https://203-0-113-10.sslip.io".
func (*Client) ActiveAlerts ¶
func (c *Client) ActiveAlerts(ctx context.Context) ([]AlertState, error)
func (*Client) AddServiceDomain ¶
func (c *Client) AddServiceDomain(ctx context.Context, project, env, name, host, port string, opts DomainOptions) (DomainCheck, error)
func (*Client) AlertEvents ¶
func (*Client) ApplyService ¶
func (*Client) CancelDeployment ¶
func (*Client) ChallengeServer ¶ added in v0.5.0
func (c *Client) ChallengeServer(ctx context.Context) (ChallengeServer, error)
func (*Client) CheckDomain ¶
func (*Client) CheckImage ¶ added in v0.1.7
func (*Client) CheckReachability ¶
func (*Client) CleanNodeDocker ¶ added in v0.3.2
func (c *Client) CleanNodeDocker(ctx context.Context, node, kind string, ids []string, all bool) (NodeDockerCleanResult, error)
CleanNodeDocker removes the named objects of kind, or prunes the kind.
func (*Client) CloneEnvironment ¶
func (c *Client) CloneEnvironment(ctx context.Context, project, name, from string, start bool) (services, jobs []string, err error)
CloneEnvironment creates an environment as a copy of another.
func (*Client) CreateAccessKey ¶
func (*Client) CreateDeployWebhook ¶ added in v0.1.7
func (c *Client) CreateDeployWebhook(ctx context.Context, project, env, service string) (string, error)
CreateDeployWebhook returns the new deploy webhook's path (it holds the secret).
func (*Client) CreateDomainRecord ¶ added in v0.5.0
func (c *Client) CreateDomainRecord(ctx context.Context, zone string, r DomainRecord) (DomainRecord, error)
CreateDomainRecord adds a record; name may be a label, the full name or "@".
func (*Client) CreateEnvironment ¶
func (*Client) CreateFirewallBlock ¶ added in v0.3.0
func (c *Client) CreateFirewallBlock(ctx context.Context, source, node string, minutes int, reason string, force bool) (FirewallBlock, error)
CreateFirewallBlock blocks a source (minutes 0 = until removed).
func (*Client) CreateFirewallPolicy ¶
func (c *Client) CreateFirewallPolicy(ctx context.Context, p FirewallPolicy) (FirewallPolicy, error)
func (*Client) CreateGitConnection ¶
func (*Client) CreateGitHubAppManifest ¶
func (*Client) CreateJoinToken ¶
func (*Client) CreateMiddleware ¶
func (c *Client) CreateMiddleware(ctx context.Context, project string, m Middleware) (Middleware, error)
func (*Client) CreateProject ¶
func (*Client) CreateProtectionValkey ¶ added in v0.3.0
func (*Client) CreateSecurityGroup ¶
func (c *Client) CreateSecurityGroup(ctx context.Context, project string, g SecurityGroup) (SecurityGroup, error)
func (*Client) CreateToken ¶
func (*Client) CutOverProjectIngress ¶ added in v0.3.0
CutOverProjectIngress ends a project's ingress move now.
func (*Client) DelegateDomainChallenge ¶ added in v0.5.0
func (c *Client) DelegateDomainChallenge(ctx context.Context, zone, name string, replaceConflicts bool) (ChallengeRoute, error)
DelegateDomainChallenge creates the CNAME that delegates a name's _acme-challenge to the domain's validation domain, when the domain has a provider. replaceConflicts also removes other records on that name.
func (*Client) DeleteAccessKey ¶
func (*Client) DeleteAlertChannel ¶
func (*Client) DeleteAlertRule ¶
func (*Client) DeleteAutoscaling ¶
func (*Client) DeleteBrandingLogo ¶ added in v0.2.0
func (*Client) DeleteCertificate ¶ added in v0.5.0
func (*Client) DeleteDeployWebhook ¶ added in v0.1.7
func (*Client) DeleteDomainRecord ¶ added in v0.5.0
func (*Client) DeleteEnvironment ¶
func (c *Client) DeleteEnvironment(ctx context.Context, project, name string, everything bool) (pending bool, err error)
DeleteEnvironment deletes an environment, with its services when everything is set (pending: it goes after them).
func (*Client) DeleteFirewallBlock ¶ added in v0.3.0
func (*Client) DeleteFirewallPolicy ¶
func (*Client) DeleteGitConnection ¶
func (*Client) DeleteGitSource ¶
func (*Client) DeleteImage ¶
func (*Client) DeleteJoinToken ¶
func (*Client) DeleteLifecyclePolicy ¶
func (*Client) DeleteMiddleware ¶
func (*Client) DeleteNode ¶
DeleteNode removes a node; force also removes a project's only load balancer (that project goes back to the controller).
func (*Client) DeleteProject ¶
func (c *Client) DeleteProject(ctx context.Context, name string, everything bool) (pending bool, err error)
DeleteProject deletes a project; with everything its services go first (pending: the project goes after them).
func (*Client) DeleteRepository ¶ added in v0.3.4
DeleteRepository deletes every tag of a repository.
func (*Client) DeleteSecurityGroup ¶
func (*Client) DeleteService ¶
func (*Client) DeleteUpstreamCredential ¶
func (*Client) DeployBuild ¶
func (*Client) Do ¶
Do sends in (if non-nil) as JSON and decodes a successful response into out (if non-nil).
func (*Client) DomainChallenge ¶ added in v0.5.0
DomainChallenge shows where the _acme-challenge record of a name goes (name "" is the domain itself; a wildcard is written *.name).
func (*Client) EffectiveFirewall ¶
func (*Client) Endpoint ¶ added in v0.1.7
Endpoint is the controller's address, e.g. "https://203-0-113-10.sslip.io".
func (*Client) ExecDial ¶
func (c *Client) ExecDial(ctx context.Context, taskID string, command []string, tty bool, cols, rows int) (*websocket.Conn, error)
ExecDial opens an interactive command in a task (see the execTask operation). The caller owns the connection.
func (*Client) ExportCertificate ¶ added in v0.5.0
func (c *Client) ExportCertificate(ctx context.Context, id string) (chain, privateKey string, err error)
ExportCertificate returns the chain and the PRIVATE KEY. It needs the certificate:ExportCertificate permission, which nobody has until it is granted.
func (*Client) FirewallCounters ¶
func (*Client) FirewallDrops ¶
func (*Client) GetAutoDeploy ¶ added in v0.1.7
func (*Client) GetAutoscaling ¶
func (*Client) GetBackupConfig ¶
func (c *Client) GetBackupConfig(ctx context.Context) (BackupSettings, error)
func (*Client) GetBranding ¶ added in v0.2.0
func (*Client) GetBuildSettings ¶
func (*Client) GetCertificate ¶ added in v0.5.0
func (*Client) GetDeployment ¶
func (*Client) GetDomainSettings ¶
func (c *Client) GetDomainSettings(ctx context.Context) (DomainSettings, error)
func (*Client) GetFirewallSSH ¶ added in v0.3.0
func (c *Client) GetFirewallSSH(ctx context.Context) (FirewallSSH, error)
func (*Client) GetGitConnection ¶
func (*Client) GetGitSource ¶
func (*Client) GetLifecyclePolicy ¶
func (*Client) GetNodeFirewall ¶ added in v0.3.0
func (*Client) GetProjectIngress ¶ added in v0.3.0
func (*Client) GetProjectProtection ¶ added in v0.3.0
func (*Client) GetRouting ¶
func (*Client) GetSecurityGroup ¶
func (*Client) GetService ¶
func (*Client) GitServerCredentials ¶
func (*Client) ImageDetails ¶ added in v0.3.1
func (*Client) ImportCertificate ¶ added in v0.5.0
func (c *Client) ImportCertificate(ctx context.Context, in CertificateImportInput) (CertificateInfo, []string, error)
func (*Client) JoinNode ¶
func (c *Client) JoinNode(ctx context.Context, req JoinRequest) (JoinResponse, error)
JoinNode needs no credentials: the join token authorizes it.
func (*Client) ListAccessKeys ¶
func (*Client) ListAlertChannels ¶
func (c *Client) ListAlertChannels(ctx context.Context) ([]AlertChannel, error)
func (*Client) ListAlertRules ¶
func (*Client) ListAllMiddlewares ¶
func (c *Client) ListAllMiddlewares(ctx context.Context) ([]Middleware, error)
func (*Client) ListAllSecurityGroups ¶
func (*Client) ListBackups ¶
func (c *Client) ListBackups(ctx context.Context) ([]BackupObject, error)
func (*Client) ListBuilds ¶
ListBuilds lists a service's builds, or recent builds everywhere when service is "".
func (*Client) ListCertificates ¶
func (c *Client) ListCertificates(ctx context.Context) ([]Certificate, error)
func (*Client) ListDomainRecords ¶ added in v0.5.0
func (*Client) ListDomains ¶ added in v0.5.0
func (*Client) ListEnvironments ¶
func (*Client) ListFirewallBlocks ¶ added in v0.3.0
func (*Client) ListFirewallPolicies ¶
func (c *Client) ListFirewallPolicies(ctx context.Context) ([]FirewallPolicy, error)
func (*Client) ListGitBranches ¶
func (*Client) ListGitConnections ¶
func (c *Client) ListGitConnections(ctx context.Context) ([]GitConnection, error)
func (*Client) ListGitRepos ¶
func (*Client) ListGitSources ¶
func (c *Client) ListGitSources(ctx context.Context) ([]GitSourceSummary, error)
func (*Client) ListImages ¶
func (*Client) ListJoinTokens ¶
func (*Client) ListMiddlewares ¶
func (*Client) ListRegistryEvents ¶
func (*Client) ListRepositories ¶
func (c *Client) ListRepositories(ctx context.Context) ([]Repository, error)
func (*Client) ListSecurityGroups ¶
func (*Client) ListServiceDomains ¶
func (*Client) ListServices ¶
func (*Client) ListSystemTasks ¶
func (c *Client) ListSystemTasks(ctx context.Context) ([]SystemTask, error)
func (*Client) ListUpstreamCredentials ¶
func (c *Client) ListUpstreamCredentials(ctx context.Context) ([]UpstreamCredential, error)
func (*Client) Metrics ¶
Metrics charts a service (a series per task) or, with service "", a whole environment (a series per service). rng is 15m, 1h, 6h, 24h or 7d.
func (*Client) NetworkThroughput ¶
func (*Client) NodeDocker ¶ added in v0.3.2
func (*Client) NodeShellDial ¶
func (c *Client) NodeShellDial(ctx context.Context, nodeID string, command []string, tty bool, cols, rows int) (*websocket.Conn, error)
NodeShellDial opens a shell on a node itself (command empty = login shell).
func (*Client) PointDomain ¶ added in v0.5.0
func (c *Client) PointDomain(ctx context.Context, zone, name string, targets []string, plan, replaceConflicts bool) (DNSPlan, error)
PointDomain makes a name reach the cluster (or the targets given), without duplicates. plan only previews; replaceConflicts also removes records SynCloud did not create.
func (*Client) PreviewLifecyclePolicy ¶
func (c *Client) PreviewLifecyclePolicy(ctx context.Context, repo string, rules []LifecycleRule) (LifecyclePreview, error)
PreviewLifecyclePolicy is a dry run of rules against a repository.
func (*Client) PreviewSecurityGroup ¶
func (c *Client) PreviewSecurityGroup(ctx context.Context, project, existing string, g SecurityGroup) ([]PreviewChange, error)
PreviewSecurityGroup shows what saving g would change; existing names the group being edited ("" for a new one).
func (*Client) ProjectAddresses ¶
func (*Client) ProjectDeployments ¶
func (c *Client) ProjectDeployments(ctx context.Context, project, env, service, status string) ([]Deployment, error)
ProjectDeployments lists a project's deployments; env, service and status narrow it when set.
func (*Client) PutAlertChannel ¶
func (c *Client) PutAlertChannel(ctx context.Context, id, name, typ string, cfg AlertChannelConfig) (AlertChannel, error)
PutAlertChannel creates (id "") or replaces a channel.
func (*Client) PutAlertRule ¶
func (c *Client) PutAlertRule(ctx context.Context, id string, rule map[string]any) (map[string]any, error)
PutAlertRule creates (id "") or replaces a rule given as JSON fields.
func (*Client) PutAutoscaling ¶
func (c *Client) PutAutoscaling(ctx context.Context, project, env, service string, p ScalingPolicy) (Autoscaling, error)
func (*Client) PutLifecyclePolicy ¶
func (c *Client) PutLifecyclePolicy(ctx context.Context, repo string, rules []LifecycleRule) (LifecyclePolicy, error)
func (*Client) PutTraefikCustom ¶
func (*Client) PutUpstreamCredential ¶
func (*Client) Raw ¶
Raw sends a request with an optional raw JSON body and returns the response status and body. Paths are relative to the endpoint, e.g. "/api/v1/auth/me".
func (*Client) RedeployService ¶
func (*Client) RegistryCleanups ¶
func (*Client) RegistryInfo ¶
func (c *Client) RegistryInfo(ctx context.Context) (RegistryInfo, error)
func (*Client) RegistryStorage ¶ added in v0.1.9
func (c *Client) RegistryStorage(ctx context.Context) (RegistryStorage, error)
func (*Client) RegistryUsage ¶ added in v0.3.1
func (*Client) RemoveServiceDomain ¶
func (*Client) RenewCertificate ¶
func (*Client) RequestCertificate ¶ added in v0.5.0
func (c *Client) RequestCertificate(ctx context.Context, in CertificateRequestInput) (CertificateInfo, error)
func (*Client) RevokeCertificate ¶ added in v0.5.0
func (*Client) RollbackService ¶
func (*Client) RunService ¶
func (*Client) ScaleService ¶
func (*Client) ScalingEvents ¶
func (*Client) Send ¶
func (c *Client) Send(ctx context.Context, method, path string, body []byte, contentType string) (*http.Response, error)
Send sends a signed request with a raw body (any content type) and returns the response for the caller to read and close; non-2xx statuses become errors. For uploads and downloads of files.
func (*Client) ServiceDeployments ¶
func (*Client) ServiceHealth ¶
func (c *Client) ServiceHealth(ctx context.Context) ([]ServiceHealth, error)
func (*Client) ServiceRevisions ¶
func (*Client) ServiceSecurity ¶
func (*Client) ServiceTasks ¶
func (*Client) SetAutoDeploy ¶ added in v0.1.7
func (*Client) SetBackupConfig ¶
func (c *Client) SetBackupConfig(ctx context.Context, cfg BackupConfig) (BackupSettings, error)
func (*Client) SetBaseDomain ¶
func (*Client) SetBranding ¶ added in v0.2.0
func (*Client) SetBrandingLogo ¶ added in v0.2.0
SetBrandingLogo uploads a PNG, JPEG or WebP image.
func (*Client) SetBuildSettings ¶
func (c *Client) SetBuildSettings(ctx context.Context, project, env, service string, in BuildSettingsInput) (BuildSettings, error)
func (*Client) SetChallengeServer ¶ added in v0.5.0
func (c *Client) SetChallengeServer(ctx context.Context, zone, ns, ip string) (ChallengeServer, error)
SetChallengeServer turns the server on for a zone below a domain you own (like acme.example.com); an empty zone switches it off. ns and ip default.
func (*Client) SetEnvironmentPolicy ¶
func (c *Client) SetEnvironmentPolicy(ctx context.Context, project, env string, in EnvironmentPolicy) (Environment, error)
func (*Client) SetFirewallSSH ¶ added in v0.3.0
func (c *Client) SetFirewallSSH(ctx context.Context, s FirewallSSH) (FirewallSSH, error)
func (*Client) SetGitServer ¶
func (*Client) SetGitSource ¶
func (*Client) SetNodeSchedulable ¶
func (*Client) SetProjectIngress ¶ added in v0.3.0
func (c *Client) SetProjectIngress(ctx context.Context, project string, nodes []string) (ProjectIngress, error)
SetProjectIngress chooses a project's load-balancer nodes (empty = the controller).
func (*Client) SetProjectNodes ¶
func (c *Client) SetProjectNodes(ctx context.Context, project string, nodes []string) (Project, error)
SetProjectNodes limits the nodes a project's workloads run on (empty = any).
func (*Client) SetProjectProtection ¶ added in v0.3.0
func (c *Client) SetProjectProtection(ctx context.Context, project string, s ProtectionSpec, extra map[string]any) (ProjectProtection, error)
SetProjectProtection saves a spec; extra carries secret, generateSecret or clearSecret.
func (*Client) SetRegistryStorage ¶ added in v0.1.9
func (c *Client) SetRegistryStorage(ctx context.Context, t RegistryStorageTarget) (RegistryStorage, error)
SetRegistryStorage starts switching the registry's storage.
func (*Client) SetRouting ¶
func (*Client) SetSharedVariables ¶
func (c *Client) SetSharedVariables(ctx context.Context, project, env string, vars map[string]string) ([]string, error)
SetSharedVariables replaces them and returns the redeployed services.
func (*Client) SharedVariables ¶
func (c *Client) SharedVariables(ctx context.Context, project, env string) (map[string]string, error)
SharedVariables returns an environment's shared variables.
func (*Client) StartBuild ¶
func (c *Client) StartBuild(ctx context.Context, project, env, service, ref, sha string) (Build, error)
StartBuild builds the branch head, or sha when given. StartBuild builds the head of ref (a branch or tag; "" = the source's branch) or sha.
func (*Client) StartRegistryCleanup ¶
func (*Client) Stream ¶
Stream sends a signed GET and returns the open response body for streaming endpoints (e.g. Server-Sent Events). The caller closes it.
func (*Client) SystemStatus ¶
func (c *Client) SystemStatus(ctx context.Context) (SystemStatus, error)
func (*Client) TagImage ¶ added in v0.3.1
TagImage gives the image from (a tag of repo) the tag tag.
func (*Client) TestAlertChannel ¶
func (*Client) TestSMTP ¶ added in v0.2.0
TestSMTP sends a test email; sendErr is the server's answer when it failed.
func (*Client) TraefikConfig ¶
func (*Client) TraefikSettings ¶
TraefikSettings is GET /traefik/settings, kept loose so the CLI can set any field by name.
func (*Client) Traffic ¶
Traffic returns request charts and per-route numbers of everything (project ""), an environment (service "") or one service.
func (*Client) TrafficMap ¶
func (c *Client) TrafficMap(ctx context.Context) ([]TrafficMapRoute, error)
func (*Client) UpdateDomainRecord ¶ added in v0.5.0
func (c *Client) UpdateDomainRecord(ctx context.Context, zone, id string, r DomainRecord) (DomainRecord, error)
func (*Client) UpdateFirewallPolicy ¶
func (c *Client) UpdateFirewallPolicy(ctx context.Context, id string, p FirewallPolicy) (FirewallPolicy, error)
func (*Client) UpdateMiddleware ¶
func (c *Client) UpdateMiddleware(ctx context.Context, project, name string, m Middleware) (Middleware, error)
func (*Client) UpdateProject ¶
func (c *Client) UpdateProject(ctx context.Context, project string, description *string, rollbackWindow *int) (Project, error)
UpdateProject changes a project's description and rollback window (nil leaves a field unchanged).
func (*Client) UpdateSecurityGroup ¶
func (c *Client) UpdateSecurityGroup(ctx context.Context, project, name string, g SecurityGroup) (SecurityGroup, error)
func (*Client) UpdateTraefikSettings ¶
func (*Client) ValidateTraefikCustom ¶
func (*Client) VerifyCertificate ¶ added in v0.5.0
type Credentials ¶
type DNSPlan ¶ added in v0.5.0
type DNSPlan struct {
Plan struct {
Steps []struct {
Action string `json:"action"`
Reason string `json:"reason"`
Record DomainRecord `json:"record"`
NeedsConfirm bool `json:"needsConfirm"`
} `json:"steps"`
} `json:"plan"`
Applied *struct{ Created, Updated, Deleted int } `json:"applied"`
Manual []DomainRecord `json:"manual"`
}
DNSPlan is what pointing a name at the cluster does (or would do).
type Deployment ¶
type Deployment struct {
ID string `json:"id"`
Service string `json:"service"`
Environment string `json:"environment"`
FromRevision int `json:"fromRevision"`
ToRevision int `json:"toRevision"`
Status string `json:"status"`
FailedTasks int `json:"failedTasks"`
Message string `json:"message"`
StartedAt time.Time `json:"startedAt"`
FinishedAt *time.Time `json:"finishedAt"`
Trigger string `json:"trigger"`
Actor string `json:"actor"`
ActorName string `json:"actorName"`
Image string `json:"image"`
Commit *struct {
SHA string `json:"sha"`
Ref string `json:"ref"`
} `json:"commit"`
Changes []DeploymentChange `json:"changes"`
Hooks []struct {
RunID string `json:"runId"`
Trigger string `json:"trigger"`
Status string `json:"status"`
} `json:"hooks"`
}
type DeploymentChange ¶
type DeploymentChange struct {
Field string `json:"field"`
From string `json:"from"`
To string `json:"to"`
}
DeploymentChange is one difference between the two revisions.
type DeploymentDetail ¶
type DeploymentDetail struct {
Deployment
Events []struct {
At time.Time `json:"at"`
Kind string `json:"kind"`
Level string `json:"level"`
Node string `json:"node"`
TaskID string `json:"taskId"`
Message string `json:"message"`
} `json:"events"`
Runs []JobRun `json:"runs"`
}
DeploymentDetail is one deployment with its timeline and hook runs.
type Domain ¶ added in v0.5.0
type Domain struct {
Name string `json:"name"`
Mode string `json:"mode"` // managed | manual
Provider string `json:"provider"`
NameServers []string `json:"nameServers"`
WildcardPolicy string `json:"wildcardPolicy"`
// ChallengeZone is the domain whose provider holds this domain's
// _acme-challenge records (a CNAME delegates them there).
ChallengeZone string `json:"challengeZone"`
ChallengeBuiltin bool `json:"challengeBuiltin"`
Grants []struct {
Project string `json:"project"`
Suffix string `json:"suffix"`
Wildcards bool `json:"wildcards"`
} `json:"grants"`
Use struct {
Services int `json:"services"`
Certificates int `json:"certificates"`
} `json:"use"`
}
Domain is a registered domain.
type DomainCheck ¶
type DomainOptions ¶
type DomainOptions struct {
Path string `json:"path,omitempty"`
StripPrefix bool `json:"stripPrefix,omitempty"`
RedirectTo string `json:"redirectTo,omitempty"`
}
DomainOptions are a custom domain's path prefix, prefix stripping and redirect (Phase 15c).
type DomainRecord ¶ added in v0.5.0
type DomainRecord struct {
ID string `json:"id,omitempty"`
Type string `json:"type"`
Name string `json:"name"`
Content string `json:"content"`
TTL int `json:"ttl,omitempty"`
Proxied bool `json:"proxied,omitempty"`
Priority *int `json:"priority,omitempty"`
Managed bool `json:"managed,omitempty"` // created by SynCloud
}
DomainRecord is a record of a managed domain.
type DomainSettings ¶
type DomainSettings struct {
BaseDomain string `json:"baseDomain"`
DashboardURL string `json:"dashboardUrl"`
RegistryHost string `json:"registryHost"`
PublicIP string `json:"publicIp"`
PublicIPError string `json:"publicIpError"`
Suggestions []string `json:"suggestions"`
ACME struct {
Enabled bool `json:"enabled"`
DirectoryURL string `json:"directoryUrl"`
Email string `json:"email"`
} `json:"acme"`
Warnings []string `json:"warnings"`
}
type EffectiveFirewall ¶
type EffectiveFirewall struct {
Enabled bool `json:"enabled"`
Rules []FirewallRule `json:"rules"`
ClusterSources []string `json:"clusterSources"`
Ruleset string `json:"ruleset"`
}
type Environment ¶
type EnvironmentPolicy ¶
type EnvironmentPolicy struct {
AutoDeploy *bool `json:"autoDeploy,omitempty"`
Locked *bool `json:"locked,omitempty"`
Reason *string `json:"reason,omitempty"`
}
EnvironmentPolicy changes an environment's auto-deploy switch and deploy lock; nil fields keep their value.
type FirewallBlock ¶ added in v0.3.0
type FirewallBlock struct {
ID string `json:"id"`
Source string `json:"source"`
Node string `json:"node"`
Reason string `json:"reason"`
CreatedBy string `json:"createdBy"`
Auto bool `json:"auto"`
CreatedAt time.Time `json:"createdAt"`
ExpiresAt *time.Time `json:"expiresAt"`
}
FirewallBlock is a source every node's firewall (or one node's) drops.
type FirewallDrop ¶
type FirewallDrop struct {
At time.Time `json:"at"`
Node string `json:"node"`
Direction string `json:"direction"`
Src string `json:"src"`
SrcName string `json:"srcName"`
Dst string `json:"dst"`
DstName string `json:"dstName"`
Protocol string `json:"protocol"`
Port int `json:"port"`
Packets uint64 `json:"packets"`
}
type FirewallPolicy ¶
type FirewallRule ¶
type FirewallSSH ¶ added in v0.3.0
type FirewallSSH struct {
Ports []int `json:"ports"`
Sources []string `json:"sources"`
Rate int `json:"rate"`
Burst int `json:"burst"`
Exempt []string `json:"exempt"`
AutoBan bool `json:"autoBan"`
BanMinutes int `json:"banMinutes"`
}
FirewallSSH is the built-in SSH access of every node (Phase 24).
type GCRun ¶
type GCRun struct {
ID string `json:"id"`
Trigger string `json:"trigger"`
Status string `json:"status"`
Expired int `json:"expired"`
ReclaimedBytes int64 `json:"reclaimedBytes"`
Message string `json:"message"`
StartedAt time.Time `json:"startedAt"`
FinishedAt *time.Time `json:"finishedAt"`
Details []struct {
Repository string `json:"repository"`
Tag string `json:"tag"`
Tags []string `json:"tags"`
SizeBytes int64 `json:"sizeBytes"`
Reason string `json:"reason"`
Outcome string `json:"outcome"`
Error string `json:"error"`
} `json:"details"`
}
type GatewayEndpoint ¶ added in v0.2.2
type GatewayEndpoint struct {
Address string `json:"address"`
ServerName string `json:"serverName,omitempty"`
}
GatewayEndpoint is one way to reach the agent gateway; with ServerName set it goes through Traefik (agent.<domain>:443).
type GitConnection ¶
type GitConnection struct {
ID string `json:"id"`
Kind string `json:"kind"`
Name string `json:"name"`
APIURL string `json:"apiUrl"`
WebURL string `json:"webUrl"`
Account string `json:"account"`
AppSlug string `json:"appSlug,omitempty"`
CreatedAt time.Time `json:"createdAt"`
InstallURL string `json:"installUrl,omitempty"`
Services []string `json:"services"`
Installations []string `json:"installations,omitempty"`
Problem string `json:"problem,omitempty"`
}
GitConnection is a connected Git provider (§5.8).
type GitHubAppManifest ¶
type GitHubAppManifest struct {
PostURL string `json:"postUrl"`
Manifest string `json:"manifest"`
State string `json:"state"`
}
GitHubAppManifest starts the GitHub App flow (finished in a browser).
type GitServer ¶
type GitServer struct {
Enabled bool `json:"enabled"`
State string `json:"state"`
URL string `json:"url"`
Image string `json:"image"`
AdminUser string `json:"adminUser"`
Connection string `json:"connection"`
Problem string `json:"problem,omitempty"`
}
GitServer is the built-in Git server (Forgejo).
type GitSource ¶
type GitSource struct {
URL string `json:"url"`
Branch string `json:"branch"`
Tags string `json:"tags,omitempty"`
Paths []string `json:"paths,omitempty"`
Builder string `json:"builder,omitempty"`
Dockerfile string `json:"dockerfile"`
Context string `json:"context"`
Token string `json:"token,omitempty"`
HasToken bool `json:"hasToken"`
AutoDeploy *bool `json:"autoDeploy,omitempty"`
PollSeconds int `json:"pollSeconds,omitempty"`
WebhookPath string `json:"webhookPath,omitempty"`
WebhookSecret string `json:"webhookSecret,omitempty"`
LastSHA string `json:"lastSha,omitempty"`
LastCheckedAt *time.Time `json:"lastCheckedAt,omitempty"`
LastError string `json:"lastError,omitempty"`
Refs map[string]string `json:"refs,omitempty"`
Connection string `json:"connection,omitempty"`
Repo string `json:"repo,omitempty"`
Webhook string `json:"webhook,omitempty"`
HookError string `json:"hookError,omitempty"`
}
type GitSourceSummary ¶
type GitSourceSummary struct {
GitSource
Project string `json:"project"`
Environment string `json:"environment"`
Service string `json:"service"`
}
GitSourceSummary is a Git source with the service it builds.
type HealthCheck ¶
type HealthCheck struct {
Type string `json:"type"`
Path string `json:"path,omitempty"`
Port string `json:"port,omitempty"`
Command []string `json:"command,omitempty"`
Interval int `json:"interval,omitempty"`
Timeout int `json:"timeout,omitempty"`
Retries int `json:"retries,omitempty"`
StartPeriod int `json:"startPeriod,omitempty"`
}
type IPAM ¶
type IPAM struct {
MeshCIDR string `json:"meshCidr"`
ContainerCIDR string `json:"containerCidr"`
ServiceCIDR string `json:"serviceCidr"`
Nodes []struct {
Node string `json:"node"`
MeshIP string `json:"meshIp"`
Subnet string `json:"subnet"`
Used int `json:"used"`
Capacity int `json:"capacity"`
Addresses []IPAMAddress `json:"addresses"`
} `json:"nodes"`
VIPs []struct {
Service string `json:"service"`
VIP string `json:"vip"`
DNSName string `json:"dnsName"`
Backends int `json:"backends"`
} `json:"vips"`
Released []struct {
Kind string `json:"kind"`
Address string `json:"address"`
ReusableAt time.Time `json:"reusableAt"`
} `json:"released"`
}
type IPAMAddress ¶
type Image ¶
type Image struct {
Tag string `json:"tag"`
Digest string `json:"digest"`
SizeBytes int64 `json:"sizeBytes"`
Platforms []string `json:"platforms"`
Created *time.Time `json:"created"`
PushedAt *time.Time `json:"pushedAt"`
UniqueBytes int64 `json:"uniqueBytes"`
Cache bool `json:"cache"`
Pulls int `json:"pulls"`
LastPulledAt *time.Time `json:"lastPulledAt"`
InUseBy []struct {
Project string `json:"project"`
Environment string `json:"environment"`
Service string `json:"service"`
} `json:"inUseBy"`
BuiltFrom *struct {
ID string `json:"id"`
Ref string `json:"ref"`
SHA string `json:"sha"`
} `json:"builtFrom"`
}
type ImageDetails ¶ added in v0.3.1
type ImageDetails struct {
Tag string `json:"tag"`
Digest string `json:"digest"`
SizeBytes int64 `json:"sizeBytes"`
TotalBytes int64 `json:"totalBytes"`
Platforms []string `json:"platforms"`
Platform string `json:"platform"`
Created *time.Time `json:"created"`
Layers []struct {
Digest string `json:"digest"`
Size int64 `json:"size"`
Command string `json:"command"`
} `json:"layers"`
Entrypoint []string `json:"entrypoint"`
Cmd []string `json:"cmd"`
WorkingDir string `json:"workingDir"`
User string `json:"user"`
Ports []string `json:"ports"`
EnvNames []string `json:"envNames"`
Labels map[string]string `json:"labels"`
}
ImageDetails describes one tag in depth.
type ImageUpdate ¶ added in v0.1.7
type ImageUpdate struct {
Deployed bool `json:"deployed"`
Digest string `json:"digest"`
Revision int `json:"revision"`
Message string `json:"message"`
}
ImageUpdate is the outcome of a check for a newer push of an image.
type Incident ¶
type Incident struct {
ID string `json:"id"`
ServiceID string `json:"serviceId"`
Project string `json:"project"`
Environment string `json:"environment"`
Service string `json:"service"`
State string `json:"state"`
Cause string `json:"cause"`
OpenedAt time.Time `json:"openedAt"`
ClosedAt *time.Time `json:"closedAt"`
}
type IngressMove ¶ added in v0.3.0
type IngressMove struct {
From []string `json:"from"` // empty = the controller
FromController bool `json:"fromController"`
Moved []string `json:"moved"`
StartedAt time.Time `json:"startedAt"`
}
IngressMove is a project's ingress change in progress.
type JobRun ¶
type JobRun struct {
ID string `json:"id"`
Job string `json:"job"`
Project string `json:"project"`
Environment string `json:"environment"`
Service string `json:"service"`
Revision int `json:"revision"`
Trigger string `json:"trigger"`
Attempt int `json:"attempt"`
Status string `json:"status"`
Node string `json:"node"`
ExitCode *int `json:"exitCode"`
Message string `json:"message"`
Command []string `json:"command"`
CreatedAt time.Time `json:"createdAt"`
StartedAt *time.Time `json:"startedAt"`
FinishedAt *time.Time `json:"finishedAt"`
}
type JoinRequest ¶
type JoinResponse ¶
type JoinResponse struct {
NodeID string `json:"nodeId"`
Name string `json:"name"`
Certificate string `json:"certificate"`
CACertificate string `json:"caCertificate"`
GatewayAddress string `json:"gatewayAddress"`
// Gateways lists the addresses to reach the gateway at, in order.
Gateways []GatewayEndpoint `json:"gateways,omitempty"`
}
type JoinToken ¶
type JoinToken struct {
ID string `json:"id"`
Description string `json:"description"`
CreatedAt time.Time `json:"createdAt"`
ExpiresAt time.Time `json:"expiresAt"`
SingleUse bool `json:"singleUse"`
Uses int `json:"uses"`
Token string `json:"token,omitempty"`
Command string `json:"command,omitempty"`
}
type LifecycleDecision ¶
type LifecyclePolicy ¶
type LifecyclePolicy struct {
Repository string `json:"repository"`
Rules []LifecycleRule `json:"rules"`
UpdatedAt time.Time `json:"updatedAt"`
}
type LifecyclePreview ¶ added in v0.3.1
type LifecyclePreview struct {
Images []LifecycleDecision `json:"images"`
Expire int `json:"expire"`
FreesBytes int64 `json:"freesBytes"`
}
LifecyclePreview is a dry run of a policy.
type LifecycleRule ¶
type LogLine ¶
type LogLine struct {
Time time.Time `json:"time"`
Project string `json:"project"`
Environment string `json:"environment"`
Service string `json:"service"`
TaskID string `json:"taskId"`
Revision string `json:"revision"`
Node string `json:"node"`
Stream string `json:"stream"`
Level string `json:"level"`
Message string `json:"message"`
// Fields of request lines (stream "access").
Fields map[string]string `json:"fields,omitempty"`
}
type LogQuery ¶
type LogQuery struct {
Project, Environment, Service, Task, Node, Text string
Since string // e.g. "1h"
Limit int
// Stream "access" selects request lines, which take Status ("5xx") and Client.
Stream, Status, Client string
}
LogQuery selects log lines; empty fields match everything.
type MeshNode ¶
type MeshNode struct {
NodeID string `json:"nodeId"`
Name string `json:"name"`
Address string `json:"address"`
Subnet string `json:"subnet"`
Endpoint string `json:"endpoint"`
PublicKey string `json:"publicKey"`
Mode string `json:"mode"`
Generation uint64 `json:"generation"`
AppliedGen uint64 `json:"appliedGeneration"`
Error string `json:"error"`
Peers []MeshPeer `json:"peers"`
}
type MetricSeries ¶
type Middleware ¶
type NetworkThroughput ¶
type Node ¶
type Node struct {
ID string `json:"id"`
Name string `json:"name"`
Status string `json:"status"`
StatusAt time.Time `json:"statusAt"`
Connected bool `json:"connected"`
LastSeenAt *time.Time `json:"lastSeenAt"`
CreatedAt time.Time `json:"createdAt"`
Info NodeInfo `json:"info"`
Metrics *NodeMetrics `json:"metrics"`
// Schedulable allows new tasks on the node.
Schedulable bool `json:"schedulable"`
Draining bool `json:"draining"`
}
type NodeDocker ¶ added in v0.3.2
type NodeDocker struct {
Node string `json:"node"`
NodeName string `json:"nodeName"`
DiskPath string `json:"diskPath"`
Pending int `json:"pending"`
Totals struct {
ImageBytes int64 `json:"imageBytes"`
ContainerBytes int64 `json:"containerBytes"`
LogBytes int64 `json:"logBytes"`
VolumeBytes int64 `json:"volumeBytes"`
BuildCacheBytes int64 `json:"buildCacheBytes"`
DockerBytes int64 `json:"dockerBytes"`
DiskTotalBytes int64 `json:"diskTotalBytes"`
DiskUsedBytes int64 `json:"diskUsedBytes"`
DiskFreeBytes int64 `json:"diskFreeBytes"`
OtherBytes int64 `json:"otherBytes"`
} `json:"totals"`
Reclaimable struct {
DanglingImages int64 `json:"danglingImages"`
UnusedImages int64 `json:"unusedImages"`
Containers int64 `json:"containers"`
StoppedManaged int64 `json:"stoppedManaged"`
AnonymousVolumes int64 `json:"anonymousVolumes"`
UnusedVolumes int64 `json:"unusedVolumes"`
BuildCache int64 `json:"buildCache"`
} `json:"reclaimable"`
Apps []struct {
Kind string `json:"kind"`
Name string `json:"name"`
Containers int `json:"containers"`
Running int `json:"running"`
ContainerBytes int64 `json:"containerBytes"`
VolumeBytes int64 `json:"volumeBytes"`
ImageBytes int64 `json:"imageBytes"`
Bytes int64 `json:"bytes"`
} `json:"apps"`
Containers []struct {
ID string `json:"id"`
Name string `json:"name"`
State string `json:"state"`
WritableBytes int64 `json:"writableBytes"`
LogBytes int64 `json:"logBytes"`
Managed bool `json:"managed"`
} `json:"containers"`
Images []struct {
ID string `json:"id"`
Tags []string `json:"tags"`
Bytes int64 `json:"bytes"`
Containers int `json:"containers"`
Dangling bool `json:"dangling"`
} `json:"images"`
Volumes []struct {
Name string `json:"name"`
Bytes int64 `json:"bytes"`
RefCount int `json:"refCount"`
Apps []string `json:"apps"`
} `json:"volumes"`
}
NodeDocker is what Docker holds on a node and who it belongs to.
type NodeDockerCleanResult ¶ added in v0.3.2
type NodeDockerCleanResult struct {
ReclaimedBytes int64 `json:"reclaimedBytes"`
Removed int `json:"removed"`
Errors []string `json:"errors"`
}
NodeDockerCleanResult is what a clean did.
type NodeFirewall ¶ added in v0.3.0
type NodeFirewall struct {
Enabled bool `json:"enabled"`
Node string `json:"node"`
Rules []struct {
ID string `json:"id"`
Kind string `json:"kind"`
Protocol string `json:"protocol"`
Ports string `json:"ports"`
Sources []string `json:"sources"`
Description string `json:"description"`
Packets uint64 `json:"packets"`
} `json:"rules"`
SSHPorts []int `json:"sshPorts"`
Listeners []struct {
Protocol string `json:"protocol"`
Address string `json:"address"`
Port int `json:"port"`
Process string `json:"process"`
Verdict string `json:"verdict"`
Rule string `json:"rule"`
} `json:"listeners"`
Blocks []FirewallBlock `json:"blocks"`
Drops []struct {
At time.Time `json:"at"`
Src string `json:"src"`
Protocol string `json:"protocol"`
Port int `json:"port"`
Packets uint64 `json:"packets"`
Direction string `json:"direction"`
} `json:"drops"`
}
NodeFirewall is a node's firewall at a glance.
type NodeInfo ¶
type NodeInfo struct {
Hostname string `json:"hostname"`
OS string `json:"os"`
Kernel string `json:"kernel"`
Arch string `json:"arch"`
CPUCores int `json:"cpuCores"`
MemoryBytes uint64 `json:"memoryBytes"`
DiskBytes uint64 `json:"diskBytes"`
DockerVersion string `json:"dockerVersion"`
AgentVersion string `json:"agentVersion"`
}
type NodeMetrics ¶
type NodeMetrics struct {
CPUPercent float64 `json:"cpuPercent"`
MemoryUsedBytes uint64 `json:"memoryUsedBytes"`
MemoryTotalBytes uint64 `json:"memoryTotalBytes"`
DiskUsedBytes uint64 `json:"diskUsedBytes"`
DiskTotalBytes uint64 `json:"diskTotalBytes"`
Load1 float64 `json:"load1"`
Load5 float64 `json:"load5"`
Load15 float64 `json:"load15"`
NetRxBytes uint64 `json:"netRxBytes"`
NetTxBytes uint64 `json:"netTxBytes"`
UptimeSeconds int64 `json:"uptimeSeconds"`
}
type PortRoute ¶
type PortRoute struct {
Port string `json:"port"`
Container int `json:"container"`
Protocol string `json:"protocol"`
Generated bool `json:"generated"`
Label string `json:"label"`
Host string `json:"host"`
Public bool `json:"public"`
PublicPort int `json:"publicPort"`
Address string `json:"address"`
Allow []string `json:"allow"`
// PortMode is auto (from the range) or chosen; ProxyProtocol and TLS
// are a tcp port's options (Phase 26).
PortMode string `json:"portMode"`
ProxyProtocol bool `json:"proxyProtocol"`
TLS string `json:"tls"`
}
PortRoute is how one port of a service is reached.
type PreviewChange ¶
type PreviewChange struct {
Service string `json:"service"`
Lines []string `json:"lines"`
Tasks int `json:"tasks"`
Nodes []string `json:"nodes"`
}
PreviewChange is one service whose effective rules would change.
type Project ¶
type Project struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Nodes []string `json:"nodes"` // allowed nodes; empty = any
Environments []string `json:"environments"`
RollbackWindow int `json:"rollbackWindow"`
CreatedAt time.Time `json:"createdAt"`
// IngressNodes serve the project's public traffic (empty = the controller).
IngressNodes []string `json:"ingressNodes"`
}
type ProjectAddress ¶
type ProjectAddress struct {
Kind string `json:"kind"`
Service string `json:"service"`
Environment string `json:"environment"`
Port string `json:"port"`
Protocol string `json:"protocol"`
Address string `json:"address"`
RedirectTo string `json:"redirectTo"`
Allow []string `json:"allow"`
DNS *DomainCheck `json:"dns"`
Certificate *struct {
Issuer string `json:"issuer"`
Status string `json:"status"`
} `json:"certificate"`
}
ProjectAddress is one way into a project's service.
type ProjectIngress ¶ added in v0.3.0
type ProjectIngress struct {
Project string `json:"project"`
Nodes []struct {
Name string `json:"name"`
Address string `json:"address"`
State string `json:"state"`
} `json:"nodes"`
Targets []string `json:"targets"`
Base string `json:"base"`
Move *IngressMove `json:"move"`
Pending []string `json:"pending"`
}
ProjectIngress is who serves a project's public traffic.
type ProjectProtection ¶ added in v0.3.0
type ProjectProtection struct {
Project string `json:"project"`
Spec ProtectionSpec `json:"spec"`
Redis struct {
Name string `json:"name"`
Health string `json:"health"`
Active bool `json:"active"`
Fallback bool `json:"fallback"`
} `json:"redis"`
Valkeys []struct {
ID string `json:"id"`
Name string `json:"name"`
Environment string `json:"environment"`
Health string `json:"health"`
} `json:"valkeys"`
OwnNodes bool `json:"ownNodes"`
Stats *struct {
Limited float64 `json:"limited"`
Blocked float64 `json:"blocked"`
Total float64 `json:"total"`
} `json:"stats"`
Secret string `json:"secret"`
}
type ProtectionSpec ¶ added in v0.3.0
type ProtectionSpec struct {
Enabled bool `json:"enabled"`
RateLimit struct {
Average int `json:"average"`
Burst int `json:"burst"`
Period string `json:"period"`
} `json:"rateLimit"`
ClientIP struct {
Source string `json:"source"`
Depth int `json:"depth"`
Header string `json:"header"`
} `json:"clientIp"`
MaxConcurrent int `json:"maxConcurrent"`
MaxBodyMB int `json:"maxBodyMb"`
Block []string `json:"block"`
Bypass struct {
IPs []string `json:"ips"`
Header string `json:"header"`
HasSecret bool `json:"hasSecret"`
Paths []string `json:"paths"`
} `json:"bypass"`
Redis struct {
DatabaseID string `json:"databaseId"`
} `json:"redis"`
Guard struct {
Rate int `json:"rate"`
Burst int `json:"burst"`
MaxConnections int `json:"maxConnections"`
BanMinutes int `json:"banMinutes"`
} `json:"guard"`
}
ProtectionSpec is a project's traffic protection (Phase 25).
type Reachability ¶
type RegistryEvent ¶
type RegistryInfo ¶
type RegistryInfo struct {
Host string `json:"host"`
Alias string `json:"alias"`
Login string `json:"login"`
SelfSigned bool `json:"selfSigned,omitempty"`
Certificate string `json:"certificate,omitempty"`
Trust string `json:"trust,omitempty"`
}
RegistryInfo is the registry's address and how to push to it.
type RegistryRepoUsage ¶ added in v0.3.1
type RegistryRepoUsage struct {
Name string `json:"name"`
System bool `json:"system"`
Images int `json:"images"`
Tags int `json:"tags"`
Bytes int64 `json:"bytes"`
UniqueBytes int64 `json:"uniqueBytes"`
CacheBytes int64 `json:"cacheBytes"`
}
RegistryRepoUsage is what one repository holds in the registry's storage.
type RegistryStorage ¶ added in v0.1.9
type RegistryStorage struct {
RegistryStorageTarget
EndpointName string `json:"endpointName"`
EndpointURL string `json:"endpointUrl"`
Switch *RegistryStorageSwitch `json:"switch"`
}
type RegistryStorageSwitch ¶ added in v0.1.9
type RegistryStorageSwitch struct {
From RegistryStorageTarget `json:"from"`
To RegistryStorageTarget `json:"to"`
State string `json:"state"`
Step string `json:"step"`
Progress struct {
Repositories int `json:"repositories"`
RepositoriesDone int `json:"repositoriesDone"`
Images int `json:"images"`
ImagesDone int `json:"imagesDone"`
Blobs int `json:"blobs"`
Skipped int `json:"skipped"`
Bytes int64 `json:"bytes"`
Current string `json:"current"`
} `json:"progress"`
Message string `json:"message"`
Kept string `json:"kept"`
Freed int64 `json:"freedBytes"`
StartedAt time.Time `json:"startedAt"`
EndedAt *time.Time `json:"endedAt"`
}
type RegistryStorageTarget ¶ added in v0.1.9
type RegistryStorageTarget struct {
Driver string `json:"driver"` // disk | s3
Endpoint string `json:"endpoint,omitempty"`
Bucket string `json:"bucket,omitempty"`
Prefix string `json:"prefix,omitempty"`
}
RegistryStorageTarget is where the registry keeps images (Phase 19).
type RegistryUsage ¶ added in v0.3.1
type RegistryUsage struct {
Repositories []RegistryRepoUsage `json:"repositories"`
ReferencedBytes int64 `json:"referencedBytes"`
CacheBytes int64 `json:"cacheBytes"`
StorageBytes *int64 `json:"storageBytes"`
UnreferencedBytes *int64 `json:"unreferencedBytes"`
MeasuredAt time.Time `json:"measuredAt"`
}
RegistryUsage is where the registry's storage goes.
type Repository ¶
type RouteTraffic ¶
type RouteTraffic struct {
ServiceID string `json:"serviceId"`
Project string `json:"project"`
Environment string `json:"environment"`
Service string `json:"service"`
RPS float64 `json:"rps"`
Errors4xx float64 `json:"errors4xx"`
Errors5xx float64 `json:"errors5xx"`
P50Ms float64 `json:"p50Ms"`
P95Ms float64 `json:"p95Ms"`
BytesIn float64 `json:"bytesIn"`
BytesOut float64 `json:"bytesOut"`
}
RouteTraffic is one routed service's traffic over the last minutes.
type RoutingInput ¶
type RoutingInput struct {
Generated *bool `json:"generated,omitempty"`
Label *string `json:"label,omitempty"`
Public *bool `json:"public,omitempty"`
Allow []string `json:"allow,omitempty"`
// PublicPort chooses the public port (0: an automatic one).
PublicPort *int `json:"publicPort,omitempty"`
ProxyProtocol *bool `json:"proxyProtocol,omitempty"`
TLS *string `json:"tls,omitempty"` // none | terminate
}
RoutingInput changes one port's routing; nil fields keep their value.
type RuleCounter ¶
type RuleMatch ¶
type RuleMatch struct {
GroupID string `json:"groupId"`
Group string `json:"group"`
Direction string `json:"direction"`
Index int `json:"index"`
Rule SecurityRule `json:"rule"`
}
type SMTP ¶ added in v0.2.0
type SMTP struct {
Configured bool `json:"configured,omitempty"`
Host string `json:"host"`
Port int `json:"port,omitempty"`
Security string `json:"security,omitempty"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
HasPassword bool `json:"hasPassword,omitempty"`
From string `json:"from"`
FromName string `json:"fromName,omitempty"`
}
SMTP is the platform mail server (Phase 20a).
type ScalingEvent ¶
type ScalingPolicy ¶
type ScalingPolicy struct {
Enabled bool `json:"enabled"`
Min int `json:"min"`
Max int `json:"max"`
Metric string `json:"metric"`
Target float64 `json:"target"`
ScaleOutCooldown int `json:"scaleOutCooldown,omitempty"`
ScaleInCooldown int `json:"scaleInCooldown,omitempty"`
ScaleInChecks int `json:"scaleInChecks,omitempty"`
UpdatedAt time.Time `json:"updatedAt,omitempty"`
UpdatedBy string `json:"updatedBy,omitempty"`
}
ScalingPolicy is a target tracking policy (§5.5).
type SecurityGroup ¶
type SecurityGroup struct {
ID string `json:"id,omitempty"`
Project string `json:"project,omitempty"`
Name string `json:"name"`
Description string `json:"description"`
Default bool `json:"default,omitempty"`
Inbound []SecurityRule `json:"inbound"`
Outbound []SecurityRule `json:"outbound"`
Services []string `json:"services"`
Members []string `json:"members,omitempty"`
CreatedAt *time.Time `json:"createdAt,omitempty"`
UpdatedAt *time.Time `json:"updatedAt,omitempty"`
}
type SecurityRule ¶
type SecurityRule struct {
Protocol string `json:"protocol"`
Ports string `json:"ports"`
Peers []string `json:"peers"`
Description string `json:"description"`
Packets uint64 `json:"packets,omitempty"`
Bytes uint64 `json:"bytes,omitempty"`
}
SecurityRule allows traffic to (inbound) or from (outbound) a group's members (§8.3).
type Service ¶
type Service struct {
ID string `json:"id"`
Project string `json:"project"`
Environment string `json:"environment"`
Name string `json:"name"`
Revision int `json:"revision"`
DesiredCount int `json:"desiredCount"`
Running int `json:"running"`
Pending int `json:"pending"`
Status string `json:"status"`
Deleting bool `json:"deleting"`
Spec ServiceSpec `json:"spec"`
Endpoints []string `json:"endpoints"`
VIP string `json:"vip"`
DNSName string `json:"dnsName"`
Deployment *Deployment `json:"deployment"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
type ServiceDomain ¶
type ServiceHealth ¶
type ServiceHealth struct {
ServiceID string `json:"serviceId"`
Project string `json:"project"`
Environment string `json:"environment"`
Service string `json:"service"`
State string `json:"state"`
Reason string `json:"reason"`
Serving int `json:"serving"`
Desired int `json:"desired"`
Uptime24h *float64 `json:"uptime24h"`
Uptime7d *float64 `json:"uptime7d"`
LastCheck *struct {
OK bool `json:"ok"`
Status int `json:"status"`
LatencyMs float64 `json:"latencyMs"`
Error string `json:"error"`
} `json:"lastCheck"`
Incident *Incident `json:"incident"`
}
type ServicePort ¶
type ServiceSecurity ¶
type ServiceSecurity struct {
Groups []SecurityGroup `json:"groups"`
Lines []string `json:"lines"`
}
type ServiceSpec ¶
type ServiceSpec struct {
Image string `json:"image"`
Command []string `json:"command,omitempty"`
Env map[string]string `json:"env,omitempty"`
Ports []ServicePort `json:"ports,omitempty"`
Resources struct {
CPU float64 `json:"cpu,omitempty"`
Memory int `json:"memory,omitempty"`
CPUMode string `json:"cpuMode,omitempty"` // "" (shared) | "reserved"
MemoryMode string `json:"memoryMode,omitempty"` // "" (shared) | "reserved"
CPULimit float64 `json:"cpuLimit,omitempty"`
MemoryLimit int `json:"memoryLimit,omitempty"`
} `json:"resources"`
Placement struct {
Strategy string `json:"strategy,omitempty"`
} `json:"placement"`
Health *HealthCheck `json:"health,omitempty"`
Deployment map[string]any `json:"deployment,omitempty"`
DesiredCount *int `json:"desiredCount,omitempty"`
}
type SystemStatus ¶
type SystemTask ¶
type SystemTask struct {
TaskID string `json:"taskId"`
Name string `json:"name"`
Description string `json:"description"`
Image string `json:"image"`
Node string `json:"node"`
State string `json:"state"`
Health string `json:"health"`
Error string `json:"error"`
ContainerID string `json:"containerId"`
StartedAt *time.Time `json:"startedAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
type Task ¶
type Task struct {
ID string `json:"id"`
ServiceID string `json:"serviceId"`
Project string `json:"project"`
Environment string `json:"environment"`
Service string `json:"service"`
Revision int `json:"revision"`
NodeID string `json:"nodeId"`
Node string `json:"node"`
Desired string `json:"desired"`
State string `json:"state"`
IP string `json:"ip"`
ContainerID string `json:"containerId"`
Health string `json:"health"`
ExitCode int `json:"exitCode"`
Error string `json:"error"`
CreatedAt time.Time `json:"createdAt"`
StartedAt *time.Time `json:"startedAt"`
FinishedAt *time.Time `json:"finishedAt"`
}
type Traffic ¶
type Traffic struct {
Metrics
Routes []RouteTraffic `json:"routes"`
WindowSeconds int `json:"windowSeconds"`
}
type TrafficMapRoute ¶
type TrafficMapRoute struct {
RouteTraffic
Hosts []string `json:"hosts"`
Tasks []TrafficMapTask `json:"tasks"`
}