Repository: ambari
Updated Branches:
  refs/heads/trunk 4e1519095 -> e8f7aa1e5


AMBARI-5118. Update Request resource API doc. (swagle)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/e8f7aa1e
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e8f7aa1e
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e8f7aa1e

Branch: refs/heads/trunk
Commit: e8f7aa1e57f34b77e9b6c2af2b70d6392a7fa7d0
Parents: 4e15190
Author: Siddharth Wagle <[email protected]>
Authored: Mon Mar 17 15:28:37 2014 -0700
Committer: Siddharth Wagle <[email protected]>
Committed: Mon Mar 17 15:28:37 2014 -0700

----------------------------------------------------------------------
 ambari-server/docs/api/v1/request-resources.md | 45 +++++++++++++++++++++
 ambari-server/docs/api/v1/request_resources.md | 45 ---------------------
 ambari-server/docs/api/v1/requests.md          | 23 +++++++++++
 3 files changed, 68 insertions(+), 45 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/e8f7aa1e/ambari-server/docs/api/v1/request-resources.md
----------------------------------------------------------------------
diff --git a/ambari-server/docs/api/v1/request-resources.md 
b/ambari-server/docs/api/v1/request-resources.md
new file mode 100644
index 0000000..0618214
--- /dev/null
+++ b/ambari-server/docs/api/v1/request-resources.md
@@ -0,0 +1,45 @@
+<!---
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# Request Resources
+ 
+ 
+###API Summary 
+
+- [List requests](requests.md)
+
+###Properties
+
+<table>
+  <tr>
+    <th>Property</th>
+    <th>Description</th>
+  </tr>
+  <tr>
+    <td>Requests/id</td>
+    <td>The request id</td>  
+  </tr>
+  <tr>
+    <td>Requests/cluster_name</td>
+    <td>The name of the parent cluster</td>  
+  </tr>
+  <tr>
+    <td>Requests/request_context</td>
+    <td>The context</td>  
+  </tr>
+</table>
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/e8f7aa1e/ambari-server/docs/api/v1/request_resources.md
----------------------------------------------------------------------
diff --git a/ambari-server/docs/api/v1/request_resources.md 
b/ambari-server/docs/api/v1/request_resources.md
deleted file mode 100644
index 0618214..0000000
--- a/ambari-server/docs/api/v1/request_resources.md
+++ /dev/null
@@ -1,45 +0,0 @@
-<!---
-Licensed to the Apache Software Foundation (ASF) under one or more
-contributor license agreements. See the NOTICE file distributed with
-this work for additional information regarding copyright ownership.
-The ASF licenses this file to You under the Apache License, Version 2.0
-(the "License"); you may not use this file except in compliance with
-the License. You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
--->
-
-# Request Resources
- 
- 
-###API Summary 
-
-- [List requests](requests.md)
-
-###Properties
-
-<table>
-  <tr>
-    <th>Property</th>
-    <th>Description</th>
-  </tr>
-  <tr>
-    <td>Requests/id</td>
-    <td>The request id</td>  
-  </tr>
-  <tr>
-    <td>Requests/cluster_name</td>
-    <td>The name of the parent cluster</td>  
-  </tr>
-  <tr>
-    <td>Requests/request_context</td>
-    <td>The context</td>  
-  </tr>
-</table>
-

http://git-wip-us.apache.org/repos/asf/ambari/blob/e8f7aa1e/ambari-server/docs/api/v1/requests.md
----------------------------------------------------------------------
diff --git a/ambari-server/docs/api/v1/requests.md 
b/ambari-server/docs/api/v1/requests.md
index 474ea85..b19dc4d 100644
--- a/ambari-server/docs/api/v1/requests.md
+++ b/ambari-server/docs/api/v1/requests.md
@@ -88,3 +88,26 @@ Get the collection of the requests for the cluster named 
"c1".
           }
         ]      
     }          
+
+
+Post on a request resource allows the user to execute Custom commands or 
custom actions on resources identified by a resource filter.
+Custom Command - A command script defined for Services in the Ambari Services 
stack and identified by a command name. Example: Restart, Service checks / 
Decommission slave component.
+Custom Action - A command script defined in the stack under custom_actions and 
identified by the action definition specified in 
/custom_action_definitions/system_action_definitions.xml.
+
+    POST http://your.ambari.server/api/v1/clusters/c1/requests
+
+    202 Created
+    {
+       "RequestInfo": {
+          "context": "Restart DataNode",
+          "command": "RESTART"
+       },
+       "Requests/resource_filters": [
+          {
+             "service_name": "HDFS",
+             "component_name": "NAMENODE",
+             "hosts": "host1,host2,host3"
+          }
+       ]
+    }
+

Reply via email to