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 E4340200C70 for ; Thu, 4 May 2017 19:30:43 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id E163B160BC4; Thu, 4 May 2017 17:30:43 +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 0E375160B9B for ; Thu, 4 May 2017 19:30:42 +0200 (CEST) Received: (qmail 5612 invoked by uid 500); 4 May 2017 17:30:42 -0000 Mailing-List: contact users-help@nifi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@nifi.apache.org Delivered-To: mailing list users@nifi.apache.org Received: (qmail 5592 invoked by uid 99); 4 May 2017 17:30:42 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 May 2017 17:30:42 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id BF9751A7BAA; Thu, 4 May 2017 17:30:41 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.397 X-Spam-Level: X-Spam-Status: No, score=-0.397 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, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id 844_xNlE7SXr; Thu, 4 May 2017 17:30:40 +0000 (UTC) Received: from mail-qk0-f176.google.com (mail-qk0-f176.google.com [209.85.220.176]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 6AD295FC93; Thu, 4 May 2017 17:30:40 +0000 (UTC) Received: by mail-qk0-f176.google.com with SMTP id n4so16953173qkc.0; Thu, 04 May 2017 10:30:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=HQ/AzzGIHXMehhD2XqfZyKteJAKkTKgJ0vAoloierXw=; b=eE5TiiIfkNjrtkjWS9ROtYaTr6s7tNvjqe8fnjztkLGO7FR5xLq7HgUVRy8IDlidIF +LTOtp5GbWfxlm5rjDsOMRUYA/NLu/+VRxuxXjtkdLUycZwcuSr2wcqsDmKijZHQI6g8 xDMGksGWYL2fcPTkN/mlPTEqDgi7omV811GU0j/NKYPdF6jgOl5hAV69JWkstp79dZIJ I7hG5tbE3XS+9ZbvQxuEaFqC68z5OPJarc+/ZePdXgY6mwPLanlZJnOecYHHWy/36avX mEcWbyndtGijmOVYaynQX3TSm5kBOZwZb51hZzejzemmlfNcyQC69Riht6074zRS2xe1 z8Ng== 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:cc; bh=HQ/AzzGIHXMehhD2XqfZyKteJAKkTKgJ0vAoloierXw=; b=snAYu4EPoVqQCv+IU69GAUZsLj1N72DEb1hgdj76k3V8aoSsMhsSRCltWWtf4jdSRU cIzUG1cGgX4FLYo6xuQ08pexGKZ2TONj16uXdmo5wRgO+U6T8Yb/HhacZhxZ361ryYh4 7bsHb2OBC3wnmbWyHDXCoezNE1nIF6MupVvD2DHnUFnOayieHMhOLuMRC4yw3l9sUStC NiZFyIpMccUOvCKc/C0UthKzBcuZWI8pftf+MBMEMQuXI3HZYNo61P2kFYdUle+upRL5 ZXzt6iA/Mta0l7+LL+oNcoeBFzyTg3Ml/bP7lsO01khHAoX5UlfIfrcVFh65CQmay9no qpFA== X-Gm-Message-State: AODbwcAtUmOZNwtG+PtYLlmG5yy28c+An7V6YyzTXMOwqesnj/igA5YW F0JqudZTvnggg4RWnlWnXhXmcVFdHjqf X-Received: by 10.55.141.130 with SMTP id p124mr8468647qkd.299.1493919039995; Thu, 04 May 2017 10:30:39 -0700 (PDT) MIME-Version: 1.0 Received: by 10.55.22.35 with HTTP; Thu, 4 May 2017 10:30:39 -0700 (PDT) In-Reply-To: References: From: Matt Gilman Date: Thu, 4 May 2017 13:30:39 -0400 Message-ID: Subject: Re: Issues with creating and connecting RPG programmatically To: users@nifi.apache.org Cc: dev@nifi.apache.org Content-Type: multipart/alternative; boundary=94eb2c085390b3c3f2054eb62160 archived-at: Thu, 04 May 2017 17:30:44 -0000 --94eb2c085390b3c3f2054eb62160 Content-Type: text/plain; charset=UTF-8 I've responded to the question on StackOverflow [1]. Thanks Matt [1] http://stackoverflow.com/questions/43788780/nifi-issues-with-creating-and-connecting-rpg-programmatically/43789310#43789310 On Thu, May 4, 2017 at 12:49 PM, Pushkara R wrote: > Hi, > > I am trying to write a function that takes two parameters, a processor ID > in machine A and an input port in machine B and creates an RPG in machine B > which connects the above to. > > Now, how I am doing that is > 1. A POST to the > */nifi-api/process-groups//remote-process-groups* > endpoint to create an RPG and retrieve the ID of that RPG > 2. A POST to the */nifi-api/process-groups//connections > *endpoint to create a connection between the processor and the input > port. the processorID and the ID of the input port are being provided along > with the list of the relationships. > 3. A final PUT to */nifi-api/remote-process-groups/ *to enable the > transmission between the machines*.* > > Now, the function always throws errors in step 2. A 409 is thrown for the > POST request with the error being 'Unable to find specified destination'. > (though refreshing the canvas on machine 1 shows the rpg having been > created) > However, when I manually run the steps 2 and 3 afterwards, with the same > rpgid, the connection happens. > > Now, I'm not sure if this is a synchronization issue or not, but I want to > figure it out because I would not want to separate out steps 1 2 and 3. > Could somebody point out what could be the issue here? > > Pushkar > > PS - the post messages for steps 2 are the same when the api is called > from within the function and manually. > --94eb2c085390b3c3f2054eb62160 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I've responded to the question on StackOverflow [1].
Thanks

Matt

=

On Thu, May 4, 2017 at 12:4= 9 PM, Pushkara R <pushkar1593@gmail.com> wrote:
Hi,

I am tryi= ng to write a function that takes two parameters, a processor ID in machine= A and an input port in machine B and creates an RPG in machine B which con= nects the above to.

Now, how I am doing that is
1. A POST to the /nifi-api/process-groups/<rootprocessgr= oupid>/remote-process-groups endpoint to create an RPG and retr= ieve the ID of that RPG
2. A POST to the /nifi-api/process-gro= ups/<rootprocessgroupid>/connections endpoint to create= a connection between the processor and the input port. the processorID and= the ID of the input port are being provided along with the list of the rel= ationships.
3. A final PUT to /nifi-api/remote-process-gr= oups/<rpgid> to enable the transmission between the machines.<= /i>

Now, the function always throws errors = in step 2. A 409 is thrown for the POST request with the error being 'U= nable to find specified destination'. (though refreshing the canvas on = machine 1 shows the rpg having been created)
However, when I manu= ally run the steps 2 and 3 afterwards, with the same rpgid, the connection = happens.

Now, I'm not sure if this is a synchr= onization issue or not, but I want to figure it out because I would not wan= t to separate out steps 1 2 and 3. Could somebody point out what could be t= he issue here?

Pushkar

PS= - the post messages for steps 2 are the same when the api is called from w= ithin the function and manually.

--94eb2c085390b3c3f2054eb62160--