接口示例 /api/v1.tag_asset_mgr/getListByAssets : 获取某些资源所关联的所有标签
[root@frmstock frmtag]#[root@frmstock frmtag]# timestamp=`date +%s` ; authorization=`echo -n "d19638d0-ea32-11ed-8a52-000c2921ab31:$timestamp:/api/v1.tag_asset_mgr/getlistbyassets" | md5sum | cut -d " " -f 1`; curl -v -k "https://tag.frmstock.org.cn/index.php/api/v1.tag_asset_mgr/getListByAssets" -H "authorization: $authorization" -H "timestamp: $timestamp" -H "Cookie: PHPSESSID=3f8d519d4e6ac8da868a248a5801730b;" -X POST -d "aids[]=100001&aids[]=100002"* About to connect() to tag.frmstock.org.cn port 443 (#0)* Trying 106.14.219.145...* Connected to tag.frmstock.org.cn (106.14.219.145) port 443 (#0)> POST /index.php/api/v1.tag_asset_mgr/getListByAssets HTTP/1.1> User-Agent: curl/7.29.0> Host: tag.frmstock.org.cn> Accept: */*> authorization: f91a6b978625ae4d16cba15590469854> timestamp: 1683344196> Cookie: PHPSESSID=3f8d519d4e6ac8da868a248a5801730b;> Content-Length: 10> Content-Type: application/x-www-form-urlencoded>* upload completely sent off: 10 out of 10 bytes< HTTP/1.1 200 OK< Server: nginx/1.20.1< Date: Sat, 06 May 2023 03:36:36 GMT< Content-Type: text/html; charset=UTF-8< Transfer-Encoding: chunked< Connection: keep-alive< X-Powered-By: PHP/7.1.33< Expires: Thu, 19 Nov 1981 08:52:00 GMT< Cache-Control: no-store, no-cache, must-revalidate< Pragma: no-cache<{"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":"100002","asset_field":{"ip":"172.18.12.2","status":"0","belongto":"zl"},"tags":[{"tag":{"name":"project","id":"644770fe9dc6d63e2e57f8c4"}}]}]}}[root@frmstock frmtag]#[root@frmstock frmtag]# timestamp=`date +%s` ; authorization=`echo -n "d19638d0-ea32-11ed-8a52-000c2921ab31:$timestamp:/api/v1.tag_asset_mgr/getlistbyassets" | md5sum | cut -d " " -f 1`; curl -v -k "https://tag.frmstock.org.cn/index.php/api/v1.tag_asset_mgr/getListByAssets" -H "authorization: $authorization" -H "timestamp: $timestamp" -H "Cookie: PHPSESSID=3f8d519d4e6ac8da868a248a5801730b;" -X POST -d "filter_keys[]=status&filter_values[]=1"* About to connect() to tag.frmstock.org.cn port 443 (#0)* Trying 106.14.219.145...* Connected to tag.frmstock.org.cn (106.14.219.145) port 443 (#0)> POST /index.php/api/v1.tag_asset_mgr/getListByAssets HTTP/1.1> User-Agent: curl/7.29.0> Host: tag.frmstock.org.cn> Accept: */*> authorization: 329c632a293cea28c291f27fdda056dc> timestamp: 1683344123> Cookie: PHPSESSID=3f8d519d4e6ac8da868a248a5801730b;> Content-Length: 10> Content-Type: application/x-www-form-urlencoded>* upload completely sent off: 10 out of 10 bytes< HTTP/1.1 200 OK< Server: nginx/1.20.1< Date: Sat, 06 May 2023 03:35:23 GMT< Content-Type: text/html; charset=UTF-8< Transfer-Encoding: chunked< Connection: keep-alive< X-Powered-By: PHP/7.1.33< Expires: Thu, 19 Nov 1981 08:52:00 GMT< Cache-Control: no-store, no-cache, must-revalidate< Pragma: no-cache<{"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"}}]}]}}[root@frmstock frmtag]#