POST v1/accounts/{foreignaccountkey}/networks/{foreignkey}/routes

Create a new Route on the network. Each Route must have a unique Id, otherwise a failure result with a 409 error code is returned.<br/><br/> Note that is endpoint returns a 202 code as the requests is Q'd. A status url is returned in the return metadata that can be used to poll the status of this request. When the Route is created successfully on the Asavie network it's Status property will be set as 'complete'

Request Information

URI Parameters

NameDescriptionTypeAdditional information
foreignaccountkey

The Api Account to create the Route on

string

Required

foreignkey

The network on the account create the Route on

string

Required

Body Parameters

The details of the new Route

Route
NameDescriptionTypeAdditional information
RouteType

Gets and sets the type of route. This can be one of the following:-<br/> agentroute = 0 staticroute = 1 blackholeroute = 2 riproute = 3

RouteTypes

None.

RouteExpiry

string

None.

Id

The unique id of the route

string

Required

Metric

Grts and sets the metric value of the route - used to balance traffic between routes

integer

None.

Subnet

Gets and sets the subnet for the route

string

None.

Mask

gets and sets the netmask for the Subnet

string

None.

Action

Gets and sets the action

string

None.

Version

The version of the Route actor. Every time a change is made to the Route its version is incremented.

integer

None.

Status

StatusValues

None.

ActorStatus

The Route actor status. Every resource in the api is represented by an actor. The actor status represents the health of the resource. The ActorStatus can be one of the following values:-<br/> stable = 0 /* everything is ok */ pending = 1 /* an operation is long running */ stalled = 10 /* an unrecoverable error has occurred that will require support desk intervention */

ActorStatusValues

None.

Request Formats

application/json, text/json

Sample:
{
  "RouteType": 0,
  "RouteExpiry": "sample string 1",
  "Id": "sample string 2",
  "Metric": 3,
  "Subnet": "sample string 4",
  "Mask": "sample string 5",
  "Action": "sample string 6",
  "Version": 7,
  "Status": 0,
  "ActorStatus": 0
}

application/xml, text/xml

Sample:
<Route xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/AS.Models.API">
  <Action>sample string 6</Action>
  <ActorStatus>stable</ActorStatus>
  <Id>sample string 2</Id>
  <Mask>sample string 5</Mask>
  <Metric>3</Metric>
  <RouteExpiry>sample string 1</RouteExpiry>
  <RouteType>agentroute</RouteType>
  <Status>pending</Status>
  <Subnet>sample string 4</Subnet>
  <Version>7</Version>
</Route>

application/x-www-form-urlencoded

Sample:

Failed to generate the sample for media type 'application/x-www-form-urlencoded'. Cannot use formatter 'JQueryMvcFormUrlEncodedFormatter' to write type 'Route'.

Response Information

Resource Description

The newly created Agent with a unique Id

PBPRReturnOfRoute
NameDescriptionTypeAdditional information
Data

Route

None.

Success

Gets the success status of the API call

boolean

None.

Meta

Gets the optional meta-data

Dictionary of string [key] and string [value]

None.

Code

Get the http code of the API call e.g. 200, 202, 409

integer

None.

ErrorCode

Get the failure error code of the API call. This is available if Success is false

integer

None.

ErrorSubCode

Gets the error sub code if available

integer

None.

ErrorDescription

Gets a textual description of the error

string

None.

StatusUrl

Gets the status url for any ACCEPTed API commands. Any command (POST,DELETE,PATCh,PUT) to the API usually returns a 202 response code. The status of the command can be queried using the URL provided

string

None.

ContinuationToken

Gets the token to be used for paged queries

string

None.

Response Formats

application/json, text/json

Sample:
{
  "Success": true,
  "Meta": {
    "sample string 1": "sample string 2",
    "sample string 3": "sample string 4"
  },
  "Code": 2,
  "ErrorCode": 3,
  "Data": {
    "RouteType": 0,
    "RouteExpiry": "sample string 1",
    "Id": "sample string 2",
    "Metric": 3,
    "Subnet": "sample string 4",
    "Mask": "sample string 5",
    "Action": "sample string 6",
    "Version": 7,
    "Status": 0,
    "ActorStatus": 0
  },
  "ErrorSubCode": 4,
  "ErrorDescription": "sample string 5",
  "StatusUrl": "sample string 6",
  "ContinuationToken": "lILTzoaXusbt3oCIicPV5w%3D%3D"
}

application/xml, text/xml

Sample:
<PBPRReturnOfRoute7NMnQmOk xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/AS.Models.API">
  <Code>2</Code>
  <ContinuationToken>lILTzoaXusbt3oCIicPV5w%3D%3D</ContinuationToken>
  <ErrorCode>3</ErrorCode>
  <ErrorDescription>sample string 5</ErrorDescription>
  <ErrorSubCode>4</ErrorSubCode>
  <Meta xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:KeyValueOfstringstring>
      <d2p1:Key>sample string 1</d2p1:Key>
      <d2p1:Value>sample string 2</d2p1:Value>
    </d2p1:KeyValueOfstringstring>
    <d2p1:KeyValueOfstringstring>
      <d2p1:Key>sample string 3</d2p1:Key>
      <d2p1:Value>sample string 4</d2p1:Value>
    </d2p1:KeyValueOfstringstring>
  </Meta>
  <StatusUrl>sample string 6</StatusUrl>
  <Success>true</Success>
  <Data>
    <Action>sample string 6</Action>
    <ActorStatus>stable</ActorStatus>
    <Id>sample string 2</Id>
    <Mask>sample string 5</Mask>
    <Metric>3</Metric>
    <RouteExpiry>sample string 1</RouteExpiry>
    <RouteType>agentroute</RouteType>
    <Status>pending</Status>
    <Subnet>sample string 4</Subnet>
    <Version>7</Version>
  </Data>
</PBPRReturnOfRoute7NMnQmOk>