LUALoriotPro WEB site

LoriotPro scripting documentation
Extensions for LUA language

Table of contents Search function

Print the current page Mail this  link UTUBE Channel version française

lp.InsertNewContainer - Insert a new container in the LoriotPro directory

LoriotPro has extended the LUA sripting language by providing its own LUA libraries. The new functions provided are dedicated to the creation of monitoring and SNMP automation application.

Syntax

uid = lp.InsertNewContainer(name,uid,type);

Description

Insert a new container object in the directory under the object specified by its UID number.

Parameters

name - A name for the new container in a character string format. Beware of creating unique name for the search options.

uid - A directory object UID ( a 64 Bits value) in a character string format. Value is . « 0 » if you want to insert it under the root object.

Type - The object type to insert

LP_LUA_DT_COUNTRY=1;
LP_LUA_DT_ORGANIZATION =2;
LP_LUA_DT_ORGANIZATION_UNIT=3;

Country
Organization
Organization Unit

Return Values

uid - the UID of the created object

nil if an error occurs

Example

lua logoLoriotPro WEB site Documentation scripting LoriotPro
Extensions du language LUA

Table des matières    Liste de fonctions

Imprimer la page en cours Mail this  link UTUBE Channel

The example below inserts few container under the Organisation object ‘MyRouter’.

insert new container

You can use the Wizard avaialble in the LUA editor for selecting the ‘uid’ of the Organistion object.

insert new container

insert new container

The uid ‘5163816506848444550’ is now insertted in the script below.

 

dofile(lp.GetPath().."/config/script/loriotinit.lua"); 

-- LP_LUA_DT_COUNTRY=1;

-- LP_LUA_DT_ORGANIZATION =2;

-- LP_LUA_DT_ORGANIZATION_UNIT=3; 

lp.InsertNewContainer('country 1',"5163816506848444550",LP_LUA_DT_COUNTRY);

lp.InsertNewContainer('organization 1',"5163816506848444550",LP_LUA_DT_COUNTRY);

lp.InsertNewContainer('organization_unit 1',"5163816506848444550",LP_LUA_DT_COUNTRY);

 

 insert new container

 The new container have been inserted under the MyRouters container.

 

 


www.loriotpro.com