diff options
author | 2020-08-27 04:58:10 +0000 | |
---|---|---|
committer | 2020-08-27 04:58:10 +0000 | |
commit | 8d566ba1186b78b4ba134a9b5b8cdc106c2a06ee (patch) | |
tree | b1307edfbd43a8abb1759de12492d2ab2bdf8c92 /apps/slice_selection/models/api/nsi_selection_response.py | |
parent | 2d770e68218a19ec3b0da34d3242355dd69e1a70 (diff) | |
parent | 01cd5da39097c948e4fba94eb785b60452c70af3 (diff) |
Merge "Change API layer for NSI selection"
Diffstat (limited to 'apps/slice_selection/models/api/nsi_selection_response.py')
-rw-r--r-- | apps/slice_selection/models/api/nsi_selection_response.py | 52 |
1 files changed, 12 insertions, 40 deletions
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) |