cAdvisor REST API 테스트 :: 행복한 프로그래머

posted by 쁘로그램어 2018. 5. 16. 17:06

cAdvisor를 설치하고 REST API를 테스트해보았다.

aAvsisor 깃허브 문서를 참고하였다.


# cAdvisor 원격 REST API

https://github.com/google/cadvisor/blob/master/docs/api.md

https://github.com/google/cadvisor/blob/master/docs/api_v2.md


아래는 REST API를 테스트했던 내용이다.

참고로 curl 명령을 아래와 같이 사용하면 json을 이쁘게? 표시할수 있다.

$ curl http://localhost:11608/api/v1.0/containers | python -m json.tool

$ curl http://localhost:11608/api/v1.0/containers | jq ''


# cAdvisor 버전, 엔트리 포인트 정보

$ curl http://localhost:11608/api/v1.0

$ curl http://localhost:11608/api/v1.2

$ curl http://localhost:11608/api/v1.3

$ curl http://localhost:11608/api/v2.0


# 컨테이너 정보

$ curl http://localhost:11608/api/v1.0/containers

$ curl http://localhost:11608/api/v1.0/containers?name=musing_hodgkin

$ curl http://localhost:11608/api/v1.0/containers?id=f72e8904d5b18d560748fc29df8bcfdaf46b5f31299a197283d


# 하위컨테이너 정보

$ curl http://localhost:11608/api/v1.3/subcontainers

$ curl http://localhost:11608/api/v1.3/subcontainers?name=musing_hodgkin

$ curl http://localhost:11608/api/v1.3/subcontainers?id=f72e8904d5b18d560748fc29df8bcfdaf46b5f31299a197283d


# 하드웨어 및 소프트웨어 속성

$ curl http://localhost:11608/api/v2.0/attributes

$ curl http://localhost:11608/api/v2.0/attributes?name=musing_hodgkin

$ curl http://localhost:11608/api/v2.0/attributes?id=f72e8904d5b18d560748fc29df8bcfdaf46b5f31299a197283d


# 컨테이너 통계 조회

$ curl http://localhost:11608/api/v2.0/stats/havenAgent?type=docker

$ curl http://localhost:11608/api/v2.0/stats?name=musing_hodgkin

$ curl http://localhost:11608/api/v2.0/stats?id=f72e8904d5b18d560748fc29df8bcfdaf46b5f31299a197283d


# 컨테이너 통계 요약

$ curl http://localhost:11608/api/v2.0/summary

$ curl http://localhost:11608/api/v2.0/summary?name=musing_hodgkin

$ curl http://localhost:11608/api/v2.0/summary?id=f72e8904d5b18d560748fc29df8bcfdaf46b5f31299a197283d


# 컨테이너 스펙

$ curl http://localhost:11608/api/v2.0/spec

$ curl http://localhost:11608/api/v2.0/spec?name=musing_hodgkin

$ curl http://localhost:11608/api/v2.0/spec?id=f72e8904d5b18d560748fc29df8bcfdaf46b5f31299a197283d


'관심 기술 > docker' 카테고리의 다른 글

Docker Engine API 정리  (0) 2018.05.22
docker, Dockerfile cheat sheet  (0) 2018.05.17
aAdvisor 설치: 컨테이너 모니터링  (0) 2018.05.16
Ubuntu에서 docker-ce 설치  (0) 2018.05.16
docker ecosystem 정리 자료  (0) 2018.05.10