diagramRequestCallback

Callback used when sending a request to the diagram endpoint. It will be called when a reply for this request is received

diagramRequestCallback(error: string, data: Object)

Type: Function

Parameters
error (string) Error received or null if no error.
data (Object) Response data from the server if there was no error.

Diagram

Class to programatically edit a specific network diagram on NetworkMaps. Used by NetworkMapsLib to edit different diagrams

new Diagram(websocket: any, ready_callback: any)
Parameters
websocket (any)
ready_callback (any)
Instance Members
get_data(callback)
reload_data(callback)
send_message(message, callback)
add_base(view, px, py, pz, sx, sy, sz, rx, ry, rz, st, callback)
add_device(st, px, py, pz, sx, sy, sz, rx, ry, rz, color1, color2, base, callback)
add_joint(view, element_type, id, joint_index, px, py, pz, callback)
add_text(text, view, px, py, pz, rx, ry, height, color, bg_type, text_align, bg_color, border_color, bg_show, border_show, border_width, bg_depth, rotation_x, base, callback)
add_symbol(st, view, px, py, pz, sx, sy, sz, rx, ry, rz, color, cd, base, callback)
move_base(view, id, px, py, pz, callback)
move_element(view, type, id, px, py, pz, base, callback)
move_joint(view, element_type, id, joint_index, px, py, pz, callback)
rotate_element(view, type, id, rx, ry, rz, callback)
resize_element(view, type, id, sx, sy, sz, callback)
settings_base(view, id, name, subtype, color1, color2, opacity, t1name, t2name, sy, tsx, tsy, callback)
settings_device(id, name, color1, color2, ifnaming, callback)
settings_vrf(id, color1, color2, callback)
settings_l2segment(id, color1, callback)
settings_text(view, id, text, height, color, bg_type, text_align, bg_color, border_color, bg_show, border_show, border_width, bg_depth, rotation_x, callback)
settings_symbol(view, id, color, cd, callback)
delete_element(view, type, id, callback)
delete_joint(view, element_type, id, joint_index, callback)
config_device(id, vlans, vrfs, svis, los, callback)

NetworkMapsLib

Class to programatically create, edit and delete network diagrams on NetworkMaps

new NetworkMapsLib(use_ssl: boolean, hostname: string, port: string, options: Object, ready_callback: Function, close_callback: Function)
Parameters
use_ssl (boolean) Identifies if the connection will be done using http or https
hostname (string) IP address or hostname of the server
port (string) Port number where the server is listening
options (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).
ready_callback (Function) Function to call once the user connection to the server has been established
close_callback (Function) Function to call if the socket is closed
Instance Members
setup_user_ws()
setup_diagram_ws(uuid, callback)
process_message(data)
login(username, password, callback)
logout(callback)
list_diagrams(callback)
add_diagram(name, callback)
delete_diagram(uuid, callback)