Documentation ¶
Index ¶
- Constants
- Variables
- func DesiredCancelsPending(pendingState ServiceCurrentState, desiredState DesiredState) bool
- func DesiredStateIsRedundant(desiredState DesiredState, emergency bool, currentState ServiceCurrentState) bool
- func GetType() string
- func Key(id string) datastore.Key
- func Round(value float64) int64
- func ScrubPortString(port string) string
- func Walk(serviceID string, visitFn Visit, getService GetService, ...) error
- type AggregateService
- type BaseIPAssignment
- type Config
- type DesiredState
- type EndpointQueryResult
- type ExportedEndpoint
- type FindChildService
- type GetChildServices
- type GetService
- type IPAssignment
- type Instance
- type InstanceCurrentState
- type LocationInstance
- type PublicEndpoint
- type Query
- type Service
- func (s *Service) AddPort(application string, portAddr string, usetls bool, protocol string, ...) (*svcdef.Port, error)
- func (s *Service) AddVirtualHost(application, vhostName string, isEnabled bool) (*svcdef.VHost, error)
- func (s *Service) EnablePort(application string, portAddr string, enable bool) error
- func (s *Service) EnableVirtualHost(application, vhostName string, enable bool) error
- func (s *Service) Equals(b *Service) bool
- func (service *Service) Evaluate(getSvc GetService, findChild FindChildService, instanceID int) (err error)
- func (service *Service) EvaluateActionsTemplate(gs GetService, fc FindChildService, instanceID int) (err error)
- func (service *Service) EvaluateConfigFilesTemplate(gs GetService, fc FindChildService, instanceID int) (err error)
- func (service *Service) EvaluateEndpointTemplates(gs GetService, fc FindChildService, instanceID int) (err error)
- func (service *Service) EvaluateEnvironmentTemplate(gs GetService, fc FindChildService, instanceID int) (err error)
- func (service *Service) EvaluateHealthCheckTemplate(gs GetService, fc FindChildService, instanceID int) (err error)
- func (service *Service) EvaluateHostnameTemplate(gs GetService, fc FindChildService, instanceID int) (err error)
- func (service *Service) EvaluateLogConfigTemplate(gs GetService, fc FindChildService, instanceID int) (err error)
- func (service *Service) EvaluatePrereqsTemplate(gs GetService, fc FindChildService, instanceID int) (err error)
- func (service *Service) EvaluateRunsTemplate(gs GetService, fc FindChildService) (err error)
- func (service *Service) EvaluateStartupTemplate(gs GetService, fc FindChildService, instanceID int) (err error)
- func (service *Service) EvaluateVolumesTemplate(gs GetService, fc FindChildService, instanceID int) (err error)
- func (s *Service) GetID() string
- func (s Service) GetPath(gs GetService) (string, error)
- func (s *Service) GetPort(application, portAddr string) *svcdef.Port
- func (s *Service) GetServiceExports() []ServiceEndpoint
- func (s *Service) GetServiceImports() []ServiceEndpoint
- func (s *Service) GetServicePorts() []ServiceEndpoint
- func (s *Service) GetServiceVHosts() []ServiceEndpoint
- func (s *Service) GetType() string
- func (s *Service) GetVirtualHost(application, vhostName string) *svcdef.VHost
- func (s *Service) HasEndpointsFor(purpose string) bool
- func (s *Service) RemovePort(application string, portAddr string) error
- func (s *Service) RemoveVirtualHost(application, vhostName string) error
- func (s Service) SetAddressConfig(endpointName string, sa svcdef.AddressResourceConfig) error
- func (s *Service) UnmarshalJSON(b []byte) error
- func (s *Service) ValidEntity() error
- type ServiceCurrentState
- type ServiceDetails
- type ServiceEndpoint
- func (e *ServiceEndpoint) GetAssignment() *addressassignment.AddressAssignment
- func (e *ServiceEndpoint) IsConfigurable() bool
- func (e *ServiceEndpoint) RemoveAssignment() error
- func (e *ServiceEndpoint) SetAssignment(aa addressassignment.AddressAssignment) error
- func (e *ServiceEndpoint) UnmarshalJSON(b []byte) error
- func (endpoint ServiceEndpoint) ValidEntity() error
- type ServiceHealth
- type StatusInstance
- type Store
- type StrategyInstance
- type Usage
- type Visit
Constants ¶
const ( // SVCRestart is the 'restart' DesiredState value. SVCRestart = DesiredState(-1) // SVCStop is the 'stop' DesiredState value. SVCStop = DesiredState(0) // SVCRun is the 'run' DesiredState value. SVCRun = DesiredState(1) // SVCPause is the 'pause' DesiredState value. SVCPause = DesiredState(2) )
const ( // SVCCSUnknown is the 'unknown' current state. SVCCSUnknown = ServiceCurrentState("unknown") // SVCCSStopped is the 'stopped' current state. SVCCSStopped = ServiceCurrentState("stopped") // SVCCSPendingStart is the 'pending start' current state. SVCCSPendingStart = ServiceCurrentState("pending_start") // SVCCSStarting is the 'starting' current state. SVCCSStarting = ServiceCurrentState("starting") // SVCCSRunning is the 'started' current state. SVCCSRunning = ServiceCurrentState("started") // SVCCSPendingRestart is the 'pending restart' current state. SVCCSPendingRestart = ServiceCurrentState("pending_restart") // SVCCSRestarting is the 'restarting' current state. SVCCSRestarting = ServiceCurrentState("restarting") // SVCCSPendingStop is the 'pending stop' current state. SVCCSPendingStop = ServiceCurrentState("pending_stop") // SVCCSStopping is the 'stopping' current state. SVCCSStopping = ServiceCurrentState("stopping") // SVCCSPendingPause is the 'pending pause' current state. SVCCSPendingPause = ServiceCurrentState("pending_pause") // SVCCSPausing is the 'pausing' current state. SVCCSPausing = ServiceCurrentState("pausing") // SVCCSPaused is the 'paused' current state. SVCCSPaused = ServiceCurrentState("paused") // SVCCSPendingEmergencyStop is the 'pending emergency stop' current state. SVCCSPendingEmergencyStop = ServiceCurrentState("pending_emergency_stop") // SVCCSEmergencyStopping is the 'emergency stopping' current state. SVCCSEmergencyStopping = ServiceCurrentState("emergency_stopping") // SVCCSEmergencyStopped is the 'emergency stopped' current state. SVCCSEmergencyStopped = ServiceCurrentState("emergency_stopped") )
Variables ¶
var (
//MAPPING is the elastic mapping for a service
MAPPING, _ = elastic.NewMapping(mappingString)
)
Functions ¶
func DesiredCancelsPending ¶
func DesiredCancelsPending(pendingState ServiceCurrentState, desiredState DesiredState) bool
DesiredCancelsPending returns true if the desired state acts as a "cancel" to a pending current state.
func DesiredStateIsRedundant ¶
func DesiredStateIsRedundant(desiredState DesiredState, emergency bool, currentState ServiceCurrentState) bool
DesiredStateIsRedundant returns true if setting the desired state would be unnecessary.
func GetType ¶
func GetType() string
GetType returns a Services's type or kind, can be used to get the string value of Service's type without a Service instance. It returns the kind as a string.
func ScrubPortString ¶
ScrubPortString makes a best effort to produce a valid port address.
func Walk ¶
func Walk(serviceID string, visitFn Visit, getService GetService, getChildren GetChildServices) error
Walk traverses the service hierarchy and calls the supplied Visit function on each service
Types ¶
type AggregateService ¶
type AggregateService struct { ServiceID string Name string DesiredState DesiredState CurrentState ServiceCurrentState Status []StatusInstance NotFound bool EmergencyShutdown bool RAMCommitment int64 }
AggregateService is a lighter service object for providing aggregate service status information
type BaseIPAssignment ¶
type BaseIPAssignment struct { ServiceID string ParentServiceID string ServiceName string PoolID string Port uint16 Application string EndpointName string }
BaseIPAssignment is a minimal service object that describes a service endpoint which may or may not have an address assignment.
type DesiredState ¶
type DesiredState int
DesiredState is the desired state of a service.
func (DesiredState) String ¶
func (state DesiredState) String() string
String returns the text representation of a DesiredState value.
func (DesiredState) ToAuditAction ¶
func (state DesiredState) ToAuditAction() string
ToAuditAction returns the audit name of a DesiredState value.
type EndpointQueryResult ¶
type EndpointQueryResult struct { ID string Name string PoolID string ParentServiceID string Endpoints []ServiceEndpoint datastore.VersionedEntity }
EndpointQueryResult used for unmarshalling query results
func (*EndpointQueryResult) ValidEntity ¶
func (d *EndpointQueryResult) ValidEntity() error
ValidEntity for EndpointQueryResult entity
type ExportedEndpoint ¶
type ExportedEndpoint struct { ServiceID string ServiceName string Application string Protocol string }
ExportedEndpoint is a minimal service object that describes exported endpoints for a service. NOTE: Could add booleans for ip assignment, vhost, and ports
type FindChildService ¶
FindChildService finds a child service with a given name, error if not found
type GetChildServices ¶
GetChildServices returns a list of services that are children to the parentID, return empty list if none found
type GetService ¶
GetService return a service, return error if not found
type IPAssignment ¶
type IPAssignment struct { BaseIPAssignment HostID string HostName string Type string IPAddress string }
IPAssignment is a minimal service object that describes an address assignment for a service.
type Instance ¶
type Instance struct { InstanceID int HostID string HostName string ServiceID string ServiceName string // FIXME: service path would be better ContainerID string ImageSynced bool DesiredState DesiredState CurrentState InstanceCurrentState HealthStatus map[string]health.Status RAMCommitment int64 RAMThreshold uint MemoryUsage Usage Scheduled time.Time Started time.Time Terminated time.Time }
Instance describes an instance of a service
type InstanceCurrentState ¶
type InstanceCurrentState string
CurrentState tracks the current state of a service instance
const ( StateStopping InstanceCurrentState = "stopping" StateStarting InstanceCurrentState = "starting" StatePausing InstanceCurrentState = "pausing" StatePaused InstanceCurrentState = "paused" StateRunning InstanceCurrentState = "started" StateStopped InstanceCurrentState = "stopped" StatePulling InstanceCurrentState = "pulling" StateResuming InstanceCurrentState = "resuming" StatePendingRestart InstanceCurrentState = "pending_restart" StateEmergencyStopping InstanceCurrentState = "emergency_stopping" StateEmergencyStopped InstanceCurrentState = "emergency_stopped" )
type LocationInstance ¶
LocationInstance collection location information about a service instance
type PublicEndpoint ¶
type PublicEndpoint struct { ServiceID string ServiceName string Application string Protocol string VHostName string `json:",omitempty"` PortAddress string `json:",omitempty"` Enabled bool }
PublicEndpoint is a minimal service object that describes a public endpoint for a service
type Service ¶
type Service struct { ID string Name string Title string // Title is a label used when describing this service in the context of a service tree Version string Context map[string]interface{} Environment []string Startup string RunAs string Description string Tags []string OriginalConfigs map[string]svcdef.ConfigFile ConfigFiles map[string]svcdef.ConfigFile Instances int InstanceLimits domain.MinMax ChangeOptions []svcdef.ChangeOption ImageID string PoolID string DesiredState int CurrentState string HostPolicy svcdef.HostPolicy Hostname string Privileged bool Launch string Endpoints []ServiceEndpoint ParentServiceID string Volumes []svcdef.Volume CreatedAt time.Time UpdatedAt time.Time DeploymentID string DisableImage bool LogConfigs []svcdef.LogConfig Snapshot svcdef.SnapshotCommands DisableShell bool Runs map[string]string // FIXME: This field is deprecated. Remove when possible. Commands map[string]domain.Command RAMCommitment utils.EngNotation RAMThreshold uint CPUCommitment uint64 Actions map[string]string HealthChecks map[string]health.HealthCheck // A health check for the service. // Prereqs is a list of scripts that must run successfully before running the command in the Startup field. Prereqs []domain.Prereq MonitoringProfile domain.MonitorProfile MemoryLimit float64 OomKillDisable bool OomScoreAdj int64 PIDFile string // StartLevel represents the order in which services are started and stopped // in normal operations. All services of a given level start before any services // at higher levels. Stopping services occurs in the reverse order. Services // with StartLevel 0 (representing undefined) start after and stop before services // with a defined StartLevel. StartLevel uint // EmergencyShutdownLevel represents the order in which services are stopped in an // emergency low-storage situation. All services of a given EmergencyShutdownLevel are // stopped before any services of a higher EmergencyShutdownLevel. In an emergency // low-storage shutdown, services with EmergencyShutdownLevel 0 (representing undefined) // are stopped after services with a defined EmergencyShutdownLevel, in the normal order // dictated by their StartLevel. EmergencyShutdownLevel uint // EmergencyShutdown is a flag that indicates whether this service has been shutdown due // to an emergency (low-storage) situation. Services with this flag set can not be started EmergencyShutdown bool datastore.VersionedEntity }
Service is a service that can run in serviced. A Service is created when a ServiceDefinition is deployed.
func BuildService ¶
func BuildService( sd svcdef.ServiceDefinition, parentServiceID string, poolID string, desiredState int, deploymentID string, ) (*Service, error)
BuildService build a service from a ServiceDefinition.
func CloneService ¶
CloneService copies a service and mutates id and names
func (*Service) AddPort ¶
func (s *Service) AddPort( application string, portAddr string, usetls bool, protocol string, isEnabled bool, ) (*svcdef.Port, error)
AddPort Add a port for given service, this method avoids duplicate ports
func (*Service) AddVirtualHost ¶
func (s *Service) AddVirtualHost(application, vhostName string, isEnabled bool) (*svcdef.VHost, error)
AddVirtualHost Add a virtual host for given service, this method avoids duplicates vhosts
func (*Service) EnablePort ¶
EnablePort enables or disables a port for given service
func (*Service) EnableVirtualHost ¶
EnableVirtualHost enable or disable a virtual host for given service
func (*Service) Evaluate ¶
func (service *Service) Evaluate(getSvc GetService, findChild FindChildService, instanceID int) (err error)
Evaluate evaluates all the fields of the Service that we care about, using a runtimeContext with the current Service embedded, and adding instanceID as an extra attribute.
func (*Service) EvaluateActionsTemplate ¶
func (service *Service) EvaluateActionsTemplate(gs GetService, fc FindChildService, instanceID int) (err error)
EvaluateActionsTemplate parses and evaluates the Actions string of a service.
func (*Service) EvaluateConfigFilesTemplate ¶
func (service *Service) EvaluateConfigFilesTemplate(gs GetService, fc FindChildService, instanceID int) (err error)
EvaluateConfigFilesTemplate parses and evals the Filename and Content. This happens for each ConfigFile on the service.
func (*Service) EvaluateEndpointTemplates ¶
func (service *Service) EvaluateEndpointTemplates(gs GetService, fc FindChildService, instanceID int) (err error)
EvaluateEndpointTemplates parses and evaluates the "ApplicationTemplate" property of each of the service endpoints for this service.
func (*Service) EvaluateEnvironmentTemplate ¶
func (service *Service) EvaluateEnvironmentTemplate(gs GetService, fc FindChildService, instanceID int) (err error)
EvaluateEndpointTemplates parses and evaluates the "Environment" property of this service.
func (*Service) EvaluateHealthCheckTemplate ¶
func (service *Service) EvaluateHealthCheckTemplate(gs GetService, fc FindChildService, instanceID int) (err error)
EvaluateHealthCheckTemplate parses and evals the Script field for each HealthCheck.
func (*Service) EvaluateHostnameTemplate ¶
func (service *Service) EvaluateHostnameTemplate(gs GetService, fc FindChildService, instanceID int) (err error)
EvaluateHostnameTemplate parses and evaluates the Hostname string of a service.
func (*Service) EvaluateLogConfigTemplate ¶
func (service *Service) EvaluateLogConfigTemplate(gs GetService, fc FindChildService, instanceID int) (err error)
EvaluateLogConfigTemplate parses and evals the Path, Type and all the values for the tags of the log configs. This happens for each LogConfig on the service.
func (*Service) EvaluatePrereqsTemplate ¶
func (service *Service) EvaluatePrereqsTemplate(gs GetService, fc FindChildService, instanceID int) (err error)
EvaluatePrereqsTemplate parses and evals the Script field for each Prereq.
func (*Service) EvaluateRunsTemplate ¶
func (service *Service) EvaluateRunsTemplate(gs GetService, fc FindChildService) (err error)
EvaluateRunsTemplate parses and evaluates the Runs string of a service.
func (*Service) EvaluateStartupTemplate ¶
func (service *Service) EvaluateStartupTemplate(gs GetService, fc FindChildService, instanceID int) (err error)
EvaluateStartupTemplate parses and evaluates the StartUp string of a service.
func (*Service) EvaluateVolumesTemplate ¶
func (service *Service) EvaluateVolumesTemplate(gs GetService, fc FindChildService, instanceID int) (err error)
EvaluateVolumesTemplate parses and evaluates the ResourcePath string in volumes of a service
func (Service) GetPath ¶
func (s Service) GetPath(gs GetService) (string, error)
GetPath uses the GetService function to determine the / delimited name path i.e. /test/app/sevicename
func (*Service) GetServiceExports ¶
func (s *Service) GetServiceExports() []ServiceEndpoint
GetServiceExports retrieves service endpoints whose purpose is "export"
func (*Service) GetServiceImports ¶
func (s *Service) GetServiceImports() []ServiceEndpoint
GetServiceImports retrieves service endpoints whose purpose is "import"
func (*Service) GetServicePorts ¶
func (s *Service) GetServicePorts() []ServiceEndpoint
GetServicePorts retrieves service endpoints that specify additional port(s)
func (*Service) GetServiceVHosts ¶
func (s *Service) GetServiceVHosts() []ServiceEndpoint
GetServiceVHosts retrieves service endpoints that specify a virtual HostPort
func (*Service) GetType ¶
GetType return a service Entity type or kind. It returns the Kind as a string.
func (*Service) GetVirtualHost ¶
GetVirtualHost returns the matching VHost entry or nil if not found.
func (*Service) HasEndpointsFor ¶
HasEndpointsFor determines if the service has any imports for the specified purpose, eg import
func (*Service) RemovePort ¶
RemovePort Remove a port for given service
func (*Service) RemoveVirtualHost ¶
RemoveVirtualHost Remove a virtual host for given service
func (Service) SetAddressConfig ¶
func (s Service) SetAddressConfig(endpointName string, sa svcdef.AddressResourceConfig) error
SetAddressConfig sets the AddressConfig for the endpoint
func (*Service) UnmarshalJSON ¶
UnmarshalJSON loads a JSON byte stream into the Service object.
func (*Service) ValidEntity ¶
ValidEntity validate that Service has all required fields
type ServiceCurrentState ¶
type ServiceCurrentState string
ServiceCurrentState is the current state of a service.
func DesiredToCurrentFinalState ¶
func DesiredToCurrentFinalState(state DesiredState, emergency bool) ServiceCurrentState
DesiredToCurrentFinalState converts a DesiredState value to a ServiceCurrentState 'final' value.
func DesiredToCurrentPendingState ¶
func DesiredToCurrentPendingState(state DesiredState, emergency bool) ServiceCurrentState
DesiredToCurrentPendingState converts a DesiredState value to a ServiceCurrentState 'pending' value.
func DesiredToCurrentTransitionState ¶
func DesiredToCurrentTransitionState(state DesiredState, emergency bool) ServiceCurrentState
DesiredToCurrentTransitionState converts a DesiredState value to a ServiceCurrentState 'transition' value.
func (ServiceCurrentState) Validate ¶
func (state ServiceCurrentState) Validate() error
Validate verifies that a ServiceCurrentState has a valid value.
type ServiceDetails ¶
type ServiceDetails struct { ID string Name string Description string PoolID string ImageID string ParentServiceID string Parent *ServiceDetails `json:",omitempty"` // optional, only needed when looking up service ancestry Instances int InstanceLimits domain.MinMax RAMCommitment utils.EngNotation RAMThreshold uint Startup string HasChildren bool DeploymentID string DesiredState int CurrentState string Launch string Tags []string EmergencyShutdown bool UpdatedAt time.Time CreatedAt time.Time Version string datastore.VersionedEntity }
ServiceDetails is the minimal data necessary to show for a service
func (*ServiceDetails) Equals ¶
func (s *ServiceDetails) Equals(b *ServiceDetails) bool
Equals returns true if two instances of ServiceDetails are the same
func (*ServiceDetails) ValidEntity ¶
func (d *ServiceDetails) ValidEntity() error
Validation for Service ServiceDetails entity
type ServiceEndpoint ¶
type ServiceEndpoint struct { Name string // Human readable name of the endpoint. Unique per service definition Purpose string Protocol string PortNumber uint16 PortTemplate string // A template which, if specified, is used to calculate the port number // VirtualAddress is an address by which an imported endpoint may be accessed within the container. // e.g. "mysqlhost:1234" VirtualAddress string Application string ApplicationTemplate string AddressConfig svcdef.AddressResourceConfig // VHost is used to request named vhost for this endpoint. // Should be the name of a subdomain, i.e "myapplication" not "myapplication.host.com" VHosts []string // VHostList is used to request named vhost(s) for this endpoint. VHostList []svcdef.VHost AddressAssignment addressassignment.AddressAssignment // PortList is the list of enabled/disabled ports to assign to this endpoint. PortList []svcdef.Port }
ServiceEndpoint endpoint exported or imported by a service
func BuildServiceEndpoint ¶
func BuildServiceEndpoint(epd svcdef.EndpointDefinition) ServiceEndpoint
BuildServiceEndpoint build a ServiceEndpoint from a EndpointDefinition
func (*ServiceEndpoint) GetAssignment ¶
func (e *ServiceEndpoint) GetAssignment() *addressassignment.AddressAssignment
GetAssignment Returns nil if no assignment set
func (*ServiceEndpoint) IsConfigurable ¶
func (e *ServiceEndpoint) IsConfigurable() bool
IsConfigurable returns true if the endpoint is configurable
func (*ServiceEndpoint) RemoveAssignment ¶
func (e *ServiceEndpoint) RemoveAssignment() error
RemoveAssignment resets a service endpoints to nothing
func (*ServiceEndpoint) SetAssignment ¶
func (e *ServiceEndpoint) SetAssignment(aa addressassignment.AddressAssignment) error
SetAssignment sets the AddressAssignment for the endpoint
func (*ServiceEndpoint) UnmarshalJSON ¶
func (e *ServiceEndpoint) UnmarshalJSON(b []byte) error
UnmarshalJSON loads a JSON byte stream into a ServiceEndpoint object.
func (ServiceEndpoint) ValidEntity ¶
func (endpoint ServiceEndpoint) ValidEntity() error
ValidEntity ensures the enpoint has valid values, does not check vhosts, public ports and assignments
type ServiceHealth ¶
type ServiceHealth struct { ID string Name string PoolID string Instances int DesiredState int CurrentState string HealthChecks map[string]health.HealthCheck EmergencyShutdown bool RAMCommitment utils.EngNotation datastore.VersionedEntity }
a lightweight Service object with enough data to support status polling even if frequent
func BuildServiceHealth ¶
func BuildServiceHealth(svc Service) *ServiceHealth
func (*ServiceHealth) ValidEntity ¶
func (sh *ServiceHealth) ValidEntity() error
Validation for Service ServiceDetails entity
type StatusInstance ¶
type StatusInstance struct { InstanceID int HealthStatus map[string]health.Status MemoryUsage Usage }
StatusInstance is an abbreviated version of the above instance data, designed to be polled at a high frequency and attached to a service
type Store ¶
type Store interface { // Put adds or updates a Service Put(ctx datastore.Context, svc *Service) error // Get a Service by id. Return ErrNoSuchEntity if not found Get(ctx datastore.Context, id string) (*Service, error) // Delete removes the a Service if it exists Delete(ctx datastore.Context, id string) error // Update the DesiredState in volatile memory for the service UpdateDesiredState(ctx datastore.Context, serviceID string, desiredState int) error // Update the CurrentState in volatile memory for the service UpdateCurrentState(ctx datastore.Context, serviceID string, currentState string) error // GetServices returns all services GetServices(ctx datastore.Context) ([]Service, error) // GetUpdatedServices returns all services updated since "since" time.Duration ago GetUpdatedServices(ctx datastore.Context, since time.Duration) ([]Service, error) // GetTaggedServices returns services with the given tags GetTaggedServices(ctx datastore.Context, tags ...string) ([]Service, error) // GetServicesByPool returns services with the given pool id GetServicesByPool(ctx datastore.Context, poolID string) ([]Service, error) // GetServiceCountByImage returns a count of services using a given imageid GetServiceCountByImage(ctx datastore.Context, imageID string) (int, error) // GetServicesByDeployment returns services with the given deployment id GetServicesByDeployment(ctx datastore.Context, deploymentID string) ([]Service, error) // GetChildServices returns services that are children of the given parent service id GetChildServices(ctx datastore.Context, parentID string) ([]Service, error) FindChildService(ctx datastore.Context, deploymentID, parentID, serviceName string) (*Service, error) // FindTenantByDeployment returns the tenant service for a given deployment id and service name FindTenantByDeploymentID(ctx datastore.Context, deploymentID, name string) (*Service, error) // GetServiceDetails returns the details for the given service GetServiceDetails(ctx datastore.Context, serviceID string) (*ServiceDetails, error) // GetChildServiceDetails returns the details for the child service of the given parent GetServiceDetailsByParentID(ctx datastore.Context, parentID string, since time.Duration) ([]ServiceDetails, error) // GetAllServiceHealth returns all service health GetAllServiceHealth(ctx datastore.Context) ([]ServiceHealth, error) // GetServiceHealth returns a service health by service id GetServiceHealth(ctx datastore.Context, serviceID string) (*ServiceHealth, error) // GetAllPublicEndpoints returns all public endpoints in the system GetAllPublicEndpoints(ctx datastore.Context) ([]PublicEndpoint, error) // GetAllExportedEndpoints returns all the exported endpoints in the system GetAllExportedEndpoints(ctx datastore.Context) ([]ExportedEndpoint, error) // GetAllIPAssignments returns all IP assignments in the system, including those that may not have address assignments GetAllIPAssignments(ctx datastore.Context) ([]BaseIPAssignment, error) // GetServiceDetailsByIDOrName returns the service details for any services // whose serviceID matches the query exactly or whose names contain the // query as a substring or string suffix GetServiceDetailsByIDOrName(ctx datastore.Context, query string, noprefix bool) ([]ServiceDetails, error) Query(ctx datastore.Context, query Query) ([]ServiceDetails, error) }
Store type for interacting with Service persistent storage
type StrategyInstance ¶
type StrategyInstance struct { HostID string ServiceID string CPUCommitment int RAMCommitment uint64 RAMThreshold uint HostPolicy servicedefinition.HostPolicy }
StrategyInstance collects service strategy information about a service instance.