summaryrefslogtreecommitdiffstats
path: root/onap_data_provider
diff options
context:
space:
mode:
Diffstat (limited to 'onap_data_provider')
-rw-r--r--onap_data_provider/resources/pnf_resource.py2
-rw-r--r--onap_data_provider/resources/vnf_resource.py5
-rw-r--r--onap_data_provider/schemas/infra_1_1.schema12
3 files changed, 17 insertions, 2 deletions
diff --git a/onap_data_provider/resources/pnf_resource.py b/onap_data_provider/resources/pnf_resource.py
index 553018b..1a02052 100644
--- a/onap_data_provider/resources/pnf_resource.py
+++ b/onap_data_provider/resources/pnf_resource.py
@@ -47,7 +47,7 @@ class PnfResource(Resource, XnfResource):
"""
if not self.exists:
logging.debug("Create Pnf %s", self.data["name"])
- self._xnf = Pnf(self.data["name"])
+ self._xnf = Pnf(self.data["name"], category=self.data.get("category"), subcategory=self.data.get("subcategory"))
if (vendor_name := self.data.get("vendor")) is not None:
self._xnf.vendor = Vendor(vendor_name)
self.onboard_resource_with_properties(self.data)
diff --git a/onap_data_provider/resources/vnf_resource.py b/onap_data_provider/resources/vnf_resource.py
index 1d47413..9c77f19 100644
--- a/onap_data_provider/resources/vnf_resource.py
+++ b/onap_data_provider/resources/vnf_resource.py
@@ -18,6 +18,7 @@
import logging
from typing import Any, Dict
+from onapsdk.sdc.vendor import Vendor # type: ignore
from onapsdk.sdc.vf import Vf # type: ignore
from .resource import Resource
from .xnf_resource import XnfResource
@@ -46,7 +47,9 @@ class VnfResource(Resource, XnfResource):
"""
if not self.exists:
logging.debug("Create Vnf %s", self.data["name"])
- self._xnf = Vf(name=self.data["name"])
+ self._xnf = Vf(name=self.data["name"], category=self.data.get("category"), subcategory=self.data.get("subcategory"))
+ if (vendor_name := self.data.get("vendor")) is not None:
+ self._xnf._vendor = Vendor(vendor_name)
self.onboard_resource_with_properties(self.data)
@property
diff --git a/onap_data_provider/schemas/infra_1_1.schema b/onap_data_provider/schemas/infra_1_1.schema
index eac5dcb..124a00e 100644
--- a/onap_data_provider/schemas/infra_1_1.schema
+++ b/onap_data_provider/schemas/infra_1_1.schema
@@ -281,6 +281,12 @@ properties:
type: string
vsp:
type: string
+ category:
+ type: string
+ subcategory:
+ type: string
+ vendor:
+ type: string
deployment_artifact:
type: object
properties:
@@ -327,6 +333,12 @@ properties:
type: string
vsp:
type: string
+ category:
+ type: string
+ subcategory:
+ type: string
+ vendor:
+ type: string
deployment_artifact:
type: object
properties: