def __flowvisor_fs_to_instance(self, fs_dict): flowspace = FlowSpace() group = Group() for datapath in fs_dict.keys(): dpid = DPID() dpid.datapath = datapath for port in fs_dict[datapath]["ports"]: of_port = Port() of_port.set_num(port) dpid.add_port(of_port) group.add_dpid(dpid) for match in fs_dict[datapath]["matches"]: of_match = Match() if match.has_key("dl_vlan"): of_match.add_dl_vlan(match["dl_vlan"]) group.add_match(of_match) flowspace.set_group(group) return flowspace
def __parse_to_fs_object(self,urn=None, experiment=None, exp_flowspace=None, expiration=None, slice_urn=None): flowspace = FlowSpace() flowspace.set_description(experiment.slice_desc) flowspace.set_urn(urn) flowspace.set_email(str(experiment.owner_email)) flowspace.set_slice_urn(urn) # slice_urn == urn (optin) flowspace.set_state(self.GENI_NOT_READY) provisioning_status, allocation_status = self.__get_geni_status(urn) flowspace.set_allocation_status(allocation_status) # flowspace.set_expiration(self.__get_slice_expiration(expiration)) flowspace.set_operational_status(provisioning_status) flowspace.set_expiration(expiration) controller = Controller() controller.parse_url(experiment.controller_url) flowspace.set_controller(controller) return flowspace