赞
踩
curl -u 'admin:xxxx' http://<ip or hostname>:<port>/api/v1/clusters
"Clusters" : {
"cluster_name" : "xxxxxx-xxxx"
}
curl -u 'admin:xxxx' http://<ip or hostname>:<port>/api/v1/clusters/{$cluster_name}
curl -u 'admin:xxxx' http://<ip or hostname>:<port>//api/v1/clusters/{$cluster_name}/hosts
"Hosts" : {
"cluster_name" : "xxxxxx-xxxx",
"host_name" : "core-xxxx"
}
curl -u 'admin:xxxx' http://<ip or hostname>:<port>//api/v1/clusters/{$cluster_name}/hosts/{$host_name}
curl -u 'admin:xxxx' http://<ip or hostname>:<port>/api/v1/clusters/{$cluster_name}/hosts/{$host_name}?fields={$item} curl -u 'admin:xxxx' http://<ip or hostname>:<port>/api/v1/clusters/{$cluster_name}/hosts/{$host_name}?fields=Hosts 配置 描述 Hosts/host_name 主机名 Hosts/ip 主机ip地址 Hosts/total_mem 主机上可用总内存 Hosts/cpu_count 主机cpu数量 Hosts/os_arch 主机的操作系统架构(例如x86_64) Hosts/os_type 主机的操作系统类型(例如 centos 6) Hosts/disk_info 主机磁盘信息 Hosts/host_status 主机状态(未知,健康,不健康) Hosts/host_state 主机状态 主机状态 描述 INIT 初始化主机状态 WAITING_FOR_HOST_STATUS_UPDATES 等待主机更新状态 HEALTHY 主机状态正常 HEARTBEAT_LOST 主机心跳丢失 UNHEALTHY 不健康状态 # 也单独查询 curl -u 'admin:xxxx' http://<ip or hostname>:<port>/api/v1/clusters/{$cluster_name}/hosts/{$host_name}?fields=Hosts/disk_info
curl -u 'admin:xxxx' http://<ip or hostname>:<port>/api/v1/clusters/{$cluster_name}/services
"ServiceInfo" : {
"cluster_name" : "xxxxxx-xxxx",
"service_name" : "YARN"
}
curl -u 'admin:xxxx' http://<ip or hostname>:<port>/api/v1/clusters/{$cluster_name}/services/{$service_name}
# 获取子项信息 curl -u 'admin:xxxx' http://<ip or hostname>:<port>/api/v1/clusters/{$cluster_name}/services/{$service_name}?fields={$item} # 获取基本信息 curl -u 'admin:xxxx' http://<ip or hostname>:<port>/api/v1/clusters/{$cluster_name}/services/{$service_name}?fields=ServiceInfo ServiceInfo/state 服务当前状态 状态 描述 INIT 初始状态 INSTALLING 服务安装中 INSTALL_FAILED 服务安装失败 INSTALLED 服务已安装 STARTING 服务启动中 STARTED 服务已启动 STOPPING 服务停止中 UNINSTALLING 服务卸载中 UNINSTALLED 服务已卸载 WIPING_OUT 已安装服务清除中 UPGRADING 服务升级中 MAINTENANCE 服务处于维护状态 UNKNOWN 无法确定服务状态
curl -u 'admin:xxxx' http://<ip or hostname>:<port>/api/v1/clusters/{$cluster_name}/services/{$service_name}/alerts 或 curl -u 'admin:xxxx' http://<ip or hostname>:<port>/api/v1/clusters/{$cluster_name}/services/{$service_name}?fields=alerts "Alert" : { "cluster_name" : "xxxxxx-xxxx", "create_time" : null, "create_user" : null, "definition_id" : 34, "definition_name" : "yarn_nodemanager_webui", "host_name" : "core-xxxx", "id" : 62, "service_name" : "YARN" } # 获取告警详细信息 curl -u 'admin:xxxx' http://<ip or hostname>:<port>/api/v1/clusters/{$cluster_name}/services/{$service_name}/alerts/{$id}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。