dev.azure.com/aidainnovazione0090/DeviceManager/_git/go-mod-core-contracts@v1.0.2/clients/interfaces/deviceprofile.go (about) 1 // 2 // Copyright (C) 2020-2022 IOTech Ltd 3 // 4 // SPDX-License-Identifier: Apache-2.0 5 6 package interfaces 7 8 import ( 9 "context" 10 11 "dev.azure.com/aidainnovazione0090/DeviceManager/_git/go-mod-core-contracts/dtos/common" 12 "dev.azure.com/aidainnovazione0090/DeviceManager/_git/go-mod-core-contracts/dtos/requests" 13 "dev.azure.com/aidainnovazione0090/DeviceManager/_git/go-mod-core-contracts/dtos/responses" 14 "dev.azure.com/aidainnovazione0090/DeviceManager/_git/go-mod-core-contracts/errors" 15 ) 16 17 // DeviceProfileClient defines the interface for interactions with the DeviceProfile endpoint on the EdgeX Foundry core-metadata service. 18 type DeviceProfileClient interface { 19 // Add adds new profiles 20 Add(ctx context.Context, reqs []requests.DeviceProfileRequest) ([]common.BaseWithIdResponse, errors.EdgeX) 21 // Update updates profiles 22 Update(ctx context.Context, reqs []requests.DeviceProfileRequest) ([]common.BaseResponse, errors.EdgeX) 23 // AddByYaml adds new profile by uploading a file in YAML format 24 AddByYaml(ctx context.Context, yamlFilePath string) (common.BaseWithIdResponse, errors.EdgeX) 25 // UpdateByYaml updates profile by uploading a file in YAML format 26 UpdateByYaml(ctx context.Context, yamlFilePath string) (common.BaseResponse, errors.EdgeX) 27 // DeleteByName deletes profile by name 28 DeleteByName(ctx context.Context, name string) (common.BaseResponse, errors.EdgeX) 29 // DeviceProfileByName queries profile by name 30 DeviceProfileByName(ctx context.Context, name string) (responses.DeviceProfileResponse, errors.EdgeX) 31 // AllDeviceProfiles queries all profiles 32 AllDeviceProfiles(ctx context.Context, labels []string, offset int, limit int) (responses.MultiDeviceProfilesResponse, errors.EdgeX) 33 // DeviceProfilesByModel queries profiles by model 34 DeviceProfilesByModel(ctx context.Context, model string, offset int, limit int) (responses.MultiDeviceProfilesResponse, errors.EdgeX) 35 // DeviceProfilesByManufacturer queries profiles by manufacturer 36 DeviceProfilesByManufacturer(ctx context.Context, manufacturer string, offset int, limit int) (responses.MultiDeviceProfilesResponse, errors.EdgeX) 37 // DeviceProfilesByManufacturerAndModel queries profiles by manufacturer and model 38 DeviceProfilesByManufacturerAndModel(ctx context.Context, manufacturer string, model string, offset int, limit int) (responses.MultiDeviceProfilesResponse, errors.EdgeX) 39 // DeviceResourceByProfileNameAndResourceName queries the device resource by profileName and resourceName 40 DeviceResourceByProfileNameAndResourceName(ctx context.Context, profileName string, resourceName string) (responses.DeviceResourceResponse, errors.EdgeX) 41 // UpdateDeviceProfileBasicInfo updates existing profile's basic info 42 UpdateDeviceProfileBasicInfo(ctx context.Context, reqs []requests.DeviceProfileBasicInfoRequest) ([]common.BaseResponse, errors.EdgeX) 43 // AddDeviceProfileResource adds new device resource to an existing profile 44 AddDeviceProfileResource(ctx context.Context, reqs []requests.AddDeviceResourceRequest) ([]common.BaseResponse, errors.EdgeX) 45 // UpdateDeviceProfileResource updates existing device resource 46 UpdateDeviceProfileResource(ctx context.Context, reqs []requests.UpdateDeviceResourceRequest) ([]common.BaseResponse, errors.EdgeX) 47 // DeleteDeviceResourceByName deletes device resource by name 48 DeleteDeviceResourceByName(ctx context.Context, profileName string, resourceName string) (common.BaseResponse, errors.EdgeX) 49 // AddDeviceProfileDeviceCommand adds new device command to an existing profile 50 AddDeviceProfileDeviceCommand(ctx context.Context, reqs []requests.AddDeviceCommandRequest) ([]common.BaseResponse, errors.EdgeX) 51 // UpdateDeviceProfileDeviceCommand updates existing device command 52 UpdateDeviceProfileDeviceCommand(ctx context.Context, reqs []requests.UpdateDeviceCommandRequest) ([]common.BaseResponse, errors.EdgeX) 53 // DeleteDeviceCommandByName deletes device command by name 54 DeleteDeviceCommandByName(ctx context.Context, profileName string, commandName string) (common.BaseResponse, errors.EdgeX) 55 // GetDeviceProfilesModelList gets list of all distinct models inserted 56 GetDeviceProfilesModelList(ctx context.Context) (responses.DeviceProfileListResponse, errors.EdgeX) 57 // GetDeviceProfilesManufacturerList gets list of all distinct manufacturers inserted 58 GetDeviceProfilesManufacturerList(ctx context.Context) (responses.DeviceProfileListResponse, errors.EdgeX) 59 // GetDeviceProfilesNameList gets list of all distinct names inserted 60 GetDeviceProfilesNameList(ctx context.Context) (responses.DeviceProfileListResponse, errors.EdgeX) 61 }