Search in sources :

Example 16 with PropertyInfoRestRep

use of com.emc.storageos.model.property.PropertyInfoRestRep in project coprhd-controller by CoprHD.

the class ApiTestVcenter method getCSDiscoveryRefreshRate.

private long getCSDiscoveryRefreshRate() throws NoSuchAlgorithmException {
    BalancedWebResource subTenantAdmin = loginUser(getSecurityAdminWithDomain());
    String configPropertiesApi = getConfigPropertiesApi();
    PropertyInfoRestRep propertyInfoRestRep = subTenantAdmin.path(configPropertiesApi).queryParam("category", "config").get(PropertyInfoRestRep.class);
    Assert.assertNotNull(propertyInfoRestRep);
    String prop = propertyInfoRestRep.getProperty("controller_cs_discovery_refresh_interval");
    Assert.assertNotNull(prop);
    return Long.parseLong(prop);
}
Also used : PropertyInfoRestRep(com.emc.storageos.model.property.PropertyInfoRestRep)

Example 17 with PropertyInfoRestRep

use of com.emc.storageos.model.property.PropertyInfoRestRep in project coprhd-controller by CoprHD.

the class CoordinatorClientImpl method getControlNodesState.

@Override
public ClusterInfo.ClusterState getControlNodesState(String siteId) {
    try {
        // get target repository and configVersion
        final RepositoryInfo targetRepository = getTargetInfo(RepositoryInfo.class);
        final PropertyInfoRestRep targetProperty = getTargetInfo(PropertyInfoExt.class);
        final PowerOffState targetPowerOffState = getTargetInfo(PowerOffState.class);
        final StorageDriversInfo targetDrivers = getTargetInfo(StorageDriversInfo.class);
        // get control nodes' repository and configVersion info
        final Map<Service, RepositoryInfo> controlNodesInfo = getAllNodeInfos(RepositoryInfo.class, CONTROL_NODE_SYSSVC_ID_PATTERN, siteId);
        final Map<Service, ConfigVersion> controlNodesConfigVersions = getAllNodeInfos(ConfigVersion.class, CONTROL_NODE_SYSSVC_ID_PATTERN, siteId);
        final Map<Service, VdcConfigVersion> controlNodesVdcConfigVersions = getAllNodeInfos(VdcConfigVersion.class, CONTROL_NODE_SYSSVC_ID_PATTERN, siteId);
        final Map<Service, StorageDriversInfo> controlNodesDrivers = getAllNodeInfos(StorageDriversInfo.class, CONTROL_NODE_SYSSVC_ID_PATTERN, siteId);
        return getControlNodesState(targetRepository, controlNodesInfo, targetProperty, controlNodesConfigVersions, controlNodesVdcConfigVersions, targetPowerOffState, targetDrivers, controlNodesDrivers, siteId);
    } catch (Exception e) {
        log.info("Fail to get the control node information ", e);
        return ClusterInfo.ClusterState.UNKNOWN;
    }
}
Also used : PropertyInfoRestRep(com.emc.storageos.model.property.PropertyInfoRestRep) RepositoryInfo(com.emc.storageos.coordinator.client.model.RepositoryInfo) VdcConfigVersion(com.emc.storageos.coordinator.client.model.VdcConfigVersion) ConfigVersion(com.emc.storageos.coordinator.client.model.ConfigVersion) Service(com.emc.storageos.coordinator.common.Service) ExecutorService(java.util.concurrent.ExecutorService) StorageDriversInfo(com.emc.storageos.coordinator.client.model.StorageDriversInfo) VdcConfigVersion(com.emc.storageos.coordinator.client.model.VdcConfigVersion) PowerOffState(com.emc.storageos.coordinator.client.model.PowerOffState) CoordinatorException(com.emc.storageos.coordinator.exceptions.CoordinatorException) RetryableCoordinatorException(com.emc.storageos.coordinator.exceptions.RetryableCoordinatorException) KeeperException(org.apache.zookeeper.KeeperException) IOException(java.io.IOException) UnknownHostException(java.net.UnknownHostException)

Example 18 with PropertyInfoRestRep

use of com.emc.storageos.model.property.PropertyInfoRestRep in project coprhd-controller by CoprHD.

the class VdcConfigService method getIpsecProperties.

@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Path("/ipsec-properties")
public PropertyInfoRestRep getIpsecProperties() throws Exception {
    log.info("getting ipsec properties.");
    Map<String, String> ipsecProps = new HashMap();
    ipsecProps.put(IPSEC_KEY, ipsecConfig.getPreSharedKey());
    SiteInfo siteInfo = coordinator.getTargetInfo(SiteInfo.class);
    String vdcConfigVersion = String.valueOf(siteInfo.getVdcConfigVersion());
    ipsecProps.put(VDC_CONFIG_VERSION, vdcConfigVersion);
    log.info("ipsec key: " + ipsecConfig.getPreSharedKey() + ", vdc config version: " + vdcConfigVersion);
    return new PropertyInfoRestRep(ipsecProps);
}
Also used : SiteInfo(com.emc.storageos.coordinator.client.model.SiteInfo) PropertyInfoRestRep(com.emc.storageos.model.property.PropertyInfoRestRep) Path(javax.ws.rs.Path) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET)

Example 19 with PropertyInfoRestRep

use of com.emc.storageos.model.property.PropertyInfoRestRep in project coprhd-controller by CoprHD.

the class SystemHealth method downloadConfigParameters.

public static void downloadConfigParameters() throws UnsupportedEncodingException {
    ViPRSystemClient client = BourneUtil.getSysClient();
    PropertyInfoRestRep propertyInfo = client.config().getProperties(PARAM_CONFIG_PROP);
    Map<String, String> props = propertyInfo.getAllProperties();
    StringBuffer output = new StringBuffer();
    for (Map.Entry<String, String> entry : props.entrySet()) {
        output.append(entry.getKey());
        output.append("=");
        output.append(entry.getValue());
        output.append("\n");
    }
    ByteArrayInputStream is = new ByteArrayInputStream(output.toString().getBytes("UTF-8"));
    renderBinary(is, "configProperties", "text/plain", false);
}
Also used : PropertyInfoRestRep(com.emc.storageos.model.property.PropertyInfoRestRep) ViPRSystemClient(com.emc.vipr.client.ViPRSystemClient) ByteArrayInputStream(java.io.ByteArrayInputStream) Map(java.util.Map)

Aggregations

PropertyInfoRestRep (com.emc.storageos.model.property.PropertyInfoRestRep)19 CheckPermission (com.emc.storageos.security.authorization.CheckPermission)5 Map (java.util.Map)5 HashMap (java.util.HashMap)4 TreeMap (java.util.TreeMap)4 PropertyInfoUpdate (com.emc.storageos.model.property.PropertyInfoUpdate)3 LocalRepositoryException (com.emc.storageos.systemservices.exceptions.LocalRepositoryException)3 PropertyInfoExt (com.emc.storageos.coordinator.client.model.PropertyInfoExt)2 RepositoryInfo (com.emc.storageos.coordinator.client.model.RepositoryInfo)2 APIException (com.emc.storageos.svcs.errorhandling.resources.APIException)2 CoordinatorClientException (com.emc.storageos.systemservices.exceptions.CoordinatorClientException)2 SyssvcException (com.emc.storageos.systemservices.exceptions.SyssvcException)2 SysClientFactory (com.emc.storageos.systemservices.impl.client.SysClientFactory)2 ViPRSystemClient (com.emc.vipr.client.ViPRSystemClient)2 ByteArrayInputStream (java.io.ByteArrayInputStream)2 ConfigVersion (com.emc.storageos.coordinator.client.model.ConfigVersion)1 PowerOffState (com.emc.storageos.coordinator.client.model.PowerOffState)1 SiteInfo (com.emc.storageos.coordinator.client.model.SiteInfo)1 StorageDriversInfo (com.emc.storageos.coordinator.client.model.StorageDriversInfo)1 VdcConfigVersion (com.emc.storageos.coordinator.client.model.VdcConfigVersion)1