Documentation
¶
Index ¶
- Constants
- Variables
- func ValidateGARMAgentVersion(version string) error
- type AcquirableJob
- type AcquirableJobList
- type ActionsServiceAdminInfoRequest
- type ActionsServiceAdminInfoResponse
- func (a ActionsServiceAdminInfoResponse) ExiresAt() (time.Time, error)
- func (a ActionsServiceAdminInfoResponse) ExpiresIn(t time.Duration) bool
- func (a ActionsServiceAdminInfoResponse) GetURL() (*url.URL, error)
- func (a ActionsServiceAdminInfoResponse) IsExpired() bool
- func (a ActionsServiceAdminInfoResponse) TimeRemaining() (time.Duration, error)
- type AgentCapabilities
- type BootstrapInstance
- type CertificateBundle
- type ControllerInfo
- type CreateEnterpriseParams
- type CreateFileObjectParams
- type CreateForgeInstanceParams
- type CreateGARMToolParams
- type CreateGiteaCredentialsParams
- type CreateGiteaEndpointParams
- type CreateGithubCredentialsParams
- type CreateGithubEndpointParams
- type CreateInstanceParams
- type CreateOrgParams
- type CreatePoolParams
- type CreateProxyParams
- type CreateRepoParams
- type CreateScaleSetParams
- type CreateTemplateParams
- type CreationDateGetter
- type Credentials
- type EndpointType
- type Enterprise
- type EnterpriseFilter
- type Enterprises
- type EntityEvent
- type EntityGetter
- type Event
- type EventLevel
- type EventType
- type FileObject
- type FileObjectPaginatedResponse
- type ForgeAuthType
- type ForgeCredentials
- func (g ForgeCredentials) CACertPool() (*x509.CertPool, error)
- func (g ForgeCredentials) CriticalRateLimitReached() (bool, time.Time)
- func (g ForgeCredentials) GetBaseTransport() (*http.Transport, error)
- func (g ForgeCredentials) GetHTTPClient(ctx context.Context) (*http.Client, error)
- func (g ForgeCredentials) GetID() uint
- func (g ForgeCredentials) HTTPClientForURL(ctx context.Context, rawURL string) (*http.Client, error)
- func (g ForgeCredentials) RateLimitReached() (bool, time.Time)
- func (g ForgeCredentials) RootCertificateBundle() (CertificateBundle, error)
- func (g ForgeCredentials) ServesURL(rawURL string) bool
- type ForgeCredentialsGetter
- type ForgeEndpoint
- type ForgeEndpoints
- type ForgeEntity
- func (g ForgeEntity) ForgeURL() string
- func (g ForgeEntity) GetCreatedAt() time.Time
- func (g ForgeEntity) GetForgeType() (EndpointType, error)
- func (g ForgeEntity) GetIDAsUUID() (uuid.UUID, error)
- func (g ForgeEntity) GetPoolBalancerType() PoolBalancerType
- func (g ForgeEntity) LabelScope() string
- func (g ForgeEntity) String() string
- type ForgeEntityType
- type ForgeInstance
- type ForgeInstanceFilter
- type ForgeInstances
- type GARMAgentRelease
- type GARMAgentReleaseAsset
- type GARMAgentReleases
- type GARMAgentTool
- type GARMAgentToolsPaginatedResponse
- type GARMToolsManager
- type GithubApp
- type GithubPAT
- type GithubRateLimit
- type HookInfo
- type IDGetter
- type InstallWebhookParams
- type Instance
- type InstanceMetadata
- type InstanceRequest
- type InstanceUpdateMessage
- type Instances
- type JWTResponse
- type Job
- type JobStatus
- type Jobs
- type JobsPaginatedResponse
- type Label
- type ListJobsFilter
- type MetadataServiceAccessDetails
- type NewUserParams
- type Organization
- type OrganizationFilter
- type Organizations
- type PaginatedResponse
- type PasswordLoginParams
- type Pool
- func (p Pool) BelongsTo(entity ForgeEntity) bool
- func (p Pool) GetCreatedAt() time.Time
- func (p Pool) GetEntity() (ForgeEntity, error)
- func (p Pool) GetID() string
- func (p *Pool) HasRequiredLabels(set []string) bool
- func (p Pool) MaxRunnersAsInt() int
- func (p Pool) MinIdleRunnersAsInt() int
- func (p *Pool) PoolType() ForgeEntityType
- func (p *Pool) RunnerTimeout() uint
- type PoolBalancerType
- type PoolManagerStatus
- type Pools
- type Provider
- type ProviderType
- type Providers
- type Proxies
- type Proxy
- type Repositories
- type Repository
- func (r Repository) CreationDateGetter() time.Time
- func (r Repository) GetBalancerType() PoolBalancerType
- func (r Repository) GetCredentialsName() string
- func (r Repository) GetEntity() (ForgeEntity, error)
- func (r Repository) GetID() string
- func (r Repository) GetName() string
- func (r Repository) String() string
- type RepositoryFilter
- type RestoreTemplateRequest
- type RunnerGroup
- type RunnerGroupList
- type RunnerInfo
- type RunnerPrefix
- type RunnerReference
- type RunnerReferenceList
- type RunnerScaleSet
- type RunnerScaleSetJitRunnerConfig
- type RunnerScaleSetMessage
- type RunnerScaleSetSession
- type RunnerScaleSetStatistic
- type RunnerScaleSetsResponse
- type RunnerSetting
- type RunnerStatus
- type ScaleSet
- func (p ScaleSet) BelongsTo(entity ForgeEntity) bool
- func (p ScaleSet) GetEntity() (ForgeEntity, error)
- func (p ScaleSet) GetID() uint
- func (p ScaleSet) GitHubLabels() []Label
- func (p ScaleSet) HasRequiredLabels(set []string) bool
- func (p *ScaleSet) RunnerTimeout() uint
- func (p *ScaleSet) ScaleSetType() ForgeEntityType
- type ScaleSetJob
- type ScaleSetJobMessage
- type ScaleSetJobs
- type ScaleSetJobsPaginatedResponse
- type ScaleSetMessageType
- type ScaleSetState
- type ScaleSets
- type StatusMessage
- type Tag
- type Template
- type Templates
- type UpdateControllerParams
- type UpdateEntityParams
- type UpdateFileObjectParams
- type UpdateGiteaCredentialsParams
- type UpdateGiteaEndpointParams
- type UpdateGithubCredentialsParams
- type UpdateGithubEndpointParams
- type UpdateInstanceParams
- type UpdatePoolParams
- type UpdateProxyParams
- type UpdateScaleSetParams
- type UpdateSystemInfoParams
- type UpdateTemplateParams
- type UpdateUserParams
- type User
- type UserDataOptions
- type WebhookEndpointType
- type WorkflowJob
Constants ¶
const ( MetricsLabelEnterpriseScope = "Enterprise" MetricsLabelRepositoryScope = "Repository" MetricsLabelOrganizationScope = "Organization" MetricsLabelInstanceScope = "Instance" )
const ( MessageTypeJobAssigned = "JobAssigned" MessageTypeJobCompleted = "JobCompleted" MessageTypeJobStarted = "JobStarted" MessageTypeJobAvailable = "JobAvailable" )
const ( // ToolSourceLocal indicates the tool is stored in the internal object store. ToolSourceLocal = "local" // ToolSourceUpstream indicates the tool is only available from the upstream // cached release and has not been downloaded locally. ToolSourceUpstream = "upstream" )
const (
DefaultRunnerPrefix string = "garm"
)
const GARMAgentLatestVersion = "latest"
GARMAgentLatestVersion denotes that the controller should track the latest GARM agent release available at GARMAgentReleasesURL. An empty version is equivalent.
const MaxReserveUsagePercentage = 50
MaxReserveUsagePercentage is the highest allowed value for ReserveUsagePercentage. Reserving more than half of the quota for critical operations leaves too little for normal operations and effectively breaks scaling.
const (
// SystemUser is a virtual user that identifies the system itself.
SystemUser = "system"
)
Variables ¶
var InstanceStatusTransitions = map[commonParams.InstanceStatus][]commonParams.InstanceStatus{ commonParams.InstanceRunning: { commonParams.InstancePendingDelete, commonParams.InstancePendingForceDelete, commonParams.InstanceStopped, commonParams.InstanceStatusUnknown, }, commonParams.InstanceStopped: { commonParams.InstancePendingDelete, commonParams.InstancePendingForceDelete, commonParams.InstanceRunning, commonParams.InstanceStatusUnknown, }, commonParams.InstanceError: { commonParams.InstancePendingDelete, commonParams.InstancePendingForceDelete, commonParams.InstanceStatusUnknown, commonParams.InstanceDeleting, }, commonParams.InstancePendingDelete: { commonParams.InstanceDeleting, commonParams.InstancePendingForceDelete, }, commonParams.InstancePendingForceDelete: { commonParams.InstanceDeleting, }, commonParams.InstanceDeleting: { commonParams.InstanceError, commonParams.InstanceDeleted, }, commonParams.InstanceDeleted: {}, commonParams.InstancePendingCreate: { commonParams.InstancePendingDelete, commonParams.InstanceCreating, commonParams.InstancePendingForceDelete, }, commonParams.InstanceCreating: { commonParams.InstanceError, commonParams.InstanceRunning, }, commonParams.InstanceStatusUnknown: { commonParams.InstanceRunning, commonParams.InstanceStopped, commonParams.InstanceError, commonParams.InstancePendingDelete, commonParams.InstancePendingForceDelete, commonParams.InstanceDeleting, commonParams.InstanceDeleted, commonParams.InstancePendingCreate, commonParams.InstanceCreating, }, }
var RunnerStatusTransitions = map[RunnerStatus][]RunnerStatus{ RunnerPending: { RunnerFailed, RunnerInstalling, RunnerTerminated, RunnerPending, RunnerActive, }, RunnerInstalling: { RunnerFailed, RunnerIdle, RunnerTerminated, RunnerInstalling, RunnerActive, RunnerOffline, }, RunnerIdle: { RunnerOffline, RunnerActive, RunnerTerminated, RunnerIdle, }, RunnerActive: { RunnerTerminated, RunnerActive, }, RunnerFailed: { RunnerTerminated, RunnerFailed, }, RunnerOffline: { RunnerIdle, RunnerActive, RunnerTerminated, RunnerOffline, }, RunnerTerminated: { RunnerTerminated, }, }
Functions ¶
func ValidateGARMAgentVersion ¶ added in v0.2.2
ValidateGARMAgentVersion checks that a GARM agent version is either empty, the "latest" keyword or a valid semver version (with or without a leading "v"). It is used by the API, the CLI and the database layer so an invalid version is rejected everywhere controller info can be updated.
Types ¶
type AcquirableJob ¶ added in v0.2.0
type AcquirableJob struct {
AcquireJobURL string `json:"acquireJobUrl"`
MessageType string `json:"messageType"`
RunnerRequestID int64 `json:"run0ne00rRequestId"`
RepositoryName string `json:"repositoryName"`
OwnerName string `json:"ownerName"`
JobWorkflowRef string `json:"jobWorkflowRef"`
EventName string `json:"eventName"`
RequestLabels []string `json:"requestLabels"`
}
type AcquirableJobList ¶ added in v0.2.0
type AcquirableJobList struct {
Count int `json:"count"`
Jobs []AcquirableJob `json:"value"`
}
type ActionsServiceAdminInfoRequest ¶ added in v0.2.0
type ActionsServiceAdminInfoResponse ¶ added in v0.2.0
type ActionsServiceAdminInfoResponse struct {
URL string `json:"url,omitempty"`
Token string `json:"token,omitempty"`
}
func (ActionsServiceAdminInfoResponse) ExiresAt ¶ added in v0.2.0
func (a ActionsServiceAdminInfoResponse) ExiresAt() (time.Time, error)
func (ActionsServiceAdminInfoResponse) ExpiresIn ¶ added in v0.2.0
func (a ActionsServiceAdminInfoResponse) ExpiresIn(t time.Duration) bool
func (ActionsServiceAdminInfoResponse) GetURL ¶ added in v0.2.0
func (a ActionsServiceAdminInfoResponse) GetURL() (*url.URL, error)
func (ActionsServiceAdminInfoResponse) IsExpired ¶ added in v0.2.0
func (a ActionsServiceAdminInfoResponse) IsExpired() bool
func (ActionsServiceAdminInfoResponse) TimeRemaining ¶ added in v0.2.0
func (a ActionsServiceAdminInfoResponse) TimeRemaining() (time.Duration, error)
type AgentCapabilities ¶ added in v0.2.0
type AgentCapabilities struct {
Shell bool `json:"has_shell"`
}
swagger:model AgentCapabilities
type BootstrapInstance ¶
type BootstrapInstance struct {
Name string `json:"name,omitempty"`
Tools []*github.RunnerApplicationDownload `json:"tools,omitempty"`
// RepoURL is the URL the github runner agent needs to configure itself.
RepoURL string `json:"repo_url,omitempty"`
// CallbackUrl is the URL where the instance can send a post, signaling
// progress or status.
CallbackURL string `json:"callback-url,omitempty"`
// MetadataURL is the URL where instances can fetch information needed to set themselves up.
MetadataURL string `json:"metadata-url,omitempty"`
// InstanceToken is the token that needs to be set by the instance in the headers
// in order to send updated back to the garm via CallbackURL.
InstanceToken string `json:"instance-token,omitempty"`
// SSHKeys are the ssh public keys we may want to inject inside the runners, if the
// provider supports it.
SSHKeys []string `json:"ssh-keys,omitempty"`
// ExtraSpecs is an opaque raw json that gets sent to the provider
// as part of the bootstrap params for instances. It can contain
// any kind of data needed by providers. The contents of this field means
// nothing to garm itself. We don't act on the information in this field at
// all. We only validate that it's a proper json.
ExtraSpecs json.RawMessage `json:"extra_specs,omitempty"`
// GitHubRunnerGroup is the github runner group in which the newly installed runner
// should be added to. The runner group must be created by someone with access to the
// enterprise.
GitHubRunnerGroup string `json:"github-runner-group,omitempty"`
// CACertBundle is a CA certificate bundle which will be sent to instances and which
// will tipically be installed as a system wide trusted root CA. by either cloud-init
// or whatever mechanism the provider will use to set up the runner.
//
// swagger:strfmt byte
CACertBundle []byte `json:"ca-cert-bundle,omitempty"`
// OSArch is the target OS CPU architecture of the runner.
OSArch commonParams.OSArch `json:"arch,omitempty"`
// OSType is the target OS platform of the runner (windows, linux).
OSType commonParams.OSType `json:"os_type,omitempty"`
// Flavor is the platform specific abstraction that defines what resources will be allocated
// to the runner (CPU, RAM, disk space, etc). This field is meaningful to the provider which
// handles the actual creation.
Flavor string `json:"flavor,omitempty"`
// Image is the platform specific identifier of the operating system template that will be used
// to spin up a new machine.
Image string `json:"image,omitempty"`
// Labels are a list of github runner labels that will be added to the runner.
Labels []string `json:"labels,omitempty"`
// PoolID is the ID of the garm pool to which this runner belongs.
PoolID string `json:"pool_id,omitempty"`
// UserDataOptions are the options for the user data generation.
UserDataOptions UserDataOptions `json:"user_data_options,omitempty"`
}
type CertificateBundle ¶ added in v0.1.4
type ControllerInfo ¶
type ControllerInfo struct {
// ControllerID is the unique ID of this controller. This ID gets generated
// automatically on controller init.
ControllerID uuid.UUID `json:"controller_id,omitempty"`
// Hostname is the hostname of the machine that runs this controller. In the
// future, this field will be migrated to a separate table that will keep track
// of each the controller nodes that are part of a cluster. This will happen when
// we implement controller scale-out capability.
Hostname string `json:"hostname,omitempty"`
// MetadataURL is the public metadata URL of the GARM instance. This URL is used
// by instances to fetch information they need to set themselves up. The URL itself
// may be made available to runners via a reverse proxy or a load balancer. That
// means that the user is responsible for telling GARM what the public URL is, by
// setting this field.
MetadataURL string `json:"metadata_url,omitempty"`
// CallbackURL is the URL where instances can send updates back to the controller.
// This URL is used by instances to send status updates back to the controller. The
// URL itself may be made available to instances via a reverse proxy or a load balancer.
// That means that the user is responsible for telling GARM what the public URL is, by
// setting this field.
CallbackURL string `json:"callback_url,omitempty"`
// WebhookURL is the base URL where the controller will receive webhooks from github.
// When webhook management is used, this URL is used as a base to which the controller
// UUID is appended and which will receive the webhooks.
// The URL itself may be made available to instances via a reverse proxy or a load balancer.
// That means that the user is responsible for telling GARM what the public URL is, by
// setting this field.
WebhookURL string `json:"webhook_url,omitempty"`
// ControllerWebhookURL is the controller specific URL where webhooks will be received.
// This field holds the WebhookURL defined above to which we append the ControllerID.
// Functionally it is the same as WebhookURL, but it allows us to safely manage webhooks
// from GARM without accidentally removing webhooks from other services or GARM controllers.
ControllerWebhookURL string `json:"controller_webhook_url,omitempty"`
// AgentURL is the URL where the GARM agent will connect. If set behind a reverse proxy, this
// URL must be configured to allow websocket connections.
AgentURL string `json:"agent_url,omitempty"`
// GARMAgentReleasesURL is the URL from where GARM can fetch garm-agent binaries. This URL must
// have an API response compatible with the github releases API.
// The default value for this field is: https://api.github.com/repos/cloudbase/garm-agent/releases
GARMAgentReleasesURL string `json:"garm_agent_releases_url"`
// SyncGARMAgentTools enables or disables automatic sync of garm-agent tools.
SyncGARMAgentTools bool `json:"enable_agent_tools_sync"`
// GARMAgentVersion is the garm-agent version the controller uses. Empty or
// "latest" tracks the newest stable release available at GARMAgentReleasesURL.
// A specific semver version pins the release that gets cached and (when
// SyncGARMAgentTools is enabled) downloaded, for operators who want to
// stick with a known good agent version.
GARMAgentVersion string `json:"garm_agent_version"`
// AllowInsecureGARMAgent configures deployed garm-agents with
// force_insecure enabled, permitting them to connect back to GARM over
// plain http/ws when GARM itself does not use TLS. The agent token is
// sent in plain text; meant for local development and testing only.
AllowInsecureGARMAgent bool `json:"allow_insecure_garm_agent"`
// MinimumJobAgeBackoff is the minimum time in seconds that a job must be in queued state
// before GARM will attempt to allocate a runner for it. When set to a non zero value,
// GARM will ignore the job until the job's age is greater than this value. When using
// the min_idle_runners feature of a pool, this gives enough time for potential idle
// runners to pick up the job before GARM attempts to allocate a new runner, thus avoiding
// the need to potentially scale down runners later. When set to 0, pool managers also
// react to queued webhooks immediately instead of on their next poll.
MinimumJobAgeBackoff uint `json:"minimum_job_age_backoff,omitempty"`
// Version is the version of the GARM controller.
Version string `json:"version,omitempty"`
// CACertBundle holds a certificate bundle meant to validate the certificate
// used by GARM itself. This can be just the root certificate that can validate
// the GARM TLS certificate, a chain or multiple root CAs.
//
// swagger:strfmt byte
CACertBundle []byte `json:"ca_cert_bundle,omitempty"`
// CachedGARMAgentReleaseFetchedAt is the timestamp when the release index was last fetched from GARMAgentReleasesURL
CachedGARMAgentReleaseFetchedAt *time.Time `json:"cached_garm_agent_release_fetched_at,omitempty"`
// CachedGARMAgentReleases stores the cached release index fetched from
// GARMAgentReleasesURL (a marshaled util.AgentReleaseIndex: the source URL
// plus the list of releases). This field is not serialized to JSON
// (internal use only).
CachedGARMAgentReleases []byte `json:"-"`
// CachedGARMAgentTools stores the tools of the resolved release (the pinned
// version, or the latest release when no pin is set), indexed by
// "os_type/os_arch". This field is not serialized to JSON (internal use only).
CachedGARMAgentTools map[string]GARMAgentTool `json:"-"`
}
swagger:model ControllerInfo
func (*ControllerInfo) GetCachedAgentTool ¶ added in v0.2.0
func (c *ControllerInfo) GetCachedAgentTool(osType, osArch string) *GARMAgentTool
GetCachedAgentTool returns the cached GARM agent tool for the specified OS type and architecture. Returns nil if no cache exists, if the cache is older than 24 hours, or if the tool is not found.
func (*ControllerInfo) JobBackoff ¶ added in v0.2.0
func (c *ControllerInfo) JobBackoff() time.Duration
type CreateEnterpriseParams ¶
type CreateEnterpriseParams struct {
Name string `json:"name,omitempty"`
CredentialsName string `json:"credentials_name,omitempty"`
WebhookSecret string `json:"webhook_secret,omitempty"`
PoolBalancerType PoolBalancerType `json:"pool_balancer_type,omitempty"`
AgentMode bool `json:"agent_mode,omitempty"`
}
swagger:model CreateEnterpriseParams
func (*CreateEnterpriseParams) Validate ¶
func (c *CreateEnterpriseParams) Validate() error
type CreateFileObjectParams ¶ added in v0.2.0
type CreateFileObjectParams struct {
Name string `json:"name"`
Description string `json:"description"`
Size int64 `json:"size"`
Tags []string `json:"tags"`
}
swagger:model CreateFileObjectParams
type CreateForgeInstanceParams ¶ added in v0.2.2
type CreateForgeInstanceParams struct {
EndpointName string `json:"endpoint_name,omitempty"`
CredentialsName string `json:"credentials_name,omitempty"`
WebhookSecret string `json:"webhook_secret,omitempty"`
ForgeType EndpointType `json:"forge_type,omitempty"`
PoolBalancerType PoolBalancerType `json:"pool_balancer_type,omitempty"`
AgentMode bool `json:"agent_mode,omitempty"`
}
swagger:model CreateForgeInstanceParams
func (*CreateForgeInstanceParams) Validate ¶ added in v0.2.2
func (c *CreateForgeInstanceParams) Validate() error
type CreateGARMToolParams ¶ added in v0.2.0
type CreateGARMToolParams struct {
Name string `json:"name"`
Description string `json:"description"`
Size int64 `json:"size"`
OSType commonParams.OSType `json:"os_type"`
OSArch commonParams.OSArch `json:"os_arch"`
Version string `json:"version"`
Origin string `json:"origin,omitempty"`
}
swagger:model CreateGARMToolParams
type CreateGiteaCredentialsParams ¶ added in v0.2.0
type CreateGiteaCredentialsParams struct {
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
Endpoint string `json:"endpoint,omitempty"`
AuthType ForgeAuthType `json:"auth_type,omitempty"`
PAT GithubPAT `json:"pat,omitempty"`
App GithubApp `json:"app,omitempty"`
}
swagger:model CreateGiteaCredentialsParams
func (CreateGiteaCredentialsParams) Validate ¶ added in v0.2.0
func (c CreateGiteaCredentialsParams) Validate() error
type CreateGiteaEndpointParams ¶ added in v0.2.0
type CreateGiteaEndpointParams struct {
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
APIBaseURL string `json:"api_base_url,omitempty"`
BaseURL string `json:"base_url,omitempty"`
// swagger:strfmt byte
CACertBundle []byte `json:"ca_cert_bundle,omitempty"`
ToolsMetadataURL string `json:"tools_metadata_url,omitempty"`
UseInternalToolsMetadata *bool `json:"use_internal_tools_metadata,omitempty"`
}
swagger:model CreateGiteaEndpointParams
func (CreateGiteaEndpointParams) Validate ¶ added in v0.2.0
func (c CreateGiteaEndpointParams) Validate() error
type CreateGithubCredentialsParams ¶ added in v0.1.5
type CreateGithubCredentialsParams struct {
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
Endpoint string `json:"endpoint,omitempty"`
AuthType ForgeAuthType `json:"auth_type,omitempty"`
PAT GithubPAT `json:"pat,omitempty"`
App GithubApp `json:"app,omitempty"`
// ReserveUsageEnabled toggles whether or not to allocate a certain
// percentage of the available rate limit to critical operations such
// as delete operations for runners that have finished their jobs.
ReserveUsageEnabled bool `json:"reserve_usage_enabled,omitempty"`
// ReserveUsagePercentage is the percentage of available rate limit reserved
// for critical operations. Setting this value too high will negatively impact
// normal operations, so it is capped at 50%. A value between 5% and 20%
// should be safe on most setups. Adjust this based on your usage patterns.
ReserveUsagePercentage int `json:"reserve_usage_percentage,omitempty"`
}
swagger:model CreateGithubCredentialsParams
func (CreateGithubCredentialsParams) Validate ¶ added in v0.1.5
func (c CreateGithubCredentialsParams) Validate() error
type CreateGithubEndpointParams ¶ added in v0.1.5
type CreateGithubEndpointParams struct {
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
APIBaseURL string `json:"api_base_url,omitempty"`
UploadBaseURL string `json:"upload_base_url,omitempty"`
BaseURL string `json:"base_url,omitempty"`
// swagger:strfmt byte
CACertBundle []byte `json:"ca_cert_bundle,omitempty"`
// ToolsMetadataURL is an optional GitHub API compatible releases URL that
// publishes runner binaries. The tools it publishes take precedence over
// the ones the endpoint API reports, for the OS/arch combos they cover.
// It is how runners for architectures upstream GitHub does not build are
// made available.
ToolsMetadataURL string `json:"tools_metadata_url,omitempty"`
}
swagger:model CreateGithubEndpointParams
func (CreateGithubEndpointParams) Validate ¶ added in v0.1.5
func (c CreateGithubEndpointParams) Validate() error
type CreateInstanceParams ¶
type CreateInstanceParams struct {
Name string `json:"name,omitempty"`
OSType commonParams.OSType `json:"os_type,omitempty"`
OSArch commonParams.OSArch `json:"os_arch,omitempty"`
Status commonParams.InstanceStatus `json:"status,omitempty"`
RunnerStatus RunnerStatus `json:"runner_status,omitempty"`
CallbackURL string `json:"callback_url,omitempty"`
MetadataURL string `json:"metadata_url,omitempty"`
// GithubRunnerGroup is the github runner group to which the runner belongs.
// The runner group must be created by someone with access to the enterprise.
GitHubRunnerGroup string `json:"github-runner-group,omitempty"`
CreateAttempt int `json:"-"`
AgentID int64 `json:"-"`
AditionalLabels []string `json:"aditional_labels,omitempty"`
JitConfiguration map[string]string `json:"jit_configuration,omitempty"`
Generation uint64 `json:"generation"`
}
type CreateOrgParams ¶
type CreateOrgParams struct {
Name string `json:"name,omitempty"`
CredentialsName string `json:"credentials_name,omitempty"`
WebhookSecret string `json:"webhook_secret,omitempty"`
PoolBalancerType PoolBalancerType `json:"pool_balancer_type,omitempty"`
ForgeType EndpointType `json:"forge_type,omitempty"`
AgentMode bool `json:"agent_mode,omitempty"`
}
swagger:model CreateOrgParams
func (*CreateOrgParams) Validate ¶
func (c *CreateOrgParams) Validate() error
type CreatePoolParams ¶
type CreatePoolParams struct {
RunnerPrefix
ProviderName string `json:"provider_name,omitempty"`
MaxRunners uint `json:"max_runners,omitempty"`
MinIdleRunners uint `json:"min_idle_runners,omitempty"`
Image string `json:"image,omitempty"`
Flavor string `json:"flavor,omitempty"`
OSType commonParams.OSType `json:"os_type,omitempty"`
OSArch commonParams.OSArch `json:"os_arch,omitempty"`
Tags []string `json:"tags,omitempty"`
Enabled bool `json:"enabled,omitempty"`
RunnerBootstrapTimeout uint `json:"runner_bootstrap_timeout,omitempty"`
ExtraSpecs json.RawMessage `json:"extra_specs,omitempty"`
EnableShell bool `json:"enable_shell"`
// GithubRunnerGroup is the github runner group in which the runners of this
// pool will be added to.
// The runner group must be created by someone with access to the enterprise.
GitHubRunnerGroup string `json:"github-runner-group,omitempty"`
Priority uint `json:"priority,omitempty"`
TemplateID *uint `json:"template_id,omitempty"`
// ProxyID is the ID of the proxy definition runners in this pool will use.
ProxyID *uint `json:"proxy_id,omitempty"`
}
swagger:model CreatePoolParams
func (*CreatePoolParams) Validate ¶
func (p *CreatePoolParams) Validate() error
type CreateProxyParams ¶ added in v0.2.2
type CreateProxyParams struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
// HTTPProxy is the proxy URL used for plain HTTP requests.
HTTPProxy string `json:"http_proxy,omitempty"`
// HTTPSProxy is the proxy URL used for HTTPS requests.
HTTPSProxy string `json:"https_proxy,omitempty"`
// NoProxy is a comma separated list of hosts, domains or CIDRs for
// which the proxy should be bypassed.
NoProxy string `json:"no_proxy,omitempty"`
// Username is the username used to authenticate to the proxy.
Username string `json:"username,omitempty"`
// Password is the password used to authenticate to the proxy.
Password string `json:"password,omitempty"`
}
swagger:model CreateProxyParams
func (*CreateProxyParams) Validate ¶ added in v0.2.2
func (c *CreateProxyParams) Validate() error
type CreateRepoParams ¶
type CreateRepoParams struct {
Owner string `json:"owner,omitempty"`
Name string `json:"name,omitempty"`
CredentialsName string `json:"credentials_name,omitempty"`
WebhookSecret string `json:"webhook_secret,omitempty"`
PoolBalancerType PoolBalancerType `json:"pool_balancer_type,omitempty"`
ForgeType EndpointType `json:"forge_type,omitempty"`
AgentMode bool `json:"agent_mode,omitempty"`
}
swagger:model CreateRepoParams
func (*CreateRepoParams) Validate ¶
func (c *CreateRepoParams) Validate() error
type CreateScaleSetParams ¶ added in v0.2.0
type CreateScaleSetParams struct {
RunnerPrefix
Name string `json:"name"`
DisableUpdate bool `json:"disable_update"`
ScaleSetID int `json:"scale_set_id"`
ProviderName string `json:"provider_name,omitempty"`
MaxRunners uint `json:"max_runners,omitempty"`
MinIdleRunners uint `json:"min_idle_runners,omitempty"`
Image string `json:"image,omitempty"`
Flavor string `json:"flavor,omitempty"`
OSType commonParams.OSType `json:"os_type,omitempty"`
OSArch commonParams.OSArch `json:"os_arch,omitempty"`
Enabled bool `json:"enabled,omitempty"`
RunnerBootstrapTimeout uint `json:"runner_bootstrap_timeout,omitempty"`
ExtraSpecs json.RawMessage `json:"extra_specs,omitempty"`
EnableShell bool `json:"enable_shell"`
// GithubRunnerGroup is the github runner group in which the runners of this
// pool will be added to.
// The runner group must be created by someone with access to the enterprise.
GitHubRunnerGroup string `json:"github-runner-group,omitempty"`
TemplateID *uint `json:"template_id,omitempty"`
Labels []string `json:"labels,omitempty"`
// ProxyID is the ID of the proxy definition runners in this scale set
// will use.
ProxyID *uint `json:"proxy_id,omitempty"`
}
swagger:model CreateScaleSetParams
func (CreateScaleSetParams) GitHubLabels ¶ added in v0.2.0
func (s CreateScaleSetParams) GitHubLabels() []Label
GitHubLabels returns the label list for GitHub scale set API calls. The scale set name is always included as the first "System" label, matching actions-runner-controller behavior. Additional labels are appended with deduplication.
func (*CreateScaleSetParams) Validate ¶ added in v0.2.0
func (s *CreateScaleSetParams) Validate() error
type CreateTemplateParams ¶ added in v0.2.0
type CreateTemplateParams struct {
Name string `json:"name"`
Description string `json:"description"`
// swagger:strfmt byte
Data []byte `json:"data"`
OSType commonParams.OSType `json:"os_type"`
ForgeType EndpointType `json:"forge_type,omitempty"`
IsSystem bool `json:"-"`
}
swagger:model CreateTemplateParams
func (*CreateTemplateParams) Validate ¶ added in v0.2.0
func (c *CreateTemplateParams) Validate() error
type CreationDateGetter ¶ added in v0.2.0
type Credentials ¶ added in v0.1.3
type Credentials []ForgeCredentials
used by swagger client generated code swagger:model Credentials
type EndpointType ¶ added in v0.2.0
type EndpointType string
const ( AutoEndpointType EndpointType = "" GithubEndpointType EndpointType = "github" GiteaEndpointType EndpointType = "gitea" )
func (EndpointType) SupportsInstancePools ¶ added in v0.2.2
func (e EndpointType) SupportsInstancePools() bool
SupportsInstancePools reports whether this forge type supports instance-level (global/admin) runner pools.
type Enterprise ¶
type Enterprise struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Pools []Pool `json:"pool,omitempty"`
// CredentialName is the name of the credentials associated with the enterprise.
// This field is now deprecated. Use CredentialsID instead. This field will be
// removed in v0.2.0.
CredentialsName string `json:"credentials_name,omitempty"`
Credentials ForgeCredentials `json:"credentials,omitempty"`
CredentialsID uint `json:"credentials_id,omitempty"`
PoolManagerStatus PoolManagerStatus `json:"pool_manager_status,omitempty"`
PoolBalancerType PoolBalancerType `json:"pool_balancing_type,omitempty"`
Endpoint ForgeEndpoint `json:"endpoint,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
Events []EntityEvent `json:"events,omitempty"`
AgentMode bool `json:"agent_mode"`
// Do not serialize sensitive info.
WebhookSecret string `json:"-"`
}
swagger:model Enterprise
func (Enterprise) GetBalancerType ¶ added in v0.1.5
func (e Enterprise) GetBalancerType() PoolBalancerType
func (Enterprise) GetCreatedAt ¶ added in v0.2.0
func (e Enterprise) GetCreatedAt() time.Time
func (Enterprise) GetEntity ¶ added in v0.1.5
func (e Enterprise) GetEntity() (ForgeEntity, error)
func (Enterprise) GetID ¶
func (e Enterprise) GetID() string
func (Enterprise) GetName ¶
func (e Enterprise) GetName() string
type EnterpriseFilter ¶ added in v0.2.0
type Enterprises ¶ added in v0.1.3
type Enterprises []Enterprise
used by swagger client generated code swagger:model Enterprises
type EntityEvent ¶ added in v0.2.0
type EntityEvent struct {
ID uint `json:"id,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
EventType EventType `json:"event_type,omitempty"`
EventLevel EventLevel `json:"event_level,omitempty"`
Message string `json:"message,omitempty"`
}
swagger:model EntityEvent
type EntityGetter ¶ added in v0.2.0
type EntityGetter interface {
GetEntity() (ForgeEntity, error)
}
EntityGetter is implemented by all github entities (repositories, organizations and enterprises). It defines the GetEntity() function which returns a github entity.
type EventLevel ¶
type EventLevel string
const ( EventInfo EventLevel = "info" EventWarning EventLevel = "warning" EventError EventLevel = "error" )
type FileObject ¶ added in v0.2.0
type FileObject struct {
ID uint `json:"id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Size int64 `json:"size"`
Tags []string `json:"tags"`
SHA256 string `json:"sha256,omitempty"`
FileType string `json:"file_type"`
}
swagger:model FileObject
type FileObjectPaginatedResponse ¶ added in v0.2.0
type FileObjectPaginatedResponse = PaginatedResponse[FileObject]
swagger:model FileObjectPaginatedResponse
type ForgeAuthType ¶ added in v0.2.0
type ForgeAuthType string
const ( // ForgeAuthTypePAT is the OAuth token based authentication ForgeAuthTypePAT ForgeAuthType = "pat" // ForgeAuthTypeApp is the GitHub App based authentication ForgeAuthTypeApp ForgeAuthType = "app" )
type ForgeCredentials ¶ added in v0.2.0
type ForgeCredentials struct {
ID uint `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
APIBaseURL string `json:"api_base_url,omitempty"`
UploadBaseURL string `json:"upload_base_url,omitempty"`
BaseURL string `json:"base_url,omitempty"`
// swagger:strfmt byte
CABundle []byte `json:"ca_bundle,omitempty"`
AuthType ForgeAuthType `json:"auth-type,omitempty"`
ForgeType EndpointType `json:"forge_type,omitempty"`
// ReserveUsageEnabled toggles whether or not to allocate a certain
// percentage of the available rate limit to critical operations such
// as delete operations for runners that have finished their jobs.
ReserveUsageEnabled bool `json:"reserve_usage_enabled,omitempty"`
// ReserveUsagePercentage is the percentage of available rate limit reserved
// for critical operations. Setting this value too high will negatively impact
// normal operations, so it is capped at 50%. A value between 5% and 20%
// should be safe on most setups. Adjust this based on your usage patterns.
ReserveUsagePercentage int `json:"reserve_usage_percentage,omitempty"`
Repositories []Repository `json:"repositories,omitempty"`
Organizations []Organization `json:"organizations,omitempty"`
Enterprises []Enterprise `json:"enterprises,omitempty"`
Endpoint ForgeEndpoint `json:"endpoint,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
RateLimit *GithubRateLimit `json:"rate_limit,omitempty"`
// Do not serialize sensitive info.
CredentialsPayload []byte `json:"-"`
}
swagger:model ForgeCredentials
func (ForgeCredentials) CACertPool ¶ added in v0.2.2
func (g ForgeCredentials) CACertPool() (*x509.CertPool, error)
CACertPool returns the cert pool to validate this endpoint against. A nil pool means no bundle is set and the system trust store applies.
The bundle widens the system trust store rather than replacing it. It exists so that a forge serving a certificate signed by an internal CA can be reached, not to pin the endpoint to that CA. Replacing the system roots would also break every other host GARM reaches for this endpoint, such as a public tools metadata URL.
func (ForgeCredentials) CriticalRateLimitReached ¶ added in v0.2.2
func (g ForgeCredentials) CriticalRateLimitReached() (bool, time.Time)
CriticalRateLimitReached reports whether even critical operations (such as removing runners that finished their jobs) should back off, meaning the quota is fully exhausted, and when it resets.
func (ForgeCredentials) GetBaseTransport ¶ added in v0.2.2
func (g ForgeCredentials) GetBaseTransport() (*http.Transport, error)
GetBaseTransport returns the HTTP transport for talking to the forge these credentials belong to. It trusts the credentials CA bundle and runs HTTP/2 health checks. Requests multiplex over a small number of HTTP/2 connections. When one dies silently (no FIN or RST reaches us), requests on it hang until the kernel gives up retransmitting, which takes around 15 minutes. The health checks send a PING frame on any connection that received no frames for SendPingTimeout and close the connection when the answer does not arrive within PingTimeout, failing in-flight requests fast. A healthy peer answers PINGs even while it holds a long poll open, so idle but live connections are unaffected.
The transport carries no authentication. Callers that set their own Authorization headers (like the scale set client) must use this and not the client returned by GetHTTPClient, whose auth wrapper overwrites the Authorization header on every request.
func (ForgeCredentials) GetHTTPClient ¶ added in v0.2.0
func (ForgeCredentials) GetID ¶ added in v0.2.0
func (g ForgeCredentials) GetID() uint
func (ForgeCredentials) HTTPClientForURL ¶ added in v0.2.2
func (g ForgeCredentials) HTTPClientForURL(ctx context.Context, rawURL string) (*http.Client, error)
HTTPClientForURL returns the client to use when fetching rawURL on behalf of these credentials.
A URL the forge itself serves gets the authenticated client, so the call counts against the quota of the token instead of the much smaller anonymous rate limit. Anything else gets an unauthenticated client, since an operator supplied URL need not belong to the forge and the forge token must not be sent to a third party. Either way the endpoint CA bundle is trusted on top of the system trust store.
func (ForgeCredentials) RateLimitReached ¶ added in v0.2.2
func (g ForgeCredentials) RateLimitReached() (bool, time.Time)
RateLimitReached reports whether these credentials should be considered rate limited for normal (non-critical) operations, and when the quota resets. When usage reservation is enabled, normal operations are considered limited once the remaining quota dips into the reserved percentage, keeping the reserve available for critical operations.
func (ForgeCredentials) RootCertificateBundle ¶ added in v0.2.0
func (g ForgeCredentials) RootCertificateBundle() (CertificateBundle, error)
func (ForgeCredentials) ServesURL ¶ added in v0.2.2
func (g ForgeCredentials) ServesURL(rawURL string) bool
ServesURL reports whether rawURL is served by the forge these credentials authenticate against. The scheme and host must match one of the forge URLs, so a plain HTTP look-alike of an HTTPS forge is not a match.
type ForgeCredentialsGetter ¶ added in v0.2.0
type ForgeCredentialsGetter interface {
GetForgeCredentials() ForgeCredentials
}
type ForgeEndpoint ¶ added in v0.2.0
type ForgeEndpoint struct {
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
APIBaseURL string `json:"api_base_url,omitempty"`
UploadBaseURL string `json:"upload_base_url,omitempty"`
BaseURL string `json:"base_url,omitempty"`
// swagger:strfmt byte
CACertBundle []byte `json:"ca_cert_bundle,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
ToolsMetadataURL string `json:"tools_metadata_url,omitempty"`
UseInternalToolsMetadata *bool `json:"use_internal_tools_metadata,omitempty"`
EndpointType EndpointType `json:"endpoint_type,omitempty"`
}
swagger:model ForgeEndpoint
type ForgeEndpoints ¶ added in v0.2.0
type ForgeEndpoints []ForgeEndpoint
used by swagger client generated code swagger:model ForgeEndpoints
type ForgeEntity ¶ added in v0.2.0
type ForgeEntity struct {
ID string `json:"id,omitempty"`
Forge ForgeEndpoint `json:"forge"`
Owner string `json:"owner,omitempty"`
Name string `json:"name,omitempty"`
EntityType ForgeEntityType `json:"entity_type,omitempty"`
Credentials ForgeCredentials `json:"credentials"`
PoolBalancerType PoolBalancerType `json:"pool_balancing_type"`
PoolManagerStatus PoolManagerStatus `json:"pool_manager_status"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
AgentMode bool `json:"agent_mode"`
WebhookSecret string `json:"-"`
}
swagger:model ForgeEntity
func (ForgeEntity) ForgeURL ¶ added in v0.2.0
func (g ForgeEntity) ForgeURL() string
func (ForgeEntity) GetCreatedAt ¶ added in v0.2.0
func (g ForgeEntity) GetCreatedAt() time.Time
func (ForgeEntity) GetForgeType ¶ added in v0.2.0
func (g ForgeEntity) GetForgeType() (EndpointType, error)
func (ForgeEntity) GetIDAsUUID ¶ added in v0.2.0
func (g ForgeEntity) GetIDAsUUID() (uuid.UUID, error)
func (ForgeEntity) GetPoolBalancerType ¶ added in v0.2.0
func (g ForgeEntity) GetPoolBalancerType() PoolBalancerType
func (ForgeEntity) LabelScope ¶ added in v0.2.0
func (g ForgeEntity) LabelScope() string
func (ForgeEntity) String ¶ added in v0.2.0
func (g ForgeEntity) String() string
type ForgeEntityType ¶ added in v0.2.0
type ForgeEntityType string
const ( ForgeEntityTypeRepository ForgeEntityType = "repository" ForgeEntityTypeOrganization ForgeEntityType = "organization" ForgeEntityTypeEnterprise ForgeEntityType = "enterprise" ForgeEntityTypeInstance ForgeEntityType = "instance" )
func (ForgeEntityType) String ¶ added in v0.2.0
func (e ForgeEntityType) String() string
type ForgeInstance ¶ added in v0.2.2
type ForgeInstance struct {
ID string `json:"id,omitempty"`
Pools []Pool `json:"pool,omitempty"`
// CredentialName is the name of the credentials associated with the forge instance.
// This field is now deprecated. Use CredentialsID instead. This field will be
// removed in v0.2.0.
CredentialsName string `json:"credentials_name,omitempty"`
Credentials ForgeCredentials `json:"credentials,omitempty"`
CredentialsID uint `json:"credentials_id,omitempty"`
PoolManagerStatus PoolManagerStatus `json:"pool_manager_status,omitempty"`
PoolBalancerType PoolBalancerType `json:"pool_balancing_type,omitempty"`
Endpoint ForgeEndpoint `json:"endpoint,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
Events []EntityEvent `json:"events,omitempty"`
AgentMode bool `json:"agent_mode"`
// Do not serialize sensitive info.
WebhookSecret string `json:"-"`
}
swagger:model ForgeInstance
func (ForgeInstance) GetBalancerType ¶ added in v0.2.2
func (f ForgeInstance) GetBalancerType() PoolBalancerType
func (ForgeInstance) GetCreatedAt ¶ added in v0.2.2
func (f ForgeInstance) GetCreatedAt() time.Time
func (ForgeInstance) GetEntity ¶ added in v0.2.2
func (f ForgeInstance) GetEntity() (ForgeEntity, error)
func (ForgeInstance) GetID ¶ added in v0.2.2
func (f ForgeInstance) GetID() string
type ForgeInstanceFilter ¶ added in v0.2.2
type ForgeInstanceFilter struct {
Endpoint string
}
type ForgeInstances ¶ added in v0.2.2
type ForgeInstances []ForgeInstance
used by swagger client generated code swagger:model ForgeInstances
type GARMAgentRelease ¶ added in v0.2.2
type GARMAgentRelease struct {
// Version is the release tag.
Version string `json:"version"`
// Prerelease indicates the release is marked as a pre-release upstream.
Prerelease bool `json:"prerelease"`
// OSArchs lists the "os_type/os_arch" combinations the release ships
// agent binaries for.
OSArchs []string `json:"os_archs,omitempty"`
// Pinned indicates this is the version the controller is pinned to.
Pinned bool `json:"pinned"`
// Latest indicates this is the release "latest" currently resolves to.
Latest bool `json:"latest"`
// ReleaseNotes holds the release description as published upstream
// (typically markdown), so operators can see what changed in a release
// before pinning to it.
ReleaseNotes string `json:"release_notes,omitempty"`
// Assets lists the downloadable binaries the release ships. Checksum
// files are omitted; the digest of each asset is included instead.
Assets []GARMAgentReleaseAsset `json:"assets,omitempty"`
}
GARMAgentRelease describes one garm-agent release available at the controller's releases URL, as recorded in the cached release index.
swagger:model GARMAgentRelease
type GARMAgentReleaseAsset ¶ added in v0.2.2
type GARMAgentReleaseAsset struct {
// Name is the file name of the asset.
Name string `json:"name"`
// Size is the size of the asset in bytes.
Size uint `json:"size"`
// Digest is the checksum of the asset as declared upstream (typically
// "sha256:<hex>").
Digest string `json:"digest,omitempty"`
// DownloadURL is the upstream URL the asset can be downloaded from.
DownloadURL string `json:"download_url"`
}
GARMAgentReleaseAsset describes one downloadable binary of a garm-agent release.
swagger:model GARMAgentReleaseAsset
type GARMAgentReleases ¶ added in v0.2.2
type GARMAgentReleases []GARMAgentRelease
swagger:model GARMAgentReleases
type GARMAgentTool ¶ added in v0.2.0
type GARMAgentTool struct {
ID uint `json:"id"`
Name string `json:"name"`
Size int64 `json:"size"`
SHA256SUM string `json:"sha256sum"`
Description string `json:"description"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
FileType string `json:"file_type"`
Version string `json:"version"`
OSType commonParams.OSType `json:"os_type"`
OSArch commonParams.OSArch `json:"os_arch"`
DownloadURL string `json:"download_url"`
// Origin defines where the GARM agent tool originated from.
// When manually uploaded, this field is set to "manual". When synced
// from a release URL, this will hold the release URL where the tools
// originated from.
Origin string `json:"origin"`
// Source indicates where this tool is currently stored.
// "local" means the tool is stored in the internal object store.
// "upstream" means the tool is only available from the upstream
// cached release and has not been downloaded locally.
Source string `json:"source"`
}
swagger:model GARMAgentTool
func (GARMAgentTool) Platform ¶ added in v0.2.2
func (g GARMAgentTool) Platform() string
Platform returns the "os_type/os_arch" key this tool is indexed under.
type GARMAgentToolsPaginatedResponse ¶ added in v0.2.0
type GARMAgentToolsPaginatedResponse = PaginatedResponse[GARMAgentTool]
swagger:model GARMAgentToolsPaginatedResponse
type GARMToolsManager ¶ added in v0.2.0
type GARMToolsManager interface {
ListAllGARMTools(ctx context.Context) ([]GARMAgentTool, error)
CreateGARMTool(ctx context.Context, param CreateGARMToolParams, reader io.Reader) (FileObject, error)
DeleteGarmTool(ctx context.Context, osType, osArch string) error
}
type GithubApp ¶ added in v0.1.5
type GithubApp struct {
AppID int64 `json:"app_id,omitempty"`
InstallationID int64 `json:"installation_id,omitempty"`
// swagger:strfmt byte
PrivateKeyBytes []byte `json:"private_key_bytes,omitempty"`
}
swagger:model GithubApp
type GithubPAT ¶ added in v0.1.5
type GithubPAT struct {
OAuth2Token string `json:"oauth2_token,omitempty"`
}
swagger:model GithubPAT
type GithubRateLimit ¶ added in v0.2.0
type GithubRateLimit struct {
Limit int `json:"limit,omitempty"`
Used int `json:"used,omitempty"`
Remaining int `json:"remaining,omitempty"`
Reset int64 `json:"reset,omitempty"`
}
swagger:model GithubRateLimit
func (GithubRateLimit) ResetAt ¶ added in v0.2.0
func (g GithubRateLimit) ResetAt() time.Time
func (GithubRateLimit) ResetIn ¶ added in v0.2.0
func (g GithubRateLimit) ResetIn() time.Duration
type HookInfo ¶ added in v0.1.4
type HookInfo struct {
ID int64 `json:"id,omitempty"`
URL string `json:"url,omitempty"`
Events []string `json:"events,omitempty"`
Active bool `json:"active,omitempty"`
InsecureSSL bool `json:"insecure_ssl,omitempty"`
}
swagger:model HookInfo
type InstallWebhookParams ¶ added in v0.1.4
type InstallWebhookParams struct {
WebhookEndpointType WebhookEndpointType `json:"webhook_endpoint_type,omitempty"`
InsecureSSL bool `json:"insecure_ssl,omitempty"`
}
swagger:model InstallWebhookParams
type Instance ¶
type Instance struct {
// ID is the database ID of this instance.
ID string `json:"id,omitempty"`
// PeoviderID is the unique ID the provider associated
// with the compute instance. We use this to identify the
// instance in the provider.
ProviderID string `json:"provider_id,omitempty"`
// ProviderName is the name of the IaaS where the instance was
// created.
ProviderName string `json:"provider_name"`
// AgentID is the github runner agent ID.
AgentID int64 `json:"agent_id,omitempty"`
// Name is the name associated with an instance. Depending on
// the provider, this may or may not be useful in the context of
// the provider, but we can use it internally to identify the
// instance.
Name string `json:"name,omitempty"`
// OSType is the operating system type. For now, only Linux and
// Windows are supported.
OSType commonParams.OSType `json:"os_type,omitempty"`
// OSName is the name of the OS. Eg: ubuntu, centos, etc.
OSName string `json:"os_name,omitempty"`
// OSVersion is the version of the operating system.
OSVersion string `json:"os_version,omitempty"`
// OSArch is the operating system architecture.
OSArch commonParams.OSArch `json:"os_arch,omitempty"`
// Addresses is a list of IP addresses the provider reports
// for this instance.
Addresses []commonParams.Address `json:"addresses,omitempty"`
// Status is the status of the instance inside the provider (eg: running, stopped, etc)
Status commonParams.InstanceStatus `json:"status,omitempty"`
// RunnerStatus is the github runner status as it appears on GitHub.
RunnerStatus RunnerStatus `json:"runner_status,omitempty"`
// PoolID is the ID of the garm pool to which a runner belongs.
PoolID string `json:"pool_id,omitempty"`
// ScaleSetID is the ID of the scale set to which a runner belongs.
ScaleSetID uint `json:"scale_set_id,omitempty"`
// ProviderFault holds any error messages captured from the IaaS provider that is
// responsible for managing the lifecycle of the runner.
//
// swagger:strfmt byte
ProviderFault []byte `json:"provider_fault,omitempty"`
// StatusMessages is a list of status messages sent back by the runner as it sets itself
// up.
StatusMessages []StatusMessage `json:"status_messages,omitempty"`
// CreatedAt is the timestamp of the creation of this runner.
CreatedAt time.Time `json:"created_at,omitempty"`
// UpdatedAt is the timestamp of the last update to this runner.
UpdatedAt time.Time `json:"updated_at,omitempty"`
// GithubRunnerGroup is the github runner group to which the runner belongs.
// The runner group must be created by someone with access to the enterprise.
GitHubRunnerGroup string `json:"github-runner-group,omitempty"`
// Job is the current job that is being serviced by this runner.
Job *Job `json:"job,omitempty"`
// Heartbeat is the last recorded heartbeat from the runner
Heartbeat time.Time `json:"heartbeat"`
Capabilities AgentCapabilities `json:"capabilities"`
// Generation is the pool generation at the time of creating this instance.
// This field is to track a divergence between when the instance was created
// and the settings currently set on a pool. We can then use this field to know
// if the instance is out of date with the pool, allowing us to remove it if we
// need to.
Generation uint64 `json:"generation"`
// Do not serialize sensitive info.
CallbackURL string `json:"-"`
MetadataURL string `json:"-"`
CreateAttempt int `json:"-"`
TokenFetched bool `json:"-"`
AditionalLabels []string `json:"-"`
JitConfiguration map[string]string `json:"-"`
}
swagger:model Instance
func (Instance) GetCreatedAt ¶ added in v0.2.0
type InstanceMetadata ¶ added in v0.2.0
type InstanceMetadata struct {
MetadataAccess MetadataServiceAccessDetails `json:"metadata_access"`
ForgeType EndpointType `json:"forge_type"`
// RunnerRegistrationURL is the URL the runner needs to configure itself
// against. This can be a repository, organization, enterprise (github)
// or system (gitea)
RunnerRegistrationURL string `json:"runner_registration_url"`
RunnerName string `json:"runner_name"`
RunnerLabels []string `json:"runner_labels,omitempty"`
CABundle map[string][]byte `json:"ca_bundles,omitempty"`
// ExtraSpecs represents the extra specs set on the pool or scale set. No secrets should
// be set in extra specs.
// Also, the instance metadata should never be saved to disk, and the metadata URL is only
// accessible during setup of the runner. The API returns unauthorized once the runner
// transitions to failed/idle.
ExtraSpecs map[string]any `json:"extra_specs,omitempty"`
// Agent mode indicates whether or not we need to install the GARM agent on the runner.
AgentMode bool `json:"agent_mode"`
// AgentTools represents the garm agent download details.
AgentTools *GARMAgentTool `json:"agent_tools,omitempty"`
AgentToken string `json:"agent_token,omitempty"`
AgentShellEnabled bool `json:"agent_shell_enabled,omitempty"`
JITEnabled bool `json:"jit_enabled"`
RunnerTools commonParams.RunnerApplicationDownload `json:"runner_tools"`
}
swagger:model InstanceMetadata
type InstanceRequest ¶
type InstanceRequest struct {
Name string `json:"name"`
OSType commonParams.OSType `json:"os_type"`
OSVersion string `json:"os_version"`
}
type InstanceUpdateMessage ¶
type InstanceUpdateMessage struct {
Status RunnerStatus `json:"status,omitempty"`
Message string `json:"message,omitempty"`
AgentID *int64 `json:"agent_id,omitempty"`
}
type Instances ¶ added in v0.1.2
type Instances []Instance
used by swagger client generated code swagger:model Instances
type JWTResponse ¶
type JWTResponse struct {
Token string `json:"token,omitempty"`
}
JWTResponse holds the JWT token returned as a result of a successful auth swagger:model JWTResponse
type Job ¶ added in v0.1.2
type Job struct {
// ID is the ID of the job.
ID int64 `json:"id,omitempty"`
WorkflowJobID int64 `json:"workflow_job_id,omitempty"`
// RunID is the ID of the workflow run. A run may have multiple jobs.
RunID int64 `json:"run_id,omitempty"`
// Action is the specific activity that triggered the event.
Action string `json:"action,omitempty"`
// Conclusion is the outcome of the job.
// Possible values: "success", "failure", "neutral", "cancelled", "skipped",
// "timed_out", "action_required"
Conclusion string `json:"conclusion,omitempty"`
// Status is the phase of the lifecycle that the job is currently in.
// "queued", "in_progress" and "completed".
Status string `json:"status,omitempty"`
// Name is the name if the job that was triggered.
Name string `json:"name,omitempty"`
StartedAt time.Time `json:"started_at,omitempty"`
CompletedAt time.Time `json:"completed_at,omitempty"`
GithubRunnerID int64 `json:"runner_id,omitempty"`
RunnerName string `json:"runner_name,omitempty"`
RunnerGroupID int64 `json:"runner_group_id,omitempty"`
RunnerGroupName string `json:"runner_group_name,omitempty"`
// repository in which the job was triggered.
RepositoryName string `json:"repository_name,omitempty"`
RepositoryOwner string `json:"repository_owner,omitempty"`
WorkflowRunURL string `json:"workflow_run_url,omitempty"`
Labels []string `json:"labels,omitempty"`
// The entity that received the hook.
//
// Webhooks may be configured on the repo, the org and/or the enterprise.
// If we only configure a repo to use garm, we'll only ever receive a
// webhook from the repo. But if we configure the parent org of the repo and
// the parent enterprise of the org to use garm, a webhook will be sent for each
// entity type, in response to one workflow event. Thus, we will get 3 webhooks
// with the same run_id and job id. Record all involved entities in the same job
// if we have them configured in garm.
RepoID *uuid.UUID `json:"repo_id,omitempty"`
OrgID *uuid.UUID `json:"org_id,omitempty"`
EnterpriseID *uuid.UUID `json:"enterprise_id,omitempty"`
ForgeInstanceID *uuid.UUID `json:"forge_instance_id,omitempty"`
// PoolID is set when one of the pool's runners picks up the job.
PoolID *uuid.UUID `json:"pool_id,omitempty"`
LockedBy uuid.UUID `json:"locked_by,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
}
swagger:model Job
func (Job) BelongsTo ¶ added in v0.2.0
func (j Job) BelongsTo(entity ForgeEntity) bool
type Jobs ¶ added in v0.1.3
type Jobs []Job
swagger:model Jobs used by swagger client generated code
type JobsPaginatedResponse ¶ added in v0.2.2
type JobsPaginatedResponse = PaginatedResponse[Job]
swagger:model JobsPaginatedResponse
type ListJobsFilter ¶ added in v0.2.2
type ListJobsFilter struct {
Page uint64
PageSize uint64
// IncludeCompleted also lists jobs that already finished. Without it
// only queued and in progress jobs are returned.
IncludeCompleted bool
// Since and Until bound the listing to jobs recorded inside the given
// window. A zero value leaves that end of the window open.
Since time.Time
Until time.Time
}
ListJobsFilter narrows down and paginates job listings. The zero value lists the first page of jobs that are not yet completed.
type MetadataServiceAccessDetails ¶ added in v0.2.0
type MetadataServiceAccessDetails struct {
CallbackURL string `json:"callback_url"`
MetadataURL string `json:"metadata_url"`
AgentURL string `json:"agent_url"`
}
swagger:model MetadataServiceAccessDetails
type NewUserParams ¶
type NewUserParams struct {
Email string `json:"email,omitempty"`
Username string `json:"username,omitempty"`
FullName string `json:"full_name,omitempty"`
Password string `json:"password,omitempty"`
IsAdmin bool `json:"-"`
Enabled bool `json:"-"`
}
NewUserParams holds the needed information to create a new user swagger:model NewUserParams
type Organization ¶
type Organization struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Pools []Pool `json:"pool,omitempty"`
// CredentialName is the name of the credentials associated with the enterprise.
// This field is now deprecated. Use CredentialsID instead. This field will be
// removed in v0.2.0.
CredentialsName string `json:"credentials_name,omitempty"`
Credentials ForgeCredentials `json:"credentials,omitempty"`
CredentialsID uint `json:"credentials_id,omitempty"`
PoolManagerStatus PoolManagerStatus `json:"pool_manager_status,omitempty"`
PoolBalancerType PoolBalancerType `json:"pool_balancing_type,omitempty"`
Endpoint ForgeEndpoint `json:"endpoint,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
Events []EntityEvent `json:"events,omitempty"`
AgentMode bool `json:"agent_mode"`
// Do not serialize sensitive info.
WebhookSecret string `json:"-"`
}
swagger:model Organization
func (Organization) GetBalancerType ¶ added in v0.1.5
func (o Organization) GetBalancerType() PoolBalancerType
func (Organization) GetCreatedAt ¶ added in v0.2.0
func (o Organization) GetCreatedAt() time.Time
func (Organization) GetEntity ¶ added in v0.1.5
func (o Organization) GetEntity() (ForgeEntity, error)
func (Organization) GetID ¶
func (o Organization) GetID() string
func (Organization) GetName ¶
func (o Organization) GetName() string
type OrganizationFilter ¶ added in v0.2.0
type Organizations ¶ added in v0.1.3
type Organizations []Organization
used by swagger client generated code swagger:model Organizations
type PaginatedResponse ¶ added in v0.2.0
type PasswordLoginParams ¶
type PasswordLoginParams struct {
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
}
swagger:model PasswordLoginParams PasswordLoginParams holds information used during password authentication, that will be passed to a password login function
func (PasswordLoginParams) Validate ¶
func (p PasswordLoginParams) Validate() error
Validate checks if the username and password are set
type Pool ¶
type Pool struct {
RunnerPrefix
ID string `json:"id,omitempty"`
ProviderName string `json:"provider_name,omitempty"`
MaxRunners uint `json:"max_runners,omitempty"`
MinIdleRunners uint `json:"min_idle_runners,omitempty"`
Image string `json:"image,omitempty"`
Flavor string `json:"flavor,omitempty"`
OSType commonParams.OSType `json:"os_type,omitempty"`
OSArch commonParams.OSArch `json:"os_arch,omitempty"`
Tags []Tag `json:"tags,omitempty"`
Enabled bool `json:"enabled,omitempty"`
Instances []Instance `json:"instances,omitempty"`
EnableShell bool `json:"enable_shell"`
// Generation holds the numeric generation of the pool. This number
// will be incremented, every time certain settings of the pool, which
// may influence how runners are created (flavor, specs, image) are changed.
// When a runner is created, this generation will be copied to the runners as
// well. That way if some settings diverge, we can target those runners
// to be recreated.
Generation uint64 `json:"generation"`
RepoID string `json:"repo_id,omitempty"`
RepoName string `json:"repo_name,omitempty"`
OrgID string `json:"org_id,omitempty"`
OrgName string `json:"org_name,omitempty"`
EnterpriseID string `json:"enterprise_id,omitempty"`
EnterpriseName string `json:"enterprise_name,omitempty"`
ForgeInstanceID string `json:"forge_instance_id,omitempty"`
Endpoint ForgeEndpoint `json:"endpoint,omitempty"`
RunnerBootstrapTimeout uint `json:"runner_bootstrap_timeout,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
// ExtraSpecs is an opaque raw json that gets sent to the provider
// as part of the bootstrap params for instances. It can contain
// any kind of data needed by providers. The contents of this field means
// nothing to garm itself. We don't act on the information in this field at
// all. We only validate that it's a proper json.
ExtraSpecs json.RawMessage `json:"extra_specs,omitempty"`
// GithubRunnerGroup is the github runner group in which the runners will be added.
// The runner group must be created by someone with access to the enterprise.
GitHubRunnerGroup string `json:"github-runner-group,omitempty"`
// Priority is the priority of the pool. The higher the number, the higher the priority.
// When fetching matching pools for a set of tags, the result will be sorted in descending
// order of priority.
Priority uint `json:"priority,omitempty"`
TemplateID uint `json:"template_id,omitempty"`
TemplateName string `json:"template_name,omitempty"`
// ProxyID is the ID of the proxy definition that will be used by runners
// spawned in this pool. Runners will use the proxy settings to reach back
// to GARM, the forge and any other resources they need during setup.
ProxyID uint `json:"proxy_id,omitempty"`
ProxyName string `json:"proxy_name,omitempty"`
}
swagger:model Pool
func (Pool) BelongsTo ¶ added in v0.2.0
func (p Pool) BelongsTo(entity ForgeEntity) bool
func (Pool) GetCreatedAt ¶ added in v0.2.0
func (Pool) GetEntity ¶ added in v0.2.0
func (p Pool) GetEntity() (ForgeEntity, error)
func (*Pool) HasRequiredLabels ¶ added in v0.1.4
func (Pool) MaxRunnersAsInt ¶ added in v0.2.0
func (Pool) MinIdleRunnersAsInt ¶ added in v0.2.0
func (*Pool) PoolType ¶
func (p *Pool) PoolType() ForgeEntityType
func (*Pool) RunnerTimeout ¶
type PoolBalancerType ¶ added in v0.1.5
type PoolBalancerType string
const ( // PoolBalancerTypeRoundRobin will try to cycle through the pools of an entity // in a round robin fashion. For example, if a repository has multiple pools that // match a certain set of labels, and the entity is configured to use round robin // balancer, the pool manager will attempt to create instances in each pool in turn // for each job that needs to be serviced. So job1 in pool1, job2 in pool2 and so on. PoolBalancerTypeRoundRobin PoolBalancerType = "roundrobin" // PoolBalancerTypePack will try to create instances in the first pool that matches // the required labels. If the pool is full, it will move on to the next pool and so on. PoolBalancerTypePack PoolBalancerType = "pack" // PoolBalancerTypeNone denotes to the default behavior of the pool manager, which is // to use the round robin balancer. PoolBalancerTypeNone PoolBalancerType = "" )
type PoolManagerStatus ¶
type PoolManagerStatus struct {
IsRunning bool `json:"running,omitempty"`
FailureReason string `json:"failure_reason,omitempty"`
}
swagger:model PoolManagerStatus
type Pools ¶ added in v0.1.2
type Pools []Pool
used by swagger client generated code swagger:model Pools
type Provider ¶
type Provider struct {
Name string `json:"name,omitempty"`
ProviderType ProviderType `json:"type,omitempty"`
Description string `json:"description,omitempty"`
}
swagger:model Provider
type ProviderType ¶
type ProviderType string
const ( // LXDProvider represents the LXD provider. LXDProvider ProviderType = "lxd" // ExternalProvider represents an external provider. ExternalProvider ProviderType = "external" )
type Providers ¶ added in v0.1.3
type Providers []Provider
used by swagger client generated code swagger:model Providers
type Proxies ¶ added in v0.2.2
type Proxies []Proxy
used by swagger client generated code swagger:model Proxies
type Proxy ¶ added in v0.2.2
type Proxy struct {
ID uint `json:"id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
// HTTPProxy is the proxy URL used for plain HTTP requests.
HTTPProxy string `json:"http_proxy,omitempty"`
// HTTPSProxy is the proxy URL used for HTTPS requests.
HTTPSProxy string `json:"https_proxy,omitempty"`
// NoProxy is a comma separated list of hosts, domains or CIDRs for
// which the proxy should be bypassed.
NoProxy string `json:"no_proxy,omitempty"`
// Username is the username used to authenticate to the proxy. If set,
// it will be composed into the final proxy URLs handed to runners.
Username string `json:"username,omitempty"`
// Password is the password used to authenticate to the proxy. This
// field is never serialized. Secrets are not echoed back via the API.
Password string `json:"-"`
}
swagger:model Proxy
func (Proxy) HasCredentials ¶ added in v0.2.2
HasCredentials returns true if the proxy definition has credentials set.
func (Proxy) ProxyConfig ¶ added in v0.2.2
func (p Proxy) ProxyConfig() commonParams.ProxyConfig
ProxyConfig composes the final proxy configuration that gets handed to providers as part of the bootstrap params. Credentials, if set, are embedded into the proxy URLs.
type Repositories ¶ added in v0.1.2
type Repositories []Repository
used by swagger client generated code swagger:model Repositories
type Repository ¶
type Repository struct {
ID string `json:"id,omitempty"`
Owner string `json:"owner,omitempty"`
Name string `json:"name,omitempty"`
Pools []Pool `json:"pool,omitempty"`
// CredentialName is the name of the credentials associated with the enterprise.
// This field is now deprecated. Use CredentialsID instead. This field will be
// removed in v0.2.0.
CredentialsName string `json:"credentials_name,omitempty"`
CredentialsID uint `json:"credentials_id,omitempty"`
Credentials ForgeCredentials `json:"credentials,omitempty"`
AgentMode bool `json:"agent_mode"`
PoolManagerStatus PoolManagerStatus `json:"pool_manager_status,omitempty"`
PoolBalancerType PoolBalancerType `json:"pool_balancing_type,omitempty"`
Endpoint ForgeEndpoint `json:"endpoint,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
Events []EntityEvent `json:"events,omitempty"`
// Do not serialize sensitive info.
WebhookSecret string `json:"-"`
}
swagger:model Repository
func (Repository) CreationDateGetter ¶ added in v0.2.0
func (r Repository) CreationDateGetter() time.Time
func (Repository) GetBalancerType ¶ added in v0.1.5
func (r Repository) GetBalancerType() PoolBalancerType
func (Repository) GetCredentialsName ¶ added in v0.2.0
func (r Repository) GetCredentialsName() string
func (Repository) GetEntity ¶ added in v0.1.5
func (r Repository) GetEntity() (ForgeEntity, error)
func (Repository) GetID ¶
func (r Repository) GetID() string
func (Repository) GetName ¶
func (r Repository) GetName() string
func (Repository) String ¶ added in v0.1.5
func (r Repository) String() string
type RepositoryFilter ¶ added in v0.2.0
type RestoreTemplateRequest ¶ added in v0.2.0
type RestoreTemplateRequest struct {
Forge EndpointType `json:"forge"`
OSType commonParams.OSType `json:"os_type"`
// RestoreAll indicates whether or not to restore all known
// system owned templates. If set, the Forge and OSType params
// are ignored.
RestoreAll bool `json:"restore_all"`
}
swagger:model RestoreTemplateRequest
type RunnerGroup ¶ added in v0.2.0
type RunnerGroupList ¶ added in v0.2.0
type RunnerGroupList struct {
Count int `json:"count"`
RunnerGroups []RunnerGroup `json:"value"`
}
type RunnerInfo ¶
type RunnerPrefix ¶
type RunnerPrefix struct {
Prefix string `json:"runner_prefix,omitempty"`
}
func (RunnerPrefix) GetRunnerPrefix ¶
func (p RunnerPrefix) GetRunnerPrefix() string
type RunnerReference ¶ added in v0.2.0
type RunnerReference struct {
ID int64 `json:"id"`
Name string `json:"name"`
OS string `json:"os"`
RunnerScaleSetID int `json:"runnerScaleSetId"`
CreatedOn any `json:"createdOn"`
RunnerGroupID uint64 `json:"runnerGroupId"`
RunnerGroupName string `json:"runnerGroupName"`
Version string `json:"version"`
Enabled bool `json:"enabled"`
Ephemeral bool `json:"ephemeral"`
Status any `json:"status"`
DisableUpdate bool `json:"disableUpdate"`
ProvisioningState string `json:"provisioningState"`
Busy bool `json:"busy"`
Labels []Label `json:"labels,omitempty"`
}
func (RunnerReference) GetStatus ¶ added in v0.2.0
func (r RunnerReference) GetStatus() RunnerStatus
type RunnerReferenceList ¶ added in v0.2.0
type RunnerReferenceList struct {
Count int `json:"count"`
RunnerReferences []RunnerReference `json:"value"`
}
type RunnerScaleSet ¶ added in v0.2.0
type RunnerScaleSet struct {
ID int `json:"id,omitempty"`
Name string `json:"name,omitempty"`
RunnerGroupID int64 `json:"runnerGroupId,omitempty"`
RunnerGroupName string `json:"runnerGroupName,omitempty"`
Labels []Label `json:"labels,omitempty"`
RunnerSetting RunnerSetting `json:"RunnerSetting,omitempty"`
CreatedOn time.Time `json:"createdOn,omitempty"`
RunnerJitConfigURL string `json:"runnerJitConfigUrl,omitempty"`
GetAcquirableJobsURL string `json:"getAcquirableJobsUrl,omitempty"`
AcquireJobsURL string `json:"acquireJobsUrl,omitempty"`
Statistics *RunnerScaleSetStatistic `json:"statistics,omitempty"`
Status interface{} `json:"status,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
}
type RunnerScaleSetJitRunnerConfig ¶ added in v0.2.0
type RunnerScaleSetJitRunnerConfig struct {
Runner *RunnerReference `json:"runner"`
EncodedJITConfig string `json:"encodedJITConfig"`
}
func (RunnerScaleSetJitRunnerConfig) DecodedJITConfig ¶ added in v0.2.0
func (r RunnerScaleSetJitRunnerConfig) DecodedJITConfig() (map[string]string, error)
type RunnerScaleSetMessage ¶ added in v0.2.0
type RunnerScaleSetMessage struct {
MessageID int64 `json:"messageId"`
MessageType string `json:"messageType"`
Body string `json:"body"`
Statistics *RunnerScaleSetStatistic `json:"statistics"`
}
func (RunnerScaleSetMessage) GetJobsFromBody ¶ added in v0.2.0
func (r RunnerScaleSetMessage) GetJobsFromBody() ([]ScaleSetJobMessage, error)
func (RunnerScaleSetMessage) IsNil ¶ added in v0.2.0
func (r RunnerScaleSetMessage) IsNil() bool
type RunnerScaleSetSession ¶ added in v0.2.0
type RunnerScaleSetSession struct {
SessionID *uuid.UUID `json:"sessionId,omitempty"`
OwnerName string `json:"ownerName,omitempty"`
RunnerScaleSet *RunnerScaleSet `json:"runnerScaleSet,omitempty"`
MessageQueueURL string `json:"messageQueueUrl,omitempty"`
MessageQueueAccessToken string `json:"messageQueueAccessToken,omitempty"`
Statistics *RunnerScaleSetStatistic `json:"statistics,omitempty"`
}
func (RunnerScaleSetSession) ExiresAt ¶ added in v0.2.0
func (a RunnerScaleSetSession) ExiresAt() (time.Time, error)
func (RunnerScaleSetSession) ExpiresIn ¶ added in v0.2.0
func (a RunnerScaleSetSession) ExpiresIn(t time.Duration) bool
func (RunnerScaleSetSession) GetURL ¶ added in v0.2.0
func (a RunnerScaleSetSession) GetURL() (*url.URL, error)
func (RunnerScaleSetSession) IsExpired ¶ added in v0.2.0
func (a RunnerScaleSetSession) IsExpired() bool
func (RunnerScaleSetSession) TimeRemaining ¶ added in v0.2.0
func (a RunnerScaleSetSession) TimeRemaining() (time.Duration, error)
type RunnerScaleSetStatistic ¶ added in v0.2.0
type RunnerScaleSetStatistic struct {
TotalAvailableJobs int `json:"totalAvailableJobs"`
TotalAcquiredJobs int `json:"totalAcquiredJobs"`
TotalAssignedJobs int `json:"totalAssignedJobs"`
TotalRunningJobs int `json:"totalRunningJobs"`
TotalRegisteredRunners int `json:"totalRegisteredRunners"`
TotalBusyRunners int `json:"totalBusyRunners"`
TotalIdleRunners int `json:"totalIdleRunners"`
}
type RunnerScaleSetsResponse ¶ added in v0.2.0
type RunnerScaleSetsResponse struct {
Count int `json:"count"`
RunnerScaleSets []RunnerScaleSet `json:"value"`
}
type RunnerSetting ¶ added in v0.2.0
type RunnerStatus ¶ added in v0.1.3
type RunnerStatus string
const ( RunnerIdle RunnerStatus = "idle" RunnerPending RunnerStatus = "pending" RunnerTerminated RunnerStatus = "terminated" RunnerInstalling RunnerStatus = "installing" RunnerFailed RunnerStatus = "failed" RunnerActive RunnerStatus = "active" RunnerOffline RunnerStatus = "offline" RunnerOnline RunnerStatus = "online" RunnerUnknown RunnerStatus = "unknown" )
func (RunnerStatus) IsValid ¶ added in v0.2.0
func (s RunnerStatus) IsValid() bool
type ScaleSet ¶ added in v0.2.0
type ScaleSet struct {
RunnerPrefix
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
ID uint `json:"id,omitempty"`
ScaleSetID int `json:"scale_set_id,omitempty"`
Name string `json:"name,omitempty"`
DisableUpdate bool `json:"disable_update"`
State ScaleSetState `json:"state"`
ExtendedState string `json:"extended_state,omitempty"`
ProviderName string `json:"provider_name,omitempty"`
MaxRunners uint `json:"max_runners,omitempty"`
MinIdleRunners uint `json:"min_idle_runners,omitempty"`
Image string `json:"image,omitempty"`
Flavor string `json:"flavor,omitempty"`
OSType commonParams.OSType `json:"os_type,omitempty"`
OSArch commonParams.OSArch `json:"os_arch,omitempty"`
Enabled bool `json:"enabled,omitempty"`
Instances []Instance `json:"instances,omitempty"`
DesiredRunnerCount int `json:"desired_runner_count,omitempty"`
EnableShell bool `json:"enable_shell"`
// Generation holds the numeric generation of the scaleset. This number
// will be incremented, every time certain settings of the scaleset, which
// may influence how runners are created (flavor, specs, image) are changed.
// When a runner is created, this generation will be copied to the runners as
// well. That way if some settings diverge, we can target those runners
// to be recreated.
Generation uint64 `json:"generation"`
Endpoint ForgeEndpoint `json:"endpoint,omitempty"`
RunnerBootstrapTimeout uint `json:"runner_bootstrap_timeout,omitempty"`
// ExtraSpecs is an opaque raw json that gets sent to the provider
// as part of the bootstrap params for instances. It can contain
// any kind of data needed by providers. The contents of this field means
// nothing to garm itself. We don't act on the information in this field at
// all. We only validate that it's a proper json.
ExtraSpecs json.RawMessage `json:"extra_specs,omitempty"`
// GithubRunnerGroup is the github runner group in which the runners will be added.
// The runner group must be created by someone with access to the enterprise.
GitHubRunnerGroup string `json:"github-runner-group,omitempty"`
Tags []Tag `json:"tags,omitempty"`
StatusMessages []StatusMessage `json:"status_messages"`
RepoID string `json:"repo_id,omitempty"`
RepoName string `json:"repo_name,omitempty"`
OrgID string `json:"org_id,omitempty"`
OrgName string `json:"org_name,omitempty"`
EnterpriseID string `json:"enterprise_id,omitempty"`
EnterpriseName string `json:"enterprise_name,omitempty"`
TemplateID uint `json:"template_id,omitempty"`
TemplateName string `json:"template_name,omitempty"`
// ProxyID is the ID of the proxy definition that will be used by runners
// spawned in this scale set. Runners will use the proxy settings to reach
// back to GARM, the forge and any other resources they need during setup.
ProxyID uint `json:"proxy_id,omitempty"`
ProxyName string `json:"proxy_name,omitempty"`
LastMessageID int64 `json:"-"`
}
swagger:model ScaleSet
func (ScaleSet) BelongsTo ¶ added in v0.2.0
func (p ScaleSet) BelongsTo(entity ForgeEntity) bool
func (ScaleSet) GetEntity ¶ added in v0.2.0
func (p ScaleSet) GetEntity() (ForgeEntity, error)
func (ScaleSet) GitHubLabels ¶ added in v0.2.0
GitHubLabels returns the label list for GitHub scale set API calls. The scale set name is always included as the first "System" label, matching actions-runner-controller behavior. Additional tag names are appended with deduplication.
func (ScaleSet) HasRequiredLabels ¶ added in v0.2.2
HasRequiredLabels returns true when every label in set is satisfied by the labels the scale set registers with GitHub, the name plus tags. A job requesting such a label set will be routed to the scale set.
func (*ScaleSet) RunnerTimeout ¶ added in v0.2.0
func (*ScaleSet) ScaleSetType ¶ added in v0.2.0
func (p *ScaleSet) ScaleSetType() ForgeEntityType
type ScaleSetJob ¶ added in v0.2.2
type ScaleSetJob struct {
ID uint `json:"id,omitempty"`
// ScaleSetJobID is the job ID assigned by the GitHub actions service.
ScaleSetJobID string `json:"scaleset_job_id,omitempty"`
// ScaleSetID is GARM's ID of the scale set that handled the job. It
// is zero for records migrated from older GARM versions, which never
// recorded the owning scale set.
ScaleSetID uint `json:"scaleset_id,omitempty"`
WorkflowRunID int64 `json:"workflow_run_id,omitempty"`
RunnerRequestID int64 `json:"runner_request_id,omitempty"`
JobWorkflowRef string `json:"job_workflow_ref,omitempty"`
Name string `json:"name,omitempty"`
Status string `json:"status,omitempty"`
Result string `json:"result,omitempty"`
EventName string `json:"event_name,omitempty"`
RequestLabels []string `json:"request_labels,omitempty"`
RepositoryName string `json:"repository_name,omitempty"`
RepositoryOwner string `json:"repository_owner,omitempty"`
RunnerGroupName string `json:"runner_group_name,omitempty"`
RunnerID int64 `json:"runner_id,omitempty"`
RunnerName string `json:"runner_name,omitempty"`
WorkflowRunURL string `json:"workflow_run_url,omitempty"`
// Timestamps reported by GitHub for the job's routing funnel.
QueueTime time.Time `json:"queue_time,omitempty"`
ScaleSetAssignTime time.Time `json:"scaleset_assign_time,omitempty"`
RunnerAssignTime time.Time `json:"runner_assign_time,omitempty"`
FinishTime time.Time `json:"finish_time,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
}
ScaleSetJob is the informational record of a job GitHub routed to a scale set. GitHub schedules these server side, so GARM never acts on them. They exist so users can list the jobs a scale set handled and see which runner serviced them. swagger:model ScaleSetJob
type ScaleSetJobMessage ¶ added in v0.2.0
type ScaleSetJobMessage struct {
MessageType string `json:"messageType,omitempty"`
JobID string `json:"jobId,omitempty"`
RunnerRequestID int64 `json:"runnerRequestId,omitempty"`
RepositoryName string `json:"repositoryName,omitempty"`
OwnerName string `json:"ownerName,omitempty"`
JobWorkflowRef string `json:"jobWorkflowRef,omitempty"`
JobDisplayName string `json:"jobDisplayName,omitempty"`
WorkflowRunID int64 `json:"workflowRunId,omitempty"`
EventName string `json:"eventName,omitempty"`
RequestLabels []string `json:"requestLabels,omitempty"`
QueueTime time.Time `json:"queueTime,omitempty"`
ScaleSetAssignTime time.Time `json:"scaleSetAssignTime,omitempty"`
RunnerAssignTime time.Time `json:"runnerAssignTime,omitempty"`
FinishTime time.Time `json:"finishTime,omitempty"`
Result string `json:"result,omitempty"`
RunnerID int64 `json:"runnerId,omitempty"`
RunnerName string `json:"runnerName,omitempty"`
AcquireJobURL string `json:"acquireJobUrl,omitempty"`
}
func (ScaleSetJobMessage) MessageTypeToStatus ¶ added in v0.2.0
func (s ScaleSetJobMessage) MessageTypeToStatus() JobStatus
func (ScaleSetJobMessage) ToScaleSetJob ¶ added in v0.2.2
func (s ScaleSetJobMessage) ToScaleSetJob(scaleSetID uint, runnerGroup string) ScaleSetJob
ToScaleSetJob converts the message to GARM's record of a scale set job. The scale set ID and runner group are known by the worker that received the message, not by the message itself.
type ScaleSetJobs ¶ added in v0.2.2
type ScaleSetJobs []ScaleSetJob
swagger:model ScaleSetJobs used by swagger client generated code
type ScaleSetJobsPaginatedResponse ¶ added in v0.2.2
type ScaleSetJobsPaginatedResponse = PaginatedResponse[ScaleSetJob]
swagger:model ScaleSetJobsPaginatedResponse
type ScaleSetMessageType ¶ added in v0.2.0
type ScaleSetMessageType string
const (
MessageTypeRunnerScaleSetJobMessages ScaleSetMessageType = "RunnerScaleSetJobMessages"
)
type ScaleSetState ¶ added in v0.2.0
type ScaleSetState string
const ( ScaleSetPendingCreate ScaleSetState = "pending_create" ScaleSetCreated ScaleSetState = "created" ScaleSetError ScaleSetState = "error" ScaleSetPendingDelete ScaleSetState = "pending_delete" ScaleSetPendingForceDelete ScaleSetState = "pending_force_delete" )
type ScaleSets ¶ added in v0.2.0
type ScaleSets []ScaleSet
used by swagger client generated code swagger:model ScaleSets
type StatusMessage ¶
type StatusMessage struct {
CreatedAt time.Time `json:"created_at,omitempty"`
Message string `json:"message,omitempty"`
EventType EventType `json:"event_type,omitempty"`
EventLevel EventLevel `json:"event_level,omitempty"`
}
swagger:model StatusMessage
type Template ¶ added in v0.2.0
type Template struct {
ID uint `json:"id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Name string `json:"name"`
Description string `json:"description"`
OSType commonParams.OSType `json:"os_type"`
ForgeType EndpointType `json:"forge_type,omitempty"`
// swagger:strfmt byte
Data []byte `json:"data"`
Owner string `json:"owner_id,omitempty"`
}
swagger:model Template
type Templates ¶ added in v0.2.0
type Templates []Template
used by swagger client generated code swagger:model Templates
type UpdateControllerParams ¶ added in v0.1.5
type UpdateControllerParams struct {
MetadataURL *string `json:"metadata_url,omitempty"`
CallbackURL *string `json:"callback_url,omitempty"`
WebhookURL *string `json:"webhook_url,omitempty"`
AgentURL *string `json:"agent_url,omitempty"`
GARMAgentReleasesURL *string `json:"garm_agent_releases_url,omitempty"`
SyncGARMAgentTools *bool `json:"enable_agent_tools_sync,omitempty"`
// GARMAgentVersion pins the garm-agent version the controller uses. An
// empty string or "latest" tracks the newest release at
// GARMAgentReleasesURL; any other value must be a valid semver version.
GARMAgentVersion *string `json:"garm_agent_version,omitempty"`
// AllowInsecureGARMAgent configures deployed garm-agents to connect to
// GARM over plain http/ws (the agent's force_insecure setting). Meant
// for local development and testing only.
AllowInsecureGARMAgent *bool `json:"allow_insecure_garm_agent,omitempty"`
MinimumJobAgeBackoff *uint `json:"minimum_job_age_backoff,omitempty"`
// swagger:strfmt byte
CACertBundle []byte `json:"ca_cert_bundle,omitempty"`
ClearCACertBundle *bool `json:"clear_ca_cert_bundle,omitempty"`
}
swagger:model UpdateControllerParams
func (UpdateControllerParams) Validate ¶ added in v0.1.5
func (u UpdateControllerParams) Validate() error
type UpdateEntityParams ¶ added in v0.1.2
type UpdateEntityParams struct {
CredentialsName string `json:"credentials_name,omitempty"`
WebhookSecret string `json:"webhook_secret,omitempty"`
PoolBalancerType PoolBalancerType `json:"pool_balancer_type,omitempty"`
AgentMode *bool `json:"agent_mode,omitempty"`
PoolManagerStatus *PoolManagerStatus `json:"-"`
}
swagger:model UpdateEntityParams
type UpdateFileObjectParams ¶ added in v0.2.0
type UpdateFileObjectParams struct {
Name *string `json:"name"`
Description *string `json:"description"`
Tags []string `json:"tags"`
}
swagger:model UpdateFileObjectParams
func (*UpdateFileObjectParams) Validate ¶ added in v0.2.0
func (u *UpdateFileObjectParams) Validate() error
type UpdateGiteaCredentialsParams ¶ added in v0.2.0
type UpdateGiteaCredentialsParams struct {
Name *string `json:"name,omitempty"`
Description *string `json:"description,omitempty"`
PAT *GithubPAT `json:"pat,omitempty"`
}
swagger:model UpdateGiteaCredentialsParams
func (UpdateGiteaCredentialsParams) Validate ¶ added in v0.2.0
func (u UpdateGiteaCredentialsParams) Validate() error
type UpdateGiteaEndpointParams ¶ added in v0.2.0
type UpdateGiteaEndpointParams struct {
Description *string `json:"description,omitempty"`
APIBaseURL *string `json:"api_base_url,omitempty"`
BaseURL *string `json:"base_url,omitempty"`
// swagger:strfmt byte
CACertBundle []byte `json:"ca_cert_bundle,omitempty"`
ToolsMetadataURL string `json:"tools_metadata_url,omitempty"`
UseInternalToolsMetadata *bool `json:"use_internal_tools_metadata,omitempty"`
}
swagger:model UpdateGiteaEndpointParams
func (UpdateGiteaEndpointParams) Validate ¶ added in v0.2.0
func (u UpdateGiteaEndpointParams) Validate() error
type UpdateGithubCredentialsParams ¶ added in v0.1.5
type UpdateGithubCredentialsParams struct {
Name *string `json:"name,omitempty"`
Description *string `json:"description,omitempty"`
PAT *GithubPAT `json:"pat,omitempty"`
App *GithubApp `json:"app,omitempty"`
// ReserveUsageEnabled toggles whether or not to allocate a certain
// percentage of the available rate limit to critical operations such
// as delete operations for runners that have finished their jobs.
ReserveUsageEnabled *bool `json:"reserve_usage_enabled,omitempty"`
// ReserveUsagePercentage is the percentage of available rate limit reserved
// for critical operations. Setting this value too high will negatively impact
// normal operations, so it is capped at 50%. A value between 5% and 20%
// should be safe on most setups. Adjust this based on your usage patterns.
ReserveUsagePercentage *int `json:"reserve_usage_percentage,omitempty"`
}
swagger:model UpdateGithubCredentialsParams
func (UpdateGithubCredentialsParams) Validate ¶ added in v0.1.5
func (u UpdateGithubCredentialsParams) Validate() error
type UpdateGithubEndpointParams ¶ added in v0.1.5
type UpdateGithubEndpointParams struct {
Description *string `json:"description,omitempty"`
APIBaseURL *string `json:"api_base_url,omitempty"`
UploadBaseURL *string `json:"upload_base_url,omitempty"`
BaseURL *string `json:"base_url,omitempty"`
// swagger:strfmt byte
CACertBundle []byte `json:"ca_cert_bundle,omitempty"`
// ToolsMetadataURL is an optional GitHub API compatible releases URL that
// publishes runner binaries. Set it to an empty string to go back to
// using only the tools the endpoint API reports.
ToolsMetadataURL *string `json:"tools_metadata_url,omitempty"`
}
swagger:model UpdateGithubEndpointParams
func (UpdateGithubEndpointParams) Validate ¶ added in v0.1.5
func (u UpdateGithubEndpointParams) Validate() error
type UpdateInstanceParams ¶
type UpdateInstanceParams struct {
ProviderID string `json:"provider_id,omitempty"`
// OSName is the name of the OS. Eg: ubuntu, centos, etc.
OSName string `json:"os_name,omitempty"`
// OSVersion is the version of the operating system.
OSVersion string `json:"os_version,omitempty"`
// Addresses is a list of IP addresses the provider reports
// for this instance.
Addresses []commonParams.Address `json:"addresses,omitempty"`
// Status is the status of the instance inside the provider (eg: running, stopped, etc)
Status commonParams.InstanceStatus `json:"status,omitempty"`
RunnerStatus RunnerStatus `json:"runner_status,omitempty"`
// swagger:strfmt byte
ProviderFault []byte `json:"provider_fault,omitempty"`
Heartbeat *time.Time `json:"heartbeat,omitempty"`
AgentID int64 `json:"-"`
CreateAttempt int `json:"-"`
TokenFetched *bool `json:"-"`
JitConfiguration map[string]string `json:"-"`
Capabilities *AgentCapabilities `json:"-"`
}
type UpdatePoolParams ¶
type UpdatePoolParams struct {
RunnerPrefix
Tags []string `json:"tags,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
MaxRunners *uint `json:"max_runners,omitempty"`
MinIdleRunners *uint `json:"min_idle_runners,omitempty"`
RunnerBootstrapTimeout *uint `json:"runner_bootstrap_timeout,omitempty"`
Image string `json:"image,omitempty"`
Flavor string `json:"flavor,omitempty"`
OSType commonParams.OSType `json:"os_type,omitempty"`
OSArch commonParams.OSArch `json:"os_arch,omitempty"`
ExtraSpecs json.RawMessage `json:"extra_specs,omitempty"`
EnableShell *bool `json:"enable_shell"`
// GithubRunnerGroup is the github runner group in which the runners of this
// pool will be added to.
// The runner group must be created by someone with access to the enterprise.
GitHubRunnerGroup *string `json:"github-runner-group,omitempty"`
Priority *uint `json:"priority,omitempty"`
TemplateID *uint `json:"template_id,omitempty"`
// ProxyID is the ID of the proxy definition runners in this pool will
// use. Setting it to 0 removes the proxy from the pool.
ProxyID *uint `json:"proxy_id,omitempty"`
}
swagger:model UpdatePoolParams
type UpdateProxyParams ¶ added in v0.2.2
type UpdateProxyParams struct {
Name *string `json:"name,omitempty"`
Description *string `json:"description,omitempty"`
// HTTPProxy is the proxy URL used for plain HTTP requests.
HTTPProxy *string `json:"http_proxy,omitempty"`
// HTTPSProxy is the proxy URL used for HTTPS requests.
HTTPSProxy *string `json:"https_proxy,omitempty"`
// NoProxy is a comma separated list of hosts, domains or CIDRs for
// which the proxy should be bypassed. Setting it to an empty string
// clears the value.
NoProxy *string `json:"no_proxy,omitempty"`
// Username is the username used to authenticate to the proxy. Setting
// it to an empty string clears the proxy credentials.
Username *string `json:"username,omitempty"`
// Password is the password used to authenticate to the proxy. Setting
// it to an empty string clears the password.
Password *string `json:"password,omitempty"`
}
swagger:model UpdateProxyParams
func (*UpdateProxyParams) Validate ¶ added in v0.2.2
func (u *UpdateProxyParams) Validate() error
type UpdateScaleSetParams ¶ added in v0.2.0
type UpdateScaleSetParams struct {
RunnerPrefix
Name string `json:"name,omitempty"`
DisableUpdate *bool `json:"disable_update,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
MaxRunners *uint `json:"max_runners,omitempty"`
MinIdleRunners *uint `json:"min_idle_runners,omitempty"`
RunnerBootstrapTimeout *uint `json:"runner_bootstrap_timeout,omitempty"`
Image string `json:"image,omitempty"`
Flavor string `json:"flavor,omitempty"`
OSType commonParams.OSType `json:"os_type,omitempty"`
OSArch commonParams.OSArch `json:"os_arch,omitempty"`
ExtraSpecs json.RawMessage `json:"extra_specs,omitempty"`
EnableShell *bool `json:"enable_shell"`
// GithubRunnerGroup is the github runner group in which the runners of this
// pool will be added to.
// The runner group must be created by someone with access to the enterprise.
GitHubRunnerGroup *string `json:"runner_group,omitempty"`
State *ScaleSetState `json:"state"`
ExtendedState *string `json:"extended_state"`
TemplateID *uint `json:"template_id,omitempty"`
ScaleSetID int `json:"-"`
// ProxyID is the ID of the proxy definition runners in this scale set
// will use. Setting it to 0 removes the proxy from the scale set.
ProxyID *uint `json:"proxy_id,omitempty"`
}
swagger:model UpdateScaleSetParams
type UpdateSystemInfoParams ¶ added in v0.1.4
type UpdateTemplateParams ¶ added in v0.2.0
type UpdateTemplateParams struct {
Name *string `json:"name"`
Description *string `json:"description"`
// swagger:strfmt byte
Data []byte `json:"data"`
}
swagger:model UpdateTemplateParams
func (*UpdateTemplateParams) Validate ¶ added in v0.2.0
func (u *UpdateTemplateParams) Validate() error
type UpdateUserParams ¶
type User ¶
type User struct {
ID string `json:"id,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
Email string `json:"email,omitempty"`
Username string `json:"username,omitempty"`
FullName string `json:"full_name,omitempty"`
Enabled bool `json:"enabled,omitempty"`
IsAdmin bool `json:"is_admin,omitempty"`
// Do not serialize sensitive info.
Password string `json:"-"`
Generation uint `json:"-"`
}
Users holds information about a particular user swagger:model User
type UserDataOptions ¶
type WebhookEndpointType ¶ added in v0.1.4
type WebhookEndpointType string
const ( // WebhookEndpointDirect instructs garm that it should attempt to create a webhook // in the target entity, using the callback URL defined in the config as a target. WebhookEndpointDirect WebhookEndpointType = "direct" // WebhookEndpointTunnel instructs garm that it should attempt to create a webhook // in the target entity, using the tunnel URL as a base for the webhook URL. // This is defined for future use. WebhookEndpointTunnel WebhookEndpointType = "tunnel" )
type WorkflowJob ¶
type WorkflowJob struct {
Action string `json:"action"`
WorkflowJob struct {
ID int64 `json:"id"`
RunID int64 `json:"run_id"`
RunURL string `json:"run_url"`
RunAttempt int64 `json:"run_attempt"`
NodeID string `json:"node_id"`
HeadSha string `json:"head_sha"`
URL string `json:"url"`
HTMLURL string `json:"html_url"`
Status string `json:"status"`
Conclusion string `json:"conclusion"`
StartedAt time.Time `json:"started_at"`
CompletedAt time.Time `json:"completed_at"`
Name string `json:"name"`
Steps []struct {
Name string `json:"name"`
Status string `json:"status"`
Conclusion string `json:"conclusion"`
Number int64 `json:"number"`
StartedAt time.Time `json:"started_at"`
CompletedAt time.Time `json:"completed_at"`
} `json:"steps"`
CheckRunURL string `json:"check_run_url"`
Labels []string `json:"labels"`
RunnerID int64 `json:"runner_id"`
RunnerName string `json:"runner_name"`
RunnerGroupID int64 `json:"runner_group_id"`
RunnerGroupName string `json:"runner_group_name"`
} `json:"workflow_job"`
Repository struct {
ID int64 `json:"id"`
NodeID string `json:"node_id"`
Name string `json:"name"`
FullName string `json:"full_name"`
Private bool `json:"private"`
Owner struct {
Login string `json:"login"`
ID int64 `json:"id"`
NodeID string `json:"node_id"`
AvatarURL string `json:"avatar_url"`
GravatarID string `json:"gravatar_id"`
URL string `json:"url"`
HTMLURL string `json:"html_url"`
FollowersURL string `json:"followers_url"`
FollowingURL string `json:"following_url"`
GistsURL string `json:"gists_url"`
StarredURL string `json:"starred_url"`
SubscriptionsURL string `json:"subscriptions_url"`
OrganizationsURL string `json:"organizations_url"`
ReposURL string `json:"repos_url"`
EventsURL string `json:"events_url"`
ReceivedEventsURL string `json:"received_events_url"`
Type string `json:"type"`
SiteAdmin bool `json:"site_admin"`
} `json:"owner"`
HTMLURL string `json:"html_url"`
Description string `json:"description"`
Fork bool `json:"fork"`
URL string `json:"url"`
ForksURL string `json:"forks_url"`
KeysURL string `json:"keys_url"`
CollaboratorsURL string `json:"collaborators_url"`
TeamsURL string `json:"teams_url"`
HooksURL string `json:"hooks_url"`
IssueEventsURL string `json:"issue_events_url"`
EventsURL string `json:"events_url"`
AssigneesURL string `json:"assignees_url"`
BranchesURL string `json:"branches_url"`
TagsURL string `json:"tags_url"`
BlobsURL string `json:"blobs_url"`
GitTagsURL string `json:"git_tags_url"`
GitRefsURL string `json:"git_refs_url"`
TreesURL string `json:"trees_url"`
StatusesURL string `json:"statuses_url"`
LanguagesURL string `json:"languages_url"`
StargazersURL string `json:"stargazers_url"`
ContributorsURL string `json:"contributors_url"`
SubscribersURL string `json:"subscribers_url"`
SubscriptionURL string `json:"subscription_url"`
CommitsURL string `json:"commits_url"`
GitCommitsURL string `json:"git_commits_url"`
CommentsURL string `json:"comments_url"`
IssueCommentURL string `json:"issue_comment_url"`
ContentsURL string `json:"contents_url"`
CompareURL string `json:"compare_url"`
MergesURL string `json:"merges_url"`
ArchiveURL string `json:"archive_url"`
DownloadsURL string `json:"downloads_url"`
IssuesURL string `json:"issues_url"`
PullsURL string `json:"pulls_url"`
MilestonesURL string `json:"milestones_url"`
NotificationsURL string `json:"notifications_url"`
LabelsURL string `json:"labels_url"`
ReleasesURL string `json:"releases_url"`
DeploymentsURL string `json:"deployments_url"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
PushedAt time.Time `json:"pushed_at"`
GitURL string `json:"git_url"`
SSHURL string `json:"ssh_url"`
CloneURL string `json:"clone_url"`
SvnURL string `json:"svn_url"`
Homepage *string `json:"homepage"`
Size int64 `json:"size"`
StargazersCount int64 `json:"stargazers_count"`
WatchersCount int64 `json:"watchers_count"`
Language *string `json:"language"`
HasIssues bool `json:"has_issues"`
HasProjects bool `json:"has_projects"`
HasDownloads bool `json:"has_downloads"`
HasWiki bool `json:"has_wiki"`
HasPages bool `json:"has_pages"`
ForksCount int64 `json:"forks_count"`
MirrorURL *string `json:"mirror_url"`
Archived bool `json:"archived"`
Disabled bool `json:"disabled"`
OpenIssuesCount int64 `json:"open_issues_count"`
License struct {
Key string `json:"key"`
Name string `json:"name"`
SpdxID string `json:"spdx_id"`
URL string `json:"url"`
NodeID string `json:"node_id"`
} `json:"license"`
AllowForking bool `json:"allow_forking"`
IsTemplate bool `json:"is_template"`
// Topics []interface{} `json:"topics"`
Visibility string `json:"visibility"`
Forks int64 `json:"forks"`
OpenIssues int64 `json:"open_issues"`
Watchers int64 `json:"watchers"`
DefaultBranch string `json:"default_branch"`
} `json:"repository"`
Organization struct {
Login string `json:"login"`
// Name is a gitea specific field
Name string `json:"name"`
ID int64 `json:"id"`
NodeID string `json:"node_id"`
URL string `json:"url"`
ReposURL string `json:"repos_url"`
EventsURL string `json:"events_url"`
HooksURL string `json:"hooks_url"`
IssuesURL string `json:"issues_url"`
MembersURL string `json:"members_url"`
PublicMembersURL string `json:"public_members_url"`
AvatarURL string `json:"avatar_url"`
Description string `json:"description"`
} `json:"organization"`
Enterprise struct {
ID int64 `json:"id"`
Slug string `json:"slug"`
Name string `json:"name"`
NodeID string `json:"node_id"`
AvatarURL string `json:"avatar_url"`
// Description interface{} `json:"description"`
// WebsiteURL interface{} `json:"website_url"`
HTMLURL string `json:"html_url"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
} `json:"enterprise"`
Sender struct {
Login string `json:"login"`
ID int64 `json:"id"`
NodeID string `json:"node_id"`
AvatarURL string `json:"avatar_url"`
GravatarID string `json:"gravatar_id"`
URL string `json:"url"`
HTMLURL string `json:"html_url"`
FollowersURL string `json:"followers_url"`
FollowingURL string `json:"following_url"`
GistsURL string `json:"gists_url"`
StarredURL string `json:"starred_url"`
SubscriptionsURL string `json:"subscriptions_url"`
OrganizationsURL string `json:"organizations_url"`
ReposURL string `json:"repos_url"`
EventsURL string `json:"events_url"`
ReceivedEventsURL string `json:"received_events_url"`
Type string `json:"type"`
SiteAdmin bool `json:"site_admin"`
} `json:"sender"`
}
WorkflowJob holds the payload sent by github when a workload_job is sent.
func (WorkflowJob) GetOrgName ¶ added in v0.2.0
func (w WorkflowJob) GetOrgName(forgeType EndpointType) string