-
Notifications
You must be signed in to change notification settings - Fork 23
/
property-reference.html.md.erb
862 lines (655 loc) · 19.2 KB
/
property-reference.html.md.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
---
title: Property Reference
owner: Ops Manager
---
<strong><%= modified_date %></strong>
This topic explains how PCF Tiles describe properties.
## <a id='expressions'></a>Double-Parentheses Expressions
The product template `.yml` file in a tile's `metadata` subdirectory defines how the tile interface collects configurable properties from the user, and how Ops Manager incorporates these properties into the deployment manifest that it creates.
The product template contains `manifest` snippets in both the `form_types` section that defines the tile interface, and the `job_types` section describing the jobs that the manifest deploys. Within these snippets, you can use special expressions to include property values that are otherwise not known ahead of time, such as configurable properties or system properties:
* Double-parentheses expressions designate property values that Ops Manager fills in when it generates the deployment manifest, after the user clicks **Apply Changes**. These values include configurable properties and properties supplied by Ops Manager.
* Triple-parentheses expressions designate property values that BOSH supplies when it deploys instances of the tile service, such as CredHub credentials.
### <a id='property-refs'></a>Referencing Properties
Evaluating a property can be represented by piecing two segments together:
* The location of the property
* What information from the property you are looking to access, or _accessors_
Together, the double-parentheses expression can be written as:
````
(( LOCATION_OF_PROPERTY.ACCESSOR ))
```
The method of referencing the location of the property varies. Here is a complete list of ways to reference a property with some help text to indicate the situation.
<table class="nice"><tr>
<td>.properties.top_level_property</td>
<td>Refers to the property blueprint whose name is "top_level_property" found in the global list of properties of the same product
</tr><tr>
<td>.job_one.job_level_property</td>
<td>Refers to the property blueprint whose name is "job_level_property" found in the list of properties of the job "job_one" of the same product</td>
</tr><tr>
<td>job_level_property</td>
<td>Refers to the property blueprint whose name is "top_level_property" found in the same product and job whose manifest is currently being evaluated</td>
</tr><tr>
<td>..other_product.properties.top_level_property</td>
<td>Refers to the property blueprint whose name is "top_level_property" found in the global list of properties of the product "other_product"</td>
</tr><tr>
<td>..other_product.job_two.job_level_property</td>
<td>Refers to the property blueprint whose name is "job_level_property" found in the list of properties of the job "job_one" of the product "other_product"</td>
</tr>
</table>
Accessors vary between property blueprint types. See the [Property Blueprint Reference](#property-blueprints) for available properties and their accessors.
The following example uses the property blueprint type `string` with its one accessor, `value`. A valid double-parentheses expression to access the value of this property (assuming it is top-level, and has the name `example-string`) would look like:
```
(( .properties.example-string.value ))
```
Ops Manager allows empty arrays in double-parentheses expressions. For example:
```
(( .properties.example-string.value || [] ))
```
### <a id='dollar'></a>Dollar Contexts
Outside of properties, you can also retrieve information about various configuration details of your product and Ops Manager.
* $ops\_manager: used by any product to obtain information about specific OpsManager
* $director: used by any product to obtain information about the Director
* $self: used by your own product to obtain information about your product's configuration
#### $ops\_manager
<table class="nice"><tr>
<td>ca_certificate</td>
<td>Provides the root CA cert that is used to sign the Director VM</td>
</tr><tr>
<td>trusted_certificates</td>
<td>Provides a list of certificates that are applied by the Director to all VMs</td>
</tr><tr>
<td>http_proxy</td>
<td>Provides the comma separated values that are entered if Ops Manager traffic is directed to an HTTP Proxy</td>
</tr><tr>
<td>https_proxy</td>
<td>Provides the comma separated values that are entered if Ops Manager traffic is directed to an HTTPS Proxy</td>
</tr><tr>
<td>no_proxy</td>
<td>Provides the comma separated values that should not go through a proxy</td></tr>
</tr>
</table>
#### $director
<table class="nice"><tr>
<td>deployment_ip</td>
<td>Provides the IP address that the BOSH Director is deployed on</td>
</tr><tr>
<td>username</td>
<td>Provides the username for the Director VM</td>
</tr>
<tr>
<td>password</td><td>Provides the password for the Director VM</td>
</tr>
<tr>
<td>ntp_servers</td><td>Provides a list of ntp servers that are deployed by the Director</td>
</tr>
<tr>
<td>ca_public_key</td>
<td>Provides the public key that is used to sign the Director VM</td>
</tr>
<tr>
<td>hostname</td>
<td>Provides the hostname for the Director VM</td>
</tr>
<tr>
<td>tld</td>
<td>Returns the string <code>bosh</code> as the top-level domain (TLD) of the BOSH Director</td>
</tr>
<tr>
<td>bosh_metrics_forwarder_client_name</td>
<td>Provides the BOSH Metrics Forwarder client name</td>
</tr>
<tr>
<td>bosh_metrics_forwarder_client_secret</td>
<td>Provides the BOSH Metrics Forwarder client secret</td>
</tr>
<tr>
<td>dns_release_present</td>
<td>Exposes the Director configuration for <code>disable_dns_release</code></td>
</tr>
</table>
<p class="note"><strong>Note</strong>: Support for the <code>$director.username</code> and <code>$director.password</code> accessors will be removed in future versions of Ops Manager.</p>
#### $self
<table class="nice"><tr>
<td>uaa_client_name</td>
<td>Provides the UAA client name created for your Product to communicate with the BOSH Director</td>
</tr><tr>
<td>uaa_client_secret</td>
<td>Provides the UAA client secret created for your Product to communicate with the BOSH Director</td>
</tr><tr>
<td>service_network</td>
<td>Provides the name of the service network that has been assigned to your product</td>
</tr><tr>
<td>stemcell_version</td>
<td>Provides the stemcell version that is being used by your product</td>
</tr>
</table>
### <a id='property-blueprints'></a>Property Blueprint Reference
#### string
Holds a single string value
Accessors:
<table class="nice"><tr>
<td>value</td>
<td>Returns the string value</td>
</tr>
</table>
Product template example:
```
- name: example_string
type: string
configurable: true
default: 'Hello world'
constraints:
- must_match_regex: '\A[^!@#$%^&*()]*\z'
error_message: 'This name cannot contain special characters.'
- must_match_regex: '\A[^0-9]*\z'
error_message: 'This name cannot contain digits.'
```
#### boolean
Holds a single boolean value
Accessors:
<table class="nice"><tr>
<td>value</td>
<td>Returns the boolean value</td>
</tr>
</table>
Example:
```
- name: example_boolean
type: boolean
configurable: true
default: false
```
#### collection
Collections represent the ability to hold multi-property entries. Each "record" will contain values for the configured set of property blueprints.
Accessors:
<table class="nice"><tr>
<td>value</td>
<td>An array of hashes whose key are the property name.<br>
Example: <code>[{album: 'my-album', artist: 'some-artist', explicit: true, genre: 'rock'}]</code></td>
</tr>
</table>
Example:
```
- name: example_collection
type: collection
configurable: true
property_blueprints:
- name: album
type: string
freeze_on_deploy: true
- name: artist
type: string
freeze_on_deploy: true
- name: explicit
type: boolean
- name: genre
type: dropdown_select
configurable: true
optional: true
options:
- name: rock
label: 'Rock'
- name: country
label: 'Country'
- name: edm
label: 'Beep Boop PSH'
default:
- album: Christmas Carols
artist: Ops Manatee
explicit: true
genre: edm
```
#### <a id='selector'></a>Selector
Provides the ability to switch between groups of properties.
Selectors are unique in the way that property information is accessed. Ops Manager provides accessors available at the top-level selector property, accessors for retrieving a specific property in an option group, and the ability to provide manifest snippets for a selector option group.
Each selector group may provide manifest snippets. This is because Ops Manager does not support conditionally adding manifest snippets. Therefore, it's difficult to be able to write manifest sections for a selector. A manifest snippet should be present within all option groups, and can
Accessors on Selector Property:
<table class="nice"><tr>
<td>value</td>
<td>Returns a string of the currently selected option group. Example: "Filet Mignon"
</tr><tr>
<td>selected_option</td>
<td>Scopes the accessor to the currently selected option group. <br>
Does not return meaningful information alone. Must be chained with an accessor available to a Selector Option Group.</td>
</tr><tr>
<td>SPECIFIC_SELECTOR_OPTION_GROUP</td>
<td>Scopes the accessor to a specific selector option group. <br>
Does not return meaningful information alone. Must be followed with the name and accessor of a specific property in the option group.</td>
</tr>
</table>
Example, `value`:
`.properties.example_selector.filet_mignon_option.review.value`
Accessors on Selector Option Group:
<table class="nice"><tr>
<td>parsed_manifest(manifest_snippet_name)</td>
<td>Returns a hash of the specific manifest snippet</td>
</tr>
</table>
Example, `selected_option`:
`.properties.example_selector.selected_option.parsed_manifest(my_snippet)`
Here, `my_snippet` corresponds to the name of an entry within each option\_template's named\_manifests section.
Example, option group:
```
- name: example_selector
type: selector
configurable: true
default: Pizza
freeze_on_deploy: true
option_templates:
- name: pizza_option
select_value: Pizza
named_manifests:
- name: my_snippet
manifest: |
pizza_toppings:
pepperoni: (( .properties.example_selector.pizza_option.pepperoni.value ))
pineapple: (( .properties.example_selector.pizza_option.pineapple.value ))
other: (( .properties.example_selector.pizza_option.other_toppings.value ))
property_blueprints:
- name: pepperoni
type: boolean
configurable: true
freeze_on_deploy: true
- name: other_toppings
type: string
configurable: true
optional: true
constraints:
- must_match_regex: '\A[^!@#$%^&*()]*\z'
error_message: 'This name cannot contain special characters.'
- name: filet_mignon_option
select_value: Filet Mignon
named_manifests:
- name: my_snippet
manifest: |
rarity: (( .properties.example_selector.filet_mignon_option.rarity_dropdown.value ))
review: (( .properties.example_selector.filet_mignon_option.review.value ))
secret_sauce: (( .properties.example_selector.filet_mignon_option.secret_sauce.value ))
property_blueprints:
- name: rarity_dropdown
type: dropdown_select
configurable: true
default: rare
options:
- name: rare
label: 'Rare'
- name: medium
label: 'Medium'
- name: well-done
label: 'Well done'
- name: secret_sauce
type: secret
configurable: true
optional: true
```
#### ldap\_url
Ensures the inputted string matches a URL of the LDAP protocol
Accessors:
<table class="nice"><tr>
<td>value</td>
<td>Returns a string</td>
</tr>
</table>
Example:
```
- name: example_ldap_url
type: ldap_url
configurable: true
default: 'ldap://example.com'
```
#### domain
Ensures the string value is a domain
Accessors:
<table class="nice"><tr>
<td>value</td>
<td>Returns a string</td>
</tr>
</table>
Example:
```
- name: example_domain
type: domain
configurable: true
default: 'example.com'
```
#### wildcard\_domain
Ensures the string value is a domain prefixed with "*."
Accessors:
<table class="nice"><tr>
<td>value</td>
<td>Returns a string</td>
</tr><tr>
<td>to_wildcard</td>
<td>Returns a string of the value prefixed with “*.” if not present</td>
</tr>
</table>
Example:
```
- name: example_wildcard_domain
type: wildcard_domain
configurable: true
default: '*.example.com'
```
#### ip\_ranges
Holds an array of strings and ensure the values are IP ranges
Accessors:
<table class="nice"><tr>
<td>value</td>
<td>Returns a string containing a comma-separated list of IP ranges</td>
</tr><tr>
<td>parsed_ip_ranges</td>
<td>Returns an array of strings for each IP range</td>
</tr>
</table>
Example:
```
- name: example_ip_ranges
type: ip_ranges
configurable: true
default: '1.1.1.1-1.1.14,2.2.2.1-2.2.2.4'
```
#### ip\_address
Ensures the string value is an IP address
Accessors:
<table class="nice"><tr>
<td>value</td>
<td>Returns a string</td>
</tr>
</table>
Example:
```
- name: example_ip_address
type: ip_address
configurable: true
default: '192.168.0.1'
```
#### email
Ensures the string value is formatted as an email address
Accessors:
<table class="nice"><tr>
<td>value</td>
<td>Returns a string</td>
</tr>
</table>
Example:
```
- name: example_string
type: email
configurable: true
default: '[email protected]'
```
#### port
Holds a single integer value
Accessors:
<table class="nice"><tr>
<td>value</td>
<td>Returns an integer</td>
</tr>
</table>
Example:
```
- name: example_port
type: port
configurable: true
default: 3000
```
#### integer
Holds a single integer value
Accessors:
<table class="nice"><tr>
<td>value</td>
<td>Returns an integer</td>
</tr>
</table>
Example:
```
- name: example_integer
type: integer
configurable: true
default: 100
```
#### text
Holds a single string value
Accessors:
<table class="nice"><tr>
<td>value</td>
<td>Returns a string</td>
</tr>
</table>
Example:
```
- name: example_text
type: text
configurable: true
default: |
Example
Text
```
#### smtp\_authentication
Holds string with a possible value of plain, login, or cram_md5
Accessors:
<table class="nice"><tr>
<td>value</td>
<td>Returns a string with possible value of <code>plain</code>, <code>login</code>, <code>cram_md5</code></td>
</tr>
</table>
Example:
```
- name: example_smtp_authentication
type: smtp_authentication
configurable: true
default: plain
```
#### network\_name
Ensure the string is a network name
Accessors:
<table class="nice"><tr>
<td>value</td>
<td>Returns a string</td>
</tr>
</table>
Example:
```
- name: example_network_name
type: network_name
configurable: true
default: 'ExampleNetwork'
```
#### network\_address
Ensure the string is a network address
Accessors:
<table class="nice"><tr>
<td>value</td>
<td>Returns a string</td>
</tr>
</table>
Example:
```
- name: example_network_address
type: network_address
configurable: true
default: 'localhost'
```
#### network\_address\_list
Holds an array of new addresses
Accessors:
<table class="nice"><tr>
<td>value</td>
<td>Returns a string containing a comma separated list of network addresses</td>
</tr><tr>
<td>parsed_network_addresses</td>
<td>Returns an array of strings for each network address</td>
</tr>
</table>
Example:
```
- name: example_network_address_list
type: network_address_list
configurable: true
default: 'localhost,1.1.1.1'
```
#### string\_list
Holds an array of strings
Accessors:
<table class="nice"><tr>
<td>value</td>
<td>Returns a string</td>
</tr><tr>
<td>parsed_strings</td>
<td>Returns an array of strings for each string entry</td>
</tr><tr>
<td>parsed_regex</td>
<td>Returns a string containing a regex of the format “^(string1|string2|string3)$” where the value of this property is“string1,string2,string3”</td>
</tr>
</table>
Example:
```
- name: example_string_list
type: string_list
configurable: true
default: 'foo,bar,baz'
```
#### ca\_certificate
Holds a string value
Accessors:
<table class="nice"><tr>
<td>value</td>
<td>Returns a string</td>
</tr>
</table>
Example:
```
- name: example_ca_certificate
type: ca-certificate
configurable: true
default: |
-- BEGIN FAKE CERT --
-- END FAKE CERT --
```
#### multi\_select\_options
Holds an array of selected string values
Accessors:
<table class="nice"><tr>
<td>value</td>
<td>Returns an array of strings for the selected options</td>
</tr>
</table>
Example:
```
- name: example_multi_select_options
type: multi_select_options
configurable: true
default: ['earth', 'mercury']
options:
- name: mercury
label: 'label for mercury'
- name: venus
label: 'label for venus'
- name: earth
label: 'label for earth'
```
#### dropdown\_select
Holds an array of strings selected string values
Accessors:
<table class="nice"><tr>
<td>value</td>
<td>Returns a string</td>
</tr>
</table>
Example:
```
- name: example_dropdown
type: dropdown_select
configurable: true
default: kiwi
options:
- name: kiwi
label: 'label for kiwi'
- name: lime
label: 'label for lime'
- name: avocado
label: 'label for avocado'
```
#### vm\_type\_dropdown
Holds single string value selected from allowed vm_types
Accessors:
<table class="nice"><tr>
<td>value</td>
<td>Returns a string</td>
</tr>
</table>
Example:
```
- name: example_vm_type_dropdown
type: vm_type_dropdown
configurable: true
```
#### disk\_type\_dropdown
Holds single string value selected from allowed disk_types
Accessors:
<table class="nice"><tr>
<td>value</td>
<td>Returns a string</td>
</tr>
</table>
Example:
```
- name: example_disk_type_dropdown
type: disk_type_dropdown
configurable: true
```
#### uuid
Holds a string uuid value
Accessors:
<table class="nice"><tr>
<td>value</td>
<td>Returns a string</td>
</tr>
</table>
Example:
```
- name: example_uuid
type: uuid
configurable: true
```
#### service\_network\_az\_multi\_select
Holds an arrays of string value selected from allowed azs
Accessors:
<table class="nice"><tr>
<td>value</td>
<td>Returns an array of strings for the selected options</td>
</tr>
</table>
Example:
```
- name: example_service_network_az_multi_select
type: service_network_az_multi_select
configurable: true
```
#### service\_network\_az\_single\_select
Holds a single string value selected from allowed azs
Accessors:
<table class="nice"><tr>
<td>value</td>
<td>Returns a string</td>
</tr>
</table>
Example:
```
- name: example_service_network_az_single_select
type: service_network_az_single_select
configurable: true
```
#### secret
Holds a single string value
Accessors:
<table class="nice"><tr>
<td>value</td>
<td>Returns a string</td>
</tr>
</table>
Example:
```
- name: example_secret
type: secret
configurable: true
```