SlideShare una empresa de Scribd logo
1 de 17
© Hortonworks Inc. 2013
Ambari
API
June 25, 2013
Page 1
© Hortonworks Inc. 2013
Agenda
• API Overview
• Monitoring
• API Constructs
• Management
Page 2
© Hortonworks Inc. 2013
API Overview - Features
• REST
• Monitoring and Management of Hadoop Cluster
• Partial Response
• Query Predicates
Page 3
© Hortonworks Inc. 2013
Monitoring
• Read state of Hadoop resources.
Example:
api/v1/clusters/cluster1/services/HDFS/components/NAMENODE
{
"href" : "http://ec2…1/services/HDFS/components/NAMENODE",
"metrics" : {
"boottime" : 1.364912931E9,
"process" : {
"proc_total" : 752.333333333,
"proc_run" : 1.64444444444
},
"rpc" : {
"rpcAuthorizationSuccesses" : 141,
"SentBytes" : 251758,
"rpcAuthorizationFailures" : 0,…
Page 4
© Hortonworks Inc. 2013
API Overview – Resource Types
• Collection Resource: This resource type doesn’t 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
© 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
© Hortonworks Inc. 2013
API Overview - Response
Collection Resource Response Example:
api/v1/clusters/cluster1/services/
{
"href" : "http://ec2…api/v1/clusters/cluster1/services/",
"items" : [
{
"href" : "http://ec2…/clusters/cluster1/services/HDFS",
"ServiceInfo" : {
"cluster_name" : "cluster1",
"service_name" : "HDFS"
}
},
{
"href" : "http://ec2…/cluster1/services/MAPREDUCE",…
Page 7
© Hortonworks Inc. 2013
API Overview - Response
Instance Resource Response Example:
api/v1/clusters/cluster1
{
"href" : "http://ec2...com:8080/api/v1/clusters/cluster1",
"Clusters" : {
"cluster_name" : "cluster1",
"cluster_id" : 1,
"version" : "HDP-1.2.1"
},
"services" : [
{
"href" :
"http://ec2...com:8080/api/v1/clusters/cluster1/services/MAPR
EDUCE",
"ServiceInfo" : {
"cluster_name" : "cluster1",
"service_name" : "MAPREDUCE"
}
}, …
Page 8
© 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
© Hortonworks Inc. 2013
API Constructs – Partial Response
Query Specific Field Example:
api/v1/clusters/cluster1/services/MAPREDUCE/components/JOBTRACKE
R?fields=metrics/rpc/SentBytes
{
"href" :
"http://…/api/v1/clusters/cluster1/services/MAPREDUCE/components/
JOBTRACKER?fields=metrics/rpc/SentBytes",
"metrics" : {
"rpc" : {
"SentBytes" : 2763921
}
},
"ServiceComponentInfo" : {
"cluster_name" : "cluster1",
"component_name" : "JOBTRACKER",
"service_name" : "MAPREDUCE"
}
}
Page 10
© Hortonworks Inc. 2013
API Constructs – Partial Response
Expand Sub-Resource Example:
api/v1/clusters/cluster1/services/MAPREDUCE?fields=components/met
rics/jvm/gcCount
{
"href" :
"http://…/services/MAPREDUCE?fields=components/metrics/jvm/gc
Count",
…
},
"components" : [
{
"href" : "http://…/MAPREDUCE/components/JOBTRACKER",
"metrics" : {
"jvm" : {
"gcCount" : 47
}
},…
Page 11
© 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
© Hortonworks Inc. 2013
API Constructs – Query Predicates
Query For Started Services Example:
api/v1/clusters/cluster1/services?ServiceInfo/state=STARTED
{
"href" :
"http://…/clusters/cluster1/services?ServiceInfo/state=STARTE
D",
"items" : [
{
"href" : "http://…/clusters/cluster1/services/NAGIOS",
"ServiceInfo" : {
"cluster_name" : "cluster1",
"state" : "STARTED",
"service_name" : "NAGIOS"
}
},…
Page 13
© 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
© 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
© Hortonworks Inc. 2013
Management - Delete
• Delete a resource.
Example:
Delete the cluster named „c1‟
DELETE http://…:8080/api/v1/clusters/c1
Page 16
© Hortonworks Inc. 2013:
Q & A
Page 17

Más contenido relacionado

La actualidad más candente

Managing 2000 Node Cluster with Ambari
Managing 2000 Node Cluster with AmbariManaging 2000 Node Cluster with Ambari
Managing 2000 Node Cluster with Ambari
DataWorks Summit
 
Ambari Meetup: Ambari Futures
Ambari Meetup: Ambari FuturesAmbari Meetup: Ambari Futures
Ambari Meetup: Ambari Futures
Hortonworks
 

La actualidad más candente (20)

Apache Ambari - What's New in 2.0.0
Apache Ambari - What's New in 2.0.0Apache Ambari - What's New in 2.0.0
Apache Ambari - What's New in 2.0.0
 
Managing 2000 Node Cluster with Ambari
Managing 2000 Node Cluster with AmbariManaging 2000 Node Cluster with Ambari
Managing 2000 Node Cluster with Ambari
 
Hortonworks technical workshop operations with ambari
Hortonworks technical workshop   operations with ambariHortonworks technical workshop   operations with ambari
Hortonworks technical workshop operations with ambari
 
Hortonworks Technical Workshop: Apache Ambari
Hortonworks Technical Workshop:   Apache AmbariHortonworks Technical Workshop:   Apache Ambari
Hortonworks Technical Workshop: Apache Ambari
 
Ambari Views - Overview
Ambari Views - OverviewAmbari Views - Overview
Ambari Views - Overview
 
Streamline Hadoop DevOps with Apache Ambari
Streamline Hadoop DevOps with Apache AmbariStreamline Hadoop DevOps with Apache Ambari
Streamline Hadoop DevOps with Apache Ambari
 
Apache Slider
Apache SliderApache Slider
Apache Slider
 
Hortonworks Technical Workshop: Interactive Query with Apache Hive
Hortonworks Technical Workshop: Interactive Query with Apache Hive Hortonworks Technical Workshop: Interactive Query with Apache Hive
Hortonworks Technical Workshop: Interactive Query with Apache Hive
 
Ambari Meetup: Ambari Futures
Ambari Meetup: Ambari FuturesAmbari Meetup: Ambari Futures
Ambari Meetup: Ambari Futures
 
Hadoop Summit 2012 | A New Generation of Data Transfer Tools for Hadoop: Sqoop 2
Hadoop Summit 2012 | A New Generation of Data Transfer Tools for Hadoop: Sqoop 2Hadoop Summit 2012 | A New Generation of Data Transfer Tools for Hadoop: Sqoop 2
Hadoop Summit 2012 | A New Generation of Data Transfer Tools for Hadoop: Sqoop 2
 
Apache Ambari - What's New in 2.4
Apache Ambari - What's New in 2.4 Apache Ambari - What's New in 2.4
Apache Ambari - What's New in 2.4
 
Slider: Applications on YARN
Slider: Applications on YARNSlider: Applications on YARN
Slider: Applications on YARN
 
Ambari Meetup: YARN
Ambari Meetup: YARNAmbari Meetup: YARN
Ambari Meetup: YARN
 
Apache Ambari: Simplified Hadoop Cluster Operation & Troubleshooting
Apache Ambari: Simplified Hadoop Cluster Operation & TroubleshootingApache Ambari: Simplified Hadoop Cluster Operation & Troubleshooting
Apache Ambari: Simplified Hadoop Cluster Operation & Troubleshooting
 
Apache Ambari Stack Extensibility
Apache Ambari Stack ExtensibilityApache Ambari Stack Extensibility
Apache Ambari Stack Extensibility
 
Apache Ambari - What's New in 2.1
Apache Ambari - What's New in 2.1Apache Ambari - What's New in 2.1
Apache Ambari - What's New in 2.1
 
Hive on spark berlin buzzwords
Hive on spark berlin buzzwordsHive on spark berlin buzzwords
Hive on spark berlin buzzwords
 
Streamline Hadoop DevOps with Apache Ambari
Streamline Hadoop DevOps with Apache AmbariStreamline Hadoop DevOps with Apache Ambari
Streamline Hadoop DevOps with Apache Ambari
 
Past, Present and Future of Apache Ambari
Past, Present and Future of Apache AmbariPast, Present and Future of Apache Ambari
Past, Present and Future of Apache Ambari
 
Kafka Security
Kafka SecurityKafka Security
Kafka Security
 

Similar a Apache Ambari BOF - APIs - Hadoop Summit 2013

Innovate2014 Better Integrations Through Open Interfaces
Innovate2014 Better Integrations Through Open InterfacesInnovate2014 Better Integrations Through Open Interfaces
Innovate2014 Better Integrations Through Open Interfaces
Steve Speicher
 
Plugins on OnDemand with Remote Apps - Atlassian Summit 2012
Plugins on OnDemand with Remote Apps - Atlassian Summit 2012 Plugins on OnDemand with Remote Apps - Atlassian Summit 2012
Plugins on OnDemand with Remote Apps - Atlassian Summit 2012
Atlassian
 

Similar a Apache Ambari BOF - APIs - Hadoop Summit 2013 (20)

Innovate2014 Better Integrations Through Open Interfaces
Innovate2014 Better Integrations Through Open InterfacesInnovate2014 Better Integrations Through Open Interfaces
Innovate2014 Better Integrations Through Open Interfaces
 
Webinar: What's new in CDAP 3.5?
Webinar: What's new in CDAP 3.5?Webinar: What's new in CDAP 3.5?
Webinar: What's new in CDAP 3.5?
 
REST API Best Practices & Implementing in Codeigniter
REST API Best Practices & Implementing in CodeigniterREST API Best Practices & Implementing in Codeigniter
REST API Best Practices & Implementing in Codeigniter
 
Java colombo-deep-dive-into-jax-rs
Java colombo-deep-dive-into-jax-rsJava colombo-deep-dive-into-jax-rs
Java colombo-deep-dive-into-jax-rs
 
Introduction to CloudStack API
Introduction to CloudStack APIIntroduction to CloudStack API
Introduction to CloudStack API
 
REST APIs
REST APIsREST APIs
REST APIs
 
Hortonworks Technical Workshop - build a yarn ready application with apache ...
Hortonworks Technical Workshop -  build a yarn ready application with apache ...Hortonworks Technical Workshop -  build a yarn ready application with apache ...
Hortonworks Technical Workshop - build a yarn ready application with apache ...
 
Service Discovery using etcd, Consul and Kubernetes
Service Discovery using etcd, Consul and KubernetesService Discovery using etcd, Consul and Kubernetes
Service Discovery using etcd, Consul and Kubernetes
 
Kasten securing access to your kubernetes applications
Kasten securing access to your kubernetes applicationsKasten securing access to your kubernetes applications
Kasten securing access to your kubernetes applications
 
Oracle GoldenGate 18c - REST API Examples
Oracle GoldenGate 18c - REST API ExamplesOracle GoldenGate 18c - REST API Examples
Oracle GoldenGate 18c - REST API Examples
 
Andrei shakirin rest_cxf
Andrei shakirin rest_cxfAndrei shakirin rest_cxf
Andrei shakirin rest_cxf
 
Building Tomorrow's Web Services
Building Tomorrow's Web ServicesBuilding Tomorrow's Web Services
Building Tomorrow's Web Services
 
Operator SDK for K8s using Go
Operator SDK for K8s using GoOperator SDK for K8s using Go
Operator SDK for K8s using Go
 
App auto crud
App auto crudApp auto crud
App auto crud
 
ITB2016 - Building ColdFusion RESTFul Services
ITB2016 - Building ColdFusion RESTFul ServicesITB2016 - Building ColdFusion RESTFul Services
ITB2016 - Building ColdFusion RESTFul Services
 
Plugins on OnDemand with Remote Apps - Atlassian Summit 2012
Plugins on OnDemand with Remote Apps - Atlassian Summit 2012 Plugins on OnDemand with Remote Apps - Atlassian Summit 2012
Plugins on OnDemand with Remote Apps - Atlassian Summit 2012
 
OData: Universal Data Solvent or Clunky Enterprise Goo? (GlueCon 2015)
OData: Universal Data Solvent or Clunky Enterprise Goo? (GlueCon 2015)OData: Universal Data Solvent or Clunky Enterprise Goo? (GlueCon 2015)
OData: Universal Data Solvent or Clunky Enterprise Goo? (GlueCon 2015)
 
XSEDE14 SciGaP-Apache Airavata Tutorial
XSEDE14 SciGaP-Apache Airavata TutorialXSEDE14 SciGaP-Apache Airavata Tutorial
XSEDE14 SciGaP-Apache Airavata Tutorial
 
Mój przepis na skalowalną architekturę mikroserwisową? Apollo Federation i Gr...
Mój przepis na skalowalną architekturę mikroserwisową? Apollo Federation i Gr...Mój przepis na skalowalną architekturę mikroserwisową? Apollo Federation i Gr...
Mój przepis na skalowalną architekturę mikroserwisową? Apollo Federation i Gr...
 
Introduction to Laravel Framework (5.2)
Introduction to Laravel Framework (5.2)Introduction to Laravel Framework (5.2)
Introduction to Laravel Framework (5.2)
 

Más de Hortonworks

Más de Hortonworks (20)

Hortonworks DataFlow (HDF) 3.3 - Taking Stream Processing to the Next Level
Hortonworks DataFlow (HDF) 3.3 - Taking Stream Processing to the Next LevelHortonworks DataFlow (HDF) 3.3 - Taking Stream Processing to the Next Level
Hortonworks DataFlow (HDF) 3.3 - Taking Stream Processing to the Next Level
 
IoT Predictions for 2019 and Beyond: Data at the Heart of Your IoT Strategy
IoT Predictions for 2019 and Beyond: Data at the Heart of Your IoT StrategyIoT Predictions for 2019 and Beyond: Data at the Heart of Your IoT Strategy
IoT Predictions for 2019 and Beyond: Data at the Heart of Your IoT Strategy
 
Getting the Most Out of Your Data in the Cloud with Cloudbreak
Getting the Most Out of Your Data in the Cloud with CloudbreakGetting the Most Out of Your Data in the Cloud with Cloudbreak
Getting the Most Out of Your Data in the Cloud with Cloudbreak
 
Johns Hopkins - Using Hadoop to Secure Access Log Events
Johns Hopkins - Using Hadoop to Secure Access Log EventsJohns Hopkins - Using Hadoop to Secure Access Log Events
Johns Hopkins - Using Hadoop to Secure Access Log Events
 
Catch a Hacker in Real-Time: Live Visuals of Bots and Bad Guys
Catch a Hacker in Real-Time: Live Visuals of Bots and Bad GuysCatch a Hacker in Real-Time: Live Visuals of Bots and Bad Guys
Catch a Hacker in Real-Time: Live Visuals of Bots and Bad Guys
 
HDF 3.2 - What's New
HDF 3.2 - What's NewHDF 3.2 - What's New
HDF 3.2 - What's New
 
Curing Kafka Blindness with Hortonworks Streams Messaging Manager
Curing Kafka Blindness with Hortonworks Streams Messaging ManagerCuring Kafka Blindness with Hortonworks Streams Messaging Manager
Curing Kafka Blindness with Hortonworks Streams Messaging Manager
 
Interpretation Tool for Genomic Sequencing Data in Clinical Environments
Interpretation Tool for Genomic Sequencing Data in Clinical EnvironmentsInterpretation Tool for Genomic Sequencing Data in Clinical Environments
Interpretation Tool for Genomic Sequencing Data in Clinical Environments
 
IBM+Hortonworks = Transformation of the Big Data Landscape
IBM+Hortonworks = Transformation of the Big Data LandscapeIBM+Hortonworks = Transformation of the Big Data Landscape
IBM+Hortonworks = Transformation of the Big Data Landscape
 
Premier Inside-Out: Apache Druid
Premier Inside-Out: Apache DruidPremier Inside-Out: Apache Druid
Premier Inside-Out: Apache Druid
 
Accelerating Data Science and Real Time Analytics at Scale
Accelerating Data Science and Real Time Analytics at ScaleAccelerating Data Science and Real Time Analytics at Scale
Accelerating Data Science and Real Time Analytics at Scale
 
TIME SERIES: APPLYING ADVANCED ANALYTICS TO INDUSTRIAL PROCESS DATA
TIME SERIES: APPLYING ADVANCED ANALYTICS TO INDUSTRIAL PROCESS DATATIME SERIES: APPLYING ADVANCED ANALYTICS TO INDUSTRIAL PROCESS DATA
TIME SERIES: APPLYING ADVANCED ANALYTICS TO INDUSTRIAL PROCESS DATA
 
Blockchain with Machine Learning Powered by Big Data: Trimble Transportation ...
Blockchain with Machine Learning Powered by Big Data: Trimble Transportation ...Blockchain with Machine Learning Powered by Big Data: Trimble Transportation ...
Blockchain with Machine Learning Powered by Big Data: Trimble Transportation ...
 
Delivering Real-Time Streaming Data for Healthcare Customers: Clearsense
Delivering Real-Time Streaming Data for Healthcare Customers: ClearsenseDelivering Real-Time Streaming Data for Healthcare Customers: Clearsense
Delivering Real-Time Streaming Data for Healthcare Customers: Clearsense
 
Making Enterprise Big Data Small with Ease
Making Enterprise Big Data Small with EaseMaking Enterprise Big Data Small with Ease
Making Enterprise Big Data Small with Ease
 
Webinewbie to Webinerd in 30 Days - Webinar World Presentation
Webinewbie to Webinerd in 30 Days - Webinar World PresentationWebinewbie to Webinerd in 30 Days - Webinar World Presentation
Webinewbie to Webinerd in 30 Days - Webinar World Presentation
 
Driving Digital Transformation Through Global Data Management
Driving Digital Transformation Through Global Data ManagementDriving Digital Transformation Through Global Data Management
Driving Digital Transformation Through Global Data Management
 
HDF 3.1 pt. 2: A Technical Deep-Dive on New Streaming Features
HDF 3.1 pt. 2: A Technical Deep-Dive on New Streaming FeaturesHDF 3.1 pt. 2: A Technical Deep-Dive on New Streaming Features
HDF 3.1 pt. 2: A Technical Deep-Dive on New Streaming Features
 
Hortonworks DataFlow (HDF) 3.1 - Redefining Data-In-Motion with Modern Data A...
Hortonworks DataFlow (HDF) 3.1 - Redefining Data-In-Motion with Modern Data A...Hortonworks DataFlow (HDF) 3.1 - Redefining Data-In-Motion with Modern Data A...
Hortonworks DataFlow (HDF) 3.1 - Redefining Data-In-Motion with Modern Data A...
 
Unlock Value from Big Data with Apache NiFi and Streaming CDC
Unlock Value from Big Data with Apache NiFi and Streaming CDCUnlock Value from Big Data with Apache NiFi and Streaming CDC
Unlock Value from Big Data with Apache NiFi and Streaming CDC
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 

Apache Ambari BOF - APIs - Hadoop Summit 2013

  • 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
  • 4. © Hortonworks Inc. 2013 Monitoring • Read state of Hadoop resources. Example: api/v1/clusters/cluster1/services/HDFS/components/NAMENODE { "href" : "http://ec2…1/services/HDFS/components/NAMENODE", "metrics" : { "boottime" : 1.364912931E9, "process" : { "proc_total" : 752.333333333, "proc_run" : 1.64444444444 }, "rpc" : { "rpcAuthorizationSuccesses" : 141, "SentBytes" : 251758, "rpcAuthorizationFailures" : 0,… Page 4
  • 5. © Hortonworks Inc. 2013 API Overview – Resource Types • Collection Resource: This resource type doesn’t 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
  • 7. © Hortonworks Inc. 2013 API Overview - Response Collection Resource Response Example: api/v1/clusters/cluster1/services/ { "href" : "http://ec2…api/v1/clusters/cluster1/services/", "items" : [ { "href" : "http://ec2…/clusters/cluster1/services/HDFS", "ServiceInfo" : { "cluster_name" : "cluster1", "service_name" : "HDFS" } }, { "href" : "http://ec2…/cluster1/services/MAPREDUCE",… Page 7
  • 8. © Hortonworks Inc. 2013 API Overview - Response Instance Resource Response Example: api/v1/clusters/cluster1 { "href" : "http://ec2...com:8080/api/v1/clusters/cluster1", "Clusters" : { "cluster_name" : "cluster1", "cluster_id" : 1, "version" : "HDP-1.2.1" }, "services" : [ { "href" : "http://ec2...com:8080/api/v1/clusters/cluster1/services/MAPR EDUCE", "ServiceInfo" : { "cluster_name" : "cluster1", "service_name" : "MAPREDUCE" } }, … Page 8
  • 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
  • 10. © Hortonworks Inc. 2013 API Constructs – Partial Response Query Specific Field Example: api/v1/clusters/cluster1/services/MAPREDUCE/components/JOBTRACKE R?fields=metrics/rpc/SentBytes { "href" : "http://…/api/v1/clusters/cluster1/services/MAPREDUCE/components/ JOBTRACKER?fields=metrics/rpc/SentBytes", "metrics" : { "rpc" : { "SentBytes" : 2763921 } }, "ServiceComponentInfo" : { "cluster_name" : "cluster1", "component_name" : "JOBTRACKER", "service_name" : "MAPREDUCE" } } Page 10
  • 11. © Hortonworks Inc. 2013 API Constructs – Partial Response Expand Sub-Resource Example: api/v1/clusters/cluster1/services/MAPREDUCE?fields=components/met rics/jvm/gcCount { "href" : "http://…/services/MAPREDUCE?fields=components/metrics/jvm/gc Count", … }, "components" : [ { "href" : "http://…/MAPREDUCE/components/JOBTRACKER", "metrics" : { "jvm" : { "gcCount" : 47 } },… Page 11
  • 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
  • 13. © Hortonworks Inc. 2013 API Constructs – Query Predicates Query For Started Services Example: api/v1/clusters/cluster1/services?ServiceInfo/state=STARTED { "href" : "http://…/clusters/cluster1/services?ServiceInfo/state=STARTE D", "items" : [ { "href" : "http://…/clusters/cluster1/services/NAGIOS", "ServiceInfo" : { "cluster_name" : "cluster1", "state" : "STARTED", "service_name" : "NAGIOS" } },… Page 13
  • 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
  • 17. © Hortonworks Inc. 2013: Q & A Page 17