Merge "Push policy adapter code (adapted from ECOMP)"
[optf/osdf.git] / models / api / placementResponse.py
1 # -------------------------------------------------------------------------
2 #   Copyright (c) 2015-2017 AT&T Intellectual Property
3 #
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
7 #
8 #       http://www.apache.org/licenses/LICENSE-2.0
9 #
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.
15 #
16 # -------------------------------------------------------------------------
17 #
18
19 from .common import OSDFModel
20 from schematics.types import StringType
21 from schematics.types.compound import ModelType, ListType
22
23
24 # TODO: update osdf.models
25
26 class LicenseSolution(OSDFModel):
27     serviceResourceId = StringType(required=True)
28     resourceModuleName = StringType(required=True)
29     entitlementPoolList = ListType(StringType(required=True))
30     licenseKeyGroupList = ListType(StringType(required=True))
31
32
33 class AssignmentInfo(OSDFModel):
34     variableName = StringType(required=True)
35     variableValue = StringType(required=True)
36
37
38 class PlacementSolution(OSDFModel):
39     serviceResourceId = StringType(required=True)
40     resourceModuleName = StringType(required=True)
41     inventoryType = StringType(required=True)
42     serviceInstanceId = StringType()
43     cloudRegionId = StringType()
44     assignmentInfo = ListType(ModelType(AssignmentInfo))
45
46
47 class SolutionInfo(OSDFModel):
48     placement = ListType(ModelType(PlacementSolution), min_size=1)
49     license = ListType(ModelType(LicenseSolution), min_size=1)
50
51
52 class PlacementResponse(OSDFModel):
53     transactionId = StringType(required=True)
54     requestId = StringType(required=True)
55     requestState = StringType(required=True)
56     statusMessage = StringType(required=True)
57     solutionInfo = ModelType(SolutionInfo)