From dev-return-112557-archive-asf-public=cust-asf.ponee.io@cloudstack.apache.org Fri Feb 22 20:35:09 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 2A707180648 for ; Fri, 22 Feb 2019 21:35:09 +0100 (CET) Received: (qmail 98808 invoked by uid 500); 22 Feb 2019 20:35:08 -0000 Mailing-List: contact dev-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list dev@cloudstack.apache.org Received: (qmail 98784 invoked by uid 99); 22 Feb 2019 20:35:07 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Feb 2019 20:35:07 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 206F71823A8 for ; Fri, 22 Feb 2019 20:35:07 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.799 X-Spam-Level: * X-Spam-Status: No, score=1.799 tagged_above=-999 required=6.31 tests=[DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd3-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 (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id q9ZhWJf5dS9c for ; Fri, 22 Feb 2019 20:35:05 +0000 (UTC) Received: from mail-io1-f66.google.com (mail-io1-f66.google.com [209.85.166.66]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 75C735FD1B for ; Fri, 22 Feb 2019 20:35:05 +0000 (UTC) Received: by mail-io1-f66.google.com with SMTP id e1so2846718iok.1 for ; Fri, 22 Feb 2019 12:35:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=4NM2MVhg06ZMyIdjzH7CxEejgakqyRJsSXDwAKSC0nQ=; b=d/vVFKJBmMqDaxijGw/GqLKKlFre+C8BETR99HhpgzdHRNTbTU8GYoAIimiCErHpPP 04V4Dl2y+JxHoD3Byngw4PcNbikRORvAoSPTGL0KrlIqeQQZ21aKdK22BY7ak/rpG1Z6 BSFr43MAVpK11i5j3LueoPt3YvpaHtO2QKm8F0GWz5pBs7bkETu17vkbTeytcKYVmJa6 BD7Pzo9z1qoloRooul1Xv4gon7mAnUMUScxilVmVoAk9QusRLAiuATawPoaJxnlJuIDv o6sg+HGQFqVguJ0JKJd/jCkLtTu9HblMg6f4t3oQ+PUnPD20yKJnKTFYIRTlKwXZ/RR5 88pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=4NM2MVhg06ZMyIdjzH7CxEejgakqyRJsSXDwAKSC0nQ=; b=fB09dO1/aUx0KjjIJDjPltFcx8i+28Q6ka0SVtpcxQrzgnF4kItrTWNJmlmF/FbVLg VGqbBnP4a0XBHRbc449Tv19xanncyufQRXxBVn1N7ECiHyVcRUtKcYrAYH7rc5iK1anp 2J5E8Qt3vuyuTreqxlrOHucCHAiNKngr86OunIoU9rubH5GfvAt5Y1G/XjL1RECNAzBb YSw2l6zmWDWDpiQn9oCaC3oJBBphBrJu7MfJOQSgjWp51H0V7zyntK2T+MP6MNNXgO1k /74MLxpYbFGHxd+gTT/FVJD/dWbgUWjJlhn5IxO5ym2lvxUJWFIRfGGbhNKWqgVjcUUk jPBw== X-Gm-Message-State: AHQUAuYpIFRL8nnBiyxTuCVIMVc1AqWV67FxjCwEy77lnucQG0bYYqQb S5gPoDmYw7FwUjiTyf4lBDXBkpycE3a9g39dKNTyFiKX X-Google-Smtp-Source: AHgI3Ib/2cG5/qmcDoCMJttCNRTeHZEvbP4TomrwdvJrlnMYtDFQS5fDgNISKGjDefy0d3rJQe3v/6GY5IvITaJIbHU= X-Received: by 2002:a5d:8b8e:: with SMTP id p14mr3567921iol.80.1550867704547; Fri, 22 Feb 2019 12:35:04 -0800 (PST) MIME-Version: 1.0 References: <9C6D89AA-E4F3-4050-AABF-24294F8CB1C5@shapeblue.com> In-Reply-To: <9C6D89AA-E4F3-4050-AABF-24294F8CB1C5@shapeblue.com> From: Alireza Eskandari Date: Sat, 23 Feb 2019 00:04:53 +0330 Message-ID: Subject: Re: hook or callback for CloudStack API To: dev@cloudstack.apache.org Content-Type: multipart/alternative; boundary="0000000000009f8f970582818661" --0000000000009f8f970582818661 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Async jobs is not my concern. Imagine that you have a firewall that is not integrated with CS and you want to insert new roles in it each time a new VM is created. In this case you need a hook that triggers an external script to configure the firewall. Pulling is time and resource consuming and its effect is not instant. On Fri, Feb 22, 2019 at 8:02 PM Anurag Awasthi wrote: > Hi Alireza, > > Could you elaborate a more on the use case you have in mind? The > description you mention is very generic. > > As far as I know we need to use polling to track the status of any async > job (which is another API call) and execute based on response. That seems > to be foundation principle behind all async calls. Alternately, you can > also use CloudMonkey ( > https://cwiki.apache.org/confluence/display/CLOUDSTACK/CloudStack+cloudmo= nkey+CLI) > as a framework or dig a little into code there to implement a similar > solution to execute hooks. > > Regards, > Anurag > > =EF=BB=BFOn 2/22/19, 6:22 PM, "Alireza Eskandari" wrote: > > Hi, > I'm looking for a solution to implement hooks or callbacks for > CloudStack > API. > For example execute an script when user calls deployVirtualMachine AP= I. > This script could be executed right after user submit his request or > after > the request completed successfully or failed. > Maybe some API management solution could help me but the problem is > understanding CS asyncjobs and their status. > Thanks > > > > Anurag.Awasthi@shapeblue.com > www.shapeblue.com > Amadeus House, Floral Street, London WC2E 9DPUK > @shapeblue > > > > --0000000000009f8f970582818661--