client

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client wraps the Warren gRPC client for easy CLI usage

func NewClient

func NewClient(addr string) (*Client, error)

NewClient creates a new Warren client with mTLS

func NewClientWithToken

func NewClientWithToken(addr, token string) (*Client, error)

NewClientWithToken creates a new Warren client and requests a certificate using a join token

func (*Client) Close

func (c *Client) Close() error

Close closes the client connection

func (*Client) CreateIngress

func (c *Client) CreateIngress(req *proto.CreateIngressRequest) (*proto.Ingress, error)

CreateIngress creates a new ingress

func (*Client) CreateSecret

func (c *Client) CreateSecret(name string, data []byte) (*proto.Secret, error)

CreateSecret creates a new secret

func (*Client) CreateService

func (c *Client) CreateService(name, image string, replicas int32, env map[string]string) (*proto.Service, error)

CreateService creates a new service

func (*Client) CreateServiceWithOptions

func (c *Client) CreateServiceWithOptions(req *proto.CreateServiceRequest) (*proto.Service, error)

CreateServiceWithOptions creates a new service with full options including health checks

func (*Client) CreateTLSCertificate

func (c *Client) CreateTLSCertificate(req *proto.CreateTLSCertificateRequest) (*proto.TLSCertificate, error)

CreateTLSCertificate creates a new TLS certificate

func (*Client) CreateVolume

func (c *Client) CreateVolume(name, driver string, options map[string]string) (*proto.Volume, error)

CreateVolume creates a new volume

func (*Client) DeleteIngress

func (c *Client) DeleteIngress(req *proto.DeleteIngressRequest) error

DeleteIngress deletes an ingress

func (*Client) DeleteSecret

func (c *Client) DeleteSecret(name string) error

DeleteSecret deletes a secret

func (*Client) DeleteService

func (c *Client) DeleteService(id string) error

DeleteService deletes a service

func (*Client) DeleteTLSCertificate

func (c *Client) DeleteTLSCertificate(req *proto.DeleteTLSCertificateRequest) error

DeleteTLSCertificate deletes a TLS certificate

func (*Client) DeleteVolume

func (c *Client) DeleteVolume(name string) error

DeleteVolume deletes a volume

func (*Client) GenerateJoinToken

func (c *Client) GenerateJoinToken(role string) (string, error)

GenerateJoinToken generates a join token for a worker or manager

func (*Client) GetClusterInfo

func (c *Client) GetClusterInfo() (*proto.GetClusterInfoResponse, error)

GetClusterInfo returns information about the cluster

func (*Client) GetIngress

func (c *Client) GetIngress(req *proto.GetIngressRequest) (*proto.Ingress, error)

GetIngress retrieves an ingress by ID or name

func (*Client) GetNode

func (c *Client) GetNode(id string) (*proto.Node, error)

GetNode gets a node by ID

func (*Client) GetSecretByName

func (c *Client) GetSecretByName(name string) (*proto.Secret, error)

GetSecretByName retrieves a secret by name (returns metadata only, no data)

func (*Client) GetService

func (c *Client) GetService(nameOrID string) (*proto.Service, error)

GetService gets a service by name or ID

func (*Client) GetTLSCertificate

func (c *Client) GetTLSCertificate(req *proto.GetTLSCertificateRequest) (*proto.TLSCertificate, error)

GetTLSCertificate retrieves a TLS certificate by ID or name

func (*Client) GetVolumeByName

func (c *Client) GetVolumeByName(name string) (*proto.Volume, error)

GetVolumeByName retrieves a volume by name

func (*Client) JoinCluster

func (c *Client) JoinCluster(nodeID, bindAddr, token string) error

JoinCluster joins a node to the cluster

func (*Client) ListIngresses

func (c *Client) ListIngresses() ([]*proto.Ingress, error)

ListIngresses lists all ingresses

func (*Client) ListNodes

func (c *Client) ListNodes() ([]*proto.Node, error)

ListNodes lists all nodes

func (*Client) ListSecrets

func (c *Client) ListSecrets() ([]*proto.Secret, error)

ListSecrets lists all secrets (returns metadata only, no data)

func (*Client) ListServices

func (c *Client) ListServices() ([]*proto.Service, error)

ListServices lists all services

func (*Client) ListTLSCertificates

func (c *Client) ListTLSCertificates() ([]*proto.TLSCertificate, error)

ListTLSCertificates lists all TLS certificates

func (*Client) ListTasks

func (c *Client) ListTasks(serviceID, nodeID string) ([]*proto.Task, error)

ListTasks lists all tasks (optionally filtered)

func (*Client) ListVolumes

func (c *Client) ListVolumes() ([]*proto.Volume, error)

ListVolumes lists all volumes

func (*Client) UpdateIngress

func (c *Client) UpdateIngress(req *proto.UpdateIngressRequest) (*proto.Ingress, error)

UpdateIngress updates an existing ingress

func (*Client) UpdateService

func (c *Client) UpdateService(id string, replicas int32) (*proto.Service, error)

UpdateService updates a service (scale replicas)

Jump to

Keyboard shortcuts

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