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