Documentation
¶
Index ¶
- Constants
- type ClientURL
- type EdgexDeviceClient
- func (cdc *EdgexDeviceClient) Convert(ctx context.Context, systemEvent dtos.SystemEvent, opts devcli.GetOptions) (*v1alpha1.Device, error)
- func (efc *EdgexDeviceClient) Create(ctx context.Context, device *iotv1alpha1.Device, options clients.CreateOptions) (*iotv1alpha1.Device, error)
- func (efc *EdgexDeviceClient) Delete(ctx context.Context, name string, options clients.DeleteOptions) error
- func (efc *EdgexDeviceClient) Get(ctx context.Context, deviceName string, options clients.GetOptions) (*iotv1alpha1.Device, error)
- func (efc *EdgexDeviceClient) GetCommandResponseByName(deviceName string) ([]dtos.CoreCommand, error)
- func (efc *EdgexDeviceClient) GetPropertyState(ctx context.Context, propertyName string, d *iotv1alpha1.Device, ...) (*iotv1alpha1.ActualPropertyState, error)
- func (efc *EdgexDeviceClient) List(ctx context.Context, options clients.ListOptions) ([]iotv1alpha1.Device, error)
- func (efc *EdgexDeviceClient) ListPropertiesState(ctx context.Context, device *iotv1alpha1.Device, options clients.ListOptions) (map[string]iotv1alpha1.DesiredPropertyState, ...)
- func (efc *EdgexDeviceClient) Update(ctx context.Context, device *iotv1alpha1.Device, options clients.UpdateOptions) (*iotv1alpha1.Device, error)
- func (efc *EdgexDeviceClient) UpdatePropertyState(ctx context.Context, propertyName string, d *iotv1alpha1.Device, ...) error
- type EdgexDeviceProfile
- func (cdc *EdgexDeviceProfile) Convert(ctx context.Context, systemEvent dtos.SystemEvent, opts devcli.GetOptions) (*v1alpha1.DeviceProfile, error)
- func (cdc *EdgexDeviceProfile) Create(ctx context.Context, deviceProfile *v1alpha1.DeviceProfile, ...) (*v1alpha1.DeviceProfile, error)
- func (cdc *EdgexDeviceProfile) Delete(ctx context.Context, name string, opts devcli.DeleteOptions) error
- func (cdc *EdgexDeviceProfile) Get(ctx context.Context, name string, opts devcli.GetOptions) (*v1alpha1.DeviceProfile, error)
- func (cdc *EdgexDeviceProfile) List(ctx context.Context, opts devcli.ListOptions) ([]v1alpha1.DeviceProfile, error)
- func (cdc *EdgexDeviceProfile) Update(ctx context.Context, deviceProfile *v1alpha1.DeviceProfile, ...) (*v1alpha1.DeviceProfile, error)
- type EdgexDeviceServiceClient
- func (cdc *EdgexDeviceServiceClient) Convert(ctx context.Context, systemEvent dtos.SystemEvent, opts devcli.GetOptions) (*v1alpha1.DeviceService, error)
- func (eds *EdgexDeviceServiceClient) Create(ctx context.Context, deviceService *v1alpha1.DeviceService, ...) (*v1alpha1.DeviceService, error)
- func (eds *EdgexDeviceServiceClient) Delete(ctx context.Context, name string, option edgeCli.DeleteOptions) error
- func (eds *EdgexDeviceServiceClient) Get(ctx context.Context, name string, options edgeCli.GetOptions) (*v1alpha1.DeviceService, error)
- func (eds *EdgexDeviceServiceClient) List(ctx context.Context, options edgeCli.ListOptions) ([]v1alpha1.DeviceService, error)
- func (eds *EdgexDeviceServiceClient) Update(ctx context.Context, ds *v1alpha1.DeviceService, options edgeCli.UpdateOptions) (*v1alpha1.DeviceService, error)
Constants ¶
const ( EdgeXObjectName = "yurt-iot-dock/edgex-object.name" DeviceServicePath = "/api/v3/deviceservice" DeviceProfilePath = "/api/v3/deviceprofile" DevicePath = "/api/v3/device" CommandResponsePath = "/api/v3/device" APIVersionV3 = "v3" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EdgexDeviceClient ¶
func NewEdgexDeviceClient ¶
func NewEdgexDeviceClient(coreMetaAddr, coreCommandAddr string) *EdgexDeviceClient
func (*EdgexDeviceClient) Convert ¶
func (cdc *EdgexDeviceClient) Convert(ctx context.Context, systemEvent dtos.SystemEvent, opts devcli.GetOptions) (*v1alpha1.Device, error)
Convert is used to convert the device information in the systemEvent of messageBus to the device object in the kubernetes cluster
func (*EdgexDeviceClient) Create ¶
func (efc *EdgexDeviceClient) Create(ctx context.Context, device *iotv1alpha1.Device, options clients.CreateOptions) (*iotv1alpha1.Device, error)
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 ¶
func (efc *EdgexDeviceClient) List(ctx context.Context, options clients.ListOptions) ([]iotv1alpha1.Device, error)
List is used to get all device objects on edge platform TODO:support label filtering according to options
func (*EdgexDeviceClient) ListPropertiesState ¶
func (efc *EdgexDeviceClient) ListPropertiesState(ctx context.Context, device *iotv1alpha1.Device, options clients.ListOptions) (map[string]iotv1alpha1.DesiredPropertyState, map[string]iotv1alpha1.ActualPropertyState, error)
ListPropertiesState gets all the actual property information about a device
func (*EdgexDeviceClient) Update ¶
func (efc *EdgexDeviceClient) Update(ctx context.Context, device *iotv1alpha1.Device, options clients.UpdateOptions) (*iotv1alpha1.Device, error)
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) Convert ¶
func (cdc *EdgexDeviceProfile) Convert(ctx context.Context, systemEvent dtos.SystemEvent, opts devcli.GetOptions) (*v1alpha1.DeviceProfile, error)
Convert is used to convert the device profile information in the systemEvent of messageBus to the device profile object in the kubernetes cluster
func (*EdgexDeviceProfile) Create ¶
func (cdc *EdgexDeviceProfile) Create(ctx context.Context, deviceProfile *v1alpha1.DeviceProfile, opts devcli.CreateOptions) (*v1alpha1.DeviceProfile, error)
func (*EdgexDeviceProfile) Delete ¶
func (cdc *EdgexDeviceProfile) Delete(ctx context.Context, name string, opts devcli.DeleteOptions) error
func (*EdgexDeviceProfile) Get ¶
func (cdc *EdgexDeviceProfile) Get(ctx context.Context, name string, opts devcli.GetOptions) (*v1alpha1.DeviceProfile, error)
func (*EdgexDeviceProfile) List ¶
func (cdc *EdgexDeviceProfile) List(ctx context.Context, opts devcli.ListOptions) ([]v1alpha1.DeviceProfile, error)
func (*EdgexDeviceProfile) Update ¶
func (cdc *EdgexDeviceProfile) Update(ctx context.Context, deviceProfile *v1alpha1.DeviceProfile, opts devcli.UpdateOptions) (*v1alpha1.DeviceProfile, error)
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) Convert ¶
func (cdc *EdgexDeviceServiceClient) Convert(ctx context.Context, systemEvent dtos.SystemEvent, opts devcli.GetOptions) (*v1alpha1.DeviceService, error)
Convert is used to convert the device service information in the systemEvent of messageBus to the device service object in the kubernetes cluster
func (*EdgexDeviceServiceClient) Create ¶
func (eds *EdgexDeviceServiceClient) Create(ctx context.Context, deviceService *v1alpha1.DeviceService, options edgeCli.CreateOptions) (*v1alpha1.DeviceService, error)
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 ¶
func (eds *EdgexDeviceServiceClient) Get(ctx context.Context, name string, options edgeCli.GetOptions) (*v1alpha1.DeviceService, error)
Get is used to query the deviceService information corresponding to the deviceService name
func (*EdgexDeviceServiceClient) List ¶
func (eds *EdgexDeviceServiceClient) List(ctx context.Context, options edgeCli.ListOptions) ([]v1alpha1.DeviceService, error)
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 ¶
func (eds *EdgexDeviceServiceClient) Update(ctx context.Context, ds *v1alpha1.DeviceService, options edgeCli.UpdateOptions) (*v1alpha1.DeviceService, error)
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