Welcome to Cloudera Manager API Client!
Python Client
=============
The python source is in the `python` directory. The Python client comes with a
`cm_api` Python client module, and examples on performing certain Hadoop cluster
administrative tasks using the Python client.
Getting Started
---------------
Here is a short snippet on using the `cm_api` Python client:
Python 2.7.2+ (default, Oct 4 2011, 20:06:09)
[GCC 4.6.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from cm_api.api_client import ApiResource
>>> api = ApiResource('rhel62-1.ent.cloudera.com', 7180, 'admin', 'admin')
>>> for h in api.get_all_hosts():
... print h.hostname
...
rhel62-2.ent.cloudera.com
rhel62-4.ent.cloudera.com
rhel62-3.ent.cloudera.com
rhel62-1.ent.cloudera.com
>>>
Another example: getting all the services in a cluster:
>>> for c in api.get_all_clusters():
... print c.name
...
Cluster 1 - CDH4
>>> for s in api.get_cluster('Cluster 1 - CDH4').get_all_services():
... print s.name
...
hdfs1
mapreduce1
zookeeper1
hbase1
oozie1
yarn1
hue1
>>>
Shell
-----
After installing the `cm_api` Python package, you can use the API shell `cmps`
(CM Python Shell):
$ cmps -H <host> --user admin --password admin
Welcome to the Cloudera Manager Console
Select a cluster using 'show clusters' and 'use'
cloudera> show clusters
+------------------+
| CLUSTER NAME |
+------------------+
| Cluster 1 - CDH4 |
| Cluster 2 - CDH3 |
+------------------+
cloudera>
Please see the `SHELL_README.md` file for more.
Example Scripts
---------------
You can find example scripts in the `python/examples` directory.
* `bulk_config_update.py` ---
Useful for heterogenous hardware environment. It sets the configuration on
the roles running on a given set of hosts.
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
共36个文件
py:25个
txt:5个
pkg-info:2个
资源分类:Python库 所属语言:Python 资源全名:cm_api-19.1.1.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
资源推荐
资源详情
资源评论
收起资源包目录
cm_api-19.1.1.tar.gz (36个子文件)
cm_api-19.1.1
MANIFEST.in 18B
PKG-INFO 529B
src
cm_api
endpoints
host_templates.py 6KB
tools.py 1KB
events.py 2KB
users.py 4KB
types.py 43KB
batch.py 1KB
role_config_groups.py 8KB
cms.py 21KB
__init__.py 0B
dashboards.py 2KB
timeseries.py 7KB
services.py 75KB
parcels.py 5KB
clusters.py 24KB
roles.py 9KB
external_accounts.py 7KB
hosts.py 8KB
resource.py 5KB
http_client.py 8KB
__init__.py 0B
api_client.py 12KB
cm_shell
cmps.py 21KB
__init__.py 0B
prettytable.py 38KB
cm_api.egg-info
PKG-INFO 529B
requires.txt 24B
SOURCES.txt 1000B
entry_points.txt 45B
top_level.txt 16B
dependency_links.txt 1B
zip-safe 1B
setup.cfg 38B
setup.py 3KB
README.md 2KB
共 36 条
- 1
资源评论
挣扎的蓝藻
- 粉丝: 13w+
- 资源: 15万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于C和C++的二维绘制工具设计源码 - DrawPro
- Object.defineProperty 的 IE 补丁object-defineproperty-ie-master.zip
- 整卷预览.mhtml
- MySQL是一种广泛使用的开源关系型数据库管理系统,它提供了丰富的SQL语句用于数据库的创建、查询、更新和管理 以下是一些常见的
- MySQL是一种广泛使用的开源关系型数据库管理系统,它提供了丰富的SQL语句用于数据库的创建、查询、更新和管理 以下是一些常见
- MySQL是一种广泛使用的开源关系型数据库管理系统,它提供了丰富的SQL语句用于数据库的创建、查询、更新和管理 以下是一些常见的
- 基于Javascript的结婚请帖设计源码 - Invitation
- mysql语句大全及用法
- mysql语句大全及用法
- mysql语句大全及用法
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功