diff options
author | krishna moorthy <krishna.moorthy6@wipro.com> | 2020-08-27 04:58:10 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-08-27 04:58:10 +0000 |
commit | 8d566ba1186b78b4ba134a9b5b8cdc106c2a06ee (patch) | |
tree | b1307edfbd43a8abb1759de12492d2ab2bdf8c92 /apps/slice_selection/models | |
parent | 2d770e68218a19ec3b0da34d3242355dd69e1a70 (diff) | |
parent | 01cd5da39097c948e4fba94eb785b60452c70af3 (diff) |
Merge "Change API layer for NSI selection"
Diffstat (limited to 'apps/slice_selection/models')
-rw-r--r-- | apps/slice_selection/models/api/nsi_selection_request.py | 30 | ||||
-rw-r--r-- | apps/slice_selection/models/api/nsi_selection_response.py | 52 |
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) |