diff options
-rw-r--r-- | lcm/ns/biz/ns_get.py | 3 | ||||
-rw-r--r-- | lcm/ns/biz/ns_heal.py | 2 | ||||
-rw-r--r-- | lcm/ns/biz/ns_manual_scale.py | 2 | ||||
-rw-r--r-- | lcm/ns/biz/ns_terminate.py | 2 | ||||
-rw-r--r-- | lcm/ns/biz/ns_update.py | 2 | ||||
-rw-r--r-- | lcm/ns/const.py | 157 | ||||
-rw-r--r-- | lcm/ns/tests/test_ns_heal.py | 2 | ||||
-rw-r--r-- | lcm/ns/tests/test_ns_manual_scale.py | 2 | ||||
-rw-r--r-- | lcm/ns_vls/biz/create_vls.py | 2 | ||||
-rw-r--r-- | lcm/ns_vnfs/biz/create_vnfs.py | 2 |
10 files changed, 10 insertions, 166 deletions
diff --git a/lcm/ns/biz/ns_get.py b/lcm/ns/biz/ns_get.py index 0804b490..1839bf0e 100644 --- a/lcm/ns/biz/ns_get.py +++ b/lcm/ns/biz/ns_get.py @@ -15,7 +15,8 @@ import json import logging -from lcm.ns.const import OWNER_TYPE, NS_INSTANCE_BASE_URI +from lcm.ns.const import NS_INSTANCE_BASE_URI +from lcm.ns.enum import OWNER_TYPE from lcm.pub.utils import restcall from lcm.pub.database.models import NSInstModel, NfInstModel, VLInstModel, CPInstModel, VNFFGInstModel diff --git a/lcm/ns/biz/ns_heal.py b/lcm/ns/biz/ns_heal.py index 91e455fd..a1cdce70 100644 --- a/lcm/ns/biz/ns_heal.py +++ b/lcm/ns/biz/ns_heal.py @@ -18,7 +18,7 @@ import threading import time import traceback -from lcm.ns.const import NS_INST_STATUS +from lcm.ns.enum import NS_INST_STATUS from lcm.pub.database.models import JobModel, NSInstModel, NfInstModel, VNFCInstModel, VmInstModel from lcm.pub.exceptions import NSLCMException from lcm.pub.utils.jobutil import JobUtil, JOB_MODEL_STATUS diff --git a/lcm/ns/biz/ns_manual_scale.py b/lcm/ns/biz/ns_manual_scale.py index 668ad486..9c3286ed 100644 --- a/lcm/ns/biz/ns_manual_scale.py +++ b/lcm/ns/biz/ns_manual_scale.py @@ -18,7 +18,7 @@ import time import traceback from lcm.ns.biz.scaleaspect import get_scale_vnf_data_info_list -from lcm.ns.const import NS_INST_STATUS +from lcm.ns.enum import NS_INST_STATUS from lcm.pub.database.models import JobModel, NSInstModel from lcm.pub.exceptions import NSLCMException from lcm.pub.utils.jobutil import JobUtil, JOB_MODEL_STATUS diff --git a/lcm/ns/biz/ns_terminate.py b/lcm/ns/biz/ns_terminate.py index 701e65c6..832603fa 100644 --- a/lcm/ns/biz/ns_terminate.py +++ b/lcm/ns/biz/ns_terminate.py @@ -23,7 +23,7 @@ from lcm.pub.msapi.nslcm import call_from_ns_cancel_resource from lcm.pub.utils.jobutil import JobUtil from lcm.pub.utils.values import ignore_case_get from lcm.pub.utils import restcall -from lcm.ns.const import OWNER_TYPE +from lcm.ns.enum import OWNER_TYPE from lcm.pub.database.models import PNFInstModel from lcm.ns.biz.ns_lcm_op_occ import NsLcmOpOcc diff --git a/lcm/ns/biz/ns_update.py b/lcm/ns/biz/ns_update.py index 110bf14b..e27d41c4 100644 --- a/lcm/ns/biz/ns_update.py +++ b/lcm/ns/biz/ns_update.py @@ -17,7 +17,7 @@ import traceback import datetime import time -from lcm.ns.const import NS_INST_STATUS +from lcm.ns.enum import NS_INST_STATUS from lcm.pub.database.models import JobModel, NSInstModel from lcm.ns_vnfs.biz.update_vnfs import NFOperateService from lcm.pub.exceptions import NSLCMException diff --git a/lcm/ns/const.py b/lcm/ns/const.py index 4eaf8109..2cfd46f8 100644 --- a/lcm/ns/const.py +++ b/lcm/ns/const.py @@ -11,171 +11,14 @@ # 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. -from lcm.pub.utils.enumutil import enum from lcm.pub.config.config import MSB_BASE_URL -OWNER_TYPE = enum(VNF=0, VNFM=1, NS=2) - -NS_INST_STATUS = enum(EMPTY='empty', INSTANTIATING='instantiating', TERMINATING='terminating', - ACTIVE='active', FAILED='failed', INACTIVE='inactive', UPDATING='updating', SCALING='scaling', - HEALING='healing') SERVICE_TYPE = 'NetworkService' SERVICE_ROLE = 'NetworkService' - -HEAL_ACTION_TYPE = enum(START="vmCreate", RESTART="vmReset") -ACTION_TYPE = enum(START=1, STOP=2, REBOOT=3) -GRANT_TYPE = enum(INSTANTIATE="INSTANTIATE", TERMINATE="TERMINATE", HEAL_CREATE="Heal Create", HEAL_RESTART="Heal Restart", OPERATE="OPERATE") -VNF_STATUS = enum(NULL='null', INSTANTIATING="instantiating", INACTIVE='inactive', ACTIVE="active", - FAILED="failed", TERMINATING="terminating", SCALING="scaling", OPERATING="operating", - UPDATING="updating", HEALING="healing") - -OPERATION_TYPE = enum( - INSTANTIATE="INSTANTIATE", - SCALE="SCALE", - TERMINATE="TERMINATE", - UPDATE="UPDATE", - HEAL="HEAL", -) - - -LCM_NOTIFICATION_STATUS = enum(START="START", RESULT="RESULT") - -OPERATION_STATE_TYPE = enum( - STARTING="STARTING", - PROCESSING="PROCESSING", - COMPLETED="COMPLETED", - FAILED_TEMP="FAILED_TEMP", - FAILED="FAILED", - ROLLING_BACK="ROLLING_BACK", - ROLLED_BACK="ROLLED_BACK" -) - -COMPOMENT_TYPE = enum( - VNF="VNF", - PNF="PNF", - NS="NS", -) - -OPName_For_Change_Notification_Type = enum( - VNF_INSTANTIATE="VNF_INSTANTIATE", VNF_SCALE="VNF_SCALE", VNF_SCALE_TO_LEVEL="VNF_SCALE_TO_LEVEL", - VNF_CHANGE_FLAVOUR="VNF_CHANGE_FLAVOUR", VNF_TERMINATE="VNF_TERMINATE", VNF_HEAL="VNF_HEAL", - VNF_OPERATE="VNF_OPERATE", VNF_CHANGE_EXT_CONN="VNF_CHANGE_EXT_CONN", VNF_MODIFY_INFO="VNF_MODIFY_INFO", - NS_INSTANTIATE="NS_INSTANTIATE", NS_SCALE="NS_SCALE", NS_UPDATE="NS_UPDATE", NS_TERMINATE="NS_TERMINATE", - NS_HEAL="NS_HEAL", -) - -OpOcc_Status_For_ChangeNotification_Type = enum( - START="START", COMPLETED="COMPLETED ", PARTIALLY_COMPLETED="PARTIALLY_COMPLETED", FAILED="FAILED", - ROLLED_BACK="ROLLED_BACK", -) - -AUTH_TYPES = ["BASIC", "OAUTH2_CLIENT_CREDENTIALS", "TLS_CERT"] - BASIC = "BASIC" - OAUTH2_CLIENT_CREDENTIALS = "OAUTH2_CLIENT_CREDENTIALS" - -CHANGE_TYPES = enum( - ADD='ADD', - DELETE='DELETE', - REMOVE='REMOVE', - INSTANTIATE='INSTANTIATE', - TERMINATE='TERMINATE', - SCALE='SCALE', - UPDATE='UPDATE', - CHANGE_FLAVOUR='CHANGE_FLAVOUR', - HEAL='HEAL', - OPERATE='OPERATE', - MODIFY='MODIFY', - MODIFY_INFORMATION='MODIFY_INFORMATION', - CHANGE_EXTERNAL_VNF_CONNECTIVITY='CHANGE_EXTERNAL_VNF_CONNECTIVITY', - ADD_LINK_PORT='ADD_LINK_PORT', - REMOVE_LINK_PORT='REMOVE_LINK_PORT' -) - -CHANGE_RESULTS = enum( - COMPLETED='COMPLETED', - ROLLED_BACK='ROLLED_BACK', - FAILED='FAILED', - PARTIALLY_COMPLETED='PARTIALLY_COMPLETED' -) - -IPADDRESSES_TYPE_ENUM = enum( - IPV4='IPV4', - IPV6='IPV6' -) - -IPADDRESSES_TYPE_LIST = [ - IPADDRESSES_TYPE_ENUM.IPV4, - IPADDRESSES_TYPE_ENUM.IPV6 -] - LCCNNOTIFICATION = "NsLcmOperationOccurrenceNotification" - -NOTIFICATION_TYPES = [ - "NsLcmOperationOccurrenceNotification", "NsIdentifierCreationNotification", "NsIdentifierDeletionNotification", - "NsChangeNotification", -] - -NS_LCM_OP_TYPES = [ - OPERATION_TYPE.INSTANTIATE, - OPERATION_TYPE.SCALE, - OPERATION_TYPE.TERMINATE, - OPERATION_TYPE.HEAL, - OPERATION_TYPE.UPDATE, -] - -LCM_OPERATION_STATE_TYPES = [ - OPERATION_STATE_TYPE.STARTING, - OPERATION_STATE_TYPE.PROCESSING, - OPERATION_STATE_TYPE.COMPLETED, - OPERATION_STATE_TYPE.FAILED_TEMP, - OPERATION_STATE_TYPE.FAILED, - OPERATION_STATE_TYPE.ROLLING_BACK, - OPERATION_STATE_TYPE.ROLLED_BACK -] - -NS_COMPOMENT_TYPE = [ - COMPOMENT_TYPE.VNF, - COMPOMENT_TYPE.PNF, - COMPOMENT_TYPE.NS, -] - - -LCM_OPName_For_Change_Notification_Type = [ - OPName_For_Change_Notification_Type.VNF_INSTANTIATE, - OPName_For_Change_Notification_Type.VNF_SCALE, - OPName_For_Change_Notification_Type.VNF_SCALE_TO_LEVEL, - OPName_For_Change_Notification_Type.VNF_CHANGE_FLAVOUR, - OPName_For_Change_Notification_Type.VNF_TERMINATE, - OPName_For_Change_Notification_Type.VNF_HEAL, - OPName_For_Change_Notification_Type.VNF_OPERATE, - OPName_For_Change_Notification_Type.VNF_CHANGE_EXT_CONN, - OPName_For_Change_Notification_Type.VNF_MODIFY_INFO, - OPName_For_Change_Notification_Type.NS_INSTANTIATE, - OPName_For_Change_Notification_Type.NS_SCALE, - OPName_For_Change_Notification_Type.NS_UPDATE, - OPName_For_Change_Notification_Type.NS_TERMINATE, - OPName_For_Change_Notification_Type.NS_HEAL, -] - -LCM_OpOcc_Status_For_ChangeNotification_Type = [ - OpOcc_Status_For_ChangeNotification_Type.START, - OpOcc_Status_For_ChangeNotification_Type.COMPLETED, - OpOcc_Status_For_ChangeNotification_Type.PARTIALLY_COMPLETED, - OpOcc_Status_For_ChangeNotification_Type.FAILED, - OpOcc_Status_For_ChangeNotification_Type.ROLLED_BACK, -] - - -CHANGE_RESULT = [ - CHANGE_RESULTS.COMPLETED, - CHANGE_RESULTS.ROLLED_BACK, - CHANGE_RESULTS.FAILED -] - - NS_INSTANCE_BASE_URI = MSB_BASE_URL + '/api/nslcm/v1/ns_instances/%s' NS_OCC_BASE_URI = MSB_BASE_URL + '/api/nslcm/v1/ns_lcm_op_occs/%s' SUBSCRIPTION_ROOT_URI = MSB_BASE_URL + "/api/nslcm/v1/subscriptions/%s" diff --git a/lcm/ns/tests/test_ns_heal.py b/lcm/ns/tests/test_ns_heal.py index 2ebcceab..88b5f3f3 100644 --- a/lcm/ns/tests/test_ns_heal.py +++ b/lcm/ns/tests/test_ns_heal.py @@ -20,7 +20,7 @@ from django.test import TestCase from rest_framework import status from lcm.ns.biz.ns_heal import NSHealService -from lcm.ns.const import NS_INST_STATUS +from lcm.ns.enum import NS_INST_STATUS from lcm.pub.database.models import NSInstModel, NfInstModel from lcm.pub.exceptions import NSLCMException from lcm.pub.utils.jobutil import JobUtil, JOB_TYPE diff --git a/lcm/ns/tests/test_ns_manual_scale.py b/lcm/ns/tests/test_ns_manual_scale.py index 6ebd5bb0..e82b54e2 100644 --- a/lcm/ns/tests/test_ns_manual_scale.py +++ b/lcm/ns/tests/test_ns_manual_scale.py @@ -23,7 +23,7 @@ from lcm.ns.biz.scaleaspect import get_json_data from rest_framework import status from lcm.ns.biz.ns_manual_scale import NSManualScaleService -from lcm.ns.const import NS_INST_STATUS +from lcm.ns.enum import NS_INST_STATUS from lcm.pub.database.models import NSInstModel, JobModel, NfInstModel from lcm.pub.exceptions import NSLCMException from lcm.pub.msapi import catalog diff --git a/lcm/ns_vls/biz/create_vls.py b/lcm/ns_vls/biz/create_vls.py index 7678a787..596c278f 100644 --- a/lcm/ns_vls/biz/create_vls.py +++ b/lcm/ns_vls/biz/create_vls.py @@ -17,7 +17,7 @@ import logging import traceback import uuid -from lcm.ns.const import OWNER_TYPE +from lcm.ns.enum import OWNER_TYPE from lcm.pub.config.config import REPORT_TO_AAI from lcm.pub.database.models import VLInstModel, NSInstModel, VNFFGInstModel from lcm.pub.exceptions import NSLCMException diff --git a/lcm/ns_vnfs/biz/create_vnfs.py b/lcm/ns_vnfs/biz/create_vnfs.py index 42bacbd5..a8ebf6d7 100644 --- a/lcm/ns_vnfs/biz/create_vnfs.py +++ b/lcm/ns_vnfs/biz/create_vnfs.py @@ -18,7 +18,7 @@ import traceback import uuid from threading import Thread -from lcm.ns.const import OWNER_TYPE +from lcm.ns.enum import OWNER_TYPE from lcm.pub.config.config import REPORT_TO_AAI from lcm.pub.database.models import NfInstModel, NSInstModel, VmInstModel, VNFFGInstModel, VLInstModel, OOFDataModel from lcm.pub.exceptions import NSLCMException |