Documentation ¶
Index ¶
- Constants
- func ConvertRequiredServicesToExchange(m *persistence.MicroserviceDefinition) *[]exchange.ServiceDependency
- func ConvertServiceToPersistent(es *exchange.ServiceDefinition, org string) (*persistence.MicroserviceDefinition, error)
- func CreateMicroserviceDef(db *bolt.DB, service_name string, service_org string, service_version string, ...) (*persistence.MicroserviceDefinition, error)
- func DecodeReasonCode(code uint64) string
- func FindOrCreateMicroserviceDef(db *bolt.DB, service_name string, service_org string, service_version string, ...) (*persistence.MicroserviceDefinition, error)
- func GenMicroservicePolicy(msdef *persistence.MicroserviceDefinition, policyPath string, db *bolt.DB, ...) error
- func GetRollbackMicroserviceDef(getService exchange.ServiceResolverHandler, ...) (*persistence.MicroserviceDefinition, error)
- func GetUpgradeMicroserviceDef(getService exchange.ServiceResolverHandler, ...) (*persistence.MicroserviceDefinition, error)
- func MicroserviceReadyForUpgrade(msdef *persistence.MicroserviceDefinition, db *bolt.DB) bool
- func RemoveMicroservicePolicy(spec_ref string, org string, version string, msdef_id string, ...) error
- func UnregisterMicroserviceExchange(getExchangeDevice exchange.DeviceHandler, ...) error
Constants ¶
const MS_CLEAR_OLD_AGS_FAILED = 201
const MS_DEFAULT_ACTIVEUPGRADE = false
const MS_DEFAULT_AUTOUPGRADE = true
microservice defaults
const MS_DELETED_BY_DOWNGRADE_PROCESS = 208
const MS_DELETED_BY_UPGRADE_PROCESS = 205
const MS_DELETED_FOR_AG_ENDED = 206
const MS_EXEC_FAILED = 202
const MS_IMAGE_FETCH_FAILED = 207
const MS_IMAGE_LOAD_FAILED = 204
const MS_REREG_EXCH_FAILED = 203
const MS_UNREG_EXCH_FAILED = 200
microservice instance terminated reason code
Variables ¶
This section is empty.
Functions ¶
func ConvertRequiredServicesToExchange ¶
func ConvertRequiredServicesToExchange(m *persistence.MicroserviceDefinition) *[]exchange.ServiceDependency
func ConvertServiceToPersistent ¶
func ConvertServiceToPersistent(es *exchange.ServiceDefinition, org string) (*persistence.MicroserviceDefinition, error)
This function converts the structure from exchange service to persistence.
func CreateMicroserviceDef ¶
func CreateMicroserviceDef(db *bolt.DB, service_name string, service_org string, service_version string, service_arch string, getService exchange.ServiceHandler) (*persistence.MicroserviceDefinition, error)
Create and save the MicroserviceDefiniton for given service. The service_version is a version range. Please make sure there is no MicroserviceDefinition for this service before calling this function.
func DecodeReasonCode ¶
func FindOrCreateMicroserviceDef ¶
func FindOrCreateMicroserviceDef(db *bolt.DB, service_name string, service_org string, service_version string, service_arch string, getService exchange.ServiceHandler) (*persistence.MicroserviceDefinition, error)
Find the MicroserviceDefinition object in the local db for the given service spec. The version is a version range. If not found, create one with hightest version within the range. TODO: we need to get the common version range if the msdef for this service exists.
func GenMicroservicePolicy ¶
func GenMicroservicePolicy(msdef *persistence.MicroserviceDefinition, policyPath string, db *bolt.DB, e chan events.Message, deviceOrg string, pattern string) error
Generate a new policy file for given ms and then register the microservice in the exchange.
func GetRollbackMicroserviceDef ¶
func GetRollbackMicroserviceDef(getService exchange.ServiceResolverHandler, msdef *persistence.MicroserviceDefinition, db *bolt.DB) (*persistence.MicroserviceDefinition, error)
Get a msdef with a lower version compared to the given msdef version and return the new microservice def.
func GetUpgradeMicroserviceDef ¶
func GetUpgradeMicroserviceDef(getService exchange.ServiceResolverHandler, msdef *persistence.MicroserviceDefinition, db *bolt.DB) (*persistence.MicroserviceDefinition, error)
Get the new microservice def that the given msdef need to upgrade to. This function gets the msdef with highest version within defined version range from the exchange and compare the version and content with the current msdef and decide if it needs to upgrade. It returns the new msdef if the old one needs to be upgraded, otherwide return nil.
func MicroserviceReadyForUpgrade ¶
func MicroserviceReadyForUpgrade(msdef *persistence.MicroserviceDefinition, db *bolt.DB) bool
check if the given msdef is eligible for a upgrade
func RemoveMicroservicePolicy ¶
func RemoveMicroservicePolicy(spec_ref string, org string, version string, msdef_id string, policy_path string, pm *policy.PolicyManager) error
Remove the policy for the given microservice and rename the policy file name.
func UnregisterMicroserviceExchange ¶
func UnregisterMicroserviceExchange(getExchangeDevice exchange.DeviceHandler, patchExchangeDevice exchange.PatchDeviceHandler, spec_ref string, org string, device_id string, device_token string, db *bolt.DB) error
Unregisters the given microservice from the exchange
Types ¶
This section is empty.