Python wrapper for Hadoop YARN REST API
Project description
Hadoop YARN Rest API
This is Python Library for Hadoop YARN rest api.
This project follows the Resource Manager Rest document.
Usage
install
pip install hadoop-yarn-rest-api
Example
#!/usr/bin/env python
# -*- coding: utf-8 -*-
if __name__ == '__main__':
yarn_url = "http://localhost:8088"
response_type = "json"
yarn = Yarn(yarn_url, response_type)
response_obj = yarn.cluster_information()
response_obj = yarn.cluster_metrics()
response_obj = yarn.cluster_scheduler()
response_obj = yarn.cluster_applications()
response_obj = yarn.cluster_applications({"limit":100})
response_obj = yarn.cluster_appstatistics()
response_obj = yarn.cluster_appstatistics({"states":"accepted,running,finished","applicationTypes":"mapreduce"})
response_obj = yarn.cluster_application("job_id")
response_obj = yarn.cluster_application_attempts("job_id")
response_obj = yarn.cluster_nodes()
response_obj = yarn.cluster_nodes({"states":"RUNNING"}) # NEW, RUNNING, UNHEALTHY, DECOMMISSIONING, DECOMMISSIONED, LOST, REBOOTED, SHUTDOWN
response_obj = yarn.cluster_node("node_id")
if yarn.response_type == 'json':
print(json.dumps(response_obj, indent=4, sort_keys=True))
elif yarn.response_type == 'xml':
print(xml.dom.minidom.parseString(ET.tostring(response_obj)).toprettyxml())
else:
print(response_obj)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for hadoop_yarn_rest_api-0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36f2206be0700d39cb131fe5669bd21ca7c77b5fdf02ba3b38ac95512f407298 |
|
MD5 | a4c15f1362fb4bc2c37ea210a23b4cec |
|
BLAKE2b-256 | 2c8b9ffaacf4401011622937a0bec9e339bb0304028a12e328675d56b09113ad |