v2

package
v1.4.4 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EdgeXObjectName     = "yurt-iot-dock/edgex-object.name"
	DeviceServicePath   = "/api/v2/deviceservice"
	DeviceProfilePath   = "/api/v2/deviceprofile"
	DevicePath          = "/api/v2/device"
	CommandResponsePath = "/api/v2/device"

	APIVersionV2 = "v2"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientURL

type ClientURL struct {
	Host string
	Port int
}

type EdgexDeviceClient

type EdgexDeviceClient struct {
	*resty.Client
	CoreMetaAddr    string
	CoreCommandAddr string
}

func NewEdgexDeviceClient

func NewEdgexDeviceClient(coreMetaAddr, coreCommandAddr string) *EdgexDeviceClient

func (*EdgexDeviceClient) Create

Create function sends a POST request to EdgeX to add a new device

func (*EdgexDeviceClient) Delete

func (efc *EdgexDeviceClient) Delete(ctx context.Context, name string, options clients.DeleteOptions) error

Delete function sends a request to EdgeX to delete a device

func (*EdgexDeviceClient) Get

func (efc *EdgexDeviceClient) Get(ctx context.Context, deviceName string, options clients.GetOptions) (*iotv1alpha1.Device, error)

Get is used to query the device information corresponding to the device name

func (*EdgexDeviceClient) GetCommandResponseByName

func (efc *EdgexDeviceClient) GetCommandResponseByName(deviceName string) ([]dtos.CoreCommand, error)

GetCommandResponseByName gets all commands supported by the device

func (*EdgexDeviceClient) GetPropertyState

func (efc *EdgexDeviceClient) GetPropertyState(ctx context.Context, propertyName string, d *iotv1alpha1.Device, options clients.GetOptions) (*iotv1alpha1.ActualPropertyState, error)

func (*EdgexDeviceClient) List

List is used to get all device objects on edge platform TODO:support label filtering according to options

func (*EdgexDeviceClient) ListPropertiesState

ListPropertiesState gets all the actual property information about a device

func (*EdgexDeviceClient) Update

Update is used to set the admin or operating state of the device by unique name of the device. TODO support to update other fields

func (*EdgexDeviceClient) UpdatePropertyState

func (efc *EdgexDeviceClient) UpdatePropertyState(ctx context.Context, propertyName string, d *iotv1alpha1.Device, options clients.UpdateOptions) error

type EdgexDeviceProfile

type EdgexDeviceProfile struct {
	*resty.Client
	CoreMetaAddr string
}

func NewEdgexDeviceProfile

func NewEdgexDeviceProfile(coreMetaAddr string) *EdgexDeviceProfile

func (*EdgexDeviceProfile) Create

func (*EdgexDeviceProfile) Delete

func (cdc *EdgexDeviceProfile) Delete(ctx context.Context, name string, opts devcli.DeleteOptions) error

func (*EdgexDeviceProfile) Get

func (*EdgexDeviceProfile) List

func (*EdgexDeviceProfile) Update

TODO: edgex does not support update DeviceProfile

type EdgexDeviceServiceClient

type EdgexDeviceServiceClient struct {
	*resty.Client
	CoreMetaAddr string
}

func NewEdgexDeviceServiceClient

func NewEdgexDeviceServiceClient(coreMetaAddr string) *EdgexDeviceServiceClient

func (*EdgexDeviceServiceClient) Create

Create function sends a POST request to EdgeX to add a new deviceService

func (*EdgexDeviceServiceClient) Delete

func (eds *EdgexDeviceServiceClient) Delete(ctx context.Context, name string, option edgeCli.DeleteOptions) error

Delete function sends a request to EdgeX to delete a deviceService

func (*EdgexDeviceServiceClient) Get

Get is used to query the deviceService information corresponding to the deviceService name

func (*EdgexDeviceServiceClient) List

List is used to get all deviceService objects on edge platform The Hanoi version currently supports only a single label and does not support other filters

func (*EdgexDeviceServiceClient) Update

Update is used to set the admin or operating state of the deviceService by unique name of the deviceService. TODO support to update other fields

Jump to

Keyboard shortcuts

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