[
https://issues.apache.org/jira/browse/BROOKLYN-433?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15863457#comment-15863457
]
ASF GitHub Bot commented on BROOKLYN-433:
-----------------------------------------
GitHub user aledsage opened a pull request:
https://github.com/apache/brooklyn-server/pull/558
BROOKLYN-433: regex/obj config key constraint in yaml
Docs PR will follow, to update the constraints section in
https://github.com/apache/brooklyn-docs/blob/master/guide/yaml/yaml-reference.md
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/aledsage/brooklyn-server BROOKLYN-433
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/brooklyn-server/pull/558.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #558
----
commit 0e69d27b96c64765e518b7d0b665f06860a2711e
Author: Aled Sage <[email protected]>
Date: 2017-02-03T13:30:09Z
BROOKLYN-433: regex/obj config key constraint in yaml
----
> YAML-based config constraint to support regex
> ---------------------------------------------
>
> Key: BROOKLYN-433
> URL: https://issues.apache.org/jira/browse/BROOKLYN-433
> Project: Brooklyn
> Issue Type: Improvement
> Affects Versions: 0.10.0
> Reporter: Aled Sage
> Assignee: Aled Sage
> Priority: Minor
>
> One can specify constraints on a config key's value, to give a validation
> error if an invalid value is supplied.
> In the Java code, this can be any predicate.
> However, in YAML we don't support many options. It would be good to support a
> regex constraint. For example:
> {noformat}
> brooklyn.parameters:
> - name: address
> type: string
> constraints:
> - required
> - regex: ^(?:[0-9]{1,3}\.){3}[0-9]{1,3}$
> {noformat}
> See docs at
> https://raw.githubusercontent.com/apache/brooklyn-docs/master/guide/yaml/yaml-reference.md,
> and code at
> https://github.com/apache/brooklyn-server/blob/master/core/src/main/java/org/apache/brooklyn/core/objs/BasicSpecParameter.java#L204-L205
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)