Template Management-Network Interface

Network Interface is a template type that fetches the primary information and details about the network for a specified location.

API Calls

/V5/templates/NETWORK_INTERFACE

/V5/templates/{templateId}/NETWORK_INTERFACE

/V5/templates

/V5/templates/copy/{templateid}/NETWORK_INTERFACE

/V5/templates

/V5/templates/{templateId}/NETWORK_INTERFACE

Get All Network Interface Profiles

Description Fetches the primary information about all network interface profiles
for the specified location.
Who Can Execute? Superuser, Administrator, Operator, and Viewer.
Syntax
GET <Base_URL>/templates/NETWORK_INTERFACE?locationid=<value>&
minimalinforequired =<value>&fields=<value>&filter=<value>&fetchSubTreeTemplates=<value>
  • locationid

    Is used to specify location Id for which information is requested. It takes an integer
    value. To retrieve the value for location id refer Location call.

  • minimalinforequired

    Is used to retrieve minimal information. For false all attributes are populated
    else minimal information is retrieved. It takes a boolean value. It is a mandatory attribute.

  • fields

    List of selective fields which will be returned in the response. It takes String value.

  • fetchSubTreeTemplates

    If set to true, templates created above, at and below the given location will be returned. If false, only templates created above and at the given location will be returned. It takes a boolean value.

Sample code
GET https://training.mojonetworks.com/new/webservice/V5/templates/NETWORK_INTERFACE?
locationid=1&minimalinforequired=true
Request Body This API call does not require any request body parameters.
Response Body If the API call is successful, the HTTP response status is 200.
The response body contains the detailed information about all network interface profiles for the specified location. The response is in the application/JSON format.

Get Details of a Network Interface Profile

Description Fetches the complete details of a network interface profile.
Who Can Execute? Superuser, Administrator, Operator, and Viewer.
Syntax
GET <Base_URL>/templates/{templateId}/NETWORK_INTERFACE?locationid=<value>&fields=<value>
  • templateid

    It is Id to identify the template. It takes an integer value.

  • locationid

    Is used to specify location Id for which information is requested.
    It takes an integer value. To retrieve the value for location id refer Location call.

  • fields

    List of selective fields which will be returned in the response. It takes String value.

Sample code
GET https://training.mojonetworks.com/new/webservice/V5/templates/5/NETWORK_INTERFACE?locationid=0
Request Body This API call does not require any request body parameters.
Response Body If the API call is successful, the HTTP response status is 200.
The response body contains detailed information of the specified network interface profile.
The response is in the application/JSON format.

Add a Network Interface Profile

Description Adds a template at the specified location.
Who Can Execute? Superuser, Administrator, and Operator.
Syntax
PUT <Base_URL>/templates?locationid=<value>
  • locationid

    It is the parameter that specifies the location at which the template must be added.
    The parameter value is specified in the application/json format. To fetch the appropriate location ID you can use Locations call.

Sample code
PUT https://training.mojonetworks.com/new/webservice/v5/templates?locationid=1
Request Body This API call requires the details of the Network Interface. You must provide the appropriate
values for the following mandatory attributes:

  • templateName
  • type

A sample request body is as follows:

{
        "type": "networkinterfaceprofile",
        "templateName": "test ssid"
  }
Response Body If the API call is successful, the HTTP response status is 200.
The response body contains details of the
newly created network interface profile.
The response is in the application/JSON format.

Copy a Network Interface Profile

Description Copies a network interface profile template at the specified location.
Who Can Execute? Superuser, Administrator, and Operator.
Syntax
PUT <Base_URL>/templates/copy/{template_id}/NETWORK_INTERFACE?templateid=<value>&locationid=<value>&nodeid=<value>
  • templateid

    Is the ID of the template. It takes an integer value.

  • locationid

    This takes an integer value specifying the location at which the template exists.
    To retrieve the value for location id refer Location call.

  • nodeid

    This takes an integer value specifying the node in a cluster deployment on which the location exists.

Sample code
PUT https://training.mojonetworks.com/new/webservice/v5/templates/copy/3/
NETWORK_INTERFACE?locationid=0&nodeid=1
Request Body This API call requires the details of the location to which the Network Interface Profile must be copied.
The destination location information is passed as parameters in the request body.
The parameters are passed in the application/json format. You must provide
appropriate values for the childId JSON attribute in the case of a cluster deployment.
A sample request body is as follows:

{

  "type": "locallocationid",
  "id": 2

}
Response Body If the API call is successful, the HTTP response status is 200.
The response body contains detailed information of the copied network interface profile. The response is in the application/json format.

Edit a Network Interface Profile

Description Modifies the details of the specified network interface profile template.
Who Can Execute? Superuser, Administrator, and Operator.
Syntax
POST <Base_URL>/templates
Sample code
POST https://training.mojonetworks.com/new/webservice/v5/templates
Request Body This API call requires the details of the network interface profile to be modified, which is passed as
parameters in the request body. The templateId attribute is generated by the system when you
add a template. To modify the template, you must provide the same system-generated
template ID. You must provide the appropriate values for the following mandatory attributes:

  • type
  • templateName
  • createdAtLocationId
  • templateId

A sample request body is as follows:

{
    "type": "networkinterfaceprofile",
    "templateId": 2,
    "templateName": "Tunnel",
    "createdAtLocationId": {
        "type": "locallocationid",
        "id": 0
    }
  }
Response Body If the API call is successful, the HTTP response status is 200.
The response body contains modified network interface profile details. The response is in
the application/json format.

Delete a Network Interface Profile

Description Deletes the specified network interface profile template.
Who Can Execute? Superuser, Administrator, and Operator.
Syntax
DELETE <Base_URL>/templates/{templateId}/NETWORK_INTERFACE?locationid=<value>
  • templateid

    It is id to identify the template. It takes an integer value.

  • locationid

    Is used to specify location Id for which information is requested.
    It takes an integer value. To retrieve the value for location id refer Location call.

Sample code
DELETE https://training.mojonetworks.com/new/webservice/v5/templates/1/NETWORK_INTERFACE?locationid=1
Request Body This API call does not require any request body parameters.
Response Body If the API call is successful, the HTTP response status is 204.
The response body does not contain any other information
JSON Table

Attribute Data Type Description
type String The template type.
templateId int Template ID
templateName String Template name.
createdAtLocationId application/json ID of location at which the template is created. The value is of the type Location ID JSON.
description String For internal use only.
templateType String Template type. Applicable value is NETWORK_INTERFACE
mncTemplateId int System-generated ID of the template provided via the parent server
to the child server.
secondaryNetworkEnabled boolean Whether a secondary network interface is enabled or not.
primaryPriorityEnabled boolean Whether the primary interface must be preferred over the secondary.
primaryEthernetOverGreSettings application/json EoGRE settings for the primary interface.
primaryEthernetOverGreSettings/greKey String GRE key for the tunnel creation
primaryEthernetOverGreSettings/remoteIpAddress String IP address of the remote end point
primaryEthernetOverGreSettings/localVlan int The local VLAN on which the tunnel will be created.
secondaryEthernetOverGreSettings application/json EoGRE settings for the secondary interface.
secondaryEthernetOverGreSettings/greKey String GRE key
secondaryEthernetOverGreSettings/remoteIpAddress String IP of remore end point
secondaryEthernetOverGreSettings/localVlan int Local VLAn for tunnel creation
secondaryEthernetOverGreSettings/networkProbeInterval int The interval, in seconds, after which the AP checks connectivity with remote endpoint by sending a ping request packet. This can have a value between 10 and 3600. The interval must be a multiple of 10.
secondaryEthernetOverGreSettings/networkPingRetryCount int Count of ping request packets that the AP sends to the remote endpoint. The default value is 3.
secondaryEthernetOverGreSettings/networkPingTimeout int Time, in seconds, till which the AP waits for a ping reply. The default value is 60 seconds.
mnctemplate boolean True indicates this has been pushed by the parent server.

Sample JSON
{
	"type": "networkinterfaceprofile",
	"templateId": 1,
	"templateName": "Test Network",
	"createdAtLocationId": {
		"type": "locallocationid",
		"id": 0
	},
	"description": "",
	"templateType": "NETWORK_INTERFACE",
	"mncTemplateId": 0,
	"secondaryNetworkEnabled": true,
	"primaryPriorityEnabled": true,
	"primaryEthernetOverGreSettings": {
		"greKey": 1234,
		"remoteIpAddress": "192.168.55.111",
		"localVlan": 3
	},
	"secondaryEthernetOverGreSettings": {
		"greKey": 1234,
		"remoteIpAddress": "192.168.55.110",
		"localVlan": 3,
		"networkProbeInterval": 300,
		"networkPingRetryCount": 3,
		"networkPingTimeout": 60
	},
	"mnctemplate": false
}