public Partition[] getPartitions(String deploymentPolicyId, String partitionGroupId) throws RestAPIException{
if(!deploymentPolicyMap.containsKey(deploymentPolicyId)){
throw new RestAPIException("There is no deployment policy with id: " + deploymentPolicyId);
}
Partition[] partitions = null;
DeploymentPolicy deploymentPolicy = deploymentPolicyMap.get(deploymentPolicyId);
for(PartitionGroup partitionGroup : deploymentPolicy.partitionGroup){
if(partitionGroup.id.equals(partitionGroupId)){
partitions = partitionGroup.partition.toArray(new Partition[0]);
}
}