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