Create a cluster-scoped or SVM-scoped static route
POST /network/ip/routes
Introduced In: 9.6
Creates a Cluster-scoped or SVM-scoped static route.
Required properties
-
gateway
- IP address to route packets to. -
SVM-scoped routes
-
svm.name
orsvm.uuid
- SVM that route is applied to.
-
-
cluster-scoped routes
-
There are no additional required fields for Cluster-scoped routes.
-
Default property values
If not specified in POST, the following default property values are assigned:
-
destination
- 0.0.0.0/0 for IPv4 or ::/0 for IPv6. -
ipspace.name
-
Default for Cluster-scoped routes.
-
Name of the SVM's IPspace for SVM-scoped routes.
-
-
metric
- 20.
Related ONTAP commands
-
network route create
Parameters
Name | Type | In | Required | Description |
---|---|---|---|---|
return_records |
boolean |
query |
False |
The default is false. If set to true, the records are returned.
|
Request Body
Name | Type | Description |
---|---|---|
_links |
||
destination |
IP information |
|
gateway |
string |
The IP address of the gateway router leading to the destination. |
interfaces |
array[interfaces] |
IP interfaces on the same subnet as the gateway. |
ipspace |
Applies to both SVM and cluster-scoped objects. Either the UUID or name may be supplied on input. |
|
metric |
integer |
Indicates a preference order between several routes to the same destination. With typical usage, the default metrics provided are adequate, there is no need to specify a metric in the route creation. |
scope |
string |
Set to "svm" for interfaces owned by an SVM. Otherwise, set to "cluster". |
svm |
Applies only to SVM-scoped objects. Either the UUID or name must be supplied. |
|
uuid |
string |
The UUID that uniquely identifies the route. |
Example request
{
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"destination": {
"address": "10.10.10.7",
"family": "string",
"netmask": "24"
},
"gateway": "10.1.1.1",
"interfaces": [
{
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"ip": {
"address": "10.10.10.7"
},
"name": "lif1",
"uuid": "1cd8a442-86d1-11e0-ae1c-123478563412"
}
],
"ipspace": {
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"name": "exchange",
"uuid": "1cd8a442-86d1-11e0-ae1c-123478563412"
},
"scope": "string",
"svm": {
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"name": "svm1",
"uuid": "02c9e252-41be-11e9-81d5-00a0986138f7"
},
"uuid": "1cd8a442-86d1-11e0-ae1c-123478563412"
}
Response
Status: 201, Created
Name | Type | Description |
---|---|---|
_links |
||
error |
||
num_records |
integer |
Number of records |
records |
array[network_route] |
Example response
{
"_links": {
"next": {
"href": "/api/resourcelink"
},
"self": {
"href": "/api/resourcelink"
}
},
"error": {
"arguments": [
{
"code": "string",
"message": "string"
}
],
"code": "4",
"message": "entry doesn't exist"
},
"num_records": 1,
"records": [
{
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"destination": {
"address": "10.10.10.7",
"family": "string",
"netmask": "24"
},
"gateway": "10.1.1.1",
"interfaces": [
{
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"ip": {
"address": "10.10.10.7"
},
"name": "lif1",
"uuid": "1cd8a442-86d1-11e0-ae1c-123478563412"
}
],
"ipspace": {
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"name": "exchange",
"uuid": "1cd8a442-86d1-11e0-ae1c-123478563412"
},
"scope": "string",
"svm": {
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"name": "svm1",
"uuid": "02c9e252-41be-11e9-81d5-00a0986138f7"
},
"uuid": "1cd8a442-86d1-11e0-ae1c-123478563412"
}
]
}
Headers
Name | Description | Type |
---|---|---|
Location |
Useful for tracking the resource location |
string |
Error
Status: Default
ONTAP Error Response Codes
Error Code | Description |
---|---|
1966265 |
The destination and gateway must belong to the same IP address family. |
1966345 |
Duplicate route exists. |
1966505 |
The gateway address cannot be the same as a LIF address. A LIF is already configured with that IP address. |
1967080 |
The destination.address is missing. |
1967081 |
The specified SVM must exist in the specified IPspace. |
1967082 |
The specified ipspace.uuid and ipspace.name refer to different IPspaces. |
1967146 |
The specified svm.name is not valid. |
2621462 |
The specified SVM does not exist. |
2621574 |
This operation is not permitted on an SVM that is configured as the destination of a MetroCluster SVM relationship. |
2621706 |
The specified UUID and name refer to different SVMs. |
Also see the table of common errors in the Response body overview section of this documentation.
Name | Type | Description |
---|---|---|
error |
Example error
{
"error": {
"arguments": [
{
"code": "string",
"message": "string"
}
],
"code": "4",
"message": "entry doesn't exist",
"target": "uuid"
}
}
Definitions
See Definitions
href
Name | Type | Description |
---|---|---|
href |
string |
_links
Name | Type | Description |
---|---|---|
self |
ip_info
IP information
Name | Type | Description |
---|---|---|
address |
string |
IPv4 or IPv6 address |
family |
string |
IPv4 or IPv6 |
netmask |
string |
Input as netmask length (16) or IPv4 mask (255.255.0.0). For IPv6, the default value is 64 with a valid range of 1 to 127. Output is always netmask length. |
ip
IP information
Name | Type | Description |
---|---|---|
address |
string |
IPv4 or IPv6 address |
interfaces
A network interface. Either UUID or name may be supplied on input.
Name | Type | Description |
---|---|---|
_links |
||
ip |
IP information |
|
name |
string |
The name of the interface. If only the name is provided, the SVM scope must be provided by the object this object is embedded in. |
uuid |
string |
The UUID that uniquely identifies the interface. |
ipspace
Applies to both SVM and cluster-scoped objects. Either the UUID or name may be supplied on input.
Name | Type | Description |
---|---|---|
_links |
||
name |
string |
IPspace name |
uuid |
string |
IPspace UUID |
svm
Applies only to SVM-scoped objects. Either the UUID or name must be supplied.
Name | Type | Description |
---|---|---|
_links |
||
name |
string |
The name of the SVM. This field cannot be specified in a PATCH method. |
uuid |
string |
The unique identifier of the SVM. This field cannot be specified in a PATCH method. |
network_route
Name | Type | Description |
---|---|---|
_links |
||
destination |
IP information |
|
gateway |
string |
The IP address of the gateway router leading to the destination. |
interfaces |
array[interfaces] |
IP interfaces on the same subnet as the gateway. |
ipspace |
Applies to both SVM and cluster-scoped objects. Either the UUID or name may be supplied on input. |
|
metric |
integer |
Indicates a preference order between several routes to the same destination. With typical usage, the default metrics provided are adequate, there is no need to specify a metric in the route creation. |
scope |
string |
Set to "svm" for interfaces owned by an SVM. Otherwise, set to "cluster". |
svm |
Applies only to SVM-scoped objects. Either the UUID or name must be supplied. |
|
uuid |
string |
The UUID that uniquely identifies the route. |
_links
Name | Type | Description |
---|---|---|
next |
||
self |
error_arguments
Name | Type | Description |
---|---|---|
code |
string |
Argument code |
message |
string |
Message argument |
error
Name | Type | Description |
---|---|---|
arguments |
array[error_arguments] |
Message arguments |
code |
string |
Error code |
message |
string |
Error message |
returned_error
Name | Type | Description |
---|---|---|
arguments |
array[error_arguments] |
Message arguments |
code |
string |
Error code |
message |
string |
Error message |
target |
string |
The target parameter that caused the error. |