Skip to content

Instantly share code, notes, and snippets.

@loganmzz
Last active April 1, 2020 08:44
Show Gist options
  • Save loganmzz/fe531085a67b4a4086195a17800626e9 to your computer and use it in GitHub Desktop.
Save loganmzz/fe531085a67b4a4086195a17800626e9 to your computer and use it in GitHub Desktop.
OVH API - Node.js - POST /cloud/project/<project>/kube
const projectid = process.argv[1];
const clustername = process.argv[2];
const region = process.argv[3];
var ovh = require('ovh')({
endpoint: 'ovh-eu',
appKey: process.env.OVH_APP_KEY,
appSecret: process.env.OVH_APP_SECRET,
consumerKey: process.env.OVH_CONSUMER_KEY,
});
ovh.request(
'POST', `/cloud/project/${projectid}/kube`,
{
name: clustername,
region,
version: "1.17"
},
function(error, credential) {
console.log(error || credential);
}
);
{
"name": "loganmzz-ovh-api",
"private": true,
"version": "1.0.0",
"description": "Call OVH API",
"main": "index.js",
"scripts": {},
"keywords": [],
"author": "LoganMzz",
"license": "ISC",
"dependencies": {
"ovh": "^2.0.3"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment