From e1d97caa841c7d859ab5b40965b6573dd1413fb0 Mon Sep 17 00:00:00 2001
From: Jorrit Schaap <schaap@astron.nl>
Date: Fri, 13 Sep 2019 15:33:45 +0200
Subject: [PATCH] SW-816: rewrote t_resourceassigner to use a testing-RADB,
 thereby removing many wrong assumptions made in the mocks. The
 resource_assgner and its schedulers can still be simplified significantly if
 we just use the RADB as designed; just insert the claims, and let the RADB
 check/set the conlict status.

---
 .../test/t_resourceassigner.py                | 1617 +++--------------
 1 file changed, 211 insertions(+), 1406 deletions(-)

diff --git a/SAS/ResourceAssignment/ResourceAssigner/test/t_resourceassigner.py b/SAS/ResourceAssignment/ResourceAssigner/test/t_resourceassigner.py
index 01428261918..2cc49b25513 100755
--- a/SAS/ResourceAssignment/ResourceAssigner/test/t_resourceassigner.py
+++ b/SAS/ResourceAssignment/ResourceAssigner/test/t_resourceassigner.py
@@ -22,41 +22,35 @@ import unittest
 from unittest import mock
 import datetime
 import sys
+from copy import deepcopy
 
 import logging
 logging.basicConfig(format='%(asctime)s %(levelname)s %(process)s %(message)s', level=logging.INFO)
 
-from lofar.sas.resourceassignment.resourceassigner.resource_assigner import ResourceAssigner, DEFAULT_RA_NOTIFICATION_PREFIX
-from lofar.sas.resourceassignment.resourceassigner.resource_availability_checker import ResourceAvailabilityChecker
+from lofar.sas.resourceassignment.resourceassigner.config import DEFAULT_RA_NOTIFICATION_PREFIX
+from lofar.sas.resourceassignment.resourceassigner.resource_assigner import ResourceAssigner
+from lofar.messaging.messagebus import TemporaryExchange
 from lofar.sas.resourceassignment.common.specification import Specification
-from lofar.parameterset import parameterset
-from lofar.common.datetimeutils import parseDatetime
 from lofar.common.util import single_line_with_single_spaces
+from lofar.messaging.messages import EventMessage
 
+try:
+    from . import radb_common_testing
+except (ImportError, SystemError):
+    import radb_common_testing
 
-class TestingResourceAssigner(ResourceAssigner):
-    def __init__(self, rarpc, rerpc, otdbrpc, momrpc, curpc, sqrpc, ra_notification_bus, dwell_scheduler, obscontrol,
-                 radb_dbcreds=None):
-        # super gets not done to be able to insert mocks as early as possible otherwise the RPC block unittesting
-        self.radbrpc = rarpc
-        self.rerpc = rerpc
-        self.otdbrpc = otdbrpc
-        self.momrpc = momrpc
-        self.curpc = curpc
-        self.sqrpc = sqrpc
-        self.ra_notification_bus = ra_notification_bus
-        # Could mock ResourceAvailabilityChecker, but it is out of play already due to mocked DwellScheduler
-        self.resource_availability_checker = ResourceAvailabilityChecker(rarpc)
-        self.dwell_scheduler = dwell_scheduler
-        self.obscontrol = obscontrol
-        self.radb_creds = radb_dbcreds
-
-
-class ResourceAssignerTest(unittest.TestCase):
+
+def setUpModule():
+    return radb_common_testing.setUpModule()
+
+
+def tearDownModule():
+    return radb_common_testing.tearDownModule()
+
+class ResourceAssignerTest(radb_common_testing.RADBCommonTest):
     mom_id = 351557
     otdb_id = 1290494
     specification_id = 2323
-    state = 'prescheduled'
     task_type = 'pipeline'
 
     specification_tree = {}
@@ -78,36 +72,16 @@ class ResourceAssignerTest(unittest.TestCase):
         }
     }
 
-    approved_status = 'approved'
-    approved_otdb_id = 22
-    approved_specification_tree = {
-        'otdb_id': approved_otdb_id,
-        'task_type': 'pipeline',
-        'state': approved_status,
-        'specification': {
-            'Observation.startTime': future_start_time,
-            'Observation.stopTime': future_stop_time
-        }
-    }
-
-    cep2_specification_tree = {
-        'otdb_id': otdb_id,
-        'task_type': 'pipeline',
-        'state': 'prescheduled',
-        'specification': {
-            'Observation.startTime': future_start_time,
-            'Observation.stopTime': future_stop_time,
-            'Observation.DataProducts.Output_Pulsar.enabled': True,
-            'Observation.DataProducts.Output_Pulsar.storageClusterName': 'CEP2'
-        }
-    }
-
     mom_bug_processing_cluster_name = 'CEP2'
     mom_bug_otdb_id = 1234
     mom_bug_specification_tree = {
         'otdb_id': mom_bug_otdb_id,
+        'mom_id': None,
+        'task_id': None,
         'task_type': 'pipeline',
         'state': 'prescheduled',
+        'starttime': datetime.datetime.utcnow(),
+        'endtime': datetime.datetime.utcnow() + datetime.timedelta(minutes=1),
         'specification': {
             'Observation.startTime': future_start_time,
             'Observation.stopTime': future_stop_time,
@@ -117,32 +91,6 @@ class ResourceAssignerTest(unittest.TestCase):
         }
     }
 
-    maintenance_otdb_id = 5678
-    maintenance_specification_tree = {
-        'otdb_id': maintenance_otdb_id,
-        'task_type': 'reservation',
-        'task_subtype': 'maintenance',
-        'state': 'prescheduled',
-        'specification': {
-            'Observation.startTime': future_start_time,
-            'Observation.stopTime': future_stop_time,
-            'Observation.VirtualInstrument.stationList': ['CS001'],
-        }
-    }
-
-    projectreservation_otdb_id = 8765
-    projectreservation_specification_tree = {
-        'otdb_id': projectreservation_otdb_id,
-        'task_type': 'reservation',
-        'task_subtype': 'project',
-        'state': 'prescheduled',
-        'specification': {
-            'Observation.startTime': future_start_time,
-            'Observation.stopTime': future_stop_time,
-            'Observation.VirtualInstrument.stationList': ['CS001'],
-        }
-    }
-
     task_mom_id = 351543
     task_otdb_id = 1290472
     task_id = 2299
@@ -159,53 +107,17 @@ class ResourceAssignerTest(unittest.TestCase):
     predecessor_task_mom_id = 1
     predecessor_task_otdb_id = 2
     predecessor_task_id = 3
-    predecessor_task = {
-        "mom_id": predecessor_task_mom_id,
-        "otdb_id": predecessor_task_otdb_id,
-        "id": predecessor_task_id,
-        "endtime": datetime.datetime(2016, 3, 25, 22, 47, 31),
-        "name": "IS HBA_DUAL",
-        "predecessor_ids": [],
-        "project_mom_id": 2,
-        "project_name": "test-lofar",
-        "specification_id": 2323,
-        "starttime": datetime.datetime(2016, 3, 25, 21, 47, 31),
-        "status": "prescheduled",
-        "status_id": 350,
-        "successor_ids": [],
-        "type": "pipeline",
-        "type_id": 0
-    }
 
     successor_task_mom_id = 4
     successor_task_otdb_id = 5
     successor_task_id = 6
-    successor_task = {
-        "mom_id": successor_task_mom_id,
-        "otdb_id": successor_task_otdb_id,
-        "id": successor_task_id,
-        "endtime": datetime.datetime(2016, 3, 25, 22, 47, 31),
-        "name": "IS HBA_DUAL",
-        "predecessor_ids": [],
-        "project_mom_id": 2,
-        "project_name": "test-lofar",
-        "specification_id": 2323,
-        "starttime": datetime.datetime(2016, 3, 25, 21, 47, 31),
-        "status": "prescheduled",
-        "status_id": 350,
-        "successor_ids": [],
-        "type": "pipeline",
-        "type_id": 0
-    }
 
-    resources_with_rcus_otdb_id = 1290495
     resources_with_no_resource_types_otdb_id = 1290497
     resources_with_negative_estimates_otdb_id = 1290488
     resources_with_errors_otdb_id = 1290496
+    no_resources_otdb_id = 1290498
     resource_error1 = "error 1"
     resource_error2 = "error 2"
-    unknown_resource_type_name = "fuel"
-    unknown_resource_type_otdb_id = 123489
 
     rerpc_status = 0
     rerpc_needed_claim_for_bandwidth_size = 2
@@ -269,13 +181,9 @@ class ResourceAssignerTest(unittest.TestCase):
                 }
             }]
         },
-        str(resources_with_rcus_otdb_id): {
-                'errors': [],
-                'estimates': [{
-                        'resource_types': {'rcu': '111100010111100101101010' },
-                        'resource_count': 1,
-                        'root_resource_group': 'CS001'
-                }]
+        str(no_resources_otdb_id): {
+            'errors': [],
+            'estimates': []
         },
         str(resources_with_errors_otdb_id): {
                 'estimates': [{
@@ -309,75 +217,9 @@ class ResourceAssignerTest(unittest.TestCase):
                             }]
                 }
             }],
-        },
-        str(unknown_resource_type_otdb_id): {
-        },
-        str(maintenance_otdb_id): 
-            {'errors': [],
-                  'estimates': [{'resource_count': 1,
-                                 'resource_types': {'rcu': '111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111'},
-                                 'root_resource_group': 'CS001'},
-                                # TODO: I'm leaving this here to check the order issue in the getResourceGroupMemberships.return_value
-                                # {'resource_count': 1,
-                                #  'resource_types': {'bandwidth': 3000000000,
-                                #                     'rsp': 3904},
-                                #  'root_resource_group': 'CS001RSP0'},
-                                # {'resource_count': 1,
-                                #  'resource_types': {'bandwidth': 3000000000,
-                                #                     'rsp': 3904},
-                                #  'root_resource_group': 'CS001RSP1'},
-                                # {'resource_count': 1,
-                                #  'resource_types': {'rcu': '111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111'},
-                                #  'root_resource_group': 'CS002'},
-                                # {'resource_count': 1,
-                                #  'resource_types': {'bandwidth': 3000000000,
-                                #                     'rsp': 3904},
-                                #  'root_resource_group': 'CS002RSP0'},
-                                # {'resource_count': 1,
-                                #  'resource_types': {'bandwidth': 3000000000,
-                                #                     'rsp': 3904},
-                                #  'root_resource_group': 'CS002RSP1'},
-                                ]}
-        ,
-        str(projectreservation_otdb_id):
-            {'errors': [],
-                   'estimates': [{'resource_count': 1,
-                                 'resource_types': {'rcu': '111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111'},
-                                 'root_resource_group': 'CS001'},
-                                ]}
-    }
-
-    cep4bandwidth_resource_id = 116
-    cep4storage_resource_id = 117
-
-    storage_claim = {
-        'resource_id': cep4storage_resource_id,
-        'resource_type_id': 5,
-        'starttime': task_start_time,
-        'used_rcus': None,
-        'endtime': task_end_time + datetime.timedelta(days=365),
-        'status': 'tentative',
-        'claim_size': rerpc_needed_claim_for_storage_size,
-        'properties': [
-            {'io_type': 'output', 'type': 15, 'sap_nr': 0, 'value': 0},
-            {'io_type': 'output', 'type': 2, 'sap_nr': 0, 'value': 1},
-            {'io_type': 'output', 'type': 10, 'sap_nr': 0, 'value': 1073741824}
-        ]
-    }
-
-    bandwidth_claim = {
-        'resource_id': cep4bandwidth_resource_id,
-        'resource_type_id': 3,
-        'starttime': task_start_time,
-        'used_rcus': None,
-        'endtime': task_end_time,
-        'status': 'tentative',
-        'claim_size': rerpc_needed_claim_for_bandwidth_size,
-        'properties': []
+        }
     }
 
-    specification_claims = [bandwidth_claim, storage_claim]
-
     def reset_specification_tree(self):
         self.specification_tree = {
             'otdb_id': self.otdb_id,
@@ -393,6 +235,9 @@ class ResourceAssignerTest(unittest.TestCase):
             'duration': 60,
             'cluster': "CEP4",
             'task_subtype': 'long baseline pipeline',
+            'starttime': self.future_start_time,
+            'endtime': self.future_stop_time,
+            'storagemanager': None,
             'specification': {
                 'Observation.momID': str(self.mom_id),
                 'Observation.startTime': self.future_start_time,
@@ -431,7 +276,6 @@ class ResourceAssignerTest(unittest.TestCase):
                 'min_duration': 60,
                 'max_duration': 60,
                 'cluster': "CEP4",
-
                 'task_subtype': 'averaging pipeline',
                 'specification': {
                     'Observation.DataProducts.Output_InstrumentModel.enabled': False,
@@ -543,1079 +387,34 @@ class ResourceAssignerTest(unittest.TestCase):
         }
 
     def setUp(self):
+        super().setUp()
         self.reset_task()
 
-        def get_task_side_effect(*args, **kwargs):
-            if 'mom_id' in kwargs:
-                if kwargs['mom_id'] == self.successor_task_mom_id:
-                    return self.successor_task
-                elif kwargs['mom_id'] == self.predecessor_task_mom_id:
-                    return self.predecessor_task
-                elif kwargs['mom_id'] == self.non_existing_task_mom_id:
-                    return None
-                else:
-                    return self.task
-            else:
-                return self.task
-
-        self.successor_task_mom_ids = [self.successor_task_mom_id]
-        self.predecessor_task_mom_ids = [self.predecessor_task_mom_id]
-
-        rarpc_patcher = mock.patch('lofar.sas.resourceassignment.resourceassignmentservice.rpc.RADBRPC')
-        self.addCleanup(rarpc_patcher.stop)
-        self.rarpc_mock = rarpc_patcher.start()
-        self.rarpc_mock.getTask.side_effect = get_task_side_effect
-        self.rarpc_mock.insertSpecificationAndTask.return_value = {
-            'inserted': True,
-            'specification_id': self.specification_id,
-            'task_id': self.task_id
-        }
-        self.rarpc_mock.getResourceClaimPropertyTypes.return_value = [
-            {'id': 0, 'name': 'nr_of_is_files'},
-            {'id': 1, 'name': 'nr_of_cs_files'},
-            {'id': 2, 'name': 'nr_of_uv_files'},
-            {'id': 3, 'name': 'nr_of_im_files'},
-            {'id': 4, 'name': 'nr_of_img_files'},
-            {'id': 5, 'name': 'nr_of_pulp_files'},
-            {'id': 6, 'name': 'nr_of_cs_stokes'},
-            {'id': 7, 'name': 'nr_of_is_stokes'},
-            {'id': 8, 'name': 'is_file_size'},
-            {'id': 9, 'name': 'cs_file_size'},
-            {'id': 10, 'name': 'uv_file_size'},
-            {'id': 11, 'name': 'im_file_size'},
-            {'id': 12, 'name': 'img_file_size'},
-            {'id': 13, 'name': 'nr_of_pulp_files'},
-            {'id': 14, 'name': 'nr_of_cs_parts'},
-            {'id': 15, 'name': 'start_sb_nr'},
-            {'id': 16, 'name': 'uv_otdb_id'},
-            {'id': 17, 'name': 'cs_otdb_id'},
-            {'id': 18, 'name': 'is_otdb_id'},
-            {'id': 19, 'name': 'im_otdb_id'},
-            {'id': 20, 'name': 'img_otdb_id'},
-            {'id': 21, 'name': 'pulp_otdb_id'},
-            {'id': 22, 'name': 'is_tab_nr'},
-            {'id': 23, 'name': 'start_sbg_nr'},
-            {'id': 24, 'name': 'pulp_file_size'}
-        ]
-        self.rarpc_mock.getResourceTypes.return_value = [
-            {'id': 0, 'name': 'rsp', 'unit_id': 0, 'units': 'rsp_channel_bit'},
-            {'id': 1, 'name': 'tbb', 'unit_id': 1, 'units': 'bytes'},
-            {'id': 2, 'name': 'rcu', 'unit_id': 2, 'units': 'rcu_board'},
-            {'id': 3, 'name': 'bandwidth', 'unit_id': 3, 'units': 'bits/second'},
-            {'id': 4, 'name': 'processor', 'unit_id': 4, 'units': 'cores'},
-            {'id': 5, 'name': 'storage', 'unit_id': 1, 'units': 'bytes'},
-        ]
-        self.rarpc_mock.insertResourceClaims.return_value = {'ids': [1, 2]}
-
-        self.rarpc_mock.getResourceGroupNames.return_value = [{"name": "CEP4"}, {"name": "DRAGNET"}, {"name": "COBALT"}]
-
-        self.rarpc_mock.getResourceGroupMemberships.return_value = {'groups': [
-            {'resource_group_parent_id': None, 'resource_group_parent_name': None, 'resource_group_id': 0,
-             'resource_group_name': 'CORE', 'child_ids': [1, 2], 'parent_ids': [], 'resource_ids': [0, 1]},
-            {'resource_group_parent_id': None, 'resource_group_parent_name': None, 'resource_group_id': 3,
-             'resource_group_name': 'CS001', 'child_ids': [], 'parent_ids': [0], 'resource_ids': [212]},
-            {'resource_group_parent_id': None, 'resource_group_parent_name': None, 'resource_group_id': 1,
-             'resource_group_name': 'CEP4', 'child_ids': [], 'parent_ids': [0], 'resource_ids': [116, 117]},
-            # {'resource_group_parent_id': None, 'resource_group_parent_name': None, 'resource_group_id': 4,   # TODO: WHY DOES ORDER MATTER IN HERE???
-            #  'resource_group_name': 'CS002', 'child_ids': [], 'parent_ids': [0], 'resource_ids': [214]},     # TODO: check what happens when this is moved after e.g. CS001; also comment in CS002 in RE response
-            ],
-            'resources': [{'resource_group_parent_id': 0,
-                           'resource_group_parent_name': 'CORE',
-                           'resource_id': 0,
-                           'resource_name': 'CS001',
-                           'parent_group_ids': []},
-                          {'resource_group_parent_id': 0,
-                           'resource_group_parent_name': 'CORE',
-                           'resource_id': 1,
-                           'resource_name': 'CS002',
-                           'parent_group_ids': []},
-                          {'resource_group_parent_id': 1,
-                           'resource_group_parent_name': 'CEP4',
-                           'resource_id': 2,
-                           'resource_name': 'CEP4_storage:/data',
-                           'parent_group_ids': []}]}
-
-        # incomplete response but good enough for tests
-        self.rarpc_mock.getResources.return_value = [
-            {'id': 0, 'name': 'cpunode01_bandwidth', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 1, 'name': 'cpunode01_processors', 'type_id': 4, 'type_name': 'processor', 'unit_id': 4,
-             'unit': 'cores', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 2, 'name': 'cpunode02_bandwidth', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 3, 'name': 'cpunode02_processors', 'type_id': 4, 'type_name': 'processor', 'unit_id': 4,
-             'unit': 'cores', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 4, 'name': 'cpunode03_bandwidth', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 5, 'name': 'cpunode03_processors', 'type_id': 4, 'type_name': 'processor', 'unit_id': 4,
-             'unit': 'cores', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 6, 'name': 'cpunode04_bandwidth', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 7, 'name': 'cpunode04_processors', 'type_id': 4, 'type_name': 'processor', 'unit_id': 4,
-             'unit': 'cores', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 8, 'name': 'cpunode05_bandwidth', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 9, 'name': 'cpunode05_processors', 'type_id': 4, 'type_name': 'processor', 'unit_id': 4,
-             'unit': 'cores', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 10, 'name': 'cpunode06_bandwidth', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 11, 'name': 'cpunode06_processors', 'type_id': 4, 'type_name': 'processor', 'unit_id': 4,
-             'unit': 'cores', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 12, 'name': 'cpunode07_bandwidth', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 13, 'name': 'cpunode07_processors', 'type_id': 4, 'type_name': 'processor', 'unit_id': 4,
-             'unit': 'cores', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 14, 'name': 'cpunode08_bandwidth', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 15, 'name': 'cpunode08_processors', 'type_id': 4, 'type_name': 'processor', 'unit_id': 4,
-             'unit': 'cores', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 16, 'name': 'cpunode09_bandwidth', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 17, 'name': 'cpunode09_processors', 'type_id': 4, 'type_name': 'processor', 'unit_id': 4,
-             'unit': 'cores', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 18, 'name': 'cpunode10_bandwidth', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 19, 'name': 'cpunode10_processors', 'type_id': 4, 'type_name': 'processor', 'unit_id': 4,
-             'unit': 'cores', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 20, 'name': 'cpunode11_bandwidth', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 21, 'name': 'cpunode11_processors', 'type_id': 4, 'type_name': 'processor', 'unit_id': 4,
-             'unit': 'cores', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 22, 'name': 'cpunode12_bandwidth', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 23, 'name': 'cpunode12_processors', 'type_id': 4, 'type_name': 'processor', 'unit_id': 4,
-             'unit': 'cores', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 24, 'name': 'cpunode13_bandwidth', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 25, 'name': 'cpunode13_processors', 'type_id': 4, 'type_name': 'processor', 'unit_id': 4,
-             'unit': 'cores', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 26, 'name': 'cpunode14_bandwidth', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 27, 'name': 'cpunode14_processors', 'type_id': 4, 'type_name': 'processor', 'unit_id': 4,
-             'unit': 'cores', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 28, 'name': 'cpunode15_bandwidth', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 29, 'name': 'cpunode15_processors', 'type_id': 4, 'type_name': 'processor', 'unit_id': 4,
-             'unit': 'cores', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 30, 'name': 'cpunode16_bandwidth', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 31, 'name': 'cpunode16_processors', 'type_id': 4, 'type_name': 'processor', 'unit_id': 4,
-             'unit': 'cores', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 32, 'name': 'cpunode17_bandwidth', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 33, 'name': 'cpunode17_processors', 'type_id': 4, 'type_name': 'processor', 'unit_id': 4,
-             'unit': 'cores', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 34, 'name': 'cpunode18_bandwidth', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 35, 'name': 'cpunode18_processors', 'type_id': 4, 'type_name': 'processor', 'unit_id': 4,
-             'unit': 'cores', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 36, 'name': 'cpunode19_bandwidth', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 37, 'name': 'cpunode19_processors', 'type_id': 4, 'type_name': 'processor', 'unit_id': 4,
-             'unit': 'cores', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 38, 'name': 'cpunode20_bandwidth', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 39, 'name': 'cpunode20_processors', 'type_id': 4, 'type_name': 'processor', 'unit_id': 4,
-             'unit': 'cores', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 40, 'name': 'cpunode21_bandwidth', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 41, 'name': 'cpunode21_processors', 'type_id': 4, 'type_name': 'processor', 'unit_id': 4,
-             'unit': 'cores', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 42, 'name': 'cpunode22_bandwidth', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 43, 'name': 'cpunode22_processors', 'type_id': 4, 'type_name': 'processor', 'unit_id': 4,
-             'unit': 'cores', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 44, 'name': 'cpunode23_bandwidth', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 45, 'name': 'cpunode23_processors', 'type_id': 4, 'type_name': 'processor', 'unit_id': 4,
-             'unit': 'cores', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 46, 'name': 'cpunode24_bandwidth', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 47, 'name': 'cpunode24_processors', 'type_id': 4, 'type_name': 'processor', 'unit_id': 4,
-             'unit': 'cores', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 48, 'name': 'cpunode25_bandwidth', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 49, 'name': 'cpunode25_processors', 'type_id': 4, 'type_name': 'processor', 'unit_id': 4,
-             'unit': 'cores', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 50, 'name': 'cpunode26_bandwidth', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 51, 'name': 'cpunode26_processors', 'type_id': 4, 'type_name': 'processor', 'unit_id': 4,
-             'unit': 'cores', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 52, 'name': 'cpunode27_bandwidth', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 53, 'name': 'cpunode27_processors', 'type_id': 4, 'type_name': 'processor', 'unit_id': 4,
-             'unit': 'cores', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 54, 'name': 'cpunode28_bandwidth', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 55, 'name': 'cpunode28_processors', 'type_id': 4, 'type_name': 'processor', 'unit_id': 4,
-             'unit': 'cores', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 56, 'name': 'cpunode29_bandwidth', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 57, 'name': 'cpunode29_processors', 'type_id': 4, 'type_name': 'processor', 'unit_id': 4,
-             'unit': 'cores', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 58, 'name': 'cpunode30_bandwidth', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 59, 'name': 'cpunode30_processors', 'type_id': 4, 'type_name': 'processor', 'unit_id': 4,
-             'unit': 'cores', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 60, 'name': 'cpunode31_bandwidth', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 61, 'name': 'cpunode31_processors', 'type_id': 4, 'type_name': 'processor', 'unit_id': 4,
-             'unit': 'cores', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 62, 'name': 'cpunode32_bandwidth', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 63, 'name': 'cpunode32_processors', 'type_id': 4, 'type_name': 'processor', 'unit_id': 4,
-             'unit': 'cores', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 64, 'name': 'cpunode33_bandwidth', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 65, 'name': 'cpunode33_processors', 'type_id': 4, 'type_name': 'processor', 'unit_id': 4,
-             'unit': 'cores', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 66, 'name': 'cpunode34_bandwidth', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 67, 'name': 'cpunode34_processors', 'type_id': 4, 'type_name': 'processor', 'unit_id': 4,
-             'unit': 'cores', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 68, 'name': 'cpunode35_bandwidth', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 69, 'name': 'cpunode35_processors', 'type_id': 4, 'type_name': 'processor', 'unit_id': 4,
-             'unit': 'cores', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 70, 'name': 'cpunode36_bandwidth', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 71, 'name': 'cpunode36_processors', 'type_id': 4, 'type_name': 'processor', 'unit_id': 4,
-             'unit': 'cores', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 72, 'name': 'cpunode37_bandwidth', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 73, 'name': 'cpunode37_processors', 'type_id': 4, 'type_name': 'processor', 'unit_id': 4,
-             'unit': 'cores', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 74, 'name': 'cpunode38_bandwidth', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 75, 'name': 'cpunode38_processors', 'type_id': 4, 'type_name': 'processor', 'unit_id': 4,
-             'unit': 'cores', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 76, 'name': 'cpunode39_bandwidth', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 77, 'name': 'cpunode39_processors', 'type_id': 4, 'type_name': 'processor', 'unit_id': 4,
-             'unit': 'cores', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 78, 'name': 'cpunode40_bandwidth', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 79, 'name': 'cpunode40_processors', 'type_id': 4, 'type_name': 'processor', 'unit_id': 4,
-             'unit': 'cores', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 80, 'name': 'cpunode41_bandwidth', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 81, 'name': 'cpunode41_processors', 'type_id': 4, 'type_name': 'processor', 'unit_id': 4,
-             'unit': 'cores', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 82, 'name': 'cpunode42_bandwidth', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 83, 'name': 'cpunode42_processors', 'type_id': 4, 'type_name': 'processor', 'unit_id': 4,
-             'unit': 'cores', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 84, 'name': 'cpunode43_bandwidth', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 85, 'name': 'cpunode43_processors', 'type_id': 4, 'type_name': 'processor', 'unit_id': 4,
-             'unit': 'cores', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 86, 'name': 'cpunode44_bandwidth', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 87, 'name': 'cpunode44_processors', 'type_id': 4, 'type_name': 'processor', 'unit_id': 4,
-             'unit': 'cores', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 88, 'name': 'cpunode45_bandwidth', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 89, 'name': 'cpunode45_processors', 'type_id': 4, 'type_name': 'processor', 'unit_id': 4,
-             'unit': 'cores', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 90, 'name': 'cpunode46_bandwidth', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 91, 'name': 'cpunode46_processors', 'type_id': 4, 'type_name': 'processor', 'unit_id': 4,
-             'unit': 'cores', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 92, 'name': 'cpunode47_bandwidth', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 93, 'name': 'cpunode47_processors', 'type_id': 4, 'type_name': 'processor', 'unit_id': 4,
-             'unit': 'cores', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 94, 'name': 'cpunode48_bandwidth', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 95, 'name': 'cpunode48_processors', 'type_id': 4, 'type_name': 'processor', 'unit_id': 4,
-             'unit': 'cores', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 96, 'name': 'cpunode49_bandwidth', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 97, 'name': 'cpunode49_processors', 'type_id': 4, 'type_name': 'processor', 'unit_id': 4,
-             'unit': 'cores', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 98, 'name': 'cpunode50_bandwidth', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 99, 'name': 'cpunode50_processors', 'type_id': 4, 'type_name': 'processor', 'unit_id': 4,
-             'unit': 'cores', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 100, 'name': 'cbt001_bandwidth', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 101, 'name': 'cbt001_processors', 'type_id': 4, 'type_name': 'processor', 'unit_id': 4,
-             'unit': 'cores', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 102, 'name': 'cbt002_bandwidth', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 103, 'name': 'cbt002_processors', 'type_id': 4, 'type_name': 'processor', 'unit_id': 4,
-             'unit': 'cores', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 104, 'name': 'cbt003_bandwidth', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 105, 'name': 'cbt003_processors', 'type_id': 4, 'type_name': 'processor', 'unit_id': 4,
-             'unit': 'cores', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 106, 'name': 'cbt004_bandwidth', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 107, 'name': 'cbt004_processors', 'type_id': 4, 'type_name': 'processor', 'unit_id': 4,
-             'unit': 'cores', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 108, 'name': 'cbt005_bandwidth', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 109, 'name': 'cbt005_processors', 'type_id': 4, 'type_name': 'processor', 'unit_id': 4,
-             'unit': 'cores', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 110, 'name': 'cbt006_bandwidth', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 111, 'name': 'cbt006_processors', 'type_id': 4, 'type_name': 'processor', 'unit_id': 4,
-             'unit': 'cores', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 112, 'name': 'cbt007_bandwidth', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 113, 'name': 'cbt007_processors', 'type_id': 4, 'type_name': 'processor', 'unit_id': 4,
-             'unit': 'cores', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 114, 'name': 'cbt008_bandwidth', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 115, 'name': 'cbt008_processors', 'type_id': 4, 'type_name': 'processor', 'unit_id': 4,
-             'unit': 'cores', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 116, 'name': 'CEP4_bandwidth:/data', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 117, 'name': 'CEP4_storage:/data', 'type_id': 5, 'type_name': 'storage', 'unit_id': 1,
-             'unit': 'bytes', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 118, 'name': 'dragproc_bandwidth:/data', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 119, 'name': 'dragproc_storage:/data', 'type_id': 5, 'type_name': 'storage', 'unit_id': 1,
-             'unit': 'bytes', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 120, 'name': 'drg01_bandwidth:/data1', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 121, 'name': 'drg01_bandwidth:/data2', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 122, 'name': 'drg01_storage:/data1', 'type_id': 5, 'type_name': 'storage', 'unit_id': 1,
-             'unit': 'bytes', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 123, 'name': 'drg01_storage:/data2', 'type_id': 5, 'type_name': 'storage', 'unit_id': 1,
-             'unit': 'bytes', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 124, 'name': 'drg02_bandwidth:/data1', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 125, 'name': 'drg02_bandwidth:/data2', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 126, 'name': 'drg02_storage:/data1', 'type_id': 5, 'type_name': 'storage', 'unit_id': 1,
-             'unit': 'bytes', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 127, 'name': 'drg02_storage:/data2', 'type_id': 5, 'type_name': 'storage', 'unit_id': 1,
-             'unit': 'bytes', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 128, 'name': 'drg03_bandwidth:/data1', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 129, 'name': 'drg03_bandwidth:/data2', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 130, 'name': 'drg03_storage:/data1', 'type_id': 5, 'type_name': 'storage', 'unit_id': 1,
-             'unit': 'bytes', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 131, 'name': 'drg03_storage:/data2', 'type_id': 5, 'type_name': 'storage', 'unit_id': 1,
-             'unit': 'bytes', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 132, 'name': 'drg04_bandwidth:/data1', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 133, 'name': 'drg04_bandwidth:/data2', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 134, 'name': 'drg04_storage:/data1', 'type_id': 5, 'type_name': 'storage', 'unit_id': 1,
-             'unit': 'bytes', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 135, 'name': 'drg04_storage:/data2', 'type_id': 5, 'type_name': 'storage', 'unit_id': 1,
-             'unit': 'bytes', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 136, 'name': 'drg05_bandwidth:/data1', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 137, 'name': 'drg05_bandwidth:/data2', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 138, 'name': 'drg05_storage:/data1', 'type_id': 5, 'type_name': 'storage', 'unit_id': 1,
-             'unit': 'bytes', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 139, 'name': 'drg05_storage:/data2', 'type_id': 5, 'type_name': 'storage', 'unit_id': 1,
-             'unit': 'bytes', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 140, 'name': 'drg06_bandwidth:/data1', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 141, 'name': 'drg06_bandwidth:/data2', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 142, 'name': 'drg06_storage:/data1', 'type_id': 5, 'type_name': 'storage', 'unit_id': 1,
-             'unit': 'bytes', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 143, 'name': 'drg06_storage:/data2', 'type_id': 5, 'type_name': 'storage', 'unit_id': 1,
-             'unit': 'bytes', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 144, 'name': 'drg07_bandwidth:/data1', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 145, 'name': 'drg07_bandwidth:/data2', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 146, 'name': 'drg07_storage:/data1', 'type_id': 5, 'type_name': 'storage', 'unit_id': 1,
-             'unit': 'bytes', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 147, 'name': 'drg07_storage:/data2', 'type_id': 5, 'type_name': 'storage', 'unit_id': 1,
-             'unit': 'bytes', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 148, 'name': 'drg08_bandwidth:/data1', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 149, 'name': 'drg08_bandwidth:/data2', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 150, 'name': 'drg08_storage:/data1', 'type_id': 5, 'type_name': 'storage', 'unit_id': 1,
-             'unit': 'bytes', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 151, 'name': 'drg08_storage:/data2', 'type_id': 5, 'type_name': 'storage', 'unit_id': 1,
-             'unit': 'bytes', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 152, 'name': 'drg09_bandwidth:/data1', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 153, 'name': 'drg09_bandwidth:/data2', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 154, 'name': 'drg09_storage:/data1', 'type_id': 5, 'type_name': 'storage', 'unit_id': 1,
-             'unit': 'bytes', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 155, 'name': 'drg09_storage:/data2', 'type_id': 5, 'type_name': 'storage', 'unit_id': 1,
-             'unit': 'bytes', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 156, 'name': 'drg10_bandwidth:/data1', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 157, 'name': 'drg10_bandwidth:/data2', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 158, 'name': 'drg10_storage:/data1', 'type_id': 5, 'type_name': 'storage', 'unit_id': 1,
-             'unit': 'bytes', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 159, 'name': 'drg10_storage:/data2', 'type_id': 5, 'type_name': 'storage', 'unit_id': 1,
-             'unit': 'bytes', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 160, 'name': 'drg11_bandwidth:/data1', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 161, 'name': 'drg11_bandwidth:/data2', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 162, 'name': 'drg11_storage:/data1', 'type_id': 5, 'type_name': 'storage', 'unit_id': 1,
-             'unit': 'bytes', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 163, 'name': 'drg11_storage:/data2', 'type_id': 5, 'type_name': 'storage', 'unit_id': 1,
-             'unit': 'bytes', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 164, 'name': 'drg12_bandwidth:/data1', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 165, 'name': 'drg12_bandwidth:/data2', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 166, 'name': 'drg12_storage:/data1', 'type_id': 5, 'type_name': 'storage', 'unit_id': 1,
-             'unit': 'bytes', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 167, 'name': 'drg12_storage:/data2', 'type_id': 5, 'type_name': 'storage', 'unit_id': 1,
-             'unit': 'bytes', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 168, 'name': 'drg13_bandwidth:/data1', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 169, 'name': 'drg13_bandwidth:/data2', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 170, 'name': 'drg13_storage:/data1', 'type_id': 5, 'type_name': 'storage', 'unit_id': 1,
-             'unit': 'bytes', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 171, 'name': 'drg13_storage:/data2', 'type_id': 5, 'type_name': 'storage', 'unit_id': 1,
-             'unit': 'bytes', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 172, 'name': 'drg14_bandwidth:/data1', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 173, 'name': 'drg14_bandwidth:/data2', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 174, 'name': 'drg14_storage:/data1', 'type_id': 5, 'type_name': 'storage', 'unit_id': 1,
-             'unit': 'bytes', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 175, 'name': 'drg14_storage:/data2', 'type_id': 5, 'type_name': 'storage', 'unit_id': 1,
-             'unit': 'bytes', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 176, 'name': 'drg15_bandwidth:/data1', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 177, 'name': 'drg15_bandwidth:/data2', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 178, 'name': 'drg15_storage:/data1', 'type_id': 5, 'type_name': 'storage', 'unit_id': 1,
-             'unit': 'bytes', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 179, 'name': 'drg15_storage:/data2', 'type_id': 5, 'type_name': 'storage', 'unit_id': 1,
-             'unit': 'bytes', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 180, 'name': 'drg16_bandwidth:/data1', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 181, 'name': 'drg16_bandwidth:/data2', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 182, 'name': 'drg16_storage:/data1', 'type_id': 5, 'type_name': 'storage', 'unit_id': 1,
-             'unit': 'bytes', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 183, 'name': 'drg16_storage:/data2', 'type_id': 5, 'type_name': 'storage', 'unit_id': 1,
-             'unit': 'bytes', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 184, 'name': 'drg17_bandwidth:/data1', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 185, 'name': 'drg17_bandwidth:/data2', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 186, 'name': 'drg17_storage:/data1', 'type_id': 5, 'type_name': 'storage', 'unit_id': 1,
-             'unit': 'bytes', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 187, 'name': 'drg17_storage:/data2', 'type_id': 5, 'type_name': 'storage', 'unit_id': 1,
-             'unit': 'bytes', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 188, 'name': 'drg18_bandwidth:/data1', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 189, 'name': 'drg18_bandwidth:/data2', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 190, 'name': 'drg18_storage:/data1', 'type_id': 5, 'type_name': 'storage', 'unit_id': 1,
-             'unit': 'bytes', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 191, 'name': 'drg18_storage:/data2', 'type_id': 5, 'type_name': 'storage', 'unit_id': 1,
-             'unit': 'bytes', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 192, 'name': 'drg19_bandwidth:/data1', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 193, 'name': 'drg19_bandwidth:/data2', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 194, 'name': 'drg19_storage:/data1', 'type_id': 5, 'type_name': 'storage', 'unit_id': 1,
-             'unit': 'bytes', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 195, 'name': 'drg19_storage:/data2', 'type_id': 5, 'type_name': 'storage', 'unit_id': 1,
-             'unit': 'bytes', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 196, 'name': 'drg20_bandwidth:/data1', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 197, 'name': 'drg20_bandwidth:/data2', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 198, 'name': 'drg20_storage:/data1', 'type_id': 5, 'type_name': 'storage', 'unit_id': 1,
-             'unit': 'bytes', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 199, 'name': 'drg20_storage:/data2', 'type_id': 5, 'type_name': 'storage', 'unit_id': 1,
-             'unit': 'bytes', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 200, 'name': 'drg21_bandwidth:/data1', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 201, 'name': 'drg21_bandwidth:/data2', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 202, 'name': 'drg21_storage:/data1', 'type_id': 5, 'type_name': 'storage', 'unit_id': 1,
-             'unit': 'bytes', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 203, 'name': 'drg21_storage:/data2', 'type_id': 5, 'type_name': 'storage', 'unit_id': 1,
-             'unit': 'bytes', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 204, 'name': 'drg22_bandwidth:/data1', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 205, 'name': 'drg22_bandwidth:/data2', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 206, 'name': 'drg22_storage:/data1', 'type_id': 5, 'type_name': 'storage', 'unit_id': 1,
-             'unit': 'bytes', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 207, 'name': 'drg22_storage:/data2', 'type_id': 5, 'type_name': 'storage', 'unit_id': 1,
-             'unit': 'bytes', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 208, 'name': 'drg23_bandwidth:/data1', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 209, 'name': 'drg23_bandwidth:/data2', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3,
-             'unit': 'bits/second', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 210, 'name': 'drg23_storage:/data1', 'type_id': 5, 'type_name': 'storage', 'unit_id': 1,
-             'unit': 'bytes', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 211, 'name': 'drg23_storage:/data2', 'type_id': 5, 'type_name': 'storage', 'unit_id': 1,
-             'unit': 'bytes', 'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 212, 'name': 'CS001rcu', 'type_id': 2, 'type_name': 'rcu', 'unit_id': 2, 'unit': 'rcu_board',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 213, 'name': 'CS001tbb', 'type_id': 1, 'type_name': 'tbb', 'unit_id': 1, 'unit': 'bytes',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 214, 'name': 'CS002rcu', 'type_id': 2, 'type_name': 'rcu', 'unit_id': 2, 'unit': 'rcu_board',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 215, 'name': 'CS002tbb', 'type_id': 1, 'type_name': 'tbb', 'unit_id': 1, 'unit': 'bytes',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 216, 'name': 'CS003rcu', 'type_id': 2, 'type_name': 'rcu', 'unit_id': 2, 'unit': 'rcu_board',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 217, 'name': 'CS003tbb', 'type_id': 1, 'type_name': 'tbb', 'unit_id': 1, 'unit': 'bytes',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 218, 'name': 'CS004rcu', 'type_id': 2, 'type_name': 'rcu', 'unit_id': 2, 'unit': 'rcu_board',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 219, 'name': 'CS004tbb', 'type_id': 1, 'type_name': 'tbb', 'unit_id': 1, 'unit': 'bytes',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 220, 'name': 'CS005rcu', 'type_id': 2, 'type_name': 'rcu', 'unit_id': 2, 'unit': 'rcu_board',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 221, 'name': 'CS005tbb', 'type_id': 1, 'type_name': 'tbb', 'unit_id': 1, 'unit': 'bytes',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 222, 'name': 'CS006rcu', 'type_id': 2, 'type_name': 'rcu', 'unit_id': 2, 'unit': 'rcu_board',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 223, 'name': 'CS006tbb', 'type_id': 1, 'type_name': 'tbb', 'unit_id': 1, 'unit': 'bytes',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 224, 'name': 'CS007rcu', 'type_id': 2, 'type_name': 'rcu', 'unit_id': 2, 'unit': 'rcu_board',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 225, 'name': 'CS007tbb', 'type_id': 1, 'type_name': 'tbb', 'unit_id': 1, 'unit': 'bytes',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 226, 'name': 'CS011rcu', 'type_id': 2, 'type_name': 'rcu', 'unit_id': 2, 'unit': 'rcu_board',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 227, 'name': 'CS011tbb', 'type_id': 1, 'type_name': 'tbb', 'unit_id': 1, 'unit': 'bytes',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 228, 'name': 'CS013rcu', 'type_id': 2, 'type_name': 'rcu', 'unit_id': 2, 'unit': 'rcu_board',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 229, 'name': 'CS013tbb', 'type_id': 1, 'type_name': 'tbb', 'unit_id': 1, 'unit': 'bytes',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 230, 'name': 'CS017rcu', 'type_id': 2, 'type_name': 'rcu', 'unit_id': 2, 'unit': 'rcu_board',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 231, 'name': 'CS017tbb', 'type_id': 1, 'type_name': 'tbb', 'unit_id': 1, 'unit': 'bytes',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 232, 'name': 'CS021rcu', 'type_id': 2, 'type_name': 'rcu', 'unit_id': 2, 'unit': 'rcu_board',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 233, 'name': 'CS021tbb', 'type_id': 1, 'type_name': 'tbb', 'unit_id': 1, 'unit': 'bytes',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 234, 'name': 'CS024rcu', 'type_id': 2, 'type_name': 'rcu', 'unit_id': 2, 'unit': 'rcu_board',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 235, 'name': 'CS024tbb', 'type_id': 1, 'type_name': 'tbb', 'unit_id': 1, 'unit': 'bytes',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 236, 'name': 'CS026rcu', 'type_id': 2, 'type_name': 'rcu', 'unit_id': 2, 'unit': 'rcu_board',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 237, 'name': 'CS026tbb', 'type_id': 1, 'type_name': 'tbb', 'unit_id': 1, 'unit': 'bytes',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 238, 'name': 'CS028rcu', 'type_id': 2, 'type_name': 'rcu', 'unit_id': 2, 'unit': 'rcu_board',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 239, 'name': 'CS028tbb', 'type_id': 1, 'type_name': 'tbb', 'unit_id': 1, 'unit': 'bytes',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 240, 'name': 'CS030rcu', 'type_id': 2, 'type_name': 'rcu', 'unit_id': 2, 'unit': 'rcu_board',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 241, 'name': 'CS030tbb', 'type_id': 1, 'type_name': 'tbb', 'unit_id': 1, 'unit': 'bytes',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 242, 'name': 'CS031rcu', 'type_id': 2, 'type_name': 'rcu', 'unit_id': 2, 'unit': 'rcu_board',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 243, 'name': 'CS031tbb', 'type_id': 1, 'type_name': 'tbb', 'unit_id': 1, 'unit': 'bytes',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 244, 'name': 'CS032rcu', 'type_id': 2, 'type_name': 'rcu', 'unit_id': 2, 'unit': 'rcu_board',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 245, 'name': 'CS032tbb', 'type_id': 1, 'type_name': 'tbb', 'unit_id': 1, 'unit': 'bytes',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 246, 'name': 'CS101rcu', 'type_id': 2, 'type_name': 'rcu', 'unit_id': 2, 'unit': 'rcu_board',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 247, 'name': 'CS101tbb', 'type_id': 1, 'type_name': 'tbb', 'unit_id': 1, 'unit': 'bytes',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 248, 'name': 'CS103rcu', 'type_id': 2, 'type_name': 'rcu', 'unit_id': 2, 'unit': 'rcu_board',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 249, 'name': 'CS103tbb', 'type_id': 1, 'type_name': 'tbb', 'unit_id': 1, 'unit': 'bytes',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 250, 'name': 'CS201rcu', 'type_id': 2, 'type_name': 'rcu', 'unit_id': 2, 'unit': 'rcu_board',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 251, 'name': 'CS201tbb', 'type_id': 1, 'type_name': 'tbb', 'unit_id': 1, 'unit': 'bytes',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 252, 'name': 'CS301rcu', 'type_id': 2, 'type_name': 'rcu', 'unit_id': 2, 'unit': 'rcu_board',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 253, 'name': 'CS301tbb', 'type_id': 1, 'type_name': 'tbb', 'unit_id': 1, 'unit': 'bytes',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 254, 'name': 'CS302rcu', 'type_id': 2, 'type_name': 'rcu', 'unit_id': 2, 'unit': 'rcu_board',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 255, 'name': 'CS302tbb', 'type_id': 1, 'type_name': 'tbb', 'unit_id': 1, 'unit': 'bytes',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 256, 'name': 'CS401rcu', 'type_id': 2, 'type_name': 'rcu', 'unit_id': 2, 'unit': 'rcu_board',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 257, 'name': 'CS401tbb', 'type_id': 1, 'type_name': 'tbb', 'unit_id': 1, 'unit': 'bytes',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 258, 'name': 'CS501rcu', 'type_id': 2, 'type_name': 'rcu', 'unit_id': 2, 'unit': 'rcu_board',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 259, 'name': 'CS501tbb', 'type_id': 1, 'type_name': 'tbb', 'unit_id': 1, 'unit': 'bytes',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 260, 'name': 'RS106rcu', 'type_id': 2, 'type_name': 'rcu', 'unit_id': 2, 'unit': 'rcu_board',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 261, 'name': 'RS106tbb', 'type_id': 1, 'type_name': 'tbb', 'unit_id': 1, 'unit': 'bytes',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 262, 'name': 'RS205rcu', 'type_id': 2, 'type_name': 'rcu', 'unit_id': 2, 'unit': 'rcu_board',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 263, 'name': 'RS205tbb', 'type_id': 1, 'type_name': 'tbb', 'unit_id': 1, 'unit': 'bytes',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 264, 'name': 'RS208rcu', 'type_id': 2, 'type_name': 'rcu', 'unit_id': 2, 'unit': 'rcu_board',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 265, 'name': 'RS208tbb', 'type_id': 1, 'type_name': 'tbb', 'unit_id': 1, 'unit': 'bytes',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 266, 'name': 'RS210rcu', 'type_id': 2, 'type_name': 'rcu', 'unit_id': 2, 'unit': 'rcu_board',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 267, 'name': 'RS210tbb', 'type_id': 1, 'type_name': 'tbb', 'unit_id': 1, 'unit': 'bytes',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 268, 'name': 'RS305rcu', 'type_id': 2, 'type_name': 'rcu', 'unit_id': 2, 'unit': 'rcu_board',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 269, 'name': 'RS305tbb', 'type_id': 1, 'type_name': 'tbb', 'unit_id': 1, 'unit': 'bytes',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 270, 'name': 'RS306rcu', 'type_id': 2, 'type_name': 'rcu', 'unit_id': 2, 'unit': 'rcu_board',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 271, 'name': 'RS306tbb', 'type_id': 1, 'type_name': 'tbb', 'unit_id': 1, 'unit': 'bytes',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 272, 'name': 'RS307rcu', 'type_id': 2, 'type_name': 'rcu', 'unit_id': 2, 'unit': 'rcu_board',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 273, 'name': 'RS307tbb', 'type_id': 1, 'type_name': 'tbb', 'unit_id': 1, 'unit': 'bytes',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 274, 'name': 'RS310rcu', 'type_id': 2, 'type_name': 'rcu', 'unit_id': 2, 'unit': 'rcu_board',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 275, 'name': 'RS310tbb', 'type_id': 1, 'type_name': 'tbb', 'unit_id': 1, 'unit': 'bytes',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 276, 'name': 'RS406rcu', 'type_id': 2, 'type_name': 'rcu', 'unit_id': 2, 'unit': 'rcu_board',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 277, 'name': 'RS406tbb', 'type_id': 1, 'type_name': 'tbb', 'unit_id': 1, 'unit': 'bytes',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 278, 'name': 'RS407rcu', 'type_id': 2, 'type_name': 'rcu', 'unit_id': 2, 'unit': 'rcu_board',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 279, 'name': 'RS407tbb', 'type_id': 1, 'type_name': 'tbb', 'unit_id': 1, 'unit': 'bytes',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 280, 'name': 'RS408rcu', 'type_id': 2, 'type_name': 'rcu', 'unit_id': 2, 'unit': 'rcu_board',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 281, 'name': 'RS408tbb', 'type_id': 1, 'type_name': 'tbb', 'unit_id': 1, 'unit': 'bytes',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 282, 'name': 'RS409rcu', 'type_id': 2, 'type_name': 'rcu', 'unit_id': 2, 'unit': 'rcu_board',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 283, 'name': 'RS409tbb', 'type_id': 1, 'type_name': 'tbb', 'unit_id': 1, 'unit': 'bytes',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 284, 'name': 'RS503rcu', 'type_id': 2, 'type_name': 'rcu', 'unit_id': 2, 'unit': 'rcu_board',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 285, 'name': 'RS503tbb', 'type_id': 1, 'type_name': 'tbb', 'unit_id': 1, 'unit': 'bytes',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 286, 'name': 'RS508rcu', 'type_id': 2, 'type_name': 'rcu', 'unit_id': 2, 'unit': 'rcu_board',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 287, 'name': 'RS508tbb', 'type_id': 1, 'type_name': 'tbb', 'unit_id': 1, 'unit': 'bytes',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 288, 'name': 'RS509rcu', 'type_id': 2, 'type_name': 'rcu', 'unit_id': 2, 'unit': 'rcu_board',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 289, 'name': 'RS509tbb', 'type_id': 1, 'type_name': 'tbb', 'unit_id': 1, 'unit': 'bytes',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 290, 'name': 'DE601rcu', 'type_id': 2, 'type_name': 'rcu', 'unit_id': 2, 'unit': 'rcu_board',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 291, 'name': 'DE601tbb', 'type_id': 1, 'type_name': 'tbb', 'unit_id': 1, 'unit': 'bytes',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 292, 'name': 'DE602rcu', 'type_id': 2, 'type_name': 'rcu', 'unit_id': 2, 'unit': 'rcu_board',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 293, 'name': 'DE602tbb', 'type_id': 1, 'type_name': 'tbb', 'unit_id': 1, 'unit': 'bytes',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 294, 'name': 'DE603rcu', 'type_id': 2, 'type_name': 'rcu', 'unit_id': 2, 'unit': 'rcu_board',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 295, 'name': 'DE603tbb', 'type_id': 1, 'type_name': 'tbb', 'unit_id': 1, 'unit': 'bytes',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 296, 'name': 'DE604rcu', 'type_id': 2, 'type_name': 'rcu', 'unit_id': 2, 'unit': 'rcu_board',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 297, 'name': 'DE604tbb', 'type_id': 1, 'type_name': 'tbb', 'unit_id': 1, 'unit': 'bytes',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 298, 'name': 'DE605rcu', 'type_id': 2, 'type_name': 'rcu', 'unit_id': 2, 'unit': 'rcu_board',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 299, 'name': 'DE605tbb', 'type_id': 1, 'type_name': 'tbb', 'unit_id': 1, 'unit': 'bytes',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 300, 'name': 'FR606rcu', 'type_id': 2, 'type_name': 'rcu', 'unit_id': 2, 'unit': 'rcu_board',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 301, 'name': 'FR606tbb', 'type_id': 1, 'type_name': 'tbb', 'unit_id': 1, 'unit': 'bytes',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 302, 'name': 'SE607rcu', 'type_id': 2, 'type_name': 'rcu', 'unit_id': 2, 'unit': 'rcu_board',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 303, 'name': 'SE607tbb', 'type_id': 1, 'type_name': 'tbb', 'unit_id': 1, 'unit': 'bytes',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 304, 'name': 'UK608rcu', 'type_id': 2, 'type_name': 'rcu', 'unit_id': 2, 'unit': 'rcu_board',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 305, 'name': 'UK608tbb', 'type_id': 1, 'type_name': 'tbb', 'unit_id': 1, 'unit': 'bytes',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 306, 'name': 'DE609rcu', 'type_id': 2, 'type_name': 'rcu', 'unit_id': 2, 'unit': 'rcu_board',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 307, 'name': 'DE609tbb', 'type_id': 1, 'type_name': 'tbb', 'unit_id': 1, 'unit': 'bytes',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 308, 'name': 'PL610rcu', 'type_id': 2, 'type_name': 'rcu', 'unit_id': 2, 'unit': 'rcu_board',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 309, 'name': 'PL610tbb', 'type_id': 1, 'type_name': 'tbb', 'unit_id': 1, 'unit': 'bytes',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 310, 'name': 'PL611rcu', 'type_id': 2, 'type_name': 'rcu', 'unit_id': 2, 'unit': 'rcu_board',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 311, 'name': 'PL611tbb', 'type_id': 1, 'type_name': 'tbb', 'unit_id': 1, 'unit': 'bytes',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 312, 'name': 'PL612rcu', 'type_id': 2, 'type_name': 'rcu', 'unit_id': 2, 'unit': 'rcu_board',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 313, 'name': 'PL612tbb', 'type_id': 1, 'type_name': 'tbb', 'unit_id': 1, 'unit': 'bytes',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 314, 'name': 'IE613rcu', 'type_id': 2, 'type_name': 'rcu', 'unit_id': 2, 'unit': 'rcu_board',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 315, 'name': 'IE613tbb', 'type_id': 1, 'type_name': 'tbb', 'unit_id': 1, 'unit': 'bytes',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 316, 'name': 'IS614rcu', 'type_id': 2, 'type_name': 'rcu', 'unit_id': 2, 'unit': 'rcu_board',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 317, 'name': 'IS614tbb', 'type_id': 1, 'type_name': 'tbb', 'unit_id': 1, 'unit': 'bytes',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 318, 'name': 'TEST1rcu', 'type_id': 2, 'type_name': 'rcu', 'unit_id': 2, 'unit': 'rcu_board',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 319, 'name': 'TEST1tbb', 'type_id': 1, 'type_name': 'tbb', 'unit_id': 1, 'unit': 'bytes',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 320, 'name': 'CS001chan0', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 321, 'name': 'CS001bw0', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 322, 'name': 'CS001chan1', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 323, 'name': 'CS001bw1', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 324, 'name': 'CS002chan0', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 325, 'name': 'CS002bw0', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 326, 'name': 'CS002chan1', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 327, 'name': 'CS002bw1', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 328, 'name': 'CS003chan0', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 329, 'name': 'CS003bw0', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 330, 'name': 'CS003chan1', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 331, 'name': 'CS003bw1', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 332, 'name': 'CS004chan0', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 333, 'name': 'CS004bw0', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 334, 'name': 'CS004chan1', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 335, 'name': 'CS004bw1', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 336, 'name': 'CS005chan0', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 337, 'name': 'CS005bw0', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 338, 'name': 'CS005chan1', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 339, 'name': 'CS005bw1', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 340, 'name': 'CS006chan0', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 341, 'name': 'CS006bw0', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 342, 'name': 'CS006chan1', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 343, 'name': 'CS006bw1', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 344, 'name': 'CS007chan0', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 345, 'name': 'CS007bw0', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 346, 'name': 'CS007chan1', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 347, 'name': 'CS007bw1', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 348, 'name': 'CS011chan0', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 349, 'name': 'CS011bw0', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 350, 'name': 'CS011chan1', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 351, 'name': 'CS011bw1', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 352, 'name': 'CS013chan0', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 353, 'name': 'CS013bw0', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 354, 'name': 'CS013chan1', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 355, 'name': 'CS013bw1', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 356, 'name': 'CS017chan0', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 357, 'name': 'CS017bw0', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 358, 'name': 'CS017chan1', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 359, 'name': 'CS017bw1', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 360, 'name': 'CS021chan0', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 361, 'name': 'CS021bw0', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 362, 'name': 'CS021chan1', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 363, 'name': 'CS021bw1', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 364, 'name': 'CS024chan0', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 365, 'name': 'CS024bw0', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 366, 'name': 'CS024chan1', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 367, 'name': 'CS024bw1', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 368, 'name': 'CS026chan0', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 369, 'name': 'CS026bw0', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 370, 'name': 'CS026chan1', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 371, 'name': 'CS026bw1', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 372, 'name': 'CS028chan0', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 373, 'name': 'CS028bw0', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 374, 'name': 'CS028chan1', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 375, 'name': 'CS028bw1', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 376, 'name': 'CS030chan0', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 377, 'name': 'CS030bw0', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 378, 'name': 'CS030chan1', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 379, 'name': 'CS030bw1', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 380, 'name': 'CS031chan0', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 381, 'name': 'CS031bw0', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 382, 'name': 'CS031chan1', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 383, 'name': 'CS031bw1', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 384, 'name': 'CS032chan0', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 385, 'name': 'CS032bw0', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 386, 'name': 'CS032chan1', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 387, 'name': 'CS032bw1', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 388, 'name': 'CS101chan0', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 389, 'name': 'CS101bw0', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 390, 'name': 'CS101chan1', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 391, 'name': 'CS101bw1', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 392, 'name': 'CS103chan0', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 393, 'name': 'CS103bw0', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 394, 'name': 'CS103chan1', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 395, 'name': 'CS103bw1', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 396, 'name': 'CS201chan0', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 397, 'name': 'CS201bw0', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 398, 'name': 'CS201chan1', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 399, 'name': 'CS201bw1', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 400, 'name': 'CS301chan0', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 401, 'name': 'CS301bw0', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 402, 'name': 'CS301chan1', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 403, 'name': 'CS301bw1', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 404, 'name': 'CS302chan0', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 405, 'name': 'CS302bw0', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 406, 'name': 'CS302chan1', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 407, 'name': 'CS302bw1', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 408, 'name': 'CS401chan0', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 409, 'name': 'CS401bw0', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 410, 'name': 'CS401chan1', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 411, 'name': 'CS401bw1', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 412, 'name': 'CS501chan0', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 413, 'name': 'CS501bw0', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 414, 'name': 'CS501chan1', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 415, 'name': 'CS501bw1', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 416, 'name': 'RS106chan', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 417, 'name': 'RS106bw', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 418, 'name': 'RS205chan', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 419, 'name': 'RS205bw', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 420, 'name': 'RS208chan', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 421, 'name': 'RS208bw', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 422, 'name': 'RS210chan', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 423, 'name': 'RS210bw', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 424, 'name': 'RS305chan', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 425, 'name': 'RS305bw', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 426, 'name': 'RS306chan', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 427, 'name': 'RS306bw', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 428, 'name': 'RS307chan', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 429, 'name': 'RS307bw', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 430, 'name': 'RS310chan', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 431, 'name': 'RS310bw', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 432, 'name': 'RS406chan', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 433, 'name': 'RS406bw', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 434, 'name': 'RS407chan', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 435, 'name': 'RS407bw', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 436, 'name': 'RS408chan', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 437, 'name': 'RS408bw', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 438, 'name': 'RS409chan', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 439, 'name': 'RS409bw', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 440, 'name': 'RS503chan', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 441, 'name': 'RS503bw', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 442, 'name': 'RS508chan', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 443, 'name': 'RS508bw', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 444, 'name': 'RS509chan', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 445, 'name': 'RS509bw', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 446, 'name': 'DE601chan', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 447, 'name': 'DE601bw', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 448, 'name': 'DE602chan', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 449, 'name': 'DE602bw', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 450, 'name': 'DE603chan', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 451, 'name': 'DE603bw', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 452, 'name': 'DE604chan', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 453, 'name': 'DE604bw', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 454, 'name': 'DE605chan', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 455, 'name': 'DE605bw', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 456, 'name': 'FR606chan', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 457, 'name': 'FR606bw', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 458, 'name': 'SE607chan', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 459, 'name': 'SE607bw', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 460, 'name': 'UK608chan', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 461, 'name': 'UK608bw', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 462, 'name': 'DE609chan', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 463, 'name': 'DE609bw', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 464, 'name': 'PL610chan', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 465, 'name': 'PL610bw', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 466, 'name': 'PL611chan', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 467, 'name': 'PL611bw', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 468, 'name': 'PL612chan', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 469, 'name': 'PL612bw', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 470, 'name': 'IE613chan', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 471, 'name': 'IE613bw', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 472, 'name': 'IS614chan', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 473, 'name': 'IS614bw', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 474, 'name': 'TEST1chan', 'type_id': 0, 'type_name': 'rsp', 'unit_id': 0, 'unit': 'rsp_channel_bit',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1},
-            {'id': 475, 'name': 'TEST1bw', 'type_id': 3, 'type_name': 'bandwidth', 'unit_id': 3, 'unit': 'bits/second',
-             'available_capacity': 10, 'used_capacity': 0, 'total_capacity': 10, 'active': 1}
-        ]
-
-        self.rarpc_mock.getResourceClaims.return_value = []
-
-        self.rarpc_mock.getResourceAllocationConfig.return_value = [
-            {'name': 'max_fill_ratio_CEP4_storage', 'value': 0.85}, {'name': 'claim_timeout', 'value': 172800},
-            {'name': 'min_inter_task_delay', 'value': 60}, {'name': 'max_fill_ratio_CEP4_bandwidth', 'value': 0.75}
-        ]
+        self.tmp_exchange = TemporaryExchange(__package__)
+        self.tmp_exchange.open()
+        self.addCleanup(self.tmp_exchange.close)
 
         def rerpc_mock_get_estimated_resources(specification_tree):
             otdb_id = specification_tree['otdb_id']
             return self.rerpc_replymessage[str(otdb_id)]
 
-        rerpc_patcher = mock.patch('lofar.sas.resourceassignment.resourceassignmentestimator.rpc.ResourceEstimatorRPC')
+        rerpc_patcher = mock.patch('lofar.sas.resourceassignment.resourceassigner.resource_assigner.ResourceEstimatorRPC')
         self.addCleanup(rerpc_patcher.stop)
         self.rerpc_mock = rerpc_patcher.start()
+        self.rerpc_mock.create.side_effect = lambda **kwargs: self.rerpc_mock # make factory method 'create' return the mock instance
         self.rerpc_mock.get_estimated_resources.side_effect = rerpc_mock_get_estimated_resources
 
-        otdbrpc_patcher = mock.patch('lofar.sas.otdb.otdbrpc')
+        otdbrpc_patcher = mock.patch('lofar.sas.resourceassignment.resourceassigner.resource_assigner.OTDBRPC')
         self.addCleanup(otdbrpc_patcher.stop)
         self.otdbrpc_mock = otdbrpc_patcher.start()
+        self.otdbrpc_mock.create.side_effect = lambda **kwargs: self.otdbrpc_mock # make factory method 'create' return the mock instance
 
-        momrpc_patcher = mock.patch('lofar.mom.momqueryservice.momqueryrpc')
+        momrpc_patcher = mock.patch('lofar.sas.resourceassignment.resourceassigner.resource_assigner.MoMQueryRPC')
         self.addCleanup(momrpc_patcher.stop)
         self.momrpc_mock = momrpc_patcher.start()
-        self.momrpc_mock.getPredecessorIds.return_value = {str(self.task_mom_id): self.predecessor_task_mom_ids}
-        self.momrpc_mock.getSuccessorIds.return_value = {str(self.task_mom_id): self.successor_task_mom_ids}
+        self.momrpc_mock.create.side_effect = lambda **kwargs: self.momrpc_mock # make factory method 'create' return the mock instance
+        self.momrpc_mock.getPredecessorIds.return_value = {str(self.task_mom_id): [self.predecessor_task_mom_id]}
+        self.momrpc_mock.getSuccessorIds.return_value = {str(self.task_mom_id): [self.successor_task_mom_id]}
         self.momrpc_mock.get_time_restrictions.return_value = {
             "minStartTime": self.task_minstarttime.strftime('%Y-%m-%dT%H:%M:%S'),
             "maxEndTime": self.task_maxendtime.strftime('%Y-%m-%dT%H:%M:%S'),
@@ -1623,96 +422,55 @@ class ResourceAssignerTest(unittest.TestCase):
             "maxDuration": str(self.task_maxduration)
         }
 
-        curpc_patcher = mock.patch('lofar.sas.datamanagement.cleanup.rpc')
+        curpc_patcher = mock.patch('lofar.sas.resourceassignment.resourceassigner.resource_assigner.CleanupRPC')
         self.addCleanup(curpc_patcher.stop)
         self.curpc_mock = curpc_patcher.start()
+        self.curpc_mock.create.side_effect = lambda **kwargs: self.curpc_mock # make factory method 'create' return the mock instance
+        self.curpc_mock.removeTaskData.return_value = {'deleted': True, 'message': ""}
 
-        sqrpc_patcher = mock.patch('lofar.sas.datamanagement.storagequery.rpc')
+        sqrpc_patcher = mock.patch('lofar.sas.resourceassignment.resourceassigner.resource_assigner.StorageQueryRPC')
         self.addCleanup(sqrpc_patcher.stop)
         self.sqrpc_mock = sqrpc_patcher.start()
+        self.sqrpc_mock.create.side_effect = lambda **kwargs: self.sqrpc_mock # make factory method 'create' return the mock instance
+        self.sqrpc_mock.getDiskUsageForOTDBId.return_value = {'found': True, 'disk_usage': 10}
 
-        ra_notification_bus_patcher = mock.patch('lofar.messaging.messagebus')
-        self.addCleanup(ra_notification_bus_patcher.stop)
-        self.ra_notification_bus_mock = ra_notification_bus_patcher.start()
-
-        logger_patcher = mock.patch('lofar.sas.resourceassignment.resourceassigner.resource_assigner.logger')
-        self.addCleanup(logger_patcher.stop)
-        self.logger_mock = logger_patcher.start()
-
-        dwell_scheduler_patcher = mock.patch(
-            'lofar.sas.resourceassignment.resourceassigner.resource_assigner.DwellScheduler'
-        )
-        self.addCleanup(dwell_scheduler_patcher.stop)
-        self.dwell_scheduler_mock = dwell_scheduler_patcher.start()
-        self.dwell_scheduler_mock().allocate_resources.return_value = (True, [])
-
-        prio_scheduler_patcher = mock.patch(
-            'lofar.sas.resourceassignment.resourceassigner.resource_assigner.PriorityScheduler'
-        )
-        self.addCleanup(prio_scheduler_patcher.stop)
-        self.prio_scheduler_mock = prio_scheduler_patcher.start()
-        self.prio_scheduler_mock().allocate_resources.return_value = (True, [])
-
-        obscontrol_patcher = mock.patch(
-            'lofar.sas.resourceassignment.resourceassigner.resource_assigner.ObservationControlRPCClient.abort_observation'
-        )
+        obscontrol_patcher = mock.patch('lofar.sas.resourceassignment.resourceassigner.resource_assigner.ObservationControlRPCClient')
         self.addCleanup(obscontrol_patcher.stop)
         self.obscontrol_mock = obscontrol_patcher.start()
+        self.obscontrol_mock.create.side_effect = lambda **kwargs: self.obscontrol_mock # make factory method 'create' return the mock instance
 
-        self.spec_mock = mock.MagicMock()
-        self.spec_mock.status = 'prescheduled'
-        self.spec_mock.radb_id = self.task_id
-        self.spec_mock.mom_id = self.task_mom_id
-        self.spec_mock.otdb_id = self.task_otdb_id
-        self.spec_mock.type = self.task_type
-        self.spec_mock.duration = datetime.timedelta(seconds=60)
-        self.spec_mock.starttime = datetime.datetime.utcnow()
-        self.spec_mock.endtime = datetime.datetime.utcnow()
-        self.spec_mock.min_starttime = datetime.datetime.utcnow()
-        self.spec_mock.max_endtime = datetime.datetime.utcnow()
-        self.spec_mock.calculate_dwell_values.return_value = (self.spec_mock.min_starttime,
-                                                              self.spec_mock.max_endtime,
-                                                              self.spec_mock.duration)
-
-        specification_patcher = mock.patch(
-            'lofar.sas.resourceassignment.resourceassigner.resource_assigner.Specification')
-        self.addCleanup(specification_patcher.stop)
-        self.specification_mock = specification_patcher.start()
-        self.specification_mock.return_value = self.spec_mock
+        ra_notification_bus_patcher = mock.patch('lofar.sas.resourceassignment.resourceassigner.resource_assigner.ToBus')
+        self.addCleanup(ra_notification_bus_patcher.stop)
+        self.ra_notification_bus_mock = ra_notification_bus_patcher.start()
 
         # Select logger output to see
         def myprint(s, *args):
             print(s % args if args else s, file=sys.stderr)
 
-        #self.logger_mock.debug.side_effect = myprint
+        logger_patcher = mock.patch('lofar.sas.resourceassignment.resourceassigner.resource_assigner.logger')
+        self.addCleanup(logger_patcher.stop)
+        self.logger_mock = logger_patcher.start()
         self.logger_mock.info.side_effect = myprint
         self.logger_mock.warn.side_effect = myprint
         self.logger_mock.error.side_effect = myprint
 
-        self.resource_assigner = TestingResourceAssigner(self.rarpc_mock, self.rerpc_mock,
-                                                         self.otdbrpc_mock, self.momrpc_mock,
-                                                         self.curpc_mock, self.sqrpc_mock,
-                                                         self.ra_notification_bus_mock,
-                                                         self.dwell_scheduler_mock,
-                                                         self.obscontrol_mock)
+        self.resource_assigner = ResourceAssigner(exchange=self.tmp_exchange.address, radb_dbcreds=self.radb.dbcreds)
 
         self.reset_specification_tree()
 
     def assert_all_services_opened(self):
-        self.assertTrue(self.rarpc_mock.open.called, "RARPC.open was not called")
-        self.assertTrue(self.rerpc_mock.open.called, "RPC.open was not called")
+        self.assertTrue(self.rerpc_mock.open.called, "ResourceEstimatorRPC.open was not called")
         self.assertTrue(self.otdbrpc_mock.open.called, "OTDBRPC.open was not called")
         self.assertTrue(self.momrpc_mock.open.called, "MOMRPC.open was not called")
         self.assertTrue(self.curpc_mock.open.called, "CURPC.open was not called")
-        self.assertTrue(self.ra_notification_bus_mock.open.called, "ra_notification_bus.open was not called")
+        self.assertTrue(any(mc for mc in self.ra_notification_bus_mock.mock_calls if 'open()' in str(mc)), "ra_notification_bus.open was not called")
 
     def assert_all_services_closed(self):
-        self.assertTrue(self.rarpc_mock.close.called, "RARPC.close was not called")
-        self.assertTrue(self.rerpc_mock.close.called, "RPC.close was not called")
+        self.assertTrue(self.rerpc_mock.close.called, "ResourceEstimatorRPC.close was not called")
         self.assertTrue(self.otdbrpc_mock.close.called, "OTDBRPC.close was not called")
         self.assertTrue(self.momrpc_mock.close.called, "MOMRPC.close was not called")
         self.assertTrue(self.curpc_mock.close.called, "CURPC.close was not called")
-        self.assertTrue(self.ra_notification_bus_mock.close.called, "ra_notification_bus.close was not called")
+        self.assertTrue(any(mc for mc in self.ra_notification_bus_mock.mock_calls if 'close()' in str(mc)), "ra_notification_bus.close was not called")
 
     def test_open_opens_all_services(self):
         self.resource_assigner.open()
@@ -1725,9 +483,7 @@ class ResourceAssignerTest(unittest.TestCase):
         self.assert_all_services_closed()
 
     def test_contextManager_opens_and_closes_all_services(self):
-        with TestingResourceAssigner(self.rarpc_mock, self.rerpc_mock, self.otdbrpc_mock, self.momrpc_mock,
-                                     self.curpc_mock, self.sqrpc_mock, self.ra_notification_bus_mock,
-                                     self.dwell_scheduler_mock, self.obscontrol_mock):
+        with self.resource_assigner:
             self.assert_all_services_opened()
 
         self.assert_all_services_closed()
@@ -1735,10 +491,8 @@ class ResourceAssignerTest(unittest.TestCase):
     def test_do_assignment_logs_specification(self):
         self.resource_assigner.do_assignment(self.specification_tree['otdb_id'], self.specification_tree)
 
-        self.logger_mock.info.assert_any_call('do_assignment: otdb_id=%s specification_tree=%s' % (
-            self.specification_tree['otdb_id'],
-            self.specification_tree
-        ))
+        self.logger_mock.info.assert_any_call('do_assignment: otdb_id=%s specification_tree=%s',
+                                              self.specification_tree['otdb_id'], self.specification_tree)
 
     def test_do_assignment_log_non_approved_or_prescheduled_states(self):
         otdb_id = self.non_approved_or_prescheduled_otdb_id
@@ -1754,22 +508,18 @@ class ResourceAssignerTest(unittest.TestCase):
                 (otdb_id, status, assignable_task_states_str))
 
     def test_do_assignment_approved_task_should_not_be_rescheduled(self):
-        self.spec_mock.status = 'approved'
-
-        self.resource_assigner.do_assignment(self.specification_tree['otdb_id'], self.specification_tree)
-
-        self.logger_mock.info.assert_any_call('Task otdb_id=%s is only approved, no resource assignment needed yet' %
-                                              self.specification_tree['otdb_id'])
-
-    def test_do_assignment_inserts_specification_and_task_in_radb(self):
-        self.resource_assigner.do_assignment(self.specification_tree['otdb_id'], self.specification_tree)
+        otdb_id = self.specification_tree['otdb_id']
+        # assure task is not known yet
+        self.assertIsNone(self.radb.getTask(otdb_id=otdb_id))
 
-        self.spec_mock.insert_into_radb.assert_called()
+        self.specification_tree['status'] = 'approved'
+        self.resource_assigner.do_assignment(otdb_id, self.specification_tree)
 
-    def test_do_assignment_fills_specification_based_on_specication_dict(self):
-        self.resource_assigner.do_assignment(self.specification_tree['otdb_id'], self.specification_tree)
+        # assure task is known now, and scheduled
+        self.assertIsNotNone(self.radb.getTask(otdb_id=otdb_id))
+        self.assertEqual('approved', self.radb.getTask(otdb_id=otdb_id)['status'])
 
-        self.spec_mock.from_dict.assert_called_with(self.specification_tree)
+        self.logger_mock.info.assert_any_call('Task otdb_id=%s is only approved, no resource assignment needed yet' % otdb_id)
 
     def freeze_time_one_day_in_the_future(self, datetime_mock):
         now = datetime.datetime.utcnow() + datetime.timedelta(days=1)
@@ -1787,52 +537,35 @@ class ResourceAssignerTest(unittest.TestCase):
 
         self.rerpc_mock.get_estimated_resources.any_calls_with(self.specification_tree)
 
-    # def test_do_assignment_logs_when_otdb_id_not_needed_resources(self):
-    #     self.spec_mock.radb_id = self.otdb_id + 11
-    #     self.specification_tree["otdb_id"] = self.otdb_id + 11
-    #
-    #     self.resource_assigner.do_assignment(self.specification_tree['otdb_id'], self.specification_tree)
-    #
-    #     self.logger_mock.error.assert_any_call(
-    #         "An exception occurred while obtaining resource estimates. Exception=no otdb_id %s found in estimator results %s" %
-    #         (self.otdb_id + 11, self.rerpc_replymessage)
-    #     )
-
     def test_do_assignment_puts_spec_to_error_when_resource_estimation_gives_an_error(self):
-        self.dwell_scheduler_mock().allocate_resources.return_value = False
-        self.specification_tree["otdb_id"] = self.otdb_id + 11
+        with mock.patch('lofar.sas.resourceassignment.resourceassigner.resource_assigner.PriorityScheduler') as scheduler_mock:
+            scheduler_mock.allocate_resources.return_value = False
 
-        self.resource_assigner.do_assignment(self.specification_tree['otdb_id'], self.specification_tree)
+            self.specification_tree["otdb_id"] = self.otdb_id + 11
+            self.specification_tree['status'] = 'prescheduled'
+            self.resource_assigner.do_assignment(self.specification_tree['otdb_id'], self.specification_tree)
 
-        self.spec_mock.set_status.assert_called_with('error')
+            task = self.radb.getTask(otdb_id=self.specification_tree["otdb_id"])
+            self.assertEqual('error', task['status'])
 
     def test_do_assignment_should_not_claim_resouces_when_otdb_id_not_needed_resources(self):
-        self.specification_tree["otdb_id"] = self.otdb_id + 1
+        self.specification_tree["otdb_id"] = self.no_resources_otdb_id
 
+        self.specification_tree['status'] = 'prescheduled'
         self.resource_assigner.do_assignment(self.specification_tree['otdb_id'], self.specification_tree)
 
-        self.rarpc_mock.insertResourceClaims.assert_not_called()
-
-    # def test_do_assignment_logs_when_task_type_not_in_needed_resources(self):
-    #     wrong_task_type = "observation"
-    #     self.spec_mock.type = wrong_task_type
-    #     self.specification_tree["task_type"] = wrong_task_type
-    #
-    #     self.resource_assigner.do_assignment(self.specification_tree['otdb_id'], self.specification_tree)
-    #
-    #     self.logger_mock.error.assert_any_call(
-    #         "An exception occurred while obtaining resource estimates. Exception=no task type %s found in estimator results %s" %
-    #         (wrong_task_type, self.rerpc_replymessage[str(self.otdb_id)])
-    #     )
+        task = self.radb.getTask(otdb_id=self.specification_tree["otdb_id"])
+        self.assertEqual([], self.radb.getResourceClaims(task_ids=task['id']))
 
     def test_do_assignment_should_not_claim_resources_when_task_type_not_in_needed_resources(self):
         wrong_task_type = "observation"
-        self.spec_mock.type = wrong_task_type
         self.specification_tree["task_type"] = wrong_task_type
-
+        self.specification_tree['status'] = 'prescheduled'
         self.resource_assigner.do_assignment(self.specification_tree['otdb_id'], self.specification_tree)
 
-        self.rarpc_mock.insertResourceClaims.assert_not_called()
+        task = self.radb.getTask(otdb_id=self.specification_tree["otdb_id"])
+        self.assertEqual('error', task['status'])
+        self.assertEqual([], self.radb.getResourceClaims(task_ids=task['id']))
 
     def test_do_assignment_should_log_single_errors_in_needed_resources(self):
         self.specification_tree["otdb_id"] = self.resources_with_errors_otdb_id
@@ -1859,76 +592,122 @@ class ResourceAssignerTest(unittest.TestCase):
             self.resource_assigner._get_resource_estimates(self.specification_tree)
 
     def ra_notification_bus_send_called_with(self, content, subject):
-        for call in self.ra_notification_bus_mock.send.call_args_list:
-            if call[0][0].subject == subject and call[0][0].content == content:
-                return True
+        for call in self.ra_notification_bus_mock().send.call_args_list:
+            if isinstance(call[0][0], EventMessage):
+                msg = call[0][0]
+                if msg.subject == subject and msg.content == content:
+                    return True
         return False
 
     def test_do_assignment_notifies_bus_when_it_was_unable_to_schedule_Conflict(self):
-        content = {'radb_id': self.task_id, 'otdb_id': self.task_otdb_id, 'mom_id': self.task_mom_id}
-        subject = 'Task' + 'Conflict'
-
-        self.spec_mock.status = 'conflict'
-        self.dwell_scheduler_mock().allocate_resources.return_value = False
-
-        self.resource_assigner.do_assignment(self.specification_tree['otdb_id'], self.specification_tree)
-
-        self.assertBusNotificationAndLogging(content, subject)
-
-    def test_do_assignment_should_read_spec_from_radb(self):
-        self.spec_mock.status = 'conflict'
-        self.dwell_scheduler_mock().allocate_resources.return_value = False
+        # prepare: insert a blocking task with a huge claim on storage (directly via the radb, not via the resource_assigner)
+        task_id = self.radb.insertSpecificationAndTask(9876, 9876, 'prescheduled', 'observation',
+                                                       datetime.datetime.utcnow()-datetime.timedelta(days=1),
+                                                       datetime.datetime.utcnow()+datetime.timedelta(days=1),
+                                                       "", "CEP4")['task_id']
+        task = self.radb.getTask(task_id)
+        cep_storage_resource = next(r for r in self.radb.getResources(resource_types='storage', include_availability=True) if 'CEP4' in r['name'])
+        self.radb.insertResourceClaim(cep_storage_resource['id'], task_id, task['starttime'], task['endtime'],
+                                      0.75*cep_storage_resource['total_capacity'], "", 0)
+        self.radb.updateTaskAndResourceClaims(task_id, claim_status='claimed', task_status='scheduled')
+        self.assertEqual('scheduled', self.radb.getTask(task_id)['status'])
+
+        # make sure the estimater mock asks for too much storage which wont fit during scheduling
+        def rerpc_mock_get_estimated_resources(specification_tree):
+            otdb_id = specification_tree['otdb_id']
+            estimates = deepcopy(self.rerpc_replymessage[str(otdb_id)])
+            estimates['estimates'][0]['resource_types']['storage'] = 0.75*cep_storage_resource['total_capacity']
+            return estimates
+        self.rerpc_mock.get_estimated_resources.side_effect = rerpc_mock_get_estimated_resources
 
+        # now test the resource_assigner.do_assignment. Should not succeed. Task and claims should go to conflict status.
+        self.specification_tree['status'] = 'prescheduled'
         self.resource_assigner.do_assignment(self.specification_tree['otdb_id'], self.specification_tree)
 
-        self.spec_mock.read_from_radb.assert_called_with(self.spec_mock.radb_id)
+        # check if task is in the radb, and if status is in conflict
+        resulting_task = self.radb.getTask(otdb_id=self.specification_tree['otdb_id'])
+        self.assertIsNotNone(resulting_task)
+        self.assertEqual('conflict', resulting_task['status'])
 
-    def test_do_assignment_should_set_status_to_conflict_again_when_cant_schedule_and_in_conflict(self):
-        self.spec_mock.status = 'conflict'
-        self.dwell_scheduler_mock().allocate_resources.return_value = False
-
-        self.resource_assigner.do_assignment(self.specification_tree['otdb_id'], self.specification_tree)
-
-        self.spec_mock.set_status.assert_called_with('conflict')
+        # check if TaskConflict notification was logged and send
+        content = {'radb_id': resulting_task['id'], 'otdb_id': resulting_task['otdb_id'], 'mom_id': resulting_task['mom_id']}
+        subject = 'TaskConflict'
+        self.assertBusNotificationAndLogging(content, subject)
 
     def test_do_assignment_notifies_bus_when_it_was_unable_to_schedule_Error(self):
-        content = {'radb_id': self.task_id, 'otdb_id': self.task_otdb_id, 'mom_id': self.task_mom_id}
-        subject = 'Task' + 'Error'
-
-        self.spec_mock.status = 'error'
-        self.dwell_scheduler_mock().allocate_resources.return_value = False
+        # make sure the estimater mock asks for more storage than available resulting in TaskError
+        def rerpc_mock_get_estimated_resources(specification_tree):
+            otdb_id = specification_tree['otdb_id']
+            estimates = deepcopy(self.rerpc_replymessage[str(otdb_id)])
+            cep_storage_resource = next(r for r in
+                                        self.radb.getResources(resource_types='storage', include_availability=True)
+                                        if 'CEP4' in r['name'])
+            estimates['estimates'][0]['resource_types']['storage'] = 1+cep_storage_resource['total_capacity']
+            return estimates
+        self.rerpc_mock.get_estimated_resources.side_effect = rerpc_mock_get_estimated_resources
 
+        # now test the resource_assigner.do_assignment. Should not succeed. Task should go to error status.
+        self.specification_tree['status'] = 'prescheduled'
         self.resource_assigner.do_assignment(self.specification_tree['otdb_id'], self.specification_tree)
 
+        # check if task is in the radb, and if status is in error
+        resulting_task = self.radb.getTask(otdb_id=self.specification_tree['otdb_id'])
+        self.assertIsNotNone(resulting_task)
+        self.assertEqual('error', resulting_task['status'])
+
+        # check if TaskError notification was logged and send
+        content = {'radb_id': resulting_task['id'], 'otdb_id': resulting_task['otdb_id'], 'mom_id': resulting_task['mom_id']}
+        subject = 'TaskError'
         self.assertBusNotificationAndLogging(content, subject)
 
     def test_do_assignment_should_set_status_to_error_again_when_cant_schedule_and_not_in_conflict(self):
-        self.spec_mock.status = 'error'
-        self.dwell_scheduler_mock().allocate_resources.return_value = False
+        # make sure the estimater mock asks for more storage than available resulting in TaskError
+        def rerpc_mock_get_estimated_resources(specification_tree):
+            otdb_id = specification_tree['otdb_id']
+            estimates = deepcopy(self.rerpc_replymessage[str(otdb_id)])
+            cep_storage_resource = next(r for r in
+                                        self.radb.getResources(resource_types='storage', include_availability=True)
+                                        if 'CEP4' in r['name'])
+            estimates['estimates'][0]['resource_types']['storage'] = 1+cep_storage_resource['total_capacity']
+            return estimates
+        self.rerpc_mock.get_estimated_resources.side_effect = rerpc_mock_get_estimated_resources
 
-        self.resource_assigner.do_assignment(self.specification_tree['otdb_id'], self.specification_tree)
+        # check if the task assignment results in an error twice (apparently it didn't someday for whatever reason)
+        for i in range(2):
+            self.specification_tree['status'] = 'prescheduled'
+            self.resource_assigner.do_assignment(self.specification_tree['otdb_id'], self.specification_tree)
 
-        self.spec_mock.set_status.assert_called_with('error')
+            # check if task is in the radb, and if status is in error
+            resulting_task = self.radb.getTask(otdb_id=self.specification_tree['otdb_id'])
+            self.assertIsNotNone(resulting_task)
+            self.assertEqual('error', resulting_task['status'])
 
-    def test_do_assignment_logs_task_data_removal_if_task_is_pipeline(self):
-        self.sqrpc_mock.getDiskUsageForOTDBId.return_value = {'found': True, 'disk_usage': 10}
+            # check if TaskError notification was logged and send
+            content = {'radb_id': resulting_task['id'], 'otdb_id': resulting_task['otdb_id'], 'mom_id': resulting_task['mom_id']}
+            subject = 'TaskError'
+            self.assertBusNotificationAndLogging(content, subject)
+
+            # reset the mock calls for next round
+            self.ra_notification_bus_mock().send.reset_mock()
+            self.logger_mock.info.send.reset_mock()
 
+    def test_do_assignment_logs_task_data_removal_if_task_is_pipeline(self):
+        self.specification_tree['status'] = 'prescheduled'
         self.resource_assigner.do_assignment(self.specification_tree['otdb_id'], self.specification_tree)
 
         self.logger_mock.info.assert_any_call("removing data on disk from previous run for otdb_id %s", self.otdb_id)
 
     def test_do_assignment_removes_task_data_if_task_is_pipeline(self):
-        self.sqrpc_mock.getDiskUsageForOTDBId.return_value = {'found': True, 'disk_usage': 10}
-
+        self.specification_tree['status'] = 'prescheduled'
         self.resource_assigner.do_assignment(self.specification_tree['otdb_id'], self.specification_tree)
 
-        self.curpc_mock.removeTaskData.assert_any_call(self.task_otdb_id)
+        self.curpc_mock.removeTaskData.assert_any_call(self.specification_tree['otdb_id'])
 
     def test_do_assignment_logs_when_taks_data_could_not_be_deleted(self):
         message = "file was locked"
-        self.sqrpc_mock.getDiskUsageForOTDBId.return_value = {'found': True, 'disk_usage': 10}
         self.curpc_mock.removeTaskData.return_value = {'deleted': False, 'message': message}
 
+        self.specification_tree['status'] = 'prescheduled'
         self.resource_assigner.do_assignment(self.specification_tree['otdb_id'], self.specification_tree)
 
         self.logger_mock.warning.assert_any_call(
@@ -1936,26 +715,42 @@ class ResourceAssignerTest(unittest.TestCase):
 
     def test_do_assignment_logs_exception_from_curcp_removeTaskData(self):
         exception_str = "Error something went wrong"
-        self.sqrpc_mock.getDiskUsageForOTDBId.return_value = {'found': True, 'disk_usage': 10}
         self.curpc_mock.removeTaskData.side_effect = Exception(exception_str)
 
-        self.resource_assigner.do_assignment(self.specification_tree['otdb_id'],
-                                             self.specification_tree)
+        otdb_id = self.specification_tree['otdb_id']
+        # assure task is not known yet
+        self.assertIsNone(self.radb.getTask(otdb_id=otdb_id))
+
+        self.specification_tree['status'] = 'prescheduled'
+        self.resource_assigner.do_assignment(otdb_id, self.specification_tree)
 
         self.logger_mock.error.assert_any_call("Exception in cleaning up earlier data: %s", exception_str)
 
     def test_do_assignment_notifies_bus_when_task_is_scheduled(self):
-        content = {'radb_id': self.task_id, 'otdb_id': self.task_otdb_id, 'mom_id': self.task_mom_id}
-        subject = 'Task' + 'Scheduled'
-
+        self.specification_tree['status'] = 'prescheduled'
         self.resource_assigner.do_assignment(self.specification_tree['otdb_id'], self.specification_tree)
 
+        # check if task is in the radb, and if status is scheduled
+        resulting_task = self.radb.getTask(otdb_id=self.specification_tree['otdb_id'])
+        self.assertIsNotNone(resulting_task)
+        self.assertEqual('scheduled', resulting_task['status'])
+
+        # check if TaskScheduled notification was logged and send
+        content = {'radb_id': resulting_task['id'], 'otdb_id': resulting_task['otdb_id'], 'mom_id': resulting_task['mom_id']}
+        subject = 'TaskScheduled'
         self.assertBusNotificationAndLogging(content, subject)
 
     def test_do_assignement_set_status_on_spec_when_scheduleable(self):
-        self.resource_assigner.do_assignment(self.specification_tree['otdb_id'], self.specification_tree)
+        otdb_id = self.specification_tree['otdb_id']
+        # assure task is not known yet
+        self.assertIsNone(self.radb.getTask(otdb_id=otdb_id))
+
+        self.specification_tree['status'] = 'prescheduled'
+        self.resource_assigner.do_assignment(otdb_id, self.specification_tree)
 
-        self.spec_mock.set_status.assert_called_with('scheduled')
+        # assure task is known now, and scheduled
+        self.assertIsNotNone(self.radb.getTask(otdb_id=otdb_id))
+        self.assertEqual('scheduled', self.radb.getTask(otdb_id=otdb_id)['status'])
 
     def assertBusNotificationAndLogging(self, content, subject):
         self.assertTrue(self.ra_notification_bus_send_called_with(content, "%s.%s" %(DEFAULT_RA_NOTIFICATION_PREFIX, subject)))
@@ -1967,6 +762,7 @@ class ResourceAssignerTest(unittest.TestCase):
         self.otdbrpc_mock.taskSetSpecification.side_effect = Exception(exception_str)
 
         with self.assertRaisesRegexp(Exception, exception_str):
+            self.mom_bug_specification_tree['status'] = 'prescheduled'
             self.resource_assigner.do_assignment(self.mom_bug_specification_tree['otdb_id'],
                                                  self.mom_bug_specification_tree)
 
@@ -2019,11 +815,20 @@ class ResourceAssignerTest(unittest.TestCase):
         self.obscontrol_mock.abort_observation.assert_called_with(spec.otdb_id)
 
     # SW-800 The schedulers need open and close called (using context manager)
-    def test_do_assignement_uses_context_manager_on_dwell_scheduler(self):
-        self.resource_assigner.do_assignment(self.specification_tree['otdb_id'], self.specification_tree)
+    def test_do_assignement_uses_context_manager_on_schedulers(self):
+        with mock.patch('lofar.sas.resourceassignment.resourceassigner.resource_assigner.BasicScheduler') as basic_scheduler_mock:
+            with mock.patch('lofar.sas.resourceassignment.resourceassigner.resource_assigner.PriorityScheduler') as prio_scheduler_mock:
+                basic_scheduler_mock().allocate_resources.return_value = (False, None)
+                prio_scheduler_mock().allocate_resources.return_value = (False, None)
+
+                self.specification_tree['status'] = 'prescheduled'
+                self.resource_assigner.do_assignment(self.specification_tree['otdb_id'], self.specification_tree)
+
+                basic_scheduler_mock().__enter__.assert_called()
+                basic_scheduler_mock().__exit__.assert_called()
 
-        self.dwell_scheduler_mock().__enter__.assert_called()
-        self.dwell_scheduler_mock().__exit__.assert_called()
+                prio_scheduler_mock().__enter__.assert_called()
+                prio_scheduler_mock().__exit__.assert_called()
 
     #This class is currently missing any tests of interaction between tasks already scheduled and new tasks,
     # e.g. triggered ones. It would require a totally different way to set up the tests to be able to test this.
-- 
GitLab