Resources related to network.
The GlobalConfiguration resource represents network general settings like default gateway, nameservers, hostname, etc.
Returns the global configuration dictionary.
Example request:
GET /api/v1.0/network/globalconfiguration/ HTTP/1.1
Content-Type: application/json
Example response:
HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json
{
"gc_domain": "local",
"gc_ipv4gateway": "192.168.3.1",
"gc_hostname": "freenas",
"gc_netwait_enabled": false,
"gc_hosts": "",
"gc_ipv6gateway": "",
"gc_netwait_ip": "",
"gc_nameserver1": "192.168.3.1",
"gc_nameserver3": "",
"gc_nameserver2": "",
"id": 1
}
Response Headers: | |
---|---|
|
|
Status Codes: |
|
Update global configuration id.
Example request:
PUT /api/v1.0/network/globalconfiguration/ HTTP/1.1
Content-Type: application/json
{
"gc_hosts": "192.168.3.56 myownhost"
}
Example response:
HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json
{
"gc_domain": "local",
"gc_ipv4gateway": "192.168.3.1",
"gc_hostname": "freenas",
"gc_netwait_enabled": false,
"gc_hosts": "192.168.3.56 myownhost",
"gc_ipv6gateway": "",
"gc_netwait_ip": "",
"gc_nameserver1": "192.168.3.1",
"gc_nameserver3": "",
"gc_nameserver2": "",
"id": 1
}
Json Parameters: | |
---|---|
|
|
Request Headers: | |
|
|
Response Headers: | |
|
|
Status Codes: |
|
The Interface resource represents network interfaces configuration.
Returns a list of all interfaces.
Example request:
GET /api/v1.0/network/interface/ HTTP/1.1
Content-Type: application/json
Example response:
HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json
[
{
"int_v6netmaskbit": "",
"int_ipv4address": "192.168.3.20",
"int_name": "ext",
"int_ipv6address": "",
"int_dhcp": false,
"int_options": "",
"int_v4netmaskbit": "24",
"ipv6_addresses": [],
"int_aliases": [],
"int_ipv6auto": true,
"ipv4_addresses": [
"192.168.3.20/24",
],
"int_interface": "em0",
"id": 1
}
]
Query Parameters: | |
---|---|
|
|
Response Headers: | |
|
|
Status Codes: |
|
Creates a new Interface and returns the new Interface object.
Example request:
POST /api/v1.0/network/interface/ HTTP/1.1
Content-Type: application/json
{
"int_ipv4address": "192.168.3.20",
"int_name": "ext",
"int_v4netmaskbit": "24",
"int_interface": "em0",
}
Example response:
HTTP/1.1 201 Created
Vary: Accept
Content-Type: application/json
{
"int_v6netmaskbit": "",
"int_ipv4address": "192.168.3.20",
"int_name": "ext",
"int_ipv6address": "",
"int_dhcp": false,
"int_options": "",
"int_v4netmaskbit": "24",
"ipv6_addresses": [],
"int_aliases": [],
"int_ipv6auto": true,
"ipv4_addresses": [
"192.168.3.20/24",
],
"int_interface": "em0",
"id": 1
}
Json Parameters: | |
---|---|
|
|
Request Headers: | |
|
|
Response Headers: | |
|
|
Status Codes: |
|
Update Interface id.
Example request:
PUT /api/v1.0/network/interface/1/ HTTP/1.1
Content-Type: application/json
{
"int_ipv4address": "192.168.3.21"
}
Example response:
HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json
{
"int_v6netmaskbit": "",
"int_ipv4address": "192.168.3.21",
"int_name": "ext",
"int_ipv6address": "",
"int_dhcp": false,
"int_options": "",
"int_v4netmaskbit": "24",
"ipv6_addresses": [],
"int_aliases": [],
"int_ipv6auto": true,
"ipv4_addresses": [
"192.168.3.20/24",
],
"int_interface": "em0",
"id": 1
}
Json Parameters: | |
---|---|
|
|
Request Headers: | |
|
|
Response Headers: | |
|
|
Status Codes: |
|
The VLAN resource represents network vlan configuration.
Returns a list of all VLANs.
Example request:
GET /api/v1.0/network/vlan/ HTTP/1.1
Content-Type: application/json
Example response:
HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json
[
{
"vlan_description": "",
"vlan_pint": "em1",
"vlan_tag": 0,
"vlan_vint": "vlan0",
"id": 1
}
]
Query Parameters: | |
---|---|
|
|
Response Headers: | |
|
|
Status Codes: |
|
Creates a new VLAN and returns the new VLAN object.
Example request:
POST /api/v1.0/network/vlan/ HTTP/1.1
Content-Type: application/json
{
"vlan_vint": "vlan0",
"vlan_pint": "em1",
"vlan_tag": 0,
}
Example response:
HTTP/1.1 201 Created
Vary: Accept
Content-Type: application/json
{
"vlan_description": "",
"vlan_pint": "em1",
"vlan_tag": 0,
"vlan_vint": "vlan0",
"id": 1
}
Json Parameters: | |
---|---|
|
|
Request Headers: | |
|
|
Response Headers: | |
|
|
Status Codes: |
|
Update VLAN id.
Example request:
PUT /api/v1.0/network/vlan/1/ HTTP/1.1
Content-Type: application/json
{
"vlan_tag": 1
}
Example response:
HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json
{
"vlan_description": "",
"vlan_pint": "em1",
"vlan_tag": 1,
"vlan_vint": "vlan0",
"id": 1
}
Json Parameters: | |
---|---|
|
|
Request Headers: | |
|
|
Response Headers: | |
|
|
Status Codes: |
|
The LAGG resource represents network LAGG (Link Aggregation) configuration.
Returns a list of all LAGGs.
Example request:
GET /api/v1.0/network/lagg/ HTTP/1.1
Content-Type: application/json
Example response:
HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json
[
{
"lagg_interface": "lagg0",
"id": 1,
"lagg_protocol": "roundrobin"
}
]
Query Parameters: | |
---|---|
|
|
Response Headers: | |
|
|
Status Codes: |
|
Creates a new LAGG and returns the new LAGG object.
Example request:
POST /api/v1.0/network/lagg/ HTTP/1.1
Content-Type: application/json
{
"lagg_interfaces": ["em1"],
"lagg_protocol": "roundrobin"
}
Example response:
HTTP/1.1 201 Created
Vary: Accept
Content-Type: application/json
{
"lagg_interface": "lagg0",
"id": 1,
"lagg_protocol": "roundrobin"
}
Json Parameters: | |
---|---|
|
|
Request Headers: | |
|
|
Response Headers: | |
|
|
Status Codes: |
|
The StaticRoute resource represents network routing tables route(8).
Returns a list of all static routes.
Example request:
GET /api/v1.0/network/staticroute/ HTTP/1.1
Content-Type: application/json
Example response:
HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json
[
{
}
]
Query Parameters: | |
---|---|
|
|
Response Headers: | |
|
|
Status Codes: |
|
Creates a new static route and returns the new static route object.
Example request:
POST /api/v1.0/network/staticroute/ HTTP/1.1
Content-Type: application/json
{
"sr_destination": "192.168.1.0/24",
"sr_gateway": "192.168.3.1",
"sr_description": "test route"
}
Example response:
HTTP/1.1 201 Created
Vary: Accept
Content-Type: application/json
{
"sr_description": "test route",
"sr_destination": "192.168.1.0/24",
"id": 1,
"sr_gateway": "192.168.3.1"
}
Json Parameters: | |
---|---|
|
|
Request Headers: | |
|
|
Response Headers: | |
|
|
Status Codes: |
|
Update static route id.
Example request:
PUT /api/v1.0/network/staticroute/1/ HTTP/1.1
Content-Type: application/json
{
"sr_destination": "192.168.1.0/16"
}
Example response:
HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json
{
"sr_description": "test route",
"sr_destination": "192.168.1.0/16",
"id": 1,
"sr_gateway": "192.168.3.1"
}
Json Parameters: | |
---|---|
|
|
Request Headers: | |
|
|
Response Headers: | |
|
|
Status Codes: |
|
Delete static route id.
Example request:
DELETE /api/v1.0/network/staticroute/1/ HTTP/1.1
Content-Type: application/json
Example response:
HTTP/1.1 204 No Response
Vary: Accept
Content-Type: application/json
Status Codes: |
|
---|