diff --git a/python/neutron-understack/neutron_understack/nautobot.py b/python/neutron-understack/neutron_understack/nautobot.py index aee73aa76..4a27029f5 100644 --- a/python/neutron-understack/neutron_understack/nautobot.py +++ b/python/neutron-understack/neutron_understack/nautobot.py @@ -86,6 +86,20 @@ def ucvni_delete(self, network_id): url = f"/api/plugins/undercloud-vni/ucvnis/{network_id}/" return self.make_api_request(url, "delete") + def fetch_namespace_by_name(self, name: str) -> str: + url = f"/api/ipam/namespaces/?name={name}&depth=1" + resp_data = self.make_api_request(url, "get") + return resp_data["results"][0]["id"] + + def namespace_create(self, name: str) -> dict: + url = "/api/ipam/namespaces/" + payload = {"name": name} + return self.make_api_request(url, "post", payload) + + def namespace_delete(self, namespace_uuid: str) -> dict: + url = f"/api/ipam/namespaces/{namespace_uuid}/" + return self.make_api_request(url, "delete") + def prep_switch_interface( self, connected_interface_id: str, ucvni_uuid: str ) -> str: