def __validate_node_sliver(sliver: NodeSliver):
     """
     Validate Network Node Sliver
     @param sliver Node Sliver
     @raises exception for invalid slivers
     """
     if sliver.get_capacities() is None and sliver.get_capacity_hints() is None:
         raise OrchestratorException(message="Either Capacity or Capacity Hints must be specified!",
                                     http_error_code=BAD_REQUEST)
    def testCapacitiesLabels(self):
        ns = NodeSliver()
        cap_hint = CapacityHints(instance_type='blah')
        lab = Labels(vlan_range='1-4096')
        ns.set_properties(capacities=Capacities(unit=1, core=2), labels=lab, capacity_hints=cap_hint)
        assert(ns.get_capacity_hints().instance_type == 'blah')
        assert(ns.get_labels().vlan_range == '1-4096')
        assert(ns.get_capacities().core == 2)

        with self.assertRaises(LabelException):
            Labels(vlan_range='1-8000')

        with self.assertRaises(LabelException):
            Labels(asn='600000')

        with self.assertRaises(LabelException):
            Labels(vlan='4098')

        with self.assertRaises(LabelException):
            Labels(inner_vlan='6000')