Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

openshift-rest-client

Package Overview
Dependencies
Maintainers
4
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

openshift-rest-client

Node.js client for developing with OpenShift

  • 1.6.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.8K
decreased by-81.43%
Maintainers
4
Weekly downloads
 
Created
Source

Build Status Coverage Status

Openshift Client

Greenkeeper badge

Node.js based client for the Openshift REST API, not unlike the Fabric8 Maven Plugin, but for node clients/builds.

Basic Usage

npm install --save openshift-rest-client

Code:

const openshiftRestClient = require('openshift-rest-client');

openshiftRestClient().then((client) => {
  // Use the client object to find a list of projects, for example
  client.projects.findAll().then((projects) => {
    console.log(projects);
  });
});

Advanced Usage

By default, the openshift-rest-client will use the openshift-config-loader module to get your openshift configuration.

You can pass in a custom config object by using the settings object

const openshiftRestClient = require('openshift-rest-client');
const settings = {};

const customConfig = {
  apiVersion: 'v1',
  context:
  { cluster: '192-168-99-100:8443',
    namespace: 'for-node-client-testing',
    user: 'developer/192-168-99-100:8443' },
  user: { token: 'zVBd1ZFeJqEAILJgimm4-gZJauaw3PW4EVqV_peEZ3U' },
  cluster: 'https://192.168.99.100:8443' }
};

settings.config = customConfig;

openshiftRestClient(settings).then((client) => {
  // Use the client object to find a list of projects, for example
  client.projects.findAll().then((projects) => {
    console.log(projects);
  });
});

If you don't have an OpenShift access token, you can use basic authentication by providing username and password as follows:

const openshiftRestClient = require('openshift-rest-client');
const settings = {};

const customConfig = {
  apiVersion: 'v1',
  context:
  { cluster: '192-168-99-100:8443',
    namespace: 'for-node-client-testing',
    user: 'developer/192-168-99-100:8443' },
  user: { 
    username: yourUsername,
    password: youPassword 
  },
  cluster: 'https://192.168.99.100:8443' }
};

settings.config = customConfig;

openshiftRestClient(settings).then((client) => {
  // Use the client object to find a list of projects, for example
  client.projects.findAll().then((projects) => {
    console.log(projects);
  });
});

Keywords

FAQs

Package last updated on 15 Jan 2019

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc