Return-Path: X-Original-To: apmail-ambari-dev-archive@www.apache.org Delivered-To: apmail-ambari-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CA934172F0 for ; Tue, 17 Mar 2015 12:26:38 +0000 (UTC) Received: (qmail 53141 invoked by uid 500); 17 Mar 2015 12:26:38 -0000 Delivered-To: apmail-ambari-dev-archive@ambari.apache.org Received: (qmail 53112 invoked by uid 500); 17 Mar 2015 12:26:38 -0000 Mailing-List: contact dev-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ambari.apache.org Delivered-To: mailing list dev@ambari.apache.org Received: (qmail 52936 invoked by uid 99); 17 Mar 2015 12:26:38 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Mar 2015 12:26:38 +0000 Date: Tue, 17 Mar 2015 12:26:38 +0000 (UTC) From: "Andrii Tkach (JIRA)" To: dev@ambari.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (AMBARI-10102) Create ember data model for widget MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Andrii Tkach created AMBARI-10102: ------------------------------------- Summary: Create ember data model for widget Key: AMBARI-10102 URL: https://issues.apache.org/jira/browse/AMBARI-10102 Project: Ambari Issue Type: Task Components: ambari-web Affects Versions: 2.1.0 Reporter: Andrii Tkach Assignee: Andrii Tkach Fix For: 2.1.0 As a part of this ticket, create an experimental flag under which poll for = the widget information from the stack while landing on the service summary = page for the first time. Since this is a static information, it is required= to be polled just once. This needs to be mapped to a model as described be= low Example API for HDFS service: {code} { href: "http://c6401.ambari.apache.org:8080/api/v1/stacks/HDP/2.2/services= /HDFS/artifacts/widget_layout", Artifacts: { artifact_name: "widget_order", service_name: "HDFS", stack_name: "HDP", stack_version: "2.2" }, artifact_data: { name: "HDFS", // This is the serviceName in the ember-data model sections: [=20 { name: "HDFS_SUMMARY" // This is the sectionName as described in = the below ember-data model widgets: [ { widget_name: =E2=80=9CNAMENODE_HEAP=E2=80=9D, widget_type: =E2=80=9CGAUGE=E2=80=9D, component_name: =E2=80=9CNAMENODE=E2=80=9D, display_name: "NameNode Heap", expression: [{ template: =E2=80=9C${jvmMemoryHeapUsed}/${jvmMemoryHeapMa= x}=E2=80=9D }], properties: { =E2=80=9Cwarning_threshold=E2=80=9D: 0.5, =E2=80=9Cerror_threshold=E2=80=9D: 0.7 } },=20 { widget_name: "HDFS_BYTES_READ", widget_type: =E2=80=9CHEATMAP=E2=80=9D, display_name: "HDFS Bytes Read", description: "",=20 component_name: =E2=80=9CDATANODE=E2=80=9D, expression: [ { template: "${metrics.dfs.datanode.bytes_read}" }=20 ] properties: { display_unit: "MB", max_limit: "1024" } } =20 ] } ] =20 }, =20 ] =20 } ] } =20 } {code} {code} App.Widget =3D DS.Model.extend({ widgetName: DS.attr('string'), defaultOrder: "" // This field is not derived from API but needs to be fi= lled in the mapper on the client side widgetType: DS.attr('string'), displayName: DS.attr('string'), serviceName: DS.attr('string'), componentName: DS.attr('string'), timeCreated: DS.attr('number'), sectionName: DS.attr('string'),=20 author: DS.attr('string'), properties: DS.attr('object'), expression: DS.attr('array') }); {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)