Create an iSCSI target
Creates an iSCSI target.
HTTP request syntax (URI)
POST <base_URI>/v8/storage/iscsi-targets/
Parameters
Name | Type | Required | Values | Description |
secret | BODY | Y | string | iSCSI secret. |
comment | BODY | Y | string | Comment at iSCSI creation. |
iSCSIName | BODY | Y | string | Name of the iSCSI target. |
accessConfig | BODY | Y | string | Access configuration. |
enableAuthentication | BODY | Y | boolean | Enable authentication flag. |
iSCSIlogicalUnit | BODY | N | array | Array of iSCSILogicalUnitId values. Note that failure to add the logical units to the target will not stop creation of the iSCSI target. |
virtualServerId | BODY | Y | number | Specifies either the virtual server object ID or the HNAS storage virtual server ID. |
Return codes
Code | Data | Description |
201 | iscsi | iSCSI target object created successfully |
400 | Error Message | Missing or invalid request contents. |
403 | Error Message | Operation forbidden by access level. |
404 | Error Message | Requested resource not found. |
500 | Error message | Error associated with the storage system. |
Any HTTP status code other than 201 indicates that the API did not complete successfully.
NoteThe underlying virtual server should have an iSCSI domain name assigned to create an iSCSI Target.
Request example
curl -vk -H "X-Api-Key: zrxvSDAv9x.RIP4gkmKarG3beF.or.4Tc2im7oeqYN88C9XPGHxbXC" https://172.17.58.119:8444/v8/storage/iscsi-targets -d'{"secret":"HitachiHitachi", "comment":"IscsiTargetCreate2","iSCSIName":"xyz-iscsi-test-5", "accessConfig":"","enableAuthentication":true, "iSCSIlogicalUnit":[], "virtualServerId":8}' -X POST
Response example
HTTP/1.1 201 Created { "iSCSITarget": { "accessConfig": "", "comment": "IscsiTargetCreate2", "globalUniqueName": "iqn.2016-09.xyzdo1875:xyzvs4014.xyzis6554", "iSCSIId": "xyz-iscsi-test-5", "iSCSIlogicalUnit": [], "objectId": "31323a3a3a6d6574726f495336353534", "isAuthenticationEnabled": true, "isRegenerateGUN": false, "secret": "HitachiHitachi", "virtualServerId": 8 }, "uri": "https://172.17.57.178:8444/v8/storage/iscsi-targets/31323a3a3a6d6574726f495336353534" }