summaryrefslogtreecommitdiffstats
path: root/apps/slice_selection/models/api
diff options
context:
space:
mode:
authordhebeha <dhebeha.mj71@wipro.com>2020-08-14 11:45:20 +0530
committerdhebeha <dhebeha.mj71@wipro.com>2020-08-14 11:46:13 +0530
commit01cd5da39097c948e4fba94eb785b60452c70af3 (patch)
tree029002a3ca33da6429fb3c94be9cc8c3111c1226 /apps/slice_selection/models/api
parentf16a36e97aae114d9168eff7a4d273891e00d387 (diff)
Change API layer for NSI selection
Issue-ID: OPTFRA-802 Signed-off-by: dhebeha <dhebeha.mj71@wipro.com> Change-Id: Ia7e36da8d9a4d1f3f8e8eb00a61e6b0b29fbbbf6
Diffstat (limited to 'apps/slice_selection/models/api')
-rw-r--r--apps/slice_selection/models/api/nsi_selection_request.py30
-rw-r--r--apps/slice_selection/models/api/nsi_selection_response.py52
2 files changed, 28 insertions, 54 deletions
diff --git a/apps/slice_selection/models/api/nsi_selection_request.py b/apps/slice_selection/models/api/nsi_selection_request.py
index b7f3fbd..943fa56 100644
--- a/apps/slice_selection/models/api/nsi_selection_request.py
+++ b/apps/slice_selection/models/api/nsi_selection_request.py
@@ -26,29 +26,31 @@ class RequestInfo(OSDFModel):
transactionId = StringType(required=True)
requestId = StringType(required=True)
callbackUrl = URLType(required=True)
- callbackHeader = DictType(BaseType)
sourceId = StringType(required=True)
+ callbackHeader = DictType(BaseType)
timeout = IntType()
+ numSolutions = IntType()
+ addtnlArgs = DictType(BaseType)
-class NSTInfo(OSDFModel):
- """Preferred candidate for a resource (sent as part of a request from client)"""
- modelInvariantId = StringType(required=True)
- modelVersionId = StringType(required=True)
- modelName = StringType()
- modelType = StringType()
- modelVersion = StringType()
- modelCustomizationName = StringType()
+class NxTInfo(OSDFModel):
+ """Information about NST/NSST model"""
+ invariantUUID = StringType(required=True)
+ UUID = StringType(required=True)
+ name = StringType(required=True)
-class ServiceInfo(OSDFModel):
- serviceInstanceId = StringType(required=True)
- serviceName = StringType(required=True)
+class SubnetCapability(OSDFModel):
+ """Subnet capability of every subnet"""
+ domainType = StringType(required=True)
+ capabilityDetails = DictType(BaseType, required=True)
class NSISelectionAPI(OSDFModel):
"""Request for nsi selection (specific to optimization and additional metadata"""
requestInfo = ModelType(RequestInfo, required=True)
- NSTInfoList = ListType(ModelType(NSTInfo), required=True)
- serviceInfo = ModelType(ServiceInfo, required=True)
+ NSTInfo = ModelType(NxTInfo, required=True)
+ NSSTInfo = ListType(ModelType(NxTInfo), required=True)
serviceProfile = DictType(BaseType, required=True)
+ subnetCapabilities = ListType(ModelType(SubnetCapability), required=True)
+ preferReuse = BooleanType()
diff --git a/apps/slice_selection/models/api/nsi_selection_response.py b/apps/slice_selection/models/api/nsi_selection_response.py
index a927efa..3c6d35b 100644
--- a/apps/slice_selection/models/api/nsi_selection_response.py
+++ b/apps/slice_selection/models/api/nsi_selection_response.py
@@ -17,66 +17,38 @@
#
from osdf.models.api.common import OSDFModel
-from schematics.types import BaseType, StringType
+from schematics.types import BaseType, StringType, BooleanType
from schematics.types.compound import ModelType, ListType, DictType
# TODO: update osdf.models
-class NSSI(OSDFModel):
- NSSIId = StringType(required=True)
- NSSIName = StringType(required=True)
- UUID = StringType(required=True)
- invariantUUID = StringType(required=True)
- sliceProfile = ListType(DictType(BaseType))
-
-
class SharedNSISolution(OSDFModel):
+ """Represents the shared NSI Solution object"""
invariantUUID = StringType(required=True)
UUID = StringType(required=True)
NSIName = StringType(required=True)
NSIId = StringType(required=True)
matchLevel = StringType(required=True)
- NSSIs = ListType(ModelType(NSSI))
-
-
-class NSSTInfo(OSDFModel):
- invariantUUID = StringType(required=True)
- UUID = StringType(required=True)
- NSSTName = StringType(required=True)
-
-
-class NSSIInfo(OSDFModel):
- NSSIName = StringType(required=True)
- NSSIId = StringType(required=True)
- matchLevel = StringType(required=True)
-
-
-class NSSISolution(OSDFModel):
- sliceProfile = DictType(BaseType)
- NSSTInfo = ModelType(NSSTInfo, required=True)
- NSSISolution = ModelType(NSSIInfo, required=True)
-
-
-class NSTInfo(OSDFModel):
- invariantUUID = StringType(required=True)
- UUID = StringType(required=True)
- NSTName = StringType(required=True)
class NewNSISolution(OSDFModel):
+ """Represents the New NSI Solution object containing tuple of slice profiles"""
+ sliceProfiles = ListType(DictType(BaseType), required=True)
matchLevel = StringType(required=True)
- NSTInfo = ModelType(NSTInfo, required=True)
- NSSISolutions = ListType(ModelType(NSSISolution))
-class Solution(OSDFModel):
- sharedNSISolutions = ListType(ModelType(SharedNSISolution))
- newNSISolutions = ListType(ModelType(NewNSISolution))
+class NSISolution(OSDFModel):
+ """Represents the NSI Solution object"""
+ """This solution object contains either sharedNSISolution or newNSISolution"""
+ existingNSI = BooleanType(required=True)
+ sharedNSISolution = ModelType(SharedNSISolution)
+ newNSISolution = ModelType(NewNSISolution)
class NSISelectionResponse(OSDFModel):
+ """Response sent to NSMF(SO)"""
transactionId = StringType(required=True)
requestId = StringType(required=True)
requestStatus = StringType(required=True)
+ solutions = ListType(ModelType(NSISolution), required=True)
statusMessage = StringType()
- solutions = ModelType(Solution, required=True)