<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to retrieve list of vCenters with FQDN and GUID in a Enhanced linked mode using web services in vSphere SDK for Java Discussions</title>
    <link>https://communities.vmware.com/t5/vSphere-SDK-for-Java-Discussions/How-to-retrieve-list-of-vCenters-with-FQDN-and-GUID-in-a/m-p/2849877#M710</link>
    <description>&lt;P&gt;&lt;STRONG&gt;Rest APIs:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;1)&amp;nbsp; GET:&amp;nbsp;&amp;nbsp;&lt;A href="https://{vcenter}/api/vcenter/topology/nodes" target="_blank" rel="noopener"&gt;https://{vcenter}/api/vcenter/topology/nodes&lt;/A&gt;&lt;/P&gt;&lt;P&gt;2)&amp;nbsp; GET:&amp;nbsp;&lt;A href="https://{vcenter}/api/vcenter/topology/replication-status" target="_blank" rel="noopener"&gt;https://{vcenter}/api/vcenter/topology/replication-status&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Web Service sample java code:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Here is the sample code to get all linked vCenters by using userAgent , here userAgent is the name of user agent or application. In my case I opened my linked VC atleast onetime with web client, so userAgent comparing with "web-client" in the code.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;Set&amp;lt;String&amp;gt; vcList = new HashSet&amp;lt;String&amp;gt;();&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;System.out.println(serviceInstance.getAboutInfo().getInstanceUuid());&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;SessionManager sessionMgr = serviceInstance.getSessionManager();&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;UserSession[] userSessions = sessionMgr.getSessionList();&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;for (UserSession userSession:userSessions) {&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; if (userSession.getUserName().contains("vsphere-webclient")) {&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; vcList.add(userSession.getIpAddress());&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 29 May 2021 10:44:16 GMT</pubDate>
    <dc:creator>doskiran</dc:creator>
    <dc:date>2021-05-29T10:44:16Z</dc:date>
    <item>
      <title>How to retrieve list of vCenters with FQDN and GUID in a Enhanced linked mode using web services sdk</title>
      <link>https://communities.vmware.com/t5/vSphere-SDK-for-Java-Discussions/How-to-retrieve-list-of-vCenters-with-FQDN-and-GUID-in-a/m-p/2821359#M705</link>
      <description>&lt;P&gt;How to retrieve list of vCenters with FQDN and GUID in a Enhanced linked mode using web services sdk?&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jan 2021 18:47:48 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-SDK-for-Java-Discussions/How-to-retrieve-list-of-vCenters-with-FQDN-and-GUID-in-a/m-p/2821359#M705</guid>
      <dc:creator>kumar_t</dc:creator>
      <dc:date>2021-01-07T18:47:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve list of vCenters with FQDN and GUID in a Enhanced linked mode using web services</title>
      <link>https://communities.vmware.com/t5/vSphere-SDK-for-Java-Discussions/How-to-retrieve-list-of-vCenters-with-FQDN-and-GUID-in-a/m-p/2849877#M710</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Rest APIs:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;1)&amp;nbsp; GET:&amp;nbsp;&amp;nbsp;&lt;A href="https://{vcenter}/api/vcenter/topology/nodes" target="_blank" rel="noopener"&gt;https://{vcenter}/api/vcenter/topology/nodes&lt;/A&gt;&lt;/P&gt;&lt;P&gt;2)&amp;nbsp; GET:&amp;nbsp;&lt;A href="https://{vcenter}/api/vcenter/topology/replication-status" target="_blank" rel="noopener"&gt;https://{vcenter}/api/vcenter/topology/replication-status&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Web Service sample java code:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Here is the sample code to get all linked vCenters by using userAgent , here userAgent is the name of user agent or application. In my case I opened my linked VC atleast onetime with web client, so userAgent comparing with "web-client" in the code.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;Set&amp;lt;String&amp;gt; vcList = new HashSet&amp;lt;String&amp;gt;();&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;System.out.println(serviceInstance.getAboutInfo().getInstanceUuid());&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;SessionManager sessionMgr = serviceInstance.getSessionManager();&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;UserSession[] userSessions = sessionMgr.getSessionList();&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;for (UserSession userSession:userSessions) {&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; if (userSession.getUserName().contains("vsphere-webclient")) {&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; vcList.add(userSession.getIpAddress());&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 29 May 2021 10:44:16 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-SDK-for-Java-Discussions/How-to-retrieve-list-of-vCenters-with-FQDN-and-GUID-in-a/m-p/2849877#M710</guid>
      <dc:creator>doskiran</dc:creator>
      <dc:date>2021-05-29T10:44:16Z</dc:date>
    </item>
  </channel>
</rss>

