Add Dataclasses and constant for NS instantiate 29/13129/7
authorPatricia Reinoso <patricia.reinoso@canonical.com>
Fri, 31 Mar 2023 11:22:42 +0000 (11:22 +0000)
committerMark Beierl <mark.beierl@canonical.com>
Thu, 6 Apr 2023 03:43:20 +0000 (03:43 +0000)
Change-Id: Iac6b0782bbb8a69edb56b4d7df6203b2ac92bd92
Signed-off-by: Patricia Reinoso <patricia.reinoso@canonical.com>
Signed-off-by: Mark Beierl <mark.beierl@canonical.com>
osm_common/dataclasses/temporal_dataclasses.py
osm_common/temporal_constants.py
releasenotes/notes/dummy-releasenote-e933e2f5490198f1.yaml [new file with mode: 0644]

index c472ca6..9bd6378 100644 (file)
@@ -60,6 +60,64 @@ class NsLcmOperationInput:
     nslcmop: dict
 
 
+@dataclass
+class NsInstantiateInput:
+    """
+    Input dataclass for workflow that instantiate NS.
+
+    Attributes:
+    -----------
+    ns_uuid : str
+        The UUID of the NS as stored in the OSM nsr
+        collection in Mongo
+
+    op_id: str
+        The operation (task) id for this workflow.  This is used
+        by the workflow at the end to update the status of the
+        operation in Mongo vim collection.
+    """
+
+    ns_uuid: str
+    op_id: str
+
+
+@dataclass
+class CharmInfo:
+    """
+    Input dataclass for
+
+    Attributes:
+    -----------
+    app_name : str
+
+    channel: str
+
+    entity_url: str
+    """
+
+    app_name: str
+    channel: str
+    entity_url: str
+
+
+@dataclass
+class VduInstantiateInput:
+    """
+    Input dataclass for workflow that instantiates a VDU.
+
+    vim_uuid: str
+
+    model_name: str
+
+    charm_info : CharmInfo
+
+    """
+
+    vim_uuid: str
+    model_name: str
+    charm_info: CharmInfo
+
+
 #######################################################################################
 # Activity Dataclasses
 
@@ -206,3 +264,69 @@ class DeleteVimInput:
     """
 
     vim_uuid: str
+
+
+@dataclass
+class DeployNsInput:
+    """
+    Input dataclass for
+
+    Attributes:
+    -----------
+    ns_uuid : str
+        The UUID of the NS as stored in the OSM nsr
+        collection in Mongo
+    """
+
+    ns_uuid: str
+
+
+class NsState(IntEnum):
+    PROCESSING = auto()
+    INSTANTIATED = auto()
+    ERROR = auto()
+
+
+@dataclass
+class UpdateNsStateInput:
+    """
+    Input dataclass for updating NS state in the DB
+
+    Attributes:
+    -----------
+    ns_uuid : str
+        The UUID of the NS as stored in the OSM ns
+        collection in Mongo
+
+    operational_state : NsState
+        A representation of the operational state (ENABLED or ERROR)
+        of the NS.
+
+    message : str
+        Human readable message providing additional details to the
+        operational state, such as the error message associated
+        with the ERROR operational_state.
+    """
+
+    ns_uuid: str
+    state: NsState
+    message: str
+
+
+@dataclass
+class CreateModelInput:
+    """
+    Input dataclass for creating a Juju Model.
+
+    Attributes:
+    -----------
+    vim_uuid : str
+        The UUID of the VIM as stored in the OSM vim_accounts
+        collection in Mongo.
+
+    model_name : str
+        Name of the model to create in Juju.
+    """
+
+    vim_uuid: str
+    model_name: str
index e9a0383..38a032f 100644 (file)
@@ -26,9 +26,18 @@ ACTIVITY_TEST_VIM_CONNECTIVITY = "test-vim-connectivity"
 ACTIVITY_UPDATE_VIM_OPERATION_STATE = "update-vim-operation-state"
 ACTIVITY_UPDATE_VIM_STATE = "update-vim-state"
 ACTIVITY_UPDATE_LCM_OPERATION_STATE = "update-lcm-operation-state"
+ACTIVITY_PREPARE_VNF_RECORDS = "prepare-vnf-records"
+ACTIVITY_DEPLOY_NS = "deploy-ns"
+ACTIVITY_UPDATE_NS_STATE = "update-ns-state"
+ACTIVITY_CHECK_NS_INSTANTIATION_FINISHED = "check-ns-instantiation-finish"
+ACTIVITY_CREATE_MODEL_IF_DOESNT_EXIST = "create-model-if-doesnt-exist"
+ACTIVITY_DEPLOY_CHARM = "deploy-charm"
+ACTIVITY_CHECK_CHARM_STATUS = "check-charm-status"
 
 # Workflows
 WORKFLOW_NSLCM_NO_OP = "nslcm-no-op"
 WORKFLOW_VIM_CREATE = "vim-create"
 WORKFLOW_VIM_UPDATE = "vim-update"
 WORKFLOW_VIM_DELETE = "vim-delete"
+WORKFLOW_NS_INSTANTIATE = "ns-instantiate"
+WORKFLOW_VDU_INSTANTIATE = "vdu-instantiate"
diff --git a/releasenotes/notes/dummy-releasenote-e933e2f5490198f1.yaml b/releasenotes/notes/dummy-releasenote-e933e2f5490198f1.yaml
new file mode 100644 (file)
index 0000000..db22e50
--- /dev/null
@@ -0,0 +1,17 @@
+#######################################################################################
+# Copyright ETSI Contributors and Others.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#######################################################################################
+---