创建iSCSI target 本节主要介绍如何使用API创建iSCSI target。 此操作用来创建iSCSI Target。 说明 HBlock上target IQN的数量最多32766个。一个target最多可以关联256个卷,但是一个卷只能被一个target关联。 请求语法 单机版 plaintext POST /rest/v1/block/target HTTP/1.1 Date: date ContentType: application/json; charsetutf8 ContentLength: length Host: ip:port Authorization: authorization { "targetName": targetName, "maxSessions": value, "reclaimPolicy": reclaimPolicy, "chap":{ "name": name, "password": password, "status": status }, "allowlist": { "initiator": [ { "IPs": [ip,ip,...], "names": [name,name,...] }, { "IPs": [ip,ip,...], "names": [name,name,...] }, ...... ], "target": [ { "IPs": [ip,ip,...], "NICs": [NIC,NIC,...] }, { "IPs": [ip,ip,...], "NICs": [NIC,NIC,...] }, ...... ] } } 集群版 plaintext POST /rest/v1/block/target HTTP/1.1 Date: date ContentType: application/json; charsetutf8 ContentLength: length Host: ip:port Authorization: authorization { "targetName": targetName, "maxSessions": value, "reclaimPolicy": reclaimPolicy, "chap":{ "name": name, "password": password, "status": status }, "serverNumbers": value, "server":["serverID",…], "allowlist": { "initiator": [ { "IPs": [ip,ip,...], "names": [name,name,...] }, { "IPs": [ip,ip,...], "names": [name,name,...] }, ...... ], "target": [ { "IPs": [ip,ip,...], "NICs": [NIC,NIC,...] }, { "IPs": [ip,ip,...], "NICs": [NIC,NIC,...] }, ...... ] } }