Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 1594C200C1A for ; Mon, 13 Feb 2017 15:24:46 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 142E6160B60; Mon, 13 Feb 2017 14:24:46 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 5F363160B4D for ; Mon, 13 Feb 2017 15:24:45 +0100 (CET) Received: (qmail 19304 invoked by uid 500); 13 Feb 2017 14:24:44 -0000 Mailing-List: contact dev-help@brooklyn.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@brooklyn.apache.org Delivered-To: mailing list dev@brooklyn.apache.org Received: (qmail 19293 invoked by uid 99); 13 Feb 2017 14:24:44 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Feb 2017 14:24:44 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 30A48C0E29 for ; Mon, 13 Feb 2017 14:24:44 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -1.199 X-Spam-Level: X-Spam-Status: No, score=-1.199 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-2.999] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id v1RN88Nz_F2Q for ; Mon, 13 Feb 2017 14:24:43 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 03B815F29A for ; Mon, 13 Feb 2017 14:24:42 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id EBAACE023B for ; Mon, 13 Feb 2017 14:24:41 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id A175421D64 for ; Mon, 13 Feb 2017 14:24:41 +0000 (UTC) Date: Mon, 13 Feb 2017 14:24:41 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: dev@brooklyn.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (BROOKLYN-433) YAML-based config constraint to support regex MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 13 Feb 2017 14:24:46 -0000 [ https://issues.apache.org/jira/browse/BROOKLYN-433?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15863746#comment-15863746 ] ASF GitHub Bot commented on BROOKLYN-433: ----------------------------------------- Github user aledsage commented on the issue: https://github.com/apache/brooklyn-server/pull/558 @tbouron It's validated server-side. Longer term, we should improve the validation errors + warnings that the server-side sends back, along with the info needed for content-assist. That's a bigger topic! @bostko thanks for comments - addressed, rebased and pushed. Once jenkins build completes again, I'll merge it. > 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)