interfaces

package
v2.0.0-dev.65 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommonClient

type CommonClient interface {
	// Configuration obtains configuration information from the target service.
	Configuration(ctx context.Context) (common.ConfigResponse, errors.EdgeX)
	// Metrics obtains metrics information from the target service.
	Metrics(ctx context.Context) (common.MetricsResponse, errors.EdgeX)
	// Ping tests whether the service is working
	Ping(ctx context.Context) (common.PingResponse, errors.EdgeX)
	// Version obtains version information from the target service.
	Version(ctx context.Context) (common.VersionResponse, errors.EdgeX)
}

type DeviceClient

type DeviceClient interface {
	// Add adds new devices.
	Add(ctx context.Context, reqs []requests.AddDeviceRequest) ([]common.BaseWithIdResponse, errors.EdgeX)
	// Update updates devices.
	Update(ctx context.Context, reqs []requests.UpdateDeviceRequest) ([]common.BaseResponse, errors.EdgeX)
	// AllDevices returns all devices. Devices can also be filtered by labels.
	// The result can be limited in a certain range by specifying the offset and limit parameters.
	// offset: The number of items to skip before starting to collect the result set. Default is 0.
	// limit: The number of items to return. Specify -1 will return all remaining items after offset. The maximum will be the MaxResultCount as defined in the configuration of service. Default is 20.
	AllDevices(ctx context.Context, labels []string, offset int, limit int) (responses.MultiDevicesResponse, errors.EdgeX)
	// DeviceNameExists checks whether the device exists.
	DeviceNameExists(ctx context.Context, name string) (common.BaseResponse, errors.EdgeX)
	// DeviceByName returns a device by device name.
	DeviceByName(ctx context.Context, name string) (responses.DeviceResponse, errors.EdgeX)
	// DeleteByName deletes a device by device name.
	DeleteDeviceByName(ctx context.Context, name string) (common.BaseResponse, errors.EdgeX)
	// DevicesByProfileName returns devices associated with the specified device profile.
	// The result can be limited in a certain range by specifying the offset and limit parameters.
	// offset: The number of items to skip before starting to collect the result set. Default is 0.
	// limit: The number of items to return. Specify -1 will return all remaining items after offset. The maximum will be the MaxResultCount as defined in the configuration of service. Default is 20.
	DevicesByProfileName(ctx context.Context, name string, offset int, limit int) (responses.MultiDevicesResponse, errors.EdgeX)
	// DevicesByServiceName returns devices associated with the specified device service.
	// The result can be limited in a certain range by specifying the offset and limit parameters.
	// offset: The number of items to skip before starting to collect the result set. Default is 0.
	// limit: The number of items to return. Specify -1 will return all remaining items after offset. The maximum will be the MaxResultCount as defined in the configuration of service. Default is 20.
	DevicesByServiceName(ctx context.Context, name string, offset int, limit int) (responses.MultiDevicesResponse, errors.EdgeX)
}

DeviceClient defines the interface for interactions with the Device endpoint on the EdgeX Foundry core-metadata service.

type DeviceProfileClient

type DeviceProfileClient interface {
	// Add adds new profiles
	Add(ctx context.Context, reqs []requests.DeviceProfileRequest) ([]common.BaseWithIdResponse, errors.EdgeX)
	// Update updates profiles
	Update(ctx context.Context, reqs []requests.DeviceProfileRequest) ([]common.BaseResponse, errors.EdgeX)
	// AddByYaml adds new profile by uploading a file in YAML format
	AddByYaml(ctx context.Context, yamlFilePath string) (common.BaseWithIdResponse, errors.EdgeX)
	// UpdateByYaml updates profile by uploading a file in YAML format
	UpdateByYaml(ctx context.Context, yamlFilePath string) (common.BaseResponse, errors.EdgeX)
	// DeleteByName deletes profile by name
	DeleteByName(ctx context.Context, name string) (common.BaseResponse, errors.EdgeX)
	// Query profile by name
	DeviceProfileByName(ctx context.Context, name string) (responses.DeviceProfileResponse, errors.EdgeX)
	// Query all profiles
	AllDeviceProfiles(ctx context.Context, labels []string, offset int, limit int) (responses.MultiDeviceProfilesResponse, errors.EdgeX)
	// Query profiles by model
	DeviceProfilesByModel(ctx context.Context, model string, offset int, limit int) (responses.MultiDeviceProfilesResponse, errors.EdgeX)
	// Query profiles by manufacturer
	DeviceProfilesByManufacturer(ctx context.Context, manufacturer string, offset int, limit int) (responses.MultiDeviceProfilesResponse, errors.EdgeX)
	// Query profiles by manufacturer and model
	DeviceProfilesByManufacturerAndModel(ctx context.Context, manufacturer string, model string, offset int, limit int) (responses.MultiDeviceProfilesResponse, errors.EdgeX)
}

DeviceProfileClient defines the interface for interactions with the DeviceProfile endpoint on the EdgeX Foundry core-metadata service.

type DeviceServiceCallbackClient

type DeviceServiceCallbackClient interface {
	// AddDeviceCallback invokes device service's callback API for adding device
	AddDeviceCallback(ctx context.Context, request requests.AddDeviceRequest) (common.BaseResponse, errors.EdgeX)
	// UpdateDeviceCallback invokes device service's callback API for updating device
	UpdateDeviceCallback(ctx context.Context, request requests.UpdateDeviceRequest) (common.BaseResponse, errors.EdgeX)
	// DeleteDeviceCallback invokes device service's callback API for deleting device
	DeleteDeviceCallback(ctx context.Context, name string) (common.BaseResponse, errors.EdgeX)
	// UpdateDeviceProfileCallback invokes device service's callback API for updating device profile
	UpdateDeviceProfileCallback(ctx context.Context, request requests.DeviceProfileRequest) (common.BaseResponse, errors.EdgeX)
	// AddProvisionWatcherCallback invokes device service's callback API for adding provision watcher
	AddProvisionWatcherCallback(ctx context.Context, request requests.AddProvisionWatcherRequest) (common.BaseResponse, errors.EdgeX)
	// UpdateProvisionWatcherCallback invokes device service's callback API for updating provision watcher
	UpdateProvisionWatcherCallback(ctx context.Context, request requests.UpdateProvisionWatcherRequest) (common.BaseResponse, errors.EdgeX)
	// DeleteProvisionWatcherCallback invokes device service's callback API for deleting provision watcher
	DeleteProvisionWatcherCallback(ctx context.Context, name string) (common.BaseResponse, errors.EdgeX)
	// UpdateDeviceServiceCallback invokes device service's callback API for updating device service
	UpdateDeviceServiceCallback(ctx context.Context, request requests.UpdateDeviceServiceRequest) (common.BaseResponse, errors.EdgeX)
}

DeviceServiceCallbackClient defines the interface for interactions with the callback endpoint on the EdgeX Foundry device service.

type DeviceServiceClient

type DeviceServiceClient interface {
	// Add adds new device services.
	Add(ctx context.Context, reqs []requests.AddDeviceServiceRequest) ([]common.BaseWithIdResponse, errors.EdgeX)
	// Update updates device services.
	Update(ctx context.Context, reqs []requests.UpdateDeviceServiceRequest) ([]common.BaseResponse, errors.EdgeX)
	// AllDeviceServices returns all device services. Device services can also be filtered by labels.
	// The result can be limited in a certain range by specifying the offset and limit parameters.
	// offset: The number of items to skip before starting to collect the result set. Default is 0.
	// limit: The number of items to return. Specify -1 will return all remaining items after offset. The maximum will be the MaxResultCount as defined in the configuration of service. Default is 20.
	AllDeviceServices(ctx context.Context, labels []string, offset int, limit int) (responses.MultiDeviceServicesResponse, errors.EdgeX)
	// DeviceServiceByName returns a device service by name.
	DeviceServiceByName(ctx context.Context, name string) (responses.DeviceServiceResponse, errors.EdgeX)
	// DeleteByName deletes a device service by name.
	DeleteByName(ctx context.Context, name string) (common.BaseResponse, errors.EdgeX)
}

DeviceServiceClient defines the interface for interactions with the Device Service endpoint on the EdgeX Foundry core-metadata service.

type DeviceServiceCommandClient

type DeviceServiceCommandClient interface {
	// GetCommand invokes device service's command API for issuing get(read) command
	GetCommand(ctx context.Context, baseUrl string, deviceName string, commandName string, queryParams string) (responses.EventResponse, errors.EdgeX)
	// SetCommand invokes device service's command API for issuing set(write) command
	SetCommand(ctx context.Context, baseUrl string, deviceName string, commandName string, queryParams string, settings map[string]string) (common.BaseResponse, errors.EdgeX)
}

DeviceServiceCommandClient defines the interface for interactions with the device command endpoints on the EdgeX Foundry device services.

type EventClient

type EventClient interface {
	// Add adds new event.
	Add(ctx context.Context, req requests.AddEventRequest) (common.BaseWithIdResponse, errors.EdgeX)
	// AllEvents returns all events sorted in descending order of created time.
	// The result can be limited in a certain range by specifying the offset and limit parameters.
	// offset: The number of items to skip before starting to collect the result set. Default is 0.
	// limit: The number of items to return. Specify -1 will return all remaining items after offset. The maximum will be the MaxResultCount as defined in the configuration of service. Default is 20.
	AllEvents(ctx context.Context, offset, limit int) (responses.MultiEventsResponse, errors.EdgeX)
	// EventCount returns a count of all of events currently stored in the database.
	EventCount(ctx context.Context) (common.CountResponse, errors.EdgeX)
	// EventCountByDeviceName returns a count of all of events currently stored in the database, sourced from the specified device.
	EventCountByDeviceName(ctx context.Context, name string) (common.CountResponse, errors.EdgeX)
	// EventsByDeviceName returns a portion of the entire events according to the device name, offset and limit parameters. Events are sorted in descending order of created time.
	// offset: The number of items to skip before starting to collect the result set. Default is 0.
	// limit: The number of items to return. Specify -1 will return all remaining items after offset. The maximum will be the MaxResultCount as defined in the configuration of service. Default is 20.
	EventsByDeviceName(ctx context.Context, name string, offset, limit int) (responses.MultiEventsResponse, errors.EdgeX)
	// DeleteByDeviceName deletes all events for the specified device.
	DeleteByDeviceName(ctx context.Context, name string) (common.BaseResponse, errors.EdgeX)
	// EventsByTimeRange returns events between a given start and end date/time. Events are sorted in descending order of created time.
	// start, end: Unix timestamp, indicating the date/time range.
	// offset: The number of items to skip before starting to collect the result set. Default is 0.
	// limit: The number of items to return. Specify -1 will return all remaining items after offset. The maximum will be the MaxResultCount as defined in the configuration of service. Default is 20.
	EventsByTimeRange(ctx context.Context, start, end, offset, limit int) (responses.MultiEventsResponse, errors.EdgeX)
	// DeleteByAge deletes events that are older than the given age. Age is supposed in milliseconds from created timestamp.
	DeleteByAge(ctx context.Context, age int) (common.BaseResponse, errors.EdgeX)
}

EventClient defines the interface for interactions with the Event endpoint on the EdgeX Foundry core-data service.

type ProvisionWatcherClient

type ProvisionWatcherClient interface {
	// Add adds a new provision watcher.
	Add(ctx context.Context, reqs []requests.AddProvisionWatcherRequest) ([]common.BaseWithIdResponse, errors.EdgeX)
	// Update updates provision watchers.
	Update(ctx context.Context, reqs []requests.UpdateProvisionWatcherRequest) ([]common.BaseResponse, errors.EdgeX)
	// AllProvisionWatchers returns all provision watchers. ProvisionWatchers can also be filtered by labels.
	// The result can be limited in a certain range by specifying the offset and limit parameters.
	// offset: The number of items to skip before starting to collect the result set. Default is 0.
	// limit: The number of items to return. Specify -1 will return all remaining items after offset. The maximum will be the MaxResultCount as defined in the configuration of service. Default is 20.
	AllProvisionWatchers(ctx context.Context, labels []string, offset int, limit int) (responses.MultiProvisionWatchersResponse, errors.EdgeX)
	// ProvisionWatcherByName returns a provision watcher by name.
	ProvisionWatcherByName(ctx context.Context, name string) (responses.ProvisionWatcherResponse, errors.EdgeX)
	// DeleteProvisionWatcherByName deletes a provision watcher by name.
	DeleteProvisionWatcherByName(ctx context.Context, name string) (common.BaseResponse, errors.EdgeX)
	// ProvisionWatchersByProfileName returns provision watchers associated with the specified device profile name.
	// The result can be limited in a certain range by specifying the offset and limit parameters.
	// offset: The number of items to skip before starting to collect the result set. Default is 0.
	// limit: The number of items to return. Specify -1 will return all remaining items after offset. The maximum will be the MaxResultCount as defined in the configuration of service. Default is 20.
	ProvisionWatchersByProfileName(ctx context.Context, name string, offset int, limit int) (responses.MultiProvisionWatchersResponse, errors.EdgeX)
	// ProvisionWatchersByServiceName returns provision watchers associated with the specified device service name.
	// The result can be limited in a certain range by specifying the offset and limit parameters.
	// offset: The number of items to skip before starting to collect the result set. Default is 0.
	// limit: The number of items to return. Specify -1 will return all remaining items after offset. The maximum will be the MaxResultCount as defined in the configuration of service. Default is 20.
	ProvisionWatchersByServiceName(ctx context.Context, name string, offset int, limit int) (responses.MultiProvisionWatchersResponse, errors.EdgeX)
}

ProvisionWatcherClient defines the interface for interactions with the ProvisionWatcher endpoint on the EdgeX Foundry core-metadata service.

type ReadingClient

type ReadingClient interface {
	// AllReadings returns all readings sorted in descending order of created time.
	// The result can be limited in a certain range by specifying the offset and limit parameters.
	// offset: The number of items to skip before starting to collect the result set. Default is 0.
	// limit: The number of items to return. Specify -1 will return all remaining items after offset. The maximum will be the MaxResultCount as defined in the configuration of service. Default is 20.
	AllReadings(ctx context.Context, offset, limit int) (responses.MultiReadingsResponse, errors.EdgeX)
	// ReadingCount returns a count of all of readings currently stored in the database.
	ReadingCount(ctx context.Context) (common.CountResponse, errors.EdgeX)
	// ReadingCountByDeviceName returns a count of all of readings currently stored in the database, sourced from the specified device.
	ReadingCountByDeviceName(ctx context.Context, name string) (common.CountResponse, errors.EdgeX)
	// ReadingsByDeviceName returns a portion of the entire readings according to the device name, offset and limit parameters. Readings are sorted in descending order of created time.
	// offset: The number of items to skip before starting to collect the result set. Default is 0.
	// limit: The number of items to return. Specify -1 will return all remaining items after offset. The maximum will be the MaxResultCount as defined in the configuration of service. Default is 20.
	ReadingsByDeviceName(ctx context.Context, name string, offset, limit int) (responses.MultiReadingsResponse, errors.EdgeX)
	// ReadingsByResourceName returns a portion of the entire readings according to the device resource name, offset and limit parameters. Readings are sorted in descending order of created time.
	// offset: The number of items to skip before starting to collect the result set. Default is 0.
	// limit: The number of items to return. Specify -1 will return all remaining items after offset. The maximum will be the MaxResultCount as defined in the configuration of service. Default is 20.
	ReadingsByResourceName(ctx context.Context, name string, offset, limit int) (responses.MultiReadingsResponse, errors.EdgeX)
	// ReadingsByTimeRange returns readings between a given start and end date/time. Readings are sorted in descending order of created time.
	// start, end: Unix timestamp, indicating the date/time range.
	// offset: The number of items to skip before starting to collect the result set. Default is 0.
	// limit: The number of items to return. Specify -1 will return all remaining items after offset. The maximum will be the MaxResultCount as defined in the configuration of service. Default is 20.
	ReadingsByTimeRange(ctx context.Context, start, end, offset, limit int) (responses.MultiReadingsResponse, errors.EdgeX)
}

ReadingClient defines the interface for interactions with the Reading endpoint on the EdgeX Foundry core-data service.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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