microservice

package
v0.0.0-...-4862416 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2018 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const MS_CLEAR_OLD_AGS_FAILED = 201
View Source
const MS_DEFAULT_ACTIVEUPGRADE = false
View Source
const MS_DEFAULT_AUTOUPGRADE = true

microservice defaults

View Source
const MS_DELETED_BY_DOWNGRADE_PROCESS = 208
View Source
const MS_DELETED_BY_UPGRADE_PROCESS = 205
View Source
const MS_DELETED_FOR_AG_ENDED = 206
View Source
const MS_EXEC_FAILED = 202
View Source
const MS_IMAGE_FETCH_FAILED = 207
View Source
const MS_IMAGE_LOAD_FAILED = 204
View Source
const MS_REREG_EXCH_FAILED = 203
View Source
const MS_UNREG_EXCH_FAILED = 200

microservice instance terminated reason code

Variables

This section is empty.

Functions

func ConvertServiceToPersistent

func ConvertServiceToPersistent(es *exchange.ServiceDefinition, org string) (*persistence.MicroserviceDefinition, error)

This function converts the structure from exchange service to persistence.

func DecodeReasonCode

func DecodeReasonCode(code uint64) string

func GenMicroservicePolicy

func GenMicroservicePolicy(msdef *persistence.MicroserviceDefinition, policyPath string, db *bolt.DB, e chan events.Message, deviceOrg string) error

Generate a new policy file for given ms and the register the microservice on the exchange.

func GetRollbackMicroserviceDef

Get a msdef with a lower version compared to the given msdef version and return the new microservice def.

func GetUpgradeMicroserviceDef

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,
	putExchangeDevice exchange.PutDeviceHandler,
	spec_ref string,
	device_id string, device_token string, db *bolt.DB) error

Unregisters the given microservice from the exchange

Types

This section is empty.

Jump to

Keyboard shortcuts

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