incubator-ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From omal...@apache.org
Subject svn commit: r1213162 [2/2] - in /incubator/ambari/trunk: ./ controller/src/main/java/org/apache/ambari/configuration/ controller/src/main/java/org/apache/ambari/controller/ controller/src/main/java/org/apache/ambari/controller/rest/resources/ controlle...
Date Mon, 12 Dec 2011 08:21:18 GMT
Added: incubator/ambari/trunk/src/site/resources/application.html
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/src/site/resources/application.html?rev=1213162&view=auto
==============================================================================
--- incubator/ambari/trunk/src/site/resources/application.html (added)
+++ incubator/ambari/trunk/src/site/resources/application.html Mon Dec 12 08:21:17 2011
@@ -0,0 +1,319 @@
+<?xml version="1.0"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wadl="http://research.sun.com/wadl/2006/10" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:html="http://www.w3.org/1999/xhtml"><head><style type="text/css">
+        body {
+            font-family: sans-serif;
+            font-size: 0.85em;
+            margin: 2em 2em;
+        }
+        .methods {
+            margin-left: 2em; 
+            margin-bottom: 2em;
+        }
+        .method {
+            background-color: #eef;
+            border: 1px solid #DDDDE6;
+            padding: .5em;
+            margin-bottom: 1em;
+            width: 95%
+        }
+        .methodNameTable {
+            width: 100%;
+            border: 0px;
+            border-bottom: 2px solid white;
+            font-size: 1.4em;
+        }
+        .methodNameTd {
+            background-color: #eef;
+        }
+        h1 {
+            font-size: 2m;
+            margin-bottom: 0em;
+        }
+        h2 {
+            border-bottom: 1px solid black;
+            margin-top: 1.5em;
+            margin-bottom: 0.5em;
+            font-size: 1.5em;
+           }
+        h3 {
+            color: #FF6633;
+            font-size: 1.35em;
+            margin-top: .5em;
+            margin-bottom: 0em;
+        }
+        h5 {
+            font-size: 1.2em;
+            color: #99a;
+            margin: 0.5em 0em 0.25em 0em;
+        }
+        h6 {
+            color: #700000;
+            font-size: 1em;
+            margin: 1em 0em 0em 0em;
+        }
+        .h7 {
+            margin-top: .75em;
+            font-size: 1em;
+            font-weight: bold;
+            font-style: italic;
+            color: blue;
+        }
+        .h8 {
+            margin-top: .75em;
+            font-size: 1em;
+            font-weight: bold;
+            font-style: italic;
+            color: black;
+        }
+        tt {
+            font-size: 1em;
+        }
+        table {
+            margin-bottom: 0.5em;
+            border: 1px solid #E0E0E0;
+        }
+        th {
+            text-align: left;
+            font-weight: normal;
+            font-size: 1em;
+            color: black;
+            background-color: #DDDDE6;
+            padding: 3px 6px;
+            border: 1px solid #B1B1B8;
+        }
+        td {
+            padding: 3px 6px;
+            vertical-align: top;
+            background-color: #F6F6FF;
+            font-size: 0.85em;
+        }
+        p {
+            margin-top: 0em;
+            margin-bottom: 0em;
+        }
+        td.summary {
+            background-color: white;
+        }
+        td.summarySeparator {
+            padding: 1px;
+        }
+    </style><title>Ambari REST API</title></head><body><h1>Ambari REST API</h1><br/>
+
+<p>
+   Ambari provides rich REST interfaces that allow the creation, 
+   modification, querying, and deletion of stacks and clusters. The
+   primary resources are: 
+   <ul><li><a href="index.html#Stacks">Stacks</a> - definition of which 
+       components should be deployed and how they should be 
+       <a href="index.html#Configuration">configured</a>.</li><li><a href="index.html#Clusters">Clusters</a> - combination a stack 
+       and nodes to run Hadoop</li><li>Nodes - the machines managed by 
+       Ambari</li>
+   </ul>
+   Each is represented by a top level resource, which is a container,
+   and nested resources for each instance.
+</p><br/>
+<p>
+   The resources and the entities that are passed to them are defined
+   using JAXB and are represented in either XML or JSON formats
+   depending on the ContentType and Accept HTTP headers. The definition
+   of the types is given in the <a href="apidocs/org/apache/ambari/common/rest/entities/package-summary.html">
+   JavaDoc</a>.
+</p><br/>
+<p>
+   Typical usage would be to create a new stack derived from a pre-defined
+   one and change the neccessary configuration parameters. Then create a
+   cluster based on the stack by assigning nodes and marking it active.
+</p>
+<h2>Summary</h2><table><tr><th>Resource</th><th>Method</th><th>Description</th></tr><tr><td class="summary"><a href="#id1172026498257">http://ambari.example.com/rest/wadl</a></td><td class="summary"><a href="#getWadl">GET</a><br/><br/></td><td class="summary">Display REST API in human readable format<br/></td></tr><tr><td class="summarySeparator"/><td class="summarySeparator"/><td class="summarySeparator"/></tr><tr><td class="summary"><a href="#id1172026498275">http://ambari.example.com/rest/nodes</a></td><td class="summary"><a href="#getNodesList">GET</a><br/><br/></td><td class="summary">Get list of nodes
+
+  The "allocated and "alive" are the boolean variables that specify the type of nodes to return based on their state i.e. if they are already allocated to any cluster and live or dead. 
+  Live nodes are the ones that are consistently heart beating with the controller. If both "allocated" and "alive" are set to NULL then all the nodes are returned.<br/></td></tr><tr><td class="summarySeparator"/><td class="summarySeparator"/><td class="summarySeparator"/></tr><tr><td class="summary"><a href="#id1172026498337">http://ambari.example.com/rest/nodes/{hostname}</a></td><td class="summary"><a href="#getNode">GET</a><br/><br/></td><td class="summary">Get the node information that includes, service states, node attributes etc.<br/></td></tr><tr><td class="summarySeparator"/><td class="summarySeparator"/><td class="summarySeparator"/></tr><tr><td class="summary"><a href="#id1172026498388">http://ambari.example.com/rest/stacks</a></td><td class="summary"><a href="#listStacks">GET</a><br/><br/></td><td class="summary">Get the list of stacks<br/></td></tr><tr><td class="summarySeparator"/><td class="summarySeparator"/><td class="summarySeparator"/></tr><tr><td class="su
 mmary"><a href="#id1172026498431">http://ambari.example.com/rest/stacks/{stackName}</a></td><td class="summary"><a href="#getStack">GET</a><br/><br/><a href="#deletestack">DELETE</a><br/><br/><a href="#updateStack">PUT</a><br/><br/></td><td class="summary">Get a stack<br/><br/>Delete the stack<br/><br/>Create/Update the stack.
+
+ If named stack does not exist already, then it is created with revision zero.
+ If named stack exists, then it is updated as new revision.
+ Optional locationURL query parameter can specify the location of the repository of
+ of stacks. If specified then stack is downloaded from the repository.<br/></td></tr><tr><td class="summarySeparator"/><td class="summarySeparator"/><td class="summarySeparator"/></tr><tr><td class="summary"><a href="#id1172026498548">http://ambari.example.com/rest/stacks/{stackName}/revisions</a></td><td class="summary"><a href="#getstackRevisions">GET</a><br/><br/></td><td class="summary">Get a stack's revisions<br/></td></tr><tr><td class="summarySeparator"/><td class="summarySeparator"/><td class="summarySeparator"/></tr><tr><td class="summary"><a href="#id1172026498588">http://ambari.example.com/rest/clusters</a></td><td class="summary"><a href="#getClusterList">GET</a><br/><br/></td><td class="summary">Get the list of clusters.
+
+  State: "ALL"           : All the clusters (irrespective of their state), 
+         "ACTIVE"        : All the active state clusters
+         "INACTIVE"      : All the inactive state clusters
+         "ATTIC"         : All the retired i.e. ATTIC state clusters<br/></td></tr><tr><td class="summary"><a href="#id1172026498654">http://ambari.example.com/rest/clusters/{clusterName}/nodes</a></td><td class="summary"><a href="#getNodes">GET</a><br/><br/></td><td class="summary">Get list of nodes associated with the cluster.<br/></td></tr><tr><td class="summarySeparator"/><td class="summarySeparator"/><td class="summarySeparator"/></tr><tr><td class="summary"><a href="#id1172026498726">http://ambari.example.com/rest/clusters/{clusterName}</a></td><td class="summary"><a href="#getClusterDefinition">GET</a><br/><br/><a href="#updateClusterDefinition">PUT</a><br/><br/><a href="#deleteCluster">DELETE</a><br/><br/></td><td class="summary">Get the information of a specified Hadoop Cluster. Information includes Cluster definition 
+ and the cluster state.<br/><br/>Add/Update cluster definition. If cluster does not exist it will created.
+  
+  While creating new cluster, cluster definition must specify name, stack name 
+  and nodes associated with the cluster. 
+  Default values for new cluster definition parameters, if not specified
+    -- goalstate          = "INACTIVE"  (optionally, it can be set to ACTIVE)
+    -- stack revision = latest revision
+    -- RoleToNodes        = If explicit association is not specified then Ambari
+                            will determine the optimal role to nodes association. 
+                            User can view it by running the command in dry_run.
+    -- active services    = "ALL" i.e. if not specified all the configured 
+                            services will be activated
+    -- description        = Default description will be associated
+    -- dry_run            = false
+  
+  
+  For new cluster to be in active state cluster definition needs to be 
+  complete &amp; valid e.g. number of nodes associated are sufficient for 
+  each role, specified stack for cluster configuration should exist 
+  etc. 
+  
+  Updating existing cluster definition would require only specific sub elements
+  of cluster definition to be specified.<br/><br/>Delete the the cluster.<br/></td></tr><tr><td class="summarySeparator"/><td class="summarySeparator"/><td class="summarySeparator"/></tr><tr><td class="summary"><a href="#id1172026498840">http://ambari.example.com/rest/clusters/{clusterName}/rename</a></td><td class="summary"><a href="#renameCluster">PUT</a><br/><br/></td><td class="summary">Rename the cluster.<br/></td></tr><tr><td class="summarySeparator"/><td class="summarySeparator"/><td class="summarySeparator"/></tr><tr><td class="summary"><a href="#id1172026498904">http://ambari.example.com/rest/clusters/{clusterName}/state</a></td><td class="summary"><a href="#getClusterState">GET</a><br/><br/></td><td class="summary">Get the cluster state.<br/></td></tr><tr><td class="summarySeparator"/><td class="summarySeparator"/><td class="summarySeparator"/></tr><tr><td class="summary"><a href="#id1172026498959">http://ambari.example.com/rest/clusters/{clusterName}/stack</a></td
 ><td class="summary"><a href="#getClusterStack">GET</a><br/><br/></td><td class="summary">Get the stack associated with cluster<br/></td></tr></table><p/><h2>Grammars</h2><p><a href="schema1.xsd">schema1.xsd</a></p><h2>Resources</h2><br/><h3><a name="id1172026498257">http://ambari.example.com/rest/wadl</a></h3><p/><h5>Methods</h5><div class="methods"><div class="method"><table class="methodNameTable"><tr><td class="methodNameTd" style="font-weight: bold"><a name="getWadl">GET</a></td><td class="methodNameTd" style="text-align: right">getWadl() 
+                            </td></tr></table><p>Display REST API in human readable format</p><h6>request</h6><div style="margin-left: 2em">
+                        unspecified
+                    </div><h6>responses</h6><div style="margin-left: 2em"><div style="margin-left: 2em"><div class="h7">representations</div><table><tr><td>200</td><td>application/xml</td><td>This page.</td></tr></table></div></div></div></div><h3><a name="id1172026498275">http://ambari.example.com/rest/nodes</a></h3><p>Nodes Resource represents collection of cluster nodes.</p><h5>Methods</h5><div class="methods"><div class="method"><table class="methodNameTable"><tr><td class="methodNameTd" style="font-weight: bold"><a name="getNodesList">GET</a></td><td class="methodNameTd" style="text-align: right">getNodesList() 
+                            </td></tr></table><p>Get list of nodes
+
+  The "allocated and "alive" are the boolean variables that specify the type of nodes to return based on their state i.e. if they are already allocated to any cluster and live or dead. 
+  Live nodes are the ones that are consistently heart beating with the controller. If both "allocated" and "alive" are set to NULL then all the nodes are returned.</p><h6>request</h6><div style="margin-left: 2em"><div class="h7">query params</div><table><tr><td><strong>allocated</strong></td><td><a href="http://www.w3.org/TR/xmlschema-2/#string">string</a><br/>default: <tt/></td><td>Boolean value to specify, if nodes to be returned are allocated/reserved for some cluster (specify null to return both allocated and unallocated nodes)</td></tr><tr><td><strong>alive</strong></td><td><a href="http://www.w3.org/TR/xmlschema-2/#string">string</a><br/>default: <tt/></td><td>Boolean value to specify, if nodes to be returned are alive or dead or both (specify null to return both live and dead nodes)</td></tr></table><p/></div><h6>responses</h6><div style="margin-left: 2em"><div style="margin-left: 2em"><div class="h7">representations</div><table><tr><td>404</td><td/><td>Node does not 
 exist</td></tr><tr><td>200</td><td>application/json</td><td><p><h6>Example</h6><pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
+&lt;Node name="localhost"&gt;
+    &lt;NodeAttributes cpuUnits="0" cpuCores="1" ramInGB="6" diskSizeInGB="0" diskUnits="4"/&gt;
+    &lt;NodeState clusterName="cluster-123" agentInstalled="true" allocatedToCluster="false"&gt;
+        &lt;nodeRoleNames&gt;jobtracker-role&lt;/nodeRoleNames&gt;
+        &lt;nodeRoleNames&gt;namenode-role&lt;/nodeRoleNames&gt;
+    &lt;/NodeState&gt;
+&lt;/Node&gt;
+</code></pre></p><br/>Successful.</td></tr></table></div></div></div></div><h3><a name="id1172026498337">http://ambari.example.com/rest/nodes/{hostname}</a></h3><p/><h5>Methods</h5><div class="methods"><div class="method"><table class="methodNameTable"><tr><td class="methodNameTd" style="font-weight: bold"><a name="getNode">GET</a></td><td class="methodNameTd" style="text-align: right">getNode() 
+                            </td></tr></table><p>Get the node information that includes, service states, node attributes etc.</p><h6>request</h6><div style="margin-left: 2em"><div class="h7">template params</div><table><tr><td><strong>hostname</strong></td><td><a href="http://www.w3.org/TR/xmlschema-2/#string">string</a></td><td>Fully qualified hostname</td></tr></table><p/></div><h6>responses</h6><div style="margin-left: 2em"><div style="margin-left: 2em"><div class="h7">representations</div><table><tr><td>404</td><td/><td>Node does not exist</td></tr><tr><td>200</td><td>application/json</td><td><p><h6>Example</h6><pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
+&lt;Node name="localhost"&gt;
+    &lt;NodeAttributes cpuUnits="0" cpuCores="1" ramInGB="6" diskSizeInGB="0" diskUnits="4"/&gt;
+    &lt;NodeState clusterName="cluster-123" agentInstalled="true" allocatedToCluster="false"&gt;
+        &lt;nodeRoleNames&gt;jobtracker-role&lt;/nodeRoleNames&gt;
+        &lt;nodeRoleNames&gt;namenode-role&lt;/nodeRoleNames&gt;
+    &lt;/NodeState&gt;
+&lt;/Node&gt;
+</code></pre></p><br/>Successful.</td></tr></table></div></div></div></div><h3><a name="id1172026498388">http://ambari.example.com/rest/stacks</a></h3><p>StackResource represents a Hadoop stack to be installed on a 
+ cluster. Stacks define a collection of Hadoop components that are
+ installed together on a cluster and their configuration.</p><h5>Methods</h5><div class="methods"><div class="method"><table class="methodNameTable"><tr><td class="methodNameTd" style="font-weight: bold"><a name="listStacks">GET</a></td><td class="methodNameTd" style="text-align: right">listStacks() 
+                            </td></tr></table><p>Get the list of stacks</p><h6>request</h6><div style="margin-left: 2em">
+                        unspecified
+                    </div><h6>responses</h6><div style="margin-left: 2em"><div style="margin-left: 2em"><div class="h7">representations</div><table><tr><td>204</td><td/><td>List is empty.</td></tr><tr><td>200</td><td>application/json application/xml</td><td><p><h6>Example</h6><pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
+&lt;stackInformation name="HDP" revision="1"&gt;
+    &lt;component&gt;hdfs&lt;/component&gt;
+    &lt;component&gt;mapreduce&lt;/component&gt;
+&lt;/stackInformation&gt;
+</code></pre></p><br/>Successful</td></tr></table></div></div></div></div><h3><a name="id1172026498431">http://ambari.example.com/rest/stacks/{stackName}</a></h3><p/><h5>Methods</h5><div class="methods"><div class="method"><table class="methodNameTable"><tr><td class="methodNameTd" style="font-weight: bold"><a name="getStack">GET</a></td><td class="methodNameTd" style="text-align: right">getStack() 
+                            </td></tr></table><p>Get a stack</p><h6>request</h6><div style="margin-left: 2em"><div class="h7">template params</div><table><tr><td><strong>stackName</strong></td><td><a href="http://www.w3.org/TR/xmlschema-2/#string">string</a></td><td>Name of the stack</td></tr></table><p/><div class="h7">query params</div><table><tr><td><strong>revision</strong></td><td><a href="http://www.w3.org/TR/xmlschema-2/#string">string</a><br/>default: <tt>-1</tt></td><td>The optional stack revision, if not specified get the latest revision</td></tr></table><p/></div><h6>responses</h6><div style="margin-left: 2em"><div style="margin-left: 2em"><div class="h7">representations</div><table><tr><td>200</td><td>application/json application/xml</td><td><p><h6>Example</h6><pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
+&lt;ClusterInformation&gt;
+    &lt;definition name="blue.dev.Cluster123" description="cluster123 - development cluster" stackName="cluster123" stackRevision="0" goalState="ATTIC" nodes="jt-nodex,nn-nodex,hostname-1x,hostname-2x,hostname-3x,hostname-4x,node-2x,node-3x,node-4x"&gt;
+        &lt;activeServices&gt;hdfs&lt;/activeServices&gt;
+        &lt;activeServices&gt;mapred&lt;/activeServices&gt;
+        &lt;roleToNodesMap roleName="jobtracker-role" nodes="jt-nodex"/&gt;
+        &lt;roleToNodesMap roleName="namenode-role" nodes="nn-nodex"/&gt;
+        &lt;roleToNodesMap roleName="slaves-role" nodes="hostname-1x,hostname-2x,hostname-3x,hostname-4x,node-2x,node-3x,node-4x"/&gt;
+    &lt;/definition&gt;
+&lt;/ClusterInformation&gt;
+</code></pre></p><br/>Get a stack</td></tr></table></div></div></div><div class="method"><table class="methodNameTable"><tr><td class="methodNameTd" style="font-weight: bold"><a name="deletestack">DELETE</a></td><td class="methodNameTd" style="text-align: right">deletestack() 
+                            </td></tr></table><p>Delete the stack</p><h6>request</h6><div style="margin-left: 2em"><div class="h7">template params</div><table><tr><td><strong>stackName</strong></td><td><a href="http://www.w3.org/TR/xmlschema-2/#string">string</a></td><td>Name of the stack</td></tr></table><p/></div><h6>responses</h6><div style="margin-left: 2em"><div style="margin-left: 2em"><div class="h7">representations</div><table><tr><td>200</td><td>application/json application/xml</td><td>Delete a stack</td></tr></table></div></div></div><div class="method"><table class="methodNameTable"><tr><td class="methodNameTd" style="font-weight: bold"><a name="updateStack">PUT</a></td><td class="methodNameTd" style="text-align: right">updateStack() 
+                            </td></tr></table><p>Create/Update the stack.
+
+ If named stack does not exist already, then it is created with revision zero.
+ If named stack exists, then it is updated as new revision.
+ Optional locationURL query parameter can specify the location of the repository of
+ of stacks. If specified then stack is downloaded from the repository.</p><h6>request</h6><div style="margin-left: 2em"><div class="h7">template params</div><table><tr><td><strong>stackName</strong></td><td><a href="http://www.w3.org/TR/xmlschema-2/#string">string</a></td><td>Name of the stack</td></tr></table><p/><div class="h7">query params</div><table><tr><td><strong>url</strong></td><td><a href="http://www.w3.org/TR/xmlschema-2/#string">string</a><br/>default: <tt/></td><td>URL pointing to the location of the stack</td></tr></table><p/><div class="h7">representations</div><table><tr><td/><td>application/json</td></tr><tr><td/><td>application/xml</td></tr></table></div><h6>responses</h6><div style="margin-left: 2em"><div style="margin-left: 2em"><div class="h7">representations</div><table><tr><td>404</td><td/><td>Specified stack does not exist. In case of creating new one, 
+                                          it is not found in repository where in case of update, it does not
+                                          exist.</td></tr><tr><td>200</td><td>application/json application/xml</td><td><p><h6>Example</h6><pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
+&lt;stack name="stack" revision="1"/&gt;
+</code></pre></p><br/>Successfully created the new or updated the existing stack.</td></tr></table></div></div></div></div><h3><a name="id1172026498548">http://ambari.example.com/rest/stacks/{stackName}/revisions</a></h3><p/><h5>Methods</h5><div class="methods"><div class="method"><table class="methodNameTable"><tr><td class="methodNameTd" style="font-weight: bold"><a name="getstackRevisions">GET</a></td><td class="methodNameTd" style="text-align: right">getstackRevisions() 
+                            </td></tr></table><p>Get a stack's revisions</p><h6>request</h6><div style="margin-left: 2em"><div class="h7">template params</div><table><tr><td><strong>stackName</strong></td><td><a href="http://www.w3.org/TR/xmlschema-2/#string">string</a></td><td>Name of the stack</td></tr></table><p/></div><h6>responses</h6><div style="margin-left: 2em"><div style="margin-left: 2em"><div class="h7">representations</div><table><tr><td>200</td><td>application/json application/xml</td><td><p><h6>Example</h6><pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
+&lt;stackInformation name="HDP" revision="1"&gt;
+    &lt;component&gt;hdfs&lt;/component&gt;
+    &lt;component&gt;mapreduce&lt;/component&gt;
+&lt;/stackInformation&gt;
+</code></pre></p><br/>Get stack revisions</td></tr></table></div></div></div></div><h3><a name="id1172026498588">http://ambari.example.com/rest/clusters</a></h3><p>Clusters Resource represents the collection of Hadoop clusters in a data center</p><h5>Methods</h5><div class="methods"><div class="method"><table class="methodNameTable"><tr><td class="methodNameTd" style="font-weight: bold"><a name="getClusterList">GET</a></td><td class="methodNameTd" style="text-align: right">getClusterList() 
+                            </td></tr></table><p>Get the list of clusters.
+
+  State: "ALL"           : All the clusters (irrespective of their state), 
+         "ACTIVE"        : All the active state clusters
+         "INACTIVE"      : All the inactive state clusters
+         "ATTIC"         : All the retired i.e. ATTIC state clusters</p><h6>request</h6><div style="margin-left: 2em"><div class="h7">query params</div><table><tr><td><strong>state</strong></td><td><a href="http://www.w3.org/TR/xmlschema-2/#string">string</a><br/>default: <tt>ALL</tt></td><td>The state of the cluster</td></tr><tr><td><strong>search</strong></td><td><a href="http://www.w3.org/TR/xmlschema-2/#string">string</a><br/>default: <tt/></td><td>Optional search expression to return list of matching 
+                     clusters</td></tr></table><p/></div><h6>responses</h6><div style="margin-left: 2em"><div style="margin-left: 2em"><div class="h7">representations</div><table><tr><td>204</td><td/><td>No cluster defined</td></tr><tr><td>200</td><td>application/json application/xml</td><td><p><h6>Example</h6><pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
+&lt;ClusterInformation&gt;
+    &lt;definition name="blue.dev.Cluster123" description="cluster123 - development cluster" stackName="cluster123" stackRevision="0" goalState="ATTIC" nodes="jt-nodex,nn-nodex,hostname-1x,hostname-2x,hostname-3x,hostname-4x,node-2x,node-3x,node-4x"&gt;
+        &lt;activeServices&gt;hdfs&lt;/activeServices&gt;
+        &lt;activeServices&gt;mapred&lt;/activeServices&gt;
+        &lt;roleToNodesMap roleName="jobtracker-role" nodes="jt-nodex"/&gt;
+        &lt;roleToNodesMap roleName="namenode-role" nodes="nn-nodex"/&gt;
+        &lt;roleToNodesMap roleName="slaves-role" nodes="hostname-1x,hostname-2x,hostname-3x,hostname-4x,node-2x,node-3x,node-4x"/&gt;
+    &lt;/definition&gt;
+&lt;/ClusterInformation&gt;
+</code></pre></p><br/>Return ClusterInformation</td></tr><tr><td>500</td><td/><td>Internal Server Error</td></tr></table></div></div></div></div><h3><a name="id1172026498654">http://ambari.example.com/rest/clusters/{clusterName}/nodes</a></h3><p/><h5>Methods</h5><div class="methods"><div class="method"><table class="methodNameTable"><tr><td class="methodNameTd" style="font-weight: bold"><a name="getNodes">GET</a></td><td class="methodNameTd" style="text-align: right">getNodes() 
+                            </td></tr></table><p>Get list of nodes associated with the cluster.</p><h6>request</h6><div style="margin-left: 2em"><div class="h7">template params</div><table><tr><td><strong>clusterName</strong></td><td><a href="http://www.w3.org/TR/xmlschema-2/#string">string</a></td><td>Name of the cluster</td></tr></table><p/><div class="h7">query params</div><table><tr><td><strong>role</strong></td><td><a href="http://www.w3.org/TR/xmlschema-2/#string">string</a><br/>default: <tt/></td><td>Optionally specify the role name to get the nodes 
+                      associated with the service role</td></tr><tr><td><strong>alive</strong></td><td><a href="http://www.w3.org/TR/xmlschema-2/#string">string</a><br/>default: <tt/></td><td>Boolean value (true/false) to specify, if nodes to be 
+                      returned are alive or dead. if this query parameter is 
+                      is not specified them all the nodes associated with cluster
+                      are returned)</td></tr></table><p/></div><h6>responses</h6><div style="margin-left: 2em"><div style="margin-left: 2em"><div class="h7">representations</div><table><tr><td>204</td><td/><td>No content; No nodes are associated with the cluster</td></tr><tr><td>200</td><td>application/json</td><td>Get list of nodes associated with the cluster.
+  The "alive" is a boolean variable that 
+  specify the type of nodes to return based on their state i.e. live or 
+  dead. Live nodes are the ones that are consistently heart beating with 
+  the controller. If both live and dead nodes need to be returned 
+  then do not specify the alive query parameter</td></tr><tr><td>500</td><td/><td>Internal Server Error; No nodes are associated with the cluster
+                                      (See "ErrorMessage" in the response http header describing specific error condition).</td></tr></table></div></div></div></div><h3><a name="id1172026498726">http://ambari.example.com/rest/clusters/{clusterName}</a></h3><p/><h5>Methods</h5><div class="methods"><div class="method"><table class="methodNameTable"><tr><td class="methodNameTd" style="font-weight: bold"><a name="getClusterDefinition">GET</a></td><td class="methodNameTd" style="text-align: right">getClusterDefinition() 
+                            </td></tr></table><p>Get the information of a specified Hadoop Cluster. Information includes Cluster definition 
+ and the cluster state.</p><h6>request</h6><div style="margin-left: 2em"><div class="h7">template params</div><table><tr><td><strong>clusterName</strong></td><td><a href="http://www.w3.org/TR/xmlschema-2/#string">string</a></td><td>Name of the cluster</td></tr></table><p/></div><h6>responses</h6><div style="margin-left: 2em"><div style="margin-left: 2em"><div class="h7">representations</div><table><tr><td>404</td><td/><td>Specified cluster does not exist</td></tr><tr><td>200</td><td>application/json application/xml</td><td><p><h6>Example</h6><pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
+&lt;stack name="stack" revision="1"/&gt;
+</code></pre></p><br/>Get the definition &amp; current state of the specified Hadoop cluster</td></tr></table></div></div></div><div class="method"><table class="methodNameTable"><tr><td class="methodNameTd" style="font-weight: bold"><a name="updateClusterDefinition">PUT</a></td><td class="methodNameTd" style="text-align: right">updateClusterDefinition() 
+                            </td></tr></table><p>Add/Update cluster definition. If cluster does not exist it will created.
+  
+  While creating new cluster, cluster definition must specify name, stack name 
+  and nodes associated with the cluster. 
+  Default values for new cluster definition parameters, if not specified
+    -- goalstate          = "INACTIVE"  (optionally, it can be set to ACTIVE)
+    -- stack revision = latest revision
+    -- RoleToNodes        = If explicit association is not specified then Ambari
+                            will determine the optimal role to nodes association. 
+                            User can view it by running the command in dry_run.
+    -- active services    = "ALL" i.e. if not specified all the configured 
+                            services will be activated
+    -- description        = Default description will be associated
+    -- dry_run            = false
+  
+  
+  For new cluster to be in active state cluster definition needs to be 
+  complete &amp; valid e.g. number of nodes associated are sufficient for 
+  each role, specified stack for cluster configuration should exist 
+  etc. 
+  
+  Updating existing cluster definition would require only specific sub elements
+  of cluster definition to be specified.</p><h6>request</h6><div style="margin-left: 2em"><div class="h7">template params</div><table><tr><td><strong>clusterName</strong></td><td><a href="http://www.w3.org/TR/xmlschema-2/#string">string</a></td><td>Name of the cluster</td></tr></table><p/><div class="h7">query params</div><table><tr><td><strong>dry_run</strong></td><td><a href="http://www.w3.org/TR/xmlschema-2/#boolean">boolean</a><br/>default: <tt>false</tt></td><td>Run without actual execution</td></tr></table><p/><div class="h7">representations</div><table><tr><td/><td>application/json</td></tr><tr><td/><td>application/xml</td></tr></table></div><h6>responses</h6><div style="margin-left: 2em"><div style="margin-left: 2em"><div class="h7">representations</div><table><tr><td>200</td><td>application/json application/xml</td><td><p><h6>Example</h6><pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
+&lt;cluster name="blue.dev.Cluster123" description="cluster123 - development cluster" stackName="cluster123" stackRevision="0" goalState="ATTIC" nodes="jt-nodex,nn-nodex,hostname-1x,hostname-2x,hostname-3x,hostname-4x,node-2x,node-3x,node-4x"&gt;
+    &lt;activeServices&gt;hdfs&lt;/activeServices&gt;
+    &lt;activeServices&gt;mapred&lt;/activeServices&gt;
+    &lt;roleToNodesMap roleName="jobtracker-role" nodes="jt-nodex"/&gt;
+    &lt;roleToNodesMap roleName="namenode-role" nodes="nn-nodex"/&gt;
+    &lt;roleToNodesMap roleName="slaves-role" nodes="hostname-1x,hostname-2x,hostname-3x,hostname-4x,node-2x,node-3x,node-4x"/&gt;
+&lt;/cluster&gt;
+</code></pre></p><br/>Returns new or updated cluster definition.</td></tr><tr><td>400</td><td/><td>Bad request (See "ErrorMessage" in the response
+                                          http header describing specific error condition).</td></tr></table></div></div></div><div class="method"><table class="methodNameTable"><tr><td class="methodNameTd" style="font-weight: bold"><a name="deleteCluster">DELETE</a></td><td class="methodNameTd" style="text-align: right">deleteCluster() 
+                            </td></tr></table><p>Delete the the cluster.</p><h6>request</h6><div style="margin-left: 2em"><div class="h7">template params</div><table><tr><td><strong>clusterName</strong></td><td><a href="http://www.w3.org/TR/xmlschema-2/#string">string</a></td><td>Name of the cluster</td></tr></table><p/></div><h6>responses</h6><div style="margin-left: 2em"><div style="margin-left: 2em"><div class="h7">representations</div><table><tr><td>200</td><td/><td>Delete operation will lead the cluster 
+                                  to "ATTIC" state and then the cluster 
+                                  definition is purged from the controller 
+                                  repository when all the nodes are released 
+                                  from the cluster. It is asynchronous operation.
+                                  In "ATTIC" state all the 
+                                  cluster services would be stopped and 
+                                  nodes are released. All the cluster data 
+                                  will be lost.</td></tr></table></div></div></div></div><h3><a name="id1172026498840">http://ambari.example.com/rest/clusters/{clusterName}/rename</a></h3><p/><h5>Methods</h5><div class="methods"><div class="method"><table class="methodNameTable"><tr><td class="methodNameTd" style="font-weight: bold"><a name="renameCluster">PUT</a></td><td class="methodNameTd" style="text-align: right">renameCluster() 
+                            </td></tr></table><p>Rename the cluster.</p><h6>request</h6><div style="margin-left: 2em"><div class="h7">template params</div><table><tr><td><strong>clusterName</strong></td><td><a href="http://www.w3.org/TR/xmlschema-2/#string">string</a></td><td>Existing name of the cluster</td></tr></table><p/><div class="h7">query params</div><table><tr><td><strong>new_name</strong></td><td><a href="http://www.w3.org/TR/xmlschema-2/#string">string</a><br/>default: <tt/></td><td>New name of the cluster</td></tr></table><p/></div><h6>responses</h6><div style="margin-left: 2em"><div style="margin-left: 2em"><div class="h7">representations</div><table><tr><td>404</td><td/><td>Cluster does not exist</td></tr><tr><td>200</td><td>application/json application/xml</td><td>Rename the cluster. This operation is allowed only
+                                          when cluster is in ATTIC state</td></tr><tr><td>406</td><td/><td>Not Acceptable. Cluster is not in ATTIC state.</td></tr><tr><td>400</td><td/><td>Bad request (See "ErrorMessage" in the response
+                                          http header describing specific error condition).</td></tr></table></div></div></div></div><h3><a name="id1172026498904">http://ambari.example.com/rest/clusters/{clusterName}/state</a></h3><p/><h5>Methods</h5><div class="methods"><div class="method"><table class="methodNameTable"><tr><td class="methodNameTd" style="font-weight: bold"><a name="getClusterState">GET</a></td><td class="methodNameTd" style="text-align: right">getClusterState() 
+                            </td></tr></table><p>Get the cluster state.</p><h6>request</h6><div style="margin-left: 2em"><div class="h7">template params</div><table><tr><td><strong>clusterName</strong></td><td><a href="http://www.w3.org/TR/xmlschema-2/#string">string</a></td><td>Name of the cluster</td></tr></table><p/></div><h6>responses</h6><div style="margin-left: 2em"><div style="margin-left: 2em"><div class="h7">representations</div><table><tr><td>404</td><td/><td>Cluster does not exist</td></tr><tr><td>200</td><td>application/json</td><td><p><h6>Example</h6><pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
+&lt;clusterState state="ATTIC" creationTime="2011-12-01T15:50:11.547-08:00" deployTime="2011-12-01T15:50:11.553-08:00" markForDeletionWhenInAttic="false"/&gt;
+</code></pre></p><br/>This provides the run time state of the 
+                                              cluster. Cluster state is derived based 
+                                              on the state of various services running on the cluster.
+                                              Representative cluster states:
+                                                  "ACTIVE"  : Hadoop stack is deployed on cluster nodes and 
+                                                              required cluster services are running
+                                                  "INACTIVE : No cluster services are running. Hadoop stack 
+                                                              may or may not be deployed on the cluster nodes
+                                                  "ATTIC"   : Only cluster definition is available. No nodes are 
+                                                              reserved for the cluster in this state.</td></tr></table></div></div></div></div><h3><a name="id1172026498959">http://ambari.example.com/rest/clusters/{clusterName}/stack</a></h3><p/><h5>Methods</h5><div class="methods"><div class="method"><table class="methodNameTable"><tr><td class="methodNameTd" style="font-weight: bold"><a name="getClusterStack">GET</a></td><td class="methodNameTd" style="text-align: right">getClusterStack() 
+                            </td></tr></table><p>Get the stack associated with cluster</p><h6>request</h6><div style="margin-left: 2em"><div class="h7">template params</div><table><tr><td><strong>clusterName</strong></td><td><a href="http://www.w3.org/TR/xmlschema-2/#string">string</a></td><td>Name of the cluster</td></tr></table><p/><div class="h7">query params</div><table><tr><td><strong>expanded</strong></td><td><a href="http://www.w3.org/TR/xmlschema-2/#boolean">boolean</a><br/>default: <tt>true</tt></td><td>Optionally specify the boolean value to indicate if 
+                      to retrieved the cluster level stack or the fully
+                      derived stack in-lining the parent stacks 
+                      associated with the service role</td></tr></table><p/></div><h6>responses</h6><div style="margin-left: 2em"><div style="margin-left: 2em"><div class="h7">representations</div><table><tr><td>200</td><td>application/json</td><td><p><h6>Example</h6><pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
+&lt;stack name="stack" revision="1"/&gt;
+</code></pre></p><br/>Get the stack associated with cluster</td></tr></table></div></div></div></div></body></html>

Added: incubator/ambari/trunk/src/site/resources/schema1.xsd
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/src/site/resources/schema1.xsd?rev=1213162&view=auto
==============================================================================
--- incubator/ambari/trunk/src/site/resources/schema1.xsd (added)
+++ incubator/ambari/trunk/src/site/resources/schema1.xsd Mon Dec 12 08:21:17 2011
@@ -0,0 +1,181 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<xs:schema version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+
+  <xs:element name="ClusterInformation" type="ClusterInformation"/>
+
+  <xs:element name="Node" type="Node"/>
+
+  <xs:element name="Property" type="Property"/>
+
+  <xs:element name="cluster" type="ClusterDefinition"/>
+
+  <xs:element name="clusterState" type="clusterState"/>
+
+  <xs:element name="component" type="CategoryType"/>
+
+  <xs:element name="componentDefinition" type="componentDefinition"/>
+
+  <xs:element name="configuration" type="Configuration"/>
+
+  <xs:element name="configurationCategory" type="ConfigurationCategory"/>
+
+  <xs:element name="nodeState" type="NodeState"/>
+
+  <xs:element name="repositoryKind" type="PackageType"/>
+
+  <xs:element name="role" type="RoleType"/>
+
+  <xs:element name="stack" type="stack"/>
+
+  <xs:element name="stackInformation" type="StackInformation"/>
+
+  <xs:complexType name="ClusterDefinition">
+    <xs:sequence>
+      <xs:element name="activeServices" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element name="roleToNodesMap" type="roleToNodes" minOccurs="0" maxOccurs="unbounded"/>
+    </xs:sequence>
+    <xs:attribute name="name" type="xs:string"/>
+    <xs:attribute name="revision" type="xs:string"/>
+    <xs:attribute name="description" type="xs:string"/>
+    <xs:attribute name="stackName" type="xs:string"/>
+    <xs:attribute name="stackRevision" type="xs:string"/>
+    <xs:attribute name="goalState" type="xs:string"/>
+    <xs:attribute name="nodes" type="xs:string"/>
+  </xs:complexType>
+
+  <xs:complexType name="roleToNodes">
+    <xs:sequence/>
+    <xs:attribute name="roleName" type="xs:string" use="required"/>
+    <xs:attribute name="nodes" type="xs:string"/>
+  </xs:complexType>
+
+  <xs:complexType name="ClusterInformation">
+    <xs:sequence>
+      <xs:element name="definition" type="ClusterDefinition" minOccurs="0"/>
+      <xs:element name="state" type="clusterState" minOccurs="0"/>
+    </xs:sequence>
+  </xs:complexType>
+
+  <xs:complexType name="clusterState">
+    <xs:sequence/>
+    <xs:attribute name="state" type="xs:string" use="required"/>
+    <xs:attribute name="creationTime" type="xs:dateTime" use="required"/>
+    <xs:attribute name="deployTime" type="xs:dateTime"/>
+    <xs:attribute name="lastUpdateTime" type="xs:dateTime"/>
+    <xs:attribute name="markForDeletionWhenInAttic" type="xs:boolean" use="required"/>
+  </xs:complexType>
+
+  <xs:complexType name="CategoryType">
+    <xs:sequence>
+      <xs:element name="definition" type="componentDefinition" minOccurs="0"/>
+      <xs:element ref="configuration" minOccurs="0"/>
+      <xs:element name="roles" type="RoleType" minOccurs="0" maxOccurs="unbounded"/>
+    </xs:sequence>
+    <xs:attribute name="name" type="xs:string" use="required"/>
+    <xs:attribute name="architecture" type="xs:string"/>
+    <xs:attribute name="version" type="xs:string"/>
+    <xs:attribute name="provider" type="xs:string"/>
+  </xs:complexType>
+
+  <xs:complexType name="componentDefinition">
+    <xs:sequence/>
+    <xs:attribute name="provider" type="xs:string"/>
+    <xs:attribute name="name" type="xs:string"/>
+    <xs:attribute name="version" type="xs:string"/>
+  </xs:complexType>
+
+  <xs:complexType name="Configuration">
+    <xs:sequence>
+      <xs:element name="category" type="ConfigurationCategory" minOccurs="0" maxOccurs="unbounded"/>
+    </xs:sequence>
+  </xs:complexType>
+
+  <xs:complexType name="ConfigurationCategory">
+    <xs:sequence>
+      <xs:element name="property" type="Property" minOccurs="0" maxOccurs="unbounded"/>
+    </xs:sequence>
+    <xs:attribute name="name" type="xs:string" use="required"/>
+  </xs:complexType>
+
+  <xs:complexType name="Property">
+    <xs:sequence/>
+    <xs:attribute name="name" type="xs:string" use="required"/>
+    <xs:attribute name="value" type="xs:string" use="required"/>
+    <xs:attribute name="force" type="xs:boolean" use="required"/>
+  </xs:complexType>
+
+  <xs:complexType name="RoleType">
+    <xs:sequence>
+      <xs:element ref="configuration"/>
+    </xs:sequence>
+    <xs:attribute name="name" type="xs:string" use="required"/>
+  </xs:complexType>
+
+  <xs:complexType name="Node">
+    <xs:sequence>
+      <xs:element name="NodeAttributes" type="nodeAttributes" minOccurs="0"/>
+      <xs:element name="NodeState" type="NodeState"/>
+    </xs:sequence>
+    <xs:attribute name="name" type="xs:string" use="required"/>
+  </xs:complexType>
+
+  <xs:complexType name="nodeAttributes">
+    <xs:sequence/>
+    <xs:attribute name="cpuType" type="xs:string"/>
+    <xs:attribute name="cpuUnits" type="xs:short" use="required"/>
+    <xs:attribute name="cpuCores" type="xs:short" use="required"/>
+    <xs:attribute name="ramInGB" type="xs:long" use="required"/>
+    <xs:attribute name="diskSizeInGB" type="xs:long" use="required"/>
+    <xs:attribute name="diskUnits" type="xs:short" use="required"/>
+  </xs:complexType>
+
+  <xs:complexType name="NodeState">
+    <xs:sequence>
+      <xs:element name="nodeRoleNames" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element name="nodeServers" type="nodeServer" minOccurs="0" maxOccurs="unbounded"/>
+    </xs:sequence>
+    <xs:attribute name="lastHeartbeatTime" type="xs:dateTime"/>
+    <xs:attribute name="clusterName" type="xs:string"/>
+    <xs:attribute name="agentInstalled" type="xs:boolean"/>
+    <xs:attribute name="allocatedToCluster" type="xs:boolean"/>
+  </xs:complexType>
+
+  <xs:complexType name="nodeServer">
+    <xs:sequence/>
+    <xs:attribute name="name" type="xs:string" use="required"/>
+    <xs:attribute name="state" type="xs:string" use="required"/>
+    <xs:attribute name="lastStateUpdateTime" type="xs:dateTime" use="required"/>
+  </xs:complexType>
+
+  <xs:complexType name="PackageType">
+    <xs:sequence>
+      <xs:element name="urls" type="xs:string" maxOccurs="unbounded"/>
+    </xs:sequence>
+    <xs:attribute name="kind" type="xs:string" use="required"/>
+  </xs:complexType>
+
+  <xs:complexType name="stack">
+    <xs:sequence>
+      <xs:element name="repositories" type="PackageType" minOccurs="0" maxOccurs="unbounded"/>
+      <xs:element ref="configuration" minOccurs="0"/>
+      <xs:element name="components" type="CategoryType" minOccurs="0" maxOccurs="unbounded"/>
+    </xs:sequence>
+    <xs:attribute name="name" type="xs:string"/>
+    <xs:attribute name="revision" type="xs:string"/>
+    <xs:attribute name="parentName" type="xs:string"/>
+    <xs:attribute name="parentRevision" type="xs:string"/>
+    <xs:attribute name="creationTime" type="xs:dateTime"/>
+  </xs:complexType>
+
+  <xs:complexType name="StackInformation">
+    <xs:sequence>
+      <xs:element name="component" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+    </xs:sequence>
+    <xs:attribute name="name" type="xs:string"/>
+    <xs:attribute name="revision" type="xs:string"/>
+    <xs:attribute name="parentName" type="xs:string"/>
+    <xs:attribute name="parentRevision" type="xs:string"/>
+    <xs:attribute name="creationTime" type="xs:dateTime"/>
+  </xs:complexType>
+</xs:schema>
+



Mime
View raw message