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);
}
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;
}
}
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);
}
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);
}
Aggregations