HelmCLI: profile list use constant
[pti/o2.git] / o2ims / domain / ocloud.py
index 1775aa2..380d919 100644 (file)
@@ -23,11 +23,16 @@ from .resource_type import ResourceTypeEnum
 # from uuid import UUID
 
 
+DeploymentManagerProfileDefault = 'default'
+DeploymentManagerProfileSOL018 = 'sol018'
+DeploymentManagerProfileSOL018HelmCLI = 'sol018_helmcli'
+
+
 class DeploymentManager(AgRoot, Serializer):
     def __init__(self, id: str, name: str, ocloudid: str,
                  dmsendpoint: str, description: str = '',
                  supportedLocations: str = '', capabilities: str = '',
-                 capacity: str = '') -> None:
+                 capacity: str = '', profile: str = '') -> None:
         super().__init__()
         self.deploymentManagerId = id
         self.version_number = 0
@@ -38,8 +43,23 @@ class DeploymentManager(AgRoot, Serializer):
         self.supportedLocations = supportedLocations
         self.capabilities = capabilities
         self.capacity = capacity
+        self.profile = profile
         self.extensions = []
 
+    def serialize(self):
+        print(self.__dict__)
+        d = Serializer.serialize(self)
+
+        if 'profile' in d and d['profile'] != '':
+            d['profile'] = json.loads(d['profile'])
+        d['profileSupportList'] = [
+            DeploymentManagerProfileDefault,
+            DeploymentManagerProfileSOL018,
+            DeploymentManagerProfileSOL018HelmCLI,
+        ]
+
+        return d
+
 
 class ResourcePool(AgRoot, Serializer):
     def __init__(self, id: str, name: str, location: str,