From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29139 invoked by alias); 22 Mar 2011 17:54:13 -0000 Received: (qmail 29125 invoked by uid 22791); 22 Mar 2011 17:54:10 -0000 X-SWARE-Spam-Status: No, hits=-5.0 required=5.0 tests=AWL,BAYES_40,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,TW_LR,TW_MX,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 22 Mar 2011 17:53:59 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p2MHrlNc006425 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 22 Mar 2011 13:53:47 -0400 Received: from fche.csb (vpn-8-169.rdu.redhat.com [10.11.8.169]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p2MHrkuU028793; Tue, 22 Mar 2011 13:53:46 -0400 Received: by fche.csb (Postfix, from userid 2569) id 95E2E5812E; Tue, 22 Mar 2011 13:53:45 -0400 (EDT) Date: Tue, 22 Mar 2011 17:54:00 -0000 From: "Frank Ch. Eigler" To: pcp@oss.sgi.com Cc: systemtap@sourceware.org Subject: sketch of possible web pmapi Message-ID: <20110322175345.GH13236@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.2i Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2011-q1/txt/msg00507.txt.bz2 Hi - I've finally jotted down some rough ideas about how a hypothetical web api might look for pcp. It exposes only a subset of the PMAPI (not sure whether pmns* should be added) in the form of http get operations that even a plain web browser can use. Let me know if you agree this is worth prototyping. * model: XMLRPC web client -+-> apache / mod_proxy (reverse-proxying) -+ (javascript) +-> (or directly) -+-> pmxmlrpc PMAPI pmxmlrpc -+-> network pmcd +-> network pmproxy -> pmcd +-> local pmda * general idea: - Exposing meaty subset of PMAPI - A plain web browser speaking http should be able to - navigate metric namespace - view metric metadata - view metric values, including enqueued events - GET requests produce XML results, with a minimal linked XSLT->HTML renderer - A plain wget should also work * API outline - create a context /context?local /context?hostname=HOSTNAME /context?archivefile=FILENAME ?poll-timeout=SECONDS /context/CONTEXT/copy - list/describe metrics /context/CONTEXT/metric?glob=GLOB /context/CONTEXT/metric?pmids=ID1,ID2,ID3 - fetch metric values /context/CONTEXT/value?pmids=ID1,ID2,ID3 /context/CONTEXT/value?pmids=ID1,ID2,ID3&time=TIME - list/describe/modify instance profile /context/CONTEXT/domain?ids=ID1,ID2 /context/CONTEXT/domain?profile=add&ids=ID1,ID2 /context/CONTEXT/domain?profile=delete&ids=ID1,ID2 * operation outline: 1) browse http://pmwebapisrv:8234/, authenticate, get html form to select connection context: local (or) hostname=HOSTNAME (or) archivefile=FILENAME, optional poll-timeout=NUMBER. Each per-context request restarts the timeout. If it expires, the web proxy will disconnect from the PCPD/PMDA / pmDestroyContext(). 2) submit GET /context? form to return an XML document denoting the creation of a context: The context.xsl stylesheet renders this XML to HTML, noting how long the context will remain open without a refresh, and listing navigation options such as: /context/CONTEXTNAME/copy -> to generate a new dup context; back to 2) a form /context/CONTEXTNAME/metric?glob=GLOB ; and a form /context/CONTEXTNAME/metric?id=PMID,PMID,PMID ; to jump to metric metadata 3) the list of metric metadata is another XML document, from pmLookupDesc() or or ... which is to render to a lovely HTML table, describing the metric metadata, plus providing links to metric-value and domain-instance views below: 4) the list of metric values is another XML document served by /context/CONTEXT/value?pmids=ID1,ID2,ID3 [&time=TIME] 9999 # if printable? #or base64-text #or ... The xslt widget would render the values into a tabular form, with a refresh link. This is the one that a web application or browser would want to fetch frequently. 5) domain instance metadata from pmGetInDom() would be served by /context/CONTEXT/domain?ids=ID1,ID2,ID3 : resulting in: ... ... This would be rendered into HTML that allows invidual domain-instances to be pmAddProfile/pmDelProfile'd to the CONTEXT, via /context/CONTEXT/domain?profile=add&ids=ID1,ID2,ID3 /context/CONTEXT/domain?profile=add&ids=all /context/CONTEXT/domain?profile=delete&ids=ID1,ID2,ID3 /context/CONTEXT/domain?profile=delete&ids=all which would return the same sort of XML as above, after adjusting the context. XXX: is there a way to query PMAPI as to the current pmAddProfile active instances?