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 Autoscaling
- type BackupConfig
- type BackupObject
- type BackupSettings
- type Build
- type BuildSettings
- type BuildSettingsInput
- type Certificate
- 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) CheckDomain(ctx context.Context, host string) (DomainCheck, error)
- func (c *Client) CheckReachability(ctx context.Context, from, to, protocol string, port int) (Reachability, 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) CreateEnvironment(ctx context.Context, project, name string) (Environment, 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) 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) DNSLookup(ctx context.Context, name string) (DNSAnswer, error)
- func (c *Client) DNSRecords(ctx context.Context) ([]DNSRecord, 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) DeleteEnvironment(ctx context.Context, project, name string, everything bool) (pending bool, err 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) 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) error
- func (c *Client) DeleteProject(ctx context.Context, name string, everything bool) (pending bool, err 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) DrainNode(ctx context.Context, id string) (Node, error)
- func (c *Client) EffectiveFirewall(ctx context.Context, nodeID string) (EffectiveFirewall, error)
- func (c *Client) ExecDial(ctx context.Context, taskID string, command []string, tty bool, cols, rows int) (*websocket.Conn, 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) GetAutoscaling(ctx context.Context, project, env, service string) (Autoscaling, error)
- func (c *Client) GetBackupConfig(ctx context.Context) (BackupSettings, error)
- func (c *Client) GetBuildSettings(ctx context.Context, project, env, service string) (BuildSettings, error)
- func (c *Client) GetDeployment(ctx context.Context, project, env, name, id string) (DeploymentDetail, error)
- func (c *Client) GetDomainSettings(ctx context.Context) (DomainSettings, 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) GetRouting(ctx context.Context, project, env, name string) ([]PortRoute, error)
- func (c *Client) GetRun(ctx context.Context, id string) (JobRun, 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) 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) ListEnvironments(ctx context.Context, project string) ([]Environment, 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) NodeShellDial(ctx context.Context, nodeID string, command []string, tty bool, cols, rows int) (*websocket.Conn, error)
- func (c *Client) PreviewLifecyclePolicy(ctx context.Context, repo string, rules []LifecycleRule) ([]LifecycleDecision, 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) RemoveServiceDomain(ctx context.Context, project, env, name, host string) error
- func (c *Client) RenewCertificate(ctx context.Context, host string) error
- func (c *Client) RestartTask(ctx context.Context, id string) 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) SetBackupConfig(ctx context.Context, cfg BackupConfig) (BackupSettings, error)
- func (c *Client) SetBaseDomain(ctx context.Context, baseDomain string) (DomainSettings, error)
- func (c *Client) SetBuildSettings(ctx context.Context, project, env, service string, in BuildSettingsInput) (BuildSettings, error)
- func (c *Client) SetEnvironmentPolicy(ctx context.Context, project, env string, in EnvironmentPolicy) (Environment, 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) SetProjectNodes(ctx context.Context, project string, nodes []string) (Project, error)
- func (c *Client) SetRouting(ctx context.Context, project, env, name string, ports map[string]RoutingInput) ([]PortRoute, 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) TailLogs(ctx context.Context, q LogQuery, fn func(LogLine)) error
- func (c *Client) TestAlertChannel(ctx context.Context, id string) 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) 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) Whoami(ctx context.Context) (User, error)
- func (c *Client) WithTLS(cfg *tls.Config) *Client
- type Credentials
- type DNSAnswer
- type DNSRecord
- type Deployment
- type DeploymentChange
- type DeploymentDetail
- type DomainCheck
- type DomainOptions
- type DomainSettings
- type EffectiveFirewall
- type Environment
- type EnvironmentPolicy
- type Error
- type FirewallDrop
- type FirewallPolicy
- type FirewallRule
- type GCRun
- type GitConnection
- type GitHubAppManifest
- type GitRepo
- type GitServer
- type GitSource
- type GitSourceSummary
- type HealthCheck
- type IPAM
- type IPAMAddress
- type Image
- type Incident
- type Job
- type JobRun
- type JoinRequest
- type JoinResponse
- type JoinToken
- type LifecycleDecision
- type LifecyclePolicy
- type LifecycleRule
- type LogLine
- type LogQuery
- type Mesh
- type MeshNode
- type MeshPeer
- type MetricSeries
- type Metrics
- type Middleware
- type NetworkThroughput
- type Node
- type NodeInfo
- type NodeMetrics
- type PortRoute
- type PreviewChange
- type Project
- type ProjectAddress
- type Reachability
- type RegistryEvent
- type RegistryInfo
- type Repository
- type Revision
- type RouteTraffic
- type RoutingInput
- type RuleCounter
- type RuleMatch
- 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 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 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"`
}
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) CheckDomain ¶
func (*Client) CheckReachability ¶
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) CreateEnvironment ¶
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) CreateSecurityGroup ¶
func (c *Client) CreateSecurityGroup(ctx context.Context, project string, g SecurityGroup) (SecurityGroup, error)
func (*Client) CreateToken ¶
func (*Client) DeleteAccessKey ¶
func (*Client) DeleteAlertChannel ¶
func (*Client) DeleteAlertRule ¶
func (*Client) DeleteAutoscaling ¶
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) DeleteFirewallPolicy ¶
func (*Client) DeleteGitConnection ¶
func (*Client) DeleteGitSource ¶
func (*Client) DeleteImage ¶
func (*Client) DeleteJoinToken ¶
func (*Client) DeleteLifecyclePolicy ¶
func (*Client) DeleteMiddleware ¶
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) 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) EffectiveFirewall ¶
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) FirewallCounters ¶
func (*Client) FirewallDrops ¶
func (*Client) GetAutoscaling ¶
func (*Client) GetBackupConfig ¶
func (c *Client) GetBackupConfig(ctx context.Context) (BackupSettings, error)
func (*Client) GetBuildSettings ¶
func (*Client) GetDeployment ¶
func (*Client) GetDomainSettings ¶
func (c *Client) GetDomainSettings(ctx context.Context) (DomainSettings, error)
func (*Client) GetGitConnection ¶
func (*Client) GetGitSource ¶
func (*Client) GetLifecyclePolicy ¶
func (*Client) GetRouting ¶
func (*Client) GetSecurityGroup ¶
func (*Client) GetService ¶
func (*Client) GitServerCredentials ¶
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) ListEnvironments ¶
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) 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) PreviewLifecyclePolicy ¶
func (c *Client) PreviewLifecyclePolicy(ctx context.Context, repo string, rules []LifecycleRule) ([]LifecycleDecision, 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) RemoveServiceDomain ¶
func (*Client) RenewCertificate ¶
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) SetBackupConfig ¶
func (c *Client) SetBackupConfig(ctx context.Context, cfg BackupConfig) (BackupSettings, error)
func (*Client) SetBaseDomain ¶
func (*Client) SetBuildSettings ¶
func (c *Client) SetBuildSettings(ctx context.Context, project, env, service string, in BuildSettingsInput) (BuildSettings, error)
func (*Client) SetEnvironmentPolicy ¶
func (c *Client) SetEnvironmentPolicy(ctx context.Context, project, env string, in EnvironmentPolicy) (Environment, error)
func (*Client) SetGitServer ¶
func (*Client) SetGitSource ¶
func (*Client) SetNodeSchedulable ¶
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) 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) TestAlertChannel ¶
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) 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 ¶
type Credentials ¶
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"`
Message string `json:"message"`
} `json:"events"`
Runs []JobRun `json:"runs"`
}
DeploymentDetail is one deployment with its timeline and hook runs.
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 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 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 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"`
Reason string `json:"reason"`
} `json:"details"`
}
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"`
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"`
}
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 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 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 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 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"`
}
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 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 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 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"`
}
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 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"`
}