Apache Ambari BOF Meet Up @ Hadoop Summit 2013 APIs and SPIs – How to Integrate with Ambari http://www.meetup.com/Apache-Ambari-User-Group/events/119184782/
Citation preview
1. Hortonworks Inc. 2013 Ambari API June 25, 2013 Page 1
2. Hortonworks Inc. 2013 Agenda API Overview Monitoring API
Constructs Management Page 2
3. Hortonworks Inc. 2013 API Overview - Features REST
Monitoring and Management of Hadoop Cluster Partial Response Query
Predicates Page 3
5. Hortonworks Inc. 2013 API Overview Resource Types Collection
Resource: This resource type doesnt refer to any specific resource;
rather it refers to a collection of resources. For example:
api/v1/clusters/cluster1/services Returns a collection of services
Instance Resource: This resource type refers to a single specific
resource. For example: api/v1/clusters/cluster1/services/HDFS
Refers to the service resource identified by the id HDFS. Page
5
6. Hortonworks Inc. 2013 API Overview - Response JSON
Collection resource Always includes request href. Inlcludes items
of the collection. Each item includes href and primary id fields.
Instance resource Always includes request href. Always includes
primary id fields. May include metrics and properties for instance.
May include href and primary id fields for sub-resources. Page
6
9. Hortonworks Inc. 2013 API Constructs Partial Response Used
to control which fields are returned by a query. restrict which
fields are returned. reach down and return data from sub-resources.
Properties, categories and sub-resources can be specified. The
wildcard * can be used to show all categories, fields and
sub-resources. provides expand functionality for sub-components.
Primary id fields of a resource are always shown regardless of the
specifies partial response. Page 9
12. Hortonworks Inc. 2013 API Constructs Query Predicates
Limits the set of resources returned by a query. Consists of at
least one relational expression. Can only be applied to collection
resources. Relational operators ( =, !=, , = ) Logical operators (
|, &, !) Functions (in(), isEmpty()) Brackets can be used to
provide explicit grouping of expressions. Expressions within
brackets have the highest precedence. Page 12
14. Hortonworks Inc. 2013 Management - Create Create a
resource. Example: Create a cluster named c1 with the property
Clusters/version = HDP-1.2.0 POST http://:8080/api/v1/clusters/c1 {
"Clusters": { "version" : "HDP-1.2.0 } } Page 14
15. Hortonworks Inc. 2013 Management - Update Update a
resource. Example: Update the state of all INSTALLED services to be
STARTED PUT http://:8080/api/v1/clusters/c1/services?ServiceInf
o/state=INSTALLED { "ServiceInfo": { "state" : "STARTED } } Page
15
16. Hortonworks Inc. 2013 Management - Delete Delete a
resource. Example: Delete the cluster named c1 DELETE
http://:8080/api/v1/clusters/c1 Page 16