portainer-api-client

Node.JS client for interacting with the Portainer HTTP API

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
portainer-api-client
000.0.24 years ago4 years agoMinified + gzip package size for portainer-api-client in KB

Readme

Portainer API Client

Example: Update a registry's password

const PortainerClient = require('portainer-api-client');
const portainerUrl = process.env.PORTAINER_URL;
const portainerUsername = process.env.PORTAINER_USERNAME;
const portainerPassword = process.env.PORTAINER_PASSWORD;
const portainer = new PortainerClient(portainerUrl, portainerUsername, portainerPassword);
let registries = await portainer.callApiWithKey('get', '/api/registries');
registry = registries[0]
registry.Username = 'newusername';
registry.Password = 'newusername';

await portainer.callApiWithKey('PUT', '/api/registries/' + registry.Id, registry);

TODOs

  • Convenience functions
  • Documentation