Documentation
¶
Index ¶
- Constants
- type BootstrapInstance
- type CertificateBundle
- type ControllerInfo
- type CreateEnterpriseParams
- type CreateGithubCredentialsParams
- type CreateGithubEndpointParams
- type CreateInstanceParams
- type CreateOrgParams
- type CreatePoolParams
- type CreateRepoParams
- type Credentials
- type Enterprise
- type Enterprises
- type Event
- type EventLevel
- type EventType
- type GithubApp
- type GithubAuthType
- type GithubCredentials
- type GithubEndpoint
- type GithubEndpoints
- type GithubEntity
- type GithubEntityType
- type GithubPAT
- type HookInfo
- type InstallWebhookParams
- type Instance
- type InstanceRequest
- type InstanceUpdateMessage
- type Instances
- type JWTResponse
- type Job
- type JobStatus
- type Jobs
- type NewUserParams
- type Organization
- type Organizations
- type PasswordLoginParams
- type Pool
- type PoolBalancerType
- type PoolManagerStatus
- type Pools
- type Provider
- type ProviderType
- type Providers
- type Repositories
- type Repository
- type RunnerInfo
- type RunnerPrefix
- type RunnerStatus
- type StatusMessage
- type Tag
- type UpdateControllerParams
- type UpdateEntityParams
- type UpdateGithubCredentialsParams
- type UpdateGithubEndpointParams
- type UpdateInstanceParams
- type UpdatePoolParams
- type UpdateSystemInfoParams
- type UpdateUserParams
- type User
- type UserDataOptions
- type WebhookEndpointType
- type WorkflowJob
Constants ¶
View Source
const ( MetricsLabelEnterpriseScope = "Enterprise" MetricsLabelRepositoryScope = "Repository" MetricsLabelOrganizationScope = "Organization" )
View Source
const (
DefaultRunnerPrefix string = "garm"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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.
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"`
// 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.
MinimumJobAgeBackoff uint `json:"minimum_job_age_backoff,omitempty"`
// Version is the version of the GARM controller.
Version string `json:"version,omitempty"`
}
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"`
}
func (*CreateEnterpriseParams) Validate ¶
func (c *CreateEnterpriseParams) 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 GithubAuthType `json:"auth_type,omitempty"`
PAT GithubPAT `json:"pat,omitempty"`
App GithubApp `json:"app,omitempty"`
}
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"`
CACertBundle []byte `json:"ca_cert_bundle,omitempty"`
}
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"`
}
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"`
}
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"`
// 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"`
}
func (*CreatePoolParams) Validate ¶
func (p *CreatePoolParams) 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"`
}
func (*CreateRepoParams) Validate ¶
func (c *CreateRepoParams) Validate() error
type Credentials ¶ added in v0.1.3
type Credentials []GithubCredentials
used by swagger client generated code
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 GithubCredentials `json:"credentials,omitempty"`
CredentialsID uint `json:"credentials_id,omitempty"`
PoolManagerStatus PoolManagerStatus `json:"pool_manager_status,omitempty"`
PoolBalancerType PoolBalancerType `json:"pool_balancing_type,omitempty"`
Endpoint GithubEndpoint `json:"endpoint,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
// Do not serialize sensitive info.
WebhookSecret string `json:"-"`
}
func (Enterprise) GetBalancerType ¶ added in v0.1.5
func (e Enterprise) GetBalancerType() PoolBalancerType
func (Enterprise) GetEntity ¶ added in v0.1.5
func (e Enterprise) GetEntity() (GithubEntity, error)
func (Enterprise) GetID ¶
func (e Enterprise) GetID() string
func (Enterprise) GetName ¶
func (e Enterprise) GetName() string
type Enterprises ¶ added in v0.1.3
type Enterprises []Enterprise
used by swagger client generated code
type EventLevel ¶
type EventLevel string
const ( EventInfo EventLevel = "info" EventWarning EventLevel = "warning" EventError EventLevel = "error" )
type GithubApp ¶ added in v0.1.5
type GithubAuthType ¶ added in v0.1.5
type GithubAuthType string
const ( // GithubAuthTypePAT is the OAuth token based authentication GithubAuthTypePAT GithubAuthType = "pat" // GithubAuthTypeApp is the GitHub App based authentication GithubAuthTypeApp GithubAuthType = "app" )
type GithubCredentials ¶
type GithubCredentials 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"`
CABundle []byte `json:"ca_bundle,omitempty"`
AuthType GithubAuthType `json:"auth-type,omitempty"`
Repositories []Repository `json:"repositories,omitempty"`
Organizations []Organization `json:"organizations,omitempty"`
Enterprises []Enterprise `json:"enterprises,omitempty"`
Endpoint GithubEndpoint `json:"endpoint,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
// Do not serialize sensitive info.
CredentialsPayload []byte `json:"-"`
}
func (GithubCredentials) GetHTTPClient ¶ added in v0.1.5
func (GithubCredentials) RootCertificateBundle ¶ added in v0.1.4
func (g GithubCredentials) RootCertificateBundle() (CertificateBundle, error)
type GithubEndpoint ¶ added in v0.1.5
type GithubEndpoint 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"`
CACertBundle []byte `json:"ca_cert_bundle,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
Credentials []GithubCredentials `json:"credentials,omitempty"`
}
type GithubEndpoints ¶ added in v0.1.5
type GithubEndpoints []GithubEndpoint
used by swagger client generated code
type GithubEntity ¶ added in v0.1.5
type GithubEntity struct {
Owner string `json:"owner,omitempty"`
Name string `json:"name,omitempty"`
ID string `json:"id,omitempty"`
EntityType GithubEntityType `json:"entity_type,omitempty"`
Credentials GithubCredentials `json:"credentials,omitempty"`
PoolBalancerType PoolBalancerType `json:"pool_balancing_type,omitempty"`
WebhookSecret string `json:"-"`
}
func (GithubEntity) GetPoolBalancerType ¶ added in v0.1.5
func (g GithubEntity) GetPoolBalancerType() PoolBalancerType
func (GithubEntity) LabelScope ¶ added in v0.1.5
func (g GithubEntity) LabelScope() string
func (GithubEntity) String ¶ added in v0.1.5
func (g GithubEntity) String() string
type GithubEntityType ¶ added in v0.1.5
type GithubEntityType string
const ( GithubEntityTypeRepository GithubEntityType = "repository" GithubEntityTypeOrganization GithubEntityType = "organization" GithubEntityTypeEnterprise GithubEntityType = "enterprise" )
func (GithubEntityType) String ¶ added in v0.1.5
func (e GithubEntityType) String() string
type GithubPAT ¶ added in v0.1.5
type GithubPAT struct {
OAuth2Token string `json:"oauth2_token,omitempty"`
}
type InstallWebhookParams ¶ added in v0.1.4
type InstallWebhookParams struct {
WebhookEndpointType WebhookEndpointType `json:"webhook_endpoint_type,omitempty"`
InsecureSSL bool `json:"insecure_ssl,omitempty"`
}
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"`
// 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"`
// ProviderFault holds any error messages captured from the IaaS provider that is
// responsible for managing the lifecycle of the runner.
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"`
// 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:"-"`
}
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 JWTResponse ¶
type JWTResponse struct {
Token string `json:"token,omitempty"`
}
JWTResponse holds the JWT token returned as a result of a successful auth
type Job ¶ added in v0.1.2
type Job struct {
// ID is the ID of the job.
ID int64 `json:"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"`
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"`
LockedBy uuid.UUID `json:"locked_by,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
}
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
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 GithubCredentials `json:"credentials,omitempty"`
CredentialsID uint `json:"credentials_id,omitempty"`
PoolManagerStatus PoolManagerStatus `json:"pool_manager_status,omitempty"`
PoolBalancerType PoolBalancerType `json:"pool_balancing_type,omitempty"`
Endpoint GithubEndpoint `json:"endpoint,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
// Do not serialize sensitive info.
WebhookSecret string `json:"-"`
}
func (Organization) GetBalancerType ¶ added in v0.1.5
func (o Organization) GetBalancerType() PoolBalancerType
func (Organization) GetEntity ¶ added in v0.1.5
func (o Organization) GetEntity() (GithubEntity, error)
func (Organization) GetID ¶
func (o Organization) GetID() string
func (Organization) GetName ¶
func (o Organization) GetName() string
type Organizations ¶ added in v0.1.3
type Organizations []Organization
used by swagger client generated code
type PasswordLoginParams ¶
type PasswordLoginParams struct {
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
}
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"`
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"`
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"`
}
func (Pool) GithubEntity ¶ added in v0.1.5
func (p Pool) GithubEntity() (GithubEntity, error)
func (*Pool) HasRequiredLabels ¶ added in v0.1.4
func (*Pool) PoolType ¶
func (p *Pool) PoolType() GithubEntityType
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 Provider ¶
type Provider struct {
Name string `json:"name,omitempty"`
ProviderType ProviderType `json:"type,omitempty"`
Description string `json:"description,omitempty"`
}
type ProviderType ¶
type ProviderType string
const ( // LXDProvider represents the LXD provider. LXDProvider ProviderType = "lxd" // ExternalProvider represents an external provider. ExternalProvider ProviderType = "external" )
type Repositories ¶ added in v0.1.2
type Repositories []Repository
used by swagger client generated code
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 GithubCredentials `json:"credentials,omitempty"`
PoolManagerStatus PoolManagerStatus `json:"pool_manager_status,omitempty"`
PoolBalancerType PoolBalancerType `json:"pool_balancing_type,omitempty"`
Endpoint GithubEndpoint `json:"endpoint,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
// Do not serialize sensitive info.
WebhookSecret string `json:"-"`
}
func (Repository) GetBalancerType ¶ added in v0.1.5
func (r Repository) GetBalancerType() PoolBalancerType
func (Repository) GetEntity ¶ added in v0.1.5
func (r Repository) GetEntity() (GithubEntity, 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 RunnerInfo ¶
type RunnerPrefix ¶
type RunnerPrefix struct {
Prefix string `json:"runner_prefix,omitempty"`
}
func (RunnerPrefix) GetRunnerPrefix ¶
func (p RunnerPrefix) GetRunnerPrefix() string
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" )
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"`
}
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"`
MinimumJobAgeBackoff *uint `json:"minimum_job_age_backoff,omitempty"`
}
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"`
}
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"`
}
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"`
CACertBundle []byte `json:"ca_cert_bundle,omitempty"`
}
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"`
ProviderFault []byte `json:"provider_fault,omitempty"`
AgentID int64 `json:"-"`
CreateAttempt int `json:"-"`
TokenFetched *bool `json:"-"`
JitConfiguration map[string]string `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"`
// 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"`
}
type UpdateSystemInfoParams ¶ added in v0.1.4
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
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"`
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.
Click to show internal directories.
Click to hide internal directories.