Callback used when sending a request to the diagram endpoint. It will be called when a reply for this request is received
Type: Function
Class to programatically edit a specific network diagram on NetworkMaps. Used by NetworkMapsLib to edit different diagrams
(any)
(any)
This function will get the already loaded data of the diagram and send it to a callback function. If this data is still not available (might happen if we just establish the connection), it will set up a function to be called once this data is received
(any)
This function will send a message to the diagram enpoint requesting the latest diagram data. once this data is received, the callback function provided will be called
(Function)
Function to be called when a response is received. Function will have two parameters: error and data received
This function will send a provided message to the diagram endpoint and set up a callback for when the reply to this message is received.
Function to create a base on a diagram.
(string)
L2 or L3 depending on which view we want this base to belong
(number)
Coordinate x of the base
(number)
Coordinate y of the base. In general, this should be 0
(number)
Coordinate z of the base.
(number)
Size on the x axis of this base.
(number)
Size on the y axis of this base. In general, this should be 1
(number)
Size on the z axis of this base.
(number)
Rotation on degrees of the base in the x axis. Should be 0.
(number)
Rotation on degrees of the base in the y axis.
(number)
Rotation on degrees of the base in the z axis. Should be 0.
(string)
Type of this base. Currently, only "F" is supported.
(diagramRequestCallback)
Function to be called when a response is received. Function will have two parameters: error and data received
Function to create a device on a diagram.
(string)
Subtype of this element (ej: "F", "R", "_COL", ...).
(number)
Coordinate x of the device (in base coords).
(number)
Coordinate y of the device (in base coords). To have it on the floor, y must match the sy of the base
(number)
Coordinate z of the device (in base coords).
(number)
Size on the x axis of this device.
(number)
Size on the y axis of this device.
(number)
Size on the z axis of this device.
(number)
Rotation on degrees of the device in the x axis. Should be 0.
(number)
Rotation on degrees of the device in the y axis.
(number)
Rotation on degrees of the device in the z axis. Should be 0.
(number)
Integer representing the color1 used by the shape. First byte R, Second G Third B: 0xRRGGBB.
(number)
Integer representing the color2 used by the shape. First byte R, Second G Third B: 0xRRGGBB.
(string)
ID of the base where this device is located.
(diagramRequestCallback)
Function to be called when a response is received. Function will have two parameters: error and data received
Function to create a link between devices on a diagram.
(string)
ID of the first device we want to link.
(string)
ID of the second device we want to link.
(number)
Integer representing the type of the link: 0: straight, 1: squared
(number)
Integer representing the color used by the shape. First byte R, Second G Third B: 0xRRGGBB.
(number)
Integer representing the thickness of the link (0.001 - .5).
(number)
Height of the link relative to the y coord of the devices linked.
(diagramRequestCallback)
Function to be called when a response is received. Function will have two parameters: error and data received
Function to create a joint in a link, l2segment, interface, svi_interface or p2p_interface.
(string)
L2 or L3 depending on which view the link/l2segment/... isg
(string)
link, l2segment, interface, svi_interface or p2p_interface.
(string)
Id of the element where the new joint will be added.
(string)
Index of this joint on the list of joints. This is where the joint will be inserted.
(number)
Coordinate x of the joint (in world coords).
(number)
Coordinate y of the joint (in world coords).
(number)
Coordinate z of the joint (in world coords).
(diagramRequestCallback)
Function to be called when a response is received. Function will have two parameters: error and data received
Function to create a text on a network diagram.
(string)
Text to be added.
(string)
L2 or L3 depending on which view the text is.
(number)
Coordinate x of the text (in base coords).
(number)
Coordinate y of the text (relative to the base sy).
(number)
Coordinate z of the text (in base coords).
(number)
Rotation on degrees of the text in the x axis.
(number)
Rotation on degrees of the text in the y axis.
(string)
Height of the text.
(number)
Integer representing the color used by the shape. First byte R, Second G Third B: 0xRRGGBB.
(string)
Type of BG to be used: "n": no bg, "r": rectangle, "c": circle, "h", "p".
(string)
Text align: "l", "r" or "c"
(number)
Integer representing the color used by the background. First byte R, Second G Third B: 0xRRGGBB.
(number)
Integer representing the color used by the border. First byte R, Second G Third B: 0xRRGGBB.
(boolean)
Boolean indicating if the background will be shown.
(boolean)
Boolean indicating if the border will be shown.
(number)
Width of the border (.01 - 1).
(number)
Depth of the background (.01 - 1).
(number)
Rotation of the text relative to the background.
(string)
ID of the base where this text is located.
(diagramRequestCallback)
Function to be called when a response is received. Function will have two parameters: error and data received
Function to create a symbol on a diagram.
(string)
Subtype of this element (ej: "X", "V", "A", "F").
(string)
L2 or L3 depending on which view the symbol is.
(number)
Coordinate x of the symbol (in base coords).
(number)
Coordinate y of the symbol (in base coords). To have it on the floor, y must match the sy of the base
(number)
Coordinate z of the symbol (in base coords).
(number)
Size on the x axis of this symbol.
(number)
Size on the y axis of this symbol.
(number)
Size on the z axis of this symbol.
(number)
Rotation on degrees of the symbol in the x axis. Should be 0.
(number)
Rotation on degrees of the symbol in the y axis.
(number)
Rotation on degrees of the symbol in the z axis. Should be 0.
(number)
Integer representing the color1 used by the shape. First byte R, Second G Third B: 0xRRGGBB.
(Object)
Object with the custom data of the symbol. The attributes to pass here are dependant on the subtype of this element:
if st == "F" (flag), object should have:
{number} flagcolor: Integer representing the color used by the flag. First byte R, Second G Third B: 0xRRGGBB.
if st == "A" (arrow), object shuld have:
{number} head_color: Integer representing the color used by the head of the arrow. First byte R, Second G Third B: 0xRRGGBB.
{string} head_type: Type of head: "n", "f", "v", "i", "p", "r" or "s"
{string} tail_type: Type of tail: "n", "f", "v", "i", "p", "r" or "s"
{string} shaft_type: Type of shaft: "s" or "r"
{number} head_sx_per: Percentage of the shaft width used as head width.
{number} head_sy_per: Percentage of the shaft length used as head length.
{number} head_sz_per: Percentage of the shaft depth used as head depth.
{number} tail_sx_per: Percentage of the shaft width used as head width.
{number} tail_sy_per: Percentage of the shaft length used as head length.
{number} tail_sz_per: Percentage of the shaft depth used as head depth.
{number} shaft_dots: 1 for solid line. Otherwise, number of dots of the line.
(string)
ID of the base where this symbol is located.
(diagramRequestCallback)
Function to be called when a response is received. Function will have two parameters: error and data received
Function to move a base on a diagram.
(string)
L2 or L3 depending on which view the base is.
(string)
ID of the element.
(number)
Coordinate x of the element (in world coords).
(number)
Coordinate y of the element (in world coords).
(number)
Coordinate z of the element (in world coords).
(diagramRequestCallback)
Function to be called when a response is received. Function will have two parameters: error and data received
Function to move an element on a diagram. Used to move devices, text, symbols, l2segments and vrfs.
(string)
L2 or L3 depending on which view the element is.
(string)
Type of the element: device, symbol, text, vrf, l2segment.
(string)
ID of the element.
(number)
Coordinate x of the element (in base coords).
(number)
Coordinate y of the element (in base coords). To have it on the floor, y must match the sy of the base
(number)
Coordinate z of the element (in base coords).
(string)
ID of the base where this element is located.
(diagramRequestCallback)
Function to be called when a response is received. Function will have two parameters: error and data received
Function to move a joint on a diagram.
(string)
L2 or L3 depending on which view the joint is.
(string)
link, l2segment, interface, svi_interface or p2p_interface.
(string)
Id of the element where the new joint will be added.
(number)
Index of this joint on the list of joints. This is where the joint will be inserted.
(number)
Coordinate x of the joint (in world coords).
(number)
Coordinate y of the joint (in world coords). To have it on the floor, y must match the sy of the base
(number)
Coordinate z of the joint (in world coords).
(diagramRequestCallback)
Function to be called when a response is received. Function will have two parameters: error and data received
Function to rotate an element on a diagram. Used to rotate bases, devices, text, symbols, l2segments and vrfs.
(string)
L2 or L3 depending on which view the element is.
(string)
Type of the element: base, device, symbol, text, vrf, l2segment
(string)
ID of the element.
(number)
Angle in degrees on the x axis.
(number)
Angle in degrees on the y axis.
(number)
Angle in degrees on the z axis.
(diagramRequestCallback)
Function to be called when a response is received. Function will have two parameters: error and data received
Function to resize an element on a diagram. Used to resize bases, devices, symbols, l2segments and vrfs.
(string)
L2 or L3 depending on which view the element is.
(string)
Type of the element: base, device, symbol, vrf, l2segment
(string)
ID of the element.
(number)
Scale x of the element (1 is standard size, 2 is double, ...)
(number)
Scale y of the element (1 is standard size, 2 is double, ...)
(number)
Scale z of the element (1 is standard size, 2 is double, ...)
(diagramRequestCallback)
Function to be called when a response is received. Function will have two parameters: error and data received
Function to change the settings of a base element (floor).
(string)
L2 or L3 depending on which view the element is.
(string)
ID of the element.
(string)
Name of the element.
(string)
Defines how the base element looks: options: "g", "f", "p", "n"
(number)
Integer representing the color1 used by the shape. First byte R, Second G Third B: 0xRRGGBB.
(number)
Integer representing the color2 used by the shape. First byte R, Second G Third B: 0xRRGGBB.
(number)
Defines how transparent the element is where 0 is fully transparent and 1 is fully opaque.
(string)
Name of the texture used on the floor. ("b1_t1", b1_t1-inv, b1_t1-trans, b1_t1-trans2, b1_t2, b1_t3, b1_t4, b1_t5, b1_t6, b1_t7, b1_t8, b1_t9, b2_t1, b2_t2)
(string)
Name of the texture used on the borders. ("b1_t1", b1_t1-inv, b1_t1-trans, b1_t1-trans2, b1_t2, b1_t3, b1_t4, b1_t5, b1_t6, b1_t7, b1_t8, b1_t9, b2_t1, b2_t2)
(number)
How elevated is the base.
(number)
Defines how the texture is applied on the element (scale x of the texture).
(number)
Defines how the texture is applied on the element (scale y of the texture).
(diagramRequestCallback)
Function to be called when a response is received. Function will have two parameters: error and data received
Function to change the settings of a device.
(string)
ID of the element.
(string)
Name of the element.
(number)
Integer representing the color1 used by the shape. First byte R, Second G Third B: 0xRRGGBB.
(number)
Integer representing the color2 used by the shape. First byte R, Second G Third B: 0xRRGGBB.
(diagramRequestCallback)
Function to be called when a response is received. Function will have two parameters: error and data received
Function to change the settings of a vrf.
(string)
ID of the element.
(number)
Integer representing the color1 used by the shape. First byte R, Second G Third B: 0xRRGGBB.
(number)
Integer representing the color2 used by the shape. First byte R, Second G Third B: 0xRRGGBB.
(diagramRequestCallback)
Function to be called when a response is received. Function will have two parameters: error and data received
Function to change the settings of a l2segment.
(string)
ID of the element.
(number)
Integer representing the color1 used by the shape. First byte R, Second G Third B: 0xRRGGBB.
(diagramRequestCallback)
Function to be called when a response is received. Function will have two parameters: error and data received
Function to change the settings of a link, l2link, interface, p2p_interface or svi_interface.
(string)
L2 or L3 depending on which view the element is.
(number)
Integer representing the type of the link: 0: straight, 1: squared
(string)
ID of the element.
(any)
(any)
(number)
Integer representing the color used by the shape. First byte R, Second G Third B: 0xRRGGBB.
(number)
Integer representing the thickness of the link (0.001 - .5).
(number)
Height of the link relative to the y coord of the devices linked.
(diagramRequestCallback)
Function to be called when a response is received. Function will have two parameters: error and data received
Function to change the settings of a text on a network diagram.
(string)
L2 or L3 depending on which view the element is.
(string)
ID of the element.
(string)
Text to be added.
(string)
Height of the text.
(number)
Integer representing the color used by the shape. First byte R, Second G Third B: 0xRRGGBB.
(string)
Type of BG to be used: "n": no bg, "r": rectangle, "c": circle, "h", "p".
(string)
Text align: "l", "r" or "c"
(number)
Integer representing the color used by the background. First byte R, Second G Third B: 0xRRGGBB.
(number)
Integer representing the color used by the border. First byte R, Second G Third B: 0xRRGGBB.
(boolean)
Boolean indicating if the background will be shown.
(boolean)
Boolean indicating if the border will be shown.
(number)
Width of the border (.01 - 1).
(number)
Depth of the background (.01 - 1).
(number)
Rotation of the text relative to the background.
(diagramRequestCallback)
Function to be called when a response is received. Function will have two parameters: error and data received
Function to create a symbol on a diagram.
(string)
L2 or L3 depending on which view the symbol is.
(string)
ID of the element.
(number)
Integer representing the color1 used by the shape. First byte R, Second G Third B: 0xRRGGBB.
(Object)
Object with the custom data of the symbol. The attributes to pass here are dependant on the subtype of this element:
if st == "F" (flag), object should have:
{number} flagcolor: Integer representing the color used by the flag. First byte R, Second G Third B: 0xRRGGBB.
if st == "A" (arrow), object shuld have:
{number} head_color: Integer representing the color used by the head of the arrow. First byte R, Second G Third B: 0xRRGGBB.
{string} head_type: Type of head: "n", "f", "v", "i", "p", "r" or "s"
{string} tail_type: Type of tail: "n", "f", "v", "i", "p", "r" or "s"
{string} shaft_type: Type of shaft: "s" or "r"
{number} head_sx_per: Percentage of the shaft width used as head width.
{number} head_sy_per: Percentage of the shaft length used as head length.
{number} head_sz_per: Percentage of the shaft depth used as head depth.
{number} tail_sx_per: Percentage of the shaft width used as head width.
{number} tail_sy_per: Percentage of the shaft length used as head length.
{number} tail_sz_per: Percentage of the shaft depth used as head depth.
{number} shaft_dots: 1 for solid line. Otherwise, number of dots of the line.
(diagramRequestCallback)
Function to be called when a response is received. Function will have two parameters: error and data received
Function to delete an element. Works for base, device, symbol, text, link
(string)
L2 or L3 depending on which view the element is.
(string)
Type of the element to delete: base, device, symbol, text, link
(string)
ID of the element.
(diagramRequestCallback)
Function to be called when a response is received. Function will have two parameters: error and data received
Function to delete an element. Works for base, device, symbol, text, link
(string)
L2 or L3 depending on which view the element is.
(string)
link, l2segment, interface, svi_interface or p2p_interface.
(string)
ID of the element.
(any)
(diagramRequestCallback)
Function to be called when a response is received. Function will have two parameters: error and data received
Function to configure a device (what vlans does it have, vrfs, svis and loopback interfaces).
(string)
ID of the element.
(Object)
List of vlans of this device. object id should be the vlan tag. The object will have one only attribute: name.
ej: {1: {name: "VLAN1"}, 100: {name: "CORP VLAN 100"}}
(Object)
List of vrfs of this device. Route Distinguiser is the key of the vrf. The object will have one only attribute: name.
ej: {"10:1": {name:"default"}, "20:1": {name: "VRF_CORP"}}
(Object)
List of svis of this device. The key will be the vlan tag. Value should be an object containint:
name: string with name of interface
ipv4: list with strings, each one an ipv4 in cidr format
ipv6: list with strings, each one an ipv6 in cidr format
vrf: vrf this svi belongs to (route distinguiser).
ej: {1: {name: "vlan100", ipv4:
["10.10.10.1/24"]
, ipv6:
["2a01::1/64"]
, vrf: "10:1"}}
(Object)
List of loopbacks of this device. The key is the index of this lo. Uses the same format as svis.
(diagramRequestCallback)
Function to be called when a response is received. Function will have two parameters: error and data received
Function to configure a link (interface names on both sides, lag names in case of more than one interface, is it running lacp and transceiver used).
(string)
ID of the element.
(boolean)
Is lacp enabled?
(string)
Transceiver type used on these cables.
(diagramRequestCallback)
Function to be called when a response is received. Function will have two parameters: error and data received
Function to configure a device link (interface names on both sides, lag names in case of more than one interface, is it running lacp and transceiver used).
(string)
ID of the link.
(number)
Index of the device in the link (0 or 1 depending on how the link was created).
(string)
Function of this interface. Can be none (not configured), switching (layer 2 interface) or routing (layer 3 interface).
(string)
(function switching) Vlan that is not tagged on this interface.
(Array<Object>)
(function routing) List of l3 subinterfaces on this interface. Each member will have:
vlan_tag: if not tagged: -1.
ipv4: list of strings containing the ipv4 addresses in cidr (ej 10.10.10.1/24)
ipv6: list of strings containing the ipv6 addresses in cidr (ej 10.10.10.1/24)
vrf: vrf (identified by RD) this interface belongs to (vrf should exist on the device)
(diagramRequestCallback)
Function to be called when a response is received. Function will have two parameters: error and data received
Class to programatically create, edit and delete network diagrams on NetworkMaps
(boolean)
Identifies if the connection will be done using http or https
(string)
IP address or hostname of the server
(string)
Port number where the server is listening
(Object)
Dictionary containing optional parameters:
session_id: Session ID already created by the server
(to prevent having to authenticate).
verify_cert: Define if in the connection we want to
verify the server certificate (default true).
(Function)
Function to call once the user connection to the server has been established
(Function)
Function to call if the socket is closed
Function to create the initial connection to the server on the user endpoint and get the session id (if not provided) that we will use to make changes on NetworkMaps. This function will be called by the constructor.
Function to create a connection to a diagram.
Function for authenticate the session created with NetworkMaps
(string)
Name of the user (email address).
(string)
Password of this user
(Function)
Function to be called once a response is received from
NetworkMaps. This function will have two parameters:
error: String with error description if there was an error
result: object containing user, name and last name of the user authenticated
Function to list the diagrams accessible by this user.
(Function)
Function to call when server responds. This function will have two parameters:
error: if an error is received
diagram_list: list of diagrams. Each entry (diagram) on the list will have:
uuid: id of the diagram (to uniquely identify this diagram on the system).
name: name of the diagram
permission: permissions we have on this diagram
oe: username of the owner
on: name of the owner
ol: last name of the owner
Function to add a new diagram.