Property Reference

This topic explains how PCF Tiles describe properties.

Double-Paren Expressions

A tile’s configuration interface is defined in a .yml file in the tile’s metadata subdirectory. Within a .yml file, you can use double parentheses to enclose deployment manifest snippets, and Ops Manager will pass these snippets to BOSH, to incorporate into the manifest that BOSH uses to deploy instances of the tile service. These double-paren expressions are how Ops Manager sends tile configuration information to BOSH, and how you should write these expressions depends on what type of information you want to retrieve.

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 (otherwise known as accessors)

Together, the double paren 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.

.properties.top_level_property Refers to the property blueprint whose name is “top_level_property” found in the global list of properties of the same product
.job_one.job_level_property 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
job_level_property Refers to the property blueprint whose name is “top_level_property” found in the same product and job whose manifest is currently being evaluated
..other_product.properties.top_level_property Refers to the property blueprint whose name is “top_level_property” found in the global list of properties of the product “other_product”
..other_product.job_two.job_level_property 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”

Accessors vary between property blueprint types. See the Property Blueprint Reference for available properties and their accessors.

The following example uses the property blueprint type string with its one accessor, value. A valid double-paren 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 ))

Dollar Contexts

Outside of properties, you can also retrieve information about various configuration details of your product and Ops Manager.

  • $opsmanager: 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

$opsmanager

ca_certificate Provides the root CA cert that is used to sign the Director VM
trusted_certificates Provides a list of certs that are applied by the Director to all VMs
http_proxy Provides the comma separated values that are entered if OpsManager traffic is directed to an HTTP Proxy
https_proxy Provides the comma separated values that are entered if OpsManager traffic is directed to an HTTPS Proxy
no_proxy Provides a the comma separated values that should not go through a proxy.

$director

deployment_ip Provides the IP address that the BOSH Director is deployed on
username Provides the username for the Director VM
passwordProvides the password for the Director VM
ntp_serversProvides a list of ntp servers that are deployed by the Director
ca_public_key Provides the public key that is used to sign the Director VM?

$self

uaa_client_name Provides the UAA client name created for your Product to communicate with the BOSH Director
uaa_client_secret Provides the UAA client secret created for your Product to communicate with the BOSH Director
service_network Provides the name of the service network that has been assigned to your product
stemcell_version Provides the stemcell version that is being used by your product

Property Blueprint Reference

string

Holds a single string value

Accessors

value Returns the string value

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

value Returns the boolean value

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

value An array of hashes whose key are the property name.
Example: [{album: ‘my-album’, artist: ‘some-artist’, explicit: true, genre: ‘rock’}]

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

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

value Returns a string of the currently selected option group. Example: “Filet Mignon”
selected_option Scopes the accessor to the currently selected option group.
Does not return meaningful information alone. Must be chained with an accessor available to a Selector Option Group.
SPECIFIC_SELECTOR_OPTION_GROUP Scopes the accessor to a specific selector option group.
Does not return meaningful information alone. Must be followed with the name and accessor of a specific property in the option group.

Example, value:

.properties.example_selector.filet_mignon_option.review.value

Accessors on Selector Option Group

parsed_manifest(manifest_snippet_name) Returns a hash of the specific manifest snippet

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

value Returns a string

Example

- name: example_ldap_url
  type: ldap_url
  configurable: true
  default: ‘ldap://example.com’

domain

Ensures the string value is a domain

Accessors

value Returns a string

Example

- name: example_domain
  type: domain
  configurable: true
  default: ’example.com’

wildcard_domain

Holds a single boolean value

Accessors

value Returns a string
to_wildcard Returns a string of the value prefixed with “*.” if not present

Example

- name: example_wildcard_domain
  type: wildcard_domain
  configurable: true
  default: ‘*.example.com’

ip_ranges

Holds a single boolean value

Accessors

value Returns a string containing a comma-separated list of ip ranges
parsed_ip_ranges Returns an array of strings for each ip range

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

Holds a single boolean value

Accessors

value Returns a string

Example

- name: example_ip_address
  type: ip_address
  configurable: true
  default: ‘192.168.0.1’

email

Holds a single boolean value

Accessors

value Returns a string

Example

- name: example_string
  type: email
  configurable: true
  default: ‘john@example.com’

port

Holds a single boolean value

Accessors

value Returns an integer

Example

- name: example_port
  type: port
  configurable: true
  default: 3000

integer

Holds a single boolean value

Accessors

value Returns an integer

Example

- name: example_integer
  type: integer
  configurable: true
  default: 100

text

Holds a single boolean value

Accessors

value Returns a string

Example

- name: example_text
  type: text
  configurable: true
  default: |
    Example
    Text

smtp_authentication

Holds a single boolean value

Accessors

value Returns a string (possible values: plain, login, cram_md5)

Example

- name: example_smtp_authentication
  type: smtp_authentication
  configurable: true
  default: plain

network_address

Holds a single boolean value

Accessors

value Returns a string

Example

- name: example_network_address
  type: network_address
  configurable: true
  default: ‘localhost’

network_address_list

Holds a single boolean value

Accessors

value Returns a string containing a comma separated list of network addresses
parsed_network_addresses Returns an array of strings for each network address

Example

- name: example_network_address_list
  type: network_address_list
  configurable: true
  default: ‘localhost,1.1.1.1’

string_list

Holds a single boolean value

Accessors

value Returns a string
parsed_strings Returns an array of strings for each string entry
parsed_regex Returns a string containing a regex of the format “^(string1|string2|string3)$” where the value of this property is“string1,string2,string3”

Example

- name: example_string_list
  type: string_list
  configurable: true
  default: ‘foo,bar,baz’

ca_certificate

Holds a single boolean value

Accessors

value Returns a string

Example

- name: example_ca_certificate
  type: ca-certificate
  configurable: true
  default: |
    -- BEGIN FAKE CERT --
    -- END FAKE CERT --

multi_select_options

Holds a single boolean value

Accessors

value Returns an array of strings for the selected options

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 a single boolean value

Accessors

value Returns a string

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 a single boolean value

Accessors

value Returns a string

Example

- name: example_vm_type_dropdown
  type: vm_type_dropdown
  configurable: true

disk_type_dropdown

Holds a single boolean value

Accessors

value Returns a string

Example

- name: example_disk_type_dropdown
  type: disk_type_dropdown
  configurable: true

uuid

Holds a single boolean value

Accessors

value Returns a string

Example

- name: example_uuid
  type: uuid
  configurable: true

service_network_az_multi_select

Holds a single boolean value

Accessors

value Returns a string

Example

- name: example_service_network_az_multi_select
  type: service_network_az_multi_select
  configurable: true

service_network_az_single_select

Holds a single boolean value

Accessors

value Returns a string

Example

- name: example_service_network_az_single_select
  type: service_network_az_single_select
  configurable: true

secret

Holds a single boolean value

Accessors

value Returns a string

Example

- name: example_secret
  type: secret
  configurable: true
Create a pull request or raise an issue on the source for this page in GitHub