Create a cluster-scoped or SVM-scoped static route
POST /network/ip/routes
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.
-
Related ONTAP commands
-
network route create
Learn more
Request Body
Name | Type | Description |
---|---|---|
_links |
||
destination |
IP information |
|
gateway |
string |
The IP address of the gateway router leading to the destination. |
ipspace |
Applies to both SVM and cluster-scoped objects. Either the UUID or name may be supplied on input. |
|
scope |
string |
Set to "svm" for interfaces owned by an SVM. Otherwise, set to "cluster". |
svm |
SVM, applies only to SVM-scoped objects. |
|
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",
"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",
"target": "uuid"
},
"num_records": 1,
"records": [
{
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"destination": {
"address": "10.10.10.7",
"family": "string",
"netmask": "24"
},
"gateway": "10.1.1.1",
"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"
}
]
}
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 invalid. |
2 |
The specified svm.uuid is invalid or wrong. |
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, you must set the netmask length. The default value is 64. Output is always netmask length. |
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
SVM, applies only to SVM-scoped objects.
Name | Type | Description |
---|---|---|
_links |
||
name |
string |
The name of the SVM. |
uuid |
string |
The unique identifier of the SVM. |
network_route
Name | Type | Description |
---|---|---|
_links |
||
destination |
IP information |
|
gateway |
string |
The IP address of the gateway router leading to the destination. |
ipspace |
Applies to both SVM and cluster-scoped objects. Either the UUID or name may be supplied on input. |
|
scope |
string |
Set to "svm" for interfaces owned by an SVM. Otherwise, set to "cluster". |
svm |
SVM, applies only to SVM-scoped objects. |
|
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 |
target |
string |
The target parameter that caused the error. |