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