def create_l3(name, l2_uuid, session_uuid=None): action = api_actions.CreateL3NetworkAction() action.name = name action.l2NetworkUuid = l2_uuid action.timeout = 300000 evt = acc_ops.execute_action_with_session(action, session_uuid) test_util.action_logger("[L3:] %s is created" % name) return evt.inventory
def create_l3_vpc(name,l2_uuid,session_uuid = None): action = api_actions.CreateL3NetworkAction() action.name = name action.l2NetworkUuid = l2_uuid action.timeout = 300000 action.type = inventory.VPC_L3_NETWORK_TYPE action.sessionUuid = session_uuid evt = acc_ops.execute_action_with_session(action,session_uuid) test_util.action_logger('[l3:] %s is created' %name) return evt.inventory
def _do_l3_deploy(l3, l2inv_uuid, l3Name, session_uuid): action = api_actions.CreateL3NetworkAction() action.sessionUuid = session_uuid action.description = l3.description__ if l3.system__ and l3.system__ != 'False': action.system = 'true' action.l2NetworkUuid = l2inv_uuid action.name = l3Name if l3.uuid__: action.resourceUuid = l3.uuid__ action.type = inventory.L3_BASIC_NETWORK_TYPE if l3.domain_name__: action.dnsDomain = l3.domain_name__ try: evt = action.run() except: exc_info.append(sys.exc_info()) deploy_logger(jsonobject.dumps(evt)) l3_inv = evt.inventory # add dns if xmlobject.has_element(l3, 'dns'): for dns in xmlobject.safe_list(l3.dns): action = api_actions.AddDnsToL3NetworkAction() action.sessionUuid = session_uuid action.dns = dns.text_ action.l3NetworkUuid = l3_inv.uuid try: evt = action.run() except: exc_info.append(sys.exc_info()) deploy_logger(jsonobject.dumps(evt)) # add ip range. if xmlobject.has_element(l3, 'ipRange'): do_add_ip_range(l3.ipRange, l3_inv.uuid, session_uuid) # add network service. providers = {} action = api_actions.QueryNetworkServiceProviderAction() action.sessionUuid = session_uuid action.conditions = [] try: reply = action.run() except: exc_info.append(sys.exc_info()) for pinv in reply: providers[pinv.name] = pinv.uuid if xmlobject.has_element(l3, 'networkService'): do_add_network_service(l3.networkService, l3_inv.uuid, providers, session_uuid)