Netman’s REST API documentation!

Currently supported hardware and features

Switch model Bond management Interface management IP management VLAN management
Brocade XXXX No Yes Yes Yes
Cisco 2950 No Yes Yes Yes
Cisco 3750 No Yes Yes Yes
Cisco 6500 No Yes Yes Yes
Juniper EX2200 Yes No No Yes
Juniper QFX Yes No No Yes
Dell No Yes No Yes
Arista 7280R No No Yes Yes

API documentation

GET /netman/apidocs/(path: filename)
GET /netman/apidocs/

Shows this documentation

GET /netman/info

Informations about the current deployment and state and generates a log entry on the netman.api logger that says : /info requested this is a logging test

Status Codes:

Example output:

{
   "status": "running",
   "version": "1.1.111.dev111111111",
   "lock_provider": "netman.adapters.threading_lock_factory.ThreadingLockFactory"
}
PUT /switches/(hostname)/interfaces/(path: interface_id)/trunk-native-vlan

Sets the native vlan of an interface

Parameters:
  • hostname (str) – Hostname or IP of the switch
  • interface_id (str) – Interface name (ex. FastEthernet0/1, ethernet1/11)
Body:
2999
DELETE /switches/(hostname)/interfaces/(path: interface_id)/trunk-native-vlan

Removes the native vlan of an interface

Parameters:
  • hostname (str) – Hostname or IP of the switch
  • interface_id (str) – Interface name (ex. FastEthernet0/1, ethernet1/11)
PUT /switches/(hostname)/interfaces/(path: interface_id)/auto-negotiation

Sets the auto_negotiation state of an interface

Parameters:
  • hostname (str) – Hostname or IP of the switch
  • interface_id (str) – Interface name (ex. FastEthernet0/1, ethernet1/11)
Body:

true or false

DELETE /switches/(hostname)/interfaces/(path: interface_id)/auto-negotiation

Unsets the auto-negotiation state of an interface

Parameters:
  • hostname (str) – Hostname or IP of the switch
  • interface_id (str) – Interface name (ex. FastEthernet0/1, ethernet1/11)
PUT /switches/(hostname)/interfaces/(path: interface_id)/spanning-tree

Edit interface spanning tree properties

Parameters:
  • edge (bool) – Activates edge mode
Body:
{
  "edge": true
}
DELETE /switches/(hostname)/interfaces/(path: interface_id)/trunk-vlans/(vlan_number)

Removes a vlan from the trunk members of an interface

Parameters:
  • hostname (str) – Hostname or IP of the switch
  • interface_id (str) – Interface name (ex. FastEthernet0/1, ethernet1/11)
  • vlan_number (int) – Vlan number, between 1 and 4096
PUT /switches/(hostname)/interfaces/(path: interface_id)/access-vlan

Sets the access vlan of an interface

Parameters:
  • hostname (str) – Hostname or IP of the switch
  • interface_id (str) – Interface name (ex. FastEthernet0/1, ethernet1/11)
Body:
1000
DELETE /switches/(hostname)/interfaces/(path: interface_id)/access-vlan

Removes the access vlan of an interface

Parameters:
  • hostname (str) – Hostname or IP of the switch
  • interface_id (str) – Interface name (ex. FastEthernet0/1, ethernet1/11)
POST /switches/(hostname)/interfaces/(path: interface_id)/trunk-vlans

Adds a vlan to the trunk members of an interface

Parameters:
  • hostname (str) – Hostname or IP of the switch
  • interface_id (str) – Interface name (ex. FastEthernet0/1, ethernet1/11)
Body:
1000
PUT /switches/(hostname)/interfaces/(path: interface_id)/bond-master

Add interface to bond

Parameters:
  • hostname (str) – Hostname or IP of the switch
  • interface_id (str) – Interface name (ex. FastEthernet0/1, ethernet1/11)
  • bond_number (int) – Bond number
Body:
10
DELETE /switches/(hostname)/interfaces/(path: interface_id)/bond-master

Free interface from bond

Parameters:
  • hostname (str) – Hostname or IP of the switch
  • interface_id (str) – Interface name (ex. FastEthernet0/1, ethernet1/11)
PUT /switches/(hostname)/interfaces/(path: interface_id)/description

Add a description to the interface

Parameters:
  • hostname (str) – Hostname or IP of the switch
  • interface_id (str) – Interface name (ex. FastEthernet0/1, ethernet1/11)
Body:

A long interface description text

DELETE /switches/(hostname)/interfaces/(path: interface_id)/description

Remove interface description

Parameters:
  • hostname (str) – Hostname or IP of the switch
  • interface_id (str) – Interface name (ex. FastEthernet0/1, ethernet1/11)
PUT /switches/(hostname)/interfaces/(path: interface_id)/port-mode

Sets the port mode of an interface

Parameters:
  • hostname (str) – Hostname or IP of the switch
  • interface_id (str) – Interface name (ex. FastEthernet0/1, ethernet1/11)
Body:

trunk or access

PUT /switches/(hostname)/interfaces/(path: interface_id)/shutdown

Sets the shutdown state of an interface

Parameters:
  • hostname (str) – Hostname or IP of the switch
  • interface_id (str) – Interface name (ex. FastEthernet0/1, ethernet1/11)
Body:

true or false

DELETE /switches/(hostname)/interfaces/(path: interface_id)/shutdown

Unsets the shutdown state of an interface

Parameters:
  • hostname (str) – Hostname or IP of the switch
  • interface_id (str) – Interface name (ex. FastEthernet0/1, ethernet1/11)
PUT /switches/(hostname)/interfaces/(path: interface_id)/lldp

Enable or disable the LLDP protocol on the interface

Parameters:
  • hostname (str) – Hostname or IP of the switch
  • interface_id (str) – Interface name (ex. FastEthernet0/1, ethernet1/11)
Body:

true or false

PUT /switches/(hostname)/interfaces/(path: interface_id)/mtu

Sets the mtu of an interface

Parameters:
  • hostname (str) – Hostname or IP of the switch
  • interface_id (str) – Interface name (ex. FastEthernet0/1, ethernet1/11)
Body:
5000
DELETE /switches/(hostname)/interfaces/(path: interface_id)/mtu

Unsets the mtu of an interface

Parameters:
  • hostname (str) – Hostname or IP of the switch
  • interface_id (str) – Interface name (ex. FastEthernet0/1, ethernet1/11)
DELETE /switches/(hostname)/vlans/(vlan_number)/dhcp-relay-server/(ip_network)

Remove DHCP relay server (ip helper address)

Parameters:
  • hostname (str) – Hostname or IP of the switch
  • vlan_number (int) – Vlan number, between 1 and 4096
POST /switches/(hostname)/vlans/(vlan_number)/dhcp-relay-server

Set DHCP relay server (ip helper address)

Parameters:
  • hostname (str) – Hostname or IP of the switch
  • vlan_number (int) – Vlan number, between 1 and 4096
Body:

IP address of the DHCP server or its relay

PUT /switches/(hostname)/bonds/(bond_number)/trunk-native-vlan

Sets the native vlan of an interface

Parameters:
  • hostname (str) – Hostname or IP of the switch
  • bond_number (int) – Bond number
Body:
2999
DELETE /switches/(hostname)/bonds/(bond_number)/trunk-native-vlan

Removes the native vlan of an interface

Parameters:
  • hostname (str) – Hostname or IP of the switch
  • bond_number (int) – Bond number
PUT /switches/(hostname)/vlans/(vlan_number)/unicast-rpf-mode

Sets the Unicast RPF state of an interface only strict is supported

Parameters:
  • hostname (str) – Hostname or IP of the switch
  • vlan_number (int) – Vlan number, between 1 and 4096
Body:

STRICT

DELETE /switches/(hostname)/vlans/(vlan_number)/unicast-rpf-mode

Remove Unicast RPF configuration of an interface

Parameters:
  • hostname (str) – Hostname or IP of the switch
  • vlan_number (int) – Vlan number, between 1 and 4096
PUT /switches/(hostname)/vlans/(vlan_number)/vrf-forwarding

Set VLAN VRF name

Parameters:
  • hostname (str) – Hostname or IP of the switch
  • vlan_number (int) – Vlan number, between 1 and 4096
Body:

DEFAULT_LAN

DELETE /switches/(hostname)/vlans/(vlan_number)/vrf-forwarding

Remove VLAN VRF name

Parameters:
  • hostname (str) – Hostname or IP of the switch
  • vlan_number (int) – Vlan number, between 1 and 4096
PUT /switches/(hostname)/vlans/(vlan_number)/icmp-redirects

Sets the ICMP redirects state of an interface

Parameters:
  • hostname (str) – Hostname or IP of the switch
  • vlan_number (int) – Vlan number, between 1 and 4096
Body:

true or false

PUT /switches/(hostname)/vlans/(vlan_number)/access-groups/(direction)

Sets the inbound or outgoing ip access-group on a Vlan

Parameters:
  • hostname (str) – Hostname or IP of the switch
  • vlan_number (int) – Vlan number, between 1 and 4096
  • direction (int) – in or out
Body:
spaceless_string
DELETE /switches/(hostname)/vlans/(vlan_number)/access-groups/(direction)

Removes the inbound or outgoing ip access-group of a Vlan

Parameters:
  • hostname (str) – Hostname or IP of the switch
  • vlan_number (int) – Vlan number, between 1 and 4096
  • direction (int) – in or out
PUT /switches/(hostname)/vlans/(vlan_number)/load-interval

Sets the load interval of a vlan

Parameters:
  • hostname (str) – Hostname or IP of the switch
  • vlan_number (int) – Vlan number, between 1 and 4096
Body:
30
DELETE /switches/(hostname)/vlans/(vlan_number)/load-interval

Unsets the load interval of a vlan

Parameters:
  • hostname (str) – Hostname or IP of the switch
  • vlan_number (int) – Vlan number, between 1 and 4096
PUT /switches/(hostname)/bonds/(bond_number)/spanning-tree

Edit bond spanning tree properties

Parameters:
  • edge (bool) – Activates edge mode
Body:
{
  "edge": true
}
DELETE /switches/(hostname)/vlans/(vlan_number)/vrrp-groups/(vrrp_group_id)

Removes a VRRP group from a VLAN

Parameters:
  • hostname (str) – Hostname or IP of the switch
  • vlan_number (int) – VLAN number, between 1 and 4096
  • vrrp_group_id (str) – VRRP group number, between 1 and 255
DELETE /switches/(hostname)/bonds/(bond_number)/trunk-vlans/(vlan_number)

Removes a vlan from the trunk members of a bonded interface

Parameters:
  • hostname (str) – Hostname or IP of the switch
  • bond_number (int) – Bond number
  • vlan_number (int) – Vlan number, between 1 and 4096
POST /switches/(hostname)/vlans/(vlan_number)/vrrp-groups

Adds a VRRP group to a VLAN

Parameters:
  • hostname (str) – Hostname or IP of the switch
  • vlan_number (int) – VLAN number, between 1 and 4096
Body:

Highlighted fields are mandatory

{
  "id": 2,
  "ips": ["10.10.0.1", "10.10.0.2", "10.10.0.3"],
  "priority": 100,
  "hello_interval": 5,
  "dead_interval": 15,
  "track_decrement": 50,
  "track_id": "101"
}
PUT /switches/(hostname)/vlans/(vlan_number)/arp-routing

Sets the ARP routing state of an interface

Parameters:
  • hostname (str) – Hostname or IP of the switch
  • vlan_number (int) – Vlan number, between 1 and 4096
Body:

true or false

PUT /switches/(hostname)/bonds/(bond_number)/access-vlan

Sets the access vlan of a bond

Parameters:
  • hostname (str) – Hostname or IP of the switch
  • bond_number (int) – Bond number
Body:
1000
DELETE /switches/(hostname)/bonds/(bond_number)/access-vlan

Removes the access vlan of a bond

Parameters:
  • hostname (str) – Hostname or IP of the switch
  • bond_number (int) – Bond number
POST /switches/(hostname)/bonds/(bond_number)/trunk-vlans

Adds a vlan to the trunk members of an interface

Parameters:
  • hostname (str) – Hostname or IP of the switch
  • bond_number (int) – Bond number
Body:
1000
PUT /switches/(hostname)/bonds/(bond_number)/description

Add a description to the bonded interface

Parameters:
  • hostname (str) – Hostname or IP of the switch
  • bond_number (int) – Bond number
Body:

A long interface description text

DELETE /switches/(hostname)/bonds/(bond_number)/description

Remove bonded interface description

Parameters:
  • hostname (str) – Hostname or IP of the switch
  • bond_number (int) – Bond number
GET /switches/(hostname)/vlans/(vlan_number)/interfaces

Displays interfaces use in a VLAN

Parameters:
  • hostname (str) – Hostname or IP of the switch
  • vlan_number (int) – Vlan number, between 1 and 4096
Status Codes:

Example output:

["ethernet 1/4", "FastEthernet0/3", "GigabitEthernet0/8"]

Change a bond link speed

Parameters:
  • hostname (str) – Hostname or IP of the switch
  • bond_number (int) – Bond number
  • bond_link_speed (str) – Bond link speed
Body:
1g
PUT /switches/(hostname)/bonds/(bond_number)/port-mode

Sets the port mode of a bond

Parameters:
  • hostname (str) – Hostname or IP of the switch
  • bond_number (int) – Bond number
Body:

trunk or access

DELETE /switches/(hostname)/vlans/(vlan_number)/varp-ips/(path: ip_network)

Removes a VARP ip from a VLAN

Parameters:
  • hostname (str) – Hostname or IP of the switch
  • vlan_number (int) – VLAN number, between 1 and 4096
  • ip_network (str) – IP/Subnet in the “x.x.x.x/xx” format
POST /switches/(hostname)/vlans/(vlan_number)/varp-ips

Adds a VARP IP Network to a VLAN

Parameters:
  • hostname (str) – Hostname or IP of the switch
  • vlan_number (int) – VLAN number, between 1 and 4096
Body:

Highlighted fields are mandatory

{
   "address": "1.2.3.4",
   "mask": 25
}

or

1.2.3.4/25
PUT /switches/(hostname)/vlans/(vlan_number)/mpls-ip

Sets the mpls ip state of a vlan

Parameters:
  • hostname (str) – Hostname or IP of the switch
  • vlan_number (int) – Vlan number, between 1 and 4096
Body:

true or false

DELETE /switches/(hostname)/vlans/(vlan_number)/ips/(path: ip_network)

Removes an IP/Subnet from a vlan

Parameters:
  • hostname (str) – Hostname or IP of the switch
  • vlan_number (int) – Vlan number, between 1 and 4096
  • ip_network (str) – IP/Subnet in the “x.x.x.x/xx” format
POST /switches/(hostname)/vlans/(vlan_number)/ips

Adds an IP/Subnet to a vlan

Parameters:
  • hostname (str) – Hostname or IP of the switch
  • vlan_number (int) – Vlan number, between 1 and 4096
Body:

Highlighted fields are mandatory

{
   "address": "1.2.3.4",
   "mask": 25
}

or

1.2.3.4/25
PUT /switches/(hostname)/vlans/(vlan_number)/ntp

Enable or disable the ntp state of an interface

Parameters:
  • hostname (str) – Hostname or IP of the switch
  • vlan_number (int) – Vlan number, between 1 and 4096
Body:

true or false

PUT /switches/(hostname)/bonds/(bond_number)/mtu

Sets the mtu of a bond

Parameters:
  • hostname (str) – Hostname or IP of the switch
  • bond_number (int) – Bond number
Body:
5000
DELETE /switches/(hostname)/bonds/(bond_number)/mtu

Unsets the mtu of an interface

Parameters:
  • hostname (str) – Hostname or IP of the switch
  • bond_number (int) – Bond number
POST /switches-sessions/(session_id)/actions

Commit or rollback a session on a switch

Parameters:
  • session (str) – ID of the session
Body:

commit or rollback

PUT /switches/(hostname)/interfaces/(path: interface_id)

Reset the interface to it’s default settings

Adding parameter to the interface is not yet supported. This requests only defaults the switch.

Parameters:
  • hostname (str) – Hostname or IP of the switch
  • interface_id (str) – Interface name (ex. FastEthernet0/1, ethernet1/11)
GET /switches/(hostname)/interfaces/(path: interface_id)

Displays informations about a physical interfaces

Parameters:
  • hostname (str) – Hostname or IP of the switch
  • interface_id (str) – name of the interface
Status Codes:

Example output:

{
   "name": "ethernet 1/4",
   "shutdown": false,
   "bond_master": null,
   "port_mode": "trunk",
   "access_vlan": null,
   "trunk_native_vlan": 2999,
   "trunk_vlans": [3000, 3001, 3002],
   "auto_negotiation": null,
   "mtu": 1500
}
GET /switches/(hostname)/interfaces

Displays informations about all physical interfaces

Parameters:
  • hostname (str) – Hostname or IP of the switch
Status Codes:

Example output:

[
   {
      "name": "ethernet 1/4",
      "shutdown": false,
      "bond_master": null,
      "port_mode": "trunk",
      "access_vlan": null,
      "trunk_native_vlan": 2999,
      "trunk_vlans": [3000, 3001, 3002],
      "auto_negotiation": null,
      "mtu": 1500
   },
   {
      "name": "FastEthernet0/3",
      "shutdown": true,
      "bond_master": null,
      "port_mode": "access",
      "access_vlan": 1999,
      "trunk_native_vlan": null,
      "trunk_vlans": [],
      "auto_negotiation": null,
      "mtu": null
   },
   {
      "name": "GigabitEthernet0/6",
      "shutdown": false,
      "bond_master": null,
      "port_mode": "dynamic",
      "access_vlan": 1999,
      "trunk_native_vlan": 2999,
      "trunk_vlans": [3000, 3001, 3002],
      "auto_negotiation": true,
      "mtu": null
   },
   {
      "name": "GigabitEthernet0/8",
      "shutdown": false,
      "bond_master": 12,
      "port_mode": "bond_member",
      "access_vlan": null,
      "trunk_native_vlan": null,
      "trunk_vlans": [],
      "auto_negotiation": false,
      "mtu": null
   }
]
GET /switches/(hostname)/versions

Displays various hardware and software versions about the switch

Parameters:
  • hostname (str) – Hostname or IP of the switch
Status Codes:

Example output:

{
   "v": "1.0",
   "units": {
      "1": {
         "v": "1.0"
      }
   }
}
GET /switches/(hostname)/vlans/(vlan_number)

Displays informations about one VLAN

Parameters:
  • hostname (str) – Hostname or IP of the switch
  • vlan_number (int) – Vlan number, between 1 and 4096
Status Codes:

Example output:

{
   "number": 1,
   "name": "One",
   "ips": [
      {"address": "1.1.1.1", "mask": 24}
   ],
   "vrf_forwarding": "MY_VRF",
   "access_groups": {
      "in": "Blah_blah",
      "out": null
   },
   "vrrp_groups": [
      {
         "id": 1,
         "ips": ["1.1.1.2"],
         "priority": 90,
         "hello_interval": 5,
         "dead_interval": 15,
         "track_id": "101",
         "track_decrement": 50
      }
   ],
   "dhcp_relay_servers": [],
   "arp_routing": true,
   "icmp_redirects": false,
   "unicast_rpf_mode": null,
   "ntp": null,
   "varp_ips": [],
   "load_interval": null,
   "mpls_ip": true
}
DELETE /switches/(hostname)/vlans/(vlan_number)

Deletes a VLAN

Parameters:
  • hostname (str) – Hostname or IP of the switch
  • vlan_number (int) – Vlan number, between 1 and 4096
GET /switches/(hostname)/bonds/(bond_number)

Displays informations about a bond

Parameters:
  • hostname (str) – Hostname or IP of the switch
Status Codes:

Example output:

{
   "number": 3,
   "link_speed": "1g",
   "members": [],
   "shutdown": true,
   "port_mode": "access",
   "access_vlan": 1999,
   "trunk_native_vlan": null,
   "trunk_vlans": [],
   "mtu": 1500
}
DELETE /switches/(hostname)/bonds/(bond_number)

Deletes a bond

Parameters:
  • hostname (str) – Hostname or IP of the switch
  • bond_number (int) – Bond number
GET /switches/(hostname)/vlans

Displays informations about all VLANs

Parameters:
  • hostname (str) – Hostname or IP of the switch
Status Codes:

Example output:

[
   {
      "number": 1,
      "name": "One",
      "ips": [
         {"address": "1.1.1.1", "mask": 24}
      ],
      "vrf_forwarding": "MY_VRF",
      "access_groups": {
         "in": "Blah_blah",
         "out": null
      },
      "vrrp_groups": [
         {
            "id": 1,
            "ips": ["1.1.1.2"],
            "priority": 90,
            "hello_interval": 5,
            "dead_interval": 15,
            "track_id": "101",
            "track_decrement": 50
         }
      ],
      "dhcp_relay_servers": [],
      "arp_routing": null,
      "icmp_redirects": false,
      "unicast_rpf_mode": null,
      "ntp": false,
      "varp_ips": [
         {"address": "3.3.3.3", "mask": 24}
      ],
      "load_interval": null,
      "mpls_ip": true
   },
   {
      "number": 2,
      "name": "",
      "ips": [
         {"address": "2.2.2.2", "mask": 24},
         {"address": "3.3.3.3", "mask": 24}
      ],
      "vrf_forwarding": null,
      "access_groups": {
         "in": null,
         "out": null
      },
      "vrrp_groups": [
         {
            "id": 1,
            "ips": ["2.2.2.2"],
            "priority": 100,
            "hello_interval":null,
            "dead_interval":null,
            "track_id":null,
            "track_decrement":null
         },
         {
            "id": 2,
            "ips": ["3.3.3.1"],
            "priority": 100,
            "hello_interval":null,
            "dead_interval":null,
            "track_id":null,
            "track_decrement":null
         }
      ],
      "dhcp_relay_servers": ["10.10.10.1"],
      "arp_routing": true,
      "icmp_redirects": true,
      "unicast_rpf_mode": "STRICT",
      "ntp": null,
      "varp_ips": [
         {"address": "4.4.4.4", "mask": 24},
         {"address": "5.5.5.5", "mask": 24}
      ],
      "load_interval": null,
      "mpls_ip": true
   }
]
POST /switches/(hostname)/vlans

Create an new VLAN

Parameters:
  • hostname (str) – Hostname or IP of the switch
Body:

Highlighted fields are mandatory

{
   "number": 2000,
   "name": "two_thousands"
}
GET /switches/(hostname)/bonds

Displays informations about all bonds

Parameters:
  • hostname (str) – Hostname or IP of the switch
Status Codes:

Example output:

[
   {
      "number": 3,
      "link_speed": "1g",
      "members": [],
      "shutdown": true,
      "port_mode": "access",
      "access_vlan": 1999,
      "trunk_native_vlan": null,
      "trunk_vlans": [],
      "mtu": 1500
   },
   {
      "number": 4,
      "link_speed": null,
      "members": [
         "ge-0/0/1",
         "ge-1/0/1"
      ],
      "shutdown": false,
      "port_mode": "trunk",
      "access_vlan": null,
      "trunk_native_vlan": 2999,
      "trunk_vlans": [
         3000,
         3001,
         3002
      ],
      "mtu": null
   },
   {
      "number": 6,
      "link_speed": "10g",
      "members": [],
      "shutdown": false,
      "port_mode": "dynamic",
      "access_vlan": 1999,
      "trunk_native_vlan": 2999,
      "trunk_vlans": [
         3000,
         3001,
         3002
      ],
      "mtu": null
   }
]
POST /switches/(hostname)/bonds

Create an new bond

Parameters:
  • hostname (str) – Hostname or IP of the switch
Body:

Highlighted fields are mandatory

{
   "number": 55
}
PUT /switches-sessions/(session_id)/(path: resource)
POST /switches-sessions/(session_id)/(path: resource)
GET /switches-sessions/(session_id)/(path: resource)
DELETE /switches-sessions/(session_id)/(path: resource)
POST /switches-sessions/(session_id)

Open a locked session on a switch

Parameters:
  • hostname (str) – Hostname or IP of the switch
Body:
{
   "hostname": "my.switch"
}
Status Codes:

Example output:

{
   "session_id": "patate"
}
DELETE /switches-sessions/(session_id)

Close a session on a switch

Parameters:
  • session (str) – ID of the session

Indices and tables