get a list of nodes/containers from pva via api

Discussion in 'General Questions' started by Ed_Greenberg, Feb 10, 2016.

  1. Ed_Greenberg

    Ed_Greenberg Kilo Poster

    Messages:
    22
    Hi folks,

    I'd like to be able to retrieve lists of the nodes that I have in PVA?. Is this possible? If so, can you point me at the API call to do so?

    Thanks,

    Ed
     
  2. Pavel

    Pavel A.I. Auto-Responder Staff Member

    Messages:
    475
    Hello Ed,

    Apparently it won't be the last question regarding PVA API - often "get list" is just a beginning :)
    You can find documentation with examples here:
    http://download.swsoft.com/pva/61/docs/en/pdf/PVA_Agent_XML_API_Reference.pdf

    And I'd recommend you to check the following article: https://kb.odin.com/en/111223
    It helps you to capture packets which are sent when you click various buttons in PVA. That is applicable to a single-node scope however. It doesn't explain how to apply it to PVA MN itself.
    You can also send/test packages you came up with using steps from this article: https://kb.odin.com/111220

    If you want to capture packets sent to PVA MN by its web interface (when you click a button in PVA MN interface send package to PVA MN internals - you can capture it to re-use afterwards) you can follow these simple steps:

    - edit pva cc config:
    -------------------------------------------------------------------------------------
    [root@3rdline-pvamn cc]# diff /etc/opt/pva/cc/pvacc.conf /etc/opt/pva/cc/pvacc.conf.orig -pruN
    --- /etc/opt/pva/cc/pvacc.conf 2016-02-11 20:26:04.678805151 +0300
    +++ /etc/opt/pva/cc/pvacc.conf.orig 2016-02-11 20:33:06.927803989 +0300
    @@ -31,8 +31,8 @@
    </local>
    </connection>
    <logging>
    - <level>50</level>
    - <agent_level>4</agent_level>
    + <level>1</level>
    + <agent_level>3</agent_level>
    <path>/var/log/pva/cc</path>
    </logging>
    <operators>
    [root@3rdline-pvamn cc]#
    -------------------------------------------------------------------------------------
    - restart pva cc (it will not interrupt active operations like backup or migration, but all active sessions GUI will be dropped)
    # pvacc restart
    - go to GUI and do whatever your heart tells you to do
    - open /var/log/pva/cc/agent.log and find the packet you'd want to re-use. There might be quite a pile but if you look at the "target" it will make it clear quite fast whether packet is useful or not.

    However, my experience shows that it would much easier to work with nodes individually rather than through PVA MN - some functionality is much easier and cheaper (in terms of effort and code-time) to reach via connection to single node instead of PVA MN
     
  3. Ed_Greenberg

    Ed_Greenberg Kilo Poster

    Messages:
    22
    >>However, my experience shows that it would much easier to work with nodes individually rather than through PVA MN - some functionality is much easier and cheaper (in terms of effort and code-time) to reach via connection to single node instead of PVA MN<<

    You've advised me of this before, and I'm fine with it, but I just need to start with a list of nodes, and where to get that but PVA?

    In any event, I've been reviewing the contents of the agent log, and what I did was to click on "Hardware Nodes" under infrastructure, but I don't see anything in the log that is useful

    Any suggestions?
     
  4. Pavel

    Pavel A.I. Auto-Responder Staff Member

    Messages:
    475
    Hello Ed.

    Indeed, this one wasn't easy to catch from the logs because, apparently, list of servers does not take place here in the same way we expect it to be.
    Following packet should help you getting list of nodes' eids:
    Code:
    <packet version="4.0.0" id="2">
    <target>server_group</target>
    <data>
    <server_group>
    <get_list>
    <type>generic</type>
    </get_list>
    </server_group>
    </data>
    </packet>
    
    And sample reply you get from it (from my sandbox):
    Code:
    <packet version="4.0.0" priority="0" id="2" type="0" time="2016-03-16T08:44:46+0000">
    <origin>server_group</origin>
    <target>vzclient11140-613435b1-44de-1444-b194-c58c7fbb33ca</target>
    <dst>
    <director>gend</director>
    </dst>
    <data>
    <server_group>
    <eid>47794122-868d-0844-b51b-a895803d7b14</eid>
    <eid>613435b1-44de-1444-b194-c58c7fbb33ca</eid>
    <eid>bc3dbc18-e43a-2042-bf91-5b271e59fca6</eid>
    <eid>ece236e2-9196-9c49-8766-efc8c0e0703d</eid>
    <eid>719c3c50-c40d-9d44-b9b1-5563bbd64aa0</eid>
    <eid>4f137663-99d2-9f45-8587-7fcc9f914dd4</eid>
    <eid>ecfc404a-050e-a048-b402-ab952a3407b7</eid>
    </server_group>
    </data>
    <src>
    <director>gend</director>
    </src>
    </packet>
    
    As far as I can see server_group target is properly documented in the PDF, you might find more useful calls over there.
    http://download.swsoft.com/pva/61/docs/en/pdf/PVA_Agent_XML_API_Reference.pdf
    page 122

    Please let me know if you'll get stuck with any other call, I'll try to help you.
     

Share This Page