blob: 50ad6a694f0a12289f1b03fe4efc59bb68d750c1 [file] [log] [blame]
Sapan Bhatiacb35e7f2017-05-24 12:17:28 +02001option app_label = "core";
Sapan Bhatiad022aeb2017-06-07 15:49:55 +02002
Matteo Scandoloee367fd2017-11-22 14:55:09 -08003// use thi policy to allow access to admins only
4policy admin_policy < ctx.user.is_admin >
5
Sapan Bhatia170ae272017-05-30 19:01:09 +02006message XOSBase {
Sapan Bhatiad022aeb2017-06-07 15:49:55 +02007 option skip_init = True;
Scott Bakera33ccb02018-01-26 13:03:28 -08008 option custom_header = "xosbase_header";
9 option abstract = True;
Scott Bakerbe2a5172019-04-10 18:02:50 -070010 option custom_python=True;
Sapan Bhatiacb35e7f2017-05-24 12:17:28 +020011
Scott Bakerc237f882018-09-28 14:12:47 -070012 // field 1 is reserved for "id"
Scott Baker44476852019-05-02 11:44:26 -070013 required string created = 2 [content_type = "date", auto_now_add = True, bookkeeping_state = True, help_text = "Time this model was created"];
14 required string updated = 3 [default = "now()", content_type = "date", bookkeeping_state = True, help_text = "Time this model was changed by a non-synchronizer"];
15 optional string enacted = 4 [content_type = "date", blank = True, default = None, bookkeeping_state = True, help_text = "When synced, set to the timestamp of the data that was synced"];
16 optional string policed = 5 [content_type = "date", blank = True, default = None, bookkeeping_state = True, help_text = "When policed, set to the timestamp of the data that was policed"];
Scott Bakerc237f882018-09-28 14:12:47 -070017 optional string backend_register = 6 [default = "{}", max_length = 1024, feedback_state = True];
Scott Baker44476852019-05-02 11:44:26 -070018 required bool backend_need_delete = 7 [default = False, bookkeeping_state = True];
19 required bool backend_need_reap = 8 [default = False, bookkeeping_state = True];
Zack Williams00e22d62019-03-01 22:32:13 -070020 required string backend_status = 9 [default = "Provisioning in progress", max_length = 1024, feedback_state = True];
Scott Bakerc237f882018-09-28 14:12:47 -070021 required int32 backend_code = 10 [default = 0, feedback_state = True];
Scott Baker44476852019-05-02 11:44:26 -070022 required bool deleted = 11 [default = False, bookkeeping_state = True];
23 required bool write_protect = 12 [default = False, bookkeeping_state = True];
24 required bool lazy_blocked = 13 [default = False, bookkeeping_state = True];
25 required bool no_sync = 14 [default = False, bookkeeping_state = True];
26 required bool no_policy = 15 [default = False, bookkeeping_state = True];
Matteo Scandolo23cf15f2018-03-06 18:12:36 -080027 optional string policy_status = 16 [default = "Policy in process", max_length = 1024, feedback_state = True];
Scott Bakerc237f882018-09-28 14:12:47 -070028 optional int32 policy_code = 17 [default = 0, feedback_state = True];
Scott Baker44476852019-05-02 11:44:26 -070029 required string leaf_model_name = 18 [max_length = 1024, bookkeeping_state = True, help_text = "The most specialized model in this chain of inheritance, often defined by a service developer"];
30 required bool backend_need_delete_policy = 19 [default = False, bookkeeping_state = True, help_text = "True if delete model_policy must be run before object can be reaped"];
Scott Bakerc80304a2019-03-07 11:07:29 -080031 required bool xos_managed = 20 [default = True, help_text = "True if xos is responsible for creating/deleting this object", gui_hidden = True];
Scott Baker83cc6f52019-03-11 11:10:24 -070032 optional string backend_handle = 21 [max_length = 1024, feedback_state = True, blank=True, help_text = "Handle used by the backend to track this object", gui_hidden = True];
Scott Baker44476852019-05-02 11:44:26 -070033 optional string changed_by_step = 22 [content_type = "date", blank = True, default = None, bookkeeping_state = True, gui_hidden = True, help_text = "Time this model was changed by a sync step"];
34 optional string changed_by_policy = 23 [content_type = "date", blank = True, default = None, bookkeeping_state = True, gui_hidden = True, help_text = "Time this model was changed by a model policy"];
Sapan Bhatia170ae272017-05-30 19:01:09 +020035}
36
Sapan Bhatiab5ce1862017-07-31 15:48:19 -040037// The calling user represents the user being accessed, or is a site admin.
38policy user_policy <
39 ctx.user.is_admin
40 | ctx.user.id = obj.id
41 | (exists Privilege:
42 Privilege.accessor_id = ctx.user.id
43 & Privilege.accessor_type = "User"
44 & Privilege.permission = "role:admin"
45 & Privilege.object_type = "Site"
46 & Privilege.object_id = ctx.user.site.id) >
47
48message User::user_policy (AbstractBaseUser,PlModelMixIn) {
Sapan Bhatiad022aeb2017-06-07 15:49:55 +020049 option skip_django = True;
Matteo Scandoloe425f9d2017-08-15 15:56:19 -070050 option description = "An XOS User";
Sapan Bhatiacb35e7f2017-05-24 12:17:28 +020051
Scott Bakerc237f882018-09-28 14:12:47 -070052 // field 1 is reserved for "id"
Scott Baker08d10402019-04-08 16:19:59 -070053 required string email = 2 [db_index = True, max_length = 256, blank = False, tosca_key=True];
54 required string username = 3 [default = "Something", max_length = 256, content_type = "stripped", blank = False, db_index = False];
55 required string password = 4 [default = "Something", max_length = 256, blank = False, db_index = False];
Scott Baker83cc6f52019-03-11 11:10:24 -070056 optional string last_login = 5 [db_index = False, content_type = "date", blank = True];
57 required string firstname = 6 [max_length = 200, content_type = "stripped", blank = False, help_text = "person's given name", db_index = False];
58 required string lastname = 7 [max_length = 200, content_type = "stripped", blank = False, help_text = "person's surname", db_index = False];
59 optional string phone = 8 [max_length = 100, content_type = "stripped", blank = True, help_text = "phone number contact", db_index = False];
60 optional string user_url = 9 [db_index = False, max_length = 200, content_type = "url", blank = True];
61 required manytoone site->Site:users = 10:1001 [help_text = "Site this user will be homed too", db_index = True, blank = False];
Scott Baker08d10402019-04-08 16:19:59 -070062 optional string public_key = 11 [help_text = "Public key string", db_index = False, blank = True, text = True];
Scott Baker83cc6f52019-03-11 11:10:24 -070063 required bool is_active = 12 [default = True, db_index = False];
64 required bool is_admin = 13 [default = False, db_index = False];
65 required bool is_staff = 14 [default = True, db_index = False];
66 required bool is_readonly = 15 [default = False, db_index = False];
67 required bool is_registering = 16 [default = False, db_index = False];
68 required bool is_appuser = 17 [default = False, db_index = False];
69 optional string login_page = 18 [max_length = 200, content_type = "stripped", blank = True, help_text = "send this user to a specific page on login", db_index = False];
Scott Bakerc80304a2019-03-07 11:07:29 -080070 required string created = 19 [content_type = "date", auto_now_add = True, help_text = "Time this model was created"];
71 required string updated = 20 [default = "now()", content_type = "date", help_text = "Time this model was changed by a non-synchronizer"];
Scott Baker83cc6f52019-03-11 11:10:24 -070072 optional string enacted = 21 [content_type = "date", blank = True, default = None, help_text = "When synced, set to the timestamp of the data that was synced"];
73 optional string policed = 22 [content_type = "date", blank = True, default = None, help_text = "When policed, set to the timestamp of the data that was policed"];
74 required string backend_status = 23 [default = "Provisioning in progress", max_length = 1024, content_type = "stripped", blank = False, db_index = False];
Scott Bakerc237f882018-09-28 14:12:47 -070075 required int32 backend_code = 24 [default = 0];
Scott Baker83cc6f52019-03-11 11:10:24 -070076 required bool backend_need_delete = 25 [default = False, db_index = False];
77 required bool backend_need_reap = 26 [default = False, db_index = False];
78 required bool deleted = 27 [default = False, db_index = False];
79 required bool write_protect = 28 [default = False, db_index = False];
80 required bool lazy_blocked = 29 [default = False, db_index = False];
81 required bool no_sync = 30 [default = False, db_index = False];
82 required bool no_policy = 31 [default = False, db_index = False];
83 required string timezone = 32 [default = "America/New_York", max_length = 100, blank = False, db_index = False];
Scott Bakerc237f882018-09-28 14:12:47 -070084 optional string policy_status = 33 [default = "0 - Policy in process", max_length = 1024];
85 optional int32 policy_code = 34 [default = 0];
Scott Baker83cc6f52019-03-11 11:10:24 -070086 required string leaf_model_name = 35 [max_length = 1024, help_text = "The most specialized model in this chain of inheritance, often defined by a service developer"];
Scott Bakerc80304a2019-03-07 11:07:29 -080087 required bool backend_need_delete_policy = 36 [default = False, help_text = "True if delete model_policy must be run before object can be reaped"];
88 required bool xos_managed = 37 [default = True, help_text = "True if xos is responsible for creating/deleting this object", gui_hidden = True];
Scott Baker83cc6f52019-03-11 11:10:24 -070089 optional string backend_handle = 38 [max_length = 1024, feedback_state = True, blank=True, help_text = "Handle used by the backend to track this object", gui_hidden = True];
90 optional string changed_by_step = 39 [content_type = "date", blank = True, default = None, gui_hidden = True, help_text = "Time this model was changed by a sync step"];
91 optional string changed_by_policy = 40 [content_type = "date", blank = True, default = None, gui_hidden = True, help_text = "Time this model was changed by a model policy"];
Scott Bakere08d0062017-07-11 12:04:26 -070092}
Sapan Bhatiad022aeb2017-06-07 15:49:55 +020093
Sapan Bhatiab5ce1862017-07-31 15:48:19 -040094// A user may give a permission that he has to another user
95policy grant_policy < ctx.user.is_admin
96 | exists Privilege:Privilege.object_type = obj.object_type
97 & Privilege.object_id = obj.object_id
98 & Privilege.accessor_type = "User"
Kailash Khalasiacab7e12017-12-14 11:27:26 -080099 & Privilege.accessor_id = ctx.user.id
Sapan Bhatiab5ce1862017-07-31 15:48:19 -0400100 & Privilege.permission = "role:admin" >
Kailash Khalasiacab7e12017-12-14 11:27:26 -0800101
Sapan Bhatiab5ce1862017-07-31 15:48:19 -0400102message Privilege::grant_policy (XOSBase) {
Scott Baker83cc6f52019-03-11 11:10:24 -0700103 required int32 accessor_id = 1 [blank=False];
104 required string accessor_type = 2 [max_length=1024, blank = False];
105 required int32 object_id = 4 [blank=False];
106 required string object_type = 5 [max_length=1024, blank = False];
107 required string permission = 6 [default = "all", max_length=1024, tosca_key=True];
Sapan Bhatiab5ce1862017-07-31 15:48:19 -0400108 required string granted = 7 [content_type = "date", auto_now_add = True, max_length=1024];
Zack Williams00e22d62019-03-01 22:32:13 -0700109 optional string expires = 8 [content_type = "date", max_length=1024];
Sapan Bhatia8918ac32017-07-09 00:43:27 -0400110}
111
Sapan Bhatia170ae272017-05-30 19:01:09 +0200112message AddressPool (XOSBase) {
Scott Bakerbe2a5172019-04-10 18:02:50 -0700113 option custom_python=True;
Scott Baker83cc6f52019-03-11 11:10:24 -0700114 required string name = 1 [db_index = False, max_length = 32, blank = False, unique = True, help_text="Name of this AddressPool"];
Scott Baker08d10402019-04-08 16:19:59 -0700115 optional string addresses = 2 [db_index = False, blank = True, text = True, help_text="Space-separated list of available addresses"];
Scott Baker83cc6f52019-03-11 11:10:24 -0700116 required string gateway_ip = 3 [max_length = 32, help_text="Gateway IP address for this AddressPool"];
117 required string gateway_mac = 4 [max_length = 32, help_text="Gateway MAC address for this AddressPool"];
118 required string cidr = 5 [max_length = 32, help_text="Subnet for this AddressPool"];
Scott Baker08d10402019-04-08 16:19:59 -0700119 optional string inuse = 6 [db_index = False, blank = True, text = True, help_text="Space-separated list of inuse addresses"];
Scott Baker83cc6f52019-03-11 11:10:24 -0700120 optional manytoone service->Service:addresspools = 7:1001 [db_index = True, blank = True, help_text="Service this AddressPool belongs to"];
Sapan Bhatia170ae272017-05-30 19:01:09 +0200121}
122
Scott Baker6bd238f2019-04-16 16:28:52 -0700123message BackupFile (XOSBase) {
124 required string name = 1 [
125 help_text = "human-readable name of this backup file",
126 max_length = 256];
127 required string uri = 2 [
128 help_text = "location of the backup file",
129 max_length = 1024];
130 optional string checksum = 3 [
131 help_text = "checksum of backup file, formatted as algorithm:hash",
132 max_length = 1024];
133 // status:
134 // retrieved - file has been retrieved from URI
135 // sent - file has been sent to URI
136 // inprogress - file transfer is in progress
137 optional string status = 4 [
138 help_text = "status of file transfer",
139 choices = "(('retrieved', 'retrieved'), ('sent', 'sent'), ('inprogress', 'inprogress'))",
140 feedback_state = True,
141 max_length = 32];
142 optional string backend_filename = 5 [
143 help_text = "for internal use, local filename",
144 feedback_state = True,
145 max_length = 1024];
146}
147
148message BackupOperation (XOSBase) {
Scott Baker89704b12019-05-07 16:42:11 -0700149 option custom_python=True;
150
Scott Baker6bd238f2019-04-16 16:28:52 -0700151 // `file` is required for restores.
152 // `file` is optional for backups. If file is unspecified then XOS will create a backup file using
153 // a default mechanism.
154 optional manytoone file->BackupFile:operations = 1:1001 [
155 help_text = "File to backup to or restore from"];
156 required string component = 2 [
157 help_text = "component that this operation applies to",
158 // XOS is currently the only allowed component
159 choices = "(('xos', 'XOS'), )",
160 default = "xos",
161 max_length = 32];
162 required string operation = 3 [
163 help_text = "operation to perform",
164 choices = "(('create', 'create'), ('restore', 'restore'), ('verify', 'verify'))",
165 max_length = 32];
166 optional string status = 4 [
167 help_text = "status of operation",
168 choices = "(('created', 'created'), ('restored', 'restored'), ('failed', 'failed'), ('inprogress', 'in progress'), ('orphaned', 'orphaned'))",
169 feedback_state = True,
170 max_length = 32];
171 optional string error_msg = 5 [
172 help_text = "error message from backup processor, if status is failure",
173 feedback_state = True,
174 max_length = 4096];
175 // `effective_date` may be different from `XOSBase.enacted` if a synchronizer is performing
176 // an operation on an external component. `XOSBase.enacted` is always set to the time the
177 // model is saved, which could differ from the time the backup or restore completed by
178 // a short time.
179 optional string effective_date = 6 [
180 help_text = "the time and date the operation was completed",
181 content_type = "date",
182 feedback_state = True];
Scott Baker89704b12019-05-07 16:42:11 -0700183 optional string uuid = 7 [
184 help_text = "unique identifer of this request",
185 bookkeeping_state = True,
186 max_length = 80];
Scott Baker6bd238f2019-04-16 16:28:52 -0700187}
188
Scott Baker6b260ea2018-04-18 07:12:22 -0700189message ComputeServiceInstance (ServiceInstance) {
Scott Baker83cc6f52019-03-11 11:10:24 -0700190 required manytoone slice->Slice:computeserviceinstances = 1:1001 [db_index = True, blank = False, help_text = "Slice that controls this ServiceInstance"];
191 required manytoone image->Image:computeserviceinstances = 2:1001 [db_index = True, blank = False, help_text = "Image used to instantiate this ServiceInstance"];
Scott Baker6b260ea2018-04-18 07:12:22 -0700192}
193
Sapan Bhatiab5ce1862017-07-31 15:48:19 -0400194// Everyone has read access
195// For write access, you have to be a site_admin
Sapan Bhatia170ae272017-05-30 19:01:09 +0200196
Sapan Bhatiab5ce1862017-07-31 15:48:19 -0400197policy site_policy <
198 ctx.user.is_admin
199 | (ctx.write_access -> exists Privilege: Privilege.object_type = "Site" & Privilege.object_id = obj.id & Privilege.accessor_id = ctx.user.id & Privilege.permission = "role:admin") >
200
201// If you can access (read or write) the site, you can also access its slices
202// Otherwise, you need an explicit privilege on the Slice (admin for write access)
203// or admin privilege on the associated site.
204policy slice_policy <
205 ctx.user.is_admin
206 | (*site_policy(site)
Zack Williams00e22d62019-03-01 22:32:13 -0700207 & (ctx.user = obj.creator
Sapan Bhatiab5ce1862017-07-31 15:48:19 -0400208 | (exists Privilege:
209 Privilege.accessor_id = ctx.user.id
210 & Privilege.accessor_type = "User"
211 & Privilege.object_type = "Slice"
212 & Privilege.object_id = obj.id
213 & (ctx.write_access -> Privilege.permission = "role:admin"))
214 )
215 |
216 (exists Privilege:
217 Privilege.accessor_id = ctx.user.id
218 & Privilege.accessor_type = "User"
219 & Privilege.object_type = "Slice"
220 & Privilege.object_id = obj.id)
221 | (exists Privilege:
222 Privilege.accessor_id = ctx.user.id
223 & Privilege.accessor_type = "User"
224 & Privilege.object_type = "Site"
225 & Privilege.object_id = obj.site.id
226 & Privilege.permission = "role:admin")
227 ) >
228
Sapan Bhatia170ae272017-05-30 19:01:09 +0200229
Sapan Bhatia170ae272017-05-30 19:01:09 +0200230message Flavor (XOSBase) {
Scott Baker83cc6f52019-03-11 11:10:24 -0700231 required string name = 1 [max_length = 32, content_type = "stripped", blank = False, help_text = "name of this flavor, as displayed to users", db_index = False, unique = True];
232 optional string description = 2 [db_index = False, max_length = 1024, content_type = "stripped"];
233 required string flavor = 3 [max_length = 32, content_type = "stripped", help_text = "flavor string used to configure deployments"];
Sapan Bhatia170ae272017-05-30 19:01:09 +0200234}
235
236
237message Image (XOSBase) {
Scott Baker83cc6f52019-03-11 11:10:24 -0700238 required string name = 1 [db_index = False, max_length = 256, content_type = "stripped", blank = False, unique_with = "tag"];
239 required string kind = 2 [default = "vm", choices = "(('vm', 'Virtual Machine'), ('container', 'Container'))", max_length = 30, blank = False, db_index = False];
240 optional string disk_format = 3 [db_index = False, max_length = 256, content_type = "stripped", blank = True];
241 optional string container_format = 4 [db_index = False, max_length = 256, content_type = "stripped", blank = True];
242 optional string path = 5 [max_length = 256, content_type = "stripped", blank = True, help_text = "Path to image on local disk", db_index = False];
243 optional string tag = 6 [max_length = 256, content_type = "stripped", blank = True, help_text = "For Docker Images, tag of image", db_index = False];
Sapan Bhatia170ae272017-05-30 19:01:09 +0200244}
245
Sapan Bhatiab5ce1862017-07-31 15:48:19 -0400246policy network_policy < *slice_policy(owner) >
247
248message Network::network_policy (XOSBase) {
Scott Baker83cc6f52019-03-11 11:10:24 -0700249 required string name = 1 [db_index = False, max_length = 32, blank = False, unique = True];
250 required manytoone template->NetworkTemplate:network = 2:1001 [db_index = True, blank = False];
251 optional string subnet = 3 [max_length = 32];
252 optional string start_ip = 4 [max_length = 32];
253 optional string end_ip = 5 [max_length = 32];
254 optional string ports = 6 [max_length = 1024];
255 optional string labels = 7 [max_length = 1024];
256 required manytoone owner->Slice:ownedNetworks = 8:1004 [help_text = "Slice that owns control of this Network", db_index = True, blank = False];
257 required bool permit_all_slices = 10 [default = False, db_index = False];
258 required bool autoconnect = 17 [help_text = "This network can be autoconnected to the slice that owns it", default = True, db_index = False];
259 optional manytomany permitted_slices->Slice/Network_permitted_slices:availableNetworks = 18:1005 [];
Sapan Bhatia170ae272017-05-30 19:01:09 +0200260}
261
262
263message NetworkParameter (XOSBase) {
Scott Baker83cc6f52019-03-11 11:10:24 -0700264 required manytoone parameter->NetworkParameterType:networkparameters = 1:1001 [help_text = "The type of the parameter", db_index = True, blank = False];
265 required string value = 2 [help_text = "The value of this parameter", max_length = 1024, db_index = False, blank = False];
266 required string content_type = 4 [max_length = 1024, content_type = "stripped", blank = False, help_text = "Content type id linked to this network parameter", db_index = False];
267 required uint32 object_id = 5 [db_index = False, blank = False, help_text = "Object linked to this NetworkParameter"];
Sapan Bhatia170ae272017-05-30 19:01:09 +0200268}
269
270
271message NetworkParameterType (XOSBase) {
Scott Baker83cc6f52019-03-11 11:10:24 -0700272 required string name = 1 [help_text = "The name of this parameter", max_length = 128, db_index = True, blank = False, unique = True];
273 optional string description = 2 [max_length = 1024];
Sapan Bhatia170ae272017-05-30 19:01:09 +0200274}
275
Sapan Bhatia9227b4d2017-07-25 23:14:48 -0400276policy network_slice_validator < (obj.slice in obj.network.permitted_slices.all()) | (obj.slice = obj.network.owner) | obj.network.permit_all_slices >
Sapan Bhatiab5ce1862017-07-31 15:48:19 -0400277policy network_slice_policy < *slice_policy(slice) & *network_policy(network) >
Sapan Bhatia170ae272017-05-30 19:01:09 +0200278
Sapan Bhatiab5ce1862017-07-31 15:48:19 -0400279message NetworkSlice::network_slice_policy (XOSBase) {
Sapan Bhatia52b1ea52017-10-19 13:02:22 -0400280 option validators = "network_slice_validator:Slice {obj.slice.name} is not allowed to connect to networks {obj.network}";
Scott Baker83cc6f52019-03-11 11:10:24 -0700281 required manytoone network->Network:networkslices = 1:1002 [db_index = True, blank = False, unique_with = "slice", tosca_key=True];
282 required manytoone slice->Slice:networkslices = 2:1006 [db_index = True, blank = False, tosca_key=True];
Sapan Bhatia170ae272017-05-30 19:01:09 +0200283}
Sapan Bhatia5ea307d2017-07-19 00:13:21 -0400284
Sapan Bhatia170ae272017-05-30 19:01:09 +0200285message NetworkTemplate (XOSBase) {
Scott Baker83cc6f52019-03-11 11:10:24 -0700286 required string name = 1 [db_index = False, max_length = 32, blank = False, unique = True];
287 optional string description = 2 [max_length = 1024];
288 required string visibility = 4 [default = "private", choices = "(('public', 'public'), ('private', 'private'))", max_length = 30, blank = False, db_index = False];
289 required string translation = 5 [default = "none", choices = "(('none', 'none'), ('NAT', 'NAT'))", max_length = 30, blank = False, db_index = False];
290 optional string access = 6 [choices = "((None, 'None'), ('indirect', 'Indirect'), ('direct', 'Direct'))", max_length = 30, blank = True, help_text = "Advertise this network as a means for other slices to contact this slice", db_index = False];
291 optional string shared_network_name = 7 [db_index = False, max_length = 30, blank = True];
292 optional string shared_network_id = 8 [help_text = "Quantum network", max_length = 256, db_index = False, blank = True];
293 required string topology_kind = 9 [default = "bigswitch", choices = "(('bigswitch', 'BigSwitch'), ('physical', 'Physical'), ('custom', 'Custom'))", max_length = 30, blank = False, db_index = False];
294 optional string controller_kind = 10 [blank = True, max_length = 30, db_index = False, choices = "((None, 'None'), ('onos', 'ONOS'), ('custom', 'Custom'))"];
295 optional string vtn_kind = 11 [default = "PRIVATE", choices = "(('PRIVATE', 'Private'), ('PUBLIC', 'Public'), ('MANAGEMENT_LOCAL', 'Management Local'), ('MANAGEMENT_HOST', 'Management Host'), ('VSG', 'VSG'), ('ACCESS_AGENT', 'Access Agent'), ('FLAT', 'Flat'))", max_length = 30, blank = True, db_index = False];
Sapan Bhatia170ae272017-05-30 19:01:09 +0200296}
Sapan Bhatiab5ce1862017-07-31 15:48:19 -0400297
Scott Baker4839dec2019-02-27 16:50:37 -0800298message Node (XOSBase) {
Scott Baker83cc6f52019-03-11 11:10:24 -0700299 required string name = 1 [max_length = 200, content_type = "stripped", blank = False, help_text = "Name of the Node", db_index = False, unique = True];
300 optional string bridgeId = 3 [max_length = 200, content_type = "stripped", blank = True, help_text = "Bridge Id", db_index = False];
301 optional string dataPlaneIntf = 4 [max_length = 200, content_type = "stripped", blank = True, help_text = "Dataplane Interface", db_index = False];
302 optional string dataPlaneIp = 5 [max_length = 200, content_type = "stripped", blank = True, help_text = "Dataplane Ip", db_index = False];
303 optional string hostManagementIface = 6 [max_length = 200, content_type = "stripped", blank = True, help_text = "Host Management Interface", db_index = False];
304 required manytoone site->Site:nodes = 7:1006 [db_index = True, blank = False, default=get_first_site];
Sapan Bhatia170ae272017-05-30 19:01:09 +0200305}
306message NodeLabel (XOSBase) {
Scott Bakerbe2a5172019-04-10 18:02:50 -0700307 option custom_python=True;
Scott Baker83cc6f52019-03-11 11:10:24 -0700308 required string name = 1 [max_length = 200, content_type = "stripped", blank = False, help_text = "label name", db_index = False, unique = True];
309 optional manytomany node->Node/NodeLabel_node:nodelabels = 2:1002 [];
Sapan Bhatia170ae272017-05-30 19:01:09 +0200310}
Sapan Bhatia5ea307d2017-07-19 00:13:21 -0400311
Scott Baker4839dec2019-02-27 16:50:37 -0800312policy port_policy < *network_policy(network) >
Sapan Bhatia5ea307d2017-07-19 00:13:21 -0400313
Sapan Bhatiab5ce1862017-07-31 15:48:19 -0400314message Port::port_policy (XOSBase) {
Scott Baker83cc6f52019-03-11 11:10:24 -0700315 required manytoone network->Network:links = 1:1003 [db_index = True, blank = False, unique_with = "service_instance", help_text = "Network bound to this port"];
316 optional string ip = 3 [max_length = 39, content_type = "ip", blank = True, help_text = "Instance ip address", db_index = False];
317 optional string port_id = 4 [help_text = "Neutron port id", max_length = 256, db_index = False, blank = True];
318 optional string mac = 5 [help_text = "MAC address associated with this port", max_length = 256, db_index = False, blank = True];
319 required bool xos_created = 6 [default = False];
320 optional manytoone service_instance->ServiceInstance:ports = 7:1001 [db_index = True, blank = True, help_text = "ServiceInstance bound to this port"];
Sapan Bhatia170ae272017-05-30 19:01:09 +0200321}
322
Scott Baker6b260ea2018-04-18 07:12:22 -0700323message Principal (XOSBase) {
Scott Baker83cc6f52019-03-11 11:10:24 -0700324 required string name = 1 [max_length = 128, db_index = True, blank = False, help_text = "The name of this principal"];
325 required manytoone trust_domain->TrustDomain:principals = 2:1001 [db_index = True, blank = False, help_text = "Trust domain this principal resides in"];
Scott Baker6b260ea2018-04-18 07:12:22 -0700326}
Sapan Bhatia170ae272017-05-30 19:01:09 +0200327
328message Role (XOSBase) {
Scott Baker83cc6f52019-03-11 11:10:24 -0700329 required string role_type = 1 [db_index = False, max_length = 80, content_type = "stripped", blank = False];
330 optional string role = 2 [db_index = False, max_length = 80, content_type = "stripped", blank = True];
331 optional string description = 3 [max_length = 120, content_type = "stripped"];
Sapan Bhatia170ae272017-05-30 19:01:09 +0200332}
333
Sapan Bhatiab5ce1862017-07-31 15:48:19 -0400334policy service_policy <ctx.user.is_admin | exists Privilege: Privilege.accessor_id = ctx.user.id & Privilege.accessor_type = "User" & Privilege.object_type = "Service" & Privilege.object_id = obj.id >
Sapan Bhatia170ae272017-05-30 19:01:09 +0200335
336message Service (XOSBase,AttributeMixin) {
Scott Bakeracfbc892019-01-24 12:23:58 -0800337 option description = "A service managed by XOS";
Scott Bakerbe2a5172019-04-10 18:02:50 -0700338 option custom_python=True;
Scott Bakeracfbc892019-01-24 12:23:58 -0800339
340 optional string description = 1 [
341 help_text = "Description of Service",
Scott Baker08d10402019-04-08 16:19:59 -0700342 text = True];
Scott Bakeracfbc892019-01-24 12:23:58 -0800343 required bool enabled = 2 [
344 help_text = "Whether or not service is Enabled",
Scott Bakeracfbc892019-01-24 12:23:58 -0800345 default = True,
Scott Bakeracfbc892019-01-24 12:23:58 -0800346 gui_hidden = True];
347 required string kind = 3 [
348 help_text = "Kind of service",
Scott Bakeracfbc892019-01-24 12:23:58 -0800349 choices="(('generic', 'Generic'), ('data', 'Data Plane'), ('control', 'Control Plane'), ('oss', 'OSS'))",
350 content_type = "stripped",
Scott Bakeracfbc892019-01-24 12:23:58 -0800351 default = "generic",
Scott Baker83cc6f52019-03-11 11:10:24 -0700352 max_length = 30];
Scott Bakeracfbc892019-01-24 12:23:58 -0800353 required string name = 4 [
354 help_text = "Unique name of service",
Scott Bakeracfbc892019-01-24 12:23:58 -0800355 content_type = "stripped",
Scott Bakeracfbc892019-01-24 12:23:58 -0800356 max_length = 30,
Scott Bakeracfbc892019-01-24 12:23:58 -0800357 unique = True];
358 optional string versionNumber = 5 [
359 help_text = "Version of Service Definition",
Scott Bakeracfbc892019-01-24 12:23:58 -0800360 content_type = "stripped",
Scott Baker83cc6f52019-03-11 11:10:24 -0700361 max_length = 30];
Scott Bakeracfbc892019-01-24 12:23:58 -0800362 required bool published = 6 [
363 help_text = "True if this service should be published in XOS",
Scott Bakeracfbc892019-01-24 12:23:58 -0800364 default = True,
Scott Bakerc80304a2019-03-07 11:07:29 -0800365 gui_hidden = True]; // deprecated?
Scott Bakeracfbc892019-01-24 12:23:58 -0800366 optional string icon_url = 8 [
Scott Bakeracfbc892019-01-24 12:23:58 -0800367 content_type = "stripped",
Scott Bakeracfbc892019-01-24 12:23:58 -0800368 gui_hidden = True,
Scott Baker83cc6f52019-03-11 11:10:24 -0700369 max_length = 1024]; // deprecated?
Scott Bakeracfbc892019-01-24 12:23:58 -0800370 optional string public_key = 9 [
371 help_text = "Public key string",
Scott Bakeracfbc892019-01-24 12:23:58 -0800372 gui_hidden = True,
Scott Baker08d10402019-04-08 16:19:59 -0700373 text = True]; // likely only used by VM-based services. deprecated?
Scott Bakeracfbc892019-01-24 12:23:58 -0800374 optional string private_key_fn = 10 [
375 help_text = "Filename of private key file, located within core container",
Scott Bakeracfbc892019-01-24 12:23:58 -0800376 content_type = "stripped",
Scott Bakeracfbc892019-01-24 12:23:58 -0800377 gui_hidden = True,
Scott Baker83cc6f52019-03-11 11:10:24 -0700378 max_length = 4096]; // likely only used by VM-based services. deprecated?
Scott Bakeracfbc892019-01-24 12:23:58 -0800379 optional string service_specific_id = 11 [
380 help_text = "Service-specific identifier, opaque to XOS core",
Scott Bakeracfbc892019-01-24 12:23:58 -0800381 content_type = "stripped",
Scott Baker83cc6f52019-03-11 11:10:24 -0700382 max_length = 30];
Scott Bakeracfbc892019-01-24 12:23:58 -0800383 optional string service_specific_attribute = 12 [
384 help_text = "Service-specific string attribute, opaque to XOS core",
Scott Bakeracfbc892019-01-24 12:23:58 -0800385 gui_hidden = True,
Scott Baker08d10402019-04-08 16:19:59 -0700386 text = True];
Himanshu Bhandari51d71c12020-03-17 07:47:59 +0000387 optional manytoone site->Site:service = 13:1012 [
388 help_text = "The Site this Service belongs to",
389 db_index = True];
390
Sapan Bhatia170ae272017-05-30 19:01:09 +0200391}
392
Scott Baker6b260ea2018-04-18 07:12:22 -0700393message ServicePort (XOSBase) {
Scott Bakeracfbc892019-01-24 12:23:58 -0800394 option description = "Exposes a port in a service outside of the pod, implementation depends on Compute Service";
395
396 required string name = 1 [
397 help_text = "Unique service port name",
Scott Baker83cc6f52019-03-11 11:10:24 -0700398 max_length = 128];
Scott Bakeracfbc892019-01-24 12:23:58 -0800399 required int32 external_port = 2 [
Scott Baker83cc6f52019-03-11 11:10:24 -0700400 help_text = "external port number"];
Scott Bakeracfbc892019-01-24 12:23:58 -0800401 required int32 internal_port = 3 [
Scott Baker83cc6f52019-03-11 11:10:24 -0700402 help_text = "internal port number"];
Scott Bakeracfbc892019-01-24 12:23:58 -0800403 required string protocol = 4 [
404 help_text = "Protocol",
Scott Bakeracfbc892019-01-24 12:23:58 -0800405 default="TCP",
Scott Baker83cc6f52019-03-11 11:10:24 -0700406 max_length = 32];
Scott Bakeracfbc892019-01-24 12:23:58 -0800407 required manytoone service->Service:serviceports = 5:1002 [
408 help_text = "The Service this ServicePort is associated with",
Scott Baker83cc6f52019-03-11 11:10:24 -0700409 db_index = True];
Scott Baker6b260ea2018-04-18 07:12:22 -0700410}
Sapan Bhatia170ae272017-05-30 19:01:09 +0200411
412message ServiceAttribute (XOSBase) {
Scott Bakeracfbc892019-01-24 12:23:58 -0800413 option description = "An (key, value) attribute associated with a Service";
414
415 required string name = 1 [
416 help_text = "Attribute Name",
Scott Bakeracfbc892019-01-24 12:23:58 -0800417 max_length = 128,
Scott Bakeracfbc892019-01-24 12:23:58 -0800418 unique_with="service"];
419 required string value = 2 [
420 help_text = "Attribute Value",
Scott Baker08d10402019-04-08 16:19:59 -0700421 text = True];
Scott Bakeracfbc892019-01-24 12:23:58 -0800422 required manytoone service->Service:serviceattributes = 3:1003 [
423 help_text = "The Service this attribute is associated with",
Scott Baker83cc6f52019-03-11 11:10:24 -0700424 db_index = True];
Sapan Bhatia170ae272017-05-30 19:01:09 +0200425}
426
427
Scott Baker071da962017-07-13 10:43:41 -0700428message ServiceDependency (XOSBase) {
Scott Bakeracfbc892019-01-24 12:23:58 -0800429 option description = "A dependency relation between a provider and a subscriber service";
430
431 required manytoone provider_service->Service:provided_dependencies = 1:1004 [
432 help_text = "The service that provides this dependency",
Scott Bakeracfbc892019-01-24 12:23:58 -0800433 db_index = True,
Scott Bakeracfbc892019-01-24 12:23:58 -0800434 tosca_key=True];
435 required manytoone subscriber_service->Service:subscribed_dependencies = 2:1005 [
436 help_text = "The services that subscribes to this dependency",
Scott Bakeracfbc892019-01-24 12:23:58 -0800437 db_index=True,
Scott Bakeracfbc892019-01-24 12:23:58 -0800438 tosca_key=True];
439 required string connect_method = 3 [
440 help_text = "method to connect the two services",
441 choices = "(('none', 'None'), ('private', 'Private'), ('public', 'Public'))",
442 default="none",
443 max_length = 30];
Sapan Bhatia170ae272017-05-30 19:01:09 +0200444}
445
446
Sapan Bhatiab5ce1862017-07-31 15:48:19 -0400447message Site::site_policy (XOSBase) {
Scott Baker83cc6f52019-03-11 11:10:24 -0700448 required string name = 1 [max_length = 200, content_type = "stripped", blank = False, help_text = "Name for this Site", db_index = False, unique = True];
449 optional string site_url = 2 [max_length = 512, content_type = "url", blank = True, help_text = "Site's Home URL Page", db_index = False];
450 required bool enabled = 3 [help_text = "Status for this Site", default = True];
451 required bool hosts_nodes = 4 [help_text = "Indicates whether or not the site host nodes", default = True];
452 required bool hosts_users = 5 [help_text = "Indicates whether or not the site manages user accounts", default = True];
453 optional float longitude = 6 [db_index = False, blank = True];
454 optional float latitude = 7 [db_index = False, blank = True];
455 required string login_base = 8 [max_length = 50, content_type = "stripped", blank = False, help_text = "Prefix for Slices associated with this Site", db_index = False];
456 required bool is_public = 9 [help_text = "Indicates the visibility of this site to other members", default = True];
457 required string abbreviated_name = 10 [db_index = False, max_length = 80, content_type = "stripped", blank = False];
Sapan Bhatia170ae272017-05-30 19:01:09 +0200458}
459
Scott Baker6b260ea2018-04-18 07:12:22 -0700460policy slice_name_no_spaces < {{ ' ' not in obj.name }} >
Sapan Bhatia5ea307d2017-07-19 00:13:21 -0400461policy slice_has_creator < obj.creator >
462
Sapan Bhatiab5ce1862017-07-31 15:48:19 -0400463message Slice::slice_policy (XOSBase) {
Scott Baker6b260ea2018-04-18 07:12:22 -0700464 option validators = "slice_name_no_spaces:Slice name contains spaces, slice_has_creator:Slice has no creator";
Sapan Bhatiacb35e7f2017-05-24 12:17:28 +0200465 option plural = "Slices";
Scott Bakerbe2a5172019-04-10 18:02:50 -0700466 option custom_python=True;
Sapan Bhatia5ea307d2017-07-19 00:13:21 -0400467
Scott Baker83cc6f52019-03-11 11:10:24 -0700468 required string name = 1 [max_length = 80, content_type = "stripped", blank = False, help_text = "The Name of the Slice", db_index = False, unique = True];
469 required bool enabled = 2 [help_text = "Status for this Slice", default = True];
Scott Baker08d10402019-04-08 16:19:59 -0700470 optional string description = 4 [help_text = "High level description of the slice and expected activities", text = True];
Scott Baker83cc6f52019-03-11 11:10:24 -0700471 required manytoone site->Site:slices = 6:1005 [help_text = "The Site this Slice belongs to", db_index = True, blank = False];
472 required int32 max_instances = 7 [default = 10, db_index = False, blank = False];
473 optional manytoone service->Service:slices = 8:1006 [db_index = True, blank = True];
474 optional string network = 9 [blank = True, max_length = 256, db_index = False, choices = "((None, 'Default'), ('host', 'Host'), ('bridged', 'Bridged'), ('noauto', 'No Automatic Networks'))"];
475 optional string exposed_ports = 10 [db_index = False, max_length = 256, blank = True];
Zack Williams00e22d62019-03-01 22:32:13 -0700476 optional manytoone creator->User:slices = 12:1004 [db_index = True];
Scott Baker83cc6f52019-03-11 11:10:24 -0700477 optional manytoone default_flavor->Flavor:slices = 13:1002 [db_index = True, blank = True];
478 optional manytoone default_image->Image:slices = 14:1005 [db_index = True, blank = True];
479 optional manytoone default_node->Node:slices = 15:1003 [db_index = True, blank = True];
480 optional string mount_data_sets = 16 [default = "GenBank", max_length = 256, content_type = "stripped", blank = True, db_index = False];
481 required string default_isolation = 17 [default = "vm", choices = "(('vm', 'Virtual Machine'), ('container', 'Container'), ('container_vm', 'Container In VM'))", max_length = 30, blank = False, db_index = False];
Zack Williams00e22d62019-03-01 22:32:13 -0700482 optional manytoone trust_domain->TrustDomain:slices = 18:1002 [db_index = True, help_text = "Trust domain this slice resides in"];
483 optional manytoone principal->Principal:slices = 19:1001 [db_index = True, help_text = "Principal this slice may use to interact with other components"];
Scott Baker83cc6f52019-03-11 11:10:24 -0700484 optional int32 controller_replica_count = 20 [default = 0, help_text = "Replica count, controller-dependent"];
485 optional string controller_kind = 21 [max_length = 256, content_type = "stripped", blank = True, help_text = "Type of controller, vim-dependent", db_index = False];
Sapan Bhatia170ae272017-05-30 19:01:09 +0200486}
487
Sapan Bhatia170ae272017-05-30 19:01:09 +0200488
Sapan Bhatiab5ce1862017-07-31 15:48:19 -0400489policy tag_policy < ctx.user.is_admin >
Sapan Bhatia170ae272017-05-30 19:01:09 +0200490
Sapan Bhatiab5ce1862017-07-31 15:48:19 -0400491message Tag::tag_policy (XOSBase) {
Scott Baker83cc6f52019-03-11 11:10:24 -0700492 required manytoone service->Service:tags = 1:1007 [help_text = "The Service this Tag is associated with", db_index = True, blank = False];
493 required string name = 2 [help_text = "The name of this tag", max_length = 128, db_index = True, blank = False];
494 required string value = 3 [max_length = 1024, content_type = "stripped", blank = False, help_text = "The value of this tag", db_index = False];
495 required string content_type = 4 [max_length = 1024, content_type = "stripped", blank = False, help_text = "Content type id linked to this tag", db_index = False];
496 required uint32 object_id = 5 [db_index = False, blank = False, help_text = "Object linked to this tag"];
Sapan Bhatia170ae272017-05-30 19:01:09 +0200497}
498
Scott Bakerd6e533f2017-07-17 13:37:29 -0700499message InterfaceType (XOSBase) {
Scott Bakeracfbc892019-01-24 12:23:58 -0800500 option description = "Defines an InterfaceType that may be used by Services to connect ServiceInstances";
501
502 required string name = 1 [
503 help_text = "Name of this interface type",
Scott Bakeracfbc892019-01-24 12:23:58 -0800504 content_type = "stripped",
Scott Bakeracfbc892019-01-24 12:23:58 -0800505 max_length = 200,
Scott Bakeracfbc892019-01-24 12:23:58 -0800506 unique_with = "direction"];
507 required string direction = 2 [
508 help_text = "Direction, either in or out",
Scott Bakeracfbc892019-01-24 12:23:58 -0800509 choices = "(('in', 'In'), ('out', 'Out'))",
510 content_type = "stripped",
Scott Baker83cc6f52019-03-11 11:10:24 -0700511 max_length = 30];
Sapan Bhatia170ae272017-05-30 19:01:09 +0200512}
513
Scott Bakerd6e533f2017-07-17 13:37:29 -0700514message ServiceInterface (XOSBase) {
Scott Bakeracfbc892019-01-24 12:23:58 -0800515 option description = "Describes the type of connection attached to a ServiceInstanceLink";
516
517 required manytoone service->Service:service_interfaces = 1:1008 [
518 help_text = "Service that this ServiceInterface is associated with",
Scott Bakeracfbc892019-01-24 12:23:58 -0800519 db_index = True,
Scott Bakeracfbc892019-01-24 12:23:58 -0800520 tosca_key=True];
521 required manytoone interface_type->InterfaceType:service_interfaces = 2:1001 [
522 help_text = "Interface type that describes this interface",
Scott Bakeracfbc892019-01-24 12:23:58 -0800523 db_index = True,
Scott Bakeracfbc892019-01-24 12:23:58 -0800524 tosca_key=True];
Scott Bakerd6e533f2017-07-17 13:37:29 -0700525}
526
527message ServiceInstance (XOSBase, AttributeMixin) {
Scott Bakeracfbc892019-01-24 12:23:58 -0800528 option description = "A portion of a service broken up into a tenant-sized piece";
Scott Bakerbe2a5172019-04-10 18:02:50 -0700529 option custom_python=True;
Scott Bakeracfbc892019-01-24 12:23:58 -0800530
531 optional string name = 1 [
532 help_text = "Name of ServiceInstance",
Scott Bakeracfbc892019-01-24 12:23:58 -0800533 content_type = "stripped",
Scott Baker83cc6f52019-03-11 11:10:24 -0700534 max_length = 200];
Scott Bakeracfbc892019-01-24 12:23:58 -0800535 required manytoone owner->Service:service_instances = 2:1009 [
536 help_text = "The Service that owns this ServiceInstance",
Scott Baker83cc6f52019-03-11 11:10:24 -0700537 db_index = True];
Scott Bakeracfbc892019-01-24 12:23:58 -0800538 optional string service_specific_id = 3 [
539 help_text = "Service-specific identifier, opaque to the XOS core",
Scott Bakeracfbc892019-01-24 12:23:58 -0800540 content_type = "stripped",
Scott Bakeracfbc892019-01-24 12:23:58 -0800541 gui_hidden = True,
Scott Baker83cc6f52019-03-11 11:10:24 -0700542 max_length = 30];
Scott Bakeracfbc892019-01-24 12:23:58 -0800543 optional string service_specific_attribute = 10 [
544 help_text = "Service-specific text attribute, opaque to the XOS core",
Scott Bakeracfbc892019-01-24 12:23:58 -0800545 gui_hidden = True,
Scott Baker08d10402019-04-08 16:19:59 -0700546 text = True];
Scott Bakeracfbc892019-01-24 12:23:58 -0800547 optional uint32 link_deleted_count = 11 [
548 help_text = "Incremented each time a provided_link is deleted from this ServiceInstance",
549 default = 0,
550 gui_hidden = True];
551 optional manytoone master_serviceinstance->ServiceInstance:child_serviceinstances = 12:1002 [
552 help_text = "The master service instance that set this service instance up",
Scott Bakeracfbc892019-01-24 12:23:58 -0800553 gui_hidden = True];
Scott Bakerd6e533f2017-07-17 13:37:29 -0700554}
555
556message ServiceInstanceLink (XOSBase) {
Scott Bakeracfbc892019-01-24 12:23:58 -0800557 option description = "A link in a chain between two ServiceInstances";
Scott Bakerbe2a5172019-04-10 18:02:50 -0700558 option custom_python=True;
Scott Bakeracfbc892019-01-24 12:23:58 -0800559
560 required manytoone provider_service_instance->ServiceInstance:provided_links = 1:1003 [
561 help_text = "Eastbound serviceinstance of this link",
562 db_index = True,
Scott Bakeracfbc892019-01-24 12:23:58 -0800563 tosca_key=True];
564 optional manytoone provider_service_interface->ServiceInterface:provided_links = 2:1004 [
565 help_text = "Interface descrption of the eastbound linkage point",
Scott Baker83cc6f52019-03-11 11:10:24 -0700566 db_index = True];
Scott Bakeracfbc892019-01-24 12:23:58 -0800567 optional manytoone subscriber_service_instance->ServiceInstance:subscribed_links = 3:1005 [
568 help_text = "Westbound ServiceInstance of this link",
Scott Baker83cc6f52019-03-11 11:10:24 -0700569 db_index = True];
Scott Bakeracfbc892019-01-24 12:23:58 -0800570 optional manytoone subscriber_service->Service:subscribed_links = 4:1010 [
571 help_text = "Interface description of the westbound linkage point",
572 db_index = True,
Scott Bakeracfbc892019-01-24 12:23:58 -0800573 tosca_key_one_of = subscriber_service_instance];
574 optional manytoone subscriber_network->Network:subscribed_links = 5:1004 [
575 help_text = "Alternative to subscriber_service_instance, if a Network model is the subscriber instead of a ServiceInstance",
576 db_index = True,
Scott Bakeracfbc892019-01-24 12:23:58 -0800577 tosca_key_one_of=subscriber_service_instance];
Scott Bakerd6e533f2017-07-17 13:37:29 -0700578}
579
580message ServiceInstanceAttribute (XOSBase) {
Scott Bakeracfbc892019-01-24 12:23:58 -0800581 option description = "A (key, value) attribute associated with a ServiceInstance";
582
583 required string name = 1 [
584 help_text = "Attribute Name",
Scott Bakeracfbc892019-01-24 12:23:58 -0800585 max_length = 128,
Scott Bakeracfbc892019-01-24 12:23:58 -0800586 unique_with = "service_instance"];
587 required string value = 2 [
Scott Baker08d10402019-04-08 16:19:59 -0700588 help_text = "Attribute Value",
589 text = True];
Scott Bakeracfbc892019-01-24 12:23:58 -0800590 required manytoone service_instance->ServiceInstance:service_instance_attributes = 3:1006 [
591 help_text = "The Tenant this attribute is associated with",
Scott Baker83cc6f52019-03-11 11:10:24 -0700592 db_index = True];
Sapan Bhatia170ae272017-05-30 19:01:09 +0200593}
594
Scott Baker6b260ea2018-04-18 07:12:22 -0700595message TrustDomain (XOSBase) {
Scott Baker08d10402019-04-08 16:19:59 -0700596 required string name = 1 [max_length = 256, db_index = True, blank = False, help_text = "Name of this trust domain"];
Scott Baker83cc6f52019-03-11 11:10:24 -0700597 required manytoone owner->Service:owned_trust_domains = 2:1011 [db_index = True, blank = False, help_text = "Service partioned by this trust domain"];
Scott Baker6b260ea2018-04-18 07:12:22 -0700598}
599
Scott Bakera33ccb02018-01-26 13:03:28 -0800600message XOSCore (XOSBase) {
601 option singular="XOSCore";
602 option plural="XOSCores";
Scott Baker83cc6f52019-03-11 11:10:24 -0700603 required string name = 1 [default = "XOS", max_length = 200, content_type = "stripped", blank = False, help_text = "Name of XOS", db_index = False, unique = True];
Sapan Bhatia170ae272017-05-30 19:01:09 +0200604}
605
Matteo Scandoloee367fd2017-11-22 14:55:09 -0800606message XOSGuiExtension::admin_policy (XOSBase) {
Matteo Scandoloe425f9d2017-08-15 15:56:19 -0700607 option verbose_name="XOS GUI Extension";
608 option description="This model holds the instruction to load an extension in the GUI";
Matteo Scandolo623da232017-12-01 11:49:45 -0800609 // option no_sync = True;
610 // option no_policy = True;
Matteo Scandolo39b4a272017-11-17 11:09:21 -0800611
Scott Baker83cc6f52019-03-11 11:10:24 -0700612 required string name = 1 [max_length = 200, content_type = "stripped", blank = False, help_text = "Name of the GUI Extensions", db_index = False, unique = True];
613 required string files = 2 [max_length = 1024, content_type = "stripped", blank = False, help_text = "List of comma separated file composing the view", db_index = False];
Sapan Bhatia170ae272017-05-30 19:01:09 +0200614}
Sapan Bhatia5ea307d2017-07-19 00:13:21 -0400615
Matteo Scandoloe2afe4b2017-11-15 08:10:55 -0800616message ServiceGraphConstraint (XOSBase) {
617 option verbose_name="Graph Constraint";
618 option description="Define the position of the nodes in the service graph";
Matteo Scandolo11a2c5e2019-03-13 10:40:17 -0700619 required string constraints = 1 [max_length = 1024, content_type = "stripped", help_text = "A composite array defining service positions in the graph, eg [volt, vsg, [address_manager, vrouter]]", tosca_key=True];
620 optional int32 priority = 2 [help_text = "The priority of the constraint, the one with highest priority will be used", default=0];
Matteo Scandoloe2afe4b2017-11-15 08:10:55 -0800621}
622