Fixing GetRecords

This commit is contained in:
stephb9959
2021-08-24 07:02:25 -07:00
parent db05ffb531
commit bd36f08b4c
2 changed files with 10 additions and 1 deletions

View File

@@ -419,7 +419,7 @@ namespace ORM {
ComputeRange(Offset, HowMany) ; ComputeRange(Offset, HowMany) ;
std::string St2 = Where.empty() ? ConvertParams(St) : (ConvertParams(St) + " where " + Where) ; std::string St2 = Where.empty() ? ConvertParams(St) : (ConvertParams(St) + " where " + Where) ;
// std::cout << "GetRecords: " << St2 << std::endl; std::cout << "GetRecords: " << St2 << std::endl;
Select << St2 , Select << St2 ,
Poco::Data::Keywords::into(RL); Poco::Data::Keywords::into(RL);

View File

@@ -147,6 +147,14 @@ getentities() {
jq < ${result_file} jq < ${result_file}
} }
gettag() {
curl ${FLAGS} "https://${OWPROV}/api/v1/inventory?entity=$1" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${token}" \
-H "accept: application/json" > ${result_file}
jq < ${result_file}
}
addtag() { addtag() {
payload="{ \"name\" : \"$1\",\"entity\" : \"$2\", \"serialNumber\" : \"$1\", \"deviceType\" : \"linksys_ea8300\" }"; payload="{ \"name\" : \"$1\",\"entity\" : \"$2\", \"serialNumber\" : \"$1\", \"deviceType\" : \"linksys_ea8300\" }";
curl ${FLAGS} -X POST "https://${OWPROV}/api/v1/inventory/1" \ curl ${FLAGS} -X POST "https://${OWPROV}/api/v1/inventory/1" \
@@ -214,6 +222,7 @@ case "$1" in
"addtag") login; addtag $2 $3; logout;; "addtag") login; addtag $2 $3; logout;;
"getentities") login; getentities ; logout;; "getentities") login; getentities ; logout;;
"gettags") login; gettags ; logout;; "gettags") login; gettags ; logout;;
"gettag") login; gettag $2 ; logout;;
"tagcount") login; tagcount ; logout;; "tagcount") login; tagcount ; logout;;
"entitycount") login; entitycount ; logout;; "entitycount") login; entitycount ; logout;;
"venuecount") login; venuecount ; logout;; "venuecount") login; venuecount ; logout;;