levtol
August 22, 2024, 3:37pm
1
Hello everyone.
I’m trying to remove Associated target, but it gives me error message
root@truenas[/home/admin]# curl -X ‘DELETE’ ‘http://10.0.0.1/api/v2.0/iscsi/targetextent/id/163 ’ -H ‘accept: application/json’ -H ‘Content-Type: application/json’ -H “Authorization: Bearer ${AUTH_BEARER}”
{
“message”: “Associated target iqn.2005-10.org.freenas.ctl:3dc5x3-target-intel-ssd-games-common is in use.”,
“errno”: 14
}#
On the other hand, if I do it via GUI, Sharing → Associated Targets → Bin button next to Associated target, it delete Associated target i need to delete.
How can I “force” Associated target deleting through API?
levtol
August 31, 2024, 1:46pm
2
Up
Same error with target deletion
root@truenas[/home/admin]# curl -X 'DELETE' 'http://10.0.0.1/api/v2.0/iscsi/target/id/54' -H 'accept: application/json' -H 'Content-Type: application/json' -H "Authorization: Bearer ${AUTH_BEARER}" -d '{"force": "true"}'
{
"force": [
{
"message": "Not a boolean",
"errno": 22
}
]
}# root@truenas[/home/admin]#
root@truenas[/home/admin]#
root@truenas[/home/admin]# curl -X 'DELETE' 'http://10.0.0.1/api/v2.0/iscsi/target/id/54' -H 'accept: application/json' -H 'Content-Type: application/json' -H "Authorization: Bearer ${AUTH_BEARER}" -d '{"force": true}'
{
"force": [
{
"message": "Not a boolean",
"errno": 22
}
]
}# root@truenas[/home/admin]# curl -X 'DELETE' 'http://10.0.0.1/api/v2.0/iscsi/target/id/54' -H 'accept: application/json' -H 'Content-Type: application/json' -H "Authorization: Bearer ${AUTH_BEARER}" -d '{"force": 1}'
{
"force": [
{
"message": "Not a boolean",
"errno": 22
}
]
}# root@truenas[/home/admin]#
root@truenas[/home/admin]#
root@truenas[/home/admin]#
root@truenas[/home/admin]#
root@truenas[/home/admin]# curl -X 'DELETE' 'http://10.0.0.1/api/v2.0/iscsi/target/id/54?force=true' -H 'accept: application/json' -H 'Content-Type: application/json' -H "Authorization: Bearer ${AUTH_BEARER}"
{
"message": "Target mn56-target-intel-ssd-games-online is in use.",
"errno": 14
}#