Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Adding method to get server types per platform. This allows to track …
…server types avails similarly shown in HQ gui.
  • Loading branch information
jvalkeal committed Jan 7, 2012
1 parent c53837d commit a7b6e2d
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions wallmount/app/DynResourceApi.groovy
Expand Up @@ -301,6 +301,30 @@ class DynResourceApi {

ret
}

/**
* Gets server resource types for existing
* server resources in a platform.
*
* Map keys:
* resource - A map representing a platform resource.
*
* @return Returns a list of maps containing title and tracks.
*/
def getServerPrototypesByPlatform(map) {
def ret = []
def platId = map.resource.eid[2..-1] as Integer

def types = [:]

serverManager.getServersByPlatform(user, platId, true, PageControl.PAGE_ALL).each{
types[it.serverType.id] = it.serverType.name
}
types.each{ key, value ->
ret << [title: value, tracks:[[id:"2:" + key, scope:"tavail/1:" + platId +"/"]]]
}
ret
}


private String resourceProtoToEid(res) {
Expand Down

0 comments on commit a7b6e2d

Please sign in to comment.