Sapan Bhatia | 29c4759 | 2017-07-23 21:32:44 -0400 | [diff] [blame^] | 1 | plyxproto |
| 2 | ========= |
| 3 | |
| 4 | plyxproto is a Python parser and processor for the xproto model definition language. |
| 5 | xproto is a syntax defined and supported by XOS (https://github.com/opencord/xos). |
| 6 | |
| 7 | Here is an example of an xproto file: |
| 8 | |
| 9 | ```protobuf |
| 10 | message Slice (PlCoreBase){ |
| 11 | required string name = 1 [max_length = 80, content_type = "stripped", blank = False, help_text = "The Name of the Slice", null = False, db_index = False]; |
| 12 | required bool enabled = 2 [help_text = "Status for this Slice", default = True, null = False, db_index = False, blank = True]; |
| 13 | required bool omf_friendly = 3 [default = False, null = False, db_index = False, blank = True]; |
| 14 | required string description = 4 [help_text = "High level description of the slice and expected activities", max_length = 1024, null = False, db_index = False, blank = True]; |
| 15 | required string slice_url = 5 [db_index = False, max_length = 512, null = False, content_type = "url", blank = True]; |
| 16 | required manytoone site->Site:slices = 6 [help_text = "The Site this Slice belongs to", null = False, db_index = True, blank = False]; |
| 17 | required int32 max_instances = 7 [default = 10, null = False, db_index = False, blank = False]; |
| 18 | optional manytoone service->Service:slices = 8 [db_index = True, null = True, blank = True]; |
| 19 | optional string network = 9 [blank = True, max_length = 256, null = True, db_index = False, choices = "((None, 'Default'), ('host', 'Host'), ('bridged', 'Bridged'), ('noauto', 'No Automatic Networks'))"]; |
| 20 | optional string exposed_ports = 10 [db_index = False, max_length = 256, null = True, blank = True]; |
| 21 | optional manytoone serviceClass->ServiceClass:slices = 11 [db_index = True, null = True, blank = True]; |
| 22 | optional manytoone creator->User:slices = 12 [db_index = True, null = True, blank = True]; |
| 23 | optional manytoone default_flavor->Flavor:slices = 13 [db_index = True, null = True, blank = True]; |
| 24 | optional manytoone default_image->Image:slices = 14 [db_index = True, null = True, blank = True]; |
| 25 | optional manytoone default_node->Node:slices = 15 [db_index = True, null = True, blank = True]; |
| 26 | optional string mount_data_sets = 16 [default = "GenBank", max_length = 256, content_type = "stripped", blank = True, null = True, db_index = False]; |
| 27 | required string default_isolation = 17 [default = "vm", choices = "(('vm', 'Virtual Machine'), ('container', 'Container'), ('container_vm', 'Container In VM'))", max_length = 30, blank = False, null = False, db_index = False]; |
| 28 | required manytomany tags->Tag = 18 [db_index = False, null = False, blank = True]; |
| 29 | } |
| 30 | ``` |
| 31 | |
| 32 | More details on xproto and XOS can be found via the link below, and at the aforementioned xos homepage. |
| 33 | |
| 34 | https://github.com/opencord/xos/blob/master/docs/dev/xproto.md |