Need XML APIs for finding server status details

Hi,
Can any one help me with the XML API format for finding server status details like Admin State,Avail State,Assoc State,etc.
Thanks and Regards
-Prateek

Here is a very basic example.  I pulled out all the extra error trapping / logging.  I have been building a module that simplifies  most of this .. will produce simple Dumper output for what you are generally looking to do.
The below example will connect to a default UCSM emulator ( http://developer.cisco.com/web/unifiedcomputing/start ) .. just change IP to match.  If you want a significantly more detailed information ( hierarchical ) ... change inHierarchical="false" to  inHierarchical="true".
Let me know if you want something more specific.
#!/usr/local/bin/perl
use strict;
use warnings;
use Data::Dumper;
use LWP::UserAgent;
use HTTP::Request::Common;
use XML::Simple;
use POSIX;
$Data::Dumper::Purity = 1;
$Data::Dumper::Useqq = 1;
### Configurables
my $ucsm = "10.#.#.#";
my $user = "config";
my $pass = "config";
my $proto = "http";
my $cookie;
my $xml = XML::Simple->new();
my $xml_blade = XML::Simple->new(ForceArray => ['computeBlade']);
## Setup User Agent
my $ContentType = "application/x-www-form-urlencode";
my $userAgent = LWP::UserAgent->new(agent => 'perl post');
$userAgent->timeout(5);
&connect;
my $blades = &getblade;
print Dumper $blades;
&disconnect;
### Subroutines
sub connect {
   my $message = q();
   print 'http://'.$ucsm.'/nuova\n';
   my $response = $userAgent->request(POST $proto.'://'.$ucsm.'/nuova', Content_Type => $ContentType, Content => $message);
   my $xml_ref = $xml->XMLin($response->content);
   $cookie = $xml_ref->{outCookie};
sub getblade {
   my $message = q();
   my $response = $userAgent->request(POST $proto.'://'.$ucsm.'/nuova', Content_Type => $ContentType, Content => $message);
   my $xml_ref = $xml_blade->XMLin($response->content, keyattr => []);
   return $xml_ref->{outConfigs};
sub disconnect {
   my $message = q();
   my $response = $userAgent->request(POST $proto.'://'.$ucsm.'/nuova', Content_Type => $ContentType, Content => $message);

Similar Messages

  • Need a code for finding prime no.s from 0 to 100.

    Hi,
    i need a code for finding prime no.s from 0 to 100.
    Please help me out.
    Regards,
    Santosh Kotra.

    hai santosh,
    here is an example program to find the prime number...........
    EXAMPLE:
    DATA: BEGIN OF primes OCCURS 0,
            number TYPE i,
            exp    TYPE i,
          END OF primes.
    DATA: w_mult TYPE i,
          w_limi TYPE i,
          w_prem TYPE i.
    DATA: w_outp TYPE text132.
    DATA: w_rtime TYPE i,
          w_stime TYPE p DECIMALS 3.
    DEFINE add_part.
      sy-fdpos = strlen( &1 ) + 1.
      &1+sy-fdpos(*) = &2.
      condense &1.
    END-OF-DEFINITION.
    PARAMETERS: p_numb TYPE i,                "number to check
                p_fact TYPE c AS CHECKBOX,    "display components
                p_nbpr TYPE c AS CHECKBOX.    "nb of primes
    START-OF-SELECTION.
      GET RUN TIME FIELD w_rtime.
      IF p_nbpr IS INITIAL OR p_numb LE 12000.
        PERFORM eratostene USING p_numb.
        add_part w_outp p_numb.
        READ TABLE primes WITH KEY number = p_numb.
        IF sy-subrc = 0.
          add_part w_outp 'is prime'.
        ELSE.
          IF p_fact IS INITIAL.
            add_part w_outp 'is not prime'.
          ELSE.
            add_part w_outp '='.
            w_limi = p_numb.
            LOOP AT primes WHERE exp GT 0.
              CHECK primes-number LE w_limi.
              IF w_prem GT 0.
                add_part w_outp '*'.
              ENDIF.
              IF primes-exp GT 1.
                add_part w_outp '('.
                add_part w_outp primes-number.
                add_part w_outp '^'.
                add_part w_outp primes-exp.
                add_part w_outp ')'.
              ELSE.
                add_part w_outp primes-number.
              ENDIF.
              w_limi = w_limi / ( primes-number ** primes-exp ).
              IF w_limi = 1.
                EXIT.
              ENDIF.
              w_prem = 1.
            ENDLOOP.
          ENDIF.
        ENDIF.
        WRITE: / w_outp.
        IF NOT p_nbpr IS INITIAL.
          DESCRIBE TABLE primes LINES sy-tmaxl.
          CLEAR: w_outp.
          add_part w_outp 'Number of primes:'.
          add_part w_outp sy-tmaxl.
          WRITE: / w_outp.
          SKIP.
          LOOP AT primes.
            WRITE: / primes-number.
          ENDLOOP.
        ENDIF.
      ELSE.
        PERFORM factors.
      ENDIF.
      GET RUN TIME FIELD w_rtime.
      w_stime = w_rtime / 1000000.
      SKIP.
      CLEAR: w_outp.
      add_part w_outp 'Calculation time:'.
      add_part w_outp w_stime.
      WRITE: / w_outp.
          FORM eratostene                                               *
    FORM eratostene USING in_number TYPE i.
      DATA: BEGIN OF no_primes OCCURS 0,
              number TYPE i,
            END OF no_primes.
      DATA: cnum TYPE i,
            dnum TYPE i,
            limi TYPE i,
            mult TYPE i,
            puis TYPE i,
            cmod TYPE i.
      IF NOT ( p_fact IS INITIAL AND p_nbpr IS INITIAL ).
        limi = in_number.
      ELSE.
        limi = sqrt( in_number ).
      ENDIF.
      cnum = 2.
      WHILE cnum LE limi.
        READ TABLE no_primes WITH KEY number = cnum.
        IF sy-subrc NE 0.
          primes-number = cnum.
          mult = 2.
          puis = 1.
          dnum = mult * cnum.
          WHILE dnum LE in_number.
            READ TABLE no_primes WITH KEY number = dnum.
            IF sy-subrc NE 0.
              no_primes-number = dnum.
              APPEND no_primes.
            ENDIF.
            IF NOT p_fact IS INITIAL.
              cmod = dnum MOD ( cnum ** puis ).
              IF cmod = 0.
                cmod = in_number MOD ( cnum ** puis ).
                IF cmod = 0.
                  primes-exp = puis.
                  puis = puis + 1.
                ENDIF.
              ENDIF.
            ENDIF.
            mult = mult + 1.
            dnum = mult * cnum.
          ENDWHILE.
          APPEND primes.
          CLEAR: primes.
        ENDIF.
        cnum = cnum + 1.
      ENDWHILE.
    ENDFORM.
          FORM factors                                                  *
    FORM factors.
      DATA: ex_factors TYPE string,
            mod        TYPE i,
            still      TYPE f,
            factor     TYPE i,
            exponent   TYPE i,
            square     TYPE f,
            fac_string TYPE text40,
            exp_string TYPE text40.
      IF p_numb LE 3.
        ex_factors = p_numb.
      ELSE.
        factor = 2.
        still  = p_numb.
        DO.
          CLEAR: exponent.
          mod = still MOD factor.
          WHILE mod = 0.
            exponent = exponent + 1.
            still    = still div factor.
            mod      = still MOD factor.
          ENDWHILE.
          IF exponent EQ 1.
            fac_string = factor.
            CONCATENATE ex_factors '*'  fac_string
                                   INTO ex_factors
                           SEPARATED BY space.
            CONDENSE ex_factors.
          ELSEIF exponent GT 1.
            fac_string = factor.
            exp_string = exponent.
            CONCATENATE ex_factors '* (' fac_string
                                   '^'   exp_string ')'
                                   INTO  ex_factors
                           SEPARATED BY space.
            CONDENSE ex_factors.
          ENDIF.
          factor = factor + 1.
          square = factor ** 2.
          IF square GT still.
            EXIT.
          ENDIF.
        ENDDO.
        IF still GT 1.
          CATCH SYSTEM-EXCEPTIONS convt_overflow = 1.
            fac_string = factor = still.
          ENDCATCH.
          IF sy-subrc NE 0.
            fac_string = still.
          ENDIF.
          CONCATENATE ex_factors '*' fac_string
                                INTO ex_factors
                        SEPARATED BY space.
          CONDENSE ex_factors.
        ENDIF.
        SHIFT ex_factors UP TO '*'.
        SHIFT ex_factors BY 2 PLACES.
      ENDIF.
      WRITE: / p_numb RIGHT-JUSTIFIED.
      IF ex_factors CA '*^'.
        WRITE: '=', ex_factors.
      ELSE.
        WRITE: 'is prime'.
      ENDIF.
    ENDFORM.
    HOPE THIS WILL BE HELPFULL.
    regards
    praba.

  • Any practical help about XML API for databases

    HI friends,
    I have a problem, i want to connect to my Database using JSP but by using XML api for database. I want to MAP my database tables, rows columns as xml elements to make it more flexible. Anyone who had practicaly worked on it, please help me out.
    I am waiting for a quick response.
    Thanks for any help in advance,
    Yours Truly,
    Khawaja Salman Sarfraz

    Some databases have a feature that allows you to output the result of a query as XML. But that's not standard SQL, and it probably varies from one DB to the next. Look up the documentation for your DB for more information.

  • What is the good voice xml api for java

    dear buddies,
    what is the best voice xml api for java? has somebody comeacross and work involving this, i would like to hear more about this
    thanks
    Kuha

    Maybe the VXML forum is a better place: http://www.voicexml.org/
    Good luck.

  • API for Proxy Server Connection

    Hi,
    can anybody tell me any API for Proxy Server Connection in java EXCLUDING
    httpclient(apache) and setting system setting and making a urlconnection.

    hey thanx for replying
    Firstly i clear my requirement
    I want some other way of connecting to Proxy Server Irrespective of Httpclient and setting system properties and then making url Connection ,these ways are clear to me .
    I found one API HTTPClient (not belonging to apache Httpclient) its different
    u check this at
    http://www.innovation.ch/java/HTTPClient/api/index-all.html#_S_
    But the problem is this API Does't support NTLM
    i tried to found higher version of this API but i did't get .
    API should support :
    1. NTML
    2.JDK 1.4
    3.SOCKS (not necessary)
    4.HTTP protocol (other like FTP ... not necessary)

  • What is newest/best/simplest Java XML API for loading/saving/validating?

    Here's what I need to do:
    - Load XML files. Preferably validate using XSD validation referenced by "xsi:schemaLocation" hints.
    - Generate XML files. I'd like to be able to specify indentation (tabs?) and "xsi:schemaLocation" XSD hints
    - I'm working with fairly small configuration files, so I'd like to work with document-centric (and not streaming oriented) APIs.
    I've spent a full day reading articles showing different code snippets for different APIs. There are dozens of standards and APIs. Also, all the articles that I can find are several years old at the least.
    This is surprisingly complex for something so seemingly simple.
    What's the best XML API that fits my criteria? Any links for code snippets and up-to-date documentation?
    Thanks!

    Well, XML hasn't changed since it was formalized, and that was in 1999. So there's really no need for people to write new parsers every couple of years any more. And that's why you don't find new tutorials being written every year either. There's really not much need for that.
    Anyway, my recommendation would be to use the classes that are built into your current version of Java. Use them for a while. Once you have experience with them, all those tutorials about other products will start to make sense and you will be able to make an educated decision for yourself.

  • � XML Api for 1.3 java version?

    Hello friends!! I need a little help...
    I always have work in my programms with jbuilder, using java 1.3 version. The programs after will be installed in pc's where have de jre 1.3 or the 1.4 java version.
    I need now to do a module wich need to work with XML.. exactly read xml only, for take some information.
    I tried to use an famous api i have discover by "google":
    import org.xml.sax.*But it not works in java 1.3!! Only for 1.4 or supperior...
    Do you know any api for work with xml compatible with 1.3? I've tried to look this for google.com but it's a very complicated for me...
    Thanks, all i need is the name : )

    If you need to work with java 1.3 you can use the Xerces XML parser
    http://xerces.apache.org/xerces2-j
    You only have to download it and add the jars to your classpath (see the xerces documentation for details)
    Xerces-J also contains the org.xml.sax.* package
    http://xerces.apache.org/xerces2-j/javadocs/api/index.html

  • [METASOLV XML AP]devolop JAVA client using XML API for metasolv application

    Hi All,
    I am new in this group, and I need to help me to develop a java client to communicate with metasolv application using XML API.
    I read "XML API Developer’s Reference" document, but I still not understand how can I setup the cllient.
    I still need:
    1- What API needed(jar files) I must use to build the client
    2- A sample of source code using java.
    3- detailed guide to communicate with metasolv application using XML API.
    Thanks&Best Regards
    RADOUANE Mohamed

    any help please!!!!

  • Needed  Message ID for Weblogic SHUTDOWN Status

    Hi
    We have our OBIEE11g Platform running in Windows platform.
    We have the Weblogic Admin & Managed Services as windows Services
    My Agenda is to monitor the the Weblogic Admin/managed services startup/stop based on messageID.
    Successfully enabled the WL Diagnostics Module(watch/notification) to trigger an email for the Message ID <BEA-000360> "<Server started in RUNNING mode>" ,
    but i could not able to find the relevant Message_ID for the SHUTDOWN status or Stopping mode, please let me know what would be the appropriate similar to the above ?
    Will this "<BEA-000396> <Server shutdown has been requested by weblogic> can act as the correct messageID for shutdown?
    Thanks

    Hi
    I reckon a good monitoring would be BEA-000365, then you would be aware of any server's status changes.
    Cheers,
    Vlad
    Give points - it is good etiquette to reward an answerer points (5 - helpful; 10 - correct) for their post if they answer your question.

  • API for Work Order status from Released to Unreleased or any user defined s

    Dear All
    Is there any API for to change work order status from Released to Unreleased or any user defined status.
    Take care
    Aamir

    Hi Ben,
    As query is resolved, you should close the Thread after rewarding to the Concerned
    Thanks,
    Manish

  • Need utilities class for application server file system (i.e. unix etc)

    I need to do things to directories and files on the application server.
    Is there an SAP class with methods for the application server file system (i.e. unix or whatever) with functionality similiar to what is provided by the methods of CL_GUI_FRONTEND_SERVICES for the presentation server?
    Is there a group of SAP functions for this task?

    You may have a look at Thomas Jung article: [sdn contribution : ABAP Server Side File Access, by Thomas Jung|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/7a13f367-0401-0010-47ba-eab0b15cf31c]
    Moreover, in release 7.10, it could be possible that SAP introduced input and output stream classes (to mimic java classes), so I guess there could be the ones for application server file system.

  • Need download Link for LYNC SERVER 2010

    I Couldn't find the download link for Lync Server 2010.
    It redirects to Lync Server 2013 download page.
    Could anyone please reply me with Lync Server 2010 download link?
    Regards,
    Arun

    The Lync Server 2010 Trial VHD is located at: 
    VHD test drive: Lync Server 2010
    (Eval) - Part 1 of 2
    VHD test drive: Lync Server 2010
    (Eval) - Part 2 of 2
    Please mark posts as answers/helpful if it answers your question.
    Blog
    Lync Validator (BETA) - Used to assist in the validation and documentation of Lync Server 2013.

  • Adaptiv Computing Controller / do i need NFS Mounts for Application Server?

    Hello,
    i got a question about the Adaptiv Computing Controller.
    Do i need NFS Mounts for the Application servers?
    Or can i handle this from the SAN too?
    Can anybody help me here?
    Thanks

    http://ww2.cs.fsu.edu/~rosentha/linux/2.6.26.5/docs/DocBook/libata/ch07.html#excatATAbusErr wrote:
    ATA bus error means that data corruption occurred during transmission over ATA bus (SATA or PATA). This type of errors can be indicated by
    ICRC or ABRT error as described in the section called “ATA/ATAPI device error (non-NCQ / non-CHECK CONDITION)”.
    Controller-specific error completion with error information indicating transmission error.
    On some controllers, command timeout. In this case, there may be a mechanism to determine that the timeout is due to transmission error.
    Unknown/random errors, timeouts and all sorts of weirdities.
    As described above, transmission errors can cause wide variety of symptoms ranging from device ICRC error to random device lockup, and, for many cases, there is no way to tell if an error condition is due to transmission error or not; therefore, it's necessary to employ some kind of heuristic when dealing with errors and timeouts. For example, encountering repetitive ABRT errors for known supported command is likely to indicate ATA bus error.
    Once it's determined that ATA bus errors have possibly occurred, lowering ATA bus transmission speed is one of actions which may alleviate the problem.
    I'd also add; make sure you have good backups when ATA errors are frequent

  • Need Java API for Essbase

    <p>We want to load data in Essbase through a web based application,thus we would need JAVA API's. Please send us any related links,white papers, red books and/or any other links.</p>

    <blockquote>quote:<br><hr><i>Originally posted by: <b>sunny_rush</b></i><BR>com_beacon_essbase_jni_EssApiJni.c:15:20: essotl.h: No such file or directory<BR><hr></blockquote><BR><BR>That package does not appear to be from Hyperion but rather from a third party. Based on the name, it may have come from Beacon Analytics which is now part of Answerthink. Did you have consulting from them in the past?<BR><BR>Tim<BR><BR><BR>

  • Any extra settings I need to make for Sql Server 2012 Install for the purpose of SP 2013

    Hi,
     I am going to install sql serevr 2012 Ent on a stand alone server Win 2012 box[ say Server2] and I want to make this machine as a db box and will make other box[say Server1] SharePoint box.
    [ On Server1 where there is no sql server installed ].
    Do I need to make any extra settings /any mappings/config entries in this box before I install sql on this  Server2 box.
    I mean, in terms of creation of a separate sql instance is required etc ....
    In my prev.installations as a standalone SP install with sql installed on the same box.
    I am facing issue with development with SP 2013. Because though I am having 16GB RAM in one of my dev machines,  with the s/ws like VS 2012, SP D 2013 along with SP 2013 & SQL SEREVR 2012, the debugging is almost NOT
    happening[ its taking "minutes" to hit a breakpoint] at all. 
    help is  appreciated!
    Das

    HI Shankar,Just to be sure with the following settings to configure sharepoint.
    Ensure both boxes in same domain and network
    ensure the connection \telnet is working.
    to instal sharepoint,farm account should have below rights on sql DB.
    db creator,securityadmin
    Check the below link for instaltion of sharepoint 2013.
    http://expertsharepoint.blogspot.de/2013/11/detailed-sharepoint2013-installation-i.html
    Anil Avula[Microsoft Partner,MCP,MCSE,MCSA,MCTS,MCITP,MCSM] See Me At: http://expertsharepoint.blogspot.de/

Maybe you are looking for