Documentation
¶
Index ¶
- Constants
- func ConvertAgreementProtocol(p *Pattern, pol *policy.Policy)
- func ConvertChoice(wl WorkloadChoice, url string, org string, arch string, pol *policy.Policy)
- func ConvertCommon(p *Pattern, patternId string, dv DataVerification, nodeh NodeHealth, ...)
- func ConvertDataVerify(dv DataVerification, pol *policy.Policy)
- func ConvertNodeHealth(nodeh NodeHealth, pol *policy.Policy)
- func ConvertToPolicies(patternId string, p *Pattern) ([]*policy.Policy, error)
- func ConvertToString(a []string) string
- func DeconstructExchangeMessage(encryptedMessage []byte, receiverPrivateKey *rsa.PrivateKey) ([]byte, *rsa.PublicKey, error)
- func DeleteKeys(keyPath string) error
- func DeleteNodePolicy(ec ExchangeContext, deviceId string) error
- func DeleteServicePolicy(ec ExchangeContext, url string, org string, version string, arch string) error
- func DeleteServicePolicyWithId(ec ExchangeContext, service_id string) error
- func DemarshalPublicKey(serializedKey []byte) (*rsa.PublicKey, error)
- func GetBusinessPolicies(ec ExchangeContext, org string, policy_id string) (map[string]ExchangeBusinessPolicy, error)
- func GetExchangeVersion(httpClientFactory *config.HTTPClientFactory, exchangeUrl string, id string, ...) (string, error)
- func GetId(id string) string
- func GetKeys(keyPath string) (*rsa.PublicKey, *rsa.PrivateKey, error)
- func GetObject(ec ExchangeContext, org string, objID string, objType string) (*common.MetaData, error)
- func GetObjectSigningKeys(ec ExchangeContext, oType string, oURL string, oOrg string, oVersion string, ...) (map[string]string, error)
- func GetOrg(id string) string
- func GetPatterns(httpClientFactory *config.HTTPClientFactory, org string, pattern string, ...) (map[string]Pattern, error)
- func HasKeys() bool
- func Heartbeat(h *http.Client, url string, id string, token string) error
- func InvokeExchange(httpClient *http.Client, method string, url string, user string, pw string, ...) (error, error)
- func IsTransportError(pResp *http.Response, err error) bool
- func MarshalPublicKey(key *rsa.PublicKey) ([]byte, error)
- func PatchExchangeDevice(httpClientFactory *config.HTTPClientFactory, deviceId string, ...) error
- func PostDeviceServicesConfigState(httpClientFactory *config.HTTPClientFactory, deviceId string, ...) error
- func SameConfigState(state1 string, state2 string) bool
- func ServiceSuspended(registered_services []Microservice, service_url string, service_org string) (bool, bool)
- func SetPolicyReceived(ec ExchangeContext, objPol *ObjectDestinationPolicy) error
- func UpdateObjectDestinationList(ec ExchangeContext, org string, objPol *ObjectDestinationPolicy, ...) error
- type Agbot
- type AgbotAgreement
- type AgbotMessage
- type AgreementCommand
- type AgreementObject
- type AgreementProtocol
- type AllAgbotAgreementsResponse
- type AllDeviceAgreementsResponse
- type Blockchain
- type BlockchainList
- type BusinessPoliciesHandler
- type DataVerification
- type DeleteNodePolicyHandler
- type DeleteServicePolicyHandler
- type DeleteServicePolicyWithIdHandler
- type DestinationPolicy
- type Device
- type DeviceAgreement
- type DeviceHandler
- type DeviceMessage
- type EncryptedSymmetricValues
- type EncryptedWrappedMessage
- type ExchangeBusinessPolicy
- type ExchangeContext
- type ExchangeMessage
- type ExchangeMessageTarget
- type ExchangeMessageWorker
- func (w *ExchangeMessageWorker) CommandHandler(command worker.Command) bool
- func (w *ExchangeMessageWorker) Initialize() bool
- func (w *ExchangeMessageWorker) Messages() chan events.Message
- func (w *ExchangeMessageWorker) NewEvent(incoming events.Message)
- func (w *ExchangeMessageWorker) NoWorkHandler()
- type ExchangePolicy
- func GetNodePolicy(ec ExchangeContext, deviceId string) (*ExchangePolicy, error)
- func GetServicePolicy(ec ExchangeContext, url string, org string, version string, arch string) (*ExchangePolicy, string, error)
- func GetServicePolicyWithId(ec ExchangeContext, service_id string) (*ExchangePolicy, error)
- type ExchangeSurfaceError
- type ExchangeVersionHandler
- type GetAgbotMessageResponse
- type GetAgbotsBusinessPolsResponse
- type GetAgbotsPatternsResponse
- type GetAgbotsResponse
- type GetBusinessPolicyResponse
- type GetDeviceMessageResponse
- type GetDevicesResponse
- type GetOrganizationResponse
- type GetPatternResponse
- type GetServicesResponse
- type HardwareRequirement
- type ImageDockerAuth
- type MSAgreementState
- type MSProp
- type Meter
- type Microservice
- type NodeHealth
- type NodeHealthStatus
- type NodeHealthStatusRequest
- type NodeInfo
- type NodePolicyHandler
- type ObjectDestinationPolicies
- type ObjectDestinationPolicy
- type ObjectDestinationQueryHandler
- type ObjectDestinationStatuses
- type ObjectPolicyQueryHandler
- type ObjectPolicyUpdateReceivedHandler
- type ObjectPolicyUpdatesQueryHandler
- type ObjectQueryHandler
- type ObjectSigningKeysHandler
- type OrgHandler
- type OrgHandlerWithContext
- type Organization
- type PatchAgbotPublicKey
- type PatchDeviceHandler
- type PatchDeviceRequest
- type Pattern
- type PatternHandler
- type PatternHandlerWithContext
- type PostDeviceResponse
- type PostDeviceServicesConfigStateHandler
- type PostMessage
- type PutAgbotAgreementState
- type PutAgreementState
- type PutDestinationListRequest
- type PutDeviceHandler
- type PutDeviceRequest
- type PutDeviceResponse
- func PutExchangeDevice(httpClientFactory *config.HTTPClientFactory, deviceId string, ...) (*PutDeviceResponse, error)
- func PutNodePolicy(ec ExchangeContext, deviceId string, ep *ExchangePolicy) (*PutDeviceResponse, error)
- func PutServicePolicy(ec ExchangeContext, url string, org string, version string, arch string, ...) (*PutDeviceResponse, error)
- func PutServicePolicyWithId(ec ExchangeContext, service_id string, ep *ExchangePolicy) (*PutDeviceResponse, error)
- func PutSurfaceErrors(ec ExchangeContext, deviceId string, errorList *ExchangeSurfaceError) (*PutDeviceResponse, error)
- type PutNodePolicyHandler
- type PutServicePolicyHandler
- type PutServicePolicyWithIdHandler
- type PutSurfaceErrorsHandler
- type ResetIntervalCommand
- type SearchExchBusinessPolRequest
- type SearchExchBusinessPolResponse
- type SearchExchangeMSRequest
- type SearchExchangeMSResponse
- type SearchExchangePatternRequest
- type SearchExchangePatternResponse
- type SearchResultDevice
- type ServedBusinessPolicy
- type ServedPattern
- type ServiceConfigState
- type ServiceDefinition
- func GetHighestVersion(msMetadata map[string]ServiceDefinition, ...) (string, ServiceDefinition, string, error)
- func GetService(ec ExchangeContext, mURL string, mOrg string, mVersion string, mArch string) (*ServiceDefinition, string, error)
- func ServiceResolver(wURL string, wOrg string, wVersion string, wArch string, ...) (*policy.APISpecList, *ServiceDefinition, []string, error)
- func (s *ServiceDefinition) GetDeployment() string
- func (s *ServiceDefinition) GetDeploymentSignature() string
- func (s *ServiceDefinition) GetServiceDependencies() *[]ServiceDependency
- func (s *ServiceDefinition) GetUserInputName(name string) *UserInput
- func (s *ServiceDefinition) GetVersion() string
- func (s *ServiceDefinition) HasDependencies() bool
- func (s *ServiceDefinition) NeedsUserInput() bool
- func (s *ServiceDefinition) PopulateDefaultUserInput(envAdds map[string]string)
- func (s ServiceDefinition) ShortString() string
- func (s ServiceDefinition) String() string
- type ServiceDependency
- type ServiceDockerAuthsHandler
- type ServiceDockerAuthsWithIdHandler
- type ServiceHandler
- type ServicePolicyHandler
- type ServicePolicyWithIdHandler
- type ServiceReference
- type ServiceResolverHandler
- type ServicesConfigStateHandler
- type SoftwareVersion
- type SurfaceErrorsHandler
- type SymmetricValues
- type UpdateObjectDestinationHandler
- type UpgradePolicy
- type UserInput
- type WorkloadAgreement
- type WorkloadChoice
- type WorkloadPriority
- type WrappedMessage
Constants ¶
const MS_SHARING_MODE_EXCLUSIVE = "exclusive"
This is the structure of the object returned on a GET /service. microservice sharing mode
const MS_SHARING_MODE_MULTIPLE = "multiple"
const MS_SHARING_MODE_SINGLE = "single" // deprecated, use singleton instead. but leave it here for backward compatibility
const MS_SHARING_MODE_SINGLETON = "singleton"
const PATTERN = "pattern"
const SERVICE = "service"
const SERVICE_CONFIGSTATE_ACTIVE = "active"
const SERVICE_CONFIGSTATE_SUSPENDED = "suspended"
service configuration states
Variables ¶
This section is empty.
Functions ¶
func ConvertAgreementProtocol ¶
Copy Agreement protocol metadata into the policy
func ConvertChoice ¶
func ConvertCommon ¶
func ConvertCommon(p *Pattern, patternId string, dv DataVerification, nodeh NodeHealth, pol *policy.Policy)
Common conversion function calls
func ConvertDataVerify ¶
func ConvertDataVerify(dv DataVerification, pol *policy.Policy)
func ConvertNodeHealth ¶
func ConvertNodeHealth(nodeh NodeHealth, pol *policy.Policy)
func ConvertToPolicies ¶
Convert a pattern to a list of policy objects. Each pattern contains 1 or more workloads or services, which will each be translated to a policy.
func ConvertToString ¶
func DeleteKeys ¶
func DeleteNodePolicy ¶
func DeleteNodePolicy(ec ExchangeContext, deviceId string) error
Delete node policy from the exchange. Return nil if the policy is deleted or does not exist.
func DeleteServicePolicy ¶
func DeleteServicePolicy(ec ExchangeContext, url string, org string, version string, arch string) error
This function deletes the service policy for a service. it returns nil if the policy is deleted or does not exist.
func DeleteServicePolicyWithId ¶
func DeleteServicePolicyWithId(ec ExchangeContext, service_id string) error
Delete service policy from the exchange. It returns nil if the policy is deleted or does not exist.
func DemarshalPublicKey ¶
Helper function that uses the PKI X.509 library to deserialize an RSA key.
func GetBusinessPolicies ¶
func GetBusinessPolicies(ec ExchangeContext, org string, policy_id string) (map[string]ExchangeBusinessPolicy, error)
Get all the business policy metadata for a specific organization, and policy if specified.
func GetExchangeVersion ¶
func GetObject ¶
func GetObject(ec ExchangeContext, org string, objID string, objType string) (*common.MetaData, error)
Get the object's metadata.
func GetObjectSigningKeys ¶
func GetObjectSigningKeys(ec ExchangeContext, oType string, oURL string, oOrg string, oVersion string, oArch string) (map[string]string, error)
This function gets the pattern/service signing key names and their contents. The oType is one of PATTERN, or SERVICE defined in the beginning of this file. When oType is PATTERN, the oURL is the pattern name and oVersion and oArch are ignored.
func GetOrg ¶
Helper functions for dealing with exchangeIds that are already prefixed with the org name and then "/".
func GetPatterns ¶
func GetPatterns(httpClientFactory *config.HTTPClientFactory, org string, pattern string, exURL string, id string, token string) (map[string]Pattern, error)
Get all the pattern metadata for a specific organization, and pattern if specified.
func InvokeExchange ¶
func InvokeExchange(httpClient *http.Client, method string, url string, user string, pw string, params interface{}, resp *interface{}) (error, error)
This function is used to invoke an exchange API For GET, the given resp parameter will be untouched when http returns code 404.
func MarshalPublicKey ¶
Helper function that uses the PKI X.509 library to serialize an RSA key.
func PatchExchangeDevice ¶
func PatchExchangeDevice(httpClientFactory *config.HTTPClientFactory, deviceId string, deviceToken string, exchangeUrl string, pdr *PatchDeviceRequest) error
patch the the device
func PostDeviceServicesConfigState ¶
func PostDeviceServicesConfigState(httpClientFactory *config.HTTPClientFactory, deviceId string, deviceToken string, exchangeUrl string, svcs_configstate *ServiceConfigState) error
modify the the configuration state for the registeredServices for a device.
func SameConfigState ¶
check if the 2 given config states are the same.
func ServiceSuspended ¶
func ServiceSuspended(registered_services []Microservice, service_url string, service_org string) (bool, bool)
check the registered services to see if the given service is suspended or not returns (found, suspended)
func SetPolicyReceived ¶
func SetPolicyReceived(ec ExchangeContext, objPol *ObjectDestinationPolicy) error
Tell the MMS that a policy update has been received.
func UpdateObjectDestinationList ¶
func UpdateObjectDestinationList(ec ExchangeContext, org string, objPol *ObjectDestinationPolicy, dests *PutDestinationListRequest) error
Update the destination list of the object when that object's policy enables it to be placed on the node.
Types ¶
type Agbot ¶
type Agbot struct { Token string `json:"token"` Name string `json:"name"` Owner string `json:"owner"` MsgEndPoint string `json:"msgEndPoint"` LastHeartbeat string `json:"lastHeartbeat"` PublicKey []byte `json:"publicKey"` }
func (Agbot) ShortString ¶
type AgbotAgreement ¶
type AgbotAgreement struct { Service WorkloadAgreement `json:"service,omitempty"` State string `json:"state"` LastUpdated string `json:"lastUpdated"` }
func (AgbotAgreement) String ¶
func (a AgbotAgreement) String() string
type AgbotMessage ¶
type AgbotMessage struct { MsgId int `json:"msgId"` DeviceId string `json:"nodeId"` DevicePubKey []byte `json:"nodePubKey"` Message []byte `json:"message"` TimeSent string `json:"timeSent"` TimeExpires string `json:"timeExpires"` }
func (AgbotMessage) String ¶
func (a AgbotMessage) String() string
type AgreementCommand ¶
type AgreementCommand struct { }
func NewAgreementCommand ¶
func NewAgreementCommand() *AgreementCommand
func (AgreementCommand) ShortString ¶
func (c AgreementCommand) ShortString() string
type AgreementObject ¶
type AgreementObject struct { }
type AgreementProtocol ¶
type AgreementProtocol struct { Name string `json:"name,omitempty"` // The name of the agreement protocol to be used ProtocolVersion int `json:"protocolVersion,omitempty"` // The max protocol version supported Blockchains BlockchainList `json:"blockchains,omitempty"` // The blockchain to be used if the protocol requires one. }
type AllAgbotAgreementsResponse ¶
type AllAgbotAgreementsResponse struct { Agreements map[string]AgbotAgreement `json:"agreements"` LastIndex int `json:"lastIndex"` }
func (AllAgbotAgreementsResponse) String ¶
func (a AllAgbotAgreementsResponse) String() string
type AllDeviceAgreementsResponse ¶
type AllDeviceAgreementsResponse struct { Agreements map[string]DeviceAgreement `json:"agreements"` LastIndex int `json:"lastIndex"` }
func (AllDeviceAgreementsResponse) String ¶
func (a AllDeviceAgreementsResponse) String() string
type Blockchain ¶
type Blockchain struct { Type string `json:"type,omitempty"` // The type of blockchain Name string `json:"name,omitempty"` // The name of the blockchain instance in the exchange,it is specific to the value of the type Org string `json:"organization,omitempty"` // The organization that owns the blockchain definition }
type BlockchainList ¶
type BlockchainList []Blockchain
type BusinessPoliciesHandler ¶
type BusinessPoliciesHandler func(org string, policy_id string) (map[string]ExchangeBusinessPolicy, error)
A handler for getting the business policies from the exchange.
func GetHTTPBusinessPoliciesHandler ¶
func GetHTTPBusinessPoliciesHandler(ec ExchangeContext) BusinessPoliciesHandler
type DataVerification ¶
type DataVerification struct { Enabled bool `json:"enabled,omitempty"` // Whether or not data verification is enabled URL string `json:"URL,omitempty"` // The URL to be used for data receipt verification URLUser string `json:"user,omitempty"` // The user id to use when calling the verification URL URLPassword string `json:"password,omitempty"` // The password to use when calling the verification URL Interval int `json:"interval,omitempty"` // The number of seconds to check for data before deciding there isnt any data CheckRate int `json:"check_rate,omitempty"` // The number of seconds between checks for valid data being received Metering Meter `json:"metering,omitempty"` // The metering configuration }
type DeleteNodePolicyHandler ¶
A handler for deleting the node policy from the exchange.
func GetHTTPDeleteNodePolicyHandler ¶
func GetHTTPDeleteNodePolicyHandler(ec ExchangeContext) DeleteNodePolicyHandler
type DeleteServicePolicyHandler ¶
func GetHTTPDeleteServicePolicyHandler ¶
func GetHTTPDeleteServicePolicyHandler(ec ExchangeContext) DeleteServicePolicyHandler
type DeleteServicePolicyWithIdHandler ¶
Two handlers for deleting the service policy from the exchange.
func GetHTTPDeleteServicePolicyWithIdHandler ¶
func GetHTTPDeleteServicePolicyWithIdHandler(ec ExchangeContext) DeleteServicePolicyWithIdHandler
type DestinationPolicy ¶
type DestinationPolicy struct { // Properties is the set of properties for a particular policy Properties externalpolicy.PropertyList `json:"properties" bson:"properties"` // Constraints is a set of expressions that form the constraints for the policy Constraints externalpolicy.ConstraintExpression `json:"constraints" bson:"constraints"` // Services is the list of services this object has affinity for Services []common.ServiceID `json:"services" bson:"services"` // Timestamp indicates when the policy was last updated (result of time.Now().UnixNano()) Timestamp int64 `json:"timestamp" bson:"timestamp"` }
func (DestinationPolicy) String ¶
func (d DestinationPolicy) String() string
type Device ¶
type Device struct { Token string `json:"token"` Name string `json:"name"` Owner string `json:"owner"` Pattern string `json:"pattern"` RegisteredServices []Microservice `json:"registeredServices"` MsgEndPoint string `json:"msgEndPoint"` SoftwareVersions SoftwareVersion `json:"softwareVersions"` LastHeartbeat string `json:"lastHeartbeat"` PublicKey []byte `json:"publicKey"` Arch string `json:"arch"` UserInput []policy.UserInput `json:"userInput"` }
Structs and types for interacting with the device (node) object in the exchange
func GetExchangeDevice ¶
func (Device) ShortString ¶
type DeviceAgreement ¶
type DeviceAgreement struct { Service []MSAgreementState `json:"services"` State string `json:"state"` AgreementService WorkloadAgreement `json:"agrService"` LastUpdated string `json:"lastUpdated"` }
func (DeviceAgreement) String ¶
func (a DeviceAgreement) String() string
type DeviceHandler ¶
A handler for getting the device information from the exchange
func GetHTTPDeviceHandler ¶
func GetHTTPDeviceHandler(ec ExchangeContext) DeviceHandler
func GetHTTPDeviceHandler2 ¶
func GetHTTPDeviceHandler2(cfg *config.HorizonConfig) DeviceHandler
this is used when ExchangeContext is not set up yet.
type DeviceMessage ¶
type DeviceMessage struct { MsgId int `json:"msgId"` AgbotId string `json:"agbotId"` AgbotPubKey []byte `json:"agbotPubKey"` Message []byte `json:"message"` TimeSent string `json:"timeSent"` }
func (DeviceMessage) String ¶
func (d DeviceMessage) String() string
type EncryptedSymmetricValues ¶
type EncryptedSymmetricValues []byte
type EncryptedWrappedMessage ¶
type EncryptedWrappedMessage []byte
type ExchangeBusinessPolicy ¶
type ExchangeBusinessPolicy struct { businesspolicy.BusinessPolicy Created string `json:"created,omitempty"` LastUpdated string `json:"lastUpdated,omitempty"` }
the exchange business policy
func (*ExchangeBusinessPolicy) GetBusinessPolicy ¶
func (e *ExchangeBusinessPolicy) GetBusinessPolicy() businesspolicy.BusinessPolicy
func (*ExchangeBusinessPolicy) GetCreated ¶
func (e *ExchangeBusinessPolicy) GetCreated() string
func (*ExchangeBusinessPolicy) GetLastUpdated ¶
func (e *ExchangeBusinessPolicy) GetLastUpdated() string
func (ExchangeBusinessPolicy) ShortString ¶
func (e ExchangeBusinessPolicy) ShortString() string
func (ExchangeBusinessPolicy) String ¶
func (e ExchangeBusinessPolicy) String() string
type ExchangeContext ¶
type ExchangeMessage ¶
type ExchangeMessage struct { WrappedMessage EncryptedWrappedMessage `json:"wrappedMessage"` SymmetricValues EncryptedSymmetricValues `json:"symmetricValues"` }
func ConstructExchangeMessage ¶
func ConstructExchangeMessage(message []byte, senderPublicKey *rsa.PublicKey, senderPrivateKey *rsa.PrivateKey, receiverPublicKey *rsa.PublicKey) (*ExchangeMessage, error)
func (ExchangeMessage) String ¶
func (self ExchangeMessage) String() string
type ExchangeMessageTarget ¶
type ExchangeMessageTarget struct { ReceiverExchangeId string // in the form org/id ReceiverPublicKeyObj *rsa.PublicKey ReceiverPublicKeyBytes []byte ReceiverMsgEndPoint string }
func CreateMessageTarget ¶
type ExchangeMessageWorker ¶
type ExchangeMessageWorker struct { worker.BaseWorker // embedded field // contains filtered or unexported fields }
func NewExchangeMessageWorker ¶
func NewExchangeMessageWorker(name string, cfg *config.HorizonConfig, db *bolt.DB) *ExchangeMessageWorker
func (*ExchangeMessageWorker) CommandHandler ¶
func (w *ExchangeMessageWorker) CommandHandler(command worker.Command) bool
func (*ExchangeMessageWorker) Initialize ¶
func (w *ExchangeMessageWorker) Initialize() bool
func (*ExchangeMessageWorker) Messages ¶
func (w *ExchangeMessageWorker) Messages() chan events.Message
func (*ExchangeMessageWorker) NewEvent ¶
func (w *ExchangeMessageWorker) NewEvent(incoming events.Message)
func (*ExchangeMessageWorker) NoWorkHandler ¶
func (w *ExchangeMessageWorker) NoWorkHandler()
type ExchangePolicy ¶
type ExchangePolicy struct { externalpolicy.ExternalPolicy LastUpdated string `json:"lastUpdated,omitempty"` }
The node and service policy objects in the exchange are identical to the external policy object supported by the node/policy API, so it is embedded in the ExchangePolicy object.
func GetNodePolicy ¶
func GetNodePolicy(ec ExchangeContext, deviceId string) (*ExchangePolicy, error)
Retrieve the node policy object from the exchange. The input device Id is assumed to be prefixed with its org.
func GetServicePolicy ¶
func GetServicePolicy(ec ExchangeContext, url string, org string, version string, arch string) (*ExchangePolicy, string, error)
This function gets the service policy for a service. It returns nil if there is no service policy for this service
func GetServicePolicyWithId ¶
func GetServicePolicyWithId(ec ExchangeContext, service_id string) (*ExchangePolicy, error)
Retrieve the service policy object from the exchange. The service_id is prefixed with the org name. It returns nil if there is no service policy for this service
func (*ExchangePolicy) GetExternalPolicy ¶
func (e *ExchangePolicy) GetExternalPolicy() externalpolicy.ExternalPolicy
func (*ExchangePolicy) GetLastUpdated ¶
func (e *ExchangePolicy) GetLastUpdated() string
func (ExchangePolicy) ShortString ¶
func (e ExchangePolicy) ShortString() string
func (ExchangePolicy) String ¶
func (e ExchangePolicy) String() string
type ExchangeSurfaceError ¶
type ExchangeSurfaceError struct {
ErrorList []persistence.SurfaceError `json:"errors"`
}
func GetSurfaceErrors ¶
func GetSurfaceErrors(ec ExchangeContext, deviceId string) (*ExchangeSurfaceError, error)
type ExchangeVersionHandler ¶
A handler for querying the exchange version. The id and token is used for auth.
func GetHTTPExchangeVersionHandler ¶
func GetHTTPExchangeVersionHandler(cfg *config.HorizonConfig) ExchangeVersionHandler
type GetAgbotMessageResponse ¶
type GetAgbotMessageResponse struct { Messages []AgbotMessage `json:"messages"` LastIndex int `json:"lastIndex"` }
type GetAgbotsBusinessPolsResponse ¶
type GetAgbotsBusinessPolsResponse struct {
BusinessPols map[string]ServedBusinessPolicy `json:"businessPols"`
}
TODO-New check with exchange
type GetAgbotsPatternsResponse ¶
type GetAgbotsPatternsResponse struct {
Patterns map[string]ServedPattern `json:"patterns"`
}
type GetAgbotsResponse ¶
type GetBusinessPolicyResponse ¶
type GetBusinessPolicyResponse struct { BusinessPolicy map[string]ExchangeBusinessPolicy `json:"businessPolicy,omitempty"` // map of all defined business policies LastIndex int `json:"lastIndex.omitempty"` }
type GetDeviceMessageResponse ¶
type GetDeviceMessageResponse struct { Messages []DeviceMessage `json:"messages"` LastIndex int `json:"lastIndex"` }
type GetDevicesResponse ¶
type GetOrganizationResponse ¶
type GetOrganizationResponse struct { Orgs map[string]Organization `json:"orgs"` LastIndex int `json:"lastIndex"` }
type GetPatternResponse ¶
type GetServicesResponse ¶
type GetServicesResponse struct { Services map[string]ServiceDefinition `json:"services"` LastIndex int `json:"lastIndex"` }
func (*GetServicesResponse) ShortString ¶
func (w *GetServicesResponse) ShortString() string
func (*GetServicesResponse) SupportVersionRange ¶
func (w *GetServicesResponse) SupportVersionRange()
The version field of all service dependencies is being changed to versionRange for all external interactions. Internally, since we still have to support old service defs, we will copy the new field into the old field for backward compatibility. This function make an in place modification of itself.
type HardwareRequirement ¶
type HardwareRequirement map[string]interface{}
This type is used to abstract the various edge node hardware requirements. The schema is left wide open.
func (HardwareRequirement) String ¶
func (h HardwareRequirement) String() string
type ImageDockerAuth ¶
type ImageDockerAuth struct { DockAuthId int `json:"dockAuthId"` Registry string `json:"registry"` UserName string `json:"username"` Token string `json:"token"` LastUpdated string `json:"lastUpdated"` }
func GetServiceDockerAuths ¶
func GetServiceDockerAuths(ec ExchangeContext, url string, org string, version string, arch string) ([]ImageDockerAuth, error)
This function gets the image docker auths for a service.
func GetServiceDockerAuthsWithId ¶
func GetServiceDockerAuthsWithId(ec ExchangeContext, service_id string) ([]ImageDockerAuth, error)
This function gets the image docker auths for the service by the given service id
func (ImageDockerAuth) String ¶
func (s ImageDockerAuth) String() string
type MSAgreementState ¶
type MSProp ¶
type MSProp struct { Name string `json:"name"` Value string `json:"value"` PropType string `json:"propType"` Op string `json:"op"` }
Structs used to invoke the exchange API
func ConvertPropertyToExchangeFormat ¶
func ConvertPropertyToExchangeFormat(prop *externalpolicy.Property) (*MSProp, error)
type Meter ¶
type Meter struct { Tokens uint64 `json:"tokens,omitempty"` // The number of tokens per time_unit PerTimeUnit string `json:"per_time_unit,omitempty"` // The per time units: min, hour and day are supported NotificationIntervalS int `json:"notification_interval,omitempty"` // The number of seconds between metering notifications }
type Microservice ¶
type Microservice struct { Url string `json:"url"` Properties []MSProp `json:"properties"` NumAgreements int `json:"numAgreements"` Policy string `json:"policy"` ConfigState string `json:"configState"` }
func (Microservice) ShortString ¶
func (m Microservice) ShortString() string
func (Microservice) String ¶
func (m Microservice) String() string
type NodeHealth ¶
type NodeHealth struct { MissingHBInterval int `json:"missing_heartbeat_interval,omitempty"` // How long a heartbeat can be missing until it is considered missing (in seconds) CheckAgreementStatus int `json:"check_agreement_status,omitempty"` // How often to check that the node agreement entry still exists in the exchange (in seconds) }
type NodeHealthStatus ¶
func GetNodeHealthStatus ¶
func GetNodeHealthStatus(httpClientFactory *config.HTTPClientFactory, pattern string, org string, nodeOrgs []string, lastCallTime string, exURL string, id string, token string) (*NodeHealthStatus, error)
Return the current status of nodes in a given pattern. This function can return nil and no error if the exchange has no updated status to return.
type NodeHealthStatusRequest ¶
type NodeInfo ¶
type NodeInfo struct { LastHeartbeat string `json:"lastHeartbeat"` Agreements map[string]AgreementObject `json:"agreements"` }
type NodePolicyHandler ¶
type NodePolicyHandler func(deviceId string) (*ExchangePolicy, error)
A handler for getting the node policy from the exchange.
func GetHTTPNodePolicyHandler ¶
func GetHTTPNodePolicyHandler(ec ExchangeContext) NodePolicyHandler
type ObjectDestinationPolicies ¶
type ObjectDestinationPolicies []ObjectDestinationPolicy
func GetObjectsByService ¶
func GetObjectsByService(ec ExchangeContext, org string, serviceId string) (*ObjectDestinationPolicies, error)
Query the CSS to retrieve object policy for a given service id.
func GetUpdatedObjects ¶
func GetUpdatedObjects(ec ExchangeContext, org string, since int64) (*ObjectDestinationPolicies, error)
Query the CSS to retrieve object policy updates that haven't been seen before.
type ObjectDestinationPolicy ¶
type ObjectDestinationPolicy struct { // OrgID is the organization ID of the object (an object belongs to exactly one organization). // required: true OrgID string `json:"orgID"` // ObjectType is the type of the object. // The type is used to group multiple objects, for example when checking for object updates. // required: true ObjectType string `json:"objectType"` // ObjectID is a unique identifier of the object // required: true ObjectID string `json:"objectID"` // DestinationPolicy is the policy specification that should be used to distribute this object // to the appropriate set of destinations. DestinationPolicy DestinationPolicy `json:"destinationPolicy,omitempty"` //Destinations is the list of the object's current destinations Destinations []common.DestinationsStatus `json:"destinations"` }
func (ObjectDestinationPolicy) String ¶
func (d ObjectDestinationPolicy) String() string
type ObjectDestinationQueryHandler ¶
type ObjectDestinationQueryHandler func(org string, objID string, objType string) (*ObjectDestinationStatuses, error)
A handler for getting the destinations of objects in the Model Management System.
func GetHTTPObjectDestinationQueryHandler ¶
func GetHTTPObjectDestinationQueryHandler(ec ExchangeContext) ObjectDestinationQueryHandler
type ObjectDestinationStatuses ¶
type ObjectDestinationStatuses []common.DestinationsStatus
func GetObjectDestinations ¶
func GetObjectDestinations(ec ExchangeContext, org string, objID string, objType string) (*ObjectDestinationStatuses, error)
Get the object's list of destinations.
type ObjectPolicyQueryHandler ¶
type ObjectPolicyQueryHandler func(org string, serviceId string) (*ObjectDestinationPolicies, error)
A handler for getting the policy of objects in the Model Management System.
func GetHTTPObjectPolicyQueryHandler ¶
func GetHTTPObjectPolicyQueryHandler(ec ExchangeContext) ObjectPolicyQueryHandler
type ObjectPolicyUpdateReceivedHandler ¶
type ObjectPolicyUpdateReceivedHandler func(objPol *ObjectDestinationPolicy) error
A handler for telling the Model Management System that a policy update has been received.
func GetHTTPObjectPolicyUpdateReceivedHandler ¶
func GetHTTPObjectPolicyUpdateReceivedHandler(ec ExchangeContext) ObjectPolicyUpdateReceivedHandler
type ObjectPolicyUpdatesQueryHandler ¶
type ObjectPolicyUpdatesQueryHandler func(org string, since int64) (*ObjectDestinationPolicies, error)
A handler for getting new policy for objects in the Model Management System.
func GetHTTPObjectPolicyUpdatesQueryHandler ¶
func GetHTTPObjectPolicyUpdatesQueryHandler(ec ExchangeContext) ObjectPolicyUpdatesQueryHandler
type ObjectQueryHandler ¶
A handler for getting the policy of objects in the Model Management System.
func GetHTTPObjectQueryHandler ¶
func GetHTTPObjectQueryHandler(ec ExchangeContext) ObjectQueryHandler
type ObjectSigningKeysHandler ¶
type ObjectSigningKeysHandler func(oType, oUrl string, oOrg string, oVersion string, oArch string) (map[string]string, error)
a handler for getting microservice keys from the exchange
func GetHTTPObjectSigningKeysHandler ¶
func GetHTTPObjectSigningKeysHandler(ec ExchangeContext) ObjectSigningKeysHandler
type OrgHandler ¶
type OrgHandler func(org string) (*Organization, error)
A handler for querying the exchange for an organization.
func GetHTTPExchangeOrgHandler ¶
func GetHTTPExchangeOrgHandler(ec ExchangeContext) OrgHandler
type OrgHandlerWithContext ¶
type OrgHandlerWithContext func(org string, id string, token string) (*Organization, error)
A handler for querying the exchange for an org when the caller doesnt have exchange identity at the time of creating the handler, but can supply the exchange context when it's time to make the call. Only used by the API package when trying to register an edge device.
func GetHTTPExchangeOrgHandlerWithContext ¶
func GetHTTPExchangeOrgHandlerWithContext(cfg *config.HorizonConfig) OrgHandlerWithContext
type Organization ¶
type Organization struct { Label string `json:"label"` Description string `json:"description"` LastUpdated string `json:"lastUpdated"` }
Functions and types for working with organizations in the exchange
func GetOrganization ¶
func GetOrganization(httpClientFactory *config.HTTPClientFactory, org string, exURL string, id string, token string) (*Organization, error)
Get the metadata for a specific organization.
type PatchAgbotPublicKey ¶
type PatchAgbotPublicKey struct {
PublicKey []byte `json:"publicKey"`
}
func CreateAgbotPublicKeyPatch ¶
func CreateAgbotPublicKeyPatch(keyPath string) *PatchAgbotPublicKey
This function creates the device registration message body.
func CreatePatchDeviceKey ¶
func CreatePatchDeviceKey() *PatchAgbotPublicKey
This function creates the device registration complete message body.
type PatchDeviceHandler ¶
type PatchDeviceHandler func(deviceId string, deviceToken string, pdr *PatchDeviceRequest) error
A handler for patching the device information on the exchange
func GetHTTPPatchDeviceHandler ¶
func GetHTTPPatchDeviceHandler(ec ExchangeContext) PatchDeviceHandler
func GetHTTPPatchDeviceHandler2 ¶
func GetHTTPPatchDeviceHandler2(cfg *config.HorizonConfig) PatchDeviceHandler
this is used when ExchangeContext is not set up yet.
type PatchDeviceRequest ¶
type PatchDeviceRequest struct { UserInput *[]policy.UserInput `json:"userInput,omitempty"` Pattern string `json:"pattern,omitempty"` Arch string `json:"arch,omitempty"` RegisteredServices *[]Microservice `json:"registeredServices,omitempty"` }
Please patch one field at a time.
func (PatchDeviceRequest) String ¶
func (p PatchDeviceRequest) String() string
type Pattern ¶
type Pattern struct { Owner string `json:"owner"` Label string `json:"label"` Description string `json:"description"` Public bool `json:"public"` Services []ServiceReference `json:"services"` AgreementProtocols []AgreementProtocol `json:"agreementProtocols"` UserInput []policy.UserInput `json:"userInput,omitempty"` }
func (Pattern) ShortString ¶
type PatternHandler ¶
A handler for querying the exchange for patterns.
func GetHTTPExchangePatternHandler ¶
func GetHTTPExchangePatternHandler(ec ExchangeContext) PatternHandler
type PatternHandlerWithContext ¶
type PatternHandlerWithContext func(org string, pattern string, id string, token string) (map[string]Pattern, error)
A handler for querying the exchange for patterns when the caller doesnt have exchange identity at the time of creating the handler, but can supply the exchange context when it's time to make the call. Only used by the API package when trying to register an edge device.
func GetHTTPExchangePatternHandlerWithContext ¶
func GetHTTPExchangePatternHandlerWithContext(cfg *config.HorizonConfig) PatternHandlerWithContext
type PostDeviceResponse ¶
type PostDeviceServicesConfigStateHandler ¶
type PostDeviceServicesConfigStateHandler func(deviceId string, deviceToken string, svcsConfigState *ServiceConfigState) error
A handler for modifying the device information on the exchange
func GetHTTPPostDeviceServicesConfigStateHandler ¶
func GetHTTPPostDeviceServicesConfigStateHandler(ec ExchangeContext) PostDeviceServicesConfigStateHandler
type PostMessage ¶
func CreatePostMessage ¶
func CreatePostMessage(msg []byte, ttl int) *PostMessage
func (PostMessage) String ¶
func (p PostMessage) String() string
type PutAgbotAgreementState ¶
type PutAgbotAgreementState struct { Service WorkloadAgreement `json:"service,omitempty"` State string `json:"state"` }
type PutAgreementState ¶
type PutAgreementState struct { State string `json:"state"` Services []MSAgreementState `json:"services,omitempty"` AgreementService WorkloadAgreement `json:"agreementService,omitempty"` }
func (PutAgreementState) String ¶
func (p PutAgreementState) String() string
type PutDestinationListRequest ¶
type PutDestinationListRequest []string
type PutDeviceHandler ¶
type PutDeviceHandler func(deviceId string, deviceToken string, pdr *PutDeviceRequest) (*PutDeviceResponse, error)
A handler for modifying the device information on the exchange
func GetHTTPPutDeviceHandler ¶
func GetHTTPPutDeviceHandler(ec ExchangeContext) PutDeviceHandler
type PutDeviceRequest ¶
type PutDeviceRequest struct { Token string `json:"token"` Name string `json:"name"` Pattern string `json:"pattern"` RegisteredServices []Microservice `json:"registeredServices"` MsgEndPoint string `json:"msgEndPoint"` SoftwareVersions SoftwareVersion `json:"softwareVersions"` PublicKey []byte `json:"publicKey"` Arch string `json:"arch"` }
func CreateDevicePut ¶
func CreateDevicePut(token string, name string) *PutDeviceRequest
This function creates the device registration message body.
func (PutDeviceRequest) ShortString ¶
func (p PutDeviceRequest) ShortString() string
func (PutDeviceRequest) String ¶
func (p PutDeviceRequest) String() string
type PutDeviceResponse ¶
func PutExchangeDevice ¶
func PutExchangeDevice(httpClientFactory *config.HTTPClientFactory, deviceId string, deviceToken string, exchangeUrl string, pdr *PutDeviceRequest) (*PutDeviceResponse, error)
modify the the device
func PutNodePolicy ¶
func PutNodePolicy(ec ExchangeContext, deviceId string, ep *ExchangePolicy) (*PutDeviceResponse, error)
Write an updated node policy to the exchange.
func PutServicePolicy ¶
func PutServicePolicy(ec ExchangeContext, url string, org string, version string, arch string, ep *ExchangePolicy) (*PutDeviceResponse, error)
This function updates the service policy for a service.
func PutServicePolicyWithId ¶
func PutServicePolicyWithId(ec ExchangeContext, service_id string, ep *ExchangePolicy) (*PutDeviceResponse, error)
Write an updated service policy to the exchange.
func PutSurfaceErrors ¶
func PutSurfaceErrors(ec ExchangeContext, deviceId string, errorList *ExchangeSurfaceError) (*PutDeviceResponse, error)
type PutNodePolicyHandler ¶
type PutNodePolicyHandler func(deviceId string, ep *ExchangePolicy) (*PutDeviceResponse, error)
A handler for updating the node policy to the exchange.
func GetHTTPPutNodePolicyHandler ¶
func GetHTTPPutNodePolicyHandler(ec ExchangeContext) PutNodePolicyHandler
type PutServicePolicyHandler ¶
type PutServicePolicyHandler func(sUrl string, sOrg string, sVersion string, sArch string, ep *ExchangePolicy) (*PutDeviceResponse, error)
func GetHTTPPutServicePolicyHandler ¶
func GetHTTPPutServicePolicyHandler(ec ExchangeContext) PutServicePolicyHandler
type PutServicePolicyWithIdHandler ¶
type PutServicePolicyWithIdHandler func(service_id string, ep *ExchangePolicy) (*PutDeviceResponse, error)
Two handlers for updating the service policy to the exchange.
func GetHTTPPutServicePolicyWithIdHandler ¶
func GetHTTPPutServicePolicyWithIdHandler(ec ExchangeContext) PutServicePolicyWithIdHandler
type PutSurfaceErrorsHandler ¶
type PutSurfaceErrorsHandler func(deviceId string, errorList *ExchangeSurfaceError) (*PutDeviceResponse, error)
A handler for putting a list of node surface errors in the exchange
func GetHTTPPutSurfaceErrorsHandler ¶
func GetHTTPPutSurfaceErrorsHandler(ec ExchangeContext) PutSurfaceErrorsHandler
type ResetIntervalCommand ¶
type ResetIntervalCommand struct { }
func NewResetIntervalCommand ¶
func NewResetIntervalCommand() *ResetIntervalCommand
func (ResetIntervalCommand) ShortString ¶
func (c ResetIntervalCommand) ShortString() string
type SearchExchBusinessPolRequest ¶
type SearchExchBusinessPolRequest struct { NodeOrgIds []string `json:"nodeOrgids,omitempty"` ChangedSince uint64 `json:"changedSince"` }
Structs and types for working with business policy based exchange searches
func (SearchExchBusinessPolRequest) String ¶
func (a SearchExchBusinessPolRequest) String() string
type SearchExchBusinessPolResponse ¶
type SearchExchBusinessPolResponse struct { Devices []SearchResultDevice `json:"nodes"` LastIndex int `json:"lastIndex"` }
func (SearchExchBusinessPolResponse) String ¶
func (r SearchExchBusinessPolResponse) String() string
type SearchExchangeMSRequest ¶
type SearchExchangeMSRequest struct { DesiredServices []Microservice `json:"desiredServices"` SecondsStale int `json:"secondsStale"` PropertiesToReturn []string `json:"propertiesToReturn"` StartIndex int `json:"startIndex"` NumEntries int `json:"numEntries"` }
structs and types for working with microservice based exchange searches
func CreateSearchMSRequest ¶
func CreateSearchMSRequest() *SearchExchangeMSRequest
This function creates the exchange search message body.
func (SearchExchangeMSRequest) String ¶
func (a SearchExchangeMSRequest) String() string
type SearchExchangeMSResponse ¶
type SearchExchangeMSResponse struct { Devices []SearchResultDevice `json:"nodes"` LastIndex int `json:"lastIndex"` }
func (SearchExchangeMSResponse) String ¶
func (r SearchExchangeMSResponse) String() string
type SearchExchangePatternRequest ¶
type SearchExchangePatternRequest struct { ServiceURL string `json:"serviceUrl,omitempty"` NodeOrgIds []string `json:"nodeOrgids,omitempty"` SecondsStale int `json:"secondsStale"` StartIndex int `json:"startIndex"` NumEntries int `json:"numEntries"` }
Structs and types for working with pattern based exchange searches
func CreateSearchPatternRequest ¶
func CreateSearchPatternRequest() *SearchExchangePatternRequest
This function creates the exchange search message body.
func (SearchExchangePatternRequest) String ¶
func (a SearchExchangePatternRequest) String() string
type SearchExchangePatternResponse ¶
type SearchExchangePatternResponse struct { Devices []SearchResultDevice `json:"nodes"` LastIndex int `json:"lastIndex"` }
func (SearchExchangePatternResponse) String ¶
func (r SearchExchangePatternResponse) String() string
type SearchResultDevice ¶
type SearchResultDevice struct { Id string `json:"id"` Name string `json:"name"` Services []Microservice `json:"services"` MsgEndPoint string `json:"msgEndPoint"` PublicKey []byte `json:"publicKey"` }
func (SearchResultDevice) ShortString ¶
func (d SearchResultDevice) ShortString() string
func (SearchResultDevice) String ¶
func (d SearchResultDevice) String() string
type ServedBusinessPolicy ¶
type ServedBusinessPolicy struct { BusinessPolOrg string `json:"businessPolOrgid"` // defaults to nodeOrgid BusinessPol string `json:"businessPol"` // '*' means all NodeOrg string `json:"nodeOrgid"` LastUpdated string `json:"lastUpdated"` }
business policies served by an agbot that are allowed to be put on the nodes of an org.
type ServedPattern ¶
type ServedPattern struct { PatternOrg string `json:"patternOrgid"` // defaults to NodeOrg Pattern string `json:"pattern"` // '*' means all NodeOrg string `json:"nodeOrgid"` LastUpdated string `json:"lastUpdated"` }
patterns served by an agbot that are allowed to be put on the nodes of an org.
type ServiceConfigState ¶
type ServiceConfigState struct { Url string `json:"url"` Org string `json:"org"` ConfigState string `json:"configState"` }
func GetServicesConfigState ¶
func GetServicesConfigState(httpClientFactory *config.HTTPClientFactory, dev_id string, dev_token string, exchangeUrl string) ([]ServiceConfigState, error)
func NewServiceConfigState ¶
func NewServiceConfigState(url, org, state string) *ServiceConfigState
func (*ServiceConfigState) String ¶
func (s *ServiceConfigState) String() string
type ServiceDefinition ¶
type ServiceDefinition struct { Owner string `json:"owner"` Label string `json:"label"` Description string `json:"description"` Public bool `json:"public"` URL string `json:"url"` Version string `json:"version"` Arch string `json:"arch"` Sharable string `json:"sharable"` MatchHardware HardwareRequirement `json:"matchHardware"` RequiredServices []ServiceDependency `json:"requiredServices"` UserInputs []UserInput `json:"userInput"` Deployment string `json:"deployment"` DeploymentSignature string `json:"deploymentSignature"` LastUpdated string `json:"lastUpdated"` }
func GetHighestVersion ¶
func GetHighestVersion(msMetadata map[string]ServiceDefinition, vRange *semanticversion.Version_Expression) (string, ServiceDefinition, string, error)
Find the highest version service and return it.
func GetService ¶
func GetService(ec ExchangeContext, mURL string, mOrg string, mVersion string, mArch string) (*ServiceDefinition, string, error)
Retrieve service definition metadata from the exchange, by specific version or for all versions.
func ServiceResolver ¶
func ServiceResolver(wURL string, wOrg string, wVersion string, wArch string, serviceHandler ServiceHandler) (*policy.APISpecList, *ServiceDefinition, []string, error)
The purpose of this function is to verify that a given service URL, version and architecture, is defined in the exchange as well as all of its required services. This function also returns the dependencies converted into policy types so that the caller can use those types to do policy compatibility checks if they want to. The string array will contain the service ids of the top level sevice and all the dependency services with highest versions within the specified range.
func (*ServiceDefinition) GetDeployment ¶
func (s *ServiceDefinition) GetDeployment() string
func (*ServiceDefinition) GetDeploymentSignature ¶
func (s *ServiceDefinition) GetDeploymentSignature() string
func (*ServiceDefinition) GetServiceDependencies ¶
func (s *ServiceDefinition) GetServiceDependencies() *[]ServiceDependency
func (*ServiceDefinition) GetUserInputName ¶
func (s *ServiceDefinition) GetUserInputName(name string) *UserInput
func (*ServiceDefinition) GetVersion ¶
func (s *ServiceDefinition) GetVersion() string
func (*ServiceDefinition) HasDependencies ¶
func (s *ServiceDefinition) HasDependencies() bool
func (*ServiceDefinition) NeedsUserInput ¶
func (s *ServiceDefinition) NeedsUserInput() bool
func (*ServiceDefinition) PopulateDefaultUserInput ¶
func (s *ServiceDefinition) PopulateDefaultUserInput(envAdds map[string]string)
func (ServiceDefinition) ShortString ¶
func (s ServiceDefinition) ShortString() string
func (ServiceDefinition) String ¶
func (s ServiceDefinition) String() string
type ServiceDependency ¶
type ServiceDependency struct { URL string `json:"url"` Org string `json:"org"` Version string `json:"version,omitempty"` VersionRange string `json:"versionRange"` Arch string `json:"arch"` }
This type is a tuple used to refer to a specific service that is a dependency for the referencing service.
func (ServiceDependency) String ¶
func (sd ServiceDependency) String() string
type ServiceDockerAuthsHandler ¶
type ServiceDockerAuthsHandler func(sUrl string, sOrg string, sVersion string, sArch string) ([]ImageDockerAuth, error)
A handler for getting the image docker auths for a service in the exchange.
func GetHTTPServiceDockerAuthsHandler ¶
func GetHTTPServiceDockerAuthsHandler(ec ExchangeContext) ServiceDockerAuthsHandler
type ServiceDockerAuthsWithIdHandler ¶
type ServiceDockerAuthsWithIdHandler func(sId string) ([]ImageDockerAuth, error)
A handler for getting the image docker auths for a service by the id in the exchange.
func GetHTTPServiceDockerAuthsWithIdHandler ¶
func GetHTTPServiceDockerAuthsWithIdHandler(ec ExchangeContext) ServiceDockerAuthsWithIdHandler
type ServiceHandler ¶
type ServiceHandler func(wUrl string, wOrg string, wVersion string, wArch string) (*ServiceDefinition, string, error)
A handler for getting service metadata from the exchange.
func GetHTTPServiceHandler ¶
func GetHTTPServiceHandler(ec ExchangeContext) ServiceHandler
type ServicePolicyHandler ¶
type ServicePolicyHandler func(sUrl string, sOrg string, sVersion string, sArch string) (*ExchangePolicy, string, error)
func GetHTTPServicePolicyHandler ¶
func GetHTTPServicePolicyHandler(ec ExchangeContext) ServicePolicyHandler
type ServicePolicyWithIdHandler ¶
type ServicePolicyWithIdHandler func(service_id string) (*ExchangePolicy, error)
Two handlers for getting the service policy from the exchange.
func GetHTTPServicePolicyWithIdHandler ¶
func GetHTTPServicePolicyWithIdHandler(ec ExchangeContext) ServicePolicyWithIdHandler
type ServiceReference ¶
type ServiceReference struct { ServiceURL string `json:"serviceUrl,omitempty"` // refers to a service definition in the exchange ServiceOrg string `json:"serviceOrgid,omitempty"` // the org holding the service definition ServiceArch string `json:"serviceArch,omitempty"` // the hardware architecture of the service definition ServiceVersions []WorkloadChoice `json:"serviceVersions,omitempty"` // a list of service version for rollback DataVerify DataVerification `json:"dataVerification"` // policy for verifying that the node is sending data NodeH NodeHealth `json:"nodeHealth"` // policy for determining when a node's health is violating its agreements AgreementLess bool `json:"agreementLess"` // This service should get started on the node without an agreement to start it }
func (ServiceReference) ShortString ¶
func (w ServiceReference) ShortString() string
func (ServiceReference) String ¶
func (w ServiceReference) String() string
type ServiceResolverHandler ¶
type ServiceResolverHandler func(wUrl string, wOrg string, wVersion string, wArch string) (*policy.APISpecList, *ServiceDefinition, []string, error)
A handler for resolving service references in the exchange.
func GetHTTPServiceResolverHandler ¶
func GetHTTPServiceResolverHandler(ec ExchangeContext) ServiceResolverHandler
type ServicesConfigStateHandler ¶
type ServicesConfigStateHandler func(id string, token string) ([]ServiceConfigState, error)
A handler for service config state information from the exchange
func GetHTTPServicesConfigStateHandler ¶
func GetHTTPServicesConfigStateHandler(ec ExchangeContext) ServicesConfigStateHandler
type SoftwareVersion ¶
type SurfaceErrorsHandler ¶
type SurfaceErrorsHandler func(deviceId string) (*ExchangeSurfaceError, error)
A handler for getting the list of node surface errors from the exchange
func GetHTTPSurfaceErrorsHandler ¶
func GetHTTPSurfaceErrorsHandler(ec ExchangeContext) SurfaceErrorsHandler
type SymmetricValues ¶
type UpdateObjectDestinationHandler ¶
type UpdateObjectDestinationHandler func(org string, objPol *ObjectDestinationPolicy, dests *PutDestinationListRequest) error
A handler for updating the list of object destinations in the Model Management System.
func GetHTTPUpdateObjectDestinationHandler ¶
func GetHTTPUpdateObjectDestinationHandler(ec ExchangeContext) UpdateObjectDestinationHandler
type UpgradePolicy ¶
type UserInput ¶
type UserInput struct { Name string `json:"name"` Label string `json:"label"` Type string `json:"type"` // Valid values are "string", "int", "float", "boolean", "list of strings" DefaultValue string `json:"defaultValue"` }
This type is used to describe a configuration variable that the node owner/user has to set before the service is able to execute on the edge node.
type WorkloadAgreement ¶
type WorkloadChoice ¶
type WorkloadChoice struct { Version string `json:"version,omitempty"` // the version of the workload Priority WorkloadPriority `json:"priority,omitempty"` // the highest priority workload is tried first for an agreement, if it fails, the next priority is tried. Priority 1 is the highest, priority 2 is next, etc. Upgrade UpgradePolicy `json:"upgradePolicy,omitempty"` DeploymentOverrides string `json:"deployment_overrides"` // env var overrides for the workload DeploymentOverridesSignature string `json:"deployment_overrides_signature"` // signature of env var overrides }
func (WorkloadChoice) ShortString ¶
func (w WorkloadChoice) ShortString() string
func (WorkloadChoice) String ¶
func (w WorkloadChoice) String() string
type WorkloadPriority ¶
type WorkloadPriority struct { PriorityValue int `json:"priority_value,omitempty"` // The priority of the workload Retries int `json:"retries,omitempty"` // The number of retries before giving up and moving to the next priority RetryDurationS int `json:"retry_durations,omitempty"` // The number of seconds in which the specified number of retries must occur in order for the next priority workload to be attempted. VerifiedDurationS int `json:"verified_durations,omitempty"` // The number of second in which verified data must exist before the rollback retry feature is turned off }