Create a cluster-scoped or SVM-scoped static route
Creates static routes scoped to either the cluster or SVM, establishing pathways for network traffic to specific destinations. Use this endpoint to configure routing strategies for improved network management and efficiency.
HTTP method and endpoint
POST /network/ip/routes
Introduced in
ONTAP 9.6
Usage notes
Creates a Cluster-scoped or SVM-scoped static route.
Required properties
-
gateway- IP address to route packets to. -
SVM-scoped routes
-
svm.nameorsvm.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 |
|---|---|---|
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. |
svm |
||
uuid |
string |
The UUID that uniquely identifies the route. |
Example request
{
"destination": {
"address": "10.10.10.7",
"netmask": "24"
},
"gateway": "10.1.1.1",
"interfaces": [
{
"name": "lif1",
"uuid": "1cd8a442-86d1-11e0-ae1c-123478563412"
}
],
"ipspace": {
"name": "exchange",
"uuid": "1cd8a442-86d1-11e0-ae1c-123478563412"
},
"svm": {
"name": "svm1",
"uuid": "02c9e252-41be-11e9-81d5-00a0986138f7"
},
"uuid": "1cd8a442-86d1-11e0-ae1c-123478563412"
}
Response
Status: 201, Created
| Name | Type | Description |
|---|---|---|
num_records |
integer |
Number of records |
records |
array[network_route] |
Example response
{
"num_records": 1,
"records": [
{
"destination": {
"address": "10.10.10.7",
"netmask": "24"
},
"gateway": "10.1.1.1",
"interfaces": [
{
"name": "lif1",
"uuid": "1cd8a442-86d1-11e0-ae1c-123478563412"
}
],
"ipspace": {
"name": "exchange",
"uuid": "1cd8a442-86d1-11e0-ae1c-123478563412"
},
"svm": {
"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 |
|---|---|
1966345 |
Duplicate route exists. |
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. |
2 |
The specified svm.uuid is not valid. |
Definitions
See Definitions
href
| Name | Type | Description |
|---|---|---|
href |
string |
_links
ip_info
IP information
| Name | Type | Description |
|---|---|---|
address |
string |
IPv4 or IPv6 address |
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
interfaces
| Name | Type | Description |
|---|---|---|
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 |
|---|---|---|
name |
string |
IPspace name |
uuid |
string |
IPspace UUID |
svm
| Name | Type | Description |
|---|---|---|
name |
string |
The name of the SVM. |
uuid |
string |
The unique identifier of the SVM. |
network_route
| Name | Type | Description |
|---|---|---|
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. |
svm |
||
uuid |
string |
The UUID that uniquely identifies the route. |
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 |
target |
string |
The target parameter that caused the error. |