How to add many hosts using jython interface to sps host database

Hi,
we want to create a huge number of virtual hosts into sps repository with jython interface.
for exemple our variables are:
hostname = sps1.internet.com
ip = 192.168.1.1
masterserver = masterserver
hardware = v550
and the script command looks like:
app.execRaw ( 'hdb.h.add' , { 'name' : hostname , 'desc' : hardware , 'tID' : 'NM:com.vodafone.osmgt#vodRAvhostHT' , 'pID' : NM:masterserver , 'attr' : 'cliServer=cliServer;RA_HOSTNAME=hostname;RA_PROVISIONING_IP_ADDR=ip;RA_DESCRIPTION=Dynamic Infrastructure container;RA_OWNER=n1sps;RA_OWNER_DIR=/var/crash/home/n1sps;RA_OWNER_CREATE_SSH_CONN=true;RA_UID=2241;RA_GROUP=n1sps;RA_GID=2241;RA_INSTALLER_USER=root;RA_SUID=y;RA_INSTALLBASE=/opt/SUNWn1sps;RA_CTYPE=ssh;RA_CTYPE_PARAM=cprefix=/opt/SUNWn1sps/N1_Service_Provisioning_System/agent;RA_LEAVEFILES=n;RA_INSTALL_JRE=/opt/SUNWn1sps/N1_Service_Provisioning_System/common/jre;RA_PORT=1131;RA_CIPHER_TYPE=1;RA_INSTALLER_WORKDIR=/tmp;RA_PARENT_HOST=masterserver;RA_PARENT_OWNER=n1sps;RA_PARENT_OWNER_DIR=/opt/SUNWn1sps/home/n1sps;RA_PARENT_TYPE=MS;RA_PACKAGE_PATH=/var/tmp/spsra;RA_PACKAGE_NAME=cr_ra_solaris_sparc_5.2.sh;RA_REMOTE_PACKAGE_TMP_DIR=/tmp;RA_REMOTE_PRIV_CMD=/usr/local/bin/sudo;RA_REMOTE_PRIV_USER=admin;RA_REMOTE_PRIV_USER_HOME=/home/admin;RA_SRC_SSH_DIR=/opt/home/.ssh;RA_DST_SSH_DIR=/home/.ssh;RA_SSH_AUTH_KEY_FILE=authorized_keys' } )
unfortunetly we are getting an error when we try to run the n1 sps hdb.h.add command.
Are we using this command in the right manner ?
Thanks in advance.
Christian

Dear Tarzanek,
I am Alexis Susset a coleague of Christian.
Thank you very much for your reply, we are now able to add hosts directly from a Jython script.
Unfortunetly, we are now encourting a problem with the hdb.h.add command.
It dies if our hostname (name) is already present in the database.
We currently need to import a very high number of node and I would like to know how to simply get two outputs (1. added nodes, 2. non-added nodes ).
Please let me know if you would like me to post the scripts I have.
PS: I tried to use a hbd.h.lo command but it dies as well when I search for a host that doesn't exist.
Many thanks and best regards,
Alexis

Similar Messages

  • How to add classification view using BAPI_MATERIAL_SAVEDATA

    Hi,
    Please any one let me know how to add classification view using BAPI_MATERIAL_SAVEDATA to the material master.
    Thanks,
    shekar

    We use this bapi on a regular basis as well as classification of materials.  We have success doing this in 2 steps.  First step is to save the material using BAPI_MATERIAL_SAVEDATA, second step is to save classification using BAPI_OBJCL_CHANGE  (this can be used for both create and change)  Also look at Function Group CLBPA .   there are several bapi's in that group dealing with object classification, including the one I mentioned..

  • How to add control buttons using Java thorugh serial port?

    Hi everyone,
    I'm new to this forum.
    I have some questions on Java and serial port.
    I want to write a Java program to control my robot, through serial port. For example, when I click "Forward", the robot will go forward, and so on.
    Now I already have the buttons, so next I would like to ask how to interface the buttons with the serial port.
    I already have all the javax.comm things installed.
    below is the code for my buttons:
    import java.awt.*;
    public class ControlButtons extends java.applet.Applet
         GridLayout myLayout = new GridLayout(3, 3);
         Button button1 = new Button(" ");
         Button buttonForward = new Button("Forward");
         Button button2 = new Button(" ");
         Button buttonLeft = new Button("Left");
         Button buttonStop = new Button("Stop");
         Button buttonRight = new Button("Right");
         Button button3 = new Button(" ");
         Button buttonReverse = new Button("Reverse");
         Button button4 = new Button(" ");
         public void init()
              setLayout(myLayout);
              add(button1);
              button1.setVisible(false);
              add(buttonForward);
              add(button2);
              button2.setVisible(false);
              add(buttonLeft);
              add(buttonStop);
              add(buttonRight);
              add(button3);
              button3.setVisible(false);
              add(buttonReverse);
              add(button4);
              button4.setVisible(false);
    }Now I would like to ask for direction on how to add in the code to make it work with serial port.
    Thanks

    The plan is, I have a robot device connected to the serial port.We don't know anything about that device. We don't know how to control it. We don't know what you have to write to the device to make it do anything. Only you know what.
    For example, when I click "Forward", the robot will go forward, and so on.So what do you have to send to make it do that? and same for the other buttons.
    Next, you need to work out from the javax.comm API how to open the serial port and send data to it. This is a standard exercise in learning a new API. You must be able to do this. Again and again.
    But the program is useless. The button can be clicked, but didn't do anything.Because (a) they have no ActionListeners and (b) there is no code to send anything to the serial port.
    You have to write all that. So you also have to look up ActionListener in the Java API and how to attach it to a button. You can do that. We all do that kind of thing every day.
    So next I would like to ask how to interface the buttons with the serial port.You've been asking nothing else since you started, but you've also only done enough investigation of your own to create the buttons. That's only the start.
    The problem is what method and command should I use to make those buttons actually functioning.See above. You've been told part of it several times. The rest only you can answer, because it's your robot.

  • Please teach me how to make the arrangement using Code Interface Node.

    How is what is necessary just to make arrangement (for example, Sine?Wave)
    using Code Interface Node? Please teach me a way.

    Try to get hold of the 'Advanced Analyis' library for labview. It contains VIs for doing FFT! No need to reinvent the wheel.
    If you can't get it and want to take the hard way, try to learn CIN programming by
    - reading the manual (no joke or cynism intended)
    - look for advice in NI's developer zone (www.ni.com/devzone) by using the search phrase 'CIN tutorial': you'll get several links which should be helpful in your case.
    - better than a CIN: try to use the DLL calling mechanisms and compile your C code into a dll. In order to learn dll intewrfacing for LabVIEW, follow the route explained under point 1 and 2 above...
    Good luck,
    Franz

  • How to add ALV button using OO in module pool program using ALV grid

    Hello Gurus!!!
                  Want some tips related how to add button using ALV Grid(OO).
    I want to display the button for search, sort ....
                 Please suggest the step -by-step procedure for implementation of these button.
                 I am designing the code for transaction FB03. Header data has been displayed but want to display the line items.
                 Kindly suggest your answers.
    Thanks,
    Sachin

    Hi,
    CLASS SELSCR_APPLICATION DEFINITION DEFERRED.
    CLASS SELSCR_APPLICATION DEFINITION.
      PUBLIC SECTION.
       METHODS:
            HANDLE_TOOLBAR
            FOR EVENT TOOLBAR OF CL_GUI_ALV_GRID
                IMPORTING E_OBJECT  E_INTERACTIVE,
            HANDLE_USER_COMMAND
            FOR EVENT USER_COMMAND OF CL_GUI_ALV_GRID
                IMPORTING E_UCOMM.
    ENDCLASS.        "SELSCR_APPLICATION DEFINITION
    CLASS SELSCR_APPLICATION IMPLEMENTATION.
      METHOD HANDLE_TOOLBAR.
        DATA: LS_TOOLBAR  TYPE STB_BUTTON.
    append SAVE icon
        CLEAR LS_TOOLBAR.
        MOVE 'SAVE' TO LS_TOOLBAR-FUNCTION.
        MOVE ICON_SYSTEM_SAVE TO LS_TOOLBAR-ICON.
        MOVE 'Save' TO LS_TOOLBAR-QUICKINFO.
        MOVE ' '  TO LS_TOOLBAR-DISABLED.
        APPEND LS_TOOLBAR TO E_OBJECT->MT_TOOLBAR.
        CLEAR LS_TOOLBAR.
      ENDMETHOD.                    "handle_toolbar
      METHOD HANDLE_USER_COMMAND.
        CASE E_UCOMM.
          WHEN 'SAVE'.
              PERFORM UPDATE_FIELDS.
        ENDCASE.
      ENDMETHOD.
    ENDCLASS.                 "SELSCR_APPLICATION IMPLEMENTATION
    these lines should be after calling method SET_TABLE_FOR_FIRST_DISPLAY
    SET HANDLER G_APPLICATION1->HANDLE_TOOLBAR FOR GRID1.
            CALL METHOD grid1->set_toolbar_interactive.
    rgds,
    bharat.

  • How to add Services programmatically using BAPI_BUS2002_ACTELEM_CREATE_M

    Hi :
    I need to create a project programmatically using the standard PS BAPI. My problem is that I don't know how to add external activities ( Services ) into my project.  I have all steps, except this one. I think that the BAPI BAPI_BUS2002_ACTELEM_CREATE_M should do it but I cannot find where to put the Service Number, Text and Quantity.
    Thanks a lot in advance.
    Jose J. Quezada.

    The problem remains the same. The BAPI_NETWORK_MAINTAIN does not have the fields to add the Services. It can adds an External Activity. The services are External Activities but where are the fields. I need an example or a more specific response. I know how to add a Material for example, but the Services are quite different.
    Kind Regards,
    Jose.

  • Can you add routes to use ipsec0 interface on SRP521W?

    I bought a couple of these to trial for location to remote telemedicine sites.  However I am only able to route one network range over the IPSec VPN.  I have to route multiple network ranges, and I am not able to make any modifications to the static routes for the ipsec0 interface, only WAN1 and LAN1.  Ideally, I would change the default route to use ipsec0.  But if that isn't an option, then just add specific ranges. 
    Can anyone help with this?
    Thanks,
    Jim

    That sucks.  I have never used a GRE tunnel before, I tried yesterday building one to my Nexus 7010 with no success.  It seems like it would be so easy if I could just get the option to select the ipsec0 interface when adding static routes.
    Can you recommend the next step router or firewall I could use to be able to send all traffic over the VPN, or at least add additional routes or network lists to send over the VPN?  I am assuming the ASA 5505 would work perfectly, but I was hoping for a more budget concious option as we'll have these all over town.
    Otherwise, if anyone can give me tips or suggestions on how to build the GRE tunnel from the SRP521W to a Nexus 7010 that would be great.
    Thanks,
    Jim

  • How to add node value using org.w3c.dom.Document?

    Hi ,
    I'm using org.w3c.dom.Document to deal with xml files. I could successfully add nodes , and their attributes. However I could not add a value of the node. (e.g. <myNode>I couldn't add this value</myNode>)
    does anyone know how to deal with this?
    I tried subNode.setNodeValue("the value i can't add"); whereas the subNode is an instance of org.w3c.dom.Node... i know this is interface i of course used the concrete class
    org.apache.crimson.tree.ElementNode
    but when I used the subNode.getNodeValue() i simply got null?
    can u plz help me?
    thanks in advance

    Reading the API documentation for the Node interface might help. At least you wouldn't be surprised when the results are exactly what the documentation says they will be.
    What would really help would be forgetting the idea that an Element can have a value. Text nodes have values, though, so create a Text node and make it the child of the Element node.

  • How to add a TreeNode using a path?

    When I doing my project, I get stuck on a portion of my GUI Coding.
    My code provide a path such as
    /Home/fsloke
    /Home/fsloke/directory1
    /Home/WorkHard
    /Home/WorkSmart
    /Home/WorkSmart/Dreamincode
    Currently my tree constructed as below:
    Home
    + fsloke
    ---+directory1
    + WorkHard
    + WorkSmart
    ---+ Dreamincode
    May I know how can I add a childNode called "TryHard" under WorkHard?
    Generally the path give is "/Home/WorkHard/TryHard".
    Don't worried I will split it to
    TreeNode Head ="Home"
    parentPath ="/Home/WorkHard";
    childNode name = "TryHard";
    Any clue?
    I search in net. All give me the solution when the user click on the tree Node. Then the code use , getSelectedPath() function.
    In my case my user not click on the Tree...
    Any advise and direction...
    Thanx...
    I like the DynamicTreeDemo coding from this website http://java.sun.com/docs/books/tutorial/uiswing/components/tree.html

    you can use this method:
    addChildTo("WorkHard","TryHard");
    public void addChildTo(String parentObject, String child){
             TreePath parentPath = getTreePath(parentObject);
             if(parentPath != null){
                 DefaultMutableTreeNode parent = (DefaultMutableTreeNode)parentPath.getLastPathComponent();
                 treeModel.insertNodeInto(new DefaultMutableTreeNode(child), parent, parent.getChildCount());
    private TreePath getTreePath(String userObject) {
             java.util.Enumeration nodes = ( (DefaultMutableTreeNode) treeModel.getRoot()).
             preorderEnumeration();
             while (nodes.hasMoreElements()) {
                  DefaultMutableTreeNode node = (DefaultMutableTreeNode) nodes.nextElement();
                  if (node.getUserObject().equals(userObject)){
                       return new TreePath(node.getPath());
             return null;
    }if you are using new DefaultMutableTreeNode("WorkHard"); , then the object name(WorkHard) should be unique , otherwise create node with your own object. Or alter the method what ever you need..
    edit:
    creation of jtree like
    DefaultMutableTreeNode top =
                new DefaultMutableTreeNode("The Java Series");
            createNodes(top);
            treeModel = new DefaultTreeModel(top);
            tree = new JTree(treeModel);
            tree.getSelectionModel().setSelectionMode
                    (TreeSelectionModel.SINGLE_TREE_SELECTION);ref:http://java.sun.com/docs/books/tutorial/uiswing/examples/components/TreeDemoProject/src/components/TreeDemo.java
    Edited by: david_david on Mar 19, 2008 10:15 AM

  • How to Add two numbers using RFC in WD abap

    Dear Experts,
    I have to add the two numbers using RFC.
    I have created the RFC and by using create -> service call i have include that RFC in my WD abap Program.. After that i don't know how to link the input view and to display the result in another view...
    Please help me..
    Thank you.

    This is the third thread that you have posted on this same question.  This is also your second warning that such activity is not allowed in the SCN forums.  Please return to your original thread if you wish to post a follow up question. 
    Beacause this is a duplicate thread it will be locked.

  • How to add multiple columns using select statement

    Hi friends
    i have two TABLES
    one table Contain only unique Agent code(23,45,56,88)
    second table contain same Agent Code,orderdate & sum(amount)
    now i want to add columns in table 1 according to date and update the amount in that column
    for example if i select start date 1st july 2014 and end date is 15 july 2014
    then i want result 
    select agentcode,amount as 01july2014,amount as 02nd july2014 up to 15th july
    Please HELP.....

    >> I have two TABLES <<
    Please post DDL, so that people do not have to guess what the keys, constraints, Declarative Referential Integrity, data types, etc. in your schema are. Learn how to follow ISO-11179 data element naming conventions and formatting rules. Temporal data should
    use ISO-8601 formats. You failed on this too!  Code should be in Standard SQL as much as possible and not local dialect. 
    This is minimal polite behavior on SQL forums. Ignorance is fine, but why do you have bad manners? The rules are posted at the front of the forum! 
    >> one [nameless, unknown] table Contain only unique Agent code(23, 45, 56, 88) <<
    You do not know the difference between a code and an identifier!
    CREATE TABLE Agents
    (agent_id INTEGER NOT NULL PRIMARY KEY); 
    >> second table contain same Agent Code, order_date & SUM(order_amount) <<
    Wrong again! The SUM() is an aggregate function and cannot be in a column. Tables have keys
    CREATE TABLE Orders
    (agent_id INTEGER NOT NULL
       REFERENCES Agents(agent_id),
     order_date DATE NOT NULL,
     order_amt DECIMAL (8,2) NOT NULL,
     PRIMARY KEY (agent_id, order_date));
    >> now I want to add columns in table 1 according to date and update the amount in that column <<
    NO! The running total is a computed column. We do not store them.
    >> for example if I select start date 1st July 2014 [sic: 2014-07 -01] and end date is 15 July 2014 [sic: 2014-07-15] <<
    If you have ever read a book on SQL, you would know the correct display format for dates! It is the only one in the ANSI/ISO Standards. 
    SELECT agent_id, order_date,
           SUM(order_amt) 
           OVER (PARTITION BY agent_id
                    ORDER BY order_date
                  ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)
           AS order_amt_runtot
      FROM Orders
     WHERE order_date BETWEEN '2014-07-01' AND '2014-07-15'; 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • How to send mail body using RE_CN_RA_INVOICE interface from RECPA520

    Hi ABAP Guru,
    I am using a standard interface RE_CN_RA_INVOICE for tcode RECPA520 for generating pdf form and send the corresponding PDF to  corresponding address maintained in Business Partner.The problem is mail is sending with attachment but there is no mail body.
    Please help

    You have to convert your long string to a table of shorter strings.
    There may be other ways, but one possibility is to use a loop to process you string.
    while (there is something left)
       put the next e.g. 1024 characters in a new row of your table
    endwhile
    If you need to reconstruct your string from the table, don't use simple concatenation since it will remove blanks at the end of lines. Believe me (from experience) sooner or later this will happen.
    Instead you need to either set the subsections of your long string, or insert from the end of your table and keep shifting the contents (probably less efficient) right

  • HOw to add list box using enhacement of standard infotype

    Hi,
    Using enahancement infotype, I wanted to add a list box field in inftyp 01.
    The module pool ZP000100 & screen no 200 already existed .In the layout editor the field didnot get displayed hence I took it from dictionary.
    I have adde the code in pbo & pai for adding values in list box.
    problem is that data is not getting saved when i enter data in pa30 inftyp 01.
    Kindly guide me.
    Regards,
    Rachel

    *

  • How to add expression property using OMB+

    Hi,
    Is it possible to set the expression property for a attribute in the CONSTANT operator through OMB+ ?
    The following commend does not work
    OMBCREATE MAPPING map_name \
    SET PROPERTIES (BUSINESS_NAME, DESCRIPTION) \
    VALUES ('map name ', 'Mapping to test constant') \
    ADD CONSTANT OPERATOR 'CONST1'\
    ADD ATTRIBUTE 'NULL_DATE' OF GROUP 'OUTGRP1' OF OPERATOR 'CONST1' \
    SET PROPERTIES (EXPRESSION) VALUES ('NULL')
    Can anybody provide an example.
    Thanks,
    Sekar,K

    Thanks mark,
    I am not sure what i did wrong yesterday , today the statement is working ? I am using version 9.2.0.4.
    Yesterday initially i tried without operator name ,
    OMBCREATE MAPPING 'M' \
    ADD CONSTANT OPERATOR \
    ADD ATTRIBUTE 'A' OF GROUP 'OUTGRP1' OF OPERATOR 'CONST'\
    SET PROPERTIES ( EXPRESSION) VALUES ('NULL')
    This statement didn't work, after that i have tried with name i was getting different error.
    I will let you know if i am able to re-create the error..
    Does version 10g supports timestamp datatype ?
    Thanks for your help
    Sekar,K

  • How to update many tables using the same code

    <%@ page language = "java" import = "java.sql.*" %>
    <%@ page import = "java.sql.*" %>
    <%@ page import = "java.text.*" %>
    <%
    String custname1=request.getParameter("custname");
    session.setAttribute("custname",custname1);
    String custtin1=request.getParameter("custtin");
    session.setAttribute("custtin",custtin1);
    %>
    <%
    try{
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection conn;
    conn=DriverManager.getConnection("jdbc:odbc:loginval");
    Statement stat=conn.createStatement();
    String stmt="insert into custdetails values('"+custname1+"','"+custtin1+"')";
    stat.executeUpdate(stmt);
    stat.close();
    conn.close();
    %>
    <jsp:forward page = "success.html"/>
    <%
    catch(Exception e)
    %>
    <jsp:forward page = "tinerror.jsp"/>
    <%
    %>---------------------------------------------------------------
    this is my code, now this code will be used by many users to update their corresponding tables. so my problem is based on the username i need to change the table name in the insert query, for example if the username is sai, then the table name has to be saicustdetails and if the user name is ram then the table name in the query has to be ramcustdetails. and so on.
    please help

    *<%@ page language = "java" import = "java.sql.*" %>
    <%@ page import = "java.sql.*" %>
    <%@ page import = "java.text.*" %>
    <%
    String tin1=request.getParameter("tin");
    session.setAttribute("tin",tin1);
    tin1=tin1+"custdetails";
    String custname1=request.getParameter("custname");
    session.setAttribute("custname",custname1);
    String custtin1=request.getParameter("custtin");
    session.setAttribute("custtin",custtin1);
    //String tin2;
    %>
    <%
    try{
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection conn;
    conn=DriverManager.getConnection("jdbc:odbc:loginval");
    Statement stat=conn.createStatement();
    String tin2;
    tin2=tin1;
    String stmt="insert into "+tin2+"values('"+custname1+"','"+custtin1+"')";
    stat.executeUpdate(stmt);
    stat.close();
    conn.close();
    %>
    <jsp:forward page = "success.html"/>
    <%
    catch(Exception e)
    %>
    <jsp:forward page = "tinerror.jsp"/>
    <%
    %>i tried what u have said but still it does not work, anyother way?????

Maybe you are looking for

  • Can't save modified file to a folder in an image disk directly

    I have an image disk on an external drive (firewire) and if I try to save a modified file of an existing file or do a "save as" to a folder, I'm always sent to the root directly of the finder and I have to navigate myself all the way back to the dest

  • I can no longer use keyboard shortcuts to access Zoom tool.

    Hello, Yesterday I wiped my HD and reinstalled my system. I thought I put everything back the way I had it, but apparently I forgot something and can't figure out what's wrong. When in Illustrator CS2, I try to hold down Space+Command, I don't get th

  • Can anyone help with printer options on iPad mini, can I change layout paper size?

    I am trying to change the printer options on my iPad mini so that I can print on legal size paper,  I also would like to change to portrait layout.  Is this an option when printing from an iPad Mini?

  • R7950 TF3 OC BE with 7950 PCB

    Hi everyone. This is my first post so please go easy on me! I've been gradually putting together a new machine over the last couple of months and finally got around to upgrading my 5850 card. I want to incorporate the new card into my water loop and

  • Regarding Requests to change a user alias / username / displayed name

    Has there been any progress in developing a way to change the name displayed on discussion posts? I didn't realize my full name would appear on my postings and would very much like to edit this on my profile. The posted answer I found that it wasn't