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 064A6200C80 for ; Thu, 25 May 2017 19:49:14 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 04CF0160BCA; Thu, 25 May 2017 17:49:14 +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 F158C160BB4 for ; Thu, 25 May 2017 19:49:12 +0200 (CEST) Received: (qmail 13790 invoked by uid 500); 25 May 2017 17:49:12 -0000 Mailing-List: contact dev-help@ariatosca.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ariatosca.incubator.apache.org Delivered-To: mailing list dev@ariatosca.incubator.apache.org Received: (qmail 13778 invoked by uid 99); 25 May 2017 17:49:11 -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; Thu, 25 May 2017 17:49:11 +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 687ADC059A for ; Thu, 25 May 2017 17:49:11 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.385 X-Spam-Level: X-Spam-Status: No, score=-0.385 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-2.796, RCVD_IN_SORBS_SPAM=0.5, T_REMOTE_IMAGE=0.01, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gigaspaces.com 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 5phzmQp9mRXj for ; Thu, 25 May 2017 17:49:07 +0000 (UTC) Received: from mail-io0-f176.google.com (mail-io0-f176.google.com [209.85.223.176]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 55A195FD7D for ; Thu, 25 May 2017 17:49:07 +0000 (UTC) Received: by mail-io0-f176.google.com with SMTP id f102so140510275ioi.2 for ; Thu, 25 May 2017 10:49:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gigaspaces.com; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=rb3xP5eAThG/pyBDgBo75NUI5I6pUAZqw9Xy9iPs1kM=; b=CAGlMXKpAcRy36Ym3mO1WJf1G03yJVTTKmNtsopwECknCIY53bbTz5HR123301mJx/ ijcSFLoVZDsmBXOzSlMvqnDbf3kSxdZQhtALloTSrJiSST9Agq+xK9S8ygVe6MQ0cfjE KuXegUUIip99w+XhMTZlkx4hsxBeIbo2K72k82PCjvlBC96lAkpwN2jk7QQJoSvTYGIZ jH147RUdiv1aMC8tZYrjokYmtpXb65GQ7z9WoxmfYLuSAenO4CvnU9xuzsHzOYdln2uX XC+dcLkzmfbXnb5k33jxnGDqA3GgA5EzXDytI2MTwXxjPyYj4wGP8+CIL3c+ha98bGJm 8TKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=rb3xP5eAThG/pyBDgBo75NUI5I6pUAZqw9Xy9iPs1kM=; b=VeD3KBmFL8MVyP9pLid+tR4ixxfmNkCbs1FOGEgjE7calzYOOjiI/rkq/6qc3RFZkr mIa/pHFzjkBjkRZ0xuf/a35IR+G4OjQ+KTwaQv8KTBU9JZ1XnclSj3Avxk8Jtjg+cByN 9csVqNMpx4NhgvmdNKn1Dkj3zKdquyQfQBKrjIQZis0LAUeDI/YrwY1ANLlYgUptfmPR AKUj4aGkEcRR2qRkB8BkiDMS2pZ+zHNIq8NzEsWu15qSQUQ/AFXpqJqBpFOPTaLq5jnh eWCOsk9fUPzA/Unp5R+jdf6lwhsByrappPL9FB0JXYIkSNXVFoVtQQkzbYWlyDXVzakH bp2w== X-Gm-Message-State: AODbwcBFKqAaq4wSwivKgi2EaA3LBJjqWhvWgkUPK+NaP3xY6bxfUyU1 Nlj/NN4oXb9xxkSaniJFCkDCsDMDQ3Dn X-Received: by 10.107.136.204 with SMTP id s73mr37108352ioi.224.1495734541429; Thu, 25 May 2017 10:49:01 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.15.231 with HTTP; Thu, 25 May 2017 10:48:40 -0700 (PDT) In-Reply-To: References: From: Tal Liron Date: Thu, 25 May 2017 12:48:41 -0500 Message-ID: Subject: Re: Query on operation inputs To: dev@ariatosca.incubator.apache.org Content-Type: multipart/alternative; boundary="001a113ece4a056e5a05505cd60b" archived-at: Thu, 25 May 2017 17:49:14 -0000 --001a113ece4a056e5a05505cd60b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi DJ, let's try to look at these issues one at a time. I got your YAML to parse OK, but had to change it around a bit... it would help if you used a complete example here, and also if it would be much shorter to demonstrate the specific issue you are asking about. There's a lot going on in this example and you are asking a few different questions. The error message you are getting is not about operation inputs, but about topology template inputs. I can't help much here unless I see those input definitions: they do not appear in your YAML fragment. In general, see section 3.8.2.1 in the TOSCA spec. Values for topology template inputs must come from an external source, and indeed in this case you are providing them via the CLI. ARIA makes sure that all required topology template inputs have a value, and that it is a valid value for the type. So, that's the error you are seeing. The inputs we *do* see in your YAML fragment are input definitions at the node type and input assignments at the node template. These work differently from topology template inputs, because their values do not come from an external source directly (though this can be indirect via get_input and other intrinsic functions). According to the spec you quote (3.5.8.2) , the key "required" is optional in YAML, meaning that you do not have to specify it. Its default value is "true". So, unless you specify "required: false", that property is required. So actually all your "required" true" lines are redundant (informative, but don't change functionality). So, let's look at your "isService" input. At the node type, it is defined as required: false. And indeed, if at the node template I don't assign a value to it, ARIA has no problem. However, if you do not assign a value to a required input, say "image", then ARIA would be unhappy. I hope this is clear, though I have a feeling you are asking about something else which I'm not quite understanding. Again, a shorter and complete example would help demonstrate what you mean. On Thu, May 25, 2017 at 9:56 AM, D Jayachandran wrote: > Hi Ran, > > When I refer the TOSCA spec, it says > > " An optional key that declares a property as required (true) or not > (false)." > property_required: represents an optional boolean value (true or false) > indicating whether or not the property is required. If this keyname is n= ot > present on a property definition, then the property SHALL be considered > required (i.e., true) by default. > > It is not clear to whom this property is required or not ? > > With your argument, it seems we always need to provide a default value to > an input, when we don=E2=80=99t declare in my service template. Is my und= erstanding > correct here ? > But the TOSCA spec says the default value is always an optional one. Also > since the parser validates the service template inputs according to the > "required" field am not sure why we need another validation during the > execution ? > > I also don=E2=80=99t find any reference in TOSCA spec which says, all inp= uts > defined in node type be declared in node template to be used by any > operation. Could you please help me with that reference in TOSCA spec ? > > > Regards, > DJ > > -----Original Message----- > From: Ran Ziv [mailto:ran@gigaspaces.com] > Sent: Thursday, May 25, 2017 5:16 PM > To: dev@ariatosca.incubator.apache.org > Subject: Re: Query on operation inputs > > Yes, I understand the confusion here. The issue is that, despite its name= , > the "required" field isn't what defines whether an input is optional or n= ot > - it is only relevant during the parsing phase (This is according to our > understanding of the TOSCA spec. Tal could probably expand more on this). > What's relevant for deciding whether an input is required or not for > actual execution is whether it has a default value - so all inputs would > have a value when the actual execution takes place. > > I hope this helps clearing this confusing issue.. > > Ran > > On Thu, May 25, 2017 at 2:08 PM, D Jayachandran < > d.jayachandran@ericsson.com > > wrote: > > > Hi Ran, > > > > Thanks for your response. > > > > In my case, I have defined the inputs as optional under the create > > operation of my custom node type. > > Since it is an optional input, I haven't declared it in my node-templat= e. > > I assume optional input may or may not be declared in a service templat= e > ? > > Am I missing something here ? > > > > Please find below the node type and node template in my case. > > > > # python /root/incubator-ariatosca/aria/cli/main.py executions start > > -s > > demo-sr-1 install > > Required inputs [u'labels'] have not been specified - expected inputs: > > [u'isService', u'name', u'exposed_port', u'image', u'labels', > > u'target_port', u'target_host'] > > > > Node-type > > > > node_types: > > test.nodes.Container.Application: > > derived_from: tosca.nodes.Root > > properties: > > name: > > type: string > > required: true > > image: > > type: string > > required: true > > port: > > type: integer > > required: false > > interfaces: > > Standard: > > type: tosca.interfaces.node.lifecycle.Standard > > create: > > inputs: > > name: > > type: string > > required: true > > image: > > type: string > > required: true > > exposed_port: > > type: integer > > required: false > > target_port: > > type: integer > > required: false > > target_host: > > type: integer > > required: false > > labels: > > type: string > > required: false > > isService: > > type: boolean > > required: false > > implementation: > > primary: sample > sample.samplemethod > > > > Node template: > > > > web_app: > > type: test.nodes.Container.Application > > properties: > > name: { get_input: web_app_name } > > image: { get_input: web_app_image } > > port: { get_input: web_app_port } > > requirements: > > - dependency: > > node: database > > relationship: > > type: tosca.relationships.DependsOn > > interfaces: > > Standard: > > create: > > inputs: > > name: { get_input: web_app_name } > > image: { get_property: [ web_app, image] } > > exposed_port: { get_property: [ web_app, > > port] } > > target_host: { get_property: [ database, > > name] } > > target_port: { get_property: [ database, > > port] } > > isService: true > > > > Regards, > > DJ > > > > -----Original Message----- > > From: Ran Ziv [mailto:ran@gigaspaces.com] > > Sent: Thursday, May 25, 2017 4:07 PM > > To: dev@ariatosca.incubator.apache.org > > Subject: Re: Query on operation inputs > > > > Hi, > > > > Weird, I remember responding to this mail before, but it doesn't seem > > like I have. > > In any case, it is indeed our intention that no inputs may be passed > > into operations unless they have been clearly declared in the > service-template. > > ARIA opts to be a strict implementation of TOSCA wherever possible. > > > > Ran > > > > On Thu, May 25, 2017 at 1:22 PM, D Jayachandran < > > d.jayachandran@ericsson.com > > > wrote: > > > > > Hi, > > > > > > The latest Apache-aria is throwing a validation error during the > > > execution of a service. > > > It demands all the operation inputs defined in a node type be > > > declared in the service template though they are optional inputs. > > > Could you please let us know if this change was intentional ? > > > > > > > > > Regards, > > > DJ(D Jayachandran) > > > > > > --=20 Tal Liron Senior Engineer tal@gigaspaces.com | +1 (773) 828-9339 Cloudify | http://getcloudify.org [image: Azure Webinar] --001a113ece4a056e5a05505cd60b--