Last active
April 1, 2020 08:44
-
-
Save loganmzz/fe531085a67b4a4086195a17800626e9 to your computer and use it in GitHub Desktop.
OVH API - Node.js - POST /cloud/project/<project>/kube
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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