1 # Copyright (C) 2021 Wind River Systems, Inc.
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
15 from flask_restx import fields
17 from o2ims.views import api
25 'oCloudId': fields.String(required=True),
26 'globalCloudId': fields.String,
27 'name': fields.String,
28 'description': fields.String,
29 'infrastructureManagementServiceEndpoint': fields.String,
34 class ResourceTypeDTO:
36 resource_type_get = api.model(
39 'resourceTypeId': fields.String(required=True,
40 description='Resource type ID'),
41 'name': fields.String,
42 'vendor': fields.String,
43 'version': fields.String,
44 'description': fields.String,
49 class ResourcePoolDTO:
51 resource_pool_get = api.model(
54 'resourcePoolId': fields.String(required=True,
55 description='Resource pool ID'),
56 'name': fields.String,
57 'globalLocationId': fields.String,
58 'location': fields.String,
59 'description': fields.String,
66 resource_list = api.model(
69 'resourceId': fields.String(required=True,
70 description='Resource ID'),
71 'resourceTypeId': fields.String,
72 'resourcePoolId': fields.String,
73 'parentId': fields.String,
74 'description': fields.String,
78 resource_get = api.model(
81 'resourceId': fields.String(required=True,
82 description='Resource ID'),
83 'resourceTypeId': fields.String,
84 'resourcePoolId': fields.String,
85 'parentId': fields.String,
86 'description': fields.String,
91 class DeploymentManagerDTO:
93 deployment_manager_get = api.model(
94 "DeploymentManagerGet",
96 'deploymentManagerId': fields.String(
98 description='Deployment manager ID'),
99 'name': fields.String,
100 'description': fields.String,
101 'deploymentManagementServiceEndpoint': fields.String,
102 'supportedLocations': fields.String,
103 'capabilities': fields.String,
104 'capacity': fields.String,
109 class SubscriptionDTO:
111 subscription_get = api.model(
114 'subscriptionId': fields.String(required=True,
115 description='Subscription ID'),
116 'callback': fields.String,
117 'consumerSubscriptionId': fields.String,
118 'filter': fields.String,
122 subscription = api.model(
123 "SubscriptionCreate",
125 'callback': fields.String(
126 required=True, description='Subscription callback address'),
127 'consumerSubscriptionId': fields.String,
128 'filter': fields.String,
132 subscription_post_resp = api.model(
133 "SubscriptionCreatedResp",
135 'subscriptionId': fields.String(required=True,
136 description='Subscription ID'),