Skip to main content
A newer release of this product is available.

Create a cluster-scoped or SVM-scoped static route

Contributors

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 or svm.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.

  • 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

_links

destination

ip_info

IP information

gateway

string

The IP address of the gateway router leading to the destination.

ipspace

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

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

_links

error

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 not valid.

2

The specified svm.uuid is not valid.

Name Type Description

error

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

Name Type Description

self

href

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

_links

name

string

IPspace name

uuid

string

IPspace UUID

svm

Name Type Description

_links

_links

name

string

The name of the SVM.

uuid

string

The unique identifier of the SVM.

network_route

Name Type Description

_links

_links

destination

ip_info

IP information

gateway

string

The IP address of the gateway router leading to the destination.

ipspace

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

uuid

string

The UUID that uniquely identifies the route.

Name Type Description

next

href

self

href

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.