|
|
이 명령은 구성된 모든 네트워크 인터페이스를 나열합니다.
요청 예:
GET /api/network/v1/interfaces HTTP/1.1 Authorization: Basic Tm8gcGVla2luZyE= Host: zfs-storage.example.com:215 Accept: application/json
결과 예:
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 369
{
"interfaces": {[
"href": "/api/network/v1/interfaces/ixgbe0",
"v4addrs": ["ipaddr-1"]
...
}, {
"href": "/api/network/v1/interfaces/ixgbe1",
"v4addrs": ["ipaddr-2"]
...
}, {
"href": "/api/network/v1/interfaces/ixgbe2",
"v4addrs": ["ipaddr-3"]
...
}, {
"href": "/api/network/v1/interfaces/ixgbe3",
"v4addrs": ["ipaddr-4"]
...
}]
}
이 명령은 지정된 네트워크 인터페이스에 대한 등록 정보의 전체 목록을 가져옵니다.
요청 예:
GET /api/network/v1/interfaces/ixgbe0 HTTP/1.1 Authorization: Basic Tm8gcGVla2luZyE= Host: zfs-storage.example.com:215 Accept: application/json
결과 예:
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 292
{
"interface": {
"admin": true,
"class": "ip",
"curaddrs": ["ipaddr-1"],
"enable": true,
"href": "/api/network/v1/interfaces/ixgbe0",
"interface": "ixgbe0",
"label": "Untitled Interface",
"links": ["ixgbe0"],
"state": "up",
"v4addrs": ["ipaddr-1"],
"v4dhcp": false,
"v6addrs": [],
"v6dhcp": false
}
}
이 명령은 새 네트워크 인터페이스를 만듭니다.
요청 예:
POST /api/network/v1/interfaces HTTP/1.1
Host: zfs-storage.example.com:215
X-Auth-User: root
X-Auth-Key: password
Content-Type: application/json
Content-Length: 78
{
"class": "ip",
"links": ["ixgbe3"],
"v4addrs":"192.0.2.0/24"
}
결과 예:
HTTP/1.1 201 Created X-Zfssa-Appliance-Api: 1.0 Location: /api/network/v1/interfaces/ixgbe3
이 명령은 기존 네트워크 인터페이스를 수정합니다.
요청 예:
PUT /api/network/v1/interfaces/ixgbe3 HTTP/1.1
{
"v4addrs": ["192.0.2.0/24"],
"interface": "Demo Rest"
}
결과 예:
HTTP/1.1 202 Accepted
X-Zfssa-Appliance-Api: 1.0
Content-Type: application/json
Content-Length: 219
{
"admin": true,
"class": "ip",
"curaddrs": ["192.0.2.0/24"],
"enable": true,
"href": "/api/network/v1/interfaces/ixgbe3",
"interface": "ixgbe3",
"label": "Demo Rest",
"links": ["ixgbe3"],
"state": "failed",
"v4addrs": ["192.0.2.0/24"]
"v4dhcp": false,
"v6addrs": [],
"v6dhcp": false
}
이 명령은 기존 네트워크 인터페이스를 삭제합니다.
요청 예:
DELETE /api/network/v1/interfaces/ixgbe3 HTTP/1.1 Authorization: Basic Tm8gcGVla2luZyE= Host: zfs-storage.example.com:215
결과 예:
HTTP/1.1 204 No Content