Target Groups
Target groups are collections of targets. The target groups commands are listed in the following table.
The target groups commands take the following URI parameters:
Table 11-8 Target Groups Commands
| Request | Append to Path /san/v{1|2} | Description |
|---|---|---|
|
GET |
/protocol/target-groups |
List all SAN target group for the given protocol: |
|
GET |
/protocol/target-groups/target-group |
Get the specified SAN target group for the given protocol: |
|
POST |
/protocol/target-groups |
Create a new SAN target group for the given protocol: |
|
PUT |
/protocol/target-groups/target-group |
Modify the specified SAN target group for the given protocol: |
|
DELETE |
/protocol/target-groups/target-group |
Destroy the specified target-group object |
List Target Groups
Lists all of the target groups available for an Oracle ZFS Storage Appliance system. On success, HTTP status 200 (OK) is returned and the body contains a JSON object with a property named groups that contains an array of target group objects.
Example Request:
GET /api/san/v1/iscsi/target-groups Host: zfs-storage.example.com:215 Authorization: Basic Tm8gcGVla2luZyE= Accept: application/json
Example Result:
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 237
{
"groups": [{
"href": "/api/san/v1/iscsi/target-groups/test-group",
"name": "test-group",
"targets": [
"iqn.zfs-storage.example.com.sun:02:31d26d2e-6aa0-6054-fe58-8b1fb508b008"
]
}, {
"href": "/api/san/v1/iscsi/target-groups/alt-group",
...
}]
}Get Target Group
Gets a single target group. The request takes a single URI parameter, which is the target group name. The response body contains a JSON object property named group that contains the target group properties.
Example Request:
GET /api/san/v1/iscsi/target-groups/test-group Host: zfs-storage.example.com:215 Authorization: Basic Tm8gcGVla2luZyE= Accept: application/json
Example Result:
HTTP/1.1 200 OK
Content-Type: application/json
{
"group": {
"href": "/api/san/v1/iscsi/target-groups/test-group",
"name": "test-group",
"targets": [
"iqn.zfs-storage.example.com.sun:02:0d5a0ed8-44b6-49f8-a594-872bf787ca5a"]
}
}Create a Target Group
Creates a new iSCSI target group. The request body is a JSON object with a
single name property that is the name of the new
group.
Example Request:
POST /api/san/v1/iscsi/target-groups HTTP/1.1
Host: zfs-storage.example.com:215
Authorization: Basic Tm8gcGVla2luZyE=
Accept: application/json
Content-Type: application/json
Content-Length: 97
{"name":"test-group",
"targets": ["iqn.zfs-storage.example.com.sun:02:31d26d2e-6aa0-6054-fe58-8b1fb508b008"]}Example Result:
HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 154
X-Zfssa-San-Api: 1.0
Location: /api/san/v1/iscsi/target-groups/test-group
{
"group": {
"href": "/api/san/v1/iscsi/target-groups/test-group",
"name": "test-group",
"targets": [
"iqn.zfs-storage.example.com.sun:02:31d26d2e-6aa0-6054-fe58-8b1fb508b008"]
}
}