public String getApiType() { return this.connection.getServiceContent().getAbout().getApiType(); }
public static void main(String[] args) throws Exception { CommandLineParser clp = new CommandLineParser(constructOptions(), args); String urlStr = clp.get_option("url"); String username = clp.get_option("username"); String password = clp.get_option("password"); String dcname = clp.get_option("datacenter");; String hostname = clp.get_option("host"); String portGroupName = clp.get_option("portgroupname"); ServiceInstance si = new ServiceInstance(new URL(urlStr), username, password, true); Folder rootFolder = si.getRootFolder(); HostSystem host = null; String apiType = si.getAboutInfo().getApiType(); if("HostAgent".equalsIgnoreCase(apiType) && dcname ==null) { dcname = "ha-datacenter"; } else if("VirtualCenter".equalsIgnoreCase(apiType) && ((dcname == null) || (hostname ==null))) { System.out.println("datacenter and host should be specified"); return; } Datacenter dc = (Datacenter) new InventoryNavigator(rootFolder).searchManagedEntity("Datacenter", dcname); host = (HostSystem) new InventoryNavigator(dc).searchManagedEntity("HostSystem", hostname); removeVirtualNic(host, portGroupName); }
public static void main(String[] args) throws Exception { CommandLineParser clp = new CommandLineParser(constructOptions(), args); String urlStr = clp.get_option("url"); String username = clp.get_option("username"); String password = clp.get_option("password"); String dcname = clp.get_option("datacenter");; String hostname = clp.get_option("host"); String portGroupName = clp.get_option("portgroupname"); ServiceInstance si = new ServiceInstance(new URL(urlStr), username, password, true); Folder rootFolder = si.getRootFolder(); HostSystem host = null; String apiType = si.getAboutInfo().getApiType(); if("HostAgent".equalsIgnoreCase(apiType) && dcname ==null) { dcname = "ha-datacenter"; } else if("VirtualCenter".equalsIgnoreCase(apiType) && ((dcname == null) || (hostname ==null))) { System.out.println("datacenter and host should be specified"); return; } Datacenter dc = (Datacenter) new InventoryNavigator(rootFolder).searchManagedEntity("Datacenter", dcname); host = (HostSystem) new InventoryNavigator(dc).searchManagedEntity("HostSystem", hostname); removeVirtualPortGroup(host, portGroupName); }
public static void main(String[] args) throws Exception { CommandLineParser clp = new CommandLineParser(constructOptions(), args); String urlStr = clp.get_option("url"); String username = clp.get_option("username"); String password = clp.get_option("password"); String dcname = clp.get_option("datacenter");; String hostname = clp.get_option("host"); String portGroupName = clp.get_option("portgroupname"); ServiceInstance si = new ServiceInstance(new URL(urlStr), username, password, true); Folder rootFolder = si.getRootFolder(); HostSystem host = null; String apiType = si.getAboutInfo().getApiType(); if("HostAgent".equalsIgnoreCase(apiType) && dcname ==null) { dcname = "ha-datacenter"; } else if("VirtualCenter".equalsIgnoreCase(apiType) && ((dcname == null) || (hostname ==null))) { System.out.println("datacenter and host should be specified"); return; } Datacenter dc = (Datacenter) new InventoryNavigator(rootFolder).searchManagedEntity("Datacenter", dcname); host = (HostSystem) new InventoryNavigator(dc).searchManagedEntity("HostSystem", hostname); removeVirtualNic(host, portGroupName); }
public static void main(String[] args) throws Exception { CommandLineParser clp = new CommandLineParser(constructOptions(), args); String urlStr = clp.get_option("url"); String username = clp.get_option("username"); String password = clp.get_option("password"); String dcname = clp.get_option("datacenter");; String hostname = clp.get_option("host"); String vswitchId = clp.get_option("vswitchid"); ServiceInstance si = new ServiceInstance(new URL(urlStr), username, password, true); Folder rootFolder = si.getRootFolder(); HostSystem host = null; String apiType = si.getAboutInfo().getApiType(); if("HostAgent".equalsIgnoreCase(apiType) && dcname ==null) { dcname = "ha-datacenter"; } else if("VirtualCenter".equalsIgnoreCase(apiType) && ((dcname == null) || (hostname ==null))) { System.out.println("datacenter and host should be specified"); return; } Datacenter dc = (Datacenter) new InventoryNavigator(rootFolder).searchManagedEntity("Datacenter", dcname); host = (HostSystem) new InventoryNavigator(dc).searchManagedEntity("HostSystem", hostname); removeVirtualSwitch(host, vswitchId); }
public static void main(String[] args) throws Exception { CommandLineParser clp = new CommandLineParser(constructOptions(), args); String urlStr = clp.get_option("url"); String username = clp.get_option("username"); String password = clp.get_option("password"); String dcname = clp.get_option("datacenter");; String hostname = clp.get_option("host"); String portGroupName = clp.get_option("portgroupname"); ServiceInstance si = new ServiceInstance(new URL(urlStr), username, password, true); Folder rootFolder = si.getRootFolder(); HostSystem host = null; String apiType = si.getAboutInfo().getApiType(); if("HostAgent".equalsIgnoreCase(apiType) && dcname ==null) { dcname = "ha-datacenter"; } else if("VirtualCenter".equalsIgnoreCase(apiType) && ((dcname == null) || (hostname ==null))) { System.out.println("datacenter and host should be specified"); return; } Datacenter dc = (Datacenter) new InventoryNavigator(rootFolder).searchManagedEntity("Datacenter", dcname); host = (HostSystem) new InventoryNavigator(dc).searchManagedEntity("HostSystem", hostname); removeVirtualPortGroup(host, portGroupName); }
public static void main(String[] args) throws Exception { CommandLineParser clp = new CommandLineParser(constructOptions(), args); String urlStr = clp.get_option("url"); String username = clp.get_option("username"); String password = clp.get_option("password"); String dcname = clp.get_option("datacenter");; String hostname = clp.get_option("host"); String vswitchId = clp.get_option("vswitchid"); ServiceInstance si = new ServiceInstance(new URL(urlStr), username, password, true); Folder rootFolder = si.getRootFolder(); HostSystem host = null; String apiType = si.getAboutInfo().getApiType(); if("HostAgent".equalsIgnoreCase(apiType) && dcname ==null) { dcname = "ha-datacenter"; } else if("VirtualCenter".equalsIgnoreCase(apiType) && ((dcname == null) || (hostname ==null))) { System.out.println("datacenter and host should be specified"); return; } Datacenter dc = (Datacenter) new InventoryNavigator(rootFolder).searchManagedEntity("Datacenter", dcname); host = (HostSystem) new InventoryNavigator(dc).searchManagedEntity("HostSystem", hostname); removeVirtualSwitch(host, vswitchId); }
public static void main(String[] args) throws Exception { CommandLineParser clp = new CommandLineParser(constructOptions(), args); String urlStr = clp.get_option("url"); String username = clp.get_option("username"); String password = clp.get_option("password"); String dcname = clp.get_option("datacenter");; String hostname = clp.get_option("host"); String vswitchId = clp.get_option("vswitchid"); String portGroupName = clp.get_option("portgroupname"); ServiceInstance si = new ServiceInstance(new URL(urlStr), username, password, true); Folder rootFolder = si.getRootFolder(); HostSystem host = null; String apiType = si.getAboutInfo().getApiType(); if("HostAgent".equalsIgnoreCase(apiType) && dcname ==null) { dcname = "ha-datacenter"; } else if("VirtualCenter".equalsIgnoreCase(apiType) && ((dcname == null) || (hostname ==null))) { System.out.println("datacenter and host should be specified"); return; } Datacenter dc = (Datacenter) new InventoryNavigator(rootFolder).searchManagedEntity("Datacenter", dcname); host = (HostSystem) new InventoryNavigator(dc).searchManagedEntity("HostSystem", hostname); addVirtualSwitchPortGroup(host, vswitchId, portGroupName); }
public static void main(String[] args) throws Exception { CommandLineParser clp = new CommandLineParser(constructOptions(), args); String urlStr = clp.get_option("url"); String username = clp.get_option("username"); String password = clp.get_option("password"); String dcname = clp.get_option("datacenter");; String hostname = clp.get_option("host"); String vswitchId = clp.get_option("vswitchid"); String portGroupName = clp.get_option("portgroupname"); ServiceInstance si = new ServiceInstance(new URL(urlStr), username, password, true); Folder rootFolder = si.getRootFolder(); HostSystem host = null; String apiType = si.getAboutInfo().getApiType(); if("HostAgent".equalsIgnoreCase(apiType) && dcname ==null) { dcname = "ha-datacenter"; } else if("VirtualCenter".equalsIgnoreCase(apiType) && ((dcname == null) || (hostname ==null))) { System.out.println("datacenter and host should be specified"); return; } Datacenter dc = (Datacenter) new InventoryNavigator(rootFolder).searchManagedEntity("Datacenter", dcname); host = (HostSystem) new InventoryNavigator(dc).searchManagedEntity("HostSystem", hostname); addVirtualSwitchPortGroup(host, vswitchId, portGroupName); }
buffer.append("Configuration file generated for:\n\n"); buffer.append("Full name.......: " + serviceInstance.getAboutInfo().getFullName() + "\n"); buffer.append("API type........: " + serviceInstance.getAboutInfo().getApiType() + "\n"); buffer.append("API version.....: " + serviceInstance.getAboutInfo().getApiVersion() + "\n"); buffer.append("Product name....: " + serviceInstance.getAboutInfo().getLicenseProductName() + "\n");
buffer.append("Configuration file generated for:\n\n"); buffer.append("Full name.......: " + serviceInstance.getAboutInfo().getFullName() + "\n"); buffer.append("API type........: " + serviceInstance.getAboutInfo().getApiType() + "\n"); buffer.append("API version.....: " + serviceInstance.getAboutInfo().getApiVersion() + "\n"); buffer.append("Product name....: " + serviceInstance.getAboutInfo().getLicenseProductName() + "\n");