Socket
Socket
Sign inDemoInstall

cadvisor-api

Package Overview
Dependencies
2
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

cadvisor-api


Version published
Maintainers
1
Created

Readme

Source

Cadvisor API Client

Build Status Coverage Status

It's easy to use HTTP Client for any version of Cadvisor API (default : 1.3)

Cadvisor Api Client using :

Usage

Cadvisor Api Parameters

  • hostname (ex. localhost)
  • port (ex. 8080)
  • requestTimeout amount of time to wait for the request to finish
  • connectTimeout amount of time to wait for a socket
  • retry options to provide to node-retry;"false" disables retry; defaults to 4 retries
  • log bunyan instance
  • headers HTTP headers to set in all requests
  • dtrace node-dtrace-provider handle
  • userAgent user-agent string to use

Get Cadvisor Machine Info

const cadvisor = require('cadvisor-api')();

cadvisor.getMachineInfo().then(function(machineInfo){
    // ...show or parse your data
}).catch(function(exceptionData){
   // ...show or parse error
});

or

const cadvisor = require('cadvisor-api')({
    hostname:'localhost',
    port:8080,
    requestTimeout: 1000,
    connectTimeout: 1000,
});

cadvisor.getMachineInfo().then(function(machineInfo){
    // ...show or parse your data
}).catch(function(exceptionData){
   // ...show or parse error
});

Get Cadvisor Container Info

const cadvisor = require('cadvisor-api')();

cadvisor.getContainerInfo().then(function(machineInfo){
    // ...show or parse your data
}).catch(function(exceptionData){
   // ...show or parse error
});

or

const cadvisor = require('cadvisor-api')();

cadvisor.getContainerInfo('data-container').then(function(machineInfo){
    // ...show or parse your data
}).catch(function(exceptionData){
   // ...show or parse error
});

Get Cadvisor SubContainer Info

const cadvisor = require('cadvisor-api')();

cadvisor.getSubContainerInfo().then(function(machineInfo){
    // ...show or parse your data
}).catch(function(exceptionData){
   // ...show or parse error
});

or

const cadvisor = require('cadvisor-api')();

cadvisor.getSubContainerInfo('data-subcontainer').then(function(machineInfo){
    // ...show or parse your data
}).catch(function(exceptionData){
   // ...show or parse error
});

Get Cadvisor Docker Info

const cadvisor = require('cadvisor-api')();

cadvisor.getDockerInfo().then(function(machineInfo){
    // ...show or parse your data
}).catch(function(exceptionData){
   // ...show or parse error
});

or

const cadvisor = require('cadvisor-api')();

cadvisor.getDockerInfo('cadvisor').then(function(machineInfo){
    // ...show or parse your data
}).catch(function(exceptionData){
   // ...show or parse error
});

Keywords

FAQs

Last updated on 19 Mar 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc