api

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2024 License: Apache-2.0 Imports: 15 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AspectNodesEndpoints

func AspectNodesEndpoints(config config.Config, control Controller, router *httprouter.Router)

func AspectsEndpoints

func AspectsEndpoints(config config.Config, control Controller, router *httprouter.Router)

func Characteristics

func Characteristics(config config.Config, control Controller, router *httprouter.Router)

func Concepts

func Concepts(config config.Config, control Controller, router *httprouter.Router)

func DeviceClassEndpoints

func DeviceClassEndpoints(config config.Config, control Controller, router *httprouter.Router)

func DeviceEndpoints

func DeviceEndpoints(config config.Config, control Controller, router *httprouter.Router)

func DeviceGroupEndpoints

func DeviceGroupEndpoints(config config.Config, control Controller, router *httprouter.Router)

func DeviceTypeEndpoints

func DeviceTypeEndpoints(config config.Config, control Controller, router *httprouter.Router)

func DeviceTypeSelectableEndpoints

func DeviceTypeSelectableEndpoints(config config.Config, control Controller, router *httprouter.Router)

func ExtendedDeviceEndpoints added in v0.1.0

func ExtendedDeviceEndpoints(config config.Config, control Controller, router *httprouter.Router)

func ExtendedHubEndpoints added in v0.1.0

func ExtendedHubEndpoints(config config.Config, control Controller, router *httprouter.Router)

func FunctionsEndpoints

func FunctionsEndpoints(config config.Config, control Controller, router *httprouter.Router)

func HubEndpoints

func HubEndpoints(config config.Config, control Controller, router *httprouter.Router)

func InvalidElements added in v0.0.5

func InvalidElements(config config.Config, control Controller, router *httprouter.Router)

func LocationEndpoints

func LocationEndpoints(config config.Config, control Controller, router *httprouter.Router)

func ProtocolEndpoints

func ProtocolEndpoints(config config.Config, control Controller, router *httprouter.Router)

func QueryEndpoint added in v0.0.6

func QueryEndpoint(config config.Config, control Controller, router *httprouter.Router)

func ServiceEndpoints

func ServiceEndpoints(config config.Config, control Controller, router *httprouter.Router)

func Start

func Start(config config.Config, control Controller) (err error)

Types

type AspectNodeQuery

type AspectNodeQuery struct {
	Ids *[]string `json:"ids,omitempty"`
}

type Controller

type Controller interface {
	ListDevices(token string, options model.DeviceListOptions) (result []models.Device, err error, errCode int)
	ReadDevice(id string, token string, action model.AuthAction) (result models.Device, err error, errCode int)
	ReadDeviceByLocalId(ownerId string, localId string, token string, action model.AuthAction) (result models.Device, err error, errCode int)
	ValidateDevice(token string, device models.Device) (err error, code int)

	ListExtendedDevices(token string, options model.DeviceListOptions) (result []models.ExtendedDevice, total int64, err error, errCode int)
	ReadExtendedDevice(id string, token string, action model.AuthAction) (result models.ExtendedDevice, err error, errCode int)
	ReadExtendedDeviceByLocalId(ownerId string, localId string, token string, action model.AuthAction) (result models.ExtendedDevice, err error, errCode int)

	ReadHub(id string, token string, action model.AuthAction) (result models.Hub, err error, errCode int)
	ListHubs(token string, options model.HubListOptions) (result []models.Hub, err error, errCode int)
	ListHubDeviceIds(id string, token string, action model.AuthAction, asLocalId bool) (result []string, err error, errCode int)
	ValidateHub(token string, hub models.Hub) (err error, code int)

	ListExtendedHubs(token string, options model.HubListOptions) (result []models.ExtendedHub, total int64, err error, errCode int)
	ReadExtendedHub(id string, token string, action model.AuthAction) (result models.ExtendedHub, err error, errCode int)

	ReadDeviceType(id string, token string) (result models.DeviceType, err error, errCode int)
	ListDeviceTypes(token string, limit int64, offset int64, sort string, filter []model.FilterCriteria, interactionsFilter []string, includeModified bool, includeUnmodified bool) (result []models.DeviceType, err error, errCode int)
	ListDeviceTypesV2(token string, limit int64, offset int64, sort string, filter []model.FilterCriteria, includeModified bool, includeUnmodified bool) (result []models.DeviceType, err error, errCode int)
	ValidateDeviceType(deviceType models.DeviceType, options model.ValidationOptions) (err error, code int)

	GetDeviceTypeSelectables(query []model.FilterCriteria, pathPrefix string, interactionsFilter []string, includeModified bool) (result []model.DeviceTypeSelectable, err error, code int)
	GetDeviceTypeSelectablesV2(query []model.FilterCriteria, pathPrefix string, includeModified bool, servicesMustMatchAllCriteria bool) (result []model.DeviceTypeSelectable, err error, code int)

	ReadDeviceGroup(id string, token string, filterGenericDuplicateCriteria bool) (result models.DeviceGroup, err error, errCode int)
	ValidateDeviceGroup(deviceGroup models.DeviceGroup) (err error, code int)
	CheckAccessToDevicesOfGroup(token string, group models.DeviceGroup) (err error, code int)

	ReadProtocol(id string, token string) (result models.Protocol, err error, errCode int)
	ListProtocols(token string, limit int64, offset int64, sort string) (result []models.Protocol, err error, errCode int)
	ValidateProtocol(protocol models.Protocol) (err error, code int)

	GetService(id string) (result models.Service, err error, code int)

	GetAspects() ([]models.Aspect, error, int)
	GetAspectsWithMeasuringFunction(ancestors bool, descendants bool) ([]models.Aspect, error, int) //returns all aspects used in combination with measuring functions (usage may optionally be by its descendants or ancestors)
	GetAspect(id string) (models.Aspect, error, int)
	ValidateAspect(aspect models.Aspect) (err error, code int)
	ValidateAspectDelete(id string) (err error, code int)

	GetAspectNode(id string) (models.AspectNode, error, int)
	GetAspectNodes() ([]models.AspectNode, error, int)
	GetAspectNodesMeasuringFunctions(id string, ancestors bool, descendants bool) (result []models.Function, err error, errCode int) //returns all measuring functions used in combination with given aspect (and optional its descendants and ancestors)
	GetAspectNodesWithMeasuringFunction(ancestors bool, descendants bool) ([]models.AspectNode, error, int)                          //returns all aspect-nodes used in combination with measuring functions (usage may optionally be by its descendants or ancestors)
	GetAspectNodesByIdList(strings []string) ([]models.AspectNode, error, int)

	GetLeafCharacteristics() (result []models.Characteristic, err error, errCode int)
	GetCharacteristic(id string) (result models.Characteristic, err error, errCode int)
	ValidateCharacteristics(characteristic models.Characteristic) (err error, code int)
	ValidateCharacteristicDelete(id string) (err error, code int)

	GetConceptWithCharacteristics(id string) (models.ConceptWithCharacteristics, error, int)
	GetConceptWithoutCharacteristics(id string) (models.Concept, error, int)
	ValidateConcept(concept models.Concept) (err error, code int)
	ValidateConceptDelete(id string) (err error, code int)

	GetDeviceClasses() ([]models.DeviceClass, error, int)
	GetDeviceClassesWithControllingFunctions() ([]models.DeviceClass, error, int)                      //returns all device-classes used in combination with controlling functions
	GetDeviceClassesFunctions(id string) (result []models.Function, err error, errCode int)            //returns all functions used in combination with given device-class
	GetDeviceClassesControllingFunctions(id string) (result []models.Function, err error, errCode int) //returns all controlling functions used in combination with given device-class
	GetDeviceClass(id string) (result models.DeviceClass, err error, errCode int)
	ValidateDeviceClass(deviceclass models.DeviceClass) (err error, code int)
	ValidateDeviceClassDelete(id string) (err error, code int)

	GetFunctionsByType(rdfType string) (result []models.Function, err error, errCode int)
	GetFunction(id string) (result models.Function, err error, errCode int)
	ValidateFunction(function models.Function) (err error, code int)
	ValidateFunctionDelete(id string) (err error, code int)

	GetLocation(id string, token string) (location models.Location, err error, errCode int)
	ValidateLocation(location models.Location) (err error, code int)
	GetUsedInDeviceType(query model.UsedInDeviceTypeQuery) (result model.UsedInDeviceTypeResponse, err error, errCode int)
}

type ValidationError added in v0.0.5

type ValidationError struct {
	Id    string `json:"id"`
	Name  string `json:"name"`
	Error string `json:"error"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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