Search in sources :

Example 1 with ConfigResolveDns

use of com.emc.cloud.platform.ucs.in.model.ConfigResolveDns in project coprhd-controller by CoprHD.

the class UcsLoginLogoutTest method getBlades.

@Test(groups = "runByDefault", dependsOnMethods = "testGetBladeDNs")
public void getBlades() throws ClientGeneralException, IllegalAccessException, InvocationTargetException, NoSuchMethodException {
    ConfigResolveDns configResolveDns = new ConfigResolveDns();
    configResolveDns.setInHierarchical("false");
    com.emc.cloud.platform.ucs.in.model.DnSet inDnSet = new com.emc.cloud.platform.ucs.in.model.DnSet();
    for (Dn dn : this.dnSet.getDn()) {
        com.emc.cloud.platform.ucs.in.model.DnSet.Dn inDn = new com.emc.cloud.platform.ucs.in.model.DnSet.Dn();
        inDn.setValue(dn.getValue());
        inDnSet.getDn().add(inDn);
    }
    configResolveDns.getContent().add(new JAXBElement<com.emc.cloud.platform.ucs.in.model.DnSet>(new QName("inDns"), com.emc.cloud.platform.ucs.in.model.DnSet.class, inDnSet));
    com.emc.cloud.platform.ucs.out.model.ConfigResolveDns configResolveDnsOut = clientHttpMethods.postEntity(factory.createConfigResolveDns(configResolveDns), com.emc.cloud.platform.ucs.out.model.ConfigResolveDns.class);
    System.out.println(BeanUtils.describe(configResolveDnsOut));
    if (configResolveDnsOut.getContent() != null && !configResolveDnsOut.getContent().isEmpty()) {
        for (Object object : configResolveDnsOut.getContent()) {
            if (object instanceof JAXBElement<?>) {
                if (!(((JAXBElement) object).getValue() instanceof ConfigSet)) {
                    continue;
                }
                configSet = ((JAXBElement<ConfigSet>) object).getValue();
                if (configSet != null && configSet.getManagedObject() != null && !configSet.getManagedObject().isEmpty()) {
                    for (JAXBElement<?> managedObject : configSet.getManagedObject()) {
                        System.out.println("\t\t" + BeanUtils.describe(managedObject.getValue()));
                    }
                }
            }
        }
    }
}
Also used : QName(javax.xml.namespace.QName) DnSet(com.emc.cloud.platform.ucs.out.model.DnSet) Dn(com.emc.cloud.platform.ucs.out.model.DnSet.Dn) JAXBElement(javax.xml.bind.JAXBElement) ConfigResolveDns(com.emc.cloud.platform.ucs.in.model.ConfigResolveDns) ConfigSet(com.emc.cloud.platform.ucs.out.model.ConfigSet) Test(org.testng.annotations.Test)

Aggregations

ConfigResolveDns (com.emc.cloud.platform.ucs.in.model.ConfigResolveDns)1 ConfigSet (com.emc.cloud.platform.ucs.out.model.ConfigSet)1 DnSet (com.emc.cloud.platform.ucs.out.model.DnSet)1 Dn (com.emc.cloud.platform.ucs.out.model.DnSet.Dn)1 JAXBElement (javax.xml.bind.JAXBElement)1 QName (javax.xml.namespace.QName)1 Test (org.testng.annotations.Test)1