How to run Bluecat API calls with a Scriptable task in vRO 6

Throw it to the community for tips.  I'm still VERY new to javascript & vRO.

I have vRO6 running with the Plugin from the IPAM Bluecat up and running with the actions of out-of-the-box & plugins.  Large.

What I am struggling with, it's that I am creating tasks that contains custom script that can do 'other' things listed in the Handbook for the Bluecat API...  Looking at the guide, some things are easy, but others make absolutely no sense to me.

An example of what I don't understand is the sequel... the API guide will show a specific example to the api java code, but it does not explain how to do this in a scriptable vRO task.

Update in Java:

APIEntity area = service.getEntityById (area ID).

Properties EntityProperties = new EntityProperties (zone.getProperties ()); Fill with the existing values and then update the only properties that need to be changed.

properties.addProperty ("TextUDF", "testTextValue");

properties.addProperty ("IntegerUDF", "1005");

zone.setProperties (properties.getPropertiesString ());

service. Update (area);

So it's 6 lines of code, but the execution of that api call vRO Bluecat seems to expect a single sector of something like this:

result = BCNProteusAPI.call (profileName, "method()", args);

I don't make any sense?  Any guidance here?

Thank you!!!

The version of the plugin available on SolutionExchange seems to expose a script object unique vRO BCNProteusAPI that acts as a proxy for Proteus service calls. Thus, the Java method calls that look like service.someMethod (args) should be directly translatable to scripts of calls BCNProteusAPI.call (profileName, "someMethod", [args]); For the example you provided, calls Java

APIEntity zone = service.getEntityById( zoneId );
service.update(zone);

may arise in the vRO as scripts

var zone = BCNProteusAPI.call(profileName, "getEntityById", [zoneId] );
BCNProteusAPI.call(profileName, "update", [zone]);

Unfortunately, the other Proteus API objects, like APIEntity, EntityProperties, etc., are not exposed as vRO scripts of the objects, which can cause problems if some service API requires such object as an input parameter. You will probably be able to pass this object returned by a call to service as input to another call from service (such as area in the example above), but you may have problems to instantiate them directly (like EntityProperties in the Java code example).

You can contact BlueCat for info, why not not all objects are exposed as vRO script objects and how they recommend to use these objects.

Tags: VMware

Similar Questions

  • Error ' com.vmware.vcloud.sdk.VCloudException: resource not found "for vdc.instantiateVappTemplate API call with vCD server 5.1.


    I get the error message "com.vmware.vcloud.sdk.VCloudException: resource not found" for vdc.instantiateVappTemplate API call with vCD Server 5.1.I tried with two customer VCDs 1.5 and 5.1. Please notify.

    Here is the code snippet

    Parameters InstantiateVAppTemplateParamsType = new InstantiateVAppTemplateParamsType();

    parameters.setName (vappName);
    parameters.setSource (vappTemplate.getReference ());
    parameters.setInstantiationParams (networkParams);
    vdc.instantiateVappTemplate (parameters);

    Reqauest URI and body:

    https://vCD5.1_Server/API/Admin/VDC/6ce10d02-746C-4C7E-a66b-c172d5990a28/action/instantiateVAppTemplate

    <? XML version = "1.0" encoding = "UTF-8" standalone = "yes"? >
    " < ns6:InstantiateVAppTemplateParams xmlns =" http://www.VMware.com/vCloud/versions "xmlns:ns2 =" http://schemas.dmtf.org/OVF/Envelope/1 "xmlns:ns3 =" http://schemas.dmtf.org/wbem/wscim/1/Common "xmlns:ns4 =" http://schemas.dmtf.org/wbem/wscim/1/CIM-Schema/2/CIM_VirtualSystemSettingData "xmlns:ns5 =" http://schemas.dmtf.org/wbem/wscim/1/CIM-Schema/2/CIM_ResourceAllocationSettingData "xmlns:ns6 =" http://www.VMware.com/vCloud/v1.5 "xmlns:ns7 =" http://www.VMware.com/Schema/OVF "xmlns:ns8 =" http://schemas.dmtf.org/OVF/Environment/1 "xmlns:ns9 =" http://www.VMware.com/vCloud/extension/v1.5 "name ="vApp_amit-2"> " "" "" "" ""
    < ns6:InstantiationParams >
    < ns6:NetworkConfigSection >
    < ns2:Info / >
    < ns6:NetworkConfig networkName = "1" >
    < ns6:Configuration >
    "" < ns6:ParentNetwork type="application/vnd.vmware.admin.network+xml" name = "Network1" href = " https://vCD5.1_Server/API/Admin/network/44fea373-8c51-4403-b97e-3dbc4b770eda "/>
    Bridge of < ns6:FenceMode > < / ns6:FenceMode >
    < / ns6:Configuration >
    < / ns6:NetworkConfig >
    < / ns6:NetworkConfigSection >
    < / ns6:InstantiationParams >
    " < ns6:Source type="application/vnd.vmware.vcloud.vAppTemplate+xml "name ="Win2008R2"id =" "urn: vcloud:vapptemplate:a47ada7e-24b6-457f-9578-f1d2f2304dec" href =" " https://vCD5.1_Server/API/vAppTemplate/vappTemplate-a47ada7e-24b6-457f-9578-f1d2f2304dec "/>
    < / ns6:InstantiateVAppTemplateParams >

    Hello

    Instead of queryReferences(), use the queryIdRecords() method.

    RefRes ReferenceResult = queryService.queryIdRecords (QueryRecordType.ADMINORGVDC);

    {for (RecordResult RV: {refRes.getRecords ())}
    If (vr.getName () .equals (vdcName)) {}
    VCC = Vdc.getVdcById (admin, vr.getId ());

    }

    In this way don't worry about whether the returned reference (containing href, mediatype and name) is API-API/Admin user.

    ORGVDC - request user Org/tenant - this will not work if you are a user/Admin Org.

    ADMINORGVDC - query the system Admin user - this will not work if you are a system administrator.

    Kind regards

    Rajesh Kamal.

  • How to stop a program called with exec.vi system

    Hey Gang,

    I need to run a third-party application of in LabVIEW.  It works fine when it is called with the exec.vi system, as long as the user has entered the correct data.  However in some (very difficult to determine) conditions, the application crashes.

    I want to be able to force by program the application to complete and return to LV I assumed that there is a way to do it using the Windows API, but I don't know how to do this, and I would need a way to get the handle of the offending application Windows.

    Short re - implement the app in BT, I'm out of ideas.  I'll appreciate any help.

    Thank you

    Roger

    If you could post a picture of the offending code, it would be great. but two things come to mind, if you expect the exploit code (for example go to a wait for a period, then kill a task) wire: completion to false.

    then is another call to command prompt, look in taskkill /f

    You can kill a process

    It may be useful

  • How to run the packaged procedure with Ref Cursor

    Hello.
    The question may be very simple for you... but I was confused how to run
    I have the following package
    CREATE OR REPLACE PACKAGE CURSPKG AS 
        TYPE T_CURSOR IS REF CURSOR; 
        PROCEDURE OPEN_ONE_CURSOR (N_EMPNO IN NUMBER, 
                                   IO_CURSOR IN OUT T_CURSOR); 
        
    END CURSPKG;
    / 
    
    
    CREATE OR REPLACE PACKAGE BODY CURSPKG AS
        PROCEDURE OPEN_ONE_CURSOR (N_EMPNO IN NUMBER,
                                   IO_CURSOR IN OUT T_CURSOR)
        IS 
            V_CURSOR T_CURSOR; 
        BEGIN 
            IF N_EMPNO <> 0 
            THEN
                 OPEN V_CURSOR FOR 
                 SELECT EMP.EMPNO, EMP.ENAME, DEPT.DEPTNO, DEPT.DNAME 
                      FROM EMP, DEPT 
                      WHERE EMP.DEPTNO = DEPT.DEPTNO 
                      AND EMP.EMPNO = N_EMPNO;
    
            ELSE 
                 OPEN V_CURSOR FOR 
                 SELECT EMP.EMPNO, EMP.ENAME, DEPT.DEPTNO, DEPT.DNAME 
                      FROM EMP, DEPT 
                      WHERE EMP.DEPTNO = DEPT.DEPTNO;
    
            END IF;
            IO_CURSOR := V_CURSOR; 
        END OPEN_ONE_CURSOR; 
    
        
    END CURSPKG;
    /
    But I want to test (run) this procedure...
    But confused how to have Ref Cursor
    Could you help me in this...

    Thank you

    You must declare a variable of type T_CURSOR and pass it to the procedure like this.

    declare
      lOutCursor CURSPKG.T_CURSOR;
    begin
      CURSPKG.OPEN_ONE_CURSOR(, lOutCursor);
    end;
    
  • How to use Windows media player with the windows Task Scheduler (7)?

    Original title: why it is so difficult... question of windows media player 12

    You want to use Windows media player with windows (7) Task Scheduler.   We have a pc, everything that appears on the screen is also pumped to our community cable channel, normally a slideshow in loop is the show, however, sometimes via a scheduler interrupt the slideshow to play a video (say a video of our last Board of Directors meeting) and to make videos, ideally the slideshow returns.

    Using Microsoft software, in this case, Windows Media Player v12.0.7601.18150, Task Scheduler 1.0, two things must happen.

    1 Task Scheduler launch a video in fullscreen / top of window.

    2. when the video is finished, wmp is closed.

    Well, 1 works fine.  The Task Manager launching wmp in full screen.  And a framework of wmp switches to allow a session of wmp be on top.

    However, a short time after launch wmp cut the screen down to a smaller version.

    And 2. closure of WMP fails to occur.  He remains on the screen waiting for human input.

    Any input appreciated.

    Charlie

    For "cuts WMP down to a smaller version", right click on the video game (during playback) and deselect ' auto Player size to contain video.

    For number 2, define your point of Task Scheduler task for the "end of task after X minutes" and therefore the value of X.  Then it will kill the instance of running Media Player after a large number of minutes.  So, it will absolutely immediately when the video is done playing, but it will be within 60 seconds and will be at least to remove WMP and let your slideshow be visible again.

  • How to use an API key with the HTTP funcitons

    I have a web service that provides a string API key.

    The function 'Set API Key"in the HTTP Client-> palette of security has two entrances, private and public key sections.

    Definition of the key given to some does not, putting my usernam as the public part does not work.

    The service (Pushbullet) gives this example in the documentation:

    curl -u : https://api.pushbullet.com/api/devices
    

    Any ideas how to make this work?

    Thanks for the message; I forgot that I posted this.

    FYI, for this particular code, they provided an API key, but then their implementation required under the user name with a password empty.

    Everyone does it a little differently, but assumed that their method is the standard.  Sigh.

  • How to run an application associated with 2 different versions of MFC?

    Hello

    I created an application that generates a DLL with an EXE which refers to several delivered runtime DLLS. The DLL and EXE have been built with VS2012, and the DLL of enforcement delivered have been built with VS2010. When I try to run the application, I get an access violation in WinMain (calling AfxGetThread returns null). Just to check the application, if the supplied runtime DLLs were also built with VS2012, the application runs correctly.

    My goal is to run the application without restoring links there.

    Is it possible to use a manifest configuration, using the file and change references to the VS2010 (made by the runtime DLL) to VS2012, so that the application can be run without the restoration of the links?

    Here is the config file that I created, but did not succeed:


      
         
            
               
               
               
               
            

         

      

    I don't know if the assemblies Microsoft.VS100.MFC and Microsoft.VS100.CRT names are actually valid and also don't know if I can redirect between major versions of VS.

    I was not able to find examples of work. Any help would be useful.

    Regards, Rob

    This issue is beyond the scope of this site and must be placed on Technet or MSDN
  • How to run MechWarrior 4: mercenaries with Windows 7

    compatibility issues with windows 7

    I am running windows 7 and have incompatibility issues when you try to run mechwarrior mercenaries 4 mektek I was wondering if there was a patch to make windows 7 compatible with this older game I beleave it was released for windows 2000, ME and XP but has problems to run properly in windows 7, I tried to change the settings , but still, come in the same endpoint, what gives? am I missing a patch or what?

    -------------

  • How to run a job Disqualification with the ability to specify the name of the file to process

    Hello

    We want to start a task from the Disqualification by command line where I can specify the name of the input in the command line file?

    I tried to use the Externalize in drive and renamed the 'enable' file name and try to use the command below.

    > java-jar jmxtools.jar runopsjob-ProcessFileToLoad of the job-project DataLoad u weblogic Pei welcome123 - runlabel Jul24 d FileName = abc.dat - nowait localhost:8090

    I expect this command will take the entrance as abc.dat instead which is specified as a reader in the work process. But it does not have the file specified as input and still treat the work with the original staging data.

    Please help how I can use several files get handled by using the unique task.

    Thank you
    Ravi

    Hi Ravi,

    The syntax for the outsourced options is the same as in execution profiles, would be if:

    D - phase.*.snapshot. *. FileName = abc.dat

    Assuming you outsourced or not ownership of file name as "filename."

    Kind regards

    Nick

  • What is the proper structure for sendDocument API call with multiple files?

    Hello - the SOAP API documentation, you can send several names of template files to be merged into a single pdf file that will be sent for signature:

    fileInfos

    -FileInfo]

    -A list of one or more files (or references to files) which is sent for signature. If more than one file is provided, they will be grouped into a single PDF before being shipped.

    What is the appropriate structure to send merged files? I can't tell if the fileInfos is a multiple child node of FileInfo, or if one child of FileInfo must contain an array of strings libraryDocumentName.

    THX

    Figured it out! fileInfos should have multiple children of FileInfo, each with their own chains of libraryDocumentName:

    fileInfos

    -FileInfo

    -libraryDocumentName

    -FileInfo

    -libraryDocumentName

    etc.

    for all those who this building in PHP in a table before sending it to the SOAP client, it looks like this:

    ...
    "fileInfos"-online table)
    "FileInfo"-online table)
    table)
    "libraryDocumentName"-online 'Model 1'
    ),
    table)
    "libraryDocumentName"-online "Model 2"
    )
    )
    )
    ...

  • How to run multiple simultaneous backups with VDR 1.2

    I have several VDR 1.2 devices, using every two CIFS shares for data warehouses.  I did not any changes in the .ini on devices file (the file does exist), but I am only able to write a backup at a time.  If I try to run a job manually all-in-one runs, it fails with a message telling me to look under "Reports" error messages.  However, there is nothing there.  I also can not save/restore the integrity checks are running.  It was also a problem of point 1.1, but it would actually give an error message that they data store was busy.

    I tried to import a whole new camera VDR and by attaching it to a new data store - same result.

    Does anyone have an idea what might happen?

    Thank you.

    Allen Beddingfield

    Systems engineer

    The University of Alabama

    Yes, exactly. We first had a VDR with 12 GB of RAM and 4 vCPUs and were not able to run several jobs once. Now, we decided to create two VDR each 4 GB RAM Max. Now, everything works!

    See you soon

    Nils

  • How to run mbralign on esxi with vsphere CLI

    I have a few virtual machines with disks misaligned, each of them can be found on ESXi, I also vSphere CLI installed on my laptop.

    Thus, it is possible to run mbralign using vSphere CLI, since there is no console on ESXi. If so, what would be the command.

    Not possible, vCLI aims for vSphere management regarding the host/vms/etc., that has nothing to do with running the tools custom within the classic ESX or ESXi. As far as I know, the mbralign is not supported on ESXi, if this is the case, it is most likely must be run within the Busybox unsupported console.

    Take a look to this blog post by Duncan about the alignment of the VM - http://www.yellow-bricks.com/2010/04/08/aligning-your-vms-virtual-harddisks/

    =========================================================================

    William Lam

    VMware vExpert 2009

    Scripts for VMware ESX/ESXi and resources at: http://engineering.ucsb.edu/~duonglt/vmware/

    Twitter: @lamw

    repository scripts vGhetto

    Introduction to the vMA (tips/tricks)

    Getting started with vSphere SDK for Perl

    VMware Code Central - Scripts/code samples for developers and administrators

    VMware developer community

    If you find this information useful, please give points to "correct" or "useful".

  • How to SEND an emergency call with low battery

    Is THIS POSSIBLE? Yes? How?

    iPhone 4 s - ios 9.2

    You need to explain what "low battery" means.

  • How to run Windows Upgrade VCenter with little or no problem at all?

    Hello

    I have 24 x Servers VMware ESXi 5.1 update 1 on HP Blade servers managed by my VCenter VMware Windows virtual machine that is currently in version vCenter Server 5.1 patch 1 (build 1064983 2013-04-25) as follows:

    Windows Server 2008 R2 SP1 Standard - 1 x vCPU & 10 GB vRAM

    Microsoft SQL Server 2008 Standard Edition (64-bit) (SP2) - 10.0.4000.0

    My question is which of the Sub VCenter upgrade version is less stressful or no problem at all:

    VMware vCenter Server 5.1 Update 3 has and modules

    VMware vCenter Server 5.5 updated 2nd and modules


    Note: Since the VCenter and DB SQL are in one place, I model clonedto the exsiting running VCenter server for roll simple return by deploying model when you connect directly to ESXi where the model is running.


    Thanks in advance.

    Given that the process of updating U3 5.1 or 5.5 U2 is as the same, I strictly recommend you upgrade to version 5.5, in this way, you don't need to upgrade your vCenter again if you decide to upgrade your guests the time later.

  • How to perform the procedure packed (with some param) in TOAD for Oracle

    Hello.

    Could you help me
    How to run the packaged procedure with parameters in TOAD to Oralce...

    Thank you...

    Use anonymous PL/SQL block to run it.

    For example.

    DECLARE
       ;
    BEGIN
      .();
    END;
    

Maybe you are looking for