Documentation
¶
Index ¶
- Variables
- func UpdateDeployTemplateStatus(deploymentID string, status string)
- type Facade
- func (f *Facade) AddHost(ctx datastore.Context, entity *host.Host) error
- func (f *Facade) AddResourcePool(ctx datastore.Context, entity *pool.ResourcePool) error
- func (f *Facade) AddService(ctx datastore.Context, svc service.Service) error
- func (f *Facade) AddServiceTemplate(ctx datastore.Context, serviceTemplate servicetemplate.ServiceTemplate) (string, error)
- func (f *Facade) AddVirtualIP(ctx datastore.Context, vip pool.VirtualIP) error
- func (f *Facade) AssignIPs(ctx datastore.Context, request dao.AssignmentRequest) error
- func (f *Facade) CreateDefaultPool(ctx datastore.Context, id string) error
- func (f *Facade) DeployService(ctx datastore.Context, poolID, parentID string, overwrite bool, ...) (string, error)
- func (f *Facade) DeployTemplate(ctx datastore.Context, poolID string, templateID string, deploymentID string) ([]string, error)
- func (f *Facade) DeployTemplateActive(active *[]map[string]string) error
- func (f *Facade) DeployTemplateStatus(deploymentID string, status *string) error
- func (f *Facade) FindAssignmentByHostPort(ctx datastore.Context, ipAddr string, port uint16) (*addressassignment.AddressAssignment, error)
- func (f *Facade) FindAssignmentByServiceEndpoint(ctx datastore.Context, serviceID, endpointName string) (*addressassignment.AddressAssignment, error)
- func (f *Facade) FindChildService(ctx datastore.Context, parentServiceID string, childName string) (*service.Service, error)
- func (f *Facade) FindHostsInPool(ctx datastore.Context, poolID string) ([]host.Host, error)
- func (f *Facade) GetActiveHostIDs(ctx datastore.Context) ([]string, error)
- func (f *Facade) GetHealthChecksForService(ctx datastore.Context, serviceID string) (map[string]domain.HealthCheck, error)
- func (f *Facade) GetHost(ctx datastore.Context, hostID string) (*host.Host, error)
- func (f *Facade) GetHostByIP(ctx datastore.Context, hostIP string) (*host.Host, error)
- func (f *Facade) GetHosts(ctx datastore.Context) ([]host.Host, error)
- func (f *Facade) GetPoolForService(ctx datastore.Context, id string) (string, error)
- func (f *Facade) GetPoolIPs(ctx datastore.Context, poolID string) (*PoolIPs, error)
- func (f *Facade) GetResourcePool(ctx datastore.Context, id string) (*pool.ResourcePool, error)
- func (f *Facade) GetResourcePools(ctx datastore.Context) ([]pool.ResourcePool, error)
- func (f *Facade) GetResourcePoolsByRealm(ctx datastore.Context, realm string) ([]pool.ResourcePool, error)
- func (f *Facade) GetService(ctx datastore.Context, id string) (*service.Service, error)
- func (f *Facade) GetServiceAddressAssignments(ctx datastore.Context, serviceID string, ...) error
- func (f *Facade) GetServiceAddressAssignmentsByPort(ctx datastore.Context, port uint16) ([]addressassignment.AddressAssignment, error)
- func (f *Facade) GetServiceEndpoints(ctx datastore.Context, serviceId string) (map[string][]dao.ApplicationEndpoint, error)
- func (f *Facade) GetServiceStates(ctx datastore.Context, serviceID string) ([]servicestate.ServiceState, error)
- func (f *Facade) GetServiceTemplates(ctx datastore.Context) (map[string]servicetemplate.ServiceTemplate, error)
- func (f *Facade) GetServices(ctx datastore.Context, request dao.EntityRequest) ([]service.Service, error)
- func (f *Facade) GetServicesByPool(ctx datastore.Context, poolID string) ([]service.Service, error)
- func (f *Facade) GetTaggedServices(ctx datastore.Context, request dao.EntityRequest) ([]service.Service, error)
- func (f *Facade) GetTenantID(ctx datastore.Context, serviceID string) (string, error)
- func (f *Facade) HasIP(ctx datastore.Context, poolID string, ipAddr string) (bool, error)
- func (f *Facade) PauseService(ctx datastore.Context, request dao.ScheduleServiceRequest) (int, error)
- func (f *Facade) RemoveAddressAssignment(ctx datastore.Context, id string) error
- func (f *Facade) RemoveHost(ctx datastore.Context, hostID string) (err error)
- func (f *Facade) RemoveResourcePool(ctx datastore.Context, id string) error
- func (f *Facade) RemoveService(ctx datastore.Context, id string) error
- func (f *Facade) RemoveServiceTemplate(ctx datastore.Context, id string) error
- func (f *Facade) RemoveVirtualIP(ctx datastore.Context, vip pool.VirtualIP) error
- func (f *Facade) RestartService(ctx datastore.Context, request dao.ScheduleServiceRequest) (int, error)
- func (f *Facade) RestoreIPs(ctx datastore.Context, svc service.Service) error
- func (f *Facade) ScheduleService(ctx datastore.Context, serviceID string, autoLaunch bool, ...) (int, error)
- func (f *Facade) ServiceUse(ctx datastore.Context, serviceID string, imageName string, registry string, ...) (string, error)
- func (f *Facade) StartService(ctx datastore.Context, request dao.ScheduleServiceRequest) (int, error)
- func (f *Facade) StopService(ctx datastore.Context, request dao.ScheduleServiceRequest) (int, error)
- func (f *Facade) UpdateHost(ctx datastore.Context, entity *host.Host) error
- func (f *Facade) UpdateResourcePool(ctx datastore.Context, entity *pool.ResourcePool) error
- func (f *Facade) UpdateService(ctx datastore.Context, svc service.Service) error
- func (f *Facade) UpdateServiceTemplate(ctx datastore.Context, template servicetemplate.ServiceTemplate) error
- func (f *Facade) WaitService(ctx datastore.Context, dstate service.DesiredState, timeout time.Duration, ...) error
- type FacadeInterface
- type FacadeTest
- type PoolIPs
- type Ports
Constants ¶
This section is empty.
Variables ¶
var ( ErrPoolExists = errors.New("facade: resource pool exists") ErrPoolNotExists = errors.New("facade: resource pool does not exist") ErrIPExists = errors.New("facade: ip exists in resource pool") ErrIPNotExists = errors.New("facade: ip does not exist in resource pool") )
var LogstashContainerReloader reloadLogstashContainer = reloadLogstashContainerImpl
Functions ¶
func UpdateDeployTemplateStatus ¶
UpdateDeployTemplateStatus updates the deployment status of the service being deployed
Types ¶
type Facade ¶
type Facade struct {
// contains filtered or unexported fields
}
Facade is an entrypoint to available controlplane methods
func (*Facade) AddHost ¶
AddHost register a host with serviced. Returns an error if host already exists or if the host's IP is a virtual IP
func (*Facade) AddResourcePool ¶
AddResourcePool adds a new resource pool
func (*Facade) AddService ¶
AddService adds a service; return error if service already exists
func (*Facade) AddServiceTemplate ¶
func (f *Facade) AddServiceTemplate(ctx datastore.Context, serviceTemplate servicetemplate.ServiceTemplate) (string, error)
AddServiceTemplate adds a service template to the system. Returns the id of the template added
func (*Facade) AddVirtualIP ¶
AddVirtualIP adds a virtualIP to a pool
func (*Facade) CreateDefaultPool ¶
CreateDefaultPool creates the default pool if it does not exists, it is idempotent
func (*Facade) DeployService ¶
func (f *Facade) DeployService(ctx datastore.Context, poolID, parentID string, overwrite bool, svcDef servicedefinition.ServiceDefinition) (string, error)
DeployService converts a service definition to a service and deploys it under a specific service. If the overwrite option is enabled, existing services with the same name will be overwritten, otherwise services may only be added.
func (*Facade) DeployTemplate ¶
func (f *Facade) DeployTemplate(ctx datastore.Context, poolID string, templateID string, deploymentID string) ([]string, error)
DeployTemplate creates and deployes a service to the pool and returns the tenant id of the newly deployed service
func (*Facade) DeployTemplateActive ¶
gather a list of all active DeploymentIDs
func (*Facade) DeployTemplateStatus ¶
DeployTemplateStatus sets the status of a deployed service or template
func (*Facade) FindAssignmentByHostPort ¶
func (f *Facade) FindAssignmentByHostPort(ctx datastore.Context, ipAddr string, port uint16) (*addressassignment.AddressAssignment, error)
func (*Facade) FindAssignmentByServiceEndpoint ¶
func (f *Facade) FindAssignmentByServiceEndpoint(ctx datastore.Context, serviceID, endpointName string) (*addressassignment.AddressAssignment, error)
GetAddressAssignmentsByEndpoint returns the address assignment by serviceID and endpoint name
func (*Facade) FindChildService ¶
func (f *Facade) FindChildService(ctx datastore.Context, parentServiceID string, childName string) (*service.Service, error)
FindChildService walks services below the service specified by serviceId, checking to see if childName matches the service's name. If so, it returns it.
func (*Facade) FindHostsInPool ¶
FindHostsInPool returns a list of all hosts with poolID
func (*Facade) GetActiveHostIDs ¶
func (*Facade) GetHealthChecksForService ¶
func (*Facade) GetHostByIP ¶
func (*Facade) GetPoolForService ¶
func (*Facade) GetPoolIPs ¶
GetPoolIPs gets all IPs available to a Pool
func (*Facade) GetResourcePool ¶
GetResourcePool returns an ResourcePool ip id. nil if not found
func (*Facade) GetResourcePools ¶
GetResourcePools Returns a list of all ResourcePools
func (*Facade) GetResourcePoolsByRealm ¶
func (f *Facade) GetResourcePoolsByRealm(ctx datastore.Context, realm string) ([]pool.ResourcePool, error)
GetResourcePoolsByRealm Returns a list of all ResourcePools by Realm
func (*Facade) GetService ¶
func (*Facade) GetServiceAddressAssignments ¶
func (f *Facade) GetServiceAddressAssignments(ctx datastore.Context, serviceID string, assignments *[]addressassignment.AddressAssignment) error
GetServiceAddressAssignments fills in all AddressAssignments for the specified serviced id.
func (*Facade) GetServiceAddressAssignmentsByPort ¶
func (f *Facade) GetServiceAddressAssignmentsByPort(ctx datastore.Context, port uint16) ([]addressassignment.AddressAssignment, error)
func (*Facade) GetServiceEndpoints ¶
func (f *Facade) GetServiceEndpoints(ctx datastore.Context, serviceId string) (map[string][]dao.ApplicationEndpoint, error)
Get a service endpoint.
func (*Facade) GetServiceStates ¶
func (f *Facade) GetServiceStates(ctx datastore.Context, serviceID string) ([]servicestate.ServiceState, error)
GetServiceStates returns all the service states given a service ID
func (*Facade) GetServiceTemplates ¶
func (f *Facade) GetServiceTemplates(ctx datastore.Context) (map[string]servicetemplate.ServiceTemplate, error)
func (*Facade) GetServices ¶
func (*Facade) GetServicesByPool ¶
GetServicesByPool looks up all services in a particular pool
func (*Facade) GetTaggedServices ¶
func (*Facade) GetTenantID ¶
The tenant id is the root service uuid. Walk the service tree to root to find the tenant id.
func (*Facade) PauseService ¶
func (*Facade) RemoveAddressAssignment ¶
RemoveAddressAssignemnt Removes an AddressAssignment by id
func (*Facade) RemoveHost ¶
RemoveHost removes a Host from serviced
func (*Facade) RemoveResourcePool ¶
RemoveResourcePool removes a ResourcePool
func (*Facade) RemoveService ¶
func (*Facade) RemoveServiceTemplate ¶
RemoveServiceTemplate removes the service template from the system
func (*Facade) RemoveVirtualIP ¶
RemoveVirtualIP removes a virtual ip from a pool
func (*Facade) RestartService ¶
func (*Facade) RestoreIPs ¶
func (*Facade) ScheduleService ¶
func (f *Facade) ScheduleService(ctx datastore.Context, serviceID string, autoLaunch bool, desiredState service.DesiredState) (int, error)
ScheduleService changes a service's desired state and returns the number of affected services
func (*Facade) ServiceUse ¶
func (*Facade) StartService ¶
func (*Facade) StopService ¶
func (*Facade) UpdateHost ¶
UpdateHost information for a registered host
func (*Facade) UpdateResourcePool ¶
UpdateResourcePool updates an existing resource pool
func (*Facade) UpdateService ¶
func (*Facade) UpdateServiceTemplate ¶
func (f *Facade) UpdateServiceTemplate(ctx datastore.Context, template servicetemplate.ServiceTemplate) error
UpdateServiceTemplate updates a service template
type FacadeInterface ¶
type FacadeInterface interface { AddService(ctx datastore.Context, svc service.Service) error GetService(ctx datastore.Context, id string) (*service.Service, error) GetServices(ctx datastore.Context, request dao.EntityRequest) ([]service.Service, error) GetServiceStates(ctx datastore.Context, serviceID string) ([]servicestate.ServiceState, error) GetTenantID(ctx datastore.Context, serviceID string) (string, error) RemoveService(ctx datastore.Context, id string) error RestoreIPs(ctx datastore.Context, svc service.Service) error ScheduleService(ctx datastore.Context, serviceID string, autoLaunch bool, desiredState service.DesiredState) (int, error) UpdateService(ctx datastore.Context, svc service.Service) error WaitService(ctx datastore.Context, dstate service.DesiredState, timeout time.Duration, serviceIDs ...string) error GetServiceTemplates(ctx datastore.Context) (map[string]servicetemplate.ServiceTemplate, error) UpdateServiceTemplate(ctx datastore.Context, template servicetemplate.ServiceTemplate) error AddHost(ctx datastore.Context, entity *host.Host) error GetHosts(ctx datastore.Context) ([]host.Host, error) AddResourcePool(ctx datastore.Context, entity *pool.ResourcePool) error GetResourcePools(ctx datastore.Context) ([]pool.ResourcePool, error) HasIP(ctx datastore.Context, poolID string, ipAddr string) (bool, error) UpdateResourcePool(ctx datastore.Context, entity *pool.ResourcePool) error }
The FacadeInterface is the API for a Facade
type FacadeTest ¶
type FacadeTest struct { elastic.ElasticTest CTX datastore.Context Facade *Facade }
FacadeTest used for running tests where a facade type is needed.
func (*FacadeTest) SetUpSuite ¶
func (ft *FacadeTest) SetUpSuite(c *gocheck.C)
SetUpSuite sets up test suite