接口示例 /api/v1.tag_asset_mgr/getListByAsset : 获取某一资源所关联的所有标签

 

  1. [root@frmstock frmtag]#
  2. [root@frmstock frmtag]# timestamp=`date +%s` ; authorization=`echo -n "d19638d0-ea32-11ed-8a52-000c2921ab31:$timestamp:/api/v1.tag_asset_mgr/getlistbyasset" | md5sum | cut -d " " -f 1`; curl -v -k "https://tag.frmstock.org.cn/index.php/api/v1.tag_asset_mgr/getListByAsset" -H "authorization: $authorization" -H "timestamp: $timestamp" -H "Cookie: PHPSESSID=3f8d519d4e6ac8da868a248a5801730b;" -X POST -d "aid=100001"
  3. * About to connect() to tag.frmstock.org.cn port 443 (#0)
  4. * Trying 106.14.219.145...
  5. * Connected to tag.frmstock.org.cn (106.14.219.145) port 443 (#0)
  6. > POST /index.php/api/v1.tag_asset_mgr/getListByAsset HTTP/1.1
  7. > User-Agent: curl/7.29.0
  8. > Host: tag.frmstock.org.cn
  9. > Accept: */*
  10. > authorization: d2d2b9faff9dc3a5cd1781c23a087f2f
  11. > timestamp: 1683343158
  12. > Cookie: PHPSESSID=3f8d519d4e6ac8da868a248a5801730b;
  13. > Content-Length: 10
  14. > Content-Type: application/x-www-form-urlencoded
  15. >
  16. * upload completely sent off: 10 out of 10 bytes
  17. < HTTP/1.1 200 OK
  18. < Server: nginx/1.20.1
  19. < Date: Sat, 06 May 2023 03:19:18 GMT
  20. < Content-Type: text/html; charset=UTF-8
  21. < Transfer-Encoding: chunked
  22. < Connection: keep-alive
  23. < X-Powered-By: PHP/7.1.33
  24. < Expires: Thu, 19 Nov 1981 08:52:00 GMT
  25. < Cache-Control: no-store, no-cache, must-revalidate
  26. < Pragma: no-cache
  27. <
  28. {"status":0,"message":"","data":{"total":1,"list":[{"asset_id":"100001","asset_field":{"ip":"172.18.12.1","status":"1","belongto":"zxt"},"tags":[{"tag":{"name":"deps","id":"643f57812258336a0fe3b590"}},{"tag":{"name":"product","id":"64476d29c9780000c7003a61"}}]}]}}
  29. [root@frmstock frmtag]#
  30. [root@frmstock frmtag]# timestamp=`date +%s` ; authorization=`echo -n "d19638d0-ea32-11ed-8a52-000c2921ab31:$timestamp:/api/v1.tag_asset_mgr/getlistbyasset" | md5sum | cut -d " " -f 1`; curl -v -k "https://tag.frmstock.org.cn/index.php/api/v1.tag_asset_mgr/getListByAsset" -H "authorization: $authorization" -H "timestamp: $timestamp" -H "Cookie: PHPSESSID=3f8d519d4e6ac8da868a248a5801730b;" -X POST -d "filter_keys[]=status&filter_values[]=1"
  31. * About to connect() to tag.frmstock.org.cn port 443 (#0)
  32. * Trying 106.14.219.145...
  33. * Connected to tag.frmstock.org.cn (106.14.219.145) port 443 (#0)
  34. > POST /index.php/api/v1.tag_asset_mgr/getListByAsset HTTP/1.1
  35. > User-Agent: curl/7.29.0
  36. > Host: tag.frmstock.org.cn
  37. > Accept: */*
  38. > authorization: 264f29e0f051b8f9cde5969a9913fec2
  39. > timestamp: 1683343504
  40. > Cookie: PHPSESSID=3f8d519d4e6ac8da868a248a5801730b;
  41. > Content-Length: 10
  42. > Content-Type: application/x-www-form-urlencoded
  43. >
  44. * upload completely sent off: 10 out of 10 bytes
  45. < HTTP/1.1 200 OK
  46. < Server: nginx/1.20.1
  47. < Date: Sat, 06 May 2023 03:25:04 GMT
  48. < Content-Type: text/html; charset=UTF-8
  49. < Transfer-Encoding: chunked
  50. < Connection: keep-alive
  51. < X-Powered-By: PHP/7.1.33
  52. < Expires: Thu, 19 Nov 1981 08:52:00 GMT
  53. < Cache-Control: no-store, no-cache, must-revalidate
  54. < Pragma: no-cache
  55. <
  56. {"status":0,"message":"","data":{"offset":0,"size":10,"total":2,"list":[{"asset_id":"100001","asset_field":{"ip":"172.18.12.1","status":"1","belongto":"zxt"},"tags":[{"tag":{"name":"deps","id":"643f57812258336a0fe3b590"}},{"tag":{"name":"product","id":"64476d29c9780000c7003a61"}}]},{"asset_id":"100003","asset_field":{"ip":"172.18.12.3","status":"1","belongto":"sdf"},"tags":[{"tag":{"name":"deps","id":"643f57812258336a0fe3b590"}}]}]}}
  57. [root@frmstock frmtag]#