Scott Baker | edbb232 | 2018-05-08 11:46:25 -0700 | [diff] [blame] | 1 | option app_label = "simpleexampleservice"; |
| 2 | option name = "simpleexampleservice"; |
| 3 | |
| 4 | message SimpleExampleService (Service){ |
| 5 | option verbose_name = "Simple Example Service"; |
Scott Baker | 5872322 | 2019-01-24 07:56:12 -0800 | [diff] [blame] | 6 | option description = "Service that demonstrates integration with Kubernetes compute resources"; |
| 7 | |
| 8 | required string service_message = 1 [ |
| 9 | help_text = "Service Message to display in web page", |
| 10 | blank = False, |
| 11 | db_index = False, |
| 12 | max_length = 254, |
| 13 | null = False]; |
| 14 | optional string service_secret = 2 [ |
| 15 | help_text = "Service Secret to place in a file", |
| 16 | blank = True, |
| 17 | db_index = False, |
| 18 | null = False]; |
Scott Baker | edbb232 | 2018-05-08 11:46:25 -0700 | [diff] [blame] | 19 | } |
| 20 | |
Scott Baker | 5872322 | 2019-01-24 07:56:12 -0800 | [diff] [blame] | 21 | // Note: Named ColorNew to prevent name collision with ExampleService's Color. |
| 22 | |
Scott Baker | edbb232 | 2018-05-08 11:46:25 -0700 | [diff] [blame] | 23 | message ColorNew (XOSBase){ |
| 24 | option verbose_name = "Color"; |
Scott Baker | 5872322 | 2019-01-24 07:56:12 -0800 | [diff] [blame] | 25 | option description = "An html color code that may be used to color a web page"; |
| 26 | |
| 27 | required string name = 1 [ |
| 28 | help_text = "Name for this color", |
| 29 | blank = False, |
| 30 | db_index = False, |
| 31 | max_length = 256, |
| 32 | null = False]; |
| 33 | required string html_code = 2 [ |
| 34 | help_text = "HTML Code for this color", |
| 35 | blank = False, |
| 36 | db_index = False, |
| 37 | max_length = 256, |
| 38 | null = False]; |
Scott Baker | edbb232 | 2018-05-08 11:46:25 -0700 | [diff] [blame] | 39 | } |
| 40 | |
Scott Baker | ed94fc4 | 2018-12-20 06:57:49 -0800 | [diff] [blame] | 41 | // Note: Named ServiceInstanceWithCompute2 to prevent name collision with ExampleService.ServiceInstanceWithCompute. |
| 42 | // Expect this model to eventually move to the core. |
| 43 | |
| 44 | message ServiceInstanceWithCompute2 (ServiceInstance) { |
Scott Baker | 5872322 | 2019-01-24 07:56:12 -0800 | [diff] [blame] | 45 | option description = "ServiceInstance with relation to a ComputeServiceInstance"; |
| 46 | |
| 47 | optional manytoone compute_instance->ComputeServiceInstance:service_instance_with_computes = 1:1001 [ |
| 48 | help_text = "ComputeServiceInstance that holds compute resources for this ServiceInstance", |
| 49 | blank=True, |
| 50 | db_index=True, |
| 51 | null=True]; |
Scott Baker | edbb232 | 2018-05-08 11:46:25 -0700 | [diff] [blame] | 52 | } |
| 53 | |
Scott Baker | ed94fc4 | 2018-12-20 06:57:49 -0800 | [diff] [blame] | 54 | message SimpleExampleServiceInstance (ServiceInstanceWithCompute2){ |
Scott Baker | edbb232 | 2018-05-08 11:46:25 -0700 | [diff] [blame] | 55 | option verbose_name = "Example Service Instance"; |
Scott Baker | 5872322 | 2019-01-24 07:56:12 -0800 | [diff] [blame] | 56 | option description = "Tenancy in SimpleExampleService, represents a web server that serves one page"; |
| 57 | |
| 58 | required string tenant_message = 1 [ |
| 59 | help_text = "Tenant Message to Display", |
| 60 | blank = False, |
| 61 | db_index = False, |
| 62 | max_length = 254, |
| 63 | null = False]; |
| 64 | optional manytoone foreground_color->ColorNew:serviceinstance_foreground_colors = 2:1001 [ |
| 65 | help_text = "Foreground color to use in web page", |
| 66 | db_index = True, |
| 67 | null = True, |
| 68 | blank = True]; |
| 69 | optional manytoone background_color->ColorNew:serviceinstance_background_colors = 3:1002 [ |
| 70 | help_text = "Background color to use in web page", |
| 71 | blank = True, |
| 72 | db_index = True, |
| 73 | null = True]; |
| 74 | optional string tenant_secret = 4 [ |
| 75 | help_text = "Tenant Secret to place in a file", |
| 76 | blank = True, |
| 77 | db_index = False, |
| 78 | null = False]; |
Scott Baker | edbb232 | 2018-05-08 11:46:25 -0700 | [diff] [blame] | 79 | } |
| 80 | |
Scott Baker | 5872322 | 2019-01-24 07:56:12 -0800 | [diff] [blame] | 81 | // Note: Named EmbeddedImageNew to prevent name collision with ExampleService's EmbeddedImage. |
| 82 | |
Scott Baker | edbb232 | 2018-05-08 11:46:25 -0700 | [diff] [blame] | 83 | message EmbeddedImageNew (XOSBase){ |
| 84 | option verbose_name = "Embedded Image"; |
Scott Baker | 5872322 | 2019-01-24 07:56:12 -0800 | [diff] [blame] | 85 | option description = "An embedded image that may be placed in a web page"; |
| 86 | |
| 87 | required string name = 1 [ |
| 88 | help_text = "Name for this image", |
| 89 | blank = False, |
| 90 | db_index = False, |
| 91 | max_length = 256, |
| 92 | null = False]; |
| 93 | required string url = 2 [ |
| 94 | help_text = "URL for this image", |
| 95 | blank = False, |
| 96 | db_index = False, |
| 97 | max_length = 256, |
| 98 | null = False]; |
| 99 | optional manytoone serviceinstance->SimpleExampleServiceInstance:embedded_images = 3:1001 [ |
| 100 | help_text = "ServiceInstance that represents the web page where this embedded image should be placed", |
| 101 | blank = True, |
| 102 | db_index = True, |
| 103 | null = True]; |
Scott Baker | edbb232 | 2018-05-08 11:46:25 -0700 | [diff] [blame] | 104 | } |