adminclient

package
v1.0.0-rc1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 16, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RunnerStatePending    = "pending"
	RunnerStateIdle       = "idle"
	RunnerStateBusy       = "busy"
	RunnerStateTerminated = "terminated"
)

Variables

This section is empty.

Functions

func IsStatus

func IsStatus(err error, status int) bool

Types

type Capacity

type Capacity struct {
	RunnableTasks     int64  `json:"runnableTasks,string"`
	PendingRunners    int64  `json:"pendingRunners,string"`
	IdleRunners       int64  `json:"idleRunners,string"`
	BusyRunners       int64  `json:"busyRunners,string"`
	TerminatedRunners int64  `json:"terminatedRunners,string"`
	Generation        string `json:"generation"`
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(baseURL, installationAdminToken string, httpClient *http.Client) (*Client, error)

func (*Client) CreateFleet

func (c *Client) CreateFleet(ctx context.Context, request CreateFleetRequest) (Fleet, error)

func (*Client) CreateRunner

func (c *Client) CreateRunner(
	ctx context.Context,
	fleetID string,
	request CreateRunnerRequest,
) (CreateRunnerResponse, error)

func (*Client) DeleteRunner

func (c *Client) DeleteRunner(ctx context.Context, fleetID, runnerID string) (Runner, error)

func (*Client) DescribeFleet

func (c *Client) DescribeFleet(ctx context.Context, fleetID string) (Fleet, error)

func (*Client) DescribeRunner

func (c *Client) DescribeRunner(ctx context.Context, fleetID, runnerID string) (Runner, error)

func (*Client) GetFleetCapacity

func (c *Client) GetFleetCapacity(
	ctx context.Context,
	fleetID, generation string,
	waitSeconds int,
) (Capacity, error)

func (*Client) ListFleets

func (c *Client) ListFleets(ctx context.Context) ([]Fleet, error)

func (*Client) ListRunners

func (c *Client) ListRunners(
	ctx context.Context,
	fleetID string,
	states []string,
	limit int,
) ([]Runner, error)

func (*Client) UpdateFleet

func (c *Client) UpdateFleet(ctx context.Context, fleetID string, request UpdateFleetRequest) (Fleet, error)

type CreateFleetRequest

type CreateFleetRequest struct {
	FleetID       string    `json:"fleetId"`
	RunnerVersion string    `json:"runnerVersion"`
	Spec          FleetSpec `json:"spec"`
}

type CreateRunnerRequest

type CreateRunnerRequest struct {
	IdempotencyKey string `json:"idempotencyKey,omitempty"`
	Ephemeral      bool   `json:"ephemeral"`
}

type CreateRunnerResponse

type CreateRunnerResponse struct {
	Runner                Runner    `json:"runner"`
	RegistrationToken     string    `json:"registrationToken"`
	RegistrationExpiresAt time.Time `json:"registrationExpiresAt"`
	RunnerAPIURL          string    `json:"runnerApiUrl"`
	DisplayName           string    `json:"displayName"`
}

type Fleet

type Fleet struct {
	ID            string    `json:"id"`
	Enabled       bool      `json:"enabled"`
	Spec          FleetSpec `json:"spec"`
	RunnerVersion string    `json:"runnerVersion"`
	CreatedAt     time.Time `json:"createdAt"`
	UpdatedAt     time.Time `json:"updatedAt"`
}

type FleetSpec

type FleetSpec struct {
	OperatingSystem string   `json:"operatingSystem"`
	Architecture    string   `json:"architecture"`
	CPUMillicores   int32    `json:"cpuMillicores"`
	MemoryMB        int32    `json:"memoryMb"`
	DiskGB          int32    `json:"diskGb"`
	Capabilities    []string `json:"capabilities"`
}

type HTTPError

type HTTPError struct {
	StatusCode int
	Body       string
}

func (*HTTPError) Error

func (e *HTTPError) Error() string

type Runner

type Runner struct {
	ID                string     `json:"id"`
	FleetID           string     `json:"fleetId"`
	State             string     `json:"state"`
	RunnerVersion     string     `json:"runnerVersion"`
	RegisteredAt      *time.Time `json:"registeredAt,omitempty"`
	LastSeenAt        *time.Time `json:"lastSeenAt,omitempty"`
	TerminationReason *string    `json:"terminationReason,omitempty"`
	CreatedAt         time.Time  `json:"createdAt"`
	UpdatedAt         time.Time  `json:"updatedAt"`
	TerminatedAt      *time.Time `json:"terminatedAt,omitempty"`
	Ephemeral         bool       `json:"ephemeral"`
}

type UpdateFleetRequest

type UpdateFleetRequest struct {
	RunnerVersion string    `json:"runnerVersion"`
	Spec          FleetSpec `json:"spec"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL