X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=o2ims%2Fdomain%2Focloud.py;h=0829fb9804ec1e1f5edeaf096444747e02ae0521;hb=71f8155b3b60befb21aabaffe0b0cf4d940eda61;hp=49b25508c8ad492eddf6e0e5e750a45eb688193b;hpb=5c501cb5e57a1ac3e0e7d38e22a3759e7958777a;p=pti%2Fo2.git diff --git a/o2ims/domain/ocloud.py b/o2ims/domain/ocloud.py index 49b2550..0829fb9 100644 --- a/o2ims/domain/ocloud.py +++ b/o2ims/domain/ocloud.py @@ -14,7 +14,7 @@ from __future__ import annotations -from o2ims.domain.base import AgRoot +from o2common.domain.base import AgRoot # from dataclasses import dataclass # from datetime import date # from typing import Optional, List, Set @@ -25,18 +25,22 @@ from .resource_type import ResourceTypeEnum class Subscription(AgRoot): def __init__(self, id: str, callback: str, consumersubid: str = '', filter: str = '') -> None: + super().__init__() self.subscriptionId = id + self.version_number = 0 self.callback = callback self.consumerSubscriptionId = consumersubid self.filter = filter -class DeploymentManager: +class DeploymentManager(AgRoot): def __init__(self, id: str, name: str, ocloudid: str, dmsendpoint: str, description: str = '', supportedLocations: str = '', capabilities: str = '', capacity: str = '') -> None: + super().__init__() self.deploymentManagerId = id + self.version_number = 0 self.oCloudId = ocloudid self.name = name self.description = description @@ -51,7 +55,9 @@ class ResourcePool(AgRoot): def __init__(self, id: str, name: str, location: str, ocloudid: str, gLocationId: str = '', description: str = '') -> None: + super().__init__() self.resourcePoolId = id + self.version_number = 0 self.oCloudId = ocloudid self.globalLocationId = gLocationId self.name = name @@ -65,6 +71,7 @@ class ResourceType(AgRoot): ocloudid: str, vender: str = '', model: str = '', version: str = '', description: str = '') -> None: + super().__init__() self.resourceTypeId = typeid self.oCloudId = ocloudid self.resourceTypeEnum = typeEnum.value @@ -81,11 +88,14 @@ class Resource(AgRoot): resourcePoolId: str, oCloudId: str = '', parentId: str = '', elements: list = [], description: str = '') -> None: + super().__init__() self.resourceId = resourceId + self.version_number = 0 self.oCloudId = oCloudId self.resourceTypeId = resourceTypeId self.resourcePoolId = resourcePoolId self.parentId = parentId + self.path = str() self.elements = elements self.description = description self.extensions = [] @@ -108,14 +118,14 @@ class Ocloud(AgRoot): self.extensions = [] # self.events = [] - def addDeploymentManager(self, - deploymentManager: DeploymentManager): - - deploymentManager.oCloudId = self.oCloudId - old = filter( - lambda x: x.deploymentManagerId == - deploymentManager.deploymentManagerId, - self.deploymentManagers) - for o in old or []: - self.deploymentManagers.remove(o) - self.deploymentManagers.append(deploymentManager) + # def addDeploymentManager(self, + # deploymentManager: DeploymentManager): + + # deploymentManager.oCloudId = self.oCloudId + # old = filter( + # lambda x: x.deploymentManagerId == + # deploymentManager.deploymentManagerId, + # self.deploymentManagers) + # for o in old or []: + # self.deploymentManagers.remove(o) + # self.deploymentManagers.append(deploymentManager)