SAN Initiators
The following commands are used to manage SAN initiators.
These commands use the following URI parameters:
- protocol
-
NAS protocol for the initiator:
fc
,iscsi
, orsrp
- initiator
-
IQN, WWN, or EUI of the initiator
Table 11-1 Initiator Commands
Request | Append to Path /san/v{1|2} | Description |
---|---|---|
GET |
/protocol/initiators |
List all SAN initiators for the given protocol: |
GET |
/protocol/initiators/initiator |
Get the specified SAN initiator for the given protocol: |
POST |
/protocol/initiators |
Create a new SAN initiator for the given protocol: |
PUT |
/protocol/initiators/initiator |
Modify the specified SAN initiator for the given protocol: |
DELETE |
/protocol/initiators/initiator |
Destroy the specified initiator object |
Many of the initiator commands use the properties listed in the following table as return values. The create and modify commands also use the properties as input values.
Table 11-2 Initiator Properties
Property | Protocol | Description |
---|---|---|
|
all |
Alias for this initiator |
|
|
Port world wide name for this initiator (WWN) |
|
|
iSCSI qualified name for this initiator |
|
|
Challenge handshake |
|
|
Challenge handshake |
|
|
Extended Unique Identifier (EUI) |
List Initiators
Lists all of the initiators configured on the appliance of a specified protocol type. The response body contains an array of initiator properties named "initiators" in JSON format.
Example Request to List iSCSI Initiators:
GET /api/san/v1/iscsi/initiators HTTP/1.1 Host: zfs-storage.example.com:215 Accept: application/json
Example Result:
HTTP/1.1 200 OK Content-Type: application/json { "initiators": [{ "alias": "init-02", "href": "/api/san/v1/iscsi/initiators/iqn.zfs-storage.example.com.sun:02:02", "initiator": "iqn.zfs-storage.example.com.sun:02:02", "chapsecret": "", "chapuser": "" },{ "alias": "init-01", "initiator": "iqn.zfs-storage.example.com.sun:02:01", "href": "/api/san/v1/iscsi/initiators/iqn.zfs-storage.example.com.sun:02:01", "chapsecret": "", "chapuser": "" }] }
Get Initiator Details
Lists the details of a single iSCSI initiator. The response body contains iSCSI initiator properties as an object named "initiator" in JSON format.
Example Request:
GET /api/san/v1/iscsi/initiators/iqn.zfs-storage.example.com.sun:02:01 HTTP/1.1 Host: zfs-storage.example.com:215 Accept: application/json
Example Result:
HTTP/1.1 200 OK Content-Type: application/json { "initiator": { "alias": "init-01", "href": "/api/san/v1/iscsi/initiators/iqn.zfs-storage.example.com.sun:02:01" "initiator": "iqn.zfs-storage.example.com.sun:02:01", "chapsecret": "", "chapuser": "" } }
Create an Initiator
Creates a new iSCSI initiator. You must supply the iSCSI Qualified Name (IQN). The request body contains the iSCSI initiator properties in JSON format. The response includes the location URI of the new iSCSI initiator in the HTTP header and status Code 201 (Created) on success. The response body contains iSCSI initiator properties as an object named "initiator" in JSON format.
Example Request:
POST /api/san/v1.0/iscsi/initiators HTTP/1.1 Host: zfs-storage.example.com:215 Content-Type: application/json Accept: application/json { "initiator": "iqn.zfs-storage.example.com.sun:02:02", "alias":"init-02" }
Example Result:
HTTP/1.1 201 Created Content-Type: application/json Content-Length: 181 X-Zfssa-San-Api: 1.0 Location: /api/san/v1/iscsi/initiators/iqn.zfs-storage.example.com.sun:02:02 { "initiator": { "alias": "init-02", "href": "/api/san/v1/iscsi/initiators/iqn.zfs-storage.example.com.sun:02:02", "initiator": "iqn.zfs-storage.example.com.sun:02:02", "chapsecret": "", "chapuser": "" } }
Modify an Initiator
This command modifies an existing initiator. The request body contains the initiator properties that should be modified in JSON format. The IQN for the initiator is supplied in the URI. HTTP status 202 (Accepted) is returned on success. The response body contains new iSCSI initiator properties as an object named initiator
in JSON format.
Example Request:
PUT /api/san/v1/iscsi/initiators/iqn.zfs-storage.example.com.sun:01 HTTP/1.1
Host: zfs-storage.example.com:215
Content-Type: application/json
Accept: application/json
{
"alias":"init-01-secure",
"chapuser":"admin4",
"chapsecret":"secret"
}
Example Result:
HTTP/1.1 202 Accepted
Content-Length: 167
Content-Type: application/json
X-Zfs-Sa-Nas-Api: 1.0
{
"initiator": {
"alias": "init-01-secure",
"href": "/api/san/v1/iscsi/initiators/iqn.zfs-storage.example.com.sun:01",
"iqn": "iqn.zfs-storage.example.com.sun:1",
"chapsecret": "secret",
"chapuser": "admin4"
}
}