1 # -------------------------------------------------------------------------
2 # Copyright (C) 2020 Wipro Limited.
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
16 # -------------------------------------------------------------------------
19 from osdf.models.api.common import OSDFModel
20 from schematics.types import BaseType, StringType, URLType, IntType, BooleanType
21 from schematics.types.compound import ModelType, ListType, DictType
24 class RequestInfo(OSDFModel):
25 """Info for northbound request from client such as SO"""
26 transactionId = StringType(required=True)
27 requestId = StringType(required=True)
28 callbackUrl = URLType(required=True)
29 sourceId = StringType(required=True)
30 callbackHeader = DictType(BaseType)
32 numSolutions = IntType()
33 addtnlArgs = DictType(BaseType)
36 class NxTInfo(OSDFModel):
37 """Information about NST/NSST model"""
38 invariantUUID = StringType(required=True)
39 UUID = StringType(required=True)
40 name = StringType(required=True)
43 class SubnetCapability(OSDFModel):
44 """Subnet capability of every subnet"""
45 domainType = StringType(required=True)
46 capabilityDetails = DictType(BaseType, required=True)
49 class NSISelectionAPI(OSDFModel):
50 """Request for nsi selection (specific to optimization and additional metadata"""
51 requestInfo = ModelType(RequestInfo, required=True)
52 NSTInfo = ModelType(NxTInfo, required=True)
53 NSSTInfo = ListType(ModelType(NxTInfo), required=True)
54 serviceProfile = DictType(BaseType, required=True)
55 subnetCapabilities = ListType(ModelType(SubnetCapability), required=True)
56 preferReuse = BooleanType()