master

package
v0.0.0-...-1c5d739 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: Apache-2.0 Imports: 21 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRequestExpired    = errors.New("Authentication request expired")
	ErrRequestFromFuture = errors.New("Authentication request has future timestamp")
)

Functions

This section is empty.

Types

type Client

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

Client a client for interacting with the serviced master

func NewClient

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

NewClient Create a new rpc client.

func (*Client) AddHost

func (c *Client) AddHost(host host.Host) ([]byte, error)

AddHost adds a Host

func (*Client) AddHostPrivate

func (c *Client) AddHostPrivate(host host.Host) ([]byte, error)

AddHost adds and registers a host with an agreed-upon shared secret keypair. Returns master's public key.

func (*Client) AddPublicEndpointPort

func (c *Client) AddPublicEndpointPort(serviceid, endpointName, portAddr string, usetls bool,
	protocol string, isEnabled bool, restart bool) (*servicedefinition.Port, error)

Adds a port public endpoint to a service.

func (*Client) AddPublicEndpointVHost

func (c *Client) AddPublicEndpointVHost(serviceid, endpointName, vhost string, isEnabled,
	restart bool) (*servicedefinition.VHost, error)

Adds a vhost public endpoint to a service.

func (*Client) AddResourcePool

func (c *Client) AddResourcePool(pool pool.ResourcePool) error

AddResourcePool adds the ResourcePool

func (*Client) AddServiceTemplate

func (c *Client) AddServiceTemplate(serviceTemplate servicetemplate.ServiceTemplate) (templateID string, err error)

Add a new service template

func (*Client) AddVirtualIP

func (c *Client) AddVirtualIP(requestVirtualIP pool.VirtualIP) error

AddVirtualIP adds a VirtualIP to a specificpool

func (*Client) AuthenticateHost

func (c *Client) AuthenticateHost(hostID string) (string, int64, error)

AuthenticateHost authenticates a host

func (*Client) ClearEmergency

func (c *Client) ClearEmergency(serviceID string) (int, error)

ClearEmergency clears the EmergencyShutdown flag on a service and all child services it returns the number of affected services

func (*Client) Close

func (c *Client) Close() (err error)

Close closes rpc client

func (*Client) DebugDisableMetrics

func (c *Client) DebugDisableMetrics() (string, error)

Disable internal metrics collection

func (*Client) DebugEnableMetrics

func (c *Client) DebugEnableMetrics() (string, error)

Enable internal metrics collection

func (*Client) DeployTemplate

func (c *Client) DeployTemplate(request servicetemplate.ServiceTemplateDeploymentRequest) (tenantIDs []string, err error)

Deploy a service Template

func (*Client) DockerOverride

func (c *Client) DockerOverride(newImage, oldImage string) error

DockerOverride replaces an image in the registry with a new image

func (*Client) EnablePublicEndpointPort

func (c *Client) EnablePublicEndpointPort(serviceid, endpointName, portAddr string, isEnabled bool) error

Enable/disable a port public endpoint for a service.

func (*Client) EnablePublicEndpointVHost

func (c *Client) EnablePublicEndpointVHost(serviceid, endpointName, vhost string, isEnabled bool) error

Enable/disable a vhost public endpoint for a service.

func (*Client) FindHostsInPool

func (c *Client) FindHostsInPool(poolID string) ([]host.Host, error)

FindHostsInPool returns all hosts in a pool

func (*Client) GetActiveHostIDs

func (c *Client) GetActiveHostIDs() ([]string, error)

GetActiveHosts returns all active host ids or empty array

func (*Client) GetAllPublicEndpoints

func (c *Client) GetAllPublicEndpoints() ([]service.PublicEndpoint, error)

GetAllPublicEndpoints

func (*Client) GetAllServiceDetails

func (c *Client) GetAllServiceDetails(since time.Duration) ([]service.ServiceDetails, error)

GetAllServiceDetails will return a list of all ServiceDetails

func (*Client) GetEvaluatedService

func (c *Client) GetEvaluatedService(serviceID string, instanceID int) (*service.Service, string, string, error)

GetEvaluatedService returns a service where an evaluation has been executed against all templated properties.

func (*Client) GetHost

func (c *Client) GetHost(hostID string) (*host.Host, error)

GetHost gets the host for the given hostID or nil

func (*Client) GetHostPublicKey

func (c *Client) GetHostPublicKey(hostID string) ([]byte, error)

func (*Client) GetHosts

func (c *Client) GetHosts() ([]host.Host, error)

GetHosts returns all hosts or empty array

func (*Client) GetISvcsHealth

func (c *Client) GetISvcsHealth(IServiceNames []string) ([]isvcs.IServiceHealthResult, error)

GetISvcsHealth returns health status for a list of isvcs

func (*Client) GetPoolIPs

func (c *Client) GetPoolIPs(poolID string) (*pool.PoolIPs, error)

GetPoolIPs returns a all IPs in a ResourcePool.

func (*Client) GetResourcePool

func (c *Client) GetResourcePool(poolID string) (*pool.ResourcePool, error)

GetResourcePool gets the pool for the given poolID or nil

func (*Client) GetResourcePools

func (c *Client) GetResourcePools() ([]pool.ResourcePool, error)

GetResourcePools returns all pools or empty array

func (*Client) GetService

func (c *Client) GetService(serviceID string) (*service.Service, error)

GetService returns a service with a particular service id.

func (*Client) GetServiceDetails

func (c *Client) GetServiceDetails(serviceID string) (*service.ServiceDetails, error)

GetServiceDetails will return a ServiceDetails for the specified service

func (*Client) GetServiceDetailsByTenantID

func (c *Client) GetServiceDetailsByTenantID(tenantID string) ([]service.ServiceDetails, error)

GetServiceDetailsByTenantID will return a list of ServiceDetails for the specified tenant ID

func (*Client) GetServiceEndpoints

func (c *Client) GetServiceEndpoints(serviceIDs []string, reportImports, reportExports bool, validate bool) ([]applicationendpoint.EndpointReport, error)

GetServiceEndpoints gets the endpoints for one or more services

func (*Client) GetServiceInstances

func (c *Client) GetServiceInstances(serviceID string) ([]service.Instance, error)

GetServiceInstances returns all instances of a service

func (*Client) GetServiceTemplates

func (c *Client) GetServiceTemplates() (map[string]servicetemplate.ServiceTemplate, error)

Get a list of service templates

func (*Client) GetServicesHealth

func (c *Client) GetServicesHealth() (map[string]map[int]map[string]health.HealthStatus, error)

GetServicesHealth returns health checks for all services.

func (*Client) GetSystemUser

func (c *Client) GetSystemUser() (user.User, error)

Get the system user record

func (*Client) GetTenantID

func (c *Client) GetTenantID(serviceID string) (string, error)

GetTenantID returns the ID of the service's tenant (i.e. the root service's ID)

func (*Client) GetVolumeStatus

func (c *Client) GetVolumeStatus() (*volume.Statuses, error)

GetVolumeStatus gets status information for the given volume or nil

func (*Client) HostsAuthenticated

func (c *Client) HostsAuthenticated(hostIDs []string) (map[string]bool, error)

func (*Client) LocateServiceInstance

func (c *Client) LocateServiceInstance(serviceID string, instanceID int) (*service.LocationInstance, error)

LocateServiceInstance returns the location of a service instance

func (*Client) RemoveHost

func (c *Client) RemoveHost(hostID string) error

RemoveHost removes a host

func (*Client) RemoveIPs

func (c *Client) RemoveIPs(args []string) error

Remove the IP assignment of a service's endpoints

func (*Client) RemovePublicEndpointPort

func (c *Client) RemovePublicEndpointPort(serviceid, endpointName, portAddr string) error

Remove a port public endpoint from a service.

func (*Client) RemovePublicEndpointVHost

func (c *Client) RemovePublicEndpointVHost(serviceid, endpointName, vhost string) error

Remove a vhost public endpoint from a service.

func (*Client) RemoveResourcePool

func (c *Client) RemoveResourcePool(poolID string) error

RemoveResourcePool removes a ResourcePool

func (*Client) RemoveServiceTemplate

func (c *Client) RemoveServiceTemplate(serviceTemplateID string) error

Remove a service Template

func (*Client) RemoveVirtualIP

func (c *Client) RemoveVirtualIP(requestVirtualIP pool.VirtualIP) error

RemoveVirtualIP removes a VirtualIP from a specific pool

func (*Client) ReportHealthStatus

func (c *Client) ReportHealthStatus(key health.HealthStatusKey, value health.HealthStatus, expires time.Duration) error

ReportHealthStatus sends an update to the health check status cache.

func (*Client) ReportInstanceDead

func (c *Client) ReportInstanceDead(serviceID string, instanceID int) error

ReportInstanceDead removes stopped instances from the health check status cache.

func (*Client) ResetHostKey

func (c *Client) ResetHostKey(hostID string) ([]byte, error)

func (*Client) ResetRegistry

func (c *Client) ResetRegistry() error

ResetRegistry pulls latest from the running docker registry and updates the index.

func (*Client) ResolveServicePath

func (c *Client) ResolveServicePath(path string, noprefix bool) ([]service.ServiceDetails, error)

ResolveServicePath resolves a service path (e.g., "infrastructure/mariadb") to zero or more ServiceDetails.

func (*Client) SendDockerAction

func (c *Client) SendDockerAction(serviceID string, instanceID int, action string, args []string) error

SendDockerAction submits an action to a docker container

func (*Client) ServiceUse

func (c *Client) ServiceUse(tenantID string, serviceID string, imageID string, registry string, replaceImgs []string, noOp bool) (string, error)

ServiceUse will use a new image for a given service - this will pull the image and tag it

func (*Client) SetIPs

Assigns an IP address to a services that haven't IP Assignment by default

func (*Client) StopServiceInstance

func (c *Client) StopServiceInstance(serviceID string, instanceID int) error

StopServiceInstance stops a service instance.

func (*Client) SyncRegistry

func (c *Client) SyncRegistry() error

SyncRegistry sends a signal to the master to repush all images into the docker registry.

func (*Client) UpdateHost

func (c *Client) UpdateHost(host host.Host) error

UpdateHost updates a host

func (*Client) UpdateResourcePool

func (c *Client) UpdateResourcePool(pool pool.ResourcePool) error

UpdateResourcePool adds the ResourcePool

func (*Client) UpgradeRegistry

func (c *Client) UpgradeRegistry(endpoint string, override bool) error

UpgradeRegistry migrates images from an older or remote docker registry and updates the index.

func (*Client) ValidateCredentials

func (c *Client) ValidateCredentials(user user.User) (bool, error)

Validate the credentials of the specified user

func (*Client) WaitService

func (c *Client) WaitService(serviceIDs []string, state service.DesiredState, timeout time.Duration, recursive bool) error

WaitService will wait for the specified services to reach the specified state, within the given timeout

type ClientInterface

type ClientInterface interface {

	//--------------------------------------------------------------------------
	// RPC Management Functions
	Close() (err error)

	// GetHost gets the host for the given hostID or nil
	GetHost(hostID string) (*host.Host, error)

	// GetHosts returns all hosts or empty array
	GetHosts() ([]host.Host, error)

	// GetActiveHosts returns all active host ids or empty array
	GetActiveHostIDs() ([]string, error)

	// AddHost adds a Host
	AddHost(h host.Host) ([]byte, error)

	// AddHostPrivate adds a Host and registers it with a shared key
	AddHostPrivate(h host.Host) ([]byte, error)

	// UpdateHost updates a host
	UpdateHost(h host.Host) error

	// RemoveHost removes a host
	RemoveHost(hostID string) error

	// FindHostsInPool returns all hosts in a pool
	FindHostsInPool(poolID string) ([]host.Host, error)

	// Authenticate a host and receive an identity token and expiration
	AuthenticateHost(hostID string) (string, int64, error)

	// Get hostID's public key
	GetHostPublicKey(hostID string) ([]byte, error)

	// Reset hostID's private key
	ResetHostKey(hostID string) ([]byte, error)

	// HostsAuthenticated returns if the hosts passed are authenticated or not
	HostsAuthenticated(hostIDs []string) (map[string]bool, error)

	// GetResourcePool gets the pool for the given poolID or nil
	GetResourcePool(poolID string) (*pool.ResourcePool, error)

	// GetResourcePools returns all pools or empty array
	GetResourcePools() ([]pool.ResourcePool, error)

	// AddResourcePool adds the ResourcePool
	AddResourcePool(p pool.ResourcePool) error

	// UpdateResourcePool adds the ResourcePool
	UpdateResourcePool(p pool.ResourcePool) error

	// RemoveResourcePool removes a ResourcePool
	RemoveResourcePool(poolID string) error

	// GetPoolIPs returns a all IPs in a ResourcePool.
	GetPoolIPs(poolID string) (*pool.PoolIPs, error)

	// AddVirtualIP adds a VirtualIP to a specific pool
	AddVirtualIP(requestVirtualIP pool.VirtualIP) error

	// RemoveVirtualIP removes a VirtualIP from a specific pool
	RemoveVirtualIP(requestVirtualIP pool.VirtualIP) error

	// ServiceUse will use a new image for a given service - this will pull the image and tag it
	ServiceUse(tenantID string, serviceID string, imageID string, registry string, replaceImgs []string, noOp bool) (string, error)

	// WaitService will wait for the specified services to reach the specified state, within the given timeout
	WaitService(serviceIDs []string, state service.DesiredState, timeout time.Duration, recursive bool) error

	// GetAllServiceDetails will return a list of all ServiceDetails
	GetAllServiceDetails(since time.Duration) ([]service.ServiceDetails, error)

	// GetServiceDetailsByTenantID will return a list of ServiceDetails for the specified tenant ID
	GetServiceDetailsByTenantID(tenantID string) ([]service.ServiceDetails, error)

	// GetServiceDetails will return a ServiceDetails for the specified service
	GetServiceDetails(serviceID string) (*service.ServiceDetails, error)

	// ResolveServicePath will return ServiceDetails that match the given path and prefix matching style
	ResolveServicePath(path string, noprefix bool) ([]service.ServiceDetails, error)

	// ClearEmergency will set EmergencyShutdown to false on the service and all child services
	ClearEmergency(serviceID string) (int, error)

	// GetServiceInstances returns all running instances of a service
	GetServiceInstances(serviceID string) ([]service.Instance, error)

	// Get a service from serviced where all templated properties have been evaluated
	GetEvaluatedService(serviceID string, instanceID int) (*service.Service, string, string, error)

	// Get the tenant ID for a service
	GetTenantID(serviceID string) (string, error)

	// StopServiceInstance stops a single service instance
	StopServiceInstance(serviceID string, instanceID int) error

	// LocateServiceInstance returns location information about a service
	// instance
	LocateServiceInstance(serviceID string, instanceID int) (*service.LocationInstance, error)

	// SendDockerAction submits a docker action to a running container
	SendDockerAction(serviceID string, instanceID int, action string, args []string) error

	// Add a new service template
	AddServiceTemplate(serviceTemplate servicetemplate.ServiceTemplate) (templateID string, err error)

	// Get a list of ServiceTemplates
	GetServiceTemplates() (serviceTemplates map[string]servicetemplate.ServiceTemplate, err error)

	// Remove a service Template
	RemoveServiceTemplate(serviceTemplateID string) error

	// Deploy an application template
	DeployTemplate(request servicetemplate.ServiceTemplateDeploymentRequest) (tenantIDs []string, err error)

	// GetVolumeStatus gets status information for the given volume or nil
	GetVolumeStatus() (*volume.Statuses, error)

	// GetServiceEndpoints gets the endpoints for one or more services
	GetServiceEndpoints(serviceIDs []string, reportImports, reportExports bool, validate bool) ([]applicationendpoint.EndpointReport, error)

	// ResetRegistry pulls images from the docker registry and updates the
	// index.
	ResetRegistry() error

	// SyncRegistry prompts the master to push its images into the docker
	// registry.
	SyncRegistry() error

	// UpgradeRegistry migrates images from an older or remote docker registry.
	UpgradeRegistry(endpoint string, override bool) error

	// DockerOverride replaces an image in the docker registry with a new image
	DockerOverride(newImage, oldImage string) error

	//--------------------------------------------------------------------------
	// Public Endpoint Management Functions
	AddPublicEndpointPort(serviceid, endpointName, portAddr string, usetls bool, protocol string, isEnabled bool, restart bool) (*servicedefinition.Port, error)

	RemovePublicEndpointPort(serviceid, endpointName, portAddr string) error

	EnablePublicEndpointPort(serviceid, endpointName, portAddr string, isEnabled bool) error

	AddPublicEndpointVHost(serviceid, endpointName, vhost string, isEnabled, restart bool) (*servicedefinition.VHost, error)

	RemovePublicEndpointVHost(serviceid, endpointName, vhost string) error

	EnablePublicEndpointVHost(serviceid, endpointName, vhost string, isEnabled bool) error

	GetAllPublicEndpoints() ([]service.PublicEndpoint, error)

	// Get the system user record
	GetSystemUser() (user.User, error)

	// Validate the credentials of the specified user
	ValidateCredentials(user user.User) (bool, error)

	// GetISvcsHealth returns health status for a list of isvcs
	GetISvcsHealth(IServiceNames []string) ([]isvcs.IServiceHealthResult, error)

	// GetServicesHealth returns health checks for all services.
	GetServicesHealth() (map[string]map[int]map[string]health.HealthStatus, error)

	// ReportHealthStatus sends an update to the health check status cache.
	ReportHealthStatus(key health.HealthStatusKey, value health.HealthStatus, expires time.Duration) error

	// ReportInstanceDead removes stopped instances from the health check status cache.
	ReportInstanceDead(serviceID string, instanceID int) error

	// Enable internal metrics collection
	DebugEnableMetrics() (string, error)

	// Disable internal metrics collection
	DebugDisableMetrics() (string, error)

	// Remove the IP assignment of a service's endpoints
	RemoveIPs(args []string) error

	// Assigns an IP address to a services that haven't IP Assignment by default
	SetIPs(request addressassignment.AssignmentRequest) error
}

The RPC interface is the API for a serviced master.

type DockerActionRequest

type DockerActionRequest struct {
	ServiceID  string
	InstanceID int
	Action     string
	Args       []string
}

type DockerOverrideRequest

type DockerOverrideRequest struct {
	OldImage string
	NewImage string
}

DockerOverrideRequest are options for replacing an image in the docker registry

type EndpointRequest

type EndpointRequest struct {
	ServiceIDs    []string
	ReportImports bool
	ReportExports bool
	Validate      bool
}

Defines a request to get a list of endpoints for one or more services

type EvaluateServiceRequest

type EvaluateServiceRequest struct {
	ServiceID  string
	InstanceID int
}

type EvaluateServiceResponse

type EvaluateServiceResponse struct {
	Service         service.Service
	TenantID        string
	ServiceNamePath string
}

type HealthStatusRequest

type HealthStatusRequest struct {
	Key     health.HealthStatusKey
	Value   health.HealthStatus
	Expires time.Duration
}

HealthStatusRequest sends health status data to the health status cache.

type HostAuthenticationRequest

type HostAuthenticationRequest struct {
	HostID    string
	Timestamp int64
	Signature []byte
}

type HostAuthenticationResponse

type HostAuthenticationResponse struct {
	Token   string
	Expires int64
}

type PublicEndpointRequest

type PublicEndpointRequest struct {
	Serviceid    string
	EndpointName string
	Name         string
	UseTLS       bool
	Protocol     string
	IsEnabled    bool
	Restart      bool
}

Defines a request to add a port public endpoints to a service

type ReportDeadInstanceRequest

type ReportDeadInstanceRequest struct {
	ServiceID  string
	InstanceID int
}

type ResolveServiceRequest

type ResolveServiceRequest struct {
	Path     string
	NoPrefix bool
}

type Server

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

Server is the RPC type for the master(s)

func NewServer

func NewServer(f *facade.Facade, tokenExpiration time.Duration) *Server

NewServer creates a new serviced master rpc server

func (*Server) AddHost

func (s *Server) AddHost(host host.Host, hostReply *[]byte) error

AddHost adds the host

func (*Server) AddHostPrivate

func (s *Server) AddHostPrivate(host host.Host, hostReply *[]byte) error

AddHostPrivate adds the host using a shared key approved of beforehand and returns the master's public key.

func (*Server) AddPublicEndpointPort

func (s *Server) AddPublicEndpointPort(request *PublicEndpointRequest, reply *servicedefinition.Port) error

Adds a port public endpoint to a service.

func (*Server) AddPublicEndpointVHost

func (s *Server) AddPublicEndpointVHost(request *PublicEndpointRequest, reply *servicedefinition.VHost) error

Adds a vhost public endpoint to a service.

func (*Server) AddResourcePool

func (s *Server) AddResourcePool(pool pool.ResourcePool, _ *struct{}) error

AddResourcePool adds the pool

func (*Server) AddServiceTemplate

func (s *Server) AddServiceTemplate(serviceTemplate servicetemplate.ServiceTemplate, response *string) error

Add a new service template

func (*Server) AddVirtualIP

func (s *Server) AddVirtualIP(requestVirtualIP pool.VirtualIP, _ *struct{}) error

AddVirtualIP adds a specific virtual IP to a pool

func (*Server) AuthenticateHost

func (s *Server) AuthenticateHost(req HostAuthenticationRequest, resp *HostAuthenticationResponse) error

func (*Server) ClearEmergency

func (s *Server) ClearEmergency(serviceID string, count *int) error

ClearEmergency clears the EmergencyShutdown flag on a service and all child services it returns the number of affected services

func (*Server) DebugDisableMetrics

func (s *Server) DebugDisableMetrics(unused struct{}, results *string) error

func (*Server) DebugEnableMetrics

func (s *Server) DebugEnableMetrics(unused struct{}, results *string) error

func (*Server) DeployTemplate

func (s *Server) DeployTemplate(request servicetemplate.ServiceTemplateDeploymentRequest, response *[]string) error

Deploy a service template

func (*Server) DockerOverride

func (s *Server) DockerOverride(overrideReq DockerOverrideRequest, _ *int) error

DockerOverride replaces an image in the registry with a new image

func (*Server) EnablePublicEndpointPort

func (s *Server) EnablePublicEndpointPort(request *PublicEndpointRequest, _ *struct{}) error

Enable/disable a port public endpoint for a service.

func (*Server) EnablePublicEndpointVHost

func (s *Server) EnablePublicEndpointVHost(request *PublicEndpointRequest, _ *struct{}) error

Enable/disable a vhost public endpoint for a service.

func (*Server) FindHostsInPool

func (s *Server) FindHostsInPool(poolID string, hostReply *[]host.Host) error

FindHostsInPool Returns all Hosts in a pool

func (*Server) GetActiveHostIDs

func (s *Server) GetActiveHostIDs(empty struct{}, hostReply *[]string) error

GetActiveHosts returns all active host ids

func (*Server) GetAllPublicEndpoints

func (s *Server) GetAllPublicEndpoints(empty struct{}, publicEndpoints *[]service.PublicEndpoint) error

GetAllPublicEndpoints get all public endpoints

func (*Server) GetAllServiceDetails

func (s *Server) GetAllServiceDetails(since time.Duration, response *[]service.ServiceDetails) error

GetAllServiceDetails will return a list of all ServiceDetails

func (*Server) GetEvaluatedService

func (s *Server) GetEvaluatedService(request EvaluateServiceRequest, response *EvaluateServiceResponse) error

GetEvaluatedService returns a service where an evaluation has been executed against all templated properties.

func (*Server) GetHost

func (s *Server) GetHost(hostID string, reply *host.Host) error

GetHost gets the host

func (*Server) GetHostPublicKey

func (s *Server) GetHostPublicKey(hostID string, key *[]byte) error

Return host's public key

func (*Server) GetHosts

func (s *Server) GetHosts(empty struct{}, hostReply *[]host.Host) error

GetHosts returns all Hosts

func (*Server) GetISvcsHealth

func (s *Server) GetISvcsHealth(IServiceNames []string, results *[]isvcs.IServiceHealthResult) error

GetISvcsHealth returns health status for a list of isvcs

func (*Server) GetPoolIPs

func (s *Server) GetPoolIPs(poolID string, reply *pool.PoolIPs) error

GetPoolIPs gets all ips available to a pool

func (*Server) GetResourcePool

func (s *Server) GetResourcePool(poolID string, reply *pool.ResourcePool) error

GetResourcePool gets the pool

func (*Server) GetResourcePools

func (s *Server) GetResourcePools(empty struct{}, poolsReply *[]pool.ResourcePool) error

GetResourcePools returns all ResourcePools

func (*Server) GetService

func (s *Server) GetService(serviceID string, svc *service.Service) error

Get a specific service

func (*Server) GetServiceDetails

func (s *Server) GetServiceDetails(serviceID string, response *service.ServiceDetails) error

GetServiceDetails will return a ServiceDetails for the specified service

func (*Server) GetServiceDetailsByTenantID

func (s *Server) GetServiceDetailsByTenantID(tenantID string, response *[]service.ServiceDetails) error

GetServiceDetailsByTenantID will return a list of ServiceDetails for the specified tenant ID

func (*Server) GetServiceEndpoints

func (s *Server) GetServiceEndpoints(request *EndpointRequest, reply *[]applicationendpoint.EndpointReport) error

Get the endpoints for one or more services

func (*Server) GetServiceInstances

func (s *Server) GetServiceInstances(serviceID string, res *[]service.Instance) (err error)

GetServiceInstances returns all instances of a service

func (*Server) GetServiceTemplates

func (s *Server) GetServiceTemplates(unused struct{}, response *map[string]servicetemplate.ServiceTemplate) error

Get a list of service templates

func (*Server) GetServicesHealth

func (s *Server) GetServicesHealth(unused struct{}, results *map[string]map[int]map[string]health.HealthStatus) error

GetServicesHealth returns health checks for all services.

func (*Server) GetSystemUser

func (s *Server) GetSystemUser(unused struct{}, systemUser *user.User) error

Get the system user

func (*Server) GetTenantID

func (s *Server) GetTenantID(serviceID string, tenantId *string) error

The tenant id is the root service uuid. Walk the service tree to root to find the tenant id.

func (*Server) GetVolumeStatus

func (s *Server) GetVolumeStatus(empty struct{}, reply *volume.Statuses) error

GetVolumeStatus gets the volume status

func (*Server) HostsAuthenticated

func (s *Server) HostsAuthenticated(hostIDs []string, res *map[string]bool) error

Given a list of hostsID return if they are authenticated

func (*Server) LocateServiceInstance

func (s *Server) LocateServiceInstance(req ServiceInstanceRequest, res *service.LocationInstance) (err error)

LocateServiceInstance locates a single service instance

func (*Server) RemoveHost

func (s *Server) RemoveHost(hostID string, _ *struct{}) error

RemoveHost removes the host

func (*Server) RemoveIPs

func (s *Server) RemoveIPs(args []string, unused *string) error

func (*Server) RemovePublicEndpointPort

func (s *Server) RemovePublicEndpointPort(request *PublicEndpointRequest, _ *struct{}) error

Remove a port public endpoint from a service.

func (*Server) RemovePublicEndpointVHost

func (s *Server) RemovePublicEndpointVHost(request *PublicEndpointRequest, _ *struct{}) error

Remove a vhost public endpoint from a service.

func (*Server) RemoveResourcePool

func (s *Server) RemoveResourcePool(poolID string, _ *struct{}) error

RemoveResourcePool removes the pool

func (*Server) RemoveServiceTemplate

func (s *Server) RemoveServiceTemplate(templateID string, _ *struct{}) error

Remove a service template

func (*Server) RemoveVirtualIP

func (s *Server) RemoveVirtualIP(requestVirtualIP pool.VirtualIP, _ *struct{}) error

RemoveVirtualIP removes a specific virtual IP from a pool

func (*Server) ReportHealthStatus

func (s *Server) ReportHealthStatus(request HealthStatusRequest, _ *struct{}) error

ReportHealthStatus sends an update to the health check status cache.

func (*Server) ReportInstanceDead

func (s *Server) ReportInstanceDead(request ReportDeadInstanceRequest, _ *struct{}) error

ReportInstanceDead removes stopped instances from the health check status cache.

func (*Server) ResetHostKey

func (s *Server) ResetHostKey(hostID string, key *[]byte) error

Reset and return host's private key

func (*Server) ResetRegistry

func (s *Server) ResetRegistry(req struct{}, reply *int) error

ResetRegistry pulls from the configured docker registry and updates the index.

func (*Server) ResolveServicePath

func (s *Server) ResolveServicePath(request ResolveServiceRequest, response *[]service.ServiceDetails) error

ResolveServicePath resolves a service path (e.g., "infrastructure/mariadb") to zero or more ServiceDetails.

func (*Server) SendDockerAction

func (s *Server) SendDockerAction(req DockerActionRequest, unused *string) (err error)

SendDockerAction submits an action to a docker container

func (*Server) ServiceUse

func (s *Server) ServiceUse(request *ServiceUseRequest, response *string) error

Use a new image for a given service - this will pull the image and tag it

func (*Server) SetIPs

func (s *Server) SetIPs(request addressassignment.AssignmentRequest, unused *string) error

func (*Server) StopServiceInstance

func (s *Server) StopServiceInstance(req ServiceInstanceRequest, unused *string) (err error)

StopServiceInstance stops a single service instance

func (*Server) SyncRegistry

func (s *Server) SyncRegistry(req struct{}, reply *int) error

SyncRegistry prompts the master to repush all images in the index into the docker registry.

func (*Server) UpdateHost

func (s *Server) UpdateHost(host host.Host, _ *struct{}) error

UpdateHost updates the host

func (*Server) UpdateResourcePool

func (s *Server) UpdateResourcePool(pool pool.ResourcePool, _ *struct{}) error

UpdateResourcePool updates the pool

func (*Server) UpgradeRegistry

func (s *Server) UpgradeRegistry(req UpgradeDockerRequest, reply *int) error

UpgradeRegistry migrates docker registry images from an older or remote docker registry.

func (*Server) ValidateCredentials

func (s *Server) ValidateCredentials(someUser user.User, valid *bool) error

Validate the credentials of the specified user

func (*Server) WaitService

func (s *Server) WaitService(request *WaitServiceRequest, throwaway *string) error

Wait on specified services to be in the given state

type ServiceDetailsByTenantIDRequest

type ServiceDetailsByTenantIDRequest struct {
	TenantID string
	Since    time.Duration
}

type ServiceInstanceRequest

type ServiceInstanceRequest struct {
	ServiceID  string
	InstanceID int
}

type ServiceUseRequest

type ServiceUseRequest struct {
	TenantID    string
	ServiceID   string
	ImageID     string
	ReplaceImgs []string
	Registry    string
	NoOp        bool
}

type UpgradeDockerRequest

type UpgradeDockerRequest struct {
	Endpoint string
	Override bool
}

UpgradeDockerRequest are options for upgrading/migrating the docker registry.

type WaitServiceRequest

type WaitServiceRequest struct {
	ServiceIDs []string
	State      service.DesiredState
	Timeout    time.Duration
	Recursive  bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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