Commit e1ab964b by Tomasz Ciesielczyk

node filter bug fix,model repo

parent ac96f9dc
......@@ -57,13 +57,13 @@ class RTMApi private constructor() {
fun checkConf() {
log.info("Start service Check!")
ServerInitializer.check()
RPMApi.instance().getPowerUsageList().toJson(RTMProperties.parsePath("${RTMProperties.basePath}/check_power_usage.json").toString())
val nodes = DAO.Resource.getNodes()
nodes.toJson(RTMProperties.parsePath("${RTMProperties.basePath}/check_node_list.json").toString())
val actionList = ArrayList<ResourceAction>()
val actionResultList = ArrayList<ResourceActionResult>()
var actionList = ArrayList<ResourceAction>()
var actionResultList = ArrayList<ResourceActionResult>()
nodes.values.forEach { node ->
Utils.getPropertyAction(node.id, 100.0, null)?.let { actionList.addAll(it) }
Utils.getPropertyAction(node.id, 0.0, null)?.let { actionList.addAll(it) }
}
actionList.toJson(RTMProperties.parsePath("${RTMProperties.basePath}/check_reset_actions.json").toString())
actionList.forEach { action ->
......@@ -74,8 +74,25 @@ class RTMApi private constructor() {
actionList.toJson(RTMProperties.parsePath("${RTMProperties.basePath}/check_reset_actions_result.json").toString())
val limits = PCMApi.instance().checkLimits()
val state = CurrentState(limits.currentPowerUsage)
RPMApi.instance().getPowerUsageList().toJson(RTMProperties.parsePath("${RTMProperties.basePath}/check_power_usage.json").toString())
//init solvers in order to dump their state
PCMAlgorithm(state)
Thread.sleep(5000)
actionList = ArrayList<ResourceAction>()
actionResultList = ArrayList<ResourceActionResult>()
nodes.values.forEach { node ->
Utils.getPropertyAction(node.id, 100.0, null)?.let { actionList.addAll(it) }
}
actionList.toJson(RTMProperties.parsePath("${RTMProperties.basePath}/check_reset_actions_100.json").toString())
actionList.forEach { action ->
RPMApi.instance().startAction(action).let { result ->
actionResultList.add(result)
}
}
actionList.toJson(RTMProperties.parsePath("${RTMProperties.basePath}/check_reset_actions_result_100.json").toString())
Thread.sleep(5000)
RPMApi.instance().getPowerUsageList().toJson(RTMProperties.parsePath("${RTMProperties.basePath}/check_power_usage_100.json").toString())
// ESMAlgorithm(state)
......
package psnc.m2dc.rtm.commands.java
val APP_VERSION = "1.0.519_67629"
\ No newline at end of file
val APP_VERSION = "1.0.529_34574"
\ No newline at end of file
package psnc.m2dc.rtm.client
const val APP_VERSION = "1.1.519_67629"
\ No newline at end of file
const val APP_VERSION = "1.1.529_34575"
\ No newline at end of file
......@@ -88,7 +88,10 @@ class ResourceManager : DataDAO() {
// val resources = HashMap<String, Resource>()
orderedSourceList.forEach { src ->
if (srcList.contains(src)) {
loadResources(src).forEach { loaded ->
loadResources(src).filter {
(!Keys.TestBed.filter_nodes.get() ||
Keys.TestBed.resource_list.getNullable()?.contains(it.key) ?: false)
}.forEach { loaded ->
loaded.value.get(Resource.Property.is_node, true)
// printConsole(DAO.Resource.getResources()[loaded.value.id]?.toJson() ?: "null: ${loaded.value.id}")
loaded.value.saveIndex(nodeIndex, "resources", loaded.key)
......@@ -166,9 +169,7 @@ class ResourceManager : DataDAO() {
logDebug("Loading child resources for: ${resource.id}")
val res = HashMap<String, Resource>()
try {
if (resource.childResources == null) {
resource.childResources = ArrayList()
}
if (resource.childResources == null) resource.childResources = ArrayList()
val type = this.getResourceType(resource)
type.apiMap[ApiType.sub_component]?.firstOrNull()?.let { apiDetails ->
when (apiDetails.api) {
......
......@@ -124,11 +124,13 @@ class RECSMonitoringApi private constructor(/*storage: IStorage<String>? = null*
try {
val sshHost = DAO.Resource.getRemoteApiEndpoint(ManagementApi.ssh, resourceId)
?: { logError("endpoint not found for $resourceId");null }()!!
LightStorage.instance.put(listOf("resources", resourceId, "properties", "ssh_host"), sshHost)
// LightStorage.instance.put(listOf("resources", resourceId, "properties", "ssh_host"), sshHost)
resource.put(Resource.Property.ssh_host,sshHost)
val sshUsername = LightStorage.instance.get<String>("resources", resourceId, "properties", "ssh_username")
?: Keys.RTM.default_ssh_user.getNullable()
?: throw NullPointerException("sshUsername not provided")
LightStorage.instance.put(listOf("resources", resourceId, "properties", "ssh_username"), sshUsername)
// LightStorage.instance.put(listOf("resources", resourceId, "properties", "ssh_username"), sshUsername)
resource.put(Resource.Property.ssh_username,sshUsername)
val task = submitTask(sshHost, sshUsername, resource)
map[resource] = task
} catch (e: NullPointerException) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment