client

package
v0.0.1-dev.137 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2026 License: MIT Imports: 25 Imported by: 0

Documentation

Overview

SnapshotClient — typed wrapper around generated.SnapshotServiceClient. RUNE-071.

Package client — StorageClassClient gRPC wrapper.

VolumeClient — typed wrapper around generated.VolumeServiceClient. RUNE-072.

Index

Constants

This section is empty.

Variables

View Source
var ErrDetachWouldPrune = release.ErrDetachWouldPrune

ErrDetachWouldPrune mirrors release.ErrDetachWouldPrune for callers that want to detect a refused-detach precondition without string matching.

Functions

func InstanceUsageToProto

func InstanceUsageToProto(u *types.InstanceUsage) *generated.InstanceUsage

InstanceUsageToProto maps the transient live-usage sample onto the wire. nil in → nil out: an absent usage field means "unknown", which clients must render as unknown rather than 0.

func NamespaceToProto

func NamespaceToProto(namespace *types.Namespace) *generated.Namespace

NamespaceToProto converts a domain namespace to a protobuf message.

func ProtoToNamespace

func ProtoToNamespace(proto *generated.Namespace) (*types.Namespace, error)

ProtoToNamespace converts a protobuf message to a domain namespace.

func ProtoToService

func ProtoToService(proto *generated.Service) (*types.Service, error)

func ProtoToSnapshot

func ProtoToSnapshot(p *generated.Snapshot) *types.Snapshot

ProtoToSnapshot converts the proto wire form back into a types.Snapshot. Best-effort timestamp parsing — falls back to zero values if the proto strings aren't RFC3339.

func ProtoToStorageClass

func ProtoToStorageClass(p *generated.StorageClass) *types.StorageClass

ProtoToStorageClass converts a wire StorageClass to its domain form. CreatedAt / UpdatedAt are parsed when present, ignoring parse errors.

func ProtoToVolume

func ProtoToVolume(p *generated.Volume) *types.Volume

ProtoToVolume converts a wire Volume back to its domain form.

func ServiceToProto

func ServiceToProto(service *types.Service) *generated.Service

Helper functions for converting between types.Service and generated.Service serviceToProto converts a types.Service to a generated.Service proto message.

func SnapshotToProto

func SnapshotToProto(s *types.Snapshot) *generated.Snapshot

SnapshotToProto converts a types.Snapshot to its proto wire form.

func StorageClassToProto

func StorageClassToProto(sc *types.StorageClass) *generated.StorageClass

StorageClassToProto converts a domain StorageClass to its wire form.

func VolumeToProto

func VolumeToProto(v *types.Volume) *generated.Volume

VolumeToProto converts a domain Volume to its wire form.

Types

type AuditClient

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

AuditClient provides access to the server-side audit log.

func NewAuditClient

func NewAuditClient(client *Client) *AuditClient

NewAuditClient creates a new audit client.

func (*AuditClient) ListAuditEvents

func (a *AuditClient) ListAuditEvents(opts AuditListOptions) ([]*types.AuditEvent, error)

ListAuditEvents returns audit events matching the filter, newest first.

type AuditListOptions

type AuditListOptions struct {
	Resource    string
	ResourceRef string
	Namespace   string
	Actor       string
	Action      string
	Since       time.Time
	Until       time.Time
	Limit       int
}

AuditListOptions narrows a ListAuditEvents call. Zero-value fields are ignored. Limit of 0 lets the server apply its default cap.

type CastPayloads

type CastPayloads struct {
	Services   map[string]*types.Service
	Secrets    map[string]*types.Secret
	Configmaps map[string]*types.Configmap
	Volumes    map[string]*types.Volume
}

CastPayloads carries the rendered resource objects for a Cast, keyed by OwnerRef.Key(). The CLI renders the castfile set into these before calling Cast; the server stamps ownership and applies them.

type Client

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

Client provides a client for interacting with the Rune API server.

func NewClient

func NewClient(options *ClientOptions) (*Client, error)

NewClient creates a new API client with the given options.

func (*Client) Close

func (c *Client) Close() error

Close closes the client connection.

func (*Client) Conn

func (c *Client) Conn() *grpc.ClientConn

Conn exposes the underlying gRPC connection for generated clients

func (*Client) Context

func (c *Client) Context() (context.Context, context.CancelFunc)

Context returns a context with the configured call timeout.

func (*Client) ContextWithTimeout

func (c *Client) ContextWithTimeout(timeout time.Duration) (context.Context, context.CancelFunc)

ContextWithTimeout returns a context bounded by the given timeout, falling back to the configured call timeout when timeout <= 0. Used by long-running calls (e.g. a release Cast) that need an aggregate, caller-supplied deadline rather than the default per-call timeout.

type ClientOptions

type ClientOptions struct {
	// Address of the API server
	Address string

	// TLS configuration
	UseTLS      bool
	TLSCertFile string

	// Authentication. Token is the bearer (access or static) sent on requests.
	Token string

	// RefreshToken, when set, lets the client transparently renew Token on
	// Unauthenticated responses via AuthService.Refresh (RUNE-201).
	RefreshToken string

	// OnRefresh, if set, is invoked after a successful refresh with the rotated
	// credentials so the caller can persist them (e.g. to the CLI context).
	OnRefresh func(accessToken, refreshToken string, expiresAt int64) error

	// Timeouts
	DialTimeout time.Duration
	CallTimeout time.Duration

	// Logger
	Logger log.Logger
}

ClientOptions holds configuration options for the API client.

func DefaultClientOptions

func DefaultClientOptions() *ClientOptions

DefaultClientOptions returns the default client options.

type ConfigmapClient

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

ConfigmapClient provides methods for interacting with configs on the Rune API server.

func NewConfigmapClient

func NewConfigmapClient(client *Client) *ConfigmapClient

NewConfigmapClient creates a new configmap client.

func (*ConfigmapClient) CreateConfigmap

func (c *ConfigmapClient) CreateConfigmap(configmap *types.Configmap, ensureNamespace bool) error

CreateConfig creates a new configmap on the API server.

func (*ConfigmapClient) DeleteConfigmap

func (c *ConfigmapClient) DeleteConfigmap(namespace, name string) error

DeleteConfigmap deletes a configmap.

func (*ConfigmapClient) GetConfigmap

func (c *ConfigmapClient) GetConfigmap(namespace, name string) (*types.Configmap, error)

GetConfigmap retrieves a configmap by name.

func (*ConfigmapClient) GetLogger

func (c *ConfigmapClient) GetLogger() log.Logger

GetLogger returns the logger for this client

func (*ConfigmapClient) ListConfigmapVersions

func (c *ConfigmapClient) ListConfigmapVersions(namespace, name string) ([]*types.Configmap, error)

ListConfigmapVersions returns the configmap's version history, newest first.

func (*ConfigmapClient) ListConfigmaps

func (c *ConfigmapClient) ListConfigmaps(namespace string, labelSelector string, fieldSelector string) ([]*types.Configmap, error)

ListConfigmaps lists configmaps in a namespace.

func (*ConfigmapClient) PatchConfigmap

func (c *ConfigmapClient) PatchConfigmap(namespace, name string, set map[string]string, unset []string) (*types.Configmap, error)

PatchConfigmap applies a server-side key-scoped merge (set/unset), creating a new version, and returns the updated configmap.

func (*ConfigmapClient) RollbackConfigmap

func (c *ConfigmapClient) RollbackConfigmap(namespace, name string, toVersion int) (*types.Configmap, error)

RollbackConfigmap rewrites HEAD to the data of a prior version (head+1).

func (*ConfigmapClient) UpdateConfigmap

func (c *ConfigmapClient) UpdateConfigmap(configmap *types.Configmap) error

UpdateConfigmap updates an existing configmap.

type DescribeClient

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

DescribeClient queries the one-shot resource diagnostics RPC (RUNE-126).

func NewDescribeClient

func NewDescribeClient(client *Client) *DescribeClient

NewDescribeClient creates a new describe client.

func (*DescribeClient) Describe

func (d *DescribeClient) Describe(kind, name, namespace string) (*generated.DescribeResult, error)

Describe assembles the diagnostic view for one resource. kind is the canonical resource kind ("instance" | "service" | "volume" | "node"); namespace is ignored for cluster-scoped kinds.

type EventClient

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

EventClient wraps EventService (RUNE-126 Phase 2).

func NewEventClient

func NewEventClient(c *Client) *EventClient

NewEventClient constructs an EventClient.

func (*EventClient) ListEvents

func (e *EventClient) ListEvents(namespace, forKind, forName string, limit int) ([]*generated.Event, error)

ListEvents returns recent events. forKind/forName narrow to a single resource when both are non-empty; pass "" for both to scan the namespace. limit <= 0 uses the server default.

type ExecClient

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

ExecClient provides methods for executing commands in instances.

func NewExecClient

func NewExecClient(client *Client) *ExecClient

NewExecClient creates a new exec client.

func (*ExecClient) NewExecSession

func (e *ExecClient) NewExecSession(ctx context.Context) (*ExecSession, error)

NewExecSession creates a new exec session.

type ExecOptions

type ExecOptions struct {
	Command        []string          // Command and arguments to execute
	Env            map[string]string // Environment variables to set
	WorkingDir     string            // Working directory for the command
	TTY            bool              // Whether to allocate a pseudo-TTY
	TerminalWidth  uint32            // Initial terminal width
	TerminalHeight uint32            // Initial terminal height
	Timeout        time.Duration     // Timeout for the exec session
	// Debug requests a postmortem inspection session against a Failed
	// instance. The server creates an ephemeral sidecar container with
	// the failing instance's image/env/mounts and a sleep entrypoint, so
	// the inner command runs against the same state without re-triggering
	// the original crash. Only valid for instance-ID targets.
	Debug bool
}

ExecOptions defines the configuration for command execution.

type ExecSession

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

ExecSession represents an active exec session.

func (*ExecSession) Close

func (s *ExecSession) Close() error

Close closes the exec session.

func (*ExecSession) InitializeInstanceTarget

func (s *ExecSession) InitializeInstanceTarget(target string, namespace string, options *ExecOptions) error

InitializeInstanceTarget initializes the exec session with the given options.

func (*ExecSession) InitializeServiceTarget

func (s *ExecSession) InitializeServiceTarget(target string, namespace string, options *ExecOptions) error

InitializeServiceTarget initializes the exec session with the given options.

func (*ExecSession) RunInteractive

func (s *ExecSession) RunInteractive() error

RunInteractive runs an interactive exec session.

func (*ExecSession) RunNonInteractive

func (s *ExecSession) RunNonInteractive() error

RunNonInteractive runs a non-interactive exec session.

type HealthClient

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

HealthClient provides methods to query health info from the API server.

func NewHealthClient

func NewHealthClient(client *Client) *HealthClient

NewHealthClient creates a new health client.

func (*HealthClient) GetAPIServerCapacity

func (h *HealthClient) GetAPIServerCapacity() (float64, int64, error)

GetAPIServerCapacity returns server-cached single-node capacity (CPU cores, memory bytes). It queries the API server health with IncludeChecks and parses the capacity check.

func (*HealthClient) GetHealth

func (h *HealthClient) GetHealth(componentType, name, namespace string, includeChecks bool) (*generated.GetHealthResponse, error)

GetHealth queries health for a component type

type InstanceClient

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

InstanceClient provides methods for interacting with instances on the Rune API server.

func NewInstanceClient

func NewInstanceClient(client *Client) *InstanceClient

NewInstanceClient creates a new instance client.

func (*InstanceClient) GetInstance

func (i *InstanceClient) GetInstance(namespace, id string) (*types.Instance, error)

GetInstance retrieves an instance by ID.

func (*InstanceClient) ListInstances

func (i *InstanceClient) ListInstances(namespace, serviceID, labelSelector, fieldSelector string) ([]*types.Instance, error)

ListInstances lists instances in a namespace with optional filtering.

func (*InstanceClient) RestartInstance

func (i *InstanceClient) RestartInstance(namespace, id string, timeout time.Duration) error

RestartInstance restarts an instance.

func (*InstanceClient) StartInstance

func (i *InstanceClient) StartInstance(namespace, id string) error

StartInstance starts an instance.

func (*InstanceClient) StopInstance

func (i *InstanceClient) StopInstance(namespace, id string, timeout time.Duration) error

StopInstance stops an instance.

func (*InstanceClient) WatchInstances

func (i *InstanceClient) WatchInstances(namespace, serviceID, labelSelector, fieldSelector string) (<-chan InstanceWatchEvent, error)

WatchInstances watches instances for changes and returns a channel of events. Note: This simulates watch by polling the list endpoint, since we need to regenerate the protobuf code to include the new WatchInstances API.

type InstanceWatchEvent

type InstanceWatchEvent struct {
	Instance  *types.Instance
	EventType string // "ADDED", "MODIFIED", "DELETED"
	Error     error
}

InstanceWatchEvent represents an instance change event

type LogClient

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

LogClient provides methods for interacting with logs on the Rune API server.

func NewLogClient

func NewLogClient(client *Client) *LogClient

NewLogClient creates a new log client.

func (*LogClient) StreamLogs

StreamLogs creates a bidirectional stream for log streaming. This is a convenience method that wraps the underlying gRPC StreamLogs call.

type NamespaceClient

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

NamespaceClient provides methods for interacting with namespaces on the Rune API server.

func NewNamespaceClient

func NewNamespaceClient(client *Client) *NamespaceClient

NewNamespaceClient creates a new namespace client.

func (*NamespaceClient) CreateNamespace

func (n *NamespaceClient) CreateNamespace(namespace *types.Namespace) error

CreateNamespace creates a new namespace on the API server.

func (*NamespaceClient) DeleteNamespace

func (n *NamespaceClient) DeleteNamespace(name string, ignoreNotFound, force bool) error

DeleteNamespace deletes a namespace by name.

func (*NamespaceClient) GetLogger

func (n *NamespaceClient) GetLogger() log.Logger

GetLogger returns the logger for this client

func (*NamespaceClient) GetNamespace

func (n *NamespaceClient) GetNamespace(name string) (*types.Namespace, error)

GetNamespace retrieves a namespace by name.

func (*NamespaceClient) ListNamespaces

func (n *NamespaceClient) ListNamespaces(labelSelector, fieldSelector map[string]string) ([]*types.Namespace, error)

ListNamespaces lists all namespaces with optional filtering.

func (*NamespaceClient) WatchNamespaces

func (n *NamespaceClient) WatchNamespaces(labelSelector, fieldSelector map[string]string) (<-chan *types.Namespace, error)

WatchNamespaces watches for namespace changes.

type ObserveClient

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

ObserveClient wraps the native observability (RuneSight) ObserveService: LogQL history queries, the backend capability handshake, and ingest. Used by `rune logs --since/--until` (history) and the dashboard.

func NewObserveClient

func NewObserveClient(client *Client) *ObserveClient

NewObserveClient creates a new observe client.

func (*ObserveClient) Capabilities

Capabilities reports the backend handshake. Capabilities.Enabled is false when observability is disabled; callers should fall back to the live log stream in that case.

func (*ObserveClient) ExecuteQuery

ExecuteQuery runs a LogQL query over the persisted store and returns the server stream of QueryResults. The caller drives Recv until io.EOF.

func (*ObserveClient) PushLogs

func (c *ObserveClient) PushLogs(ctx context.Context, records []*generated.LogRecord) (uint32, error)

PushLogs ingests a batch of records (the multi-node forwarder transport).

func (*ObserveClient) QueryLogs

func (c *ObserveClient) QueryLogs(ctx context.Context, logql, namespace string, start, end time.Time, limit int, forward bool) ([]*generated.LogRow, error)

QueryLogs is a convenience wrapper that runs a LogQL query and collects the returned log rows into a slice. It is meant for the non-follow `rune logs` history path; metric samples are ignored. start/end are RFC3339-formatted internally.

type Plan

type Plan struct {
	Release   string
	Namespace string
	Applyable bool
	Changes   []PlannedChange
}

Plan is the render-friendly projection of a reconcile plan (diff).

type PlannedChange

type PlannedChange struct {
	ResourceType string
	Namespace    string
	Name         string
	Action       string
	Conflict     string
}

PlannedChange is a render-friendly projection of a single planned reconcile change returned by Plan.

type PortForwardClient

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

PortForwardClient provides access to the gRPC PortForwardService (RUNE-122). One PortForwardClient owns one streaming session; the CLI multiplexes any number of accepted local connections over it.

func NewPortForwardClient

func NewPortForwardClient(client *Client) *PortForwardClient

NewPortForwardClient creates a new port-forward client.

func (*PortForwardClient) Open

Open opens a session and waits for the Ready frame.

type PortForwardReady

type PortForwardReady struct {
	InstanceID  string
	Namespace   string
	ServiceName string
}

PortForwardReady is returned by Ready() once the server has bound the stream to a concrete instance.

type PortForwardSession

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

PortForwardSession is a single open StreamPortForward call.

The session holds the bidi gRPC stream and serialises Sends through an internal channel so callers can fan-out Open / Data frames from any goroutine. Recv is single-consumer: typically the CLI runs one receive loop that demultiplexes frames into per-conn_id channels.

func (*PortForwardSession) Close

func (s *PortForwardSession) Close() error

Close half-closes the stream and waits for the send loop to drain. Safe to call from any goroutine; idempotent.

func (*PortForwardSession) Recv

Recv reads the next frame from the server. Returns io.EOF on clean stream end.

func (*PortForwardSession) SendClose

func (s *PortForwardSession) SendClose(connID uint64, errStr string) error

SendClose terminates a single conn within the session.

func (*PortForwardSession) SendData

func (s *PortForwardSession) SendData(connID uint64, payload []byte) error

SendData forwards a payload for an open conn.

func (*PortForwardSession) SendOpen

func (s *PortForwardSession) SendOpen(connID uint64, remotePort uint32) error

SendOpen requests a new multiplexed connection.

type PortForwardTarget

type PortForwardTarget struct {
	Service    string
	InstanceID string
	Namespace  string
	// ControlPlane forwards to runed's own dashboard/HTTP listener instead
	// of a workload instance (used by `rune ui`).
	ControlPlane bool
	// Pin selects a specific instance when Service has scale>1.
	Pin string
	// Ports the client intends to forward (informational/audit).
	Ports []uint32
}

PortForwardTarget identifies what to bind a forward to. Exactly one of Service, InstanceID, or ControlPlane must be set.

type ReleaseClient

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

ReleaseClient talks to the ReleaseService for stateful runeset releases (RUNESET_STATEFUL_RELEASES.md): list, get, history, diff (Plan), uninstall (DeleteRelease), and rollback.

func NewReleaseClient

func NewReleaseClient(client *Client) *ReleaseClient

NewReleaseClient creates a new release client.

func (*ReleaseClient) Cast

func (c *ReleaseClient) Cast(spec release.ReleaseSpec, payloads CastPayloads, timeout time.Duration) (*types.Release, *Plan, error)

Cast runs a server-side reconcile for a fully-rendered release spec + payloads (C1: client renders, server plans+applies). It returns the recorded Release and the executed Plan. A plan with unresolved ownership conflicts, or a detach that would prune, surfaces as a FailedPrecondition carrying the Plan.

func (*ReleaseClient) DeleteRelease

func (c *ReleaseClient) DeleteRelease(namespace, name string, keepVolumes, purge bool) error

DeleteRelease uninstalls a release (soft by default; purge to forget — D4).

func (*ReleaseClient) Diff

func (c *ReleaseClient) Diff(namespace, name string, resources []types.OwnerRef) (*Plan, error)

Diff computes the reconcile plan for a release without applying it. Today the CLI exercises this for an already-recorded release by supplying its current desired ref set; the full render-from-source path lands with the cast PR.

func (*ReleaseClient) GetLogger

func (c *ReleaseClient) GetLogger() log.Logger

GetLogger returns the logger for this client.

func (*ReleaseClient) GetRelease

func (c *ReleaseClient) GetRelease(namespace, name string) (*types.Release, error)

GetRelease retrieves a single release by name.

func (*ReleaseClient) History

func (c *ReleaseClient) History(namespace, name string) ([]*types.Release, error)

History returns the revision log of a release, newest first.

func (*ReleaseClient) ListReleases

func (c *ReleaseClient) ListReleases(namespace string, includeUninstalled bool) ([]*types.Release, error)

ListReleases lists releases. namespace="" lists across all namespaces.

func (*ReleaseClient) PlanSpec

func (c *ReleaseClient) PlanSpec(spec release.ReleaseSpec) (*Plan, error)

PlanSpec computes the reconcile plan for a fully-rendered spec WITHOUT applying it — the online dry-run / `release diff` path (C4). Unlike Diff (which plans against a recorded release's owned set), this plans the freshly-rendered desired set from source.

func (*ReleaseClient) Rollback

func (c *ReleaseClient) Rollback(namespace, name string, revision int) (*types.Release, error)

Rollback rolls a release forward to a prior revision. The server currently returns Unimplemented (the re-render path lands with the cast PR).

type SecretClient

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

SecretClient provides methods for interacting with secrets on the Rune API server.

func NewSecretClient

func NewSecretClient(client *Client) *SecretClient

NewSecretClient creates a new secret client.

func (*SecretClient) CreateSecret

func (s *SecretClient) CreateSecret(secret *types.Secret, ensureNamespace bool) error

CreateSecret creates a new secret on the API server.

func (*SecretClient) DeleteSecret

func (s *SecretClient) DeleteSecret(namespace, name string) error

DeleteSecret deletes a secret.

func (*SecretClient) GetLogger

func (s *SecretClient) GetLogger() log.Logger

GetLogger returns the logger for this client

func (*SecretClient) GetSecret

func (s *SecretClient) GetSecret(namespace, name string) (*types.Secret, error)

GetSecret retrieves a secret by name.

As of dev.33, GetSecret returns metadata only — the returned Secret has an empty Data map and a populated DataKeys list. Use RevealSecret to obtain the plaintext payload (requires the secrets:reveal RBAC verb).

func (*SecretClient) ListSecretVersions

func (s *SecretClient) ListSecretVersions(namespace, name string) ([]*types.Secret, error)

ListSecretVersions returns metadata for every historical version of a secret, newest first. Plaintext data is omitted; DataKeys is populated per version. Use RevealSecretVersion to obtain a specific version's plaintext payload (requires the secrets:reveal verb).

func (*SecretClient) ListSecrets

func (s *SecretClient) ListSecrets(namespace string, labelSelector string, fieldSelector string) ([]*types.Secret, error)

ListSecrets lists secrets in a namespace.

func (*SecretClient) PatchSecret

func (s *SecretClient) PatchSecret(namespace, name string, set map[string]string, unset []string) (*types.Secret, error)

PatchSecret performs a server-side merge update of a secret's data map. set entries upsert; unset keys are removed. The server returns metadata only (no plaintext) so this only requires the secrets:update RBAC verb. Returns the updated metadata Secret (data map empty, DataKeys populated).

func (*SecretClient) RevealSecret

func (s *SecretClient) RevealSecret(namespace, name string) (*types.Secret, error)

RevealSecret retrieves the plaintext data payload of a secret.

Requires the secrets:reveal RBAC verb. Each successful call emits a `reveal` audit event server-side; failures are also recorded with outcome=error.

func (*SecretClient) RevealSecretVersion

func (s *SecretClient) RevealSecretVersion(namespace, name string, version int) (*types.Secret, error)

RevealSecretVersion returns the plaintext payload of a specific historical version of a secret. Requires the secrets:reveal RBAC verb.

func (*SecretClient) RollbackSecret

func (s *SecretClient) RollbackSecret(namespace, name string, toVersion int) (*types.Secret, error)

RollbackSecret rewrites the secret's HEAD to the contents of a prior version, producing a new HEAD version (head+1). Requires the secrets:update RBAC verb. Emits a `rollback` audit event server-side recording fromVersion (previous head), toVersion (target), and newVersion (the new head).

func (*SecretClient) UpdateSecret

func (s *SecretClient) UpdateSecret(secret *types.Secret, force bool) error

UpdateSecret updates an existing secret.

type ServiceClient

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

ServiceClient provides methods for interacting with services on the Rune API server.

func NewServiceClient

func NewServiceClient(client *Client) *ServiceClient

NewServiceClient creates a new service client.

func (*ServiceClient) CreateService

func (s *ServiceClient) CreateService(service *types.Service, ensureNamespace bool) error

CreateService creates a new service on the API server.

func (*ServiceClient) DeleteService

func (s *ServiceClient) DeleteService(namespace, name string) error

DeleteService deletes a service by name.

func (*ServiceClient) DeleteServiceWithRequest

func (s *ServiceClient) DeleteServiceWithRequest(req *generated.DeleteServiceRequest) (*generated.DeleteServiceResponse, error)

DeleteServiceWithRequest deletes a service with the full request object.

func (*ServiceClient) GetDeletionStatus

func (s *ServiceClient) GetDeletionStatus(namespace, name string) (*generated.GetDeletionStatusResponse, error)

GetDeletionStatus gets the status of a deletion operation.

func (*ServiceClient) GetLogger

func (s *ServiceClient) GetLogger() log.Logger

GetLogger returns the logger for this client

func (*ServiceClient) GetService

func (s *ServiceClient) GetService(namespace, name string) (*types.Service, error)

GetService retrieves a service by name.

func (*ServiceClient) ListDeletionOperations

func (s *ServiceClient) ListDeletionOperations(namespace, status string) (*generated.ListDeletionOperationsResponse, error)

ListDeletionOperations lists all deletion operations.

func (*ServiceClient) ListInstances

ListInstances lists instances for a service.

func (*ServiceClient) ListServices

func (s *ServiceClient) ListServices(namespace string, labelSelector string, fieldSelector string) ([]*types.Service, error)

ListServices lists services in a namespace with optional filtering.

func (*ServiceClient) RestartService

func (s *ServiceClient) RestartService(namespace, name string) (templateGeneration int64, scale int, err error)

RestartService restarts a service in place (issue #140): the server stamps a new template generation and the reconciler replaces every instance at the current spec — the desired scale never dips through zero. Returns the stamped template generation and the scale the service converges to; callers wait for all instances to be Running with generation >= the returned value.

func (*ServiceClient) ScaleService

func (s *ServiceClient) ScaleService(namespace, name string, scale int) error

ScaleService changes the scale of a service.

func (*ServiceClient) ScaleServiceWithRequest

func (s *ServiceClient) ScaleServiceWithRequest(req *generated.ScaleServiceRequest) (*generated.ServiceResponse, error)

ScaleServiceWithRequest changes the scale of a service with the full request object.

func (*ServiceClient) UpdateService

func (s *ServiceClient) UpdateService(service *types.Service, force bool) error

UpdateService updates an existing service.

func (*ServiceClient) WatchScaling

func (s *ServiceClient) WatchScaling(namespace, name string, targetScale int) (<-chan *generated.ScalingStatusResponse, context.CancelFunc, error)

WatchScaling observes the scaling progress of a service and returns a channel of status updates. The caller should close the cancel function when done watching to prevent resource leaks.

func (*ServiceClient) WatchServices

func (s *ServiceClient) WatchServices(namespace string, labelSelector string, fieldSelector string) (<-chan WatchEvent, context.CancelFunc, error)

WatchServices watches services for changes and returns a channel of events. The caller should call the cancel function when done watching to prevent resource leaks.

type SnapshotClient

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

SnapshotClient is the typed wrapper around generated.SnapshotServiceClient.

func NewSnapshotClient

func NewSnapshotClient(c *Client) *SnapshotClient

NewSnapshotClient constructs a SnapshotClient.

func (*SnapshotClient) CreateSnapshot

func (c *SnapshotClient) CreateSnapshot(s *types.Snapshot, ensureNamespace bool) (*types.Snapshot, error)

func (*SnapshotClient) DeleteSnapshot

func (c *SnapshotClient) DeleteSnapshot(namespace, name string) error

func (*SnapshotClient) GetLogger

func (c *SnapshotClient) GetLogger() log.Logger

GetLogger returns the client's logger.

func (*SnapshotClient) GetSnapshot

func (c *SnapshotClient) GetSnapshot(namespace, name string) (*types.Snapshot, error)

func (*SnapshotClient) ListSnapshots

func (c *SnapshotClient) ListSnapshots(namespace string, labelSelector map[string]string) ([]*types.Snapshot, error)

func (*SnapshotClient) RestoreVolume

func (c *SnapshotClient) RestoreVolume(snapshotNamespace, snapshotName, targetVolumeName, targetNamespace, storageClassName string, labels map[string]string) (*types.Volume, error)

RestoreVolume creates a new Volume from this Snapshot. Returns the new Volume row in Pending; the VolumeController drives it through driver.RestoreFromSnapshot to Available.

type StorageClassClient

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

StorageClassClient is the typed wrapper around generated.StorageClassServiceClient.

func NewStorageClassClient

func NewStorageClassClient(client *Client) *StorageClassClient

NewStorageClassClient constructs a StorageClassClient.

func (*StorageClassClient) CreateStorageClass

func (c *StorageClassClient) CreateStorageClass(sc *types.StorageClass) error

func (*StorageClassClient) DeleteStorageClass

func (c *StorageClassClient) DeleteStorageClass(name string, cascade bool) error

func (*StorageClassClient) GetLogger

func (c *StorageClassClient) GetLogger() log.Logger

GetLogger returns the client's logger.

func (*StorageClassClient) GetStorageClass

func (c *StorageClassClient) GetStorageClass(name string) (*types.StorageClass, error)

func (*StorageClassClient) ListStorageClasses

func (c *StorageClassClient) ListStorageClasses(labelSelector map[string]string) ([]*types.StorageClass, error)

func (*StorageClassClient) UpdateStorageClass

func (c *StorageClassClient) UpdateStorageClass(sc *types.StorageClass) error

type VolumeClient

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

VolumeClient is the typed wrapper around generated.VolumeServiceClient.

func NewVolumeClient

func NewVolumeClient(c *Client) *VolumeClient

NewVolumeClient constructs a VolumeClient.

func (*VolumeClient) CreateVolume

func (c *VolumeClient) CreateVolume(v *types.Volume, ensureNamespace bool) error

func (*VolumeClient) DeleteVolume

func (c *VolumeClient) DeleteVolume(namespace, name string) error

func (*VolumeClient) DetachVolume

func (c *VolumeClient) DetachVolume(namespace, name string, force bool) (*types.Volume, error)

DetachVolume clears bind state on a volume so a replacement instance can attach it. With force=true the call is allowed regardless of current status.

func (*VolumeClient) GetLogger

func (c *VolumeClient) GetLogger() log.Logger

GetLogger returns the client's logger.

func (*VolumeClient) GetVolume

func (c *VolumeClient) GetVolume(namespace, name string) (*types.Volume, error)

func (*VolumeClient) ListVolumes

func (c *VolumeClient) ListVolumes(namespace string, labelSelector, fieldSelector map[string]string) ([]*types.Volume, error)

func (*VolumeClient) RetryProvisionVolume

func (c *VolumeClient) RetryProvisionVolume(namespace, name string) (*types.Volume, error)

RetryProvisionVolume re-arms a Failed/Stalled volume by transitioning it back to Pending. Returns the updated Volume.

func (*VolumeClient) UpdateVolume

func (c *VolumeClient) UpdateVolume(v *types.Volume) error

type WatchEvent

type WatchEvent struct {
	Service   *types.Service
	EventType string // "ADDED", "MODIFIED", "DELETED"
	Error     error
}

WatchEvent represents a service change event

Jump to

Keyboard shortcuts

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